perchai-cli 2.4.42 → 2.4.43
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/perch.mjs +725 -626
- package/package.json +1 -1
package/dist/perch.mjs
CHANGED
|
@@ -5267,9 +5267,9 @@ var require_xlsx = __commonJS({
|
|
|
5267
5267
|
}
|
|
5268
5268
|
return o;
|
|
5269
5269
|
}
|
|
5270
|
-
var
|
|
5270
|
+
var fs16;
|
|
5271
5271
|
function get_fs() {
|
|
5272
|
-
return
|
|
5272
|
+
return fs16 || (fs16 = __require("fs"));
|
|
5273
5273
|
}
|
|
5274
5274
|
function parse(file, options) {
|
|
5275
5275
|
if (file[0] == 80 && file[1] == 75) return parse_zip2(file, options);
|
|
@@ -5545,7 +5545,7 @@ var require_xlsx = __commonJS({
|
|
|
5545
5545
|
}
|
|
5546
5546
|
function read_file(filename2, options) {
|
|
5547
5547
|
get_fs();
|
|
5548
|
-
return parse(
|
|
5548
|
+
return parse(fs16.readFileSync(filename2), options);
|
|
5549
5549
|
}
|
|
5550
5550
|
function read(blob, options) {
|
|
5551
5551
|
var type = options && options.type;
|
|
@@ -5822,7 +5822,7 @@ var require_xlsx = __commonJS({
|
|
|
5822
5822
|
}
|
|
5823
5823
|
return o;
|
|
5824
5824
|
}
|
|
5825
|
-
function find2(cfb,
|
|
5825
|
+
function find2(cfb, path16) {
|
|
5826
5826
|
var UCFullPaths = cfb.FullPaths.map(function(x) {
|
|
5827
5827
|
return x.toUpperCase();
|
|
5828
5828
|
});
|
|
@@ -5831,11 +5831,11 @@ var require_xlsx = __commonJS({
|
|
|
5831
5831
|
return y[y.length - (x.slice(-1) == "/" ? 2 : 1)];
|
|
5832
5832
|
});
|
|
5833
5833
|
var k = false;
|
|
5834
|
-
if (
|
|
5834
|
+
if (path16.charCodeAt(0) === 47) {
|
|
5835
5835
|
k = true;
|
|
5836
|
-
|
|
5837
|
-
} else k =
|
|
5838
|
-
var UCPath =
|
|
5836
|
+
path16 = UCFullPaths[0].slice(0, -1) + path16;
|
|
5837
|
+
} else k = path16.indexOf("/") !== -1;
|
|
5838
|
+
var UCPath = path16.toUpperCase();
|
|
5839
5839
|
var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
|
|
5840
5840
|
if (w !== -1) return cfb.FileIndex[w];
|
|
5841
5841
|
var m = !UCPath.match(chr1);
|
|
@@ -5871,7 +5871,7 @@ var require_xlsx = __commonJS({
|
|
|
5871
5871
|
function write_file(cfb, filename2, options) {
|
|
5872
5872
|
get_fs();
|
|
5873
5873
|
var o = _write(cfb, options);
|
|
5874
|
-
|
|
5874
|
+
fs16.writeFileSync(filename2, o);
|
|
5875
5875
|
}
|
|
5876
5876
|
function a2s2(o) {
|
|
5877
5877
|
var out = new Array(o.length);
|
|
@@ -5883,7 +5883,7 @@ var require_xlsx = __commonJS({
|
|
|
5883
5883
|
switch (options && options.type || "buffer") {
|
|
5884
5884
|
case "file":
|
|
5885
5885
|
get_fs();
|
|
5886
|
-
|
|
5886
|
+
fs16.writeFileSync(options.filename, o);
|
|
5887
5887
|
return o;
|
|
5888
5888
|
case "binary":
|
|
5889
5889
|
return typeof o == "string" ? o : a2s2(o);
|
|
@@ -6816,11 +6816,11 @@ var require_xlsx = __commonJS({
|
|
|
6816
6816
|
}
|
|
6817
6817
|
throw new Error("cannot save file " + fname);
|
|
6818
6818
|
}
|
|
6819
|
-
function read_binary(
|
|
6820
|
-
if (typeof _fs !== "undefined") return _fs.readFileSync(
|
|
6821
|
-
if (typeof Deno !== "undefined") return Deno.readFileSync(
|
|
6819
|
+
function read_binary(path16) {
|
|
6820
|
+
if (typeof _fs !== "undefined") return _fs.readFileSync(path16);
|
|
6821
|
+
if (typeof Deno !== "undefined") return Deno.readFileSync(path16);
|
|
6822
6822
|
if (typeof $ !== "undefined" && typeof File !== "undefined" && typeof Folder !== "undefined") try {
|
|
6823
|
-
var infile = File(
|
|
6823
|
+
var infile = File(path16);
|
|
6824
6824
|
infile.open("r");
|
|
6825
6825
|
infile.encoding = "binary";
|
|
6826
6826
|
var data = infile.read();
|
|
@@ -6829,7 +6829,7 @@ var require_xlsx = __commonJS({
|
|
|
6829
6829
|
} catch (e) {
|
|
6830
6830
|
if (!e.message || !e.message.match(/onstruct/)) throw e;
|
|
6831
6831
|
}
|
|
6832
|
-
throw new Error("Cannot access file " +
|
|
6832
|
+
throw new Error("Cannot access file " + path16);
|
|
6833
6833
|
}
|
|
6834
6834
|
function keys2(o) {
|
|
6835
6835
|
var ks = Object.keys(o), o2 = [];
|
|
@@ -7106,16 +7106,16 @@ var require_xlsx = __commonJS({
|
|
|
7106
7106
|
for (var i = 0; i < k.length; ++i) if (k[i].slice(-1) != "/") o.push(k[i].replace(/^Root Entry[\/]/, ""));
|
|
7107
7107
|
return o.sort();
|
|
7108
7108
|
}
|
|
7109
|
-
function zip_add_file(zip,
|
|
7109
|
+
function zip_add_file(zip, path16, content) {
|
|
7110
7110
|
if (zip.FullPaths) {
|
|
7111
7111
|
if (typeof content == "string") {
|
|
7112
7112
|
var res;
|
|
7113
7113
|
if (has_buf) res = Buffer_from(content);
|
|
7114
7114
|
else res = utf8decode(content);
|
|
7115
|
-
return CFB.utils.cfb_add(zip,
|
|
7115
|
+
return CFB.utils.cfb_add(zip, path16, res);
|
|
7116
7116
|
}
|
|
7117
|
-
CFB.utils.cfb_add(zip,
|
|
7118
|
-
} else zip.file(
|
|
7117
|
+
CFB.utils.cfb_add(zip, path16, content);
|
|
7118
|
+
} else zip.file(path16, content);
|
|
7119
7119
|
}
|
|
7120
7120
|
function zip_new() {
|
|
7121
7121
|
return CFB.utils.cfb_new();
|
|
@@ -7132,11 +7132,11 @@ var require_xlsx = __commonJS({
|
|
|
7132
7132
|
}
|
|
7133
7133
|
throw new Error("Unrecognized type " + o.type);
|
|
7134
7134
|
}
|
|
7135
|
-
function resolve_path(
|
|
7136
|
-
if (
|
|
7135
|
+
function resolve_path(path16, base) {
|
|
7136
|
+
if (path16.charAt(0) == "/") return path16.slice(1);
|
|
7137
7137
|
var result2 = base.split("/");
|
|
7138
7138
|
if (base.slice(-1) != "/") result2.pop();
|
|
7139
|
-
var target =
|
|
7139
|
+
var target = path16.split("/");
|
|
7140
7140
|
while (target.length !== 0) {
|
|
7141
7141
|
var step = target.shift();
|
|
7142
7142
|
if (step === "..") result2.pop();
|
|
@@ -10805,9 +10805,9 @@ var require_xlsx = __commonJS({
|
|
|
10805
10805
|
cell.isst = blob.read_shift(4);
|
|
10806
10806
|
return cell;
|
|
10807
10807
|
}
|
|
10808
|
-
function write_LabelSst(R, C, v,
|
|
10808
|
+
function write_LabelSst(R, C, v, os7) {
|
|
10809
10809
|
var o = new_buf(10);
|
|
10810
|
-
write_XLSCell(R, C,
|
|
10810
|
+
write_XLSCell(R, C, os7, o);
|
|
10811
10811
|
o.write_shift(4, v);
|
|
10812
10812
|
return o;
|
|
10813
10813
|
}
|
|
@@ -10820,10 +10820,10 @@ var require_xlsx = __commonJS({
|
|
|
10820
10820
|
cell.val = str;
|
|
10821
10821
|
return cell;
|
|
10822
10822
|
}
|
|
10823
|
-
function write_Label(R, C, v,
|
|
10823
|
+
function write_Label(R, C, v, os7, opts) {
|
|
10824
10824
|
var b8 = !opts || opts.biff == 8;
|
|
10825
10825
|
var o = new_buf(6 + 2 + +b8 + (1 + b8) * v.length);
|
|
10826
|
-
write_XLSCell(R, C,
|
|
10826
|
+
write_XLSCell(R, C, os7, o);
|
|
10827
10827
|
o.write_shift(2, v.length);
|
|
10828
10828
|
if (b8) o.write_shift(1, 1);
|
|
10829
10829
|
o.write_shift((1 + b8) * v.length, v, b8 ? "utf16le" : "sbcs");
|
|
@@ -10977,9 +10977,9 @@ var require_xlsx = __commonJS({
|
|
|
10977
10977
|
cell.t = val === true || val === false ? "b" : "e";
|
|
10978
10978
|
return cell;
|
|
10979
10979
|
}
|
|
10980
|
-
function write_BoolErr(R, C, v,
|
|
10980
|
+
function write_BoolErr(R, C, v, os7, opts, t) {
|
|
10981
10981
|
var o = new_buf(8);
|
|
10982
|
-
write_XLSCell(R, C,
|
|
10982
|
+
write_XLSCell(R, C, os7, o);
|
|
10983
10983
|
write_Bes(v, t, o);
|
|
10984
10984
|
return o;
|
|
10985
10985
|
}
|
|
@@ -10990,9 +10990,9 @@ var require_xlsx = __commonJS({
|
|
|
10990
10990
|
cell.val = xnum;
|
|
10991
10991
|
return cell;
|
|
10992
10992
|
}
|
|
10993
|
-
function write_Number(R, C, v,
|
|
10993
|
+
function write_Number(R, C, v, os7) {
|
|
10994
10994
|
var o = new_buf(14);
|
|
10995
|
-
write_XLSCell(R, C,
|
|
10995
|
+
write_XLSCell(R, C, os7, o);
|
|
10996
10996
|
write_Xnum(v, o);
|
|
10997
10997
|
return o;
|
|
10998
10998
|
}
|
|
@@ -17815,8 +17815,8 @@ var require_xlsx = __commonJS({
|
|
|
17815
17815
|
var cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts);
|
|
17816
17816
|
return { cell, val: val[0], formula: cbf, shared: flags >> 3 & 1, tt: val[1] };
|
|
17817
17817
|
}
|
|
17818
|
-
function write_Formula(cell, R, C, opts,
|
|
17819
|
-
var o1 = write_XLSCell(R, C,
|
|
17818
|
+
function write_Formula(cell, R, C, opts, os7) {
|
|
17819
|
+
var o1 = write_XLSCell(R, C, os7);
|
|
17820
17820
|
var o2 = write_FormulaValue(cell.v);
|
|
17821
17821
|
var o3 = new_buf(6);
|
|
17822
17822
|
var flags = 1 | 32;
|
|
@@ -19395,8 +19395,8 @@ var require_xlsx = __commonJS({
|
|
|
19395
19395
|
break;
|
|
19396
19396
|
}
|
|
19397
19397
|
var v = writetag("v", escapexml(vv)), o = { r: ref };
|
|
19398
|
-
var
|
|
19399
|
-
if (
|
|
19398
|
+
var os7 = get_cell_style(opts.cellXfs, cell, opts);
|
|
19399
|
+
if (os7 !== 0) o.s = os7;
|
|
19400
19400
|
switch (cell.t) {
|
|
19401
19401
|
case "n":
|
|
19402
19402
|
break;
|
|
@@ -23211,8 +23211,8 @@ var require_xlsx = __commonJS({
|
|
|
23211
23211
|
p = escapexlml(cell.v || "");
|
|
23212
23212
|
break;
|
|
23213
23213
|
}
|
|
23214
|
-
var
|
|
23215
|
-
attr["ss:StyleID"] = "s" + (21 +
|
|
23214
|
+
var os7 = get_cell_style(opts.cellXfs, cell, opts);
|
|
23215
|
+
attr["ss:StyleID"] = "s" + (21 + os7);
|
|
23216
23216
|
attr["ss:Index"] = addr.c + 1;
|
|
23217
23217
|
var _v = cell.v != null ? p : "";
|
|
23218
23218
|
var m = cell.t == "z" ? "" : '<Data ss:Type="' + t + '">' + _v + "</Data>";
|
|
@@ -29047,32 +29047,32 @@ var require_xlsx = __commonJS({
|
|
|
29047
29047
|
});
|
|
29048
29048
|
}
|
|
29049
29049
|
function write_ws_biff8_cell(ba, cell, R, C, opts) {
|
|
29050
|
-
var
|
|
29050
|
+
var os7 = 16 + get_cell_style(opts.cellXfs, cell, opts);
|
|
29051
29051
|
if (cell.v == null && !cell.bf) {
|
|
29052
|
-
write_biff_rec(ba, 513, write_XLSCell(R, C,
|
|
29052
|
+
write_biff_rec(ba, 513, write_XLSCell(R, C, os7));
|
|
29053
29053
|
return;
|
|
29054
29054
|
}
|
|
29055
|
-
if (cell.bf) write_biff_rec(ba, 6, write_Formula(cell, R, C, opts,
|
|
29055
|
+
if (cell.bf) write_biff_rec(ba, 6, write_Formula(cell, R, C, opts, os7));
|
|
29056
29056
|
else switch (cell.t) {
|
|
29057
29057
|
case "d":
|
|
29058
29058
|
case "n":
|
|
29059
29059
|
var v = cell.t == "d" ? datenum(parseDate3(cell.v)) : cell.v;
|
|
29060
|
-
write_biff_rec(ba, 515, write_Number(R, C, v,
|
|
29060
|
+
write_biff_rec(ba, 515, write_Number(R, C, v, os7, opts));
|
|
29061
29061
|
break;
|
|
29062
29062
|
case "b":
|
|
29063
29063
|
case "e":
|
|
29064
|
-
write_biff_rec(ba, 517, write_BoolErr(R, C, cell.v,
|
|
29064
|
+
write_biff_rec(ba, 517, write_BoolErr(R, C, cell.v, os7, opts, cell.t));
|
|
29065
29065
|
break;
|
|
29066
29066
|
/* TODO: codepage, sst */
|
|
29067
29067
|
case "s":
|
|
29068
29068
|
case "str":
|
|
29069
29069
|
if (opts.bookSST) {
|
|
29070
29070
|
var isst = get_sst_id(opts.Strings, cell.v, opts.revStrings);
|
|
29071
|
-
write_biff_rec(ba, 253, write_LabelSst(R, C, isst,
|
|
29072
|
-
} else write_biff_rec(ba, 516, write_Label(R, C, (cell.v || "").slice(0, 255),
|
|
29071
|
+
write_biff_rec(ba, 253, write_LabelSst(R, C, isst, os7, opts));
|
|
29072
|
+
} else write_biff_rec(ba, 516, write_Label(R, C, (cell.v || "").slice(0, 255), os7, opts));
|
|
29073
29073
|
break;
|
|
29074
29074
|
default:
|
|
29075
|
-
write_biff_rec(ba, 513, write_XLSCell(R, C,
|
|
29075
|
+
write_biff_rec(ba, 513, write_XLSCell(R, C, os7));
|
|
29076
29076
|
}
|
|
29077
29077
|
}
|
|
29078
29078
|
function write_ws_biff8(idx, opts, wb) {
|
|
@@ -31790,19 +31790,19 @@ var require_xlsx = __commonJS({
|
|
|
31790
31790
|
}
|
|
31791
31791
|
return !wbrels || wbrels.length === 0 ? null : wbrels;
|
|
31792
31792
|
}
|
|
31793
|
-
function safe_parse_sheet(zip,
|
|
31793
|
+
function safe_parse_sheet(zip, path16, relsPath, sheet, idx, sheetRels, sheets, stype, opts, wb, themes, styles6) {
|
|
31794
31794
|
try {
|
|
31795
|
-
sheetRels[sheet] = parse_rels(getzipstr(zip, relsPath, true),
|
|
31796
|
-
var data = getzipdata(zip,
|
|
31795
|
+
sheetRels[sheet] = parse_rels(getzipstr(zip, relsPath, true), path16);
|
|
31796
|
+
var data = getzipdata(zip, path16);
|
|
31797
31797
|
var _ws;
|
|
31798
31798
|
switch (stype) {
|
|
31799
31799
|
case "sheet":
|
|
31800
|
-
_ws = parse_ws(data,
|
|
31800
|
+
_ws = parse_ws(data, path16, idx, opts, sheetRels[sheet], wb, themes, styles6);
|
|
31801
31801
|
break;
|
|
31802
31802
|
case "chart":
|
|
31803
|
-
_ws = parse_cs(data,
|
|
31803
|
+
_ws = parse_cs(data, path16, idx, opts, sheetRels[sheet], wb, themes, styles6);
|
|
31804
31804
|
if (!_ws || !_ws["!drawel"]) break;
|
|
31805
|
-
var dfile = resolve_path(_ws["!drawel"].Target,
|
|
31805
|
+
var dfile = resolve_path(_ws["!drawel"].Target, path16);
|
|
31806
31806
|
var drelsp = get_rels_path(dfile);
|
|
31807
31807
|
var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile));
|
|
31808
31808
|
var chartp = resolve_path(draw, dfile);
|
|
@@ -31810,10 +31810,10 @@ var require_xlsx = __commonJS({
|
|
|
31810
31810
|
_ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws);
|
|
31811
31811
|
break;
|
|
31812
31812
|
case "macro":
|
|
31813
|
-
_ws = parse_ms(data,
|
|
31813
|
+
_ws = parse_ms(data, path16, idx, opts, sheetRels[sheet], wb, themes, styles6);
|
|
31814
31814
|
break;
|
|
31815
31815
|
case "dialog":
|
|
31816
|
-
_ws = parse_ds(data,
|
|
31816
|
+
_ws = parse_ds(data, path16, idx, opts, sheetRels[sheet], wb, themes, styles6);
|
|
31817
31817
|
break;
|
|
31818
31818
|
default:
|
|
31819
31819
|
throw new Error("Unrecognized sheet type " + stype);
|
|
@@ -31823,13 +31823,13 @@ var require_xlsx = __commonJS({
|
|
|
31823
31823
|
if (sheetRels && sheetRels[sheet]) keys2(sheetRels[sheet]).forEach(function(n) {
|
|
31824
31824
|
var dfile2 = "";
|
|
31825
31825
|
if (sheetRels[sheet][n].Type == RELS.CMNT) {
|
|
31826
|
-
dfile2 = resolve_path(sheetRels[sheet][n].Target,
|
|
31826
|
+
dfile2 = resolve_path(sheetRels[sheet][n].Target, path16);
|
|
31827
31827
|
var comments = parse_cmnt(getzipdata(zip, dfile2, true), dfile2, opts);
|
|
31828
31828
|
if (!comments || !comments.length) return;
|
|
31829
31829
|
sheet_insert_comments(_ws, comments, false);
|
|
31830
31830
|
}
|
|
31831
31831
|
if (sheetRels[sheet][n].Type == RELS.TCMNT) {
|
|
31832
|
-
dfile2 = resolve_path(sheetRels[sheet][n].Target,
|
|
31832
|
+
dfile2 = resolve_path(sheetRels[sheet][n].Target, path16);
|
|
31833
31833
|
tcomments = tcomments.concat(parse_tcmnt_xml(getzipdata(zip, dfile2, true), opts));
|
|
31834
31834
|
}
|
|
31835
31835
|
});
|
|
@@ -31933,7 +31933,7 @@ var require_xlsx = __commonJS({
|
|
|
31933
31933
|
if (opts.bookDeps && dir.calcchain) deps = parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)), dir.calcchain, opts);
|
|
31934
31934
|
var i = 0;
|
|
31935
31935
|
var sheetRels = {};
|
|
31936
|
-
var
|
|
31936
|
+
var path16, relsPath;
|
|
31937
31937
|
{
|
|
31938
31938
|
var wbsheets = wb.Sheets;
|
|
31939
31939
|
props.Worksheets = wbsheets.length;
|
|
@@ -31958,15 +31958,15 @@ var require_xlsx = __commonJS({
|
|
|
31958
31958
|
wsloop: for (i = 0; i != props.Worksheets; ++i) {
|
|
31959
31959
|
var stype = "sheet";
|
|
31960
31960
|
if (wbrels && wbrels[i]) {
|
|
31961
|
-
|
|
31962
|
-
if (!safegetzipfile(zip,
|
|
31963
|
-
if (!safegetzipfile(zip,
|
|
31961
|
+
path16 = "xl/" + wbrels[i][1].replace(/[\/]?xl\//, "");
|
|
31962
|
+
if (!safegetzipfile(zip, path16)) path16 = wbrels[i][1];
|
|
31963
|
+
if (!safegetzipfile(zip, path16)) path16 = wbrelsfile.replace(/_rels\/.*$/, "") + wbrels[i][1];
|
|
31964
31964
|
stype = wbrels[i][2];
|
|
31965
31965
|
} else {
|
|
31966
|
-
|
|
31967
|
-
|
|
31966
|
+
path16 = "xl/worksheets/sheet" + (i + 1 - nmode) + "." + wbext;
|
|
31967
|
+
path16 = path16.replace(/sheet0\./, "sheet.");
|
|
31968
31968
|
}
|
|
31969
|
-
relsPath =
|
|
31969
|
+
relsPath = path16.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
|
|
31970
31970
|
if (opts && opts.sheets != null) switch (typeof opts.sheets) {
|
|
31971
31971
|
case "number":
|
|
31972
31972
|
if (i != opts.sheets) continue wsloop;
|
|
@@ -31984,7 +31984,7 @@ var require_xlsx = __commonJS({
|
|
|
31984
31984
|
if (!snjseen) continue wsloop;
|
|
31985
31985
|
}
|
|
31986
31986
|
}
|
|
31987
|
-
safe_parse_sheet(zip,
|
|
31987
|
+
safe_parse_sheet(zip, path16, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles6);
|
|
31988
31988
|
}
|
|
31989
31989
|
out = {
|
|
31990
31990
|
Directory: dir,
|
|
@@ -32873,7 +32873,7 @@ var require_xlsx = __commonJS({
|
|
|
32873
32873
|
return out;
|
|
32874
32874
|
}
|
|
32875
32875
|
var qreg = /"/g;
|
|
32876
|
-
function make_csv_row(sheet, r, R, cols,
|
|
32876
|
+
function make_csv_row(sheet, r, R, cols, fs16, rs, FS, o) {
|
|
32877
32877
|
var isempty = true;
|
|
32878
32878
|
var row = [], txt = "", rr = encode_row(R);
|
|
32879
32879
|
for (var C = r.s.c; C <= r.e.c; ++C) {
|
|
@@ -32883,7 +32883,7 @@ var require_xlsx = __commonJS({
|
|
|
32883
32883
|
else if (val.v != null) {
|
|
32884
32884
|
isempty = false;
|
|
32885
32885
|
txt = "" + (o.rawNumbers && val.t == "n" ? val.v : format_cell(val, null, o));
|
|
32886
|
-
for (var i = 0, cc = 0; i !== txt.length; ++i) if ((cc = txt.charCodeAt(i)) ===
|
|
32886
|
+
for (var i = 0, cc = 0; i !== txt.length; ++i) if ((cc = txt.charCodeAt(i)) === fs16 || cc === rs || cc === 34 || o.forceQuotes) {
|
|
32887
32887
|
txt = '"' + txt.replace(qreg, '""') + '"';
|
|
32888
32888
|
break;
|
|
32889
32889
|
}
|
|
@@ -32903,7 +32903,7 @@ var require_xlsx = __commonJS({
|
|
|
32903
32903
|
var o = opts == null ? {} : opts;
|
|
32904
32904
|
if (sheet == null || sheet["!ref"] == null) return "";
|
|
32905
32905
|
var r = safe_decode_range(sheet["!ref"]);
|
|
32906
|
-
var FS = o.FS !== void 0 ? o.FS : ",",
|
|
32906
|
+
var FS = o.FS !== void 0 ? o.FS : ",", fs16 = FS.charCodeAt(0);
|
|
32907
32907
|
var RS = o.RS !== void 0 ? o.RS : "\n", rs = RS.charCodeAt(0);
|
|
32908
32908
|
var endregex = new RegExp((FS == "|" ? "\\|" : FS) + "+$");
|
|
32909
32909
|
var row = "", cols = [];
|
|
@@ -32914,7 +32914,7 @@ var require_xlsx = __commonJS({
|
|
|
32914
32914
|
var w = 0;
|
|
32915
32915
|
for (var R = r.s.r; R <= r.e.r; ++R) {
|
|
32916
32916
|
if ((rowinfo[R] || {}).hidden) continue;
|
|
32917
|
-
row = make_csv_row(sheet, r, R, cols,
|
|
32917
|
+
row = make_csv_row(sheet, r, R, cols, fs16, rs, FS, o);
|
|
32918
32918
|
if (row == null) {
|
|
32919
32919
|
continue;
|
|
32920
32920
|
}
|
|
@@ -33186,7 +33186,7 @@ var require_xlsx = __commonJS({
|
|
|
33186
33186
|
return stream;
|
|
33187
33187
|
}
|
|
33188
33188
|
var r = safe_decode_range(sheet["!ref"]);
|
|
33189
|
-
var FS = o.FS !== void 0 ? o.FS : ",",
|
|
33189
|
+
var FS = o.FS !== void 0 ? o.FS : ",", fs16 = FS.charCodeAt(0);
|
|
33190
33190
|
var RS = o.RS !== void 0 ? o.RS : "\n", rs = RS.charCodeAt(0);
|
|
33191
33191
|
var endregex = new RegExp((FS == "|" ? "\\|" : FS) + "+$");
|
|
33192
33192
|
var row = "", cols = [];
|
|
@@ -33204,7 +33204,7 @@ var require_xlsx = __commonJS({
|
|
|
33204
33204
|
while (R <= r.e.r) {
|
|
33205
33205
|
++R;
|
|
33206
33206
|
if ((rowinfo[R - 1] || {}).hidden) continue;
|
|
33207
|
-
row = make_csv_row(sheet, r, R - 1, cols,
|
|
33207
|
+
row = make_csv_row(sheet, r, R - 1, cols, fs16, rs, FS, o);
|
|
33208
33208
|
if (row != null) {
|
|
33209
33209
|
if (o.strip) row = row.replace(endregex, "");
|
|
33210
33210
|
if (row || o.blankrows !== false) return stream.push((w++ ? RS : "") + row);
|
|
@@ -47774,8 +47774,8 @@ var require_html2canvas = __commonJS({
|
|
|
47774
47774
|
return BezierCurve2;
|
|
47775
47775
|
})()
|
|
47776
47776
|
);
|
|
47777
|
-
var isBezierCurve = function(
|
|
47778
|
-
return
|
|
47777
|
+
var isBezierCurve = function(path16) {
|
|
47778
|
+
return path16.type === 1;
|
|
47779
47779
|
};
|
|
47780
47780
|
var BoundCurves = (
|
|
47781
47781
|
/** @class */
|
|
@@ -47903,8 +47903,8 @@ var require_html2canvas = __commonJS({
|
|
|
47903
47903
|
var ClipEffect = (
|
|
47904
47904
|
/** @class */
|
|
47905
47905
|
/* @__PURE__ */ (function() {
|
|
47906
|
-
function ClipEffect2(
|
|
47907
|
-
this.path =
|
|
47906
|
+
function ClipEffect2(path16, target) {
|
|
47907
|
+
this.path = path16;
|
|
47908
47908
|
this.target = target;
|
|
47909
47909
|
this.type = 1;
|
|
47910
47910
|
}
|
|
@@ -47939,8 +47939,8 @@ var require_html2canvas = __commonJS({
|
|
|
47939
47939
|
}
|
|
47940
47940
|
return false;
|
|
47941
47941
|
};
|
|
47942
|
-
var transformPath = function(
|
|
47943
|
-
return
|
|
47942
|
+
var transformPath = function(path16, deltaX, deltaY, deltaW, deltaH) {
|
|
47943
|
+
return path16.map(function(point, index) {
|
|
47944
47944
|
switch (index) {
|
|
47945
47945
|
case 0:
|
|
47946
47946
|
return point.add(deltaX, deltaY);
|
|
@@ -48207,42 +48207,42 @@ var require_html2canvas = __commonJS({
|
|
|
48207
48207
|
}
|
|
48208
48208
|
};
|
|
48209
48209
|
var createStrokePathFromCurves = function(outer1, outer2) {
|
|
48210
|
-
var
|
|
48210
|
+
var path16 = [];
|
|
48211
48211
|
if (isBezierCurve(outer1)) {
|
|
48212
|
-
|
|
48212
|
+
path16.push(outer1.subdivide(0.5, false));
|
|
48213
48213
|
} else {
|
|
48214
|
-
|
|
48214
|
+
path16.push(outer1);
|
|
48215
48215
|
}
|
|
48216
48216
|
if (isBezierCurve(outer2)) {
|
|
48217
|
-
|
|
48217
|
+
path16.push(outer2.subdivide(0.5, true));
|
|
48218
48218
|
} else {
|
|
48219
|
-
|
|
48219
|
+
path16.push(outer2);
|
|
48220
48220
|
}
|
|
48221
|
-
return
|
|
48221
|
+
return path16;
|
|
48222
48222
|
};
|
|
48223
48223
|
var createPathFromCurves = function(outer1, inner1, outer2, inner2) {
|
|
48224
|
-
var
|
|
48224
|
+
var path16 = [];
|
|
48225
48225
|
if (isBezierCurve(outer1)) {
|
|
48226
|
-
|
|
48226
|
+
path16.push(outer1.subdivide(0.5, false));
|
|
48227
48227
|
} else {
|
|
48228
|
-
|
|
48228
|
+
path16.push(outer1);
|
|
48229
48229
|
}
|
|
48230
48230
|
if (isBezierCurve(outer2)) {
|
|
48231
|
-
|
|
48231
|
+
path16.push(outer2.subdivide(0.5, true));
|
|
48232
48232
|
} else {
|
|
48233
|
-
|
|
48233
|
+
path16.push(outer2);
|
|
48234
48234
|
}
|
|
48235
48235
|
if (isBezierCurve(inner2)) {
|
|
48236
|
-
|
|
48236
|
+
path16.push(inner2.subdivide(0.5, true).reverse());
|
|
48237
48237
|
} else {
|
|
48238
|
-
|
|
48238
|
+
path16.push(inner2);
|
|
48239
48239
|
}
|
|
48240
48240
|
if (isBezierCurve(inner1)) {
|
|
48241
|
-
|
|
48241
|
+
path16.push(inner1.subdivide(0.5, false).reverse());
|
|
48242
48242
|
} else {
|
|
48243
|
-
|
|
48243
|
+
path16.push(inner1);
|
|
48244
48244
|
}
|
|
48245
|
-
return
|
|
48245
|
+
return path16;
|
|
48246
48246
|
};
|
|
48247
48247
|
var paddingBox = function(element) {
|
|
48248
48248
|
var bounds = element.bounds;
|
|
@@ -48282,10 +48282,10 @@ var require_html2canvas = __commonJS({
|
|
|
48282
48282
|
var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea);
|
|
48283
48283
|
var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
|
|
48284
48284
|
var position2 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
|
|
48285
|
-
var
|
|
48285
|
+
var path16 = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position2, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
|
|
48286
48286
|
var offsetX = Math.round(backgroundPositioningArea.left + position2[0]);
|
|
48287
48287
|
var offsetY = Math.round(backgroundPositioningArea.top + position2[1]);
|
|
48288
|
-
return [
|
|
48288
|
+
return [path16, offsetX, offsetY, sizeWidth, sizeHeight];
|
|
48289
48289
|
};
|
|
48290
48290
|
var isAuto = function(token) {
|
|
48291
48291
|
return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;
|
|
@@ -48666,8 +48666,8 @@ var require_html2canvas = __commonJS({
|
|
|
48666
48666
|
CanvasRenderer2.prototype.renderReplacedElement = function(container, curves, image3) {
|
|
48667
48667
|
if (image3 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
|
|
48668
48668
|
var box = contentBox(container);
|
|
48669
|
-
var
|
|
48670
|
-
this.path(
|
|
48669
|
+
var path16 = calculatePaddingBoxPath(curves);
|
|
48670
|
+
this.path(path16);
|
|
48671
48671
|
this.ctx.save();
|
|
48672
48672
|
this.ctx.clip();
|
|
48673
48673
|
this.ctx.drawImage(image3, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
|
|
@@ -49001,8 +49001,8 @@ var require_html2canvas = __commonJS({
|
|
|
49001
49001
|
}
|
|
49002
49002
|
});
|
|
49003
49003
|
};
|
|
49004
|
-
CanvasRenderer2.prototype.renderRepeat = function(
|
|
49005
|
-
this.path(
|
|
49004
|
+
CanvasRenderer2.prototype.renderRepeat = function(path16, pattern, offsetX, offsetY) {
|
|
49005
|
+
this.path(path16);
|
|
49006
49006
|
this.ctx.fillStyle = pattern;
|
|
49007
49007
|
this.ctx.translate(offsetX, offsetY);
|
|
49008
49008
|
this.ctx.fill();
|
|
@@ -49029,7 +49029,7 @@ var require_html2canvas = __commonJS({
|
|
|
49029
49029
|
case 0:
|
|
49030
49030
|
index = container.styles.backgroundImage.length - 1;
|
|
49031
49031
|
_loop_1 = function(backgroundImage3) {
|
|
49032
|
-
var image3, url, _c,
|
|
49032
|
+
var image3, url, _c, path16, x, y, width, height, pattern, _d, path16, x, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path16, left, top_1, width, height, position2, x, y, _g, rx, ry, radialGradient_1, midX, midY, f2, invF;
|
|
49033
49033
|
return __generator2(this, function(_h) {
|
|
49034
49034
|
switch (_h.label) {
|
|
49035
49035
|
case 0:
|
|
@@ -49053,14 +49053,14 @@ var require_html2canvas = __commonJS({
|
|
|
49053
49053
|
image3.width,
|
|
49054
49054
|
image3.height,
|
|
49055
49055
|
image3.width / image3.height
|
|
49056
|
-
]),
|
|
49056
|
+
]), path16 = _c[0], x = _c[1], y = _c[2], width = _c[3], height = _c[4];
|
|
49057
49057
|
pattern = this_1.ctx.createPattern(this_1.resizeImage(image3, width, height), "repeat");
|
|
49058
|
-
this_1.renderRepeat(
|
|
49058
|
+
this_1.renderRepeat(path16, pattern, x, y);
|
|
49059
49059
|
}
|
|
49060
49060
|
return [3, 6];
|
|
49061
49061
|
case 5:
|
|
49062
49062
|
if (isLinearGradient(backgroundImage3)) {
|
|
49063
|
-
_d = calculateBackgroundRendering(container, index, [null, null, null]),
|
|
49063
|
+
_d = calculateBackgroundRendering(container, index, [null, null, null]), path16 = _d[0], x = _d[1], y = _d[2], width = _d[3], height = _d[4];
|
|
49064
49064
|
_e = calculateGradientDirection(backgroundImage3.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];
|
|
49065
49065
|
canvas = document.createElement("canvas");
|
|
49066
49066
|
canvas.width = width;
|
|
@@ -49074,14 +49074,14 @@ var require_html2canvas = __commonJS({
|
|
|
49074
49074
|
ctx.fillRect(0, 0, width, height);
|
|
49075
49075
|
if (width > 0 && height > 0) {
|
|
49076
49076
|
pattern = this_1.ctx.createPattern(canvas, "repeat");
|
|
49077
|
-
this_1.renderRepeat(
|
|
49077
|
+
this_1.renderRepeat(path16, pattern, x, y);
|
|
49078
49078
|
}
|
|
49079
49079
|
} else if (isRadialGradient(backgroundImage3)) {
|
|
49080
49080
|
_f = calculateBackgroundRendering(container, index, [
|
|
49081
49081
|
null,
|
|
49082
49082
|
null,
|
|
49083
49083
|
null
|
|
49084
|
-
]),
|
|
49084
|
+
]), path16 = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4];
|
|
49085
49085
|
position2 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position;
|
|
49086
49086
|
x = getAbsoluteValue(position2[0], width);
|
|
49087
49087
|
y = getAbsoluteValue(position2[position2.length - 1], height);
|
|
@@ -49091,7 +49091,7 @@ var require_html2canvas = __commonJS({
|
|
|
49091
49091
|
processColorStops(backgroundImage3.stops, rx * 2).forEach(function(colorStop) {
|
|
49092
49092
|
return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
|
|
49093
49093
|
});
|
|
49094
|
-
this_1.path(
|
|
49094
|
+
this_1.path(path16);
|
|
49095
49095
|
this_1.ctx.fillStyle = radialGradient_1;
|
|
49096
49096
|
if (rx !== ry) {
|
|
49097
49097
|
midX = container.bounds.left + 0.5 * container.bounds.width;
|
|
@@ -52739,7 +52739,7 @@ var require_es_promise_constructor = __commonJS({
|
|
|
52739
52739
|
var IS_PURE = require_is_pure();
|
|
52740
52740
|
var IS_NODE = require_environment_is_node();
|
|
52741
52741
|
var globalThis2 = require_global_this();
|
|
52742
|
-
var
|
|
52742
|
+
var path16 = require_path();
|
|
52743
52743
|
var call = require_function_call();
|
|
52744
52744
|
var defineBuiltIn = require_define_built_in();
|
|
52745
52745
|
var setPrototypeOf = require_object_set_prototype_of();
|
|
@@ -52989,7 +52989,7 @@ var require_es_promise_constructor = __commonJS({
|
|
|
52989
52989
|
$2({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
52990
52990
|
Promise: PromiseConstructor
|
|
52991
52991
|
});
|
|
52992
|
-
PromiseWrapper =
|
|
52992
|
+
PromiseWrapper = path16.Promise;
|
|
52993
52993
|
setToStringTag(PromiseConstructor, PROMISE, false, true);
|
|
52994
52994
|
setSpecies(PROMISE);
|
|
52995
52995
|
}
|
|
@@ -56483,7 +56483,7 @@ var require_es_number_constructor = __commonJS({
|
|
|
56483
56483
|
var IS_PURE = require_is_pure();
|
|
56484
56484
|
var DESCRIPTORS = require_descriptors();
|
|
56485
56485
|
var globalThis2 = require_global_this();
|
|
56486
|
-
var
|
|
56486
|
+
var path16 = require_path();
|
|
56487
56487
|
var uncurryThis = require_function_uncurry_this();
|
|
56488
56488
|
var isForced = require_is_forced();
|
|
56489
56489
|
var hasOwn = require_has_own_property();
|
|
@@ -56499,7 +56499,7 @@ var require_es_number_constructor = __commonJS({
|
|
|
56499
56499
|
var trim = require_string_trim().trim;
|
|
56500
56500
|
var NUMBER = "Number";
|
|
56501
56501
|
var NativeNumber = globalThis2[NUMBER];
|
|
56502
|
-
var PureNumberNamespace =
|
|
56502
|
+
var PureNumberNamespace = path16[NUMBER];
|
|
56503
56503
|
var NumberPrototype = NativeNumber.prototype;
|
|
56504
56504
|
var TypeError2 = globalThis2.TypeError;
|
|
56505
56505
|
var stringSlice = uncurryThis("".slice);
|
|
@@ -56571,8 +56571,8 @@ var require_es_number_constructor = __commonJS({
|
|
|
56571
56571
|
}
|
|
56572
56572
|
}
|
|
56573
56573
|
};
|
|
56574
|
-
if (IS_PURE && PureNumberNamespace) copyConstructorProperties(
|
|
56575
|
-
if (FORCED || IS_PURE) copyConstructorProperties(
|
|
56574
|
+
if (IS_PURE && PureNumberNamespace) copyConstructorProperties(path16[NUMBER], PureNumberNamespace);
|
|
56575
|
+
if (FORCED || IS_PURE) copyConstructorProperties(path16[NUMBER], NativeNumber);
|
|
56576
56576
|
}
|
|
56577
56577
|
});
|
|
56578
56578
|
|
|
@@ -58687,8 +58687,8 @@ var require_lib2 = __commonJS({
|
|
|
58687
58687
|
}
|
|
58688
58688
|
}, {
|
|
58689
58689
|
key: "parsePath",
|
|
58690
|
-
value: function parsePath(
|
|
58691
|
-
var points = toNumbers(
|
|
58690
|
+
value: function parsePath(path16) {
|
|
58691
|
+
var points = toNumbers(path16);
|
|
58692
58692
|
var len = points.length;
|
|
58693
58693
|
var pathPoints = [];
|
|
58694
58694
|
for (var i = 0; i < len; i += 2) {
|
|
@@ -60189,10 +60189,10 @@ var require_lib2 = __commonJS({
|
|
|
60189
60189
|
var PathParser = /* @__PURE__ */ (function(_SVGPathData) {
|
|
60190
60190
|
_inherits__default["default"](PathParser2, _SVGPathData);
|
|
60191
60191
|
var _super = _createSuper$I(PathParser2);
|
|
60192
|
-
function PathParser2(
|
|
60192
|
+
function PathParser2(path16) {
|
|
60193
60193
|
var _this;
|
|
60194
60194
|
_classCallCheck__default["default"](this, PathParser2);
|
|
60195
|
-
_this = _super.call(this,
|
|
60195
|
+
_this = _super.call(this, path16.replace(/([+\-.])\s+/gm, "$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, ""));
|
|
60196
60196
|
_this.control = null;
|
|
60197
60197
|
_this.start = null;
|
|
60198
60198
|
_this.current = null;
|
|
@@ -60520,7 +60520,7 @@ var require_lib2 = __commonJS({
|
|
|
60520
60520
|
}
|
|
60521
60521
|
_createClass__default["default"](PathElement2, [{
|
|
60522
60522
|
key: "path",
|
|
60523
|
-
value: function
|
|
60523
|
+
value: function path16(ctx) {
|
|
60524
60524
|
var pathParser = this.pathParser;
|
|
60525
60525
|
var boundingBox = new BoundingBox();
|
|
60526
60526
|
pathParser.reset();
|
|
@@ -61644,7 +61644,7 @@ var require_lib2 = __commonJS({
|
|
|
61644
61644
|
}
|
|
61645
61645
|
_createClass__default["default"](RectElement2, [{
|
|
61646
61646
|
key: "path",
|
|
61647
|
-
value: function
|
|
61647
|
+
value: function path16(ctx) {
|
|
61648
61648
|
var x = this.getAttribute("x").getPixels("x");
|
|
61649
61649
|
var y = this.getAttribute("y").getPixels("y");
|
|
61650
61650
|
var width = this.getStyle("width", false, true).getPixels("x");
|
|
@@ -61724,7 +61724,7 @@ var require_lib2 = __commonJS({
|
|
|
61724
61724
|
}
|
|
61725
61725
|
_createClass__default["default"](CircleElement2, [{
|
|
61726
61726
|
key: "path",
|
|
61727
|
-
value: function
|
|
61727
|
+
value: function path16(ctx) {
|
|
61728
61728
|
var cx = this.getAttribute("cx").getPixels("x");
|
|
61729
61729
|
var cy = this.getAttribute("cy").getPixels("y");
|
|
61730
61730
|
var r = this.getAttribute("r").getPixels();
|
|
@@ -61780,7 +61780,7 @@ var require_lib2 = __commonJS({
|
|
|
61780
61780
|
}
|
|
61781
61781
|
_createClass__default["default"](EllipseElement2, [{
|
|
61782
61782
|
key: "path",
|
|
61783
|
-
value: function
|
|
61783
|
+
value: function path16(ctx) {
|
|
61784
61784
|
var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
|
|
61785
61785
|
var rx = this.getAttribute("rx").getPixels("x");
|
|
61786
61786
|
var ry = this.getAttribute("ry").getPixels("y");
|
|
@@ -61847,7 +61847,7 @@ var require_lib2 = __commonJS({
|
|
|
61847
61847
|
}
|
|
61848
61848
|
}, {
|
|
61849
61849
|
key: "path",
|
|
61850
|
-
value: function
|
|
61850
|
+
value: function path16(ctx) {
|
|
61851
61851
|
var _this$getPoints = this.getPoints(), _this$getPoints2 = _slicedToArray__default["default"](_this$getPoints, 2), _this$getPoints2$ = _this$getPoints2[0], x0 = _this$getPoints2$.x, y0 = _this$getPoints2$.y, _this$getPoints2$2 = _this$getPoints2[1], x1 = _this$getPoints2$2.x, y1 = _this$getPoints2$2.y;
|
|
61852
61852
|
if (ctx) {
|
|
61853
61853
|
ctx.beginPath();
|
|
@@ -61905,7 +61905,7 @@ var require_lib2 = __commonJS({
|
|
|
61905
61905
|
}
|
|
61906
61906
|
_createClass__default["default"](PolylineElement2, [{
|
|
61907
61907
|
key: "path",
|
|
61908
|
-
value: function
|
|
61908
|
+
value: function path16(ctx) {
|
|
61909
61909
|
var points = this.points;
|
|
61910
61910
|
var _points = _slicedToArray__default["default"](points, 1), _points$ = _points[0], x0 = _points$.x, y0 = _points$.y;
|
|
61911
61911
|
var boundingBox = new BoundingBox(x0, y0);
|
|
@@ -61979,7 +61979,7 @@ var require_lib2 = __commonJS({
|
|
|
61979
61979
|
}
|
|
61980
61980
|
_createClass__default["default"](PolygonElement2, [{
|
|
61981
61981
|
key: "path",
|
|
61982
|
-
value: function
|
|
61982
|
+
value: function path16(ctx) {
|
|
61983
61983
|
var boundingBox = _get__default["default"](_getPrototypeOf__default["default"](PolygonElement2.prototype), "path", this).call(this, ctx);
|
|
61984
61984
|
var _this$points = _slicedToArray__default["default"](this.points, 1), _this$points$ = _this$points[0], x = _this$points$.x, y = _this$points$.y;
|
|
61985
61985
|
if (ctx) {
|
|
@@ -63230,7 +63230,7 @@ var require_lib2 = __commonJS({
|
|
|
63230
63230
|
}
|
|
63231
63231
|
}, {
|
|
63232
63232
|
key: "path",
|
|
63233
|
-
value: function
|
|
63233
|
+
value: function path16(ctx) {
|
|
63234
63234
|
var dataArray = this.dataArray;
|
|
63235
63235
|
if (ctx) {
|
|
63236
63236
|
ctx.beginPath();
|
|
@@ -63259,7 +63259,7 @@ var require_lib2 = __commonJS({
|
|
|
63259
63259
|
}
|
|
63260
63260
|
break;
|
|
63261
63261
|
case PathParser.ARC: {
|
|
63262
|
-
var _points = _slicedToArray__default["default"](points, 8), cx = _points[0], cy = _points[1], rx = _points[2], ry = _points[3], theta = _points[4], dTheta = _points[5], psi = _points[6],
|
|
63262
|
+
var _points = _slicedToArray__default["default"](points, 8), cx = _points[0], cy = _points[1], rx = _points[2], ry = _points[3], theta = _points[4], dTheta = _points[5], psi = _points[6], fs16 = _points[7];
|
|
63263
63263
|
var r = rx > ry ? rx : ry;
|
|
63264
63264
|
var scaleX = rx > ry ? 1 : rx / ry;
|
|
63265
63265
|
var scaleY = rx > ry ? ry / rx : 1;
|
|
@@ -63267,7 +63267,7 @@ var require_lib2 = __commonJS({
|
|
|
63267
63267
|
ctx.translate(cx, cy);
|
|
63268
63268
|
ctx.rotate(psi);
|
|
63269
63269
|
ctx.scale(scaleX, scaleY);
|
|
63270
|
-
ctx.arc(0, 0, r, theta, theta + dTheta, Boolean(1 -
|
|
63270
|
+
ctx.arc(0, 0, r, theta, theta + dTheta, Boolean(1 - fs16));
|
|
63271
63271
|
ctx.scale(1 / scaleX, 1 / scaleY);
|
|
63272
63272
|
ctx.rotate(-psi);
|
|
63273
63273
|
ctx.translate(-cx, -cy);
|
|
@@ -63447,13 +63447,13 @@ var require_lib2 = __commonJS({
|
|
|
63447
63447
|
}
|
|
63448
63448
|
}, {
|
|
63449
63449
|
key: "parsePathData",
|
|
63450
|
-
value: function parsePathData(
|
|
63450
|
+
value: function parsePathData(path16) {
|
|
63451
63451
|
this.pathLength = -1;
|
|
63452
|
-
if (!
|
|
63452
|
+
if (!path16) {
|
|
63453
63453
|
return [];
|
|
63454
63454
|
}
|
|
63455
63455
|
var pathCommands = [];
|
|
63456
|
-
var pathParser =
|
|
63456
|
+
var pathParser = path16.pathParser;
|
|
63457
63457
|
pathParser.reset();
|
|
63458
63458
|
while (!pathParser.isEnd()) {
|
|
63459
63459
|
var current = pathParser.current;
|
|
@@ -64259,7 +64259,7 @@ var require_lib2 = __commonJS({
|
|
|
64259
64259
|
}
|
|
64260
64260
|
}, {
|
|
64261
64261
|
key: "path",
|
|
64262
|
-
value: function
|
|
64262
|
+
value: function path16(ctx) {
|
|
64263
64263
|
var element = this.element;
|
|
64264
64264
|
if (element) {
|
|
64265
64265
|
element.path(ctx);
|
|
@@ -75918,6 +75918,7 @@ function isTurnAbortedError(error) {
|
|
|
75918
75918
|
var TURN_STOPPED_BY_USER_MESSAGE;
|
|
75919
75919
|
var init_turnAbort = __esm({
|
|
75920
75920
|
"features/perchTerminal/runtime/turnAbort.ts"() {
|
|
75921
|
+
"use strict";
|
|
75921
75922
|
TURN_STOPPED_BY_USER_MESSAGE = "Turn stopped by user.";
|
|
75922
75923
|
}
|
|
75923
75924
|
});
|
|
@@ -76218,7 +76219,6 @@ function getToolDisplayName(toolName) {
|
|
|
76218
76219
|
var NON_MODULE_TOOL_OWNERS, TOOL_RISK, TOOL_DISPLAY_NAMES;
|
|
76219
76220
|
var init_catalog = __esm({
|
|
76220
76221
|
"features/perchTerminal/runtime/toolSystem/catalog.ts"() {
|
|
76221
|
-
"use strict";
|
|
76222
76222
|
init_toolNames();
|
|
76223
76223
|
NON_MODULE_TOOL_OWNERS = {
|
|
76224
76224
|
[TOOL_NAMES.listSources]: "lane",
|
|
@@ -86341,14 +86341,14 @@ function extractOne(tc, ts) {
|
|
|
86341
86341
|
}
|
|
86342
86342
|
if (tc.toolName === "readLocalFile" || tc.toolName === "readLocalSourceFile") {
|
|
86343
86343
|
const content = String(parsed?.content ?? tc.result ?? "").trim();
|
|
86344
|
-
const
|
|
86344
|
+
const path16 = String(tc.input?.path ?? "");
|
|
86345
86345
|
return {
|
|
86346
86346
|
id: `ev-${tc.toolCallId}-fileread`,
|
|
86347
86347
|
type: "fileRead",
|
|
86348
86348
|
toolName: tc.toolName,
|
|
86349
|
-
title: `readFile: ${
|
|
86349
|
+
title: `readFile: ${path16 || "local file"}`,
|
|
86350
86350
|
excerpt: truncate2(content, RICH_EXCERPT_CHARS),
|
|
86351
|
-
workspacePath:
|
|
86351
|
+
workspacePath: path16 || null,
|
|
86352
86352
|
timestamp: ts,
|
|
86353
86353
|
ok: tc.ok
|
|
86354
86354
|
};
|
|
@@ -86437,8 +86437,8 @@ function serializeThreadEvidenceForPrompt(items) {
|
|
|
86437
86437
|
"The following tool results from prior turns are available for this turn. Treat them as already-completed work. Do not repeat searches, reads, drafts, or deliveries unless the user explicitly asks to redo them.",
|
|
86438
86438
|
...recent.map((item, idx) => {
|
|
86439
86439
|
const status = item.ok ? "ok" : "failed";
|
|
86440
|
-
const
|
|
86441
|
-
return `[E${idx + 1}] ${item.type} via ${item.toolName} (${status}): ${item.title}${
|
|
86440
|
+
const path16 = item.workspacePath ? ` path=${item.workspacePath}` : "";
|
|
86441
|
+
return `[E${idx + 1}] ${item.type} via ${item.toolName} (${status}): ${item.title}${path16}
|
|
86442
86442
|
${item.excerpt}`;
|
|
86443
86443
|
})
|
|
86444
86444
|
].join("\n");
|
|
@@ -86723,7 +86723,6 @@ function truncateHistoryLine(value, max2) {
|
|
|
86723
86723
|
}
|
|
86724
86724
|
var init_operatorTruth = __esm({
|
|
86725
86725
|
"features/perchTerminal/runtime/operatorTruth.ts"() {
|
|
86726
|
-
"use strict";
|
|
86727
86726
|
}
|
|
86728
86727
|
});
|
|
86729
86728
|
|
|
@@ -94657,13 +94656,13 @@ function __disposeResources(env4) {
|
|
|
94657
94656
|
}
|
|
94658
94657
|
return next();
|
|
94659
94658
|
}
|
|
94660
|
-
function __rewriteRelativeImportExtension(
|
|
94661
|
-
if (typeof
|
|
94662
|
-
return
|
|
94659
|
+
function __rewriteRelativeImportExtension(path16, preserveJsx) {
|
|
94660
|
+
if (typeof path16 === "string" && /^\.\.?\//.test(path16)) {
|
|
94661
|
+
return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
94663
94662
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
94664
94663
|
});
|
|
94665
94664
|
}
|
|
94666
|
-
return
|
|
94665
|
+
return path16;
|
|
94667
94666
|
}
|
|
94668
94667
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
94669
94668
|
var init_tslib_es6 = __esm({
|
|
@@ -104185,8 +104184,8 @@ var require_main2 = __commonJS({
|
|
|
104185
104184
|
});
|
|
104186
104185
|
|
|
104187
104186
|
// node_modules/iceberg-js/dist/index.mjs
|
|
104188
|
-
function buildUrl(baseUrl,
|
|
104189
|
-
const url = new URL(
|
|
104187
|
+
function buildUrl(baseUrl, path16, query) {
|
|
104188
|
+
const url = new URL(path16, baseUrl);
|
|
104190
104189
|
if (query) {
|
|
104191
104190
|
for (const [key, value] of Object.entries(query)) {
|
|
104192
104191
|
if (value !== void 0) {
|
|
@@ -104216,12 +104215,12 @@ function createFetchClient(options) {
|
|
|
104216
104215
|
return {
|
|
104217
104216
|
async request({
|
|
104218
104217
|
method,
|
|
104219
|
-
path:
|
|
104218
|
+
path: path16,
|
|
104220
104219
|
query,
|
|
104221
104220
|
body,
|
|
104222
104221
|
headers
|
|
104223
104222
|
}) {
|
|
104224
|
-
const url = buildUrl(options.baseUrl,
|
|
104223
|
+
const url = buildUrl(options.baseUrl, path16, query);
|
|
104225
104224
|
const authHeaders = await buildAuthHeaders(options.auth);
|
|
104226
104225
|
const res = await fetchFn(url, {
|
|
104227
104226
|
method,
|
|
@@ -105119,7 +105118,7 @@ var init_dist3 = __esm({
|
|
|
105119
105118
|
* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
|
105120
105119
|
* @param fileBody The body of the file to be stored in the bucket.
|
|
105121
105120
|
*/
|
|
105122
|
-
async uploadOrUpdate(method,
|
|
105121
|
+
async uploadOrUpdate(method, path16, fileBody, fileOptions) {
|
|
105123
105122
|
var _this = this;
|
|
105124
105123
|
return _this.handleOperation(async () => {
|
|
105125
105124
|
let body;
|
|
@@ -105143,7 +105142,7 @@ var init_dist3 = __esm({
|
|
|
105143
105142
|
if ((typeof ReadableStream !== "undefined" && body instanceof ReadableStream || body && typeof body === "object" && "pipe" in body && typeof body.pipe === "function") && !options.duplex) options.duplex = "half";
|
|
105144
105143
|
}
|
|
105145
105144
|
if (fileOptions === null || fileOptions === void 0 ? void 0 : fileOptions.headers) for (const [key, value] of Object.entries(fileOptions.headers)) headers = setHeader(headers, key, value);
|
|
105146
|
-
const cleanPath = _this._removeEmptyFolders(
|
|
105145
|
+
const cleanPath = _this._removeEmptyFolders(path16);
|
|
105147
105146
|
const _path = _this._getFinalPath(cleanPath);
|
|
105148
105147
|
const data = await (method == "PUT" ? put : post)(_this.fetch, `${_this.url}/object/${_path}`, body, _objectSpread22({ headers }, (options === null || options === void 0 ? void 0 : options.duplex) ? { duplex: options.duplex } : {}));
|
|
105149
105148
|
return {
|
|
@@ -105205,8 +105204,8 @@ var init_dist3 = __esm({
|
|
|
105205
105204
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105206
105205
|
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
105207
105206
|
*/
|
|
105208
|
-
async upload(
|
|
105209
|
-
return this.uploadOrUpdate("POST",
|
|
105207
|
+
async upload(path16, fileBody, fileOptions) {
|
|
105208
|
+
return this.uploadOrUpdate("POST", path16, fileBody, fileOptions);
|
|
105210
105209
|
}
|
|
105211
105210
|
/**
|
|
105212
105211
|
* Upload a file with a token generated from `createSignedUploadUrl`.
|
|
@@ -105246,9 +105245,9 @@ var init_dist3 = __esm({
|
|
|
105246
105245
|
* - `objects` table permissions: none
|
|
105247
105246
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105248
105247
|
*/
|
|
105249
|
-
async uploadToSignedUrl(
|
|
105248
|
+
async uploadToSignedUrl(path16, token, fileBody, fileOptions) {
|
|
105250
105249
|
var _this3 = this;
|
|
105251
|
-
const cleanPath = _this3._removeEmptyFolders(
|
|
105250
|
+
const cleanPath = _this3._removeEmptyFolders(path16);
|
|
105252
105251
|
const _path = _this3._getFinalPath(cleanPath);
|
|
105253
105252
|
const url = new URL(_this3.url + `/object/upload/sign/${_path}`);
|
|
105254
105253
|
url.searchParams.set("token", token);
|
|
@@ -105317,10 +105316,10 @@ var init_dist3 = __esm({
|
|
|
105317
105316
|
* - `objects` table permissions: `insert`
|
|
105318
105317
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105319
105318
|
*/
|
|
105320
|
-
async createSignedUploadUrl(
|
|
105319
|
+
async createSignedUploadUrl(path16, options) {
|
|
105321
105320
|
var _this4 = this;
|
|
105322
105321
|
return _this4.handleOperation(async () => {
|
|
105323
|
-
let _path = _this4._getFinalPath(
|
|
105322
|
+
let _path = _this4._getFinalPath(path16);
|
|
105324
105323
|
const headers = _objectSpread22({}, _this4.headers);
|
|
105325
105324
|
if (options === null || options === void 0 ? void 0 : options.upsert) headers["x-upsert"] = "true";
|
|
105326
105325
|
const data = await post(_this4.fetch, `${_this4.url}/object/upload/sign/${_path}`, {}, { headers });
|
|
@@ -105329,7 +105328,7 @@ var init_dist3 = __esm({
|
|
|
105329
105328
|
if (!token) throw new StorageError("No token returned by API");
|
|
105330
105329
|
return {
|
|
105331
105330
|
signedUrl: url.toString(),
|
|
105332
|
-
path:
|
|
105331
|
+
path: path16,
|
|
105333
105332
|
token
|
|
105334
105333
|
};
|
|
105335
105334
|
});
|
|
@@ -105389,8 +105388,8 @@ var init_dist3 = __esm({
|
|
|
105389
105388
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105390
105389
|
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
105391
105390
|
*/
|
|
105392
|
-
async update(
|
|
105393
|
-
return this.uploadOrUpdate("PUT",
|
|
105391
|
+
async update(path16, fileBody, fileOptions) {
|
|
105392
|
+
return this.uploadOrUpdate("PUT", path16, fileBody, fileOptions);
|
|
105394
105393
|
}
|
|
105395
105394
|
/**
|
|
105396
105395
|
* Moves an existing file to a new path in the same bucket.
|
|
@@ -105541,10 +105540,10 @@ var init_dist3 = __esm({
|
|
|
105541
105540
|
* - `objects` table permissions: `select`
|
|
105542
105541
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105543
105542
|
*/
|
|
105544
|
-
async createSignedUrl(
|
|
105543
|
+
async createSignedUrl(path16, expiresIn, options) {
|
|
105545
105544
|
var _this8 = this;
|
|
105546
105545
|
return _this8.handleOperation(async () => {
|
|
105547
|
-
let _path = _this8._getFinalPath(
|
|
105546
|
+
let _path = _this8._getFinalPath(path16);
|
|
105548
105547
|
const hasTransform = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0;
|
|
105549
105548
|
let data = await post(_this8.fetch, `${_this8.url}/object/sign/${_path}`, _objectSpread22({ expiresIn }, hasTransform ? { transform: options.transform } : {}), { headers: _this8.headers });
|
|
105550
105549
|
const query = new URLSearchParams();
|
|
@@ -105680,13 +105679,13 @@ var init_dist3 = __esm({
|
|
|
105680
105679
|
* - `objects` table permissions: `select`
|
|
105681
105680
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105682
105681
|
*/
|
|
105683
|
-
download(
|
|
105682
|
+
download(path16, options, parameters) {
|
|
105684
105683
|
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0 ? "render/image/authenticated" : "object";
|
|
105685
105684
|
const query = new URLSearchParams();
|
|
105686
105685
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
105687
105686
|
if ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set("cacheNonce", String(options.cacheNonce));
|
|
105688
105687
|
const queryString = query.toString();
|
|
105689
|
-
const _path = this._getFinalPath(
|
|
105688
|
+
const _path = this._getFinalPath(path16);
|
|
105690
105689
|
const downloadFn = () => get(this.fetch, `${this.url}/${renderPath}/${_path}${queryString ? `?${queryString}` : ""}`, {
|
|
105691
105690
|
headers: this.headers,
|
|
105692
105691
|
noResolveJson: true
|
|
@@ -105717,9 +105716,9 @@ var init_dist3 = __esm({
|
|
|
105717
105716
|
* }
|
|
105718
105717
|
* ```
|
|
105719
105718
|
*/
|
|
105720
|
-
async info(
|
|
105719
|
+
async info(path16) {
|
|
105721
105720
|
var _this10 = this;
|
|
105722
|
-
const _path = _this10._getFinalPath(
|
|
105721
|
+
const _path = _this10._getFinalPath(path16);
|
|
105723
105722
|
return _this10.handleOperation(async () => {
|
|
105724
105723
|
return recursiveToCamel(await get(_this10.fetch, `${_this10.url}/object/info/${_path}`, { headers: _this10.headers }));
|
|
105725
105724
|
});
|
|
@@ -105740,9 +105739,9 @@ var init_dist3 = __esm({
|
|
|
105740
105739
|
* .exists('folder/avatar1.png')
|
|
105741
105740
|
* ```
|
|
105742
105741
|
*/
|
|
105743
|
-
async exists(
|
|
105742
|
+
async exists(path16) {
|
|
105744
105743
|
var _this11 = this;
|
|
105745
|
-
const _path = _this11._getFinalPath(
|
|
105744
|
+
const _path = _this11._getFinalPath(path16);
|
|
105746
105745
|
try {
|
|
105747
105746
|
await head(_this11.fetch, `${_this11.url}/object/${_path}`, { headers: _this11.headers });
|
|
105748
105747
|
return {
|
|
@@ -105821,8 +105820,8 @@ var init_dist3 = __esm({
|
|
|
105821
105820
|
* - `objects` table permissions: none
|
|
105822
105821
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105823
105822
|
*/
|
|
105824
|
-
getPublicUrl(
|
|
105825
|
-
const _path = this._getFinalPath(
|
|
105823
|
+
getPublicUrl(path16, options) {
|
|
105824
|
+
const _path = this._getFinalPath(path16);
|
|
105826
105825
|
const query = new URLSearchParams();
|
|
105827
105826
|
if (options === null || options === void 0 ? void 0 : options.download) query.set("download", options.download === true ? "" : options.download);
|
|
105828
105827
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
@@ -105961,10 +105960,10 @@ var init_dist3 = __esm({
|
|
|
105961
105960
|
* - `objects` table permissions: `select`
|
|
105962
105961
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
105963
105962
|
*/
|
|
105964
|
-
async list(
|
|
105963
|
+
async list(path16, options, parameters) {
|
|
105965
105964
|
var _this13 = this;
|
|
105966
105965
|
return _this13.handleOperation(async () => {
|
|
105967
|
-
const body = _objectSpread22(_objectSpread22(_objectSpread22({}, DEFAULT_SEARCH_OPTIONS), options), {}, { prefix:
|
|
105966
|
+
const body = _objectSpread22(_objectSpread22(_objectSpread22({}, DEFAULT_SEARCH_OPTIONS), options), {}, { prefix: path16 || "" });
|
|
105968
105967
|
return await post(_this13.fetch, `${_this13.url}/object/list/${_this13.bucketId}`, body, { headers: _this13.headers }, parameters);
|
|
105969
105968
|
});
|
|
105970
105969
|
}
|
|
@@ -106029,11 +106028,11 @@ var init_dist3 = __esm({
|
|
|
106029
106028
|
if (typeof Buffer !== "undefined") return Buffer.from(data).toString("base64");
|
|
106030
106029
|
return btoa(data);
|
|
106031
106030
|
}
|
|
106032
|
-
_getFinalPath(
|
|
106033
|
-
return `${this.bucketId}/${
|
|
106031
|
+
_getFinalPath(path16) {
|
|
106032
|
+
return `${this.bucketId}/${path16.replace(/^\/+/, "")}`;
|
|
106034
106033
|
}
|
|
106035
|
-
_removeEmptyFolders(
|
|
106036
|
-
return
|
|
106034
|
+
_removeEmptyFolders(path16) {
|
|
106035
|
+
return path16.replace(/^\/|\/$/g, "").replace(/\/+/g, "/");
|
|
106037
106036
|
}
|
|
106038
106037
|
/** Modifies the `query`, appending values the from `transform` */
|
|
106039
106038
|
applyTransformOptsToQuery(query, transform) {
|
|
@@ -117511,9 +117510,9 @@ function fetchClaudeCodeMessages(option, opts, model) {
|
|
|
117511
117510
|
signal: providerAbort.signal
|
|
117512
117511
|
}).finally(providerAbort.clear);
|
|
117513
117512
|
}
|
|
117514
|
-
function claudeCodeEndpoint(
|
|
117513
|
+
function claudeCodeEndpoint(path16) {
|
|
117515
117514
|
const base = (envVar("CLAUDE_CODE_BASE_URL") ?? envVar("CLAUDE_CODE_BACKEND_BASE_URL") ?? "https://api.anthropic.com").replace(/\/$/, "");
|
|
117516
|
-
const endpoint = base.endsWith(`/v1/${
|
|
117515
|
+
const endpoint = base.endsWith(`/v1/${path16}`) || base.endsWith(`/${path16}`) ? base : `${base}/v1/${path16}`;
|
|
117517
117516
|
const url = new URL(endpoint);
|
|
117518
117517
|
url.searchParams.set("beta", "true");
|
|
117519
117518
|
return url.toString();
|
|
@@ -117767,9 +117766,9 @@ function parseCodexToolCallItem(item, index) {
|
|
|
117767
117766
|
rawArgumentsText
|
|
117768
117767
|
};
|
|
117769
117768
|
}
|
|
117770
|
-
function codexEndpoint(
|
|
117769
|
+
function codexEndpoint(path16) {
|
|
117771
117770
|
const base = (envVar("CODEX_BACKEND_BASE_URL") ?? envVar("CODEX_OAUTH_BASE_URL") ?? "https://chatgpt.com/backend-api/codex").replace(/\/$/, "");
|
|
117772
|
-
const endpoint = base.endsWith(`/${
|
|
117771
|
+
const endpoint = base.endsWith(`/${path16}`) ? base : `${base}/${path16}`;
|
|
117773
117772
|
const url = new URL(endpoint);
|
|
117774
117773
|
url.searchParams.set("client_version", codexClientVersion());
|
|
117775
117774
|
return url.toString();
|
|
@@ -125393,8 +125392,8 @@ var require_dist2 = __commonJS({
|
|
|
125393
125392
|
return this.status === 419;
|
|
125394
125393
|
}
|
|
125395
125394
|
};
|
|
125396
|
-
function buildUrl2(baseUrl,
|
|
125397
|
-
const url = new URL(
|
|
125395
|
+
function buildUrl2(baseUrl, path16, query) {
|
|
125396
|
+
const url = new URL(path16, baseUrl);
|
|
125398
125397
|
if (query) {
|
|
125399
125398
|
for (const [key, value] of Object.entries(query)) {
|
|
125400
125399
|
if (value !== void 0) {
|
|
@@ -125424,12 +125423,12 @@ var require_dist2 = __commonJS({
|
|
|
125424
125423
|
return {
|
|
125425
125424
|
async request({
|
|
125426
125425
|
method,
|
|
125427
|
-
path:
|
|
125426
|
+
path: path16,
|
|
125428
125427
|
query,
|
|
125429
125428
|
body,
|
|
125430
125429
|
headers
|
|
125431
125430
|
}) {
|
|
125432
|
-
const url = buildUrl2(options.baseUrl,
|
|
125431
|
+
const url = buildUrl2(options.baseUrl, path16, query);
|
|
125433
125432
|
const authHeaders = await buildAuthHeaders2(options.auth);
|
|
125434
125433
|
const res = await fetchFn(url, {
|
|
125435
125434
|
method,
|
|
@@ -126370,7 +126369,7 @@ var require_dist3 = __commonJS({
|
|
|
126370
126369
|
* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
|
126371
126370
|
* @param fileBody The body of the file to be stored in the bucket.
|
|
126372
126371
|
*/
|
|
126373
|
-
async uploadOrUpdate(method,
|
|
126372
|
+
async uploadOrUpdate(method, path16, fileBody, fileOptions) {
|
|
126374
126373
|
var _this = this;
|
|
126375
126374
|
return _this.handleOperation(async () => {
|
|
126376
126375
|
let body;
|
|
@@ -126394,7 +126393,7 @@ var require_dist3 = __commonJS({
|
|
|
126394
126393
|
if ((typeof ReadableStream !== "undefined" && body instanceof ReadableStream || body && typeof body === "object" && "pipe" in body && typeof body.pipe === "function") && !options.duplex) options.duplex = "half";
|
|
126395
126394
|
}
|
|
126396
126395
|
if (fileOptions === null || fileOptions === void 0 ? void 0 : fileOptions.headers) for (const [key, value] of Object.entries(fileOptions.headers)) headers = setHeader2(headers, key, value);
|
|
126397
|
-
const cleanPath = _this._removeEmptyFolders(
|
|
126396
|
+
const cleanPath = _this._removeEmptyFolders(path16);
|
|
126398
126397
|
const _path = _this._getFinalPath(cleanPath);
|
|
126399
126398
|
const data = await (method == "PUT" ? put2 : post2)(_this.fetch, `${_this.url}/object/${_path}`, body, _objectSpread24({ headers }, (options === null || options === void 0 ? void 0 : options.duplex) ? { duplex: options.duplex } : {}));
|
|
126400
126399
|
return {
|
|
@@ -126456,8 +126455,8 @@ var require_dist3 = __commonJS({
|
|
|
126456
126455
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126457
126456
|
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
126458
126457
|
*/
|
|
126459
|
-
async upload(
|
|
126460
|
-
return this.uploadOrUpdate("POST",
|
|
126458
|
+
async upload(path16, fileBody, fileOptions) {
|
|
126459
|
+
return this.uploadOrUpdate("POST", path16, fileBody, fileOptions);
|
|
126461
126460
|
}
|
|
126462
126461
|
/**
|
|
126463
126462
|
* Upload a file with a token generated from `createSignedUploadUrl`.
|
|
@@ -126497,9 +126496,9 @@ var require_dist3 = __commonJS({
|
|
|
126497
126496
|
* - `objects` table permissions: none
|
|
126498
126497
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126499
126498
|
*/
|
|
126500
|
-
async uploadToSignedUrl(
|
|
126499
|
+
async uploadToSignedUrl(path16, token, fileBody, fileOptions) {
|
|
126501
126500
|
var _this3 = this;
|
|
126502
|
-
const cleanPath = _this3._removeEmptyFolders(
|
|
126501
|
+
const cleanPath = _this3._removeEmptyFolders(path16);
|
|
126503
126502
|
const _path = _this3._getFinalPath(cleanPath);
|
|
126504
126503
|
const url = new URL(_this3.url + `/object/upload/sign/${_path}`);
|
|
126505
126504
|
url.searchParams.set("token", token);
|
|
@@ -126568,10 +126567,10 @@ var require_dist3 = __commonJS({
|
|
|
126568
126567
|
* - `objects` table permissions: `insert`
|
|
126569
126568
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126570
126569
|
*/
|
|
126571
|
-
async createSignedUploadUrl(
|
|
126570
|
+
async createSignedUploadUrl(path16, options) {
|
|
126572
126571
|
var _this4 = this;
|
|
126573
126572
|
return _this4.handleOperation(async () => {
|
|
126574
|
-
let _path = _this4._getFinalPath(
|
|
126573
|
+
let _path = _this4._getFinalPath(path16);
|
|
126575
126574
|
const headers = _objectSpread24({}, _this4.headers);
|
|
126576
126575
|
if (options === null || options === void 0 ? void 0 : options.upsert) headers["x-upsert"] = "true";
|
|
126577
126576
|
const data = await post2(_this4.fetch, `${_this4.url}/object/upload/sign/${_path}`, {}, { headers });
|
|
@@ -126580,7 +126579,7 @@ var require_dist3 = __commonJS({
|
|
|
126580
126579
|
if (!token) throw new StorageError2("No token returned by API");
|
|
126581
126580
|
return {
|
|
126582
126581
|
signedUrl: url.toString(),
|
|
126583
|
-
path:
|
|
126582
|
+
path: path16,
|
|
126584
126583
|
token
|
|
126585
126584
|
};
|
|
126586
126585
|
});
|
|
@@ -126640,8 +126639,8 @@ var require_dist3 = __commonJS({
|
|
|
126640
126639
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126641
126640
|
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
126642
126641
|
*/
|
|
126643
|
-
async update(
|
|
126644
|
-
return this.uploadOrUpdate("PUT",
|
|
126642
|
+
async update(path16, fileBody, fileOptions) {
|
|
126643
|
+
return this.uploadOrUpdate("PUT", path16, fileBody, fileOptions);
|
|
126645
126644
|
}
|
|
126646
126645
|
/**
|
|
126647
126646
|
* Moves an existing file to a new path in the same bucket.
|
|
@@ -126792,10 +126791,10 @@ var require_dist3 = __commonJS({
|
|
|
126792
126791
|
* - `objects` table permissions: `select`
|
|
126793
126792
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126794
126793
|
*/
|
|
126795
|
-
async createSignedUrl(
|
|
126794
|
+
async createSignedUrl(path16, expiresIn, options) {
|
|
126796
126795
|
var _this8 = this;
|
|
126797
126796
|
return _this8.handleOperation(async () => {
|
|
126798
|
-
let _path = _this8._getFinalPath(
|
|
126797
|
+
let _path = _this8._getFinalPath(path16);
|
|
126799
126798
|
const hasTransform = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0;
|
|
126800
126799
|
let data = await post2(_this8.fetch, `${_this8.url}/object/sign/${_path}`, _objectSpread24({ expiresIn }, hasTransform ? { transform: options.transform } : {}), { headers: _this8.headers });
|
|
126801
126800
|
const query = new URLSearchParams();
|
|
@@ -126931,13 +126930,13 @@ var require_dist3 = __commonJS({
|
|
|
126931
126930
|
* - `objects` table permissions: `select`
|
|
126932
126931
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
126933
126932
|
*/
|
|
126934
|
-
download(
|
|
126933
|
+
download(path16, options, parameters) {
|
|
126935
126934
|
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0 ? "render/image/authenticated" : "object";
|
|
126936
126935
|
const query = new URLSearchParams();
|
|
126937
126936
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
126938
126937
|
if ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set("cacheNonce", String(options.cacheNonce));
|
|
126939
126938
|
const queryString = query.toString();
|
|
126940
|
-
const _path = this._getFinalPath(
|
|
126939
|
+
const _path = this._getFinalPath(path16);
|
|
126941
126940
|
const downloadFn = () => get3(this.fetch, `${this.url}/${renderPath}/${_path}${queryString ? `?${queryString}` : ""}`, {
|
|
126942
126941
|
headers: this.headers,
|
|
126943
126942
|
noResolveJson: true
|
|
@@ -126968,9 +126967,9 @@ var require_dist3 = __commonJS({
|
|
|
126968
126967
|
* }
|
|
126969
126968
|
* ```
|
|
126970
126969
|
*/
|
|
126971
|
-
async info(
|
|
126970
|
+
async info(path16) {
|
|
126972
126971
|
var _this10 = this;
|
|
126973
|
-
const _path = _this10._getFinalPath(
|
|
126972
|
+
const _path = _this10._getFinalPath(path16);
|
|
126974
126973
|
return _this10.handleOperation(async () => {
|
|
126975
126974
|
return recursiveToCamel2(await get3(_this10.fetch, `${_this10.url}/object/info/${_path}`, { headers: _this10.headers }));
|
|
126976
126975
|
});
|
|
@@ -126991,9 +126990,9 @@ var require_dist3 = __commonJS({
|
|
|
126991
126990
|
* .exists('folder/avatar1.png')
|
|
126992
126991
|
* ```
|
|
126993
126992
|
*/
|
|
126994
|
-
async exists(
|
|
126993
|
+
async exists(path16) {
|
|
126995
126994
|
var _this11 = this;
|
|
126996
|
-
const _path = _this11._getFinalPath(
|
|
126995
|
+
const _path = _this11._getFinalPath(path16);
|
|
126997
126996
|
try {
|
|
126998
126997
|
await head2(_this11.fetch, `${_this11.url}/object/${_path}`, { headers: _this11.headers });
|
|
126999
126998
|
return {
|
|
@@ -127072,8 +127071,8 @@ var require_dist3 = __commonJS({
|
|
|
127072
127071
|
* - `objects` table permissions: none
|
|
127073
127072
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
127074
127073
|
*/
|
|
127075
|
-
getPublicUrl(
|
|
127076
|
-
const _path = this._getFinalPath(
|
|
127074
|
+
getPublicUrl(path16, options) {
|
|
127075
|
+
const _path = this._getFinalPath(path16);
|
|
127077
127076
|
const query = new URLSearchParams();
|
|
127078
127077
|
if (options === null || options === void 0 ? void 0 : options.download) query.set("download", options.download === true ? "" : options.download);
|
|
127079
127078
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
@@ -127212,10 +127211,10 @@ var require_dist3 = __commonJS({
|
|
|
127212
127211
|
* - `objects` table permissions: `select`
|
|
127213
127212
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
127214
127213
|
*/
|
|
127215
|
-
async list(
|
|
127214
|
+
async list(path16, options, parameters) {
|
|
127216
127215
|
var _this13 = this;
|
|
127217
127216
|
return _this13.handleOperation(async () => {
|
|
127218
|
-
const body = _objectSpread24(_objectSpread24(_objectSpread24({}, DEFAULT_SEARCH_OPTIONS2), options), {}, { prefix:
|
|
127217
|
+
const body = _objectSpread24(_objectSpread24(_objectSpread24({}, DEFAULT_SEARCH_OPTIONS2), options), {}, { prefix: path16 || "" });
|
|
127219
127218
|
return await post2(_this13.fetch, `${_this13.url}/object/list/${_this13.bucketId}`, body, { headers: _this13.headers }, parameters);
|
|
127220
127219
|
});
|
|
127221
127220
|
}
|
|
@@ -127280,11 +127279,11 @@ var require_dist3 = __commonJS({
|
|
|
127280
127279
|
if (typeof Buffer !== "undefined") return Buffer.from(data).toString("base64");
|
|
127281
127280
|
return btoa(data);
|
|
127282
127281
|
}
|
|
127283
|
-
_getFinalPath(
|
|
127284
|
-
return `${this.bucketId}/${
|
|
127282
|
+
_getFinalPath(path16) {
|
|
127283
|
+
return `${this.bucketId}/${path16.replace(/^\/+/, "")}`;
|
|
127285
127284
|
}
|
|
127286
|
-
_removeEmptyFolders(
|
|
127287
|
-
return
|
|
127285
|
+
_removeEmptyFolders(path16) {
|
|
127286
|
+
return path16.replace(/^\/|\/$/g, "").replace(/\/+/g, "/");
|
|
127288
127287
|
}
|
|
127289
127288
|
/** Modifies the `query`, appending values the from `transform` */
|
|
127290
127289
|
applyTransformOptsToQuery(query, transform) {
|
|
@@ -138318,11 +138317,11 @@ async function pickFolder(request) {
|
|
|
138318
138317
|
if (result2.ok) notifyApprovedRootsChanged();
|
|
138319
138318
|
return result2;
|
|
138320
138319
|
}
|
|
138321
|
-
async function approveFolderAccess(
|
|
138320
|
+
async function approveFolderAccess(path16, options) {
|
|
138322
138321
|
const bridge = getDesktopBridge();
|
|
138323
138322
|
if (!bridge) return { ok: false, error: LOCAL_WORKSPACE_ACCESS_UNAVAILABLE };
|
|
138324
138323
|
const result2 = await bridge.approveFolderAccess({
|
|
138325
|
-
path:
|
|
138324
|
+
path: path16,
|
|
138326
138325
|
permissionMode: currentPermissionMode(),
|
|
138327
138326
|
grantedVia: options?.grantedVia ?? null
|
|
138328
138327
|
});
|
|
@@ -139347,8 +139346,8 @@ function wrapReason(ex) {
|
|
|
139347
139346
|
return new UnknownErrorException(ex.message, ex.toString());
|
|
139348
139347
|
}
|
|
139349
139348
|
async function node_utils_fetchData(url) {
|
|
139350
|
-
const
|
|
139351
|
-
const data = await
|
|
139349
|
+
const fs16 = process.getBuiltinModule("fs");
|
|
139350
|
+
const data = await fs16.promises.readFile(url);
|
|
139352
139351
|
return new Uint8Array(data);
|
|
139353
139352
|
}
|
|
139354
139353
|
function applyBoundingBox(ctx, bbox) {
|
|
@@ -139749,7 +139748,7 @@ function compileType3Glyph(imgData) {
|
|
|
139749
139748
|
return null;
|
|
139750
139749
|
}
|
|
139751
139750
|
const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);
|
|
139752
|
-
const
|
|
139751
|
+
const path16 = new Path2D();
|
|
139753
139752
|
for (i = 0; count && i <= height; i++) {
|
|
139754
139753
|
let p = i * width1;
|
|
139755
139754
|
const end = p + width;
|
|
@@ -139759,7 +139758,7 @@ function compileType3Glyph(imgData) {
|
|
|
139759
139758
|
if (p === end) {
|
|
139760
139759
|
continue;
|
|
139761
139760
|
}
|
|
139762
|
-
|
|
139761
|
+
path16.moveTo(p % width1, i);
|
|
139763
139762
|
const p0 = p;
|
|
139764
139763
|
let type = points[p];
|
|
139765
139764
|
do {
|
|
@@ -139775,7 +139774,7 @@ function compileType3Glyph(imgData) {
|
|
|
139775
139774
|
type = pp & 51 * type >> 4;
|
|
139776
139775
|
points[p] &= type >> 2 | type << 2;
|
|
139777
139776
|
}
|
|
139778
|
-
|
|
139777
|
+
path16.lineTo(p % width1, p / width1 | 0);
|
|
139779
139778
|
if (!points[p]) {
|
|
139780
139779
|
--count;
|
|
139781
139780
|
}
|
|
@@ -139788,7 +139787,7 @@ function compileType3Glyph(imgData) {
|
|
|
139788
139787
|
c.save();
|
|
139789
139788
|
c.scale(1 / width, -1 / height);
|
|
139790
139789
|
c.translate(0, -height);
|
|
139791
|
-
c.fill(
|
|
139790
|
+
c.fill(path16);
|
|
139792
139791
|
c.beginPath();
|
|
139793
139792
|
c.restore();
|
|
139794
139793
|
};
|
|
@@ -149375,11 +149374,11 @@ var init_pdf = __esm({
|
|
|
149375
149374
|
} catch (ex) {
|
|
149376
149375
|
warn(`getPathGenerator - ignoring character: "${ex}".`);
|
|
149377
149376
|
}
|
|
149378
|
-
const
|
|
149377
|
+
const path16 = new Path2D(cmds || "");
|
|
149379
149378
|
if (!this.fontExtraProperties) {
|
|
149380
149379
|
objs.delete(objId);
|
|
149381
149380
|
}
|
|
149382
|
-
return this.compiledGlyphs[character] =
|
|
149381
|
+
return this.compiledGlyphs[character] = path16;
|
|
149383
149382
|
}
|
|
149384
149383
|
};
|
|
149385
149384
|
CallbackKind = {
|
|
@@ -151390,9 +151389,9 @@ var init_pdf = __esm({
|
|
|
151390
151389
|
x,
|
|
151391
151390
|
y,
|
|
151392
151391
|
fontSize,
|
|
151393
|
-
path:
|
|
151392
|
+
path: path16
|
|
151394
151393
|
} of paths) {
|
|
151395
|
-
newPath.addPath(
|
|
151394
|
+
newPath.addPath(path16, new DOMMatrix(transform).preMultiplySelf(invTransf).translate(x, y).scale(fontSize, -fontSize));
|
|
151396
151395
|
}
|
|
151397
151396
|
ctx.clip(newPath);
|
|
151398
151397
|
ctx.beginPath();
|
|
@@ -151472,9 +151471,9 @@ var init_pdf = __esm({
|
|
|
151472
151471
|
nextLine() {
|
|
151473
151472
|
this.moveText(0, this.current.leading);
|
|
151474
151473
|
}
|
|
151475
|
-
#getScaledPath(
|
|
151474
|
+
#getScaledPath(path16, currentTransform, transform) {
|
|
151476
151475
|
const newPath = new Path2D();
|
|
151477
|
-
newPath.addPath(
|
|
151476
|
+
newPath.addPath(path16, new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform));
|
|
151478
151477
|
return newPath;
|
|
151479
151478
|
}
|
|
151480
151479
|
paintChar(character, x, y, patternFillTransform, patternStrokeTransform) {
|
|
@@ -151487,9 +151486,9 @@ var init_pdf = __esm({
|
|
|
151487
151486
|
const isAddToPathSet = !!(textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG);
|
|
151488
151487
|
const patternFill = current.patternFill && !font.missingFile;
|
|
151489
151488
|
const patternStroke = current.patternStroke && !font.missingFile;
|
|
151490
|
-
let
|
|
151489
|
+
let path16;
|
|
151491
151490
|
if (font.disableFontFace || isAddToPathSet || patternFill || patternStroke) {
|
|
151492
|
-
|
|
151491
|
+
path16 = font.getPathGenerator(this.commonObjs, character);
|
|
151493
151492
|
}
|
|
151494
151493
|
if (font.disableFontFace || patternFill || patternStroke) {
|
|
151495
151494
|
ctx.save();
|
|
@@ -151499,19 +151498,19 @@ var init_pdf = __esm({
|
|
|
151499
151498
|
if (patternFillTransform) {
|
|
151500
151499
|
const currentTransform = ctx.getTransform();
|
|
151501
151500
|
ctx.setTransform(...patternFillTransform);
|
|
151502
|
-
ctx.fill(this.#getScaledPath(
|
|
151501
|
+
ctx.fill(this.#getScaledPath(path16, currentTransform, patternFillTransform));
|
|
151503
151502
|
} else {
|
|
151504
|
-
ctx.fill(
|
|
151503
|
+
ctx.fill(path16);
|
|
151505
151504
|
}
|
|
151506
151505
|
}
|
|
151507
151506
|
if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) {
|
|
151508
151507
|
if (patternStrokeTransform) {
|
|
151509
151508
|
const currentTransform = ctx.getTransform();
|
|
151510
151509
|
ctx.setTransform(...patternStrokeTransform);
|
|
151511
|
-
ctx.stroke(this.#getScaledPath(
|
|
151510
|
+
ctx.stroke(this.#getScaledPath(path16, currentTransform, patternStrokeTransform));
|
|
151512
151511
|
} else {
|
|
151513
151512
|
ctx.lineWidth /= fontSize;
|
|
151514
|
-
ctx.stroke(
|
|
151513
|
+
ctx.stroke(path16);
|
|
151515
151514
|
}
|
|
151516
151515
|
}
|
|
151517
151516
|
ctx.restore();
|
|
@@ -151530,7 +151529,7 @@ var init_pdf = __esm({
|
|
|
151530
151529
|
x,
|
|
151531
151530
|
y,
|
|
151532
151531
|
fontSize,
|
|
151533
|
-
path:
|
|
151532
|
+
path: path16
|
|
151534
151533
|
});
|
|
151535
151534
|
}
|
|
151536
151535
|
}
|
|
@@ -153545,10 +153544,10 @@ var init_pdf = __esm({
|
|
|
153545
153544
|
this._readableStream = null;
|
|
153546
153545
|
this._readCapability = Promise.withResolvers();
|
|
153547
153546
|
this._headersCapability = Promise.withResolvers();
|
|
153548
|
-
const
|
|
153549
|
-
|
|
153547
|
+
const fs16 = process.getBuiltinModule("fs");
|
|
153548
|
+
fs16.promises.lstat(this._url).then((stat2) => {
|
|
153550
153549
|
this._contentLength = stat2.size;
|
|
153551
|
-
this._setReadableStream(
|
|
153550
|
+
this._setReadableStream(fs16.createReadStream(this._url));
|
|
153552
153551
|
this._headersCapability.resolve();
|
|
153553
153552
|
}, (error) => {
|
|
153554
153553
|
if (error.code === "ENOENT") {
|
|
@@ -153643,8 +153642,8 @@ var init_pdf = __esm({
|
|
|
153643
153642
|
this._readCapability = Promise.withResolvers();
|
|
153644
153643
|
const source = stream.source;
|
|
153645
153644
|
this._isStreamingSupported = !source.disableStream;
|
|
153646
|
-
const
|
|
153647
|
-
this._setReadableStream(
|
|
153645
|
+
const fs16 = process.getBuiltinModule("fs");
|
|
153646
|
+
this._setReadableStream(fs16.createReadStream(this._url, {
|
|
153648
153647
|
start,
|
|
153649
153648
|
end: end - 1
|
|
153650
153649
|
}));
|
|
@@ -163868,13 +163867,13 @@ var init_pdf = __esm({
|
|
|
163868
163867
|
const root2 = this.#createSVG();
|
|
163869
163868
|
const defs = _DrawLayer._svgFactory.createElement("defs");
|
|
163870
163869
|
root2.append(defs);
|
|
163871
|
-
const
|
|
163872
|
-
defs.append(
|
|
163870
|
+
const path16 = _DrawLayer._svgFactory.createElement("path");
|
|
163871
|
+
defs.append(path16);
|
|
163873
163872
|
const pathId = `path_p${this.pageIndex}_${id}`;
|
|
163874
|
-
|
|
163875
|
-
|
|
163873
|
+
path16.setAttribute("id", pathId);
|
|
163874
|
+
path16.setAttribute("vector-effect", "non-scaling-stroke");
|
|
163876
163875
|
if (isPathUpdatable) {
|
|
163877
|
-
this.#toUpdate.set(id,
|
|
163876
|
+
this.#toUpdate.set(id, path16);
|
|
163878
163877
|
}
|
|
163879
163878
|
const clipPathId = hasClip ? this.#createClipPath(defs, pathId) : null;
|
|
163880
163879
|
const use = _DrawLayer._svgFactory.createElement("use");
|
|
@@ -163892,11 +163891,11 @@ var init_pdf = __esm({
|
|
|
163892
163891
|
const root2 = this.#createSVG();
|
|
163893
163892
|
const defs = _DrawLayer._svgFactory.createElement("defs");
|
|
163894
163893
|
root2.append(defs);
|
|
163895
|
-
const
|
|
163896
|
-
defs.append(
|
|
163894
|
+
const path16 = _DrawLayer._svgFactory.createElement("path");
|
|
163895
|
+
defs.append(path16);
|
|
163897
163896
|
const pathId = `path_p${this.pageIndex}_${id}`;
|
|
163898
|
-
|
|
163899
|
-
|
|
163897
|
+
path16.setAttribute("id", pathId);
|
|
163898
|
+
path16.setAttribute("vector-effect", "non-scaling-stroke");
|
|
163900
163899
|
let maskId;
|
|
163901
163900
|
if (mustRemoveSelfIntersections) {
|
|
163902
163901
|
const mask = _DrawLayer._svgFactory.createElement("mask");
|
|
@@ -163943,7 +163942,7 @@ var init_pdf = __esm({
|
|
|
163943
163942
|
root: root2,
|
|
163944
163943
|
bbox,
|
|
163945
163944
|
rootClass,
|
|
163946
|
-
path:
|
|
163945
|
+
path: path16
|
|
163947
163946
|
} = properties;
|
|
163948
163947
|
const element = typeof elementOrId === "number" ? this.#mapping.get(elementOrId) : elementOrId;
|
|
163949
163948
|
if (!element) {
|
|
@@ -163963,10 +163962,10 @@ var init_pdf = __esm({
|
|
|
163963
163962
|
classList.toggle(className, value);
|
|
163964
163963
|
}
|
|
163965
163964
|
}
|
|
163966
|
-
if (
|
|
163965
|
+
if (path16) {
|
|
163967
163966
|
const defs = element.firstChild;
|
|
163968
163967
|
const pathElement = defs.firstChild;
|
|
163969
|
-
this.#updateProperties(pathElement,
|
|
163968
|
+
this.#updateProperties(pathElement, path16);
|
|
163970
163969
|
}
|
|
163971
163970
|
}
|
|
163972
163971
|
updateParent(id, layer) {
|
|
@@ -164923,8 +164922,8 @@ var init_tap = __esm({
|
|
|
164923
164922
|
});
|
|
164924
164923
|
|
|
164925
164924
|
// node_modules/underscore/modules/toPath.js
|
|
164926
|
-
function toPath(
|
|
164927
|
-
return isArray_default(
|
|
164925
|
+
function toPath(path16) {
|
|
164926
|
+
return isArray_default(path16) ? path16 : [path16];
|
|
164928
164927
|
}
|
|
164929
164928
|
var init_toPath = __esm({
|
|
164930
164929
|
"node_modules/underscore/modules/toPath.js"() {
|
|
@@ -164935,8 +164934,8 @@ var init_toPath = __esm({
|
|
|
164935
164934
|
});
|
|
164936
164935
|
|
|
164937
164936
|
// node_modules/underscore/modules/_toPath.js
|
|
164938
|
-
function toPath2(
|
|
164939
|
-
return _.toPath(
|
|
164937
|
+
function toPath2(path16) {
|
|
164938
|
+
return _.toPath(path16);
|
|
164940
164939
|
}
|
|
164941
164940
|
var init_toPath2 = __esm({
|
|
164942
164941
|
"node_modules/underscore/modules/_toPath.js"() {
|
|
@@ -164946,11 +164945,11 @@ var init_toPath2 = __esm({
|
|
|
164946
164945
|
});
|
|
164947
164946
|
|
|
164948
164947
|
// node_modules/underscore/modules/_deepGet.js
|
|
164949
|
-
function deepGet(obj2,
|
|
164950
|
-
var length =
|
|
164948
|
+
function deepGet(obj2, path16) {
|
|
164949
|
+
var length = path16.length;
|
|
164951
164950
|
for (var i = 0; i < length; i++) {
|
|
164952
164951
|
if (obj2 == null) return void 0;
|
|
164953
|
-
obj2 = obj2[
|
|
164952
|
+
obj2 = obj2[path16[i]];
|
|
164954
164953
|
}
|
|
164955
164954
|
return length ? obj2 : void 0;
|
|
164956
164955
|
}
|
|
@@ -164960,8 +164959,8 @@ var init_deepGet = __esm({
|
|
|
164960
164959
|
});
|
|
164961
164960
|
|
|
164962
164961
|
// node_modules/underscore/modules/get.js
|
|
164963
|
-
function get2(object2,
|
|
164964
|
-
var value = deepGet(object2, toPath2(
|
|
164962
|
+
function get2(object2, path16, defaultValue) {
|
|
164963
|
+
var value = deepGet(object2, toPath2(path16));
|
|
164965
164964
|
return isUndefined(value) ? defaultValue : value;
|
|
164966
164965
|
}
|
|
164967
164966
|
var init_get = __esm({
|
|
@@ -164973,11 +164972,11 @@ var init_get = __esm({
|
|
|
164973
164972
|
});
|
|
164974
164973
|
|
|
164975
164974
|
// node_modules/underscore/modules/has.js
|
|
164976
|
-
function has2(obj2,
|
|
164977
|
-
|
|
164978
|
-
var length =
|
|
164975
|
+
function has2(obj2, path16) {
|
|
164976
|
+
path16 = toPath2(path16);
|
|
164977
|
+
var length = path16.length;
|
|
164979
164978
|
for (var i = 0; i < length; i++) {
|
|
164980
|
-
var key =
|
|
164979
|
+
var key = path16[i];
|
|
164981
164980
|
if (!has(obj2, key)) return false;
|
|
164982
164981
|
obj2 = obj2[key];
|
|
164983
164982
|
}
|
|
@@ -165014,10 +165013,10 @@ var init_matcher = __esm({
|
|
|
165014
165013
|
});
|
|
165015
165014
|
|
|
165016
165015
|
// node_modules/underscore/modules/property.js
|
|
165017
|
-
function property(
|
|
165018
|
-
|
|
165016
|
+
function property(path16) {
|
|
165017
|
+
path16 = toPath2(path16);
|
|
165019
165018
|
return function(obj2) {
|
|
165020
|
-
return deepGet(obj2,
|
|
165019
|
+
return deepGet(obj2, path16);
|
|
165021
165020
|
};
|
|
165022
165021
|
}
|
|
165023
165022
|
var init_property = __esm({
|
|
@@ -165126,8 +165125,8 @@ var init_noop = __esm({
|
|
|
165126
165125
|
// node_modules/underscore/modules/propertyOf.js
|
|
165127
165126
|
function propertyOf(obj2) {
|
|
165128
165127
|
if (obj2 == null) return noop;
|
|
165129
|
-
return function(
|
|
165130
|
-
return get2(obj2,
|
|
165128
|
+
return function(path16) {
|
|
165129
|
+
return get2(obj2, path16);
|
|
165131
165130
|
};
|
|
165132
165131
|
}
|
|
165133
165132
|
var init_propertyOf = __esm({
|
|
@@ -165321,14 +165320,14 @@ var init_template = __esm({
|
|
|
165321
165320
|
});
|
|
165322
165321
|
|
|
165323
165322
|
// node_modules/underscore/modules/result.js
|
|
165324
|
-
function result(obj2,
|
|
165325
|
-
|
|
165326
|
-
var length =
|
|
165323
|
+
function result(obj2, path16, fallback) {
|
|
165324
|
+
path16 = toPath2(path16);
|
|
165325
|
+
var length = path16.length;
|
|
165327
165326
|
if (!length) {
|
|
165328
165327
|
return isFunction_default(fallback) ? fallback.call(obj2) : fallback;
|
|
165329
165328
|
}
|
|
165330
165329
|
for (var i = 0; i < length; i++) {
|
|
165331
|
-
var prop = obj2 == null ? void 0 : obj2[
|
|
165330
|
+
var prop = obj2 == null ? void 0 : obj2[path16[i]];
|
|
165332
165331
|
if (prop === void 0) {
|
|
165333
165332
|
prop = fallback;
|
|
165334
165333
|
i = length;
|
|
@@ -166011,14 +166010,14 @@ var init_invoke = __esm({
|
|
|
166011
166010
|
init_map();
|
|
166012
166011
|
init_deepGet();
|
|
166013
166012
|
init_toPath2();
|
|
166014
|
-
invoke_default = restArguments(function(obj2,
|
|
166013
|
+
invoke_default = restArguments(function(obj2, path16, args) {
|
|
166015
166014
|
var contextPath, func;
|
|
166016
|
-
if (isFunction_default(
|
|
166017
|
-
func =
|
|
166015
|
+
if (isFunction_default(path16)) {
|
|
166016
|
+
func = path16;
|
|
166018
166017
|
} else {
|
|
166019
|
-
|
|
166020
|
-
contextPath =
|
|
166021
|
-
|
|
166018
|
+
path16 = toPath2(path16);
|
|
166019
|
+
contextPath = path16.slice(0, -1);
|
|
166020
|
+
path16 = path16[path16.length - 1];
|
|
166022
166021
|
}
|
|
166023
166022
|
return map(obj2, function(context) {
|
|
166024
166023
|
var method = func;
|
|
@@ -166027,7 +166026,7 @@ var init_invoke = __esm({
|
|
|
166027
166026
|
context = deepGet(context, contextPath);
|
|
166028
166027
|
}
|
|
166029
166028
|
if (context == null) return void 0;
|
|
166030
|
-
method = context[
|
|
166029
|
+
method = context[path16];
|
|
166031
166030
|
}
|
|
166032
166031
|
return method == null ? method : method.apply(context, args);
|
|
166033
166032
|
});
|
|
@@ -175493,8 +175492,8 @@ var require_utils2 = __commonJS({
|
|
|
175493
175492
|
var result2 = transform[inputType][outputType](input);
|
|
175494
175493
|
return result2;
|
|
175495
175494
|
};
|
|
175496
|
-
exports2.resolve = function(
|
|
175497
|
-
var parts =
|
|
175495
|
+
exports2.resolve = function(path16) {
|
|
175496
|
+
var parts = path16.split("/");
|
|
175498
175497
|
var result2 = [];
|
|
175499
175498
|
for (var index = 0; index < parts.length; index++) {
|
|
175500
175499
|
var part = parts[index];
|
|
@@ -181347,18 +181346,18 @@ var require_object = __commonJS({
|
|
|
181347
181346
|
var object2 = new ZipObject(name, zipObjectContent, o);
|
|
181348
181347
|
this.files[name] = object2;
|
|
181349
181348
|
};
|
|
181350
|
-
var parentFolder = function(
|
|
181351
|
-
if (
|
|
181352
|
-
|
|
181349
|
+
var parentFolder = function(path16) {
|
|
181350
|
+
if (path16.slice(-1) === "/") {
|
|
181351
|
+
path16 = path16.substring(0, path16.length - 1);
|
|
181353
181352
|
}
|
|
181354
|
-
var lastSlash =
|
|
181355
|
-
return lastSlash > 0 ?
|
|
181353
|
+
var lastSlash = path16.lastIndexOf("/");
|
|
181354
|
+
return lastSlash > 0 ? path16.substring(0, lastSlash) : "";
|
|
181356
181355
|
};
|
|
181357
|
-
var forceTrailingSlash = function(
|
|
181358
|
-
if (
|
|
181359
|
-
|
|
181356
|
+
var forceTrailingSlash = function(path16) {
|
|
181357
|
+
if (path16.slice(-1) !== "/") {
|
|
181358
|
+
path16 += "/";
|
|
181360
181359
|
}
|
|
181361
|
-
return
|
|
181360
|
+
return path16;
|
|
181362
181361
|
};
|
|
181363
181362
|
var folderAdd = function(name, createFolders) {
|
|
181364
181363
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
@@ -182396,27 +182395,27 @@ var require_zipfile = __commonJS({
|
|
|
182396
182395
|
};
|
|
182397
182396
|
});
|
|
182398
182397
|
}
|
|
182399
|
-
function splitPath(
|
|
182400
|
-
var lastIndex =
|
|
182398
|
+
function splitPath(path16) {
|
|
182399
|
+
var lastIndex = path16.lastIndexOf("/");
|
|
182401
182400
|
if (lastIndex === -1) {
|
|
182402
|
-
return { dirname: "", basename:
|
|
182401
|
+
return { dirname: "", basename: path16 };
|
|
182403
182402
|
} else {
|
|
182404
182403
|
return {
|
|
182405
|
-
dirname:
|
|
182406
|
-
basename:
|
|
182404
|
+
dirname: path16.substring(0, lastIndex),
|
|
182405
|
+
basename: path16.substring(lastIndex + 1)
|
|
182407
182406
|
};
|
|
182408
182407
|
}
|
|
182409
182408
|
}
|
|
182410
182409
|
function joinPath() {
|
|
182411
|
-
var nonEmptyPaths = Array.prototype.filter.call(arguments, function(
|
|
182412
|
-
return
|
|
182410
|
+
var nonEmptyPaths = Array.prototype.filter.call(arguments, function(path16) {
|
|
182411
|
+
return path16;
|
|
182413
182412
|
});
|
|
182414
182413
|
var relevantPaths = [];
|
|
182415
|
-
nonEmptyPaths.forEach(function(
|
|
182416
|
-
if (/^\//.test(
|
|
182417
|
-
relevantPaths = [
|
|
182414
|
+
nonEmptyPaths.forEach(function(path16) {
|
|
182415
|
+
if (/^\//.test(path16)) {
|
|
182416
|
+
relevantPaths = [path16];
|
|
182418
182417
|
} else {
|
|
182419
|
-
relevantPaths.push(
|
|
182418
|
+
relevantPaths.push(path16);
|
|
182420
182419
|
}
|
|
182421
182420
|
});
|
|
182422
182421
|
return relevantPaths.join("/");
|
|
@@ -189808,9 +189807,9 @@ var require_office_xml_reader = __commonJS({
|
|
|
189808
189807
|
return collapseAlternateContent(document2)[0];
|
|
189809
189808
|
});
|
|
189810
189809
|
}
|
|
189811
|
-
function readXmlFromZipFile(docxFile,
|
|
189812
|
-
if (docxFile.exists(
|
|
189813
|
-
return docxFile.read(
|
|
189810
|
+
function readXmlFromZipFile(docxFile, path16) {
|
|
189811
|
+
if (docxFile.exists(path16)) {
|
|
189812
|
+
return docxFile.read(path16, "utf-8").then(stripUtf8Bom).then(read);
|
|
189814
189813
|
} else {
|
|
189815
189814
|
return promises.resolve(null);
|
|
189816
189815
|
}
|
|
@@ -191574,10 +191573,10 @@ var require_body_reader = __commonJS({
|
|
|
191574
191573
|
}
|
|
191575
191574
|
}
|
|
191576
191575
|
function findEmbeddedImageFile(relationshipId) {
|
|
191577
|
-
var
|
|
191576
|
+
var path16 = uris.uriToZipEntryName("word", relationships.findTargetByRelationshipId(relationshipId));
|
|
191578
191577
|
return {
|
|
191579
|
-
path:
|
|
191580
|
-
read: docxFile.read.bind(docxFile,
|
|
191578
|
+
path: path16,
|
|
191579
|
+
read: docxFile.read.bind(docxFile, path16)
|
|
191581
191580
|
};
|
|
191582
191581
|
}
|
|
191583
191582
|
function readImage(imageFile, altText) {
|
|
@@ -191814,12 +191813,12 @@ var require_content_types_reader = __commonJS({
|
|
|
191814
191813
|
}
|
|
191815
191814
|
function contentTypes(overrides, extensionDefaults) {
|
|
191816
191815
|
return {
|
|
191817
|
-
findContentType: function(
|
|
191818
|
-
var overrideContentType = overrides[
|
|
191816
|
+
findContentType: function(path16) {
|
|
191817
|
+
var overrideContentType = overrides[path16];
|
|
191819
191818
|
if (overrideContentType) {
|
|
191820
191819
|
return overrideContentType;
|
|
191821
191820
|
} else {
|
|
191822
|
-
var pathParts =
|
|
191821
|
+
var pathParts = path16.split(".");
|
|
191823
191822
|
var extension2 = pathParts[pathParts.length - 1];
|
|
191824
191823
|
if (extensionDefaults.hasOwnProperty(extension2)) {
|
|
191825
191824
|
return extensionDefaults[extension2];
|
|
@@ -192062,12 +192061,12 @@ var require_comments_reader = __commonJS({
|
|
|
192062
192061
|
var require_path_is_absolute = __commonJS({
|
|
192063
192062
|
"node_modules/path-is-absolute/index.js"(exports2, module2) {
|
|
192064
192063
|
"use strict";
|
|
192065
|
-
function posix(
|
|
192066
|
-
return
|
|
192064
|
+
function posix(path16) {
|
|
192065
|
+
return path16.charAt(0) === "/";
|
|
192067
192066
|
}
|
|
192068
|
-
function win32(
|
|
192067
|
+
function win32(path16) {
|
|
192069
192068
|
var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
|
|
192070
|
-
var result2 = splitDeviceRe.exec(
|
|
192069
|
+
var result2 = splitDeviceRe.exec(path16);
|
|
192071
192070
|
var device = result2[1] || "";
|
|
192072
192071
|
var isUnc = Boolean(device && device.charAt(1) !== ":");
|
|
192073
192072
|
return Boolean(result2[2] || isUnc);
|
|
@@ -192081,9 +192080,9 @@ var require_path_is_absolute = __commonJS({
|
|
|
192081
192080
|
// node_modules/mammoth/lib/docx/files.js
|
|
192082
192081
|
var require_files = __commonJS({
|
|
192083
192082
|
"node_modules/mammoth/lib/docx/files.js"(exports2) {
|
|
192084
|
-
var
|
|
192083
|
+
var fs16 = __require("fs");
|
|
192085
192084
|
var url = __require("url");
|
|
192086
|
-
var
|
|
192085
|
+
var os7 = __require("os");
|
|
192087
192086
|
var dirname2 = __require("path").dirname;
|
|
192088
192087
|
var resolvePath2 = __require("path").resolve;
|
|
192089
192088
|
var isAbsolutePath2 = require_path_is_absolute();
|
|
@@ -192101,19 +192100,19 @@ var require_files = __commonJS({
|
|
|
192101
192100
|
}
|
|
192102
192101
|
var base = options.relativeToFile ? dirname2(options.relativeToFile) : null;
|
|
192103
192102
|
function read(uri, encoding) {
|
|
192104
|
-
return resolveUri(uri).then(function(
|
|
192105
|
-
return readFile4(
|
|
192103
|
+
return resolveUri(uri).then(function(path16) {
|
|
192104
|
+
return readFile4(path16, encoding).caught(function(error) {
|
|
192106
192105
|
var message = "could not open external image: '" + uri + "' (document directory: '" + base + "')\n" + error.message;
|
|
192107
192106
|
return promises.reject(new Error(message));
|
|
192108
192107
|
});
|
|
192109
192108
|
});
|
|
192110
192109
|
}
|
|
192111
192110
|
function resolveUri(uri) {
|
|
192112
|
-
var
|
|
192113
|
-
if (isAbsolutePath2(
|
|
192114
|
-
return promises.resolve(
|
|
192111
|
+
var path16 = uriToPath(uri);
|
|
192112
|
+
if (isAbsolutePath2(path16)) {
|
|
192113
|
+
return promises.resolve(path16);
|
|
192115
192114
|
} else if (base) {
|
|
192116
|
-
return promises.resolve(resolvePath2(base,
|
|
192115
|
+
return promises.resolve(resolvePath2(base, path16));
|
|
192117
192116
|
} else {
|
|
192118
192117
|
return promises.reject(new Error("could not find external image '" + uri + "', path of input document is unknown"));
|
|
192119
192118
|
}
|
|
@@ -192122,18 +192121,18 @@ var require_files = __commonJS({
|
|
|
192122
192121
|
read
|
|
192123
192122
|
};
|
|
192124
192123
|
}
|
|
192125
|
-
var readFile4 = promises.promisify(
|
|
192124
|
+
var readFile4 = promises.promisify(fs16.readFile.bind(fs16));
|
|
192126
192125
|
function uriToPath(uriString, platform3) {
|
|
192127
192126
|
if (!platform3) {
|
|
192128
|
-
platform3 =
|
|
192127
|
+
platform3 = os7.platform();
|
|
192129
192128
|
}
|
|
192130
192129
|
var uri = url.parse(uriString);
|
|
192131
192130
|
if (isLocalFileUri(uri) || isRelativeUri(uri)) {
|
|
192132
|
-
var
|
|
192133
|
-
if (platform3 === "win32" && /^\/[a-z]:/i.test(
|
|
192134
|
-
return
|
|
192131
|
+
var path16 = decodeURIComponent(uri.path);
|
|
192132
|
+
if (platform3 === "win32" && /^\/[a-z]:/i.test(path16)) {
|
|
192133
|
+
return path16.slice(1);
|
|
192135
192134
|
} else {
|
|
192136
|
-
return
|
|
192135
|
+
return path16;
|
|
192137
192136
|
}
|
|
192138
192137
|
} else {
|
|
192139
192138
|
throw new Error("Could not convert URI to path: " + uriString);
|
|
@@ -192333,18 +192332,18 @@ var require_docx_reader = __commonJS({
|
|
|
192333
192332
|
readElement: contentTypesReader.readContentTypesFromXml,
|
|
192334
192333
|
defaultValue: contentTypesReader.defaultContentTypes
|
|
192335
192334
|
});
|
|
192336
|
-
function readNumberingFromZipFile(zipFile,
|
|
192335
|
+
function readNumberingFromZipFile(zipFile, path16, styles6) {
|
|
192337
192336
|
return xmlFileReader({
|
|
192338
|
-
filename:
|
|
192337
|
+
filename: path16,
|
|
192339
192338
|
readElement: function(element) {
|
|
192340
192339
|
return numberingXml.readNumberingXml(element, { styles: styles6 });
|
|
192341
192340
|
},
|
|
192342
192341
|
defaultValue: numberingXml.defaultNumbering
|
|
192343
192342
|
})(zipFile);
|
|
192344
192343
|
}
|
|
192345
|
-
function readStylesFromZipFile(zipFile,
|
|
192344
|
+
function readStylesFromZipFile(zipFile, path16) {
|
|
192346
192345
|
return xmlFileReader({
|
|
192347
|
-
filename:
|
|
192346
|
+
filename: path16,
|
|
192348
192347
|
readElement: stylesReader.readStylesXml,
|
|
192349
192348
|
defaultValue: stylesReader.defaultStyles
|
|
192350
192349
|
})(zipFile);
|
|
@@ -192375,10 +192374,10 @@ var require_style_map = __commonJS({
|
|
|
192375
192374
|
});
|
|
192376
192375
|
}
|
|
192377
192376
|
function updateRelationships(docxFile) {
|
|
192378
|
-
var
|
|
192377
|
+
var path16 = "word/_rels/document.xml.rels";
|
|
192379
192378
|
var relationshipsUri = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
192380
192379
|
var relationshipElementName = "{" + relationshipsUri + "}Relationship";
|
|
192381
|
-
return docxFile.read(
|
|
192380
|
+
return docxFile.read(path16, "utf8").then(xml.readString).then(function(relationshipsContainer) {
|
|
192382
192381
|
var relationships = relationshipsContainer.children;
|
|
192383
192382
|
addOrUpdateElement(relationships, relationshipElementName, "Id", {
|
|
192384
192383
|
"Id": "rMammothStyleMap",
|
|
@@ -192386,21 +192385,21 @@ var require_style_map = __commonJS({
|
|
|
192386
192385
|
"Target": styleMapAbsolutePath
|
|
192387
192386
|
});
|
|
192388
192387
|
var namespaces = { "": relationshipsUri };
|
|
192389
|
-
return docxFile.write(
|
|
192388
|
+
return docxFile.write(path16, xml.writeString(relationshipsContainer, namespaces));
|
|
192390
192389
|
});
|
|
192391
192390
|
}
|
|
192392
192391
|
function updateContentTypes(docxFile) {
|
|
192393
|
-
var
|
|
192392
|
+
var path16 = "[Content_Types].xml";
|
|
192394
192393
|
var contentTypesUri = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
192395
192394
|
var overrideName = "{" + contentTypesUri + "}Override";
|
|
192396
|
-
return docxFile.read(
|
|
192395
|
+
return docxFile.read(path16, "utf8").then(xml.readString).then(function(typesElement) {
|
|
192397
192396
|
var children = typesElement.children;
|
|
192398
192397
|
addOrUpdateElement(children, overrideName, "PartName", {
|
|
192399
192398
|
"PartName": styleMapAbsolutePath,
|
|
192400
192399
|
"ContentType": "text/prs.mammoth.style-map"
|
|
192401
192400
|
});
|
|
192402
192401
|
var namespaces = { "": contentTypesUri };
|
|
192403
|
-
return docxFile.write(
|
|
192402
|
+
return docxFile.write(path16, xml.writeString(typesElement, namespaces));
|
|
192404
192403
|
});
|
|
192405
192404
|
}
|
|
192406
192405
|
function addOrUpdateElement(elements, name, identifyingAttribute, attributes) {
|
|
@@ -193088,9 +193087,9 @@ var require_document_to_html = __commonJS({
|
|
|
193088
193087
|
};
|
|
193089
193088
|
var paths = [];
|
|
193090
193089
|
if (run.highlight !== null) {
|
|
193091
|
-
var
|
|
193092
|
-
if (
|
|
193093
|
-
paths.push(
|
|
193090
|
+
var path16 = findHtmlPath({ type: "highlight", color: run.highlight });
|
|
193091
|
+
if (path16) {
|
|
193092
|
+
paths.push(path16);
|
|
193094
193093
|
}
|
|
193095
193094
|
}
|
|
193096
193095
|
if (run.isSmallCaps) {
|
|
@@ -193125,15 +193124,15 @@ var require_document_to_html = __commonJS({
|
|
|
193125
193124
|
messages.push(unrecognisedStyleWarning("run", run));
|
|
193126
193125
|
}
|
|
193127
193126
|
paths.push(stylePath);
|
|
193128
|
-
paths.forEach(function(
|
|
193129
|
-
nodes =
|
|
193127
|
+
paths.forEach(function(path17) {
|
|
193128
|
+
nodes = path17.wrap.bind(path17, nodes);
|
|
193130
193129
|
});
|
|
193131
193130
|
return nodes();
|
|
193132
193131
|
}
|
|
193133
193132
|
function findHtmlPathForRunProperty(elementType, defaultTagName) {
|
|
193134
|
-
var
|
|
193135
|
-
if (
|
|
193136
|
-
return
|
|
193133
|
+
var path16 = findHtmlPath({ type: elementType });
|
|
193134
|
+
if (path16) {
|
|
193135
|
+
return path16;
|
|
193137
193136
|
} else if (defaultTagName) {
|
|
193138
193137
|
return htmlPaths.element(defaultTagName, {}, { fresh: false });
|
|
193139
193138
|
} else {
|
|
@@ -194835,11 +194834,11 @@ var require_options_reader = __commonJS({
|
|
|
194835
194834
|
// node_modules/mammoth/lib/unzip.js
|
|
194836
194835
|
var require_unzip = __commonJS({
|
|
194837
194836
|
"node_modules/mammoth/lib/unzip.js"(exports2) {
|
|
194838
|
-
var
|
|
194837
|
+
var fs16 = __require("fs");
|
|
194839
194838
|
var promises = require_promises();
|
|
194840
194839
|
var zipfile = require_zipfile();
|
|
194841
194840
|
exports2.openZip = openZip;
|
|
194842
|
-
var readFile4 = promises.promisify(
|
|
194841
|
+
var readFile4 = promises.promisify(fs16.readFile);
|
|
194843
194842
|
function openZip(options) {
|
|
194844
194843
|
if (options.path) {
|
|
194845
194844
|
return readFile4(options.path).then(zipfile.openArrayBuffer);
|
|
@@ -195557,8 +195556,8 @@ function decodeBase64ToBuffer(value) {
|
|
|
195557
195556
|
function fileNameFromLocalId(localSourceId) {
|
|
195558
195557
|
const sep = localSourceId.lastIndexOf("::");
|
|
195559
195558
|
if (sep >= 0) {
|
|
195560
|
-
const
|
|
195561
|
-
return
|
|
195559
|
+
const path16 = localSourceId.slice(sep + 2);
|
|
195560
|
+
return path16.split("/").pop() ?? path16;
|
|
195562
195561
|
}
|
|
195563
195562
|
return localSourceId;
|
|
195564
195563
|
}
|
|
@@ -195927,7 +195926,7 @@ function normalizeInputPath(pathValue) {
|
|
|
195927
195926
|
}
|
|
195928
195927
|
function expandHomePath(pathValue, roots) {
|
|
195929
195928
|
if (!pathValue?.startsWith("~/")) return pathValue;
|
|
195930
|
-
const homePrefix = roots.map((root2) => root2.path.replace(/\\/g, "/")).find((
|
|
195929
|
+
const homePrefix = roots.map((root2) => root2.path.replace(/\\/g, "/")).find((path16) => /^\/Users\/[^/]+/.test(path16))?.match(/^\/Users\/[^/]+/)?.[0];
|
|
195931
195930
|
return homePrefix ? `${homePrefix}${pathValue.slice(1)}` : pathValue;
|
|
195932
195931
|
}
|
|
195933
195932
|
function normalizeRelativePath(pathValue) {
|
|
@@ -207213,62 +207212,62 @@ var init_initPacks = __esm({
|
|
|
207213
207212
|
});
|
|
207214
207213
|
|
|
207215
207214
|
// lib/perchManagedAgents/runtime.ts
|
|
207216
|
-
function validateJsonSchema(value, schema,
|
|
207215
|
+
function validateJsonSchema(value, schema, path16 = "") {
|
|
207217
207216
|
const errors = [];
|
|
207218
207217
|
if (schema.type === "object" && value != null && typeof value === "object" && !Array.isArray(value)) {
|
|
207219
207218
|
const obj2 = value;
|
|
207220
207219
|
if (schema.required) {
|
|
207221
207220
|
for (const key of schema.required) {
|
|
207222
|
-
if (!(key in obj2)) errors.push(`${
|
|
207221
|
+
if (!(key in obj2)) errors.push(`${path16 || "root"}: missing required field "${key}"`);
|
|
207223
207222
|
}
|
|
207224
207223
|
}
|
|
207225
207224
|
if (schema.additionalProperties === false && schema.properties) {
|
|
207226
207225
|
const allowed = new Set(Object.keys(schema.properties));
|
|
207227
207226
|
for (const key of Object.keys(obj2)) {
|
|
207228
|
-
if (!allowed.has(key)) errors.push(`${
|
|
207227
|
+
if (!allowed.has(key)) errors.push(`${path16 || "root"}: unexpected field "${key}"`);
|
|
207229
207228
|
}
|
|
207230
207229
|
}
|
|
207231
207230
|
if (schema.properties) {
|
|
207232
207231
|
for (const [key, subSchema] of Object.entries(schema.properties)) {
|
|
207233
207232
|
if (key in obj2) {
|
|
207234
|
-
errors.push(...validateJsonSchema(obj2[key], subSchema, `${
|
|
207233
|
+
errors.push(...validateJsonSchema(obj2[key], subSchema, `${path16}.${key}`));
|
|
207235
207234
|
}
|
|
207236
207235
|
}
|
|
207237
207236
|
}
|
|
207238
207237
|
} else if (schema.type === "array" && Array.isArray(value)) {
|
|
207239
207238
|
if (schema.maxItems != null && value.length > schema.maxItems) {
|
|
207240
|
-
errors.push(`${
|
|
207239
|
+
errors.push(`${path16 || "root"}: array exceeds maxItems (${value.length} > ${schema.maxItems})`);
|
|
207241
207240
|
}
|
|
207242
207241
|
if (schema.items) {
|
|
207243
207242
|
for (let i = 0; i < Math.min(value.length, 10); i += 1) {
|
|
207244
|
-
errors.push(...validateJsonSchema(value[i], schema.items, `${
|
|
207243
|
+
errors.push(...validateJsonSchema(value[i], schema.items, `${path16}[${i}]`));
|
|
207245
207244
|
}
|
|
207246
207245
|
}
|
|
207247
207246
|
} else if (schema.type === "string" && typeof value === "string") {
|
|
207248
207247
|
if (schema.maxLength != null && value.length > schema.maxLength) {
|
|
207249
|
-
errors.push(`${
|
|
207248
|
+
errors.push(`${path16 || "root"}: string exceeds maxLength (${value.length} > ${schema.maxLength})`);
|
|
207250
207249
|
}
|
|
207251
207250
|
if (schema.pattern) {
|
|
207252
207251
|
try {
|
|
207253
207252
|
if (!new RegExp(schema.pattern).test(value)) {
|
|
207254
|
-
errors.push(`${
|
|
207253
|
+
errors.push(`${path16 || "root"}: string does not match pattern "${schema.pattern}"`);
|
|
207255
207254
|
}
|
|
207256
207255
|
} catch {
|
|
207257
207256
|
}
|
|
207258
207257
|
}
|
|
207259
207258
|
} else if (schema.type === "number" && typeof value !== "number") {
|
|
207260
|
-
errors.push(`${
|
|
207259
|
+
errors.push(`${path16 || "root"}: expected number, got ${typeof value}`);
|
|
207261
207260
|
} else if (schema.type === "boolean" && typeof value !== "boolean") {
|
|
207262
|
-
errors.push(`${
|
|
207261
|
+
errors.push(`${path16 || "root"}: expected boolean, got ${typeof value}`);
|
|
207263
207262
|
} else if (schema.type === "string" && typeof value !== "string" && value != null) {
|
|
207264
|
-
errors.push(`${
|
|
207263
|
+
errors.push(`${path16 || "root"}: expected string, got ${typeof value}`);
|
|
207265
207264
|
} else if (schema.type === "object" && (value == null || typeof value !== "object" || Array.isArray(value))) {
|
|
207266
|
-
if (value != null) errors.push(`${
|
|
207265
|
+
if (value != null) errors.push(`${path16 || "root"}: expected object, got ${typeof value}`);
|
|
207267
207266
|
} else if (schema.type === "array" && !Array.isArray(value) && value != null) {
|
|
207268
|
-
errors.push(`${
|
|
207267
|
+
errors.push(`${path16 || "root"}: expected array, got ${typeof value}`);
|
|
207269
207268
|
}
|
|
207270
207269
|
if (schema.enum && !schema.enum.includes(value)) {
|
|
207271
|
-
errors.push(`${
|
|
207270
|
+
errors.push(`${path16 || "root"}: value not in enum [${schema.enum.join(", ")}]`);
|
|
207272
207271
|
}
|
|
207273
207272
|
return errors;
|
|
207274
207273
|
}
|
|
@@ -211627,12 +211626,12 @@ var init_fileSystem = __esm({
|
|
|
211627
211626
|
classification: { native: false },
|
|
211628
211627
|
handler: async (args, ctx) => {
|
|
211629
211628
|
const pattern = args.pattern ? String(args.pattern) : void 0;
|
|
211630
|
-
const
|
|
211629
|
+
const path16 = args.path ? String(args.path) : void 0;
|
|
211631
211630
|
const maxResults = typeof args.maxResults === "number" ? args.maxResults : void 0;
|
|
211632
211631
|
return listWorkspaceFilesGlob({
|
|
211633
211632
|
workspaceRoot: effectiveWorkspaceRoot(ctx),
|
|
211634
211633
|
pattern,
|
|
211635
|
-
path:
|
|
211634
|
+
path: path16,
|
|
211636
211635
|
maxResults,
|
|
211637
211636
|
fsAccessOverride: ctx.fsAccessOverride
|
|
211638
211637
|
});
|
|
@@ -211643,14 +211642,14 @@ var init_fileSystem = __esm({
|
|
|
211643
211642
|
classification: { native: false },
|
|
211644
211643
|
handler: async (args, ctx) => {
|
|
211645
211644
|
const query = String(args.query ?? "");
|
|
211646
|
-
const
|
|
211645
|
+
const path16 = args.path ? String(args.path) : void 0;
|
|
211647
211646
|
const include = args.include ? String(args.include) : void 0;
|
|
211648
211647
|
const caseSensitive = typeof args.caseSensitive === "boolean" ? args.caseSensitive : void 0;
|
|
211649
211648
|
const maxResults = typeof args.maxResults === "number" ? args.maxResults : void 0;
|
|
211650
211649
|
return searchWorkspaceFilesGrep({
|
|
211651
211650
|
workspaceRoot: effectiveWorkspaceRoot(ctx),
|
|
211652
211651
|
query,
|
|
211653
|
-
path:
|
|
211652
|
+
path: path16,
|
|
211654
211653
|
include,
|
|
211655
211654
|
caseSensitive,
|
|
211656
211655
|
maxResults,
|
|
@@ -211713,24 +211712,24 @@ var init_fileSystem = __esm({
|
|
|
211713
211712
|
name: TOOL_NAMES.createDirectory,
|
|
211714
211713
|
classification: { native: false },
|
|
211715
211714
|
handler: async (args, ctx) => {
|
|
211716
|
-
const
|
|
211717
|
-
return createDirectory({ path: resolveWorkspacePath(ctx,
|
|
211715
|
+
const path16 = String(args.path ?? "");
|
|
211716
|
+
return createDirectory({ path: resolveWorkspacePath(ctx, path16), fsAccessOverride: ctx.fsAccessOverride });
|
|
211718
211717
|
}
|
|
211719
211718
|
};
|
|
211720
211719
|
deleteLocalFileTool = {
|
|
211721
211720
|
name: TOOL_NAMES.deleteLocalFile,
|
|
211722
211721
|
classification: { native: false },
|
|
211723
211722
|
handler: async (args, ctx) => {
|
|
211724
|
-
const
|
|
211725
|
-
return deleteLocalFile({ path: resolveWorkspacePath(ctx,
|
|
211723
|
+
const path16 = String(args.path ?? "");
|
|
211724
|
+
return deleteLocalFile({ path: resolveWorkspacePath(ctx, path16), fsAccessOverride: ctx.fsAccessOverride });
|
|
211726
211725
|
}
|
|
211727
211726
|
};
|
|
211728
211727
|
printFileTool = {
|
|
211729
211728
|
name: TOOL_NAMES.printFile,
|
|
211730
211729
|
classification: { native: false },
|
|
211731
211730
|
handler: async (args, ctx) => {
|
|
211732
|
-
const
|
|
211733
|
-
return printFile({ path: resolveWorkspacePath(ctx,
|
|
211731
|
+
const path16 = String(args.path ?? "");
|
|
211732
|
+
return printFile({ path: resolveWorkspacePath(ctx, path16), fsAccessOverride: ctx.fsAccessOverride });
|
|
211734
211733
|
}
|
|
211735
211734
|
};
|
|
211736
211735
|
statPathTool = {
|
|
@@ -215050,11 +215049,11 @@ function extractEvidenceFromToolResult(input) {
|
|
|
215050
215049
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
215051
215050
|
const result2 = input.result;
|
|
215052
215051
|
if (input.toolName === TOOL_NAMES.readLocalFile) {
|
|
215053
|
-
const
|
|
215052
|
+
const path16 = stringValue6(result2.relativePath);
|
|
215054
215053
|
return [{
|
|
215055
215054
|
source: input.toolName,
|
|
215056
|
-
title:
|
|
215057
|
-
path:
|
|
215055
|
+
title: path16 ? `Read ${path16}` : "Read local file",
|
|
215056
|
+
path: path16,
|
|
215058
215057
|
snippet: stringValue6(result2.content)?.slice(0, 500),
|
|
215059
215058
|
metadata: pickMetadata(result2, ["sizeBytes", "executionHost"]),
|
|
215060
215059
|
createdAt
|
|
@@ -215115,11 +215114,11 @@ function extractEvidenceFromToolResult(input) {
|
|
|
215115
215114
|
}];
|
|
215116
215115
|
}
|
|
215117
215116
|
if (input.toolName === TOOL_NAMES.statPath) {
|
|
215118
|
-
const
|
|
215117
|
+
const path16 = stringValue6(result2.relativePath);
|
|
215119
215118
|
return [{
|
|
215120
215119
|
source: input.toolName,
|
|
215121
|
-
title:
|
|
215122
|
-
path:
|
|
215120
|
+
title: path16 ? `Stat ${path16}` : "Path metadata",
|
|
215121
|
+
path: path16,
|
|
215123
215122
|
summary: summarizeStat(result2),
|
|
215124
215123
|
metadata: pickMetadata(result2, ["exists", "isFile", "isDirectory", "sizeBytes", "modifiedAt", "executionHost"]),
|
|
215125
215124
|
createdAt
|
|
@@ -217686,8 +217685,8 @@ function sourceReadFamilyForToolCall(toolName, args) {
|
|
|
217686
217685
|
}
|
|
217687
217686
|
}
|
|
217688
217687
|
if (toolName === TOOL_NAMES.readLocalFile) {
|
|
217689
|
-
const
|
|
217690
|
-
return
|
|
217688
|
+
const path16 = typeof record.path === "string" ? record.path.trim() : "";
|
|
217689
|
+
return path16 ? `${toolName}:${path16}` : null;
|
|
217691
217690
|
}
|
|
217692
217691
|
if (toolName === TOOL_NAMES.readLocalSourceFile) {
|
|
217693
217692
|
const source = typeof record.localSourceId === "string" ? record.localSourceId.trim() : typeof record.sourceId === "string" ? record.sourceId.trim() : typeof record.path === "string" ? record.path.trim() : "";
|
|
@@ -218369,13 +218368,13 @@ function extractProviderReasoning(value) {
|
|
|
218369
218368
|
fields: Array.from(new Set(fields))
|
|
218370
218369
|
};
|
|
218371
218370
|
}
|
|
218372
|
-
function visit(value,
|
|
218371
|
+
function visit(value, path16, chunks, fields, seen) {
|
|
218373
218372
|
if (!value || typeof value !== "object") return;
|
|
218374
218373
|
if (seen.has(value)) return;
|
|
218375
218374
|
seen.add(value);
|
|
218376
218375
|
if (Array.isArray(value)) {
|
|
218377
218376
|
value.forEach(
|
|
218378
|
-
(item, index) => visit(item, `${
|
|
218377
|
+
(item, index) => visit(item, `${path16}[${index}]`, chunks, fields, seen)
|
|
218379
218378
|
);
|
|
218380
218379
|
return;
|
|
218381
218380
|
}
|
|
@@ -218384,23 +218383,23 @@ function visit(value, path15, chunks, fields, seen) {
|
|
|
218384
218383
|
const maybe = obj2[key];
|
|
218385
218384
|
if (typeof maybe === "string" && maybe.trim()) {
|
|
218386
218385
|
chunks.push(maybe);
|
|
218387
|
-
fields.push(`${
|
|
218386
|
+
fields.push(`${path16}.${key}`);
|
|
218388
218387
|
}
|
|
218389
218388
|
}
|
|
218390
218389
|
const type = typeof obj2.type === "string" ? obj2.type.toLowerCase() : "";
|
|
218391
218390
|
if ((type === "thinking" || type === "reasoning") && typeof obj2.content === "string" && obj2.content.trim()) {
|
|
218392
218391
|
chunks.push(obj2.content);
|
|
218393
|
-
fields.push(`${
|
|
218392
|
+
fields.push(`${path16}.content[type=${type}]`);
|
|
218394
218393
|
}
|
|
218395
218394
|
if ((type === "thinking" || type === "reasoning") && typeof obj2.text === "string" && obj2.text.trim()) {
|
|
218396
218395
|
chunks.push(obj2.text);
|
|
218397
|
-
fields.push(`${
|
|
218396
|
+
fields.push(`${path16}.text[type=${type}]`);
|
|
218398
218397
|
}
|
|
218399
218398
|
for (const [key, child] of Object.entries(obj2)) {
|
|
218400
218399
|
if (key.toLowerCase().includes("api") || key.toLowerCase().includes("authorization"))
|
|
218401
218400
|
continue;
|
|
218402
218401
|
if (typeof child === "object" && child !== null)
|
|
218403
|
-
visit(child, `${
|
|
218402
|
+
visit(child, `${path16}.${key}`, chunks, fields, seen);
|
|
218404
218403
|
}
|
|
218405
218404
|
}
|
|
218406
218405
|
var REASONING_KEYS;
|
|
@@ -227511,8 +227510,8 @@ async function resolveLocalSelectedSourceBundleForTurn(input) {
|
|
|
227511
227510
|
function extractFileNameFromId(localSourceId) {
|
|
227512
227511
|
const sep = localSourceId.lastIndexOf("::");
|
|
227513
227512
|
if (sep >= 0) {
|
|
227514
|
-
const
|
|
227515
|
-
return
|
|
227513
|
+
const path16 = localSourceId.slice(sep + 2);
|
|
227514
|
+
return path16.split("/").pop() ?? path16;
|
|
227516
227515
|
}
|
|
227517
227516
|
return localSourceId;
|
|
227518
227517
|
}
|
|
@@ -230732,7 +230731,7 @@ function buildSeatbeltProfile(workspaceRoot) {
|
|
|
230732
230731
|
home,
|
|
230733
230732
|
"/Users/Shared",
|
|
230734
230733
|
"/Volumes"
|
|
230735
|
-
])).map((
|
|
230734
|
+
])).map((path16) => `(subpath ${seatbeltString(path16)})`).join("\n ");
|
|
230736
230735
|
return `
|
|
230737
230736
|
(version 1)
|
|
230738
230737
|
(allow default)
|
|
@@ -233111,6 +233110,99 @@ var init_learningMemory = __esm({
|
|
|
233111
233110
|
}
|
|
233112
233111
|
});
|
|
233113
233112
|
|
|
233113
|
+
// features/perchTerminal/runtime/cliHost/cliUpdateCheck.ts
|
|
233114
|
+
import fs12 from "node:fs";
|
|
233115
|
+
import os3 from "node:os";
|
|
233116
|
+
import path14 from "node:path";
|
|
233117
|
+
function compareCliVersions(a, b2) {
|
|
233118
|
+
const ma = SEMVER_RE.exec(a);
|
|
233119
|
+
const mb = SEMVER_RE.exec(b2);
|
|
233120
|
+
if (!ma || !mb) return null;
|
|
233121
|
+
for (let i = 1; i <= 3; i += 1) {
|
|
233122
|
+
const da = Number(ma[i]);
|
|
233123
|
+
const db = Number(mb[i]);
|
|
233124
|
+
if (da !== db) return da < db ? -1 : 1;
|
|
233125
|
+
}
|
|
233126
|
+
return 0;
|
|
233127
|
+
}
|
|
233128
|
+
function updateNoticeLine(installed, latest) {
|
|
233129
|
+
if (!latest) return null;
|
|
233130
|
+
const cmp = compareCliVersions(installed, latest);
|
|
233131
|
+
if (cmp === null || cmp >= 0) return null;
|
|
233132
|
+
return `Update available: v${installed} \u2192 v${latest} \xB7 run: npm i -g perchai-cli@latest`;
|
|
233133
|
+
}
|
|
233134
|
+
function shouldRefresh(checkedAt, now23, ttlMs = CACHE_TTL_MS2) {
|
|
233135
|
+
if (checkedAt === null) return true;
|
|
233136
|
+
return now23 - checkedAt >= ttlMs;
|
|
233137
|
+
}
|
|
233138
|
+
function updateChecksDisabled(env4 = process.env) {
|
|
233139
|
+
return Boolean(env4.CI || env4.PERCH_NO_UPDATE_NOTIFIER || env4.NO_UPDATE_NOTIFIER);
|
|
233140
|
+
}
|
|
233141
|
+
function cacheFile() {
|
|
233142
|
+
const override = process.env.PERCH_UPDATE_CACHE_FILE?.trim();
|
|
233143
|
+
if (override) return override;
|
|
233144
|
+
return path14.join(os3.homedir(), ".perch", "update-check.json");
|
|
233145
|
+
}
|
|
233146
|
+
function readCache() {
|
|
233147
|
+
try {
|
|
233148
|
+
const raw = fs12.readFileSync(cacheFile(), "utf8");
|
|
233149
|
+
const parsed = JSON.parse(raw);
|
|
233150
|
+
if (typeof parsed.latestVersion === "string" && typeof parsed.checkedAt === "number") {
|
|
233151
|
+
return { latestVersion: parsed.latestVersion, checkedAt: parsed.checkedAt };
|
|
233152
|
+
}
|
|
233153
|
+
} catch {
|
|
233154
|
+
}
|
|
233155
|
+
return null;
|
|
233156
|
+
}
|
|
233157
|
+
function writeCache(cache3) {
|
|
233158
|
+
try {
|
|
233159
|
+
const file = cacheFile();
|
|
233160
|
+
fs12.mkdirSync(path14.dirname(file), { recursive: true });
|
|
233161
|
+
fs12.writeFileSync(file, JSON.stringify(cache3));
|
|
233162
|
+
} catch {
|
|
233163
|
+
}
|
|
233164
|
+
}
|
|
233165
|
+
async function fetchLatestVersion() {
|
|
233166
|
+
const controller = new AbortController();
|
|
233167
|
+
const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
233168
|
+
if (typeof timer.unref === "function") timer.unref();
|
|
233169
|
+
try {
|
|
233170
|
+
const response = await fetch(REGISTRY_LATEST_URL, {
|
|
233171
|
+
signal: controller.signal,
|
|
233172
|
+
headers: { accept: "application/json" }
|
|
233173
|
+
});
|
|
233174
|
+
if (!response.ok) return null;
|
|
233175
|
+
const body = await response.json();
|
|
233176
|
+
return typeof body.version === "string" ? body.version : null;
|
|
233177
|
+
} catch {
|
|
233178
|
+
return null;
|
|
233179
|
+
} finally {
|
|
233180
|
+
clearTimeout(timer);
|
|
233181
|
+
}
|
|
233182
|
+
}
|
|
233183
|
+
async function refreshCacheInBackground() {
|
|
233184
|
+
const latest = await fetchLatestVersion();
|
|
233185
|
+
if (latest) writeCache({ latestVersion: latest, checkedAt: Date.now() });
|
|
233186
|
+
}
|
|
233187
|
+
function resolveUpdateNotice(installedVersion) {
|
|
233188
|
+
if (updateChecksDisabled()) return null;
|
|
233189
|
+
const cache3 = readCache();
|
|
233190
|
+
if (shouldRefresh(cache3?.checkedAt ?? null, Date.now())) {
|
|
233191
|
+
void refreshCacheInBackground();
|
|
233192
|
+
}
|
|
233193
|
+
return updateNoticeLine(installedVersion, cache3?.latestVersion ?? null);
|
|
233194
|
+
}
|
|
233195
|
+
var REGISTRY_LATEST_URL, CACHE_TTL_MS2, FETCH_TIMEOUT_MS, SEMVER_RE;
|
|
233196
|
+
var init_cliUpdateCheck = __esm({
|
|
233197
|
+
"features/perchTerminal/runtime/cliHost/cliUpdateCheck.ts"() {
|
|
233198
|
+
"use strict";
|
|
233199
|
+
REGISTRY_LATEST_URL = "https://registry.npmjs.org/perchai-cli/latest";
|
|
233200
|
+
CACHE_TTL_MS2 = 24 * 60 * 60 * 1e3;
|
|
233201
|
+
FETCH_TIMEOUT_MS = 3e3;
|
|
233202
|
+
SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
233203
|
+
}
|
|
233204
|
+
});
|
|
233205
|
+
|
|
233114
233206
|
// node_modules/react/cjs/react.production.js
|
|
233115
233207
|
var require_react_production = __commonJS({
|
|
233116
233208
|
"node_modules/react/cjs/react.production.js"(exports2) {
|
|
@@ -234722,7 +234814,7 @@ __export(base_exports, {
|
|
|
234722
234814
|
synchronizedOutput: () => synchronizedOutput
|
|
234723
234815
|
});
|
|
234724
234816
|
import process2 from "node:process";
|
|
234725
|
-
import
|
|
234817
|
+
import os4 from "node:os";
|
|
234726
234818
|
var ESC, OSC, BEL, SEP, isTerminalApp, isWindows2, isTmux, cwdFunction, wrapOsc, cursorTo, cursorMove, cursorUp, cursorDown, cursorForward, cursorBackward, cursorLeft, cursorSavePosition, cursorRestorePosition, cursorGetPosition, cursorNextLine, cursorPrevLine, cursorHide, cursorShow, eraseLines, eraseEndLine, eraseStartLine, eraseLine, eraseDown, eraseUp, eraseScreen, scrollUp, scrollDown, clearScreen, clearViewport, isOldWindows, clearTerminal, enterAlternativeScreen, exitAlternativeScreen, beginSynchronizedOutput, endSynchronizedOutput, synchronizedOutput, beep, link, image, iTerm, ConEmu, setCwd;
|
|
234727
234819
|
var init_base = __esm({
|
|
234728
234820
|
"node_modules/ansi-escapes/base.js"() {
|
|
@@ -234805,7 +234897,7 @@ var init_base = __esm({
|
|
|
234805
234897
|
if (isBrowser || !isWindows2) {
|
|
234806
234898
|
return false;
|
|
234807
234899
|
}
|
|
234808
|
-
const parts =
|
|
234900
|
+
const parts = os4.release().split(".");
|
|
234809
234901
|
const major = Number(parts[0]);
|
|
234810
234902
|
const build2 = Number(parts[2] ?? 0);
|
|
234811
234903
|
if (major < 10) {
|
|
@@ -237329,7 +237421,7 @@ var init_wrap_ansi = __esm({
|
|
|
237329
237421
|
// node_modules/terminal-size/index.js
|
|
237330
237422
|
import process3 from "node:process";
|
|
237331
237423
|
import { execFileSync } from "node:child_process";
|
|
237332
|
-
import
|
|
237424
|
+
import fs13 from "node:fs";
|
|
237333
237425
|
import tty from "node:tty";
|
|
237334
237426
|
function terminalSize() {
|
|
237335
237427
|
const { env: env4, stdout, stderr } = process3;
|
|
@@ -237385,7 +237477,7 @@ var init_terminal_size = __esm({
|
|
|
237385
237477
|
return true;
|
|
237386
237478
|
}
|
|
237387
237479
|
try {
|
|
237388
|
-
const statContents =
|
|
237480
|
+
const statContents = fs13.readFileSync("/proc/self/stat", "utf8");
|
|
237389
237481
|
const closingParenthesisIndex = statContents.lastIndexOf(") ");
|
|
237390
237482
|
if (closingParenthesisIndex === -1) {
|
|
237391
237483
|
return false;
|
|
@@ -237406,8 +237498,8 @@ var init_terminal_size = __esm({
|
|
|
237406
237498
|
};
|
|
237407
237499
|
devTty = () => {
|
|
237408
237500
|
try {
|
|
237409
|
-
const flags = process3.platform === "darwin" ?
|
|
237410
|
-
const { columns, rows } = tty.WriteStream(
|
|
237501
|
+
const flags = process3.platform === "darwin" ? fs13.constants.O_EVTONLY | fs13.constants.O_NONBLOCK : fs13.constants.O_NONBLOCK;
|
|
237502
|
+
const { columns, rows } = tty.WriteStream(fs13.openSync("/dev/tty", flags));
|
|
237411
237503
|
return { columns, rows };
|
|
237412
237504
|
} catch {
|
|
237413
237505
|
}
|
|
@@ -246179,10 +246271,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
246179
246271
|
fiber = fiber.next, id--;
|
|
246180
246272
|
return fiber;
|
|
246181
246273
|
}
|
|
246182
|
-
function copyWithSetImpl(obj2,
|
|
246183
|
-
if (index >=
|
|
246184
|
-
var key =
|
|
246185
|
-
updated[key] = copyWithSetImpl(obj2[key],
|
|
246274
|
+
function copyWithSetImpl(obj2, path16, index, value) {
|
|
246275
|
+
if (index >= path16.length) return value;
|
|
246276
|
+
var key = path16[index], updated = isArrayImpl(obj2) ? obj2.slice() : assign({}, obj2);
|
|
246277
|
+
updated[key] = copyWithSetImpl(obj2[key], path16, index + 1, value);
|
|
246186
246278
|
return updated;
|
|
246187
246279
|
}
|
|
246188
246280
|
function copyWithRename(obj2, oldPath, newPath) {
|
|
@@ -246209,11 +246301,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
246209
246301
|
);
|
|
246210
246302
|
return updated;
|
|
246211
246303
|
}
|
|
246212
|
-
function copyWithDeleteImpl(obj2,
|
|
246213
|
-
var key =
|
|
246214
|
-
if (index + 1 ===
|
|
246304
|
+
function copyWithDeleteImpl(obj2, path16, index) {
|
|
246305
|
+
var key = path16[index], updated = isArrayImpl(obj2) ? obj2.slice() : assign({}, obj2);
|
|
246306
|
+
if (index + 1 === path16.length)
|
|
246215
246307
|
return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
|
|
246216
|
-
updated[key] = copyWithDeleteImpl(obj2[key],
|
|
246308
|
+
updated[key] = copyWithDeleteImpl(obj2[key], path16, index + 1);
|
|
246217
246309
|
return updated;
|
|
246218
246310
|
}
|
|
246219
246311
|
function shouldSuspendImpl() {
|
|
@@ -259490,29 +259582,29 @@ var require_react_reconciler_development = __commonJS({
|
|
|
259490
259582
|
var didWarnAboutNestedUpdates = false;
|
|
259491
259583
|
var didWarnAboutFindNodeInStrictMode = {};
|
|
259492
259584
|
var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
|
|
259493
|
-
overrideHookState = function(fiber, id,
|
|
259585
|
+
overrideHookState = function(fiber, id, path16, value) {
|
|
259494
259586
|
id = findHook(fiber, id);
|
|
259495
|
-
null !== id && (
|
|
259587
|
+
null !== id && (path16 = copyWithSetImpl(id.memoizedState, path16, 0, value), id.memoizedState = path16, id.baseState = path16, fiber.memoizedProps = assign({}, fiber.memoizedProps), path16 = enqueueConcurrentRenderForLane(fiber, 2), null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2));
|
|
259496
259588
|
};
|
|
259497
|
-
overrideHookStateDeletePath = function(fiber, id,
|
|
259589
|
+
overrideHookStateDeletePath = function(fiber, id, path16) {
|
|
259498
259590
|
id = findHook(fiber, id);
|
|
259499
|
-
null !== id && (
|
|
259591
|
+
null !== id && (path16 = copyWithDeleteImpl(id.memoizedState, path16, 0), id.memoizedState = path16, id.baseState = path16, fiber.memoizedProps = assign({}, fiber.memoizedProps), path16 = enqueueConcurrentRenderForLane(fiber, 2), null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2));
|
|
259500
259592
|
};
|
|
259501
259593
|
overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
|
|
259502
259594
|
id = findHook(fiber, id);
|
|
259503
259595
|
null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
|
|
259504
259596
|
};
|
|
259505
|
-
overrideProps = function(fiber,
|
|
259506
|
-
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps,
|
|
259597
|
+
overrideProps = function(fiber, path16, value) {
|
|
259598
|
+
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path16, 0, value);
|
|
259507
259599
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
259508
|
-
|
|
259509
|
-
null !==
|
|
259600
|
+
path16 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
259601
|
+
null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2);
|
|
259510
259602
|
};
|
|
259511
|
-
overridePropsDeletePath = function(fiber,
|
|
259512
|
-
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps,
|
|
259603
|
+
overridePropsDeletePath = function(fiber, path16) {
|
|
259604
|
+
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path16, 0);
|
|
259513
259605
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
259514
|
-
|
|
259515
|
-
null !==
|
|
259606
|
+
path16 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
259607
|
+
null !== path16 && scheduleUpdateOnFiber(path16, fiber, 2);
|
|
259516
259608
|
};
|
|
259517
259609
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
259518
259610
|
fiber.pendingProps = copyWithRename(
|
|
@@ -269234,8 +269326,8 @@ var require_backend = __commonJS({
|
|
|
269234
269326
|
}
|
|
269235
269327
|
return false;
|
|
269236
269328
|
}
|
|
269237
|
-
function utils_getInObject(object2,
|
|
269238
|
-
return
|
|
269329
|
+
function utils_getInObject(object2, path16) {
|
|
269330
|
+
return path16.reduce(function(reduced, attr) {
|
|
269239
269331
|
if (reduced) {
|
|
269240
269332
|
if (utils_hasOwnProperty.call(reduced, attr)) {
|
|
269241
269333
|
return reduced[attr];
|
|
@@ -269247,11 +269339,11 @@ var require_backend = __commonJS({
|
|
|
269247
269339
|
return null;
|
|
269248
269340
|
}, object2);
|
|
269249
269341
|
}
|
|
269250
|
-
function deletePathInObject(object2,
|
|
269251
|
-
var length =
|
|
269252
|
-
var last2 =
|
|
269342
|
+
function deletePathInObject(object2, path16) {
|
|
269343
|
+
var length = path16.length;
|
|
269344
|
+
var last2 = path16[length - 1];
|
|
269253
269345
|
if (object2 != null) {
|
|
269254
|
-
var parent = utils_getInObject(object2,
|
|
269346
|
+
var parent = utils_getInObject(object2, path16.slice(0, length - 1));
|
|
269255
269347
|
if (parent) {
|
|
269256
269348
|
if (src_isArray(parent)) {
|
|
269257
269349
|
parent.splice(last2, 1);
|
|
@@ -269277,11 +269369,11 @@ var require_backend = __commonJS({
|
|
|
269277
269369
|
}
|
|
269278
269370
|
}
|
|
269279
269371
|
}
|
|
269280
|
-
function utils_setInObject(object2,
|
|
269281
|
-
var length =
|
|
269282
|
-
var last2 =
|
|
269372
|
+
function utils_setInObject(object2, path16, value) {
|
|
269373
|
+
var length = path16.length;
|
|
269374
|
+
var last2 = path16[length - 1];
|
|
269283
269375
|
if (object2 != null) {
|
|
269284
|
-
var parent = utils_getInObject(object2,
|
|
269376
|
+
var parent = utils_getInObject(object2, path16.slice(0, length - 1));
|
|
269285
269377
|
if (parent) {
|
|
269286
269378
|
parent[last2] = value;
|
|
269287
269379
|
}
|
|
@@ -269814,8 +269906,8 @@ var require_backend = __commonJS({
|
|
|
269814
269906
|
unserializable: /* @__PURE__ */ Symbol("unserializable")
|
|
269815
269907
|
};
|
|
269816
269908
|
var LEVEL_THRESHOLD = 2;
|
|
269817
|
-
function createDehydrated(type, inspectable, data, cleaned,
|
|
269818
|
-
cleaned.push(
|
|
269909
|
+
function createDehydrated(type, inspectable, data, cleaned, path16) {
|
|
269910
|
+
cleaned.push(path16);
|
|
269819
269911
|
var dehydrated = {
|
|
269820
269912
|
inspectable,
|
|
269821
269913
|
type,
|
|
@@ -269833,13 +269925,13 @@ var require_backend = __commonJS({
|
|
|
269833
269925
|
}
|
|
269834
269926
|
return dehydrated;
|
|
269835
269927
|
}
|
|
269836
|
-
function dehydrate(data, cleaned, unserializable,
|
|
269928
|
+
function dehydrate(data, cleaned, unserializable, path16, isPathAllowed) {
|
|
269837
269929
|
var level = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0;
|
|
269838
269930
|
var type = getDataType(data);
|
|
269839
269931
|
var isPathAllowedCheck;
|
|
269840
269932
|
switch (type) {
|
|
269841
269933
|
case "html_element":
|
|
269842
|
-
cleaned.push(
|
|
269934
|
+
cleaned.push(path16);
|
|
269843
269935
|
return {
|
|
269844
269936
|
inspectable: false,
|
|
269845
269937
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269848,7 +269940,7 @@ var require_backend = __commonJS({
|
|
|
269848
269940
|
type
|
|
269849
269941
|
};
|
|
269850
269942
|
case "function":
|
|
269851
|
-
cleaned.push(
|
|
269943
|
+
cleaned.push(path16);
|
|
269852
269944
|
return {
|
|
269853
269945
|
inspectable: false,
|
|
269854
269946
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269857,14 +269949,14 @@ var require_backend = __commonJS({
|
|
|
269857
269949
|
type
|
|
269858
269950
|
};
|
|
269859
269951
|
case "string":
|
|
269860
|
-
isPathAllowedCheck = isPathAllowed(
|
|
269952
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
269861
269953
|
if (isPathAllowedCheck) {
|
|
269862
269954
|
return data;
|
|
269863
269955
|
} else {
|
|
269864
269956
|
return data.length <= 500 ? data : data.slice(0, 500) + "...";
|
|
269865
269957
|
}
|
|
269866
269958
|
case "bigint":
|
|
269867
|
-
cleaned.push(
|
|
269959
|
+
cleaned.push(path16);
|
|
269868
269960
|
return {
|
|
269869
269961
|
inspectable: false,
|
|
269870
269962
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269873,7 +269965,7 @@ var require_backend = __commonJS({
|
|
|
269873
269965
|
type
|
|
269874
269966
|
};
|
|
269875
269967
|
case "symbol":
|
|
269876
|
-
cleaned.push(
|
|
269968
|
+
cleaned.push(path16);
|
|
269877
269969
|
return {
|
|
269878
269970
|
inspectable: false,
|
|
269879
269971
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269882,9 +269974,9 @@ var require_backend = __commonJS({
|
|
|
269882
269974
|
type
|
|
269883
269975
|
};
|
|
269884
269976
|
case "react_element": {
|
|
269885
|
-
isPathAllowedCheck = isPathAllowed(
|
|
269977
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
269886
269978
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
269887
|
-
cleaned.push(
|
|
269979
|
+
cleaned.push(path16);
|
|
269888
269980
|
return {
|
|
269889
269981
|
inspectable: true,
|
|
269890
269982
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269901,19 +269993,19 @@ var require_backend = __commonJS({
|
|
|
269901
269993
|
preview_long: formatDataForPreview(data, true),
|
|
269902
269994
|
name: getDisplayNameForReactElement(data) || "Unknown"
|
|
269903
269995
|
};
|
|
269904
|
-
unserializableValue.key = dehydrate(data.key, cleaned, unserializable,
|
|
269996
|
+
unserializableValue.key = dehydrate(data.key, cleaned, unserializable, path16.concat(["key"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
269905
269997
|
if (data.$$typeof === REACT_LEGACY_ELEMENT_TYPE) {
|
|
269906
|
-
unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable,
|
|
269998
|
+
unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable, path16.concat(["ref"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
269907
269999
|
}
|
|
269908
|
-
unserializableValue.props = dehydrate(data.props, cleaned, unserializable,
|
|
269909
|
-
unserializable.push(
|
|
270000
|
+
unserializableValue.props = dehydrate(data.props, cleaned, unserializable, path16.concat(["props"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270001
|
+
unserializable.push(path16);
|
|
269910
270002
|
return unserializableValue;
|
|
269911
270003
|
}
|
|
269912
270004
|
case "react_lazy": {
|
|
269913
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270005
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
269914
270006
|
var payload = data._payload;
|
|
269915
270007
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
269916
|
-
cleaned.push(
|
|
270008
|
+
cleaned.push(path16);
|
|
269917
270009
|
var inspectable = payload !== null && hydration_typeof(payload) === "object" && (payload._status === 1 || payload._status === 2 || payload.status === "fulfilled" || payload.status === "rejected");
|
|
269918
270010
|
return {
|
|
269919
270011
|
inspectable,
|
|
@@ -269930,13 +270022,13 @@ var require_backend = __commonJS({
|
|
|
269930
270022
|
preview_long: formatDataForPreview(data, true),
|
|
269931
270023
|
name: "lazy()"
|
|
269932
270024
|
};
|
|
269933
|
-
_unserializableValue._payload = dehydrate(payload, cleaned, unserializable,
|
|
269934
|
-
unserializable.push(
|
|
270025
|
+
_unserializableValue._payload = dehydrate(payload, cleaned, unserializable, path16.concat(["_payload"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270026
|
+
unserializable.push(path16);
|
|
269935
270027
|
return _unserializableValue;
|
|
269936
270028
|
}
|
|
269937
270029
|
case "array_buffer":
|
|
269938
270030
|
case "data_view":
|
|
269939
|
-
cleaned.push(
|
|
270031
|
+
cleaned.push(path16);
|
|
269940
270032
|
return {
|
|
269941
270033
|
inspectable: false,
|
|
269942
270034
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269946,21 +270038,21 @@ var require_backend = __commonJS({
|
|
|
269946
270038
|
type
|
|
269947
270039
|
};
|
|
269948
270040
|
case "array":
|
|
269949
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270041
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
269950
270042
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
269951
|
-
return createDehydrated(type, true, data, cleaned,
|
|
270043
|
+
return createDehydrated(type, true, data, cleaned, path16);
|
|
269952
270044
|
}
|
|
269953
270045
|
var arr = [];
|
|
269954
270046
|
for (var i = 0; i < data.length; i++) {
|
|
269955
|
-
arr[i] = dehydrateKey(data, i, cleaned, unserializable,
|
|
270047
|
+
arr[i] = dehydrateKey(data, i, cleaned, unserializable, path16.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
269956
270048
|
}
|
|
269957
270049
|
return arr;
|
|
269958
270050
|
case "html_all_collection":
|
|
269959
270051
|
case "typed_array":
|
|
269960
270052
|
case "iterator":
|
|
269961
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270053
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
269962
270054
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
269963
|
-
return createDehydrated(type, true, data, cleaned,
|
|
270055
|
+
return createDehydrated(type, true, data, cleaned, path16);
|
|
269964
270056
|
} else {
|
|
269965
270057
|
var _unserializableValue2 = {
|
|
269966
270058
|
unserializable: true,
|
|
@@ -269972,13 +270064,13 @@ var require_backend = __commonJS({
|
|
|
269972
270064
|
name: typeof data.constructor !== "function" || typeof data.constructor.name !== "string" || data.constructor.name === "Object" ? "" : data.constructor.name
|
|
269973
270065
|
};
|
|
269974
270066
|
Array.from(data).forEach(function(item, i2) {
|
|
269975
|
-
return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable,
|
|
270067
|
+
return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path16.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
269976
270068
|
});
|
|
269977
|
-
unserializable.push(
|
|
270069
|
+
unserializable.push(path16);
|
|
269978
270070
|
return _unserializableValue2;
|
|
269979
270071
|
}
|
|
269980
270072
|
case "opaque_iterator":
|
|
269981
|
-
cleaned.push(
|
|
270073
|
+
cleaned.push(path16);
|
|
269982
270074
|
return {
|
|
269983
270075
|
inspectable: false,
|
|
269984
270076
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269987,7 +270079,7 @@ var require_backend = __commonJS({
|
|
|
269987
270079
|
type
|
|
269988
270080
|
};
|
|
269989
270081
|
case "date":
|
|
269990
|
-
cleaned.push(
|
|
270082
|
+
cleaned.push(path16);
|
|
269991
270083
|
return {
|
|
269992
270084
|
inspectable: false,
|
|
269993
270085
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -269996,7 +270088,7 @@ var require_backend = __commonJS({
|
|
|
269996
270088
|
type
|
|
269997
270089
|
};
|
|
269998
270090
|
case "regexp":
|
|
269999
|
-
cleaned.push(
|
|
270091
|
+
cleaned.push(path16);
|
|
270000
270092
|
return {
|
|
270001
270093
|
inspectable: false,
|
|
270002
270094
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -270005,9 +270097,9 @@ var require_backend = __commonJS({
|
|
|
270005
270097
|
type
|
|
270006
270098
|
};
|
|
270007
270099
|
case "thenable":
|
|
270008
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270100
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
270009
270101
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
270010
|
-
cleaned.push(
|
|
270102
|
+
cleaned.push(path16);
|
|
270011
270103
|
return {
|
|
270012
270104
|
inspectable: data.status === "fulfilled" || data.status === "rejected",
|
|
270013
270105
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -270028,8 +270120,8 @@ var require_backend = __commonJS({
|
|
|
270028
270120
|
preview_long: formatDataForPreview(data, true),
|
|
270029
270121
|
name: "fulfilled Thenable"
|
|
270030
270122
|
};
|
|
270031
|
-
_unserializableValue3.value = dehydrate(data.value, cleaned, unserializable,
|
|
270032
|
-
unserializable.push(
|
|
270123
|
+
_unserializableValue3.value = dehydrate(data.value, cleaned, unserializable, path16.concat(["value"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270124
|
+
unserializable.push(path16);
|
|
270033
270125
|
return _unserializableValue3;
|
|
270034
270126
|
}
|
|
270035
270127
|
case "rejected": {
|
|
@@ -270040,12 +270132,12 @@ var require_backend = __commonJS({
|
|
|
270040
270132
|
preview_long: formatDataForPreview(data, true),
|
|
270041
270133
|
name: "rejected Thenable"
|
|
270042
270134
|
};
|
|
270043
|
-
_unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable,
|
|
270044
|
-
unserializable.push(
|
|
270135
|
+
_unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable, path16.concat(["reason"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270136
|
+
unserializable.push(path16);
|
|
270045
270137
|
return _unserializableValue4;
|
|
270046
270138
|
}
|
|
270047
270139
|
default:
|
|
270048
|
-
cleaned.push(
|
|
270140
|
+
cleaned.push(path16);
|
|
270049
270141
|
return {
|
|
270050
270142
|
inspectable: false,
|
|
270051
270143
|
preview_short: formatDataForPreview(data, false),
|
|
@@ -270055,21 +270147,21 @@ var require_backend = __commonJS({
|
|
|
270055
270147
|
};
|
|
270056
270148
|
}
|
|
270057
270149
|
case "object":
|
|
270058
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270150
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
270059
270151
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
270060
|
-
return createDehydrated(type, true, data, cleaned,
|
|
270152
|
+
return createDehydrated(type, true, data, cleaned, path16);
|
|
270061
270153
|
} else {
|
|
270062
270154
|
var object2 = {};
|
|
270063
270155
|
getAllEnumerableKeys(data).forEach(function(key) {
|
|
270064
270156
|
var name = key.toString();
|
|
270065
|
-
object2[name] = dehydrateKey(data, key, cleaned, unserializable,
|
|
270157
|
+
object2[name] = dehydrateKey(data, key, cleaned, unserializable, path16.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270066
270158
|
});
|
|
270067
270159
|
return object2;
|
|
270068
270160
|
}
|
|
270069
270161
|
case "class_instance": {
|
|
270070
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270162
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
270071
270163
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
270072
|
-
return createDehydrated(type, true, data, cleaned,
|
|
270164
|
+
return createDehydrated(type, true, data, cleaned, path16);
|
|
270073
270165
|
}
|
|
270074
270166
|
var value = {
|
|
270075
270167
|
unserializable: true,
|
|
@@ -270081,15 +270173,15 @@ var require_backend = __commonJS({
|
|
|
270081
270173
|
};
|
|
270082
270174
|
getAllEnumerableKeys(data).forEach(function(key) {
|
|
270083
270175
|
var keyAsString = key.toString();
|
|
270084
|
-
value[keyAsString] = dehydrate(data[key], cleaned, unserializable,
|
|
270176
|
+
value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path16.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270085
270177
|
});
|
|
270086
|
-
unserializable.push(
|
|
270178
|
+
unserializable.push(path16);
|
|
270087
270179
|
return value;
|
|
270088
270180
|
}
|
|
270089
270181
|
case "error": {
|
|
270090
|
-
isPathAllowedCheck = isPathAllowed(
|
|
270182
|
+
isPathAllowedCheck = isPathAllowed(path16);
|
|
270091
270183
|
if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
|
|
270092
|
-
return createDehydrated(type, true, data, cleaned,
|
|
270184
|
+
return createDehydrated(type, true, data, cleaned, path16);
|
|
270093
270185
|
}
|
|
270094
270186
|
var _value = {
|
|
270095
270187
|
unserializable: true,
|
|
@@ -270099,22 +270191,22 @@ var require_backend = __commonJS({
|
|
|
270099
270191
|
preview_long: formatDataForPreview(data, true),
|
|
270100
270192
|
name: data.name
|
|
270101
270193
|
};
|
|
270102
|
-
_value.message = dehydrate(data.message, cleaned, unserializable,
|
|
270103
|
-
_value.stack = dehydrate(data.stack, cleaned, unserializable,
|
|
270194
|
+
_value.message = dehydrate(data.message, cleaned, unserializable, path16.concat(["message"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270195
|
+
_value.stack = dehydrate(data.stack, cleaned, unserializable, path16.concat(["stack"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270104
270196
|
if ("cause" in data) {
|
|
270105
|
-
_value.cause = dehydrate(data.cause, cleaned, unserializable,
|
|
270197
|
+
_value.cause = dehydrate(data.cause, cleaned, unserializable, path16.concat(["cause"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270106
270198
|
}
|
|
270107
270199
|
getAllEnumerableKeys(data).forEach(function(key) {
|
|
270108
270200
|
var keyAsString = key.toString();
|
|
270109
|
-
_value[keyAsString] = dehydrate(data[key], cleaned, unserializable,
|
|
270201
|
+
_value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path16.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
|
|
270110
270202
|
});
|
|
270111
|
-
unserializable.push(
|
|
270203
|
+
unserializable.push(path16);
|
|
270112
270204
|
return _value;
|
|
270113
270205
|
}
|
|
270114
270206
|
case "infinity":
|
|
270115
270207
|
case "nan":
|
|
270116
270208
|
case "undefined":
|
|
270117
|
-
cleaned.push(
|
|
270209
|
+
cleaned.push(path16);
|
|
270118
270210
|
return {
|
|
270119
270211
|
type
|
|
270120
270212
|
};
|
|
@@ -270122,10 +270214,10 @@ var require_backend = __commonJS({
|
|
|
270122
270214
|
return data;
|
|
270123
270215
|
}
|
|
270124
270216
|
}
|
|
270125
|
-
function dehydrateKey(parent, key, cleaned, unserializable,
|
|
270217
|
+
function dehydrateKey(parent, key, cleaned, unserializable, path16, isPathAllowed) {
|
|
270126
270218
|
var level = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : 0;
|
|
270127
270219
|
try {
|
|
270128
|
-
return dehydrate(parent[key], cleaned, unserializable,
|
|
270220
|
+
return dehydrate(parent[key], cleaned, unserializable, path16, isPathAllowed, level);
|
|
270129
270221
|
} catch (error) {
|
|
270130
270222
|
var preview = "";
|
|
270131
270223
|
if (hydration_typeof(error) === "object" && error !== null && typeof error.stack === "string") {
|
|
@@ -270133,7 +270225,7 @@ var require_backend = __commonJS({
|
|
|
270133
270225
|
} else if (typeof error === "string") {
|
|
270134
270226
|
preview = error;
|
|
270135
270227
|
}
|
|
270136
|
-
cleaned.push(
|
|
270228
|
+
cleaned.push(path16);
|
|
270137
270229
|
return {
|
|
270138
270230
|
inspectable: false,
|
|
270139
270231
|
preview_short: "[Exception]",
|
|
@@ -270143,8 +270235,8 @@ var require_backend = __commonJS({
|
|
|
270143
270235
|
};
|
|
270144
270236
|
}
|
|
270145
270237
|
}
|
|
270146
|
-
function fillInPath(object2, data,
|
|
270147
|
-
var target = getInObject(object2,
|
|
270238
|
+
function fillInPath(object2, data, path16, value) {
|
|
270239
|
+
var target = getInObject(object2, path16);
|
|
270148
270240
|
if (target != null) {
|
|
270149
270241
|
if (!target[meta.unserializable]) {
|
|
270150
270242
|
delete target[meta.inspectable];
|
|
@@ -270159,9 +270251,9 @@ var require_backend = __commonJS({
|
|
|
270159
270251
|
}
|
|
270160
270252
|
if (value !== null && data.unserializable.length > 0) {
|
|
270161
270253
|
var unserializablePath = data.unserializable[0];
|
|
270162
|
-
var isMatch2 = unserializablePath.length ===
|
|
270163
|
-
for (var i = 0; i <
|
|
270164
|
-
if (
|
|
270254
|
+
var isMatch2 = unserializablePath.length === path16.length;
|
|
270255
|
+
for (var i = 0; i < path16.length; i++) {
|
|
270256
|
+
if (path16[i] !== unserializablePath[i]) {
|
|
270165
270257
|
isMatch2 = false;
|
|
270166
270258
|
break;
|
|
270167
270259
|
}
|
|
@@ -270170,13 +270262,13 @@ var require_backend = __commonJS({
|
|
|
270170
270262
|
upgradeUnserializable(value, value);
|
|
270171
270263
|
}
|
|
270172
270264
|
}
|
|
270173
|
-
setInObject(object2,
|
|
270265
|
+
setInObject(object2, path16, value);
|
|
270174
270266
|
}
|
|
270175
270267
|
function hydrate(object2, cleaned, unserializable) {
|
|
270176
|
-
cleaned.forEach(function(
|
|
270177
|
-
var length =
|
|
270178
|
-
var last2 =
|
|
270179
|
-
var parent = getInObject(object2,
|
|
270268
|
+
cleaned.forEach(function(path16) {
|
|
270269
|
+
var length = path16.length;
|
|
270270
|
+
var last2 = path16[length - 1];
|
|
270271
|
+
var parent = getInObject(object2, path16.slice(0, length - 1));
|
|
270180
270272
|
if (!parent || !parent.hasOwnProperty(last2)) {
|
|
270181
270273
|
return;
|
|
270182
270274
|
}
|
|
@@ -270202,10 +270294,10 @@ var require_backend = __commonJS({
|
|
|
270202
270294
|
parent[last2] = replaced;
|
|
270203
270295
|
}
|
|
270204
270296
|
});
|
|
270205
|
-
unserializable.forEach(function(
|
|
270206
|
-
var length =
|
|
270207
|
-
var last2 =
|
|
270208
|
-
var parent = getInObject(object2,
|
|
270297
|
+
unserializable.forEach(function(path16) {
|
|
270298
|
+
var length = path16.length;
|
|
270299
|
+
var last2 = path16[length - 1];
|
|
270300
|
+
var parent = getInObject(object2, path16.slice(0, length - 1));
|
|
270209
270301
|
if (!parent || !parent.hasOwnProperty(last2)) {
|
|
270210
270302
|
return;
|
|
270211
270303
|
}
|
|
@@ -270326,11 +270418,11 @@ var require_backend = __commonJS({
|
|
|
270326
270418
|
return gte(version4, FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER);
|
|
270327
270419
|
}
|
|
270328
270420
|
function cleanForBridge(data, isPathAllowed) {
|
|
270329
|
-
var
|
|
270421
|
+
var path16 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
270330
270422
|
if (data !== null) {
|
|
270331
270423
|
var cleanedPaths = [];
|
|
270332
270424
|
var unserializablePaths = [];
|
|
270333
|
-
var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths,
|
|
270425
|
+
var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path16, isPathAllowed);
|
|
270334
270426
|
return {
|
|
270335
270427
|
data: cleanedData,
|
|
270336
270428
|
cleaned: cleanedPaths,
|
|
@@ -270340,18 +270432,18 @@ var require_backend = __commonJS({
|
|
|
270340
270432
|
return null;
|
|
270341
270433
|
}
|
|
270342
270434
|
}
|
|
270343
|
-
function copyWithDelete(obj2,
|
|
270435
|
+
function copyWithDelete(obj2, path16) {
|
|
270344
270436
|
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
270345
|
-
var key =
|
|
270437
|
+
var key = path16[index];
|
|
270346
270438
|
var updated = shared_isArray(obj2) ? obj2.slice() : utils_objectSpread({}, obj2);
|
|
270347
|
-
if (index + 1 ===
|
|
270439
|
+
if (index + 1 === path16.length) {
|
|
270348
270440
|
if (shared_isArray(updated)) {
|
|
270349
270441
|
updated.splice(key, 1);
|
|
270350
270442
|
} else {
|
|
270351
270443
|
delete updated[key];
|
|
270352
270444
|
}
|
|
270353
270445
|
} else {
|
|
270354
|
-
updated[key] = copyWithDelete(obj2[key],
|
|
270446
|
+
updated[key] = copyWithDelete(obj2[key], path16, index + 1);
|
|
270355
270447
|
}
|
|
270356
270448
|
return updated;
|
|
270357
270449
|
}
|
|
@@ -270372,14 +270464,14 @@ var require_backend = __commonJS({
|
|
|
270372
270464
|
}
|
|
270373
270465
|
return updated;
|
|
270374
270466
|
}
|
|
270375
|
-
function copyWithSet(obj2,
|
|
270467
|
+
function copyWithSet(obj2, path16, value) {
|
|
270376
270468
|
var index = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
|
|
270377
|
-
if (index >=
|
|
270469
|
+
if (index >= path16.length) {
|
|
270378
270470
|
return value;
|
|
270379
270471
|
}
|
|
270380
|
-
var key =
|
|
270472
|
+
var key = path16[index];
|
|
270381
270473
|
var updated = shared_isArray(obj2) ? obj2.slice() : utils_objectSpread({}, obj2);
|
|
270382
|
-
updated[key] = copyWithSet(obj2[key],
|
|
270474
|
+
updated[key] = copyWithSet(obj2[key], path16, value, index + 1);
|
|
270383
270475
|
return updated;
|
|
270384
270476
|
}
|
|
270385
270477
|
function getEffectDurations(root2) {
|
|
@@ -271655,12 +271747,12 @@ var require_backend = __commonJS({
|
|
|
271655
271747
|
}
|
|
271656
271748
|
});
|
|
271657
271749
|
bridge_defineProperty(_this, "overrideValueAtPath", function(_ref) {
|
|
271658
|
-
var id = _ref.id,
|
|
271750
|
+
var id = _ref.id, path16 = _ref.path, rendererID = _ref.rendererID, type = _ref.type, value = _ref.value;
|
|
271659
271751
|
switch (type) {
|
|
271660
271752
|
case "context":
|
|
271661
271753
|
_this.send("overrideContext", {
|
|
271662
271754
|
id,
|
|
271663
|
-
path:
|
|
271755
|
+
path: path16,
|
|
271664
271756
|
rendererID,
|
|
271665
271757
|
wasForwarded: true,
|
|
271666
271758
|
value
|
|
@@ -271669,7 +271761,7 @@ var require_backend = __commonJS({
|
|
|
271669
271761
|
case "hooks":
|
|
271670
271762
|
_this.send("overrideHookState", {
|
|
271671
271763
|
id,
|
|
271672
|
-
path:
|
|
271764
|
+
path: path16,
|
|
271673
271765
|
rendererID,
|
|
271674
271766
|
wasForwarded: true,
|
|
271675
271767
|
value
|
|
@@ -271678,7 +271770,7 @@ var require_backend = __commonJS({
|
|
|
271678
271770
|
case "props":
|
|
271679
271771
|
_this.send("overrideProps", {
|
|
271680
271772
|
id,
|
|
271681
|
-
path:
|
|
271773
|
+
path: path16,
|
|
271682
271774
|
rendererID,
|
|
271683
271775
|
wasForwarded: true,
|
|
271684
271776
|
value
|
|
@@ -271687,7 +271779,7 @@ var require_backend = __commonJS({
|
|
|
271687
271779
|
case "state":
|
|
271688
271780
|
_this.send("overrideState", {
|
|
271689
271781
|
id,
|
|
271690
|
-
path:
|
|
271782
|
+
path: path16,
|
|
271691
271783
|
rendererID,
|
|
271692
271784
|
wasForwarded: true,
|
|
271693
271785
|
value
|
|
@@ -272025,12 +272117,12 @@ var require_backend = __commonJS({
|
|
|
272025
272117
|
}
|
|
272026
272118
|
});
|
|
272027
272119
|
agent_defineProperty(_this, "copyElementPath", function(_ref5) {
|
|
272028
|
-
var id = _ref5.id,
|
|
272120
|
+
var id = _ref5.id, path16 = _ref5.path, rendererID = _ref5.rendererID;
|
|
272029
272121
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272030
272122
|
if (renderer2 == null) {
|
|
272031
272123
|
console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
|
|
272032
272124
|
} else {
|
|
272033
|
-
var value = renderer2.getSerializedElementValueByPath(id,
|
|
272125
|
+
var value = renderer2.getSerializedElementValueByPath(id, path16);
|
|
272034
272126
|
if (value != null) {
|
|
272035
272127
|
_this._bridge.send("saveToClipboard", value);
|
|
272036
272128
|
} else {
|
|
@@ -272039,12 +272131,12 @@ var require_backend = __commonJS({
|
|
|
272039
272131
|
}
|
|
272040
272132
|
});
|
|
272041
272133
|
agent_defineProperty(_this, "deletePath", function(_ref6) {
|
|
272042
|
-
var hookID = _ref6.hookID, id = _ref6.id,
|
|
272134
|
+
var hookID = _ref6.hookID, id = _ref6.id, path16 = _ref6.path, rendererID = _ref6.rendererID, type = _ref6.type;
|
|
272043
272135
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272044
272136
|
if (renderer2 == null) {
|
|
272045
272137
|
console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
|
|
272046
272138
|
} else {
|
|
272047
|
-
renderer2.deletePath(type, id, hookID,
|
|
272139
|
+
renderer2.deletePath(type, id, hookID, path16);
|
|
272048
272140
|
}
|
|
272049
272141
|
});
|
|
272050
272142
|
agent_defineProperty(_this, "getBackendVersion", function() {
|
|
@@ -272081,12 +272173,12 @@ var require_backend = __commonJS({
|
|
|
272081
272173
|
}
|
|
272082
272174
|
});
|
|
272083
272175
|
agent_defineProperty(_this, "inspectElement", function(_ref9) {
|
|
272084
|
-
var forceFullData = _ref9.forceFullData, id = _ref9.id,
|
|
272176
|
+
var forceFullData = _ref9.forceFullData, id = _ref9.id, path16 = _ref9.path, rendererID = _ref9.rendererID, requestID = _ref9.requestID;
|
|
272085
272177
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272086
272178
|
if (renderer2 == null) {
|
|
272087
272179
|
console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
|
|
272088
272180
|
} else {
|
|
272089
|
-
_this._bridge.send("inspectedElement", renderer2.inspectElement(requestID, id,
|
|
272181
|
+
_this._bridge.send("inspectedElement", renderer2.inspectElement(requestID, id, path16, forceFullData));
|
|
272090
272182
|
if (_this._persistedSelectionMatch === null || _this._persistedSelectionMatch.id !== id) {
|
|
272091
272183
|
_this._persistedSelection = null;
|
|
272092
272184
|
_this._persistedSelectionMatch = null;
|
|
@@ -272120,15 +272212,15 @@ var require_backend = __commonJS({
|
|
|
272120
272212
|
}
|
|
272121
272213
|
for (var rendererID in _this._rendererInterfaces) {
|
|
272122
272214
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272123
|
-
var
|
|
272215
|
+
var path16 = null;
|
|
272124
272216
|
if (suspendedByPathIndex !== null && rendererPath !== null) {
|
|
272125
272217
|
var suspendedByPathRendererIndex = suspendedByPathIndex - suspendedByOffset;
|
|
272126
272218
|
var rendererHasRequestedSuspendedByPath = renderer2.getElementAttributeByPath(id, ["suspendedBy", suspendedByPathRendererIndex]) !== void 0;
|
|
272127
272219
|
if (rendererHasRequestedSuspendedByPath) {
|
|
272128
|
-
|
|
272220
|
+
path16 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
|
|
272129
272221
|
}
|
|
272130
272222
|
}
|
|
272131
|
-
var inspectedRootsPayload = renderer2.inspectElement(requestID, id,
|
|
272223
|
+
var inspectedRootsPayload = renderer2.inspectElement(requestID, id, path16, forceFullData);
|
|
272132
272224
|
switch (inspectedRootsPayload.type) {
|
|
272133
272225
|
case "hydrated-path":
|
|
272134
272226
|
inspectedRootsPayload.path[1] += suspendedByOffset;
|
|
@@ -272222,20 +272314,20 @@ var require_backend = __commonJS({
|
|
|
272222
272314
|
}
|
|
272223
272315
|
});
|
|
272224
272316
|
agent_defineProperty(_this, "overrideValueAtPath", function(_ref15) {
|
|
272225
|
-
var hookID = _ref15.hookID, id = _ref15.id,
|
|
272317
|
+
var hookID = _ref15.hookID, id = _ref15.id, path16 = _ref15.path, rendererID = _ref15.rendererID, type = _ref15.type, value = _ref15.value;
|
|
272226
272318
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272227
272319
|
if (renderer2 == null) {
|
|
272228
272320
|
console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
|
|
272229
272321
|
} else {
|
|
272230
|
-
renderer2.overrideValueAtPath(type, id, hookID,
|
|
272322
|
+
renderer2.overrideValueAtPath(type, id, hookID, path16, value);
|
|
272231
272323
|
}
|
|
272232
272324
|
});
|
|
272233
272325
|
agent_defineProperty(_this, "overrideContext", function(_ref16) {
|
|
272234
|
-
var id = _ref16.id,
|
|
272326
|
+
var id = _ref16.id, path16 = _ref16.path, rendererID = _ref16.rendererID, wasForwarded = _ref16.wasForwarded, value = _ref16.value;
|
|
272235
272327
|
if (!wasForwarded) {
|
|
272236
272328
|
_this.overrideValueAtPath({
|
|
272237
272329
|
id,
|
|
272238
|
-
path:
|
|
272330
|
+
path: path16,
|
|
272239
272331
|
rendererID,
|
|
272240
272332
|
type: "context",
|
|
272241
272333
|
value
|
|
@@ -272243,11 +272335,11 @@ var require_backend = __commonJS({
|
|
|
272243
272335
|
}
|
|
272244
272336
|
});
|
|
272245
272337
|
agent_defineProperty(_this, "overrideHookState", function(_ref17) {
|
|
272246
|
-
var id = _ref17.id, hookID = _ref17.hookID,
|
|
272338
|
+
var id = _ref17.id, hookID = _ref17.hookID, path16 = _ref17.path, rendererID = _ref17.rendererID, wasForwarded = _ref17.wasForwarded, value = _ref17.value;
|
|
272247
272339
|
if (!wasForwarded) {
|
|
272248
272340
|
_this.overrideValueAtPath({
|
|
272249
272341
|
id,
|
|
272250
|
-
path:
|
|
272342
|
+
path: path16,
|
|
272251
272343
|
rendererID,
|
|
272252
272344
|
type: "hooks",
|
|
272253
272345
|
value
|
|
@@ -272255,11 +272347,11 @@ var require_backend = __commonJS({
|
|
|
272255
272347
|
}
|
|
272256
272348
|
});
|
|
272257
272349
|
agent_defineProperty(_this, "overrideProps", function(_ref18) {
|
|
272258
|
-
var id = _ref18.id,
|
|
272350
|
+
var id = _ref18.id, path16 = _ref18.path, rendererID = _ref18.rendererID, wasForwarded = _ref18.wasForwarded, value = _ref18.value;
|
|
272259
272351
|
if (!wasForwarded) {
|
|
272260
272352
|
_this.overrideValueAtPath({
|
|
272261
272353
|
id,
|
|
272262
|
-
path:
|
|
272354
|
+
path: path16,
|
|
272263
272355
|
rendererID,
|
|
272264
272356
|
type: "props",
|
|
272265
272357
|
value
|
|
@@ -272267,11 +272359,11 @@ var require_backend = __commonJS({
|
|
|
272267
272359
|
}
|
|
272268
272360
|
});
|
|
272269
272361
|
agent_defineProperty(_this, "overrideState", function(_ref19) {
|
|
272270
|
-
var id = _ref19.id,
|
|
272362
|
+
var id = _ref19.id, path16 = _ref19.path, rendererID = _ref19.rendererID, wasForwarded = _ref19.wasForwarded, value = _ref19.value;
|
|
272271
272363
|
if (!wasForwarded) {
|
|
272272
272364
|
_this.overrideValueAtPath({
|
|
272273
272365
|
id,
|
|
272274
|
-
path:
|
|
272366
|
+
path: path16,
|
|
272275
272367
|
rendererID,
|
|
272276
272368
|
type: "state",
|
|
272277
272369
|
value
|
|
@@ -272338,12 +272430,12 @@ var require_backend = __commonJS({
|
|
|
272338
272430
|
_this._bridge.send("stopInspectingHost", selected);
|
|
272339
272431
|
});
|
|
272340
272432
|
agent_defineProperty(_this, "storeAsGlobal", function(_ref23) {
|
|
272341
|
-
var count = _ref23.count, id = _ref23.id,
|
|
272433
|
+
var count = _ref23.count, id = _ref23.id, path16 = _ref23.path, rendererID = _ref23.rendererID;
|
|
272342
272434
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272343
272435
|
if (renderer2 == null) {
|
|
272344
272436
|
console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
|
|
272345
272437
|
} else {
|
|
272346
|
-
renderer2.storeAsGlobal(id,
|
|
272438
|
+
renderer2.storeAsGlobal(id, path16, count);
|
|
272347
272439
|
}
|
|
272348
272440
|
});
|
|
272349
272441
|
agent_defineProperty(_this, "updateHookSettings", function(settings) {
|
|
@@ -272360,12 +272452,12 @@ var require_backend = __commonJS({
|
|
|
272360
272452
|
var rendererID = +rendererIDString;
|
|
272361
272453
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272362
272454
|
if (_this._lastSelectedRendererID === rendererID) {
|
|
272363
|
-
var
|
|
272364
|
-
if (
|
|
272365
|
-
renderer2.setTrackedPath(
|
|
272455
|
+
var path16 = renderer2.getPathForElement(_this._lastSelectedElementID);
|
|
272456
|
+
if (path16 !== null) {
|
|
272457
|
+
renderer2.setTrackedPath(path16);
|
|
272366
272458
|
_this._persistedSelection = {
|
|
272367
272459
|
rendererID,
|
|
272368
|
-
path:
|
|
272460
|
+
path: path16
|
|
272369
272461
|
};
|
|
272370
272462
|
}
|
|
272371
272463
|
}
|
|
@@ -272440,11 +272532,11 @@ var require_backend = __commonJS({
|
|
|
272440
272532
|
var rendererID = _this._lastSelectedRendererID;
|
|
272441
272533
|
var id = _this._lastSelectedElementID;
|
|
272442
272534
|
var renderer2 = _this._rendererInterfaces[rendererID];
|
|
272443
|
-
var
|
|
272444
|
-
if (
|
|
272535
|
+
var path16 = renderer2 != null ? renderer2.getPathForElement(id) : null;
|
|
272536
|
+
if (path16 !== null) {
|
|
272445
272537
|
storage_sessionStorageSetItem(SESSION_STORAGE_LAST_SELECTION_KEY, JSON.stringify({
|
|
272446
272538
|
rendererID,
|
|
272447
|
-
path:
|
|
272539
|
+
path: path16
|
|
272448
272540
|
}));
|
|
272449
272541
|
} else {
|
|
272450
272542
|
storage_sessionStorageRemoveItem(SESSION_STORAGE_LAST_SELECTION_KEY);
|
|
@@ -273153,7 +273245,7 @@ var require_backend = __commonJS({
|
|
|
273153
273245
|
hasElementWithId: function hasElementWithId() {
|
|
273154
273246
|
return false;
|
|
273155
273247
|
},
|
|
273156
|
-
inspectElement: function inspectElement(requestID, id,
|
|
273248
|
+
inspectElement: function inspectElement(requestID, id, path16) {
|
|
273157
273249
|
return {
|
|
273158
273250
|
id,
|
|
273159
273251
|
responseID: requestID,
|
|
@@ -278404,9 +278496,9 @@ var require_backend = __commonJS({
|
|
|
278404
278496
|
}
|
|
278405
278497
|
return null;
|
|
278406
278498
|
}
|
|
278407
|
-
function getElementAttributeByPath(id,
|
|
278499
|
+
function getElementAttributeByPath(id, path16) {
|
|
278408
278500
|
if (isMostRecentlyInspectedElement(id)) {
|
|
278409
|
-
return utils_getInObject(mostRecentlyInspectedElement,
|
|
278501
|
+
return utils_getInObject(mostRecentlyInspectedElement, path16);
|
|
278410
278502
|
}
|
|
278411
278503
|
return void 0;
|
|
278412
278504
|
}
|
|
@@ -279113,9 +279205,9 @@ var require_backend = __commonJS({
|
|
|
279113
279205
|
function isMostRecentlyInspectedElementCurrent(id) {
|
|
279114
279206
|
return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected;
|
|
279115
279207
|
}
|
|
279116
|
-
function mergeInspectedPaths(
|
|
279208
|
+
function mergeInspectedPaths(path16) {
|
|
279117
279209
|
var current = currentlyInspectedPaths;
|
|
279118
|
-
|
|
279210
|
+
path16.forEach(function(key) {
|
|
279119
279211
|
if (!current[key]) {
|
|
279120
279212
|
current[key] = {};
|
|
279121
279213
|
}
|
|
@@ -279123,21 +279215,21 @@ var require_backend = __commonJS({
|
|
|
279123
279215
|
});
|
|
279124
279216
|
}
|
|
279125
279217
|
function createIsPathAllowed(key, secondaryCategory) {
|
|
279126
|
-
return function isPathAllowed(
|
|
279218
|
+
return function isPathAllowed(path16) {
|
|
279127
279219
|
switch (secondaryCategory) {
|
|
279128
279220
|
case "hooks":
|
|
279129
|
-
if (
|
|
279221
|
+
if (path16.length === 1) {
|
|
279130
279222
|
return true;
|
|
279131
279223
|
}
|
|
279132
|
-
if (
|
|
279224
|
+
if (path16[path16.length - 2] === "hookSource" && path16[path16.length - 1] === "fileName") {
|
|
279133
279225
|
return true;
|
|
279134
279226
|
}
|
|
279135
|
-
if (
|
|
279227
|
+
if (path16[path16.length - 1] === "subHooks" || path16[path16.length - 2] === "subHooks") {
|
|
279136
279228
|
return true;
|
|
279137
279229
|
}
|
|
279138
279230
|
break;
|
|
279139
279231
|
case "suspendedBy":
|
|
279140
|
-
if (
|
|
279232
|
+
if (path16.length < 5) {
|
|
279141
279233
|
return true;
|
|
279142
279234
|
}
|
|
279143
279235
|
break;
|
|
@@ -279148,8 +279240,8 @@ var require_backend = __commonJS({
|
|
|
279148
279240
|
if (!current) {
|
|
279149
279241
|
return false;
|
|
279150
279242
|
}
|
|
279151
|
-
for (var i = 0; i <
|
|
279152
|
-
current = current[
|
|
279243
|
+
for (var i = 0; i < path16.length; i++) {
|
|
279244
|
+
current = current[path16[i]];
|
|
279153
279245
|
if (!current) {
|
|
279154
279246
|
return false;
|
|
279155
279247
|
}
|
|
@@ -279203,38 +279295,38 @@ var require_backend = __commonJS({
|
|
|
279203
279295
|
break;
|
|
279204
279296
|
}
|
|
279205
279297
|
}
|
|
279206
|
-
function storeAsGlobal(id,
|
|
279298
|
+
function storeAsGlobal(id, path16, count) {
|
|
279207
279299
|
if (isMostRecentlyInspectedElement(id)) {
|
|
279208
|
-
var value = utils_getInObject(mostRecentlyInspectedElement,
|
|
279300
|
+
var value = utils_getInObject(mostRecentlyInspectedElement, path16);
|
|
279209
279301
|
var key = "$reactTemp".concat(count);
|
|
279210
279302
|
window[key] = value;
|
|
279211
279303
|
console.log(key);
|
|
279212
279304
|
console.log(value);
|
|
279213
279305
|
}
|
|
279214
279306
|
}
|
|
279215
|
-
function getSerializedElementValueByPath(id,
|
|
279307
|
+
function getSerializedElementValueByPath(id, path16) {
|
|
279216
279308
|
if (isMostRecentlyInspectedElement(id)) {
|
|
279217
|
-
var valueToCopy = utils_getInObject(mostRecentlyInspectedElement,
|
|
279309
|
+
var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path16);
|
|
279218
279310
|
return serializeToString(valueToCopy);
|
|
279219
279311
|
}
|
|
279220
279312
|
}
|
|
279221
|
-
function inspectElement(requestID, id,
|
|
279222
|
-
if (
|
|
279223
|
-
mergeInspectedPaths(
|
|
279313
|
+
function inspectElement(requestID, id, path16, forceFullData) {
|
|
279314
|
+
if (path16 !== null) {
|
|
279315
|
+
mergeInspectedPaths(path16);
|
|
279224
279316
|
}
|
|
279225
279317
|
if (isMostRecentlyInspectedElement(id) && !forceFullData) {
|
|
279226
279318
|
if (!hasElementUpdatedSinceLastInspected) {
|
|
279227
|
-
if (
|
|
279319
|
+
if (path16 !== null) {
|
|
279228
279320
|
var secondaryCategory = null;
|
|
279229
|
-
if (
|
|
279230
|
-
secondaryCategory =
|
|
279321
|
+
if (path16[0] === "hooks" || path16[0] === "suspendedBy") {
|
|
279322
|
+
secondaryCategory = path16[0];
|
|
279231
279323
|
}
|
|
279232
279324
|
return {
|
|
279233
279325
|
id,
|
|
279234
279326
|
responseID: requestID,
|
|
279235
279327
|
type: "hydrated-path",
|
|
279236
|
-
path:
|
|
279237
|
-
value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement,
|
|
279328
|
+
path: path16,
|
|
279329
|
+
value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path16), createIsPathAllowed(null, secondaryCategory), path16)
|
|
279238
279330
|
};
|
|
279239
279331
|
} else {
|
|
279240
279332
|
return {
|
|
@@ -279423,7 +279515,7 @@ var require_backend = __commonJS({
|
|
|
279423
279515
|
console.groupEnd();
|
|
279424
279516
|
}
|
|
279425
279517
|
}
|
|
279426
|
-
function deletePath(type, id, hookID,
|
|
279518
|
+
function deletePath(type, id, hookID, path16) {
|
|
279427
279519
|
var devtoolsInstance = idToDevToolsInstanceMap.get(id);
|
|
279428
279520
|
if (devtoolsInstance === void 0) {
|
|
279429
279521
|
console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
|
|
@@ -279437,12 +279529,12 @@ var require_backend = __commonJS({
|
|
|
279437
279529
|
var instance = fiber.stateNode;
|
|
279438
279530
|
switch (type) {
|
|
279439
279531
|
case "context":
|
|
279440
|
-
|
|
279532
|
+
path16 = path16.slice(1);
|
|
279441
279533
|
switch (fiber.tag) {
|
|
279442
279534
|
case ClassComponent:
|
|
279443
|
-
if (
|
|
279535
|
+
if (path16.length === 0) {
|
|
279444
279536
|
} else {
|
|
279445
|
-
deletePathInObject(instance.context,
|
|
279537
|
+
deletePathInObject(instance.context, path16);
|
|
279446
279538
|
}
|
|
279447
279539
|
instance.forceUpdate();
|
|
279448
279540
|
break;
|
|
@@ -279452,21 +279544,21 @@ var require_backend = __commonJS({
|
|
|
279452
279544
|
break;
|
|
279453
279545
|
case "hooks":
|
|
279454
279546
|
if (typeof overrideHookStateDeletePath === "function") {
|
|
279455
|
-
overrideHookStateDeletePath(fiber, hookID,
|
|
279547
|
+
overrideHookStateDeletePath(fiber, hookID, path16);
|
|
279456
279548
|
}
|
|
279457
279549
|
break;
|
|
279458
279550
|
case "props":
|
|
279459
279551
|
if (instance === null) {
|
|
279460
279552
|
if (typeof overridePropsDeletePath === "function") {
|
|
279461
|
-
overridePropsDeletePath(fiber,
|
|
279553
|
+
overridePropsDeletePath(fiber, path16);
|
|
279462
279554
|
}
|
|
279463
279555
|
} else {
|
|
279464
|
-
fiber.pendingProps = copyWithDelete(instance.props,
|
|
279556
|
+
fiber.pendingProps = copyWithDelete(instance.props, path16);
|
|
279465
279557
|
instance.forceUpdate();
|
|
279466
279558
|
}
|
|
279467
279559
|
break;
|
|
279468
279560
|
case "state":
|
|
279469
|
-
deletePathInObject(instance.state,
|
|
279561
|
+
deletePathInObject(instance.state, path16);
|
|
279470
279562
|
instance.forceUpdate();
|
|
279471
279563
|
break;
|
|
279472
279564
|
}
|
|
@@ -279522,7 +279614,7 @@ var require_backend = __commonJS({
|
|
|
279522
279614
|
}
|
|
279523
279615
|
}
|
|
279524
279616
|
}
|
|
279525
|
-
function overrideValueAtPath(type, id, hookID,
|
|
279617
|
+
function overrideValueAtPath(type, id, hookID, path16, value) {
|
|
279526
279618
|
var devtoolsInstance = idToDevToolsInstanceMap.get(id);
|
|
279527
279619
|
if (devtoolsInstance === void 0) {
|
|
279528
279620
|
console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
|
|
@@ -279536,13 +279628,13 @@ var require_backend = __commonJS({
|
|
|
279536
279628
|
var instance = fiber.stateNode;
|
|
279537
279629
|
switch (type) {
|
|
279538
279630
|
case "context":
|
|
279539
|
-
|
|
279631
|
+
path16 = path16.slice(1);
|
|
279540
279632
|
switch (fiber.tag) {
|
|
279541
279633
|
case ClassComponent:
|
|
279542
|
-
if (
|
|
279634
|
+
if (path16.length === 0) {
|
|
279543
279635
|
instance.context = value;
|
|
279544
279636
|
} else {
|
|
279545
|
-
utils_setInObject(instance.context,
|
|
279637
|
+
utils_setInObject(instance.context, path16, value);
|
|
279546
279638
|
}
|
|
279547
279639
|
instance.forceUpdate();
|
|
279548
279640
|
break;
|
|
@@ -279552,18 +279644,18 @@ var require_backend = __commonJS({
|
|
|
279552
279644
|
break;
|
|
279553
279645
|
case "hooks":
|
|
279554
279646
|
if (typeof overrideHookState === "function") {
|
|
279555
|
-
overrideHookState(fiber, hookID,
|
|
279647
|
+
overrideHookState(fiber, hookID, path16, value);
|
|
279556
279648
|
}
|
|
279557
279649
|
break;
|
|
279558
279650
|
case "props":
|
|
279559
279651
|
switch (fiber.tag) {
|
|
279560
279652
|
case ClassComponent:
|
|
279561
|
-
fiber.pendingProps = copyWithSet(instance.props,
|
|
279653
|
+
fiber.pendingProps = copyWithSet(instance.props, path16, value);
|
|
279562
279654
|
instance.forceUpdate();
|
|
279563
279655
|
break;
|
|
279564
279656
|
default:
|
|
279565
279657
|
if (typeof overrideProps === "function") {
|
|
279566
|
-
overrideProps(fiber,
|
|
279658
|
+
overrideProps(fiber, path16, value);
|
|
279567
279659
|
}
|
|
279568
279660
|
break;
|
|
279569
279661
|
}
|
|
@@ -279571,7 +279663,7 @@ var require_backend = __commonJS({
|
|
|
279571
279663
|
case "state":
|
|
279572
279664
|
switch (fiber.tag) {
|
|
279573
279665
|
case ClassComponent:
|
|
279574
|
-
utils_setInObject(instance.state,
|
|
279666
|
+
utils_setInObject(instance.state, path16, value);
|
|
279575
279667
|
instance.forceUpdate();
|
|
279576
279668
|
break;
|
|
279577
279669
|
}
|
|
@@ -279857,14 +279949,14 @@ var require_backend = __commonJS({
|
|
|
279857
279949
|
var trackedPathMatchInstance = null;
|
|
279858
279950
|
var trackedPathMatchDepth = -1;
|
|
279859
279951
|
var mightBeOnTrackedPath = false;
|
|
279860
|
-
function setTrackedPath(
|
|
279861
|
-
if (
|
|
279952
|
+
function setTrackedPath(path16) {
|
|
279953
|
+
if (path16 === null) {
|
|
279862
279954
|
trackedPathMatchFiber = null;
|
|
279863
279955
|
trackedPathMatchInstance = null;
|
|
279864
279956
|
trackedPathMatchDepth = -1;
|
|
279865
279957
|
mightBeOnTrackedPath = false;
|
|
279866
279958
|
}
|
|
279867
|
-
trackedPath =
|
|
279959
|
+
trackedPath = path16;
|
|
279868
279960
|
}
|
|
279869
279961
|
function updateTrackedPathStateBeforeMount(fiber, fiberInstance) {
|
|
279870
279962
|
if (trackedPath === null || !mightBeOnTrackedPath) {
|
|
@@ -280632,9 +280724,9 @@ var require_backend = __commonJS({
|
|
|
280632
280724
|
}
|
|
280633
280725
|
var currentlyInspectedElementID = null;
|
|
280634
280726
|
var currentlyInspectedPaths = {};
|
|
280635
|
-
function mergeInspectedPaths(
|
|
280727
|
+
function mergeInspectedPaths(path16) {
|
|
280636
280728
|
var current = currentlyInspectedPaths;
|
|
280637
|
-
|
|
280729
|
+
path16.forEach(function(key) {
|
|
280638
280730
|
if (!current[key]) {
|
|
280639
280731
|
current[key] = {};
|
|
280640
280732
|
}
|
|
@@ -280642,13 +280734,13 @@ var require_backend = __commonJS({
|
|
|
280642
280734
|
});
|
|
280643
280735
|
}
|
|
280644
280736
|
function createIsPathAllowed(key) {
|
|
280645
|
-
return function isPathAllowed(
|
|
280737
|
+
return function isPathAllowed(path16) {
|
|
280646
280738
|
var current = currentlyInspectedPaths[key];
|
|
280647
280739
|
if (!current) {
|
|
280648
280740
|
return false;
|
|
280649
280741
|
}
|
|
280650
|
-
for (var i = 0; i <
|
|
280651
|
-
current = current[
|
|
280742
|
+
for (var i = 0; i < path16.length; i++) {
|
|
280743
|
+
current = current[path16[i]];
|
|
280652
280744
|
if (!current) {
|
|
280653
280745
|
return false;
|
|
280654
280746
|
}
|
|
@@ -280698,24 +280790,24 @@ var require_backend = __commonJS({
|
|
|
280698
280790
|
break;
|
|
280699
280791
|
}
|
|
280700
280792
|
}
|
|
280701
|
-
function storeAsGlobal(id,
|
|
280793
|
+
function storeAsGlobal(id, path16, count) {
|
|
280702
280794
|
var inspectedElement = inspectElementRaw(id);
|
|
280703
280795
|
if (inspectedElement !== null) {
|
|
280704
|
-
var value = utils_getInObject(inspectedElement,
|
|
280796
|
+
var value = utils_getInObject(inspectedElement, path16);
|
|
280705
280797
|
var key = "$reactTemp".concat(count);
|
|
280706
280798
|
window[key] = value;
|
|
280707
280799
|
console.log(key);
|
|
280708
280800
|
console.log(value);
|
|
280709
280801
|
}
|
|
280710
280802
|
}
|
|
280711
|
-
function getSerializedElementValueByPath(id,
|
|
280803
|
+
function getSerializedElementValueByPath(id, path16) {
|
|
280712
280804
|
var inspectedElement = inspectElementRaw(id);
|
|
280713
280805
|
if (inspectedElement !== null) {
|
|
280714
|
-
var valueToCopy = utils_getInObject(inspectedElement,
|
|
280806
|
+
var valueToCopy = utils_getInObject(inspectedElement, path16);
|
|
280715
280807
|
return serializeToString(valueToCopy);
|
|
280716
280808
|
}
|
|
280717
280809
|
}
|
|
280718
|
-
function inspectElement(requestID, id,
|
|
280810
|
+
function inspectElement(requestID, id, path16, forceFullData) {
|
|
280719
280811
|
if (forceFullData || currentlyInspectedElementID !== id) {
|
|
280720
280812
|
currentlyInspectedElementID = id;
|
|
280721
280813
|
currentlyInspectedPaths = {};
|
|
@@ -280728,8 +280820,8 @@ var require_backend = __commonJS({
|
|
|
280728
280820
|
type: "not-found"
|
|
280729
280821
|
};
|
|
280730
280822
|
}
|
|
280731
|
-
if (
|
|
280732
|
-
mergeInspectedPaths(
|
|
280823
|
+
if (path16 !== null) {
|
|
280824
|
+
mergeInspectedPaths(path16);
|
|
280733
280825
|
}
|
|
280734
280826
|
updateSelectedElement(id);
|
|
280735
280827
|
inspectedElement.context = cleanForBridge(inspectedElement.context, createIsPathAllowed("context"));
|
|
@@ -280932,10 +281024,10 @@ var require_backend = __commonJS({
|
|
|
280932
281024
|
console.groupEnd();
|
|
280933
281025
|
}
|
|
280934
281026
|
}
|
|
280935
|
-
function getElementAttributeByPath(id,
|
|
281027
|
+
function getElementAttributeByPath(id, path16) {
|
|
280936
281028
|
var inspectedElement = inspectElementRaw(id);
|
|
280937
281029
|
if (inspectedElement !== null) {
|
|
280938
|
-
return utils_getInObject(inspectedElement,
|
|
281030
|
+
return utils_getInObject(inspectedElement, path16);
|
|
280939
281031
|
}
|
|
280940
281032
|
return void 0;
|
|
280941
281033
|
}
|
|
@@ -280952,14 +281044,14 @@ var require_backend = __commonJS({
|
|
|
280952
281044
|
}
|
|
280953
281045
|
return element.type;
|
|
280954
281046
|
}
|
|
280955
|
-
function deletePath(type, id, hookID,
|
|
281047
|
+
function deletePath(type, id, hookID, path16) {
|
|
280956
281048
|
var internalInstance = idToInternalInstanceMap.get(id);
|
|
280957
281049
|
if (internalInstance != null) {
|
|
280958
281050
|
var publicInstance = internalInstance._instance;
|
|
280959
281051
|
if (publicInstance != null) {
|
|
280960
281052
|
switch (type) {
|
|
280961
281053
|
case "context":
|
|
280962
|
-
deletePathInObject(publicInstance.context,
|
|
281054
|
+
deletePathInObject(publicInstance.context, path16);
|
|
280963
281055
|
forceUpdate(publicInstance);
|
|
280964
281056
|
break;
|
|
280965
281057
|
case "hooks":
|
|
@@ -280967,12 +281059,12 @@ var require_backend = __commonJS({
|
|
|
280967
281059
|
case "props":
|
|
280968
281060
|
var element = internalInstance._currentElement;
|
|
280969
281061
|
internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
|
|
280970
|
-
props: copyWithDelete(element.props,
|
|
281062
|
+
props: copyWithDelete(element.props, path16)
|
|
280971
281063
|
});
|
|
280972
281064
|
forceUpdate(publicInstance);
|
|
280973
281065
|
break;
|
|
280974
281066
|
case "state":
|
|
280975
|
-
deletePathInObject(publicInstance.state,
|
|
281067
|
+
deletePathInObject(publicInstance.state, path16);
|
|
280976
281068
|
forceUpdate(publicInstance);
|
|
280977
281069
|
break;
|
|
280978
281070
|
}
|
|
@@ -281006,14 +281098,14 @@ var require_backend = __commonJS({
|
|
|
281006
281098
|
}
|
|
281007
281099
|
}
|
|
281008
281100
|
}
|
|
281009
|
-
function overrideValueAtPath(type, id, hookID,
|
|
281101
|
+
function overrideValueAtPath(type, id, hookID, path16, value) {
|
|
281010
281102
|
var internalInstance = idToInternalInstanceMap.get(id);
|
|
281011
281103
|
if (internalInstance != null) {
|
|
281012
281104
|
var publicInstance = internalInstance._instance;
|
|
281013
281105
|
if (publicInstance != null) {
|
|
281014
281106
|
switch (type) {
|
|
281015
281107
|
case "context":
|
|
281016
|
-
utils_setInObject(publicInstance.context,
|
|
281108
|
+
utils_setInObject(publicInstance.context, path16, value);
|
|
281017
281109
|
forceUpdate(publicInstance);
|
|
281018
281110
|
break;
|
|
281019
281111
|
case "hooks":
|
|
@@ -281021,12 +281113,12 @@ var require_backend = __commonJS({
|
|
|
281021
281113
|
case "props":
|
|
281022
281114
|
var element = internalInstance._currentElement;
|
|
281023
281115
|
internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
|
|
281024
|
-
props: copyWithSet(element.props,
|
|
281116
|
+
props: copyWithSet(element.props, path16, value)
|
|
281025
281117
|
});
|
|
281026
281118
|
forceUpdate(publicInstance);
|
|
281027
281119
|
break;
|
|
281028
281120
|
case "state":
|
|
281029
|
-
utils_setInObject(publicInstance.state,
|
|
281121
|
+
utils_setInObject(publicInstance.state, path16, value);
|
|
281030
281122
|
forceUpdate(publicInstance);
|
|
281031
281123
|
break;
|
|
281032
281124
|
}
|
|
@@ -281071,7 +281163,7 @@ var require_backend = __commonJS({
|
|
|
281071
281163
|
}
|
|
281072
281164
|
function setTraceUpdatesEnabled(enabled) {
|
|
281073
281165
|
}
|
|
281074
|
-
function setTrackedPath(
|
|
281166
|
+
function setTrackedPath(path16) {
|
|
281075
281167
|
}
|
|
281076
281168
|
function getOwnersList(id) {
|
|
281077
281169
|
return null;
|
|
@@ -282326,8 +282418,8 @@ var init_devtools = __esm({
|
|
|
282326
282418
|
|
|
282327
282419
|
// node_modules/ink/build/reconciler.js
|
|
282328
282420
|
async function loadPackageJson() {
|
|
282329
|
-
const
|
|
282330
|
-
const content =
|
|
282421
|
+
const fs16 = await import("node:fs");
|
|
282422
|
+
const content = fs16.readFileSync(new URL("../package.json", import.meta.url), "utf8");
|
|
282331
282423
|
return JSON.parse(content);
|
|
282332
282424
|
}
|
|
282333
282425
|
var import_react_reconciler, import_constants8, Scheduler, import_react, diff, cleanupYogaNode, currentUpdatePriority, currentRootNode, packageJson, reconciler_default;
|
|
@@ -282937,7 +283029,7 @@ var init_ansi_styles2 = __esm({
|
|
|
282937
283029
|
|
|
282938
283030
|
// node_modules/ink/node_modules/chalk/source/vendor/supports-color/index.js
|
|
282939
283031
|
import process5 from "node:process";
|
|
282940
|
-
import
|
|
283032
|
+
import os5 from "node:os";
|
|
282941
283033
|
import tty2 from "node:tty";
|
|
282942
283034
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.argv) {
|
|
282943
283035
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -282995,7 +283087,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
282995
283087
|
return min2;
|
|
282996
283088
|
}
|
|
282997
283089
|
if (process5.platform === "win32") {
|
|
282998
|
-
const osRelease =
|
|
283090
|
+
const osRelease = os5.release().split(".");
|
|
282999
283091
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
283000
283092
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
283001
283093
|
}
|
|
@@ -285358,7 +285450,7 @@ var init_Text = __esm({
|
|
|
285358
285450
|
});
|
|
285359
285451
|
|
|
285360
285452
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
285361
|
-
import * as
|
|
285453
|
+
import * as fs14 from "node:fs";
|
|
285362
285454
|
import { cwd } from "node:process";
|
|
285363
285455
|
function ErrorOverview({ error }) {
|
|
285364
285456
|
const stack = error.stack ? error.stack.split("\n").slice(1) : void 0;
|
|
@@ -285366,8 +285458,8 @@ function ErrorOverview({ error }) {
|
|
|
285366
285458
|
const filePath = cleanupPath(origin?.file);
|
|
285367
285459
|
let excerpt;
|
|
285368
285460
|
let lineWidth = 0;
|
|
285369
|
-
if (filePath && origin?.line &&
|
|
285370
|
-
const sourceCode =
|
|
285461
|
+
if (filePath && origin?.line && fs14.existsSync(filePath)) {
|
|
285462
|
+
const sourceCode = fs14.readFileSync(filePath, "utf8");
|
|
285371
285463
|
excerpt = dist_default3(sourceCode, origin.line);
|
|
285372
285464
|
if (excerpt) {
|
|
285373
285465
|
for (const { line } of excerpt) {
|
|
@@ -285468,8 +285560,8 @@ var init_ErrorOverview = __esm({
|
|
|
285468
285560
|
init_dist7();
|
|
285469
285561
|
init_Box();
|
|
285470
285562
|
init_Text();
|
|
285471
|
-
cleanupPath = (
|
|
285472
|
-
return
|
|
285563
|
+
cleanupPath = (path16) => {
|
|
285564
|
+
return path16?.replace(`file://${cwd()}/`, "");
|
|
285473
285565
|
};
|
|
285474
285566
|
stackUtils = new import_stack_utils.default({
|
|
285475
285567
|
cwd: cwd(),
|
|
@@ -287388,10 +287480,10 @@ __export(perch_cli_exports, {
|
|
|
287388
287480
|
runPerchCli: () => runPerchCli,
|
|
287389
287481
|
workerEventToCliRow: () => workerEventToCliRow
|
|
287390
287482
|
});
|
|
287391
|
-
import
|
|
287483
|
+
import fs15 from "node:fs";
|
|
287392
287484
|
import { createHash as createHash4 } from "node:crypto";
|
|
287393
|
-
import
|
|
287394
|
-
import
|
|
287485
|
+
import os6 from "node:os";
|
|
287486
|
+
import path15 from "node:path";
|
|
287395
287487
|
import readline from "node:readline/promises";
|
|
287396
287488
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
287397
287489
|
import { execFile as execFile3 } from "node:child_process";
|
|
@@ -287917,6 +288009,7 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
287917
288009
|
await syncInteractiveCliThreadScope(state, connection);
|
|
287918
288010
|
};
|
|
287919
288011
|
const runTurn = deps.runCliTurn ?? runPerchCliTurn;
|
|
288012
|
+
const updateNotice = resolveUpdateNotice(CLI_PACKAGE_VERSION);
|
|
287920
288013
|
const instance = Ink2.render(
|
|
287921
288014
|
React11.createElement(function PerchInkApp() {
|
|
287922
288015
|
const app = Ink2.useApp();
|
|
@@ -288760,6 +288853,11 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288760
288853
|
React11.createElement(Ink2.Text, { color: "#7a6f66" }, "perch \xB7 field terminal"),
|
|
288761
288854
|
React11.createElement(Ink2.Text, { color: "#7a6f66" }, `v${CLI_PACKAGE_VERSION}`)
|
|
288762
288855
|
),
|
|
288856
|
+
updateNotice ? React11.createElement(
|
|
288857
|
+
Ink2.Box,
|
|
288858
|
+
{ width: PERCH_SPLASH_WIDTH, marginBottom: 1 },
|
|
288859
|
+
React11.createElement(Ink2.Text, { color: CLI_BRAND.bronzeGlint }, updateNotice)
|
|
288860
|
+
) : null,
|
|
288763
288861
|
...PERCH_SPLASH_SCENE.map(
|
|
288764
288862
|
(line, index) => React11.createElement(
|
|
288765
288863
|
Ink2.Box,
|
|
@@ -289264,12 +289362,12 @@ async function persistCliThreadState(input) {
|
|
|
289264
289362
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
289265
289363
|
};
|
|
289266
289364
|
const filePath = cliThreadStatePath(input.threadId, input.threadScopeKey);
|
|
289267
|
-
await
|
|
289268
|
-
await
|
|
289365
|
+
await fs15.promises.mkdir(path15.dirname(filePath), { recursive: true, mode: 448 });
|
|
289366
|
+
await fs15.promises.writeFile(filePath, JSON.stringify(payload, null, 2), { mode: 384 });
|
|
289269
289367
|
}
|
|
289270
289368
|
async function readCliThreadState(threadId, threadScopeKey) {
|
|
289271
289369
|
try {
|
|
289272
|
-
const raw = await
|
|
289370
|
+
const raw = await fs15.promises.readFile(cliThreadStatePath(threadId, threadScopeKey), "utf8");
|
|
289273
289371
|
const parsed = JSON.parse(raw);
|
|
289274
289372
|
if (parsed.version !== 1 || parsed.threadId !== threadId) return null;
|
|
289275
289373
|
return {
|
|
@@ -289285,11 +289383,11 @@ async function readCliThreadState(threadId, threadScopeKey) {
|
|
|
289285
289383
|
}
|
|
289286
289384
|
}
|
|
289287
289385
|
async function deleteCliThreadState(threadId, threadScopeKey) {
|
|
289288
|
-
await
|
|
289386
|
+
await fs15.promises.rm(cliThreadStatePath(threadId, threadScopeKey), { force: true }).catch(() => void 0);
|
|
289289
289387
|
}
|
|
289290
289388
|
function cliThreadStatePath(threadId, threadScopeKey) {
|
|
289291
|
-
const base = process.env.PERCH_CLI_STATE_DIR?.trim() ||
|
|
289292
|
-
return
|
|
289389
|
+
const base = process.env.PERCH_CLI_STATE_DIR?.trim() || path15.join(os6.homedir(), ".perch", "threads");
|
|
289390
|
+
return path15.join(base, safeCliThreadScopeKey(threadScopeKey), `${safeCliThreadId(threadId)}.json`);
|
|
289293
289391
|
}
|
|
289294
289392
|
async function resolveCliThreadScopeKey(connection) {
|
|
289295
289393
|
const session = await readStoredCliAuthSession().catch(() => null);
|
|
@@ -290168,20 +290266,20 @@ function writeAPScenarioResult(result2, json, writer) {
|
|
|
290168
290266
|
}
|
|
290169
290267
|
function resolveFolderPath(input) {
|
|
290170
290268
|
const resolved = resolvePath(input);
|
|
290171
|
-
const stat2 =
|
|
290269
|
+
const stat2 = fs15.existsSync(resolved) ? fs15.statSync(resolved) : null;
|
|
290172
290270
|
if (!stat2?.isDirectory()) throw new Error(`Folder does not exist: ${resolved}`);
|
|
290173
290271
|
return resolved;
|
|
290174
290272
|
}
|
|
290175
290273
|
function resolveExistingDirectory(input) {
|
|
290176
290274
|
const resolved = resolvePath(input);
|
|
290177
|
-
const stat2 =
|
|
290275
|
+
const stat2 = fs15.existsSync(resolved) ? fs15.statSync(resolved) : null;
|
|
290178
290276
|
if (!stat2?.isDirectory()) throw new Error(`Directory does not exist: ${resolved}`);
|
|
290179
290277
|
return resolved;
|
|
290180
290278
|
}
|
|
290181
290279
|
function resolvePath(input) {
|
|
290182
290280
|
if (input === "~") return process.env.HOME ?? input;
|
|
290183
|
-
if (input.startsWith("~/")) return
|
|
290184
|
-
return
|
|
290281
|
+
if (input.startsWith("~/")) return path15.join(process.env.HOME ?? "", input.slice(2));
|
|
290282
|
+
return path15.resolve(input);
|
|
290185
290283
|
}
|
|
290186
290284
|
function requireCliAppUrl(input) {
|
|
290187
290285
|
const resolved = resolveCliAppUrl(input, null);
|
|
@@ -290215,16 +290313,16 @@ function parseExpectation(input) {
|
|
|
290215
290313
|
return { key, value: rawValue };
|
|
290216
290314
|
}
|
|
290217
290315
|
function readCliPackageVersion() {
|
|
290218
|
-
const scriptDir =
|
|
290316
|
+
const scriptDir = path15.dirname(fileURLToPath(import.meta.url));
|
|
290219
290317
|
const candidates = [
|
|
290220
|
-
|
|
290221
|
-
|
|
290222
|
-
|
|
290223
|
-
|
|
290318
|
+
path15.resolve(scriptDir, "../packages/cli/package.json"),
|
|
290319
|
+
path15.resolve(scriptDir, "../package.json"),
|
|
290320
|
+
path15.resolve(process.cwd(), "packages/cli/package.json"),
|
|
290321
|
+
path15.resolve(process.cwd(), "package.json")
|
|
290224
290322
|
];
|
|
290225
290323
|
for (const candidate of candidates) {
|
|
290226
290324
|
try {
|
|
290227
|
-
const raw =
|
|
290325
|
+
const raw = fs15.readFileSync(candidate, "utf8");
|
|
290228
290326
|
const parsed = JSON.parse(raw);
|
|
290229
290327
|
if (typeof parsed.version === "string" && parsed.version.trim()) {
|
|
290230
290328
|
return parsed.version.trim();
|
|
@@ -290237,7 +290335,7 @@ function readCliPackageVersion() {
|
|
|
290237
290335
|
function shortCwd(cwd2) {
|
|
290238
290336
|
const home = process.env.HOME;
|
|
290239
290337
|
if (home && cwd2 === home) return "~";
|
|
290240
|
-
if (home && cwd2.startsWith(`${home}${
|
|
290338
|
+
if (home && cwd2.startsWith(`${home}${path15.sep}`)) {
|
|
290241
290339
|
return `~/${cwd2.slice(home.length + 1)}`;
|
|
290242
290340
|
}
|
|
290243
290341
|
return cwd2;
|
|
@@ -290271,6 +290369,7 @@ var init_perch_cli = __esm({
|
|
|
290271
290369
|
init_sharedSlashCommands();
|
|
290272
290370
|
init_toolDefinitions();
|
|
290273
290371
|
init_nodeLocalBridge();
|
|
290372
|
+
init_cliUpdateCheck();
|
|
290274
290373
|
init_agentSkillRegistry();
|
|
290275
290374
|
execFileAsync3 = promisify3(execFile3);
|
|
290276
290375
|
DEFAULT_CLI_LOGIN_APP_URL = "https://app.perchai.app";
|