@famibee/skynovel 2.0.1 → 2.0.2
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/dist/RubySpliter.js +2 -2
- package/dist/RubySpliter.js.map +1 -1
- package/dist/sn/RubySpliter.d.ts.map +1 -1
- package/dist_app/RubySpliter.js +2 -2
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/appMain.js +2 -2
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/sn/RubySpliter.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/RubySpliter.js
CHANGED
|
@@ -15,11 +15,11 @@ var RubySpliter = class e {
|
|
|
15
15
|
}
|
|
16
16
|
static #n;
|
|
17
17
|
static setEscape(t) {
|
|
18
|
-
e.#n = RegExp((t ? `(?<ce>\\${t}\\S)|` : "") +
|
|
18
|
+
e.#n = RegExp((t ? `(?<ce>\\${t}\\S)|` : "") + e.#r, "gs");
|
|
19
19
|
}
|
|
20
|
+
static #r = "|(?<str>[^《\\n]+)《(?<ruby>[^》\\n]+)》|(?:(?<kan>[⺀-々〇〻㐀-鿿豈-]+[ぁ-ヿ]*|[^ |《》\\n])《(?<kan_ruby>[^》\\n]+)》)|(?<txt>[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^|《》]+?|.)";
|
|
20
21
|
putTxt(t) {
|
|
21
22
|
for (let { groups: n } of t.matchAll(e.#n)) {
|
|
22
|
-
if (!n) break;
|
|
23
23
|
let { ruby: e, kan_ruby: t, kan: r = "", ce: i, txt: a = "", str: o = "" } = n;
|
|
24
24
|
if (e) {
|
|
25
25
|
this.putTxtRb(decodeURIComponent(o), e);
|
package/dist/RubySpliter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RubySpliter.js","names":["#sesame","#putCh","#REG_RUBY","a: string[]"],"sources":["../src/sn/RubySpliter.ts"],"sourcesContent":["/*
|
|
1
|
+
{"version":3,"file":"RubySpliter.js","names":["#sesame","#putCh","#REG_RUBY","#REGTXT_RUBY_BASE","a: string[]"],"sources":["../src/sn/RubySpliter.ts"],"sourcesContent":["/* ***** BEGIN LICENSE BLOCK *****\n\tCopyright (c) 2018-2025 Famibee (famibee.blog38.fc2.com)\n\n\tThis software is released under the MIT License.\n\thttp://opensource.org/licenses/mit-license.php\n** ***** END LICENSE BLOCK ***** */\n\nimport type {TArg} from './Grammar';\nimport type {T_PutCh} from './CmnInterface';\n\nexport type IAutoPage = (idx: number, str: string) => void;\n\n\nexport class RubySpliter {\n\tstatic\t#sesame\t\t= 'ヽ';\n\tstatic\tsetting(hArg: TArg) {if (hArg.sesame) RubySpliter.#sesame = hArg.sesame}\n\tstatic\tgetSesame() {return RubySpliter.#sesame}\n\n\tstatic\tdestroy() {RubySpliter.#sesame = 'ヽ'}\n\n\t#putCh\t: T_PutCh\t= ()=> { /* empty */ };\n\tinit(putCh: T_PutCh) {this.#putCh = putCh}\n\n/*\n\t\t★Unicodeで「漢字」の正規表現 – ものかの http://tama-san.com/kanji-regex/\n\t\t2E80..2FDF\tCJK部首補助+康熙部首\n\t\t3005\t\t々(漢字の踊り字)\n\t\t3007\t\t〇(漢数字のゼロ)\n\t\t303B\t\t〻(漢字の踊り字)\n\t\t3400..4DBF\t\tCJK統合漢字拡張A\n\t\t4E00..9FFF\t\tCJK統合漢字\n\t\tF900..FAFF\t\tCJK互換漢字\n\t\t20000..2FFFF\tCJK統合漢字拡張B〜F+CJK互換漢字追加+念のためU+2FFFFまで\n\n\t\t[\\x{2E80}-\\x{2FDF}々〇〻\\x{3400}-\\x{4DBF}\\x{4E00}-\\x{9FFF}\\x{F900}-\\x{FAFF}\\x{20000}-\\x{2FFFF}]\n\t\t[\\u2E80-\\u2FDF々〇〻\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u20000-\\u2FFFF]\n\t\t[⺀-々〇〻㐀-䶿一-鿿豈-\\u20000-\\u2FFFF]\t\t// 含まれない文字がある\n\t\t[⺀-々〇〻㐀-鿿豈-\\u20000-\\u2FFFF]\t\t\t// ヽ--30FD が変に引っかかる。多分\\u2000-\\u2FFF解釈\n\t\t\\\\u{20000}-\\\\u{2FFFF}\t// 五桁だとエラー\n\n\t\t【2022/10/03】ruby正規表現のUnicode プロパティ(とPOSIX文字クラス) - Qiita https://qiita.com/Takayuki_Nakano/items/8d38beaddb84b488d683\n\t\t\t> このHiraganaプロパティ、長音記号は含まれていません。\n\t\t\t> \\p{Han}…簡体字や繁体字、韓国語の漢字…ベトナム語の漢字にもマッチ\n\n\t\t・Unicode文字一覧表 - instant tools https://tools.m-bsys.com/ex/unicode_table.php\n*/\n\tstatic\t#REG_RUBY\t: RegExp;\n\tstatic\tsetEscape(ce: string) {\n\t\t// 830 match 11293 step(1.7ms) PCRE2 https://regex101.com/r/BBrQtC/1\n\t\t// (new RegExp(\"~\")) の場合は、バックスラッシュは2つ必要\n\t\tRubySpliter.#REG_RUBY = new RegExp(\n\t\t\t(ce ?`(?<ce>\\\\${ce}\\\\S)|` :'') +\n\t\t\tRubySpliter.#REGTXT_RUBY_BASE, 'gs'\n\t\t);\n\t}\n\tstatic\treadonly\t#REGTXT_RUBY_BASE =\n\t\t'|(?<str>[^《\\\\n]+)《(?<ruby>[^》\\\\n]+)》'+\n\t\t'|(?:(?<kan>[⺀-々〇〻㐀-鿿豈-]+[ぁ-ヿ]*|[^ |《》\\\\n])'+\n\t\t'《(?<kan_ruby>[^》\\\\n]+)》)'+\n\t\t'|(?<txt>'+\n\t\t'[\\\\uD800-\\\\uDBFF][\\\\uDC00-\\\\uDFFF]'+\t// 上位 + 下位サロゲート\n\t\t'|[^|《》]+?'+\t\t// 不要だが細切れにしないほうが後々効率で有利\n\t\t'|.)';\n\n\tputTxt(text: string) {\n\t\tfor (const {groups} of text.matchAll(RubySpliter.#REG_RUBY)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst {ruby, kan_ruby, kan='', ce, txt='', str=''} = groups!;\n\t\t\tif (ruby) {this.putTxtRb(decodeURIComponent(str), ruby); continue}\n\n\t\t\tif (kan_ruby) {this.putTxtRb(kan, kan_ruby); continue}\n\t\t\tif (ce) {this.#putCh(ce.slice(1), ''); continue}\n\n\t\t\tfor (const v of Array.from(txt)) this.#putCh(v, '');\n\t\t\t\t// txt.split('')や [...txt] はサロゲートペアで問題\n\t\t}\n\t}\n\n\tputTxtRb(text: string, ruby: string) {\t// テスト用にpublic\n\t\t// 自動区切りを行わない(内部的 json文法)\n\t\tif (/^\\w+|{\"/.test(ruby)) {this.#putCh(text, ruby); return}\n\n\t\tconst a: string[] = Array.from(text);\n\t\tconst len = a.length;\n\t\tif (/^\\*.?$/.test(ruby)) {\t// 傍点文法\n\t\t\tconst rb_ses = 'center|'+ (ruby === '*' ?RubySpliter.#sesame :ruby.charAt(1));\n\t\t\tfor (const s of a) this.#putCh(s, rb_ses);\n\t\t\treturn;\n\t\t}\n\n\t\t// 自動区切りを行わない(単漢字など)\n\t\tif (len === 1 || ! ruby.includes(' ')) {\n\t\t\tthis.#putCh(text, decodeURIComponent(ruby));\n\t\t\treturn;\n\t\t}\n\n\t\t// 空白がある場合はユーザが区切りを指定しているものと見なす\n\t\tconst aR = ruby.split(' ');\n\t\tconst lenR = aR.length;\n\t\tconst len_max = lenR > len ?lenR :len;\n\t\tfor (let i=0; i<len_max; ++i) this.#putCh(\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\ti < len ? a[i]! : '',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\ti < lenR ? decodeURIComponent(aR[i]!) : ''\n\t\t);\n\t}\n\n}\n"],"mappings":"AAaA,IAAa,cAAb,MAAa,EAAY;CACxB,QAAA,IAAkB;CAClB,OAAO,QAAQ,GAAY;AAAC,EAAI,EAAK,WAAQ,GAAA,IAAsB,EAAK;;CACxE,OAAO,YAAY;AAAC,SAAO,GAAA;;CAE3B,OAAO,UAAU;AAAC,KAAA,IAAsB;;CAExC,WAAwB;CACxB,KAAK,GAAgB;AAAC,QAAA,IAAc;;CAyBpC,QAAA;CACA,OAAO,UAAU,GAAY;AAG5B,KAAA,IAA4B,QAC1B,IAAI,WAAW,EAAG,SAAQ,MAC3B,GAAA,GAA+B,KAC/B;;CAEF,QAAA,IACC;CAQD,OAAO,GAAc;AACpB,OAAK,IAAM,EAAC,eAAW,EAAK,SAAS,GAAA,EAAsB,EAAE;GAE5D,IAAM,EAAC,SAAM,aAAU,SAAI,IAAI,OAAI,SAAI,IAAI,SAAI,OAAM;AACrD,OAAI,GAAM;AAAC,SAAK,SAAS,mBAAmB,EAAI,EAAE,EAAK;AAAE;;AAEzD,OAAI,GAAU;AAAC,SAAK,SAAS,GAAK,EAAS;AAAE;;AAC7C,OAAI,GAAI;AAAC,UAAA,EAAY,EAAG,MAAM,EAAE,EAAE,GAAG;AAAE;;AAEvC,QAAK,IAAM,KAAK,MAAM,KAAK,EAAI,CAAE,OAAA,EAAY,GAAG,GAAG;;;CAKrD,SAAS,GAAc,GAAc;AAEpC,MAAI,UAAU,KAAK,EAAK,EAAE;AAAC,SAAA,EAAY,GAAM,EAAK;AAAE;;EAEpD,IAAMI,IAAc,MAAM,KAAK,EAAK,EAC9B,IAAM,EAAE;AACd,MAAI,SAAS,KAAK,EAAK,EAAE;GACxB,IAAM,IAAS,aAAY,MAAS,MAAK,GAAA,IAAqB,EAAK,OAAO,EAAE;AAC5E,QAAK,IAAM,KAAK,EAAG,OAAA,EAAY,GAAG,EAAO;AACzC;;AAID,MAAI,MAAQ,KAAK,CAAE,EAAK,SAAS,IAAI,EAAE;AACtC,SAAA,EAAY,GAAM,mBAAmB,EAAK,CAAC;AAC3C;;EAID,IAAM,IAAK,EAAK,MAAM,IAAI,EACpB,IAAO,EAAG,QACV,IAAU,IAAO,IAAK,IAAM;AAClC,OAAK,IAAI,IAAE,GAAG,IAAE,GAAS,EAAE,EAAG,OAAA,EAE7B,IAAI,IAAM,EAAE,KAAM,IAElB,IAAI,IAAO,mBAAmB,EAAG,GAAI,GAAG,GACxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RubySpliter.d.ts","sourceRoot":"","sources":["../../../src/sn/RubySpliter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RubySpliter.d.ts","sourceRoot":"","sources":["../../../src/sn/RubySpliter.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAG3D,qBAAa,WAAW;;IAEvB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI;IACzB,MAAM,CAAC,SAAS;IAEhB,MAAM,CAAC,OAAO;IAGd,IAAI,CAAC,KAAK,EAAE,OAAO;IA0BnB,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM;IAiB3B,MAAM,CAAC,IAAI,EAAE,MAAM;IAcnB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CA8BnC"}
|
package/dist_app/RubySpliter.js
CHANGED
|
@@ -15,11 +15,11 @@ var RubySpliter = class e {
|
|
|
15
15
|
}
|
|
16
16
|
static #n;
|
|
17
17
|
static setEscape(t) {
|
|
18
|
-
e.#n = RegExp((t ? `(?<ce>\\${t}\\S)|` : "") +
|
|
18
|
+
e.#n = RegExp((t ? `(?<ce>\\${t}\\S)|` : "") + e.#r, "gs");
|
|
19
19
|
}
|
|
20
|
+
static #r = "|(?<str>[^《\\n]+)《(?<ruby>[^》\\n]+)》|(?:(?<kan>[⺀-々〇〻㐀-鿿豈-]+[ぁ-ヿ]*|[^ |《》\\n])《(?<kan_ruby>[^》\\n]+)》)|(?<txt>[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^|《》]+?|.)";
|
|
20
21
|
putTxt(t) {
|
|
21
22
|
for (let { groups: n } of t.matchAll(e.#n)) {
|
|
22
|
-
if (!n) break;
|
|
23
23
|
let { ruby: e, kan_ruby: t, kan: r = "", ce: i, txt: a = "", str: o = "" } = n;
|
|
24
24
|
if (e) {
|
|
25
25
|
this.putTxtRb(decodeURIComponent(o), e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RubySpliter.js","names":["#sesame","#putCh","#REG_RUBY","a: string[]"],"sources":["../src/sn/RubySpliter.ts"],"sourcesContent":["/*
|
|
1
|
+
{"version":3,"file":"RubySpliter.js","names":["#sesame","#putCh","#REG_RUBY","#REGTXT_RUBY_BASE","a: string[]"],"sources":["../src/sn/RubySpliter.ts"],"sourcesContent":["/* ***** BEGIN LICENSE BLOCK *****\n\tCopyright (c) 2018-2025 Famibee (famibee.blog38.fc2.com)\n\n\tThis software is released under the MIT License.\n\thttp://opensource.org/licenses/mit-license.php\n** ***** END LICENSE BLOCK ***** */\n\nimport type {TArg} from './Grammar';\nimport type {T_PutCh} from './CmnInterface';\n\nexport type IAutoPage = (idx: number, str: string) => void;\n\n\nexport class RubySpliter {\n\tstatic\t#sesame\t\t= 'ヽ';\n\tstatic\tsetting(hArg: TArg) {if (hArg.sesame) RubySpliter.#sesame = hArg.sesame}\n\tstatic\tgetSesame() {return RubySpliter.#sesame}\n\n\tstatic\tdestroy() {RubySpliter.#sesame = 'ヽ'}\n\n\t#putCh\t: T_PutCh\t= ()=> { /* empty */ };\n\tinit(putCh: T_PutCh) {this.#putCh = putCh}\n\n/*\n\t\t★Unicodeで「漢字」の正規表現 – ものかの http://tama-san.com/kanji-regex/\n\t\t2E80..2FDF\tCJK部首補助+康熙部首\n\t\t3005\t\t々(漢字の踊り字)\n\t\t3007\t\t〇(漢数字のゼロ)\n\t\t303B\t\t〻(漢字の踊り字)\n\t\t3400..4DBF\t\tCJK統合漢字拡張A\n\t\t4E00..9FFF\t\tCJK統合漢字\n\t\tF900..FAFF\t\tCJK互換漢字\n\t\t20000..2FFFF\tCJK統合漢字拡張B〜F+CJK互換漢字追加+念のためU+2FFFFまで\n\n\t\t[\\x{2E80}-\\x{2FDF}々〇〻\\x{3400}-\\x{4DBF}\\x{4E00}-\\x{9FFF}\\x{F900}-\\x{FAFF}\\x{20000}-\\x{2FFFF}]\n\t\t[\\u2E80-\\u2FDF々〇〻\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFAFF\\u20000-\\u2FFFF]\n\t\t[⺀-々〇〻㐀-䶿一-鿿豈-\\u20000-\\u2FFFF]\t\t// 含まれない文字がある\n\t\t[⺀-々〇〻㐀-鿿豈-\\u20000-\\u2FFFF]\t\t\t// ヽ--30FD が変に引っかかる。多分\\u2000-\\u2FFF解釈\n\t\t\\\\u{20000}-\\\\u{2FFFF}\t// 五桁だとエラー\n\n\t\t【2022/10/03】ruby正規表現のUnicode プロパティ(とPOSIX文字クラス) - Qiita https://qiita.com/Takayuki_Nakano/items/8d38beaddb84b488d683\n\t\t\t> このHiraganaプロパティ、長音記号は含まれていません。\n\t\t\t> \\p{Han}…簡体字や繁体字、韓国語の漢字…ベトナム語の漢字にもマッチ\n\n\t\t・Unicode文字一覧表 - instant tools https://tools.m-bsys.com/ex/unicode_table.php\n*/\n\tstatic\t#REG_RUBY\t: RegExp;\n\tstatic\tsetEscape(ce: string) {\n\t\t// 830 match 11293 step(1.7ms) PCRE2 https://regex101.com/r/BBrQtC/1\n\t\t// (new RegExp(\"~\")) の場合は、バックスラッシュは2つ必要\n\t\tRubySpliter.#REG_RUBY = new RegExp(\n\t\t\t(ce ?`(?<ce>\\\\${ce}\\\\S)|` :'') +\n\t\t\tRubySpliter.#REGTXT_RUBY_BASE, 'gs'\n\t\t);\n\t}\n\tstatic\treadonly\t#REGTXT_RUBY_BASE =\n\t\t'|(?<str>[^《\\\\n]+)《(?<ruby>[^》\\\\n]+)》'+\n\t\t'|(?:(?<kan>[⺀-々〇〻㐀-鿿豈-]+[ぁ-ヿ]*|[^ |《》\\\\n])'+\n\t\t'《(?<kan_ruby>[^》\\\\n]+)》)'+\n\t\t'|(?<txt>'+\n\t\t'[\\\\uD800-\\\\uDBFF][\\\\uDC00-\\\\uDFFF]'+\t// 上位 + 下位サロゲート\n\t\t'|[^|《》]+?'+\t\t// 不要だが細切れにしないほうが後々効率で有利\n\t\t'|.)';\n\n\tputTxt(text: string) {\n\t\tfor (const {groups} of text.matchAll(RubySpliter.#REG_RUBY)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst {ruby, kan_ruby, kan='', ce, txt='', str=''} = groups!;\n\t\t\tif (ruby) {this.putTxtRb(decodeURIComponent(str), ruby); continue}\n\n\t\t\tif (kan_ruby) {this.putTxtRb(kan, kan_ruby); continue}\n\t\t\tif (ce) {this.#putCh(ce.slice(1), ''); continue}\n\n\t\t\tfor (const v of Array.from(txt)) this.#putCh(v, '');\n\t\t\t\t// txt.split('')や [...txt] はサロゲートペアで問題\n\t\t}\n\t}\n\n\tputTxtRb(text: string, ruby: string) {\t// テスト用にpublic\n\t\t// 自動区切りを行わない(内部的 json文法)\n\t\tif (/^\\w+|{\"/.test(ruby)) {this.#putCh(text, ruby); return}\n\n\t\tconst a: string[] = Array.from(text);\n\t\tconst len = a.length;\n\t\tif (/^\\*.?$/.test(ruby)) {\t// 傍点文法\n\t\t\tconst rb_ses = 'center|'+ (ruby === '*' ?RubySpliter.#sesame :ruby.charAt(1));\n\t\t\tfor (const s of a) this.#putCh(s, rb_ses);\n\t\t\treturn;\n\t\t}\n\n\t\t// 自動区切りを行わない(単漢字など)\n\t\tif (len === 1 || ! ruby.includes(' ')) {\n\t\t\tthis.#putCh(text, decodeURIComponent(ruby));\n\t\t\treturn;\n\t\t}\n\n\t\t// 空白がある場合はユーザが区切りを指定しているものと見なす\n\t\tconst aR = ruby.split(' ');\n\t\tconst lenR = aR.length;\n\t\tconst len_max = lenR > len ?lenR :len;\n\t\tfor (let i=0; i<len_max; ++i) this.#putCh(\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\ti < len ? a[i]! : '',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\ti < lenR ? decodeURIComponent(aR[i]!) : ''\n\t\t);\n\t}\n\n}\n"],"mappings":"AAaA,IAAa,cAAb,MAAa,EAAY;CACxB,QAAA,IAAkB;CAClB,OAAO,QAAQ,GAAY;AAAC,EAAI,EAAK,WAAQ,GAAA,IAAsB,EAAK;;CACxE,OAAO,YAAY;AAAC,SAAO,GAAA;;CAE3B,OAAO,UAAU;AAAC,KAAA,IAAsB;;CAExC,WAAwB;CACxB,KAAK,GAAgB;AAAC,QAAA,IAAc;;CAyBpC,QAAA;CACA,OAAO,UAAU,GAAY;AAG5B,KAAA,IAA4B,QAC1B,IAAI,WAAW,EAAG,SAAQ,MAC3B,GAAA,GAA+B,KAC/B;;CAEF,QAAA,IACC;CAQD,OAAO,GAAc;AACpB,OAAK,IAAM,EAAC,eAAW,EAAK,SAAS,GAAA,EAAsB,EAAE;GAE5D,IAAM,EAAC,SAAM,aAAU,SAAI,IAAI,OAAI,SAAI,IAAI,SAAI,OAAM;AACrD,OAAI,GAAM;AAAC,SAAK,SAAS,mBAAmB,EAAI,EAAE,EAAK;AAAE;;AAEzD,OAAI,GAAU;AAAC,SAAK,SAAS,GAAK,EAAS;AAAE;;AAC7C,OAAI,GAAI;AAAC,UAAA,EAAY,EAAG,MAAM,EAAE,EAAE,GAAG;AAAE;;AAEvC,QAAK,IAAM,KAAK,MAAM,KAAK,EAAI,CAAE,OAAA,EAAY,GAAG,GAAG;;;CAKrD,SAAS,GAAc,GAAc;AAEpC,MAAI,UAAU,KAAK,EAAK,EAAE;AAAC,SAAA,EAAY,GAAM,EAAK;AAAE;;EAEpD,IAAMI,IAAc,MAAM,KAAK,EAAK,EAC9B,IAAM,EAAE;AACd,MAAI,SAAS,KAAK,EAAK,EAAE;GACxB,IAAM,IAAS,aAAY,MAAS,MAAK,GAAA,IAAqB,EAAK,OAAO,EAAE;AAC5E,QAAK,IAAM,KAAK,EAAG,OAAA,EAAY,GAAG,EAAO;AACzC;;AAID,MAAI,MAAQ,KAAK,CAAE,EAAK,SAAS,IAAI,EAAE;AACtC,SAAA,EAAY,GAAM,mBAAmB,EAAK,CAAC;AAC3C;;EAID,IAAM,IAAK,EAAK,MAAM,IAAI,EACpB,IAAO,EAAG,QACV,IAAU,IAAO,IAAK,IAAM;AAClC,OAAK,IAAI,IAAE,GAAG,IAAE,GAAS,EAAE,EAAG,OAAA,EAE7B,IAAI,IAAM,EAAE,KAAM,IAElB,IAAI,IAAO,mBAAmB,EAAG,GAAI,GAAG,GACxC"}
|
package/dist_app/appMain.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&&t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);let f=require(`electron`);f=u(f);let p=require(`node:process`);p=u(p);let m=require(`node:path`);m=u(m);let h=require(`node:util`),g=require(`node:fs`);g=u(g);let _=require(`node:crypto`);_=u(_);let v=require(`node:assert`);v=u(v);let y=require(`node:os`);y=u(y),require(`node:events`),require(`node:stream`);var b=s((e=>{e.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==`function`)e.apply(this,t);else return new Promise((n,r)=>{t.push((e,t)=>e==null?n(t):r(e)),e.apply(this,t)})},`name`,{value:e.name})},e.fromPromise=function(e){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!=`function`)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},`name`,{value:e.name})}})),x=s(((e,t)=>{var n=require(`constants`),r=process.cwd,i=null,a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||=r.call(process),i};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var o=process.chdir;process.chdir=function(e){i=null,o.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,o)}t.exports=s;function s(e){n.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),a===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){if(t){i&&i(t);return}e.fchmod(n,r,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),a=!0,o;try{o=e.fchmodSync(i,r),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function r(e){n.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,r,i,a){e.open(t,n.O_SYMLINK,function(t,n){if(t){a&&a(t);return}e.futimes(n,r,i,function(t){e.close(n,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,r,i){var a=e.openSync(t,n.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,r,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function o(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),S=s(((e,t)=>{var n=require(`stream`).Stream;t.exports=r;function r(e){return{ReadStream:t,WriteStream:r};function t(r,i){if(!(this instanceof t))return new t(r,i);n.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,i||={};for(var o=Object.keys(i),s=0,c=o.length;s<c;s++){var l=o[s];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.end===void 0)this.end=1/0;else if(typeof this.end!=`number`)throw TypeError(`end must be a Number`);if(this.start>this.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function r(t,i){if(!(this instanceof r))return new r(t,i);n.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i||={};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var c=a[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.start<0)throw Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),C=s(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),w=s(((e,t)=>{var n=require(`fs`),r=x(),i=S(),a=C(),o=require(`util`),s,c;typeof Symbol==`function`&&typeof Symbol.for==`function`?(s=Symbol.for(`graceful-fs.queue`),c=Symbol.for(`graceful-fs.previous`)):(s=`___graceful-fs.queue`,c=`___graceful-fs.previous`);function l(){}function u(e,t){Object.defineProperty(e,s,{get:function(){return t}})}var d=l;o.debuglog?d=o.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(d=function(){var e=o.format.apply(o,arguments);e=`GFS4: `+e.split(/\n/).join(`
|
|
2
2
|
GFS4: `),console.error(e)}),n[s]||(u(n,global[s]||[]),n.close=(function(e){function t(t,r){return e.call(n,t,function(e){e||h(),typeof r==`function`&&r.apply(this,arguments)})}return Object.defineProperty(t,c,{value:e}),t})(n.close),n.closeSync=(function(e){function t(t){e.apply(n,arguments),h()}return Object.defineProperty(t,c,{value:e}),t})(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){d(n[s]),require(`assert`).equal(n[s].length,0)})),global[s]||u(global,n[s]),t.exports=f(a(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(t.exports=f(n),n.__patched=!0);function f(e){r(e),e.gracefulify=f,e.createReadStream=T,e.createWriteStream=E;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?p([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var a=e.writeFile;e.writeFile=o;function o(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,o){return a(e,t,n,function(a){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([i,[e,t,n,r],a,o||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var m=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=m.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?p([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=i(e);x=g.ReadStream,C=g.WriteStream}var _=e.ReadStream;_&&(x.prototype=Object.create(_.prototype),x.prototype.open=S);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=w),Object.defineProperty(e,`ReadStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return C},set:function(e){C=e},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(e,`FileReadStream`,{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(e,`FileWriteStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});function x(e,t){return this instanceof x?(_.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var e=this;O(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function C(e,t){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function w(){var e=this;O(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function T(t,n){return new e.ReadStream(t,n)}function E(t,n){return new e.WriteStream(t,n)}var D=e.open;e.open=O;function O(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return D(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?p([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function p(e){d(`ENQUEUE`,e[0].name,e[1]),n[s].push(e),g()}var m;function h(){for(var e=Date.now(),t=0;t<n[s].length;++t)n[s][t].length>2&&(n[s][t][3]=e,n[s][t][4]=e);g()}function g(){if(clearTimeout(m),m=void 0,n[s].length!==0){var e=n[s].shift(),t=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)d(`RETRY`,t.name,r),t.apply(null,r);else if(Date.now()-a>=6e4){d(`TIMEOUT`,t.name,r);var c=r.pop();typeof c==`function`&&c.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(d(`RETRY`,t.name,r),t.apply(null,r.concat([a]))):n[s].push(e)}m===void 0&&(m=setTimeout(g,0))}}})),T=s((e=>{var t=b().fromCallback,n=w(),r=`access.appendFile.chmod.chown.close.copyFile.cp.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.glob.lchmod.lchown.lutimes.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.statfs.symlink.truncate.unlink.utimes.writeFile`.split(`.`).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),E=s(((e,t)=>{var n=require(`path`);t.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(n.parse(e).root,``))){let t=Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),D=s(((e,t)=>{var n=T(),{checkPath:r}=E(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),O=s(((e,t)=>{var n=b().fromPromise,{makeDir:r,makeDirSync:i}=D(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),k=s(((e,t)=>{var n=b().fromPromise,r=T();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),A=s(((e,t)=>{var n=T(),r=b().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),j=s(((e,t)=>{var n=T(),r=require(`path`),i=b().fromPromise;function a(e,t,r){let i=r.dereference?e=>n.stat(e,{bigint:!0}):e=>n.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function o(e,t,r){let i,a=r.dereference?e=>n.statSync(e,{bigint:!0}):e=>n.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function s(e,t,n,i){let{srcStat:o,destStat:s}=await a(e,t,i);if(s){if(d(o,s)){let i=r.basename(e),a=r.basename(t);if(n===`move`&&i!==a&&i.toLowerCase()===a.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(o.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!o.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(o.isDirectory()&&f(e,t))throw Error(p(e,t,n));return{srcStat:o,destStat:s}}function c(e,t,n,i){let{srcStat:a,destStat:s}=o(e,t,i);if(s){if(d(a,s)){let i=r.basename(e),o=r.basename(t);if(n===`move`&&i!==o&&i.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&f(e,t))throw Error(p(e,t,n));return{srcStat:a,destStat:s}}async function l(e,t,i,a){let o=r.resolve(r.dirname(e)),s=r.resolve(r.dirname(i));if(s===o||s===r.parse(s).root)return;let c;try{c=await n.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(d(t,c))throw Error(p(e,i,a));return l(e,t,s,a)}function u(e,t,i,a){let o=r.resolve(r.dirname(e)),s=r.resolve(r.dirname(i));if(s===o||s===r.parse(s).root)return;let c;try{c=n.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(d(t,c))throw Error(p(e,i,a));return u(e,t,s,a)}function d(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function f(e,t){let n=r.resolve(e).split(r.sep).filter(e=>e),i=r.resolve(t).split(r.sep).filter(e=>e);return n.every((e,t)=>i[t]===e)}function p(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}t.exports={checkPaths:i(s),checkPathsSync:c,checkParentPaths:i(l),checkParentPathsSync:u,isSrcSubdir:f,areIdentical:d}})),M=s(((e,t)=>{async function n(e,t){let n=[];for await(let r of e)n.push(t(r).then(()=>null,e=>e??Error(`unknown error`)));await Promise.all(n.map(e=>e.then(e=>{if(e!==null)throw e})))}t.exports={asyncIteratorConcurrentProcess:n}})),N=s(((e,t)=>{var n=T(),r=require(`path`),{mkdirs:i}=O(),{pathExists:a}=k(),{utimesMillis:o}=A(),s=j(),{asyncIteratorConcurrentProcess:c}=M();async function l(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
3
3
|
|
|
4
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`);let{srcStat:o,destStat:c}=await s.checkPaths(e,t,`copy`,n);if(await s.checkParentPaths(e,o,t,`copy`),!await u(e,t,n))return;let l=r.dirname(t);await a(l)||await i(l),await d(c,e,t,n)}async function u(e,t,n){return n.filter?n.filter(e,t):!0}async function d(e,t,r,i){let a=await(i.dereference?n.stat:n.lstat)(t);if(a.isDirectory())return g(a,e,t,r,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return f(a,e,t,r,i);if(a.isSymbolicLink())return _(e,t,r,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}async function f(e,t,r,i,a){if(!t)return p(e,r,i,a);if(a.overwrite)return await n.unlink(i),p(e,r,i,a);if(a.errorOnExist)throw Error(`'${i}' already exists`)}async function p(e,t,r,i){if(await n.copyFile(t,r),i.preserveTimestamps){m(e.mode)&&await h(r,e.mode);let i=await n.stat(t);await o(r,i.atime,i.mtime)}return n.chmod(r,e.mode)}function m(e){return(e&128)==0}function h(e,t){return n.chmod(e,t|128)}async function g(e,t,i,a,o){t||await n.mkdir(a),await c(await n.opendir(i),async e=>{let t=r.join(i,e.name),n=r.join(a,e.name);if(await u(t,n,o)){let{destStat:e}=await s.checkPaths(t,n,`copy`,o);await d(e,t,n,o)}}),t||await n.chmod(a,e.mode)}async function _(e,t,i,a){let o=await n.readlink(t);if(a.dereference&&(o=r.resolve(process.cwd(),o)),!e)return n.symlink(o,i);let c=null;try{c=await n.readlink(i)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return n.symlink(o,i);throw e}if(a.dereference&&(c=r.resolve(process.cwd(),c)),s.isSrcSubdir(o,c))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`);if(s.isSrcSubdir(c,o))throw Error(`Cannot overwrite '${c}' with '${o}'.`)
|
|
4
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`);let{srcStat:o,destStat:c}=await s.checkPaths(e,t,`copy`,n);if(await s.checkParentPaths(e,o,t,`copy`),!await u(e,t,n))return;let l=r.dirname(t);await a(l)||await i(l),await d(c,e,t,n)}async function u(e,t,n){return n.filter?n.filter(e,t):!0}async function d(e,t,r,i){let a=await(i.dereference?n.stat:n.lstat)(t);if(a.isDirectory())return g(a,e,t,r,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return f(a,e,t,r,i);if(a.isSymbolicLink())return _(e,t,r,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}async function f(e,t,r,i,a){if(!t)return p(e,r,i,a);if(a.overwrite)return await n.unlink(i),p(e,r,i,a);if(a.errorOnExist)throw Error(`'${i}' already exists`)}async function p(e,t,r,i){if(await n.copyFile(t,r),i.preserveTimestamps){m(e.mode)&&await h(r,e.mode);let i=await n.stat(t);await o(r,i.atime,i.mtime)}return n.chmod(r,e.mode)}function m(e){return(e&128)==0}function h(e,t){return n.chmod(e,t|128)}async function g(e,t,i,a,o){t||await n.mkdir(a),await c(await n.opendir(i),async e=>{let t=r.join(i,e.name),n=r.join(a,e.name);if(await u(t,n,o)){let{destStat:e}=await s.checkPaths(t,n,`copy`,o);await d(e,t,n,o)}}),t||await n.chmod(a,e.mode)}async function _(e,t,i,a){let o=await n.readlink(t);if(a.dereference&&(o=r.resolve(process.cwd(),o)),!e)return n.symlink(o,i);let c=null;try{c=await n.readlink(i)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return n.symlink(o,i);throw e}if(a.dereference&&(c=r.resolve(process.cwd(),c)),o!==c){if(s.isSrcSubdir(o,c))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`);if(s.isSrcSubdir(c,o))throw Error(`Cannot overwrite '${c}' with '${o}'.`)}return await n.unlink(i),n.symlink(o,i)}t.exports=l})),P=s(((e,t)=>{var n=w(),r=require(`path`),i=O().mkdirsSync,a=A().utimesMillisSync,o=j();function s(e,t,a){typeof a==`function`&&(a={filter:a}),a||={},a.clobber=`clobber`in a?!!a.clobber:!0,a.overwrite=`overwrite`in a?!!a.overwrite:a.clobber,a.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
5
5
|
|
|
6
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:s,destStat:l}=o.checkPathsSync(e,t,`copy`,a);if(o.checkParentPathsSync(e,s,t,`copy`),a.filter&&!a.filter(e,t))return;let u=r.dirname(t);return n.existsSync(u)||i(u),c(l,e,t,a)}function c(e,t,r,i){let a=(i.dereference?n.statSync:n.lstatSync)(t);if(a.isDirectory())return _(a,e,t,r,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return l(a,e,t,r,i);if(a.isSymbolicLink())return x(e,t,r,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function l(e,t,n,r,i){return t?u(e,n,r,i):d(e,n,r,i)}function u(e,t,r,i){if(i.overwrite)return n.unlinkSync(r),d(e,t,r,i);if(i.errorOnExist)throw Error(`'${r}' already exists`)}function d(e,t,r,i){return n.copyFileSync(t,r),i.preserveTimestamps&&f(e.mode,t,r),h(r,e.mode)}function f(e,t,n){return p(e)&&m(n,e),g(t,n)}function p(e){return(e&128)==0}function m(e,t){return h(e,t|128)}function h(e,t){return n.chmodSync(e,t)}function g(e,t){let r=n.statSync(e);return a(t,r.atime,r.mtime)}function _(e,t,n,r,i){return t?y(n,r,i):v(e.mode,n,r,i)}function v(e,t,r,i){return n.mkdirSync(r),y(t,r,i),h(r,e)}function y(e,t,r){let i=n.opendirSync(e);try{let n;for(;(n=i.readSync())!==null;)b(n.name,e,t,r)}finally{i.closeSync()}}function b(e,t,n,i){let a=r.join(t,e),s=r.join(n,e);if(i.filter&&!i.filter(a,s))return;let{destStat:l}=o.checkPathsSync(a,s,`copy`,i);return c(l,a,s,i)}function x(e,t,i,a){let s=n.readlinkSync(t);if(a.dereference&&(s=r.resolve(process.cwd(),s)),e){let e;try{e=n.readlinkSync(i)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return n.symlinkSync(s,i);throw e}if(a.dereference&&(e=r.resolve(process.cwd(),e)),o.isSrcSubdir(s,e))throw Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`);if(o.isSrcSubdir(e,s))throw Error(`Cannot overwrite '${e}' with '${s}'.`)
|
|
6
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:s,destStat:l}=o.checkPathsSync(e,t,`copy`,a);if(o.checkParentPathsSync(e,s,t,`copy`),a.filter&&!a.filter(e,t))return;let u=r.dirname(t);return n.existsSync(u)||i(u),c(l,e,t,a)}function c(e,t,r,i){let a=(i.dereference?n.statSync:n.lstatSync)(t);if(a.isDirectory())return _(a,e,t,r,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return l(a,e,t,r,i);if(a.isSymbolicLink())return x(e,t,r,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function l(e,t,n,r,i){return t?u(e,n,r,i):d(e,n,r,i)}function u(e,t,r,i){if(i.overwrite)return n.unlinkSync(r),d(e,t,r,i);if(i.errorOnExist)throw Error(`'${r}' already exists`)}function d(e,t,r,i){return n.copyFileSync(t,r),i.preserveTimestamps&&f(e.mode,t,r),h(r,e.mode)}function f(e,t,n){return p(e)&&m(n,e),g(t,n)}function p(e){return(e&128)==0}function m(e,t){return h(e,t|128)}function h(e,t){return n.chmodSync(e,t)}function g(e,t){let r=n.statSync(e);return a(t,r.atime,r.mtime)}function _(e,t,n,r,i){return t?y(n,r,i):v(e.mode,n,r,i)}function v(e,t,r,i){return n.mkdirSync(r),y(t,r,i),h(r,e)}function y(e,t,r){let i=n.opendirSync(e);try{let n;for(;(n=i.readSync())!==null;)b(n.name,e,t,r)}finally{i.closeSync()}}function b(e,t,n,i){let a=r.join(t,e),s=r.join(n,e);if(i.filter&&!i.filter(a,s))return;let{destStat:l}=o.checkPathsSync(a,s,`copy`,i);return c(l,a,s,i)}function x(e,t,i,a){let s=n.readlinkSync(t);if(a.dereference&&(s=r.resolve(process.cwd(),s)),e){let e;try{e=n.readlinkSync(i)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return n.symlinkSync(s,i);throw e}if(a.dereference&&(e=r.resolve(process.cwd(),e)),s!==e){if(o.isSrcSubdir(s,e))throw Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`);if(o.isSrcSubdir(e,s))throw Error(`Cannot overwrite '${e}' with '${s}'.`)}return S(s,i)}else return n.symlinkSync(s,i)}function S(e,t){return n.unlinkSync(t),n.symlinkSync(e,t)}t.exports=s})),F=s(((e,t)=>{var n=b().fromPromise;t.exports={copy:n(N()),copySync:P()}})),I=s(((e,t)=>{var n=w(),r=b().fromCallback;function i(e,t){n.rm(e,{recursive:!0,force:!0},t)}function a(e){n.rmSync(e,{recursive:!0,force:!0})}t.exports={remove:r(i),removeSync:a}})),L=s(((e,t)=>{var n=b().fromPromise,r=T(),i=require(`path`),a=O(),o=I(),s=n(async function(e){let t;try{t=await r.readdir(e)}catch{return a.mkdirs(e)}return Promise.all(t.map(t=>o.remove(i.join(e,t))))});function c(e){let t;try{t=r.readdirSync(e)}catch{return a.mkdirsSync(e)}t.forEach(t=>{t=i.join(e,t),o.removeSync(t)})}t.exports={emptyDirSync:c,emptydirSync:c,emptyDir:s,emptydir:s}})),ee=s(((e,t)=>{var n=b().fromPromise,r=require(`path`),i=T(),a=O();async function o(e){let t;try{t=await i.stat(e)}catch{}if(t&&t.isFile())return;let n=r.dirname(e),o=null;try{o=await i.stat(n)}catch(t){if(t.code===`ENOENT`){await a.mkdirs(n),await i.writeFile(e,``);return}else throw t}o.isDirectory()?await i.writeFile(e,``):await i.readdir(n)}function s(e){let t;try{t=i.statSync(e)}catch{}if(t&&t.isFile())return;let n=r.dirname(e);try{i.statSync(n).isDirectory()||i.readdirSync(n)}catch(e){if(e&&e.code===`ENOENT`)a.mkdirsSync(n);else throw e}i.writeFileSync(e,``)}t.exports={createFile:n(o),createFileSync:s}})),te=s(((e,t)=>{var n=b().fromPromise,r=require(`path`),i=T(),a=O(),{pathExists:o}=k(),{areIdentical:s}=j();async function c(e,t){let n;try{n=await i.lstat(t)}catch{}let c;try{c=await i.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}if(n&&s(c,n))return;let l=r.dirname(t);await o(l)||await a.mkdirs(l),await i.link(e,t)}function l(e,t){let n;try{n=i.lstatSync(t)}catch{}try{let t=i.lstatSync(e);if(n&&s(t,n))return}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}let o=r.dirname(t);return i.existsSync(o)||a.mkdirsSync(o),i.linkSync(e,t)}t.exports={createLink:n(c),createLinkSync:l}})),ne=s(((e,t)=>{var n=require(`path`),r=T(),{pathExists:i}=k(),a=b().fromPromise;async function o(e,t){if(n.isAbsolute(e)){try{await r.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:e}}let a=n.dirname(t),o=n.join(a,e);if(await i(o))return{toCwd:o,toDst:e};try{await r.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:n.relative(a,e)}}function s(e,t){if(n.isAbsolute(e)){if(!r.existsSync(e))throw Error(`absolute srcpath does not exist`);return{toCwd:e,toDst:e}}let i=n.dirname(t),a=n.join(i,e);if(r.existsSync(a))return{toCwd:a,toDst:e};if(!r.existsSync(e))throw Error(`relative srcpath does not exist`);return{toCwd:e,toDst:n.relative(i,e)}}t.exports={symlinkPaths:a(o),symlinkPathsSync:s}})),re=s(((e,t)=>{var n=T(),r=b().fromPromise;async function i(e,t){if(t)return t;let r;try{r=await n.lstat(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}function a(e,t){if(t)return t;let r;try{r=n.lstatSync(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}t.exports={symlinkType:r(i),symlinkTypeSync:a}})),ie=s(((e,t)=>{var n=b().fromPromise,r=require(`path`),i=T(),{mkdirs:a,mkdirsSync:o}=O(),{symlinkPaths:s,symlinkPathsSync:c}=ne(),{symlinkType:l,symlinkTypeSync:u}=re(),{pathExists:d}=k(),{areIdentical:f}=j();async function p(e,t,n){let o;try{o=await i.lstat(t)}catch{}if(o&&o.isSymbolicLink()){let[n,r]=await Promise.all([i.stat(e),i.stat(t)]);if(f(n,r))return}let c=await s(e,t);e=c.toDst;let u=await l(c.toCwd,n),p=r.dirname(t);return await d(p)||await a(p),i.symlink(e,t,u)}function m(e,t,n){let a;try{a=i.lstatSync(t)}catch{}if(a&&a.isSymbolicLink()&&f(i.statSync(e),i.statSync(t)))return;let s=c(e,t);e=s.toDst,n=u(s.toCwd,n);let l=r.dirname(t);return i.existsSync(l)||o(l),i.symlinkSync(e,t,n)}t.exports={createSymlink:n(p),createSymlinkSync:m}})),ae=s(((e,t)=>{var{createFile:n,createFileSync:r}=ee(),{createLink:i,createLinkSync:a}=te(),{createSymlink:o,createSymlinkSync:s}=ie();t.exports={createFile:n,createFileSync:r,ensureFile:n,ensureFileSync:r,createLink:i,createLinkSync:a,ensureLink:i,ensureLinkSync:a,createSymlink:o,createSymlinkSync:s,ensureSymlink:o,ensureSymlinkSync:s}})),oe=s(((e,t)=>{function n(e,{EOL:t=`
|
|
7
7
|
`,finalEOL:n=!0,replacer:r=null,spaces:i}={}){let a=n?t:``;return JSON.stringify(e,r,i).replace(/\n/g,t)+a}function r(e){return Buffer.isBuffer(e)&&(e=e.toString(`utf8`)),e.replace(/^\uFEFF/,``)}t.exports={stringify:n,stripBom:r}})),se=s(((e,t)=>{var n;try{n=w()}catch{n=require(`fs`)}var r=b(),{stringify:i,stripBom:a}=oe();async function o(e,t={}){typeof t==`string`&&(t={encoding:t});let i=t.fs||n,o=`throws`in t?t.throws:!0,s=await r.fromCallback(i.readFile)(e,t);s=a(s);let c;try{c=JSON.parse(s,t?t.reviver:null)}catch(t){if(o)throw t.message=`${e}: ${t.message}`,t;return null}return c}var s=r.fromPromise(o);function c(e,t={}){typeof t==`string`&&(t={encoding:t});let r=t.fs||n,i=`throws`in t?t.throws:!0;try{let n=r.readFileSync(e,t);return n=a(n),JSON.parse(n,t.reviver)}catch(t){if(i)throw t.message=`${e}: ${t.message}`,t;return null}}async function l(e,t,a={}){let o=a.fs||n,s=i(t,a);await r.fromCallback(o.writeFile)(e,s,a)}var u=r.fromPromise(l);function d(e,t,r={}){let a=r.fs||n,o=i(t,r);return a.writeFileSync(e,o,r)}t.exports={readFile:s,readFileSync:c,writeFile:u,writeFileSync:d}})),ce=s(((e,t)=>{var n=se();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}})),le=s(((e,t)=>{var n=b().fromPromise,r=T(),i=require(`path`),a=O(),o=k().pathExists;async function s(e,t,n=`utf-8`){let s=i.dirname(e);return await o(s)||await a.mkdirs(s),r.writeFile(e,t,n)}function c(e,...t){let n=i.dirname(e);r.existsSync(n)||a.mkdirsSync(n),r.writeFileSync(e,...t)}t.exports={outputFile:n(s),outputFileSync:c}})),ue=s(((e,t)=>{var{stringify:n}=oe(),{outputFile:r}=le();async function i(e,t,i={}){await r(e,n(t,i),i)}t.exports=i})),de=s(((e,t)=>{var{stringify:n}=oe(),{outputFileSync:r}=le();function i(e,t,i){r(e,n(t,i),i)}t.exports=i})),fe=s(((e,t)=>{var n=b().fromPromise,r=ce();r.outputJson=n(ue()),r.outputJsonSync=de(),r.outputJSON=r.outputJson,r.outputJSONSync=r.outputJsonSync,r.writeJSON=r.writeJson,r.writeJSONSync=r.writeJsonSync,r.readJSON=r.readJson,r.readJSONSync=r.readJsonSync,t.exports=r})),pe=s(((e,t)=>{var n=T(),r=require(`path`),{copy:i}=F(),{remove:a}=I(),{mkdirp:o}=O(),{pathExists:s}=k(),c=j();async function l(e,t,n={}){let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:s=!1}=await c.checkPaths(e,t,`move`,n);await c.checkParentPaths(e,a,t,`move`);let l=r.dirname(t);return r.parse(l).root!==l&&await o(l),u(e,t,i,s)}async function u(e,t,r,i){if(!i){if(r)await a(t);else if(await s(t))throw Error(`dest already exists.`)}try{await n.rename(e,t)}catch(n){if(n.code!==`EXDEV`)throw n;await d(e,t,r)}}async function d(e,t,n){return await i(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),a(e)}t.exports=l})),me=s(((e,t)=>{var n=w(),r=require(`path`),i=F().copySync,a=I().removeSync,o=O().mkdirpSync,s=j();function c(e,t,n){n||={};let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:c=!1}=s.checkPathsSync(e,t,`move`,n);return s.checkParentPathsSync(e,a,t,`move`),l(t)||o(r.dirname(t)),u(e,t,i,c)}function l(e){let t=r.dirname(e);return r.parse(t).root===t}function u(e,t,r,i){if(i)return d(e,t,r);if(r)return a(t),d(e,t,r);if(n.existsSync(t))throw Error(`dest already exists.`);return d(e,t,r)}function d(e,t,r){try{n.renameSync(e,t)}catch(n){if(n.code!==`EXDEV`)throw n;return f(e,t,r)}}function f(e,t,n){return i(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),a(e)}t.exports=c})),he=s(((e,t)=>{var n=b().fromPromise;t.exports={move:n(pe()),moveSync:me()}})),ge=s(((e,t)=>{t.exports={...T(),...F(),...L(),...ae(),...fe(),...O(),...he(),...le(),...k(),...I()}})),R=ge(),_e=e=>{let t=typeof e;return e!==null&&(t===`object`||t===`function`)},ve=new Set([`__proto__`,`prototype`,`constructor`]),ye=1e6,be=e=>e>=`0`&&e<=`9`;function xe(e){if(e===`0`)return!0;if(/^[1-9]\d*$/.test(e)){let t=Number.parseInt(e,10);return t<=2**53-1&&t<=ye}return!1}function Se(e,t){return ve.has(e)?!1:(e&&xe(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}function Ce(e){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);let t=[],n=``,r=`start`,i=!1,a=0;for(let o of e){if(a++,i){n+=o,i=!1;continue}if(o===`\\`){if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);i=!0,r=r===`start`?`property`:r;continue}switch(o){case`.`:if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`){r=`property`;break}if(!Se(n,t))return[];n=``,r=`property`;break;case`[`:if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`){r=`index`;break}if(r===`property`||r===`start`){if((n||r===`property`)&&!Se(n,t))return[];n=``}r=`index`;break;case`]`:if(r===`index`){if(n===``)n=(t.pop()||``)+`[]`,r=`property`;else{let e=Number.parseInt(n,10);!Number.isNaN(e)&&Number.isFinite(e)&&e>=0&&e<=2**53-1&&e<=ye&&n===String(e)?t.push(e):t.push(n),n=``,r=`indexEnd`}break}if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);n+=o;break;default:if(r===`index`&&!be(o))throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);r===`start`&&(r=`property`),n+=o}}switch(i&&(n+=`\\`),r){case`property`:if(!Se(n,t))return[];break;case`index`:throw Error(`Index was not closed`);case`start`:t.push(``);break}return t}function we(e){if(typeof e==`string`)return Ce(e);if(Array.isArray(e)){let t=[];for(let[n,r]of e.entries()){if(typeof r!=`string`&&typeof r!=`number`)throw TypeError(`Expected a string or number for path segment at index ${n}, got ${typeof r}`);if(typeof r==`number`&&!Number.isFinite(r))throw TypeError(`Path segment at index ${n} must be a finite number, got ${r}`);if(ve.has(r))return[];typeof r==`string`&&xe(r)?t.push(Number.parseInt(r,10)):t.push(r)}return t}return[]}function Te(e,t,n){if(!_e(e)||typeof t!=`string`&&!Array.isArray(t))return n===void 0?e:n;let r=we(t);if(r.length===0)return n;for(let t=0;t<r.length;t++){let i=r[t];if(e=e[i],e==null){if(t!==r.length-1)return n;break}}return e===void 0?n:e}function Ee(e,t,n){if(!_e(e)||typeof t!=`string`&&!Array.isArray(t))return e;let r=e,i=we(t);if(i.length===0)return e;for(let t=0;t<i.length;t++){let r=i[t];if(t===i.length-1)e[r]=n;else if(!_e(e[r])){let n=typeof i[t+1]==`number`;e[r]=n?[]:{}}e=e[r]}return r}function De(e,t){if(!_e(e)||typeof t!=`string`&&!Array.isArray(t))return!1;let n=we(t);if(n.length===0)return!1;for(let t=0;t<n.length;t++){let r=n[t];if(t===n.length-1)return Object.hasOwn(e,r)?(delete e[r],!0):!1;if(e=e[r],!_e(e))return!1}}function Oe(e,t){if(!_e(e)||typeof t!=`string`&&!Array.isArray(t))return!1;let n=we(t);if(n.length===0)return!1;for(let t of n){if(!_e(e)||!(t in e))return!1;e=e[t]}return!0}var ke=y.default.homedir(),Ae=y.default.tmpdir(),{env:je}=p.default,Me=e=>{let t=m.default.join(ke,`Library`);return{data:m.default.join(t,`Application Support`,e),config:m.default.join(t,`Preferences`,e),cache:m.default.join(t,`Caches`,e),log:m.default.join(t,`Logs`,e),temp:m.default.join(Ae,e)}},Ne=e=>{let t=je.APPDATA||m.default.join(ke,`AppData`,`Roaming`),n=je.LOCALAPPDATA||m.default.join(ke,`AppData`,`Local`);return{data:m.default.join(n,e,`Data`),config:m.default.join(t,e,`Config`),cache:m.default.join(n,e,`Cache`),log:m.default.join(n,e,`Log`),temp:m.default.join(Ae,e)}},Pe=e=>{let t=m.default.basename(ke);return{data:m.default.join(je.XDG_DATA_HOME||m.default.join(ke,`.local`,`share`),e),config:m.default.join(je.XDG_CONFIG_HOME||m.default.join(ke,`.config`),e),cache:m.default.join(je.XDG_CACHE_HOME||m.default.join(ke,`.cache`),e),log:m.default.join(je.XDG_STATE_HOME||m.default.join(ke,`.local`,`state`),e),temp:m.default.join(Ae,t,e)}};function Fe(e,{suffix:t=`nodejs`}={}){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),p.default.platform===`darwin`?Me(e):p.default.platform===`win32`?Ne(e):Pe(e)}var Ie=(e,t)=>{let{onError:n}=t;return function(...t){return e.apply(void 0,t).catch(n)}},Le=Ie,Re=(e,t)=>{let{onError:n}=t;return function(...t){try{return e.apply(void 0,t)}catch(e){return n(e)}}},z=Re,ze=250,Be=(e,t)=>{let{isRetriable:n}=t;return function(t){let{timeout:r}=t,i=t.interval??250,a=Date.now()+r;return function t(...r){return e.apply(void 0,r).catch(e=>{if(!n(e)||Date.now()>=a)throw e;let o=Math.round(i*Math.random());return o>0?new Promise(e=>setTimeout(e,o)).then(()=>t.apply(void 0,r)):t.apply(void 0,r)})}}},Ve=Be,He=(e,t)=>{let{isRetriable:n}=t;return function(t){let{timeout:r}=t,i=Date.now()+r;return function(...t){for(;;)try{return e.apply(void 0,t)}catch(e){if(!n(e)||Date.now()>=i)throw e;continue}}}},Ue=He,We={isChangeErrorOk:e=>{if(!We.isNodeError(e))return!1;let{code:t}=e;return t===`ENOSYS`||!qe&&(t===`EINVAL`||t===`EPERM`)},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!We.isNodeError(e))return!1;let{code:t}=e;return t===`EMFILE`||t===`ENFILE`||t===`EAGAIN`||t===`EBUSY`||t===`EACCESS`||t===`EACCES`||t===`EACCS`||t===`EPERM`},onChangeError:e=>{if(!We.isNodeError(e)||!We.isChangeErrorOk(e))throw e}},Ge=We,Ke={onError:Ge.onChangeError},B={onError:()=>void 0},qe=p.default.getuid?!p.default.getuid():!1,V={isRetriable:Ge.isRetriableError},Je={attempt:{chmod:Le((0,h.promisify)(g.default.chmod),Ke),chown:Le((0,h.promisify)(g.default.chown),Ke),close:Le((0,h.promisify)(g.default.close),B),fsync:Le((0,h.promisify)(g.default.fsync),B),mkdir:Le((0,h.promisify)(g.default.mkdir),B),realpath:Le((0,h.promisify)(g.default.realpath),B),stat:Le((0,h.promisify)(g.default.stat),B),unlink:Le((0,h.promisify)(g.default.unlink),B),chmodSync:z(g.default.chmodSync,Ke),chownSync:z(g.default.chownSync,Ke),closeSync:z(g.default.closeSync,B),existsSync:z(g.default.existsSync,B),fsyncSync:z(g.default.fsync,B),mkdirSync:z(g.default.mkdirSync,B),realpathSync:z(g.default.realpathSync,B),statSync:z(g.default.statSync,B),unlinkSync:z(g.default.unlinkSync,B)},retry:{close:Ve((0,h.promisify)(g.default.close),V),fsync:Ve((0,h.promisify)(g.default.fsync),V),open:Ve((0,h.promisify)(g.default.open),V),readFile:Ve((0,h.promisify)(g.default.readFile),V),rename:Ve((0,h.promisify)(g.default.rename),V),stat:Ve((0,h.promisify)(g.default.stat),V),write:Ve((0,h.promisify)(g.default.write),V),writeFile:Ve((0,h.promisify)(g.default.writeFile),V),closeSync:Ue(g.default.closeSync,V),fsyncSync:Ue(g.default.fsyncSync,V),openSync:Ue(g.default.openSync,V),readFileSync:Ue(g.default.readFileSync,V),renameSync:Ue(g.default.renameSync,V),statSync:Ue(g.default.statSync,V),writeSync:Ue(g.default.writeSync,V),writeFileSync:Ue(g.default.writeFileSync,V)}},H=Je,Ye=`utf8`,Xe=438,Ze=511,Qe={},$e=p.default.geteuid?p.default.geteuid():-1,et=p.default.getegid?p.default.getegid():-1,tt=1e3,nt=!!p.default.getuid,rt=p.default.getuid?!p.default.getuid():!1,it=128,at=e=>e instanceof Error&&`code`in e,ot=e=>typeof e==`string`,st=e=>e===void 0,ct=class{constructor(){this.callbacks=new Set,this.exit=()=>{for(let e of this.callbacks)e()},this.hook=()=>{window.addEventListener(`beforeunload`,this.exit)},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},lt=new ct,ut=lt.register,dt=ut,U={store:{},create:e=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6);return`${e}${`.tmp-${Date.now().toString().slice(-10)}${t}`}`},get:(e,t,n=!0)=>{let r=U.truncate(t(e));return r in U.store?U.get(e,t,n):(U.store[r]=n,[r,()=>delete U.store[r]])},purge:e=>{U.store[e]&&(delete U.store[e],H.attempt.unlink(e))},purgeSync:e=>{U.store[e]&&(delete U.store[e],H.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(let e in U.store)U.purgeSync(e)},truncate:e=>{let t=m.default.basename(e);if(t.length<=128)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-128;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};dt(U.purgeSyncAll);var ft=U;function pt(e,t,n=Qe){if(ot(n))return pt(e,t,{encoding:n});let r={timeout:n.timeout??1e3},i=null,a=null,o=null;try{let s=H.attempt.realpathSync(e),c=!!s;e=s||e,[a,i]=ft.get(e,n.tmpCreate||ft.create,n.tmpPurge!==!1);let l=nt&&st(n.chown),u=st(n.mode);if(c&&(l||u)){let t=H.attempt.statSync(e);t&&(n={...n},l&&(n.chown={uid:t.uid,gid:t.gid}),u&&(n.mode=t.mode))}if(!c){let t=m.default.dirname(e);H.attempt.mkdirSync(t,{mode:511,recursive:!0})}o=H.retry.openSync(r)(a,`w`,n.mode||438),n.tmpCreated&&n.tmpCreated(a),ot(t)?H.retry.writeSync(r)(o,t,0,n.encoding||`utf8`):st(t)||H.retry.writeSync(r)(o,t,0,t.length,0),n.fsync!==!1&&(n.fsyncWait===!1?H.attempt.fsync(o):H.retry.fsyncSync(r)(o)),H.retry.closeSync(r)(o),o=null,n.chown&&(n.chown.uid!==$e||n.chown.gid!==et)&&H.attempt.chownSync(a,n.chown.uid,n.chown.gid),n.mode&&n.mode!==438&&H.attempt.chmodSync(a,n.mode);try{H.retry.renameSync(r)(a,e)}catch(t){if(!at(t)||t.code!==`ENAMETOOLONG`)throw t;H.retry.renameSync(r)(a,ft.truncate(e))}i(),a=null}finally{o&&H.attempt.closeSync(o),a&&ft.purge(a)}}var mt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),ht=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=mt(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),W=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=mt(),n=ht(),r=mt();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=ht();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
8
8
|
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function k(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function A(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function j(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${L(e)}`}e.not=j;var M=I(e.operators.AND);function N(...e){return e.reduce(M)}e.and=N;var P=I(e.operators.OR);function F(...e){return e.reduce(P)}e.or=F;function I(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${L(n)} ${e} ${L(r)}`}function L(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),G=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=W(),n=mt();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),K=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=W();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),gt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=W(),n=G(),r=K();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),_t=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=gt(),n=W(),r=K(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),vt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),yt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),bt=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=vt(),n=yt(),r=gt(),i=W(),a=G(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
9
9
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|