@testream/dotnet-reporter 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -7
- package/dist/index.js +6 -7019
- package/dist/index.js.map +1 -1
- package/package.json +15 -8
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnIA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AA4BA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AAIA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;ACnXA;AAWA;AASA;AA9CA;AACA;AAEA;AACA;AAsBA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AASA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAMA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1TA;AAqJA;AAtPA;AACA;AACA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;;;;ACjTA;AAVA;AAOA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;AC7BA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClYA;AACA;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC50BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtmCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7gCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACj+DA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../../shared-types/dist/ci-detection.js","../../shared-types/dist/ctrf.js","../../shared-types/dist/index.js","../../shared-types/dist/js-test-name-snippets.js","../../shared-types/dist/source-snippets.js","../../shared-types/dist/test-locations.js","../../shared-types/dist/upload.js",".././src/cli.ts",".././src/source-snippets.ts",".././src/trx-parser.ts",".././src/uploader.ts","../external node-commonjs \"child_process\"","../external node-commonjs \"fs\"","../external node-commonjs \"fs/promises\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:diagnostics_channel\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:string_decoder\"","../external node-commonjs \"node:url\"","../external node-commonjs \"os\"","../external node-commonjs \"path\"","../../../node_modules/glob/dist/commonjs/glob.js","../../../node_modules/glob/dist/commonjs/has-magic.js","../../../node_modules/glob/dist/commonjs/ignore.js","../../../node_modules/glob/dist/commonjs/index.js","../../../node_modules/glob/dist/commonjs/pattern.js","../../../node_modules/glob/dist/commonjs/processor.js","../../../node_modules/glob/dist/commonjs/walker.js","../../../node_modules/lru-cache/dist/commonjs/node/index.min.js","../../../node_modules/minimatch/dist/commonjs/assert-valid-pattern.js","../../../node_modules/minimatch/dist/commonjs/ast.js","../../../node_modules/minimatch/dist/commonjs/brace-expressions.js","../../../node_modules/minimatch/dist/commonjs/escape.js","../../../node_modules/minimatch/dist/commonjs/index.js","../../../node_modules/minimatch/dist/commonjs/unescape.js","../../../node_modules/minimatch/node_modules/balanced-match/dist/commonjs/index.js","../../../node_modules/minimatch/node_modules/brace-expansion/dist/commonjs/index.js","../../../node_modules/minipass/dist/commonjs/index.js","../../../node_modules/path-scurry/dist/commonjs/index.js","../../../node_modules/fast-xml-parser/lib/fxp.cjs","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../webpack/before-startup","../webpack/startup","../webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.detectCIContext = detectCIContext;\nfunction removePrefix(value, prefix) {\n if (!value) {\n return undefined;\n }\n return value.startsWith(prefix) ? value.slice(prefix.length) : value;\n}\nfunction readEnvironment() {\n const runtime = globalThis;\n return runtime.process?.env ?? {};\n}\nfunction buildGithubRepositoryUrl(env) {\n if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY) {\n return undefined;\n }\n return `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`;\n}\nfunction buildGithubBuildUrl(env) {\n if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY || !env.GITHUB_RUN_ID) {\n return undefined;\n }\n return `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`;\n}\nfunction detectGitHubBranch(env) {\n if (env.GITHUB_HEAD_REF) {\n return env.GITHUB_HEAD_REF;\n }\n if (env.GITHUB_REF?.startsWith('refs/heads/')) {\n return env.GITHUB_REF_NAME ?? removePrefix(env.GITHUB_REF, 'refs/heads/');\n }\n return undefined;\n}\nfunction detectGitHubActionsContext(env) {\n return {\n branch: detectGitHubBranch(env),\n commitSha: env.GITHUB_SHA,\n repositoryUrl: buildGithubRepositoryUrl(env),\n buildNumber: env.GITHUB_RUN_NUMBER,\n buildUrl: buildGithubBuildUrl(env),\n };\n}\nfunction detectGitLabContext(env) {\n return {\n branch: env.CI_COMMIT_BRANCH || env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,\n commitSha: env.CI_COMMIT_SHA,\n repositoryUrl: env.CI_PROJECT_URL,\n buildNumber: env.CI_PIPELINE_IID,\n buildUrl: env.CI_PIPELINE_URL,\n };\n}\nfunction detectAzurePipelinesContext(env) {\n return {\n branch: removePrefix(env.BUILD_SOURCEBRANCH, 'refs/heads/'),\n commitSha: env.BUILD_SOURCEVERSION,\n repositoryUrl: env.BUILD_REPOSITORY_URI,\n buildNumber: env.BUILD_BUILDNUMBER,\n buildUrl: env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI && env.SYSTEM_TEAMPROJECT && env.BUILD_BUILDID\n ? `${env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${env.SYSTEM_TEAMPROJECT}/_build/results?buildId=${env.BUILD_BUILDID}`\n : undefined,\n };\n}\nfunction detectCircleCIContext(env) {\n return {\n branch: env.CIRCLE_BRANCH,\n commitSha: env.CIRCLE_SHA1,\n repositoryUrl: env.CIRCLE_REPOSITORY_URL,\n buildNumber: env.CIRCLE_BUILD_NUM,\n buildUrl: env.CIRCLE_BUILD_URL,\n };\n}\nfunction detectJenkinsContext(env) {\n return {\n branch: removePrefix(env.GIT_BRANCH, 'origin/'),\n commitSha: env.GIT_COMMIT,\n repositoryUrl: env.GIT_URL,\n buildNumber: env.BUILD_NUMBER,\n buildUrl: env.BUILD_URL,\n };\n}\nfunction detectBitbucketContext(env) {\n return {\n branch: env.BITBUCKET_BRANCH,\n commitSha: env.BITBUCKET_COMMIT,\n repositoryUrl: env.BITBUCKET_GIT_HTTP_ORIGIN,\n buildNumber: env.BITBUCKET_BUILD_NUMBER,\n buildUrl: env.BITBUCKET_REPO_FULL_NAME && env.BITBUCKET_BUILD_NUMBER\n ? `https://bitbucket.org/${env.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${env.BITBUCKET_BUILD_NUMBER}`\n : undefined,\n };\n}\nconst CI_PROVIDER_DETECTORS = [\n {\n isMatch: (env) => env.GITHUB_ACTIONS === 'true',\n detect: detectGitHubActionsContext,\n },\n {\n isMatch: (env) => env.GITLAB_CI === 'true',\n detect: detectGitLabContext,\n },\n {\n isMatch: (env) => env.TF_BUILD === 'True',\n detect: detectAzurePipelinesContext,\n },\n {\n isMatch: (env) => env.CIRCLECI === 'true',\n detect: detectCircleCIContext,\n },\n {\n isMatch: (env) => Boolean(env.JENKINS_URL),\n detect: detectJenkinsContext,\n },\n {\n isMatch: (env) => Boolean(env.BITBUCKET_BUILD_NUMBER),\n detect: detectBitbucketContext,\n },\n];\n/**\n * Detect CI context from environment variables\n * Supports: GitHub Actions, GitLab CI, Azure Pipelines, CircleCI, Jenkins, Bitbucket Pipelines\n */\nfunction detectCIContext() {\n const env = readEnvironment();\n for (const provider of CI_PROVIDER_DETECTORS) {\n if (provider.isMatch(env)) {\n return provider.detect(env);\n }\n }\n return {};\n}\n//# sourceMappingURL=ci-detection.js.map","\"use strict\";\n// CTRF (Common Test Report Format) Type Definitions\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ctrf.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestLocationCollector = exports.enrichReportWithJsTestNameSourceSnippets = exports.resolveSourceSnippetOptions = exports.enrichReportWithSourceSnippets = exports.ensureReportId = exports.mapAttachmentsToTestResults = exports.uploadArtifacts = exports.uploadTestRun = exports.detectCIContext = void 0;\n// CTRF types\n__exportStar(require(\"./ctrf\"), exports);\nvar ci_detection_1 = require(\"./ci-detection\");\nObject.defineProperty(exports, \"detectCIContext\", { enumerable: true, get: function () { return ci_detection_1.detectCIContext; } });\nvar upload_1 = require(\"./upload\");\nObject.defineProperty(exports, \"uploadTestRun\", { enumerable: true, get: function () { return upload_1.uploadTestRun; } });\nObject.defineProperty(exports, \"uploadArtifacts\", { enumerable: true, get: function () { return upload_1.uploadArtifacts; } });\nObject.defineProperty(exports, \"mapAttachmentsToTestResults\", { enumerable: true, get: function () { return upload_1.mapAttachmentsToTestResults; } });\nObject.defineProperty(exports, \"ensureReportId\", { enumerable: true, get: function () { return upload_1.ensureReportId; } });\nvar source_snippets_1 = require(\"./source-snippets\");\nObject.defineProperty(exports, \"enrichReportWithSourceSnippets\", { enumerable: true, get: function () { return source_snippets_1.enrichReportWithSourceSnippets; } });\nObject.defineProperty(exports, \"resolveSourceSnippetOptions\", { enumerable: true, get: function () { return source_snippets_1.resolveSourceSnippetOptions; } });\nvar js_test_name_snippets_1 = require(\"./js-test-name-snippets\");\nObject.defineProperty(exports, \"enrichReportWithJsTestNameSourceSnippets\", { enumerable: true, get: function () { return js_test_name_snippets_1.enrichReportWithJsTestNameSourceSnippets; } });\nvar test_locations_1 = require(\"./test-locations\");\nObject.defineProperty(exports, \"createTestLocationCollector\", { enumerable: true, get: function () { return test_locations_1.createTestLocationCollector; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enrichReportWithJsTestNameSourceSnippets = enrichReportWithJsTestNameSourceSnippets;\nconst promises_1 = require(\"node:fs/promises\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst source_snippets_1 = require(\"./source-snippets\");\nconst MAX_CANDIDATES = 3;\n// Finds the start of common JS/TS test declarations, then the title is parsed\n// manually so titles can contain non-delimiting quotes like `it(\"doesn't\")`.\nconst JS_TEST_DECLARATION_PATTERN = /\\b(describe|it|test)(?:\\.(only|skip))?\\s*\\(\\s*(['\"`])/g;\nasync function enrichReportWithJsTestNameSourceSnippets(report, options) {\n const resolved = (0, source_snippets_1.resolveSourceSnippetOptions)(options);\n const fileCandidateCache = new Map();\n await Promise.all(report.results.tests.map(async (test) => {\n if (test.snippet || !test.filePath) {\n return;\n }\n const filePath = node_path_1.default.resolve(resolved.sourceRoot, test.filePath);\n if (!isInsideSourceRoot(filePath, resolved.sourceRoot)) {\n return;\n }\n const candidates = await getCachedJsTestCandidates(filePath, fileCandidateCache);\n if (!candidates) {\n return;\n }\n const matches = rankCandidatesForTest(test, candidates).slice(0, MAX_CANDIDATES);\n if (matches.length === 0) {\n return;\n }\n test.line ?? (test.line = matches[0].line);\n test.snippet = formatCandidateSnippet(matches, resolved);\n }));\n}\nfunction getCachedJsTestCandidates(filePath, fileCandidateCache) {\n let cached = fileCandidateCache.get(filePath);\n if (!cached) {\n cached = (0, promises_1.readFile)(filePath, 'utf-8')\n .then((content) => scanJsTestCandidates(content))\n .catch(() => undefined);\n fileCandidateCache.set(filePath, cached);\n }\n return cached;\n}\n// This scanner intentionally handles the common JS/TS test declaration shapes\n// without adding parser dependencies to every reporter package. Exact runner\n// line metadata still wins; this fallback exists to give AI review bounded\n// source context when the reporter only emitted file path and test name.\nfunction scanJsTestCandidates(content) {\n const lineOffsets = buildLineOffsets(content);\n const blocks = scanJsTestBlocks(content, lineOffsets);\n const describeBlocks = blocks.filter((block) => block.kind === 'describe');\n return blocks\n .filter((block) => block.kind === 'test')\n .map((block) => {\n const describeTitles = describeBlocks\n .filter((describeBlock) => describeBlock.startIndex < block.startIndex && describeBlock.endIndex >= block.endIndex)\n .sort((left, right) => left.startIndex - right.startIndex)\n .map((describeBlock) => describeBlock.title);\n return {\n title: block.title,\n describeTitles,\n fullName: [...describeTitles, block.title].join(' ').trim(),\n line: block.startLine,\n snippet: block.snippet,\n };\n });\n}\nfunction scanJsTestBlocks(content, lineOffsets) {\n const blocks = [];\n JS_TEST_DECLARATION_PATTERN.lastIndex = 0;\n let match;\n while ((match = JS_TEST_DECLARATION_PATTERN.exec(content)) !== null) {\n if (isCommentedLine(content, match.index)) {\n continue;\n }\n const title = readQuotedTitle(content, match.index + match[0].length, match[3]);\n if (!title) {\n continue;\n }\n const commaIndex = skipWhitespaceAndFindComma(content, title.endIndex + 1);\n if (commaIndex == null) {\n continue;\n }\n const kind = match[1] === 'describe' ? 'describe' : 'test';\n const startIndex = match.index;\n const openBraceIndex = findCallbackOpenBrace(content, commaIndex + 1);\n if (openBraceIndex == null) {\n continue;\n }\n const closeBraceIndex = findMatchingBrace(content, openBraceIndex);\n if (closeBraceIndex == null) {\n continue;\n }\n const endIndex = findSnippetEndIndex(content, closeBraceIndex);\n const snippet = content.slice(startIndex, endIndex).trim();\n if (!snippet) {\n continue;\n }\n blocks.push({\n kind,\n title: title.value.trim(),\n startIndex,\n endIndex,\n startLine: getLineNumber(lineOffsets, startIndex),\n snippet,\n });\n }\n return blocks;\n}\nfunction rankCandidatesForTest(test, candidates) {\n const normalizedName = normalizeWhitespace(test.name);\n const suiteChain = normalizeDescribeChain(test.suite);\n const exactFullNameMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.fullName) === normalizedName);\n if (exactFullNameMatches.length > 0) {\n return exactFullNameMatches;\n }\n if (suiteChain) {\n const suiteMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.title) === normalizedName &&\n normalizeWhitespace(candidate.describeTitles.join(' ')) === suiteChain);\n if (suiteMatches.length > 0) {\n return suiteMatches;\n }\n }\n const leafTitleMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.title) === normalizedName);\n if (leafTitleMatches.length > 0) {\n return leafTitleMatches;\n }\n return candidates.filter((candidate) => {\n const normalizedTitle = normalizeWhitespace(candidate.title);\n if (!normalizedName.endsWith(normalizedTitle)) {\n return false;\n }\n const prefix = normalizedName\n .slice(0, normalizedName.length - normalizedTitle.length)\n .trim();\n return prefix.length > 0 && normalizeWhitespace(candidate.describeTitles.join(' ')) === prefix;\n });\n}\nfunction formatCandidateSnippet(candidates, options) {\n const combined = candidates.length === 1\n ? candidates[0].snippet\n : candidates\n .map((candidate, index) => `Candidate ${index + 1} (line ${candidate.line})\\n${candidate.snippet}`)\n .join('\\n\\n');\n const boundedLines = combined.split(/\\r?\\n/).slice(0, options.maxLines).join('\\n').trim();\n if (boundedLines.length <= options.maxChars) {\n return boundedLines;\n }\n return boundedLines.slice(0, options.maxChars);\n}\nfunction findCallbackOpenBrace(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '/' && content[index + 1] === '/') {\n index = skipLineComment(content, index + 2);\n continue;\n }\n if (char === '/' && content[index + 1] === '*') {\n index = skipBlockComment(content, index + 2);\n continue;\n }\n if (content.startsWith('=>', index)) {\n return findNextBlockBrace(content, index + 2);\n }\n if (startsWithWord(content, index, 'function')) {\n return findNextBlockBrace(content, index + 'function'.length);\n }\n if (char === ';') {\n return undefined;\n }\n }\n return undefined;\n}\nfunction findNextBlockBrace(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '{') {\n return index;\n }\n if (char === '\\n' && looksLikeLineTerminator(content, index + 1)) {\n return undefined;\n }\n }\n return undefined;\n}\nfunction findMatchingBrace(content, openBraceIndex) {\n let depth = 0;\n for (let index = openBraceIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '/' && content[index + 1] === '/') {\n index = skipLineComment(content, index + 2);\n continue;\n }\n if (char === '/' && content[index + 1] === '*') {\n index = skipBlockComment(content, index + 2);\n continue;\n }\n if (char === '{') {\n depth++;\n continue;\n }\n if (char === '}') {\n depth--;\n if (depth === 0) {\n return index;\n }\n }\n }\n return undefined;\n}\nfunction readQuotedTitle(content, startIndex, quote) {\n let value = '';\n for (let index = startIndex; index < content.length; index++) {\n const char = content[index];\n if (char === '\\\\') {\n value += char;\n if (index + 1 < content.length) {\n index++;\n value += content[index];\n }\n continue;\n }\n if (char === quote) {\n return { value, endIndex: index };\n }\n if (char === '\\n' && quote !== '`') {\n return undefined;\n }\n value += char;\n }\n return undefined;\n}\nfunction skipWhitespaceAndFindComma(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (/\\s/.test(char)) {\n continue;\n }\n return char === ',' ? index : undefined;\n }\n return undefined;\n}\nfunction findSnippetEndIndex(content, closeBraceIndex) {\n let index = closeBraceIndex + 1;\n while (index < content.length) {\n const char = content[index];\n if (char === '\\r' || char === '\\n') {\n return index;\n }\n index++;\n }\n return content.length;\n}\nfunction skipQuotedString(content, startIndex) {\n const quote = content[startIndex];\n for (let index = startIndex + 1; index < content.length; index++) {\n const char = content[index];\n if (char === '\\\\') {\n index++;\n continue;\n }\n if (char === quote) {\n return index;\n }\n }\n return content.length - 1;\n}\nfunction skipLineComment(content, startIndex) {\n for (let index = startIndex; index < content.length; index++) {\n if (content[index] === '\\n') {\n return index;\n }\n }\n return content.length - 1;\n}\nfunction skipBlockComment(content, startIndex) {\n for (let index = startIndex; index < content.length - 1; index++) {\n if (content[index] === '*' && content[index + 1] === '/') {\n return index + 1;\n }\n }\n return content.length - 1;\n}\nfunction looksLikeLineTerminator(content, index) {\n for (let cursor = index; cursor < content.length; cursor++) {\n const char = content[cursor];\n if (!/\\s/.test(char)) {\n return char !== '.' && char !== '(';\n }\n }\n return false;\n}\nfunction buildLineOffsets(content) {\n const offsets = [0];\n for (let index = 0; index < content.length; index++) {\n if (content[index] === '\\n') {\n offsets.push(index + 1);\n }\n }\n return offsets;\n}\nfunction getLineNumber(lineOffsets, index) {\n let line = 0;\n for (let i = 0; i < lineOffsets.length; i++) {\n if (lineOffsets[i] > index) {\n break;\n }\n line = i;\n }\n return line + 1;\n}\nfunction isCommentedLine(content, index) {\n const lineStart = content.lastIndexOf('\\n', index - 1) + 1;\n const prefix = content.slice(lineStart, index).trimStart();\n return prefix.startsWith('//') || prefix.startsWith('*');\n}\nfunction startsWithWord(content, index, word) {\n if (!content.startsWith(word, index)) {\n return false;\n }\n const before = index === 0 ? '' : content[index - 1];\n const after = content[index + word.length] ?? '';\n return !isIdentifierChar(before) && !isIdentifierChar(after);\n}\nfunction isIdentifierChar(char) {\n return /[A-Za-z0-9_$]/.test(char);\n}\nfunction normalizeWhitespace(value) {\n return (value ?? '').trim().replace(/\\s+/g, ' ');\n}\nfunction normalizeDescribeChain(suite) {\n if (!suite) {\n return '';\n }\n const segments = suite\n .split('>')\n .map((segment) => segment.trim())\n .filter(Boolean);\n if (segments.length === 0) {\n return '';\n }\n const firstSegmentLooksLikeFile = segments[0].includes('.');\n const describeSegments = firstSegmentLooksLikeFile ? segments.slice(1) : segments;\n return normalizeWhitespace(describeSegments.join(' '));\n}\nfunction isInsideSourceRoot(filePath, sourceRoot) {\n const relative = node_path_1.default.relative(sourceRoot, filePath);\n return relative.length > 0 && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative);\n}\n//# sourceMappingURL=js-test-name-snippets.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSourceSnippetOptions = resolveSourceSnippetOptions;\nexports.enrichReportWithSourceSnippets = enrichReportWithSourceSnippets;\nconst promises_1 = require(\"node:fs/promises\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst DEFAULT_MAX_CHARS = 2000;\nconst DEFAULT_MAX_LINES = 40;\nfunction resolveSourceSnippetOptions(options) {\n return {\n sourceRoot: node_path_1.default.resolve(options?.sourceRoot ?? process.cwd()),\n maxChars: normalizePositiveInt(options?.maxChars, DEFAULT_MAX_CHARS),\n maxLines: normalizePositiveInt(options?.maxLines, DEFAULT_MAX_LINES),\n };\n}\n// This implementation only extracts JS/TS-style test()/it() blocks.\n// Other languages need reporter-specific snippet logic after that reporter\n// has supplied file/line metadata for the test.\nasync function enrichReportWithSourceSnippets(report, options) {\n const resolved = resolveSourceSnippetOptions(options);\n const fileContentCache = new Map();\n await Promise.all(report.results.tests.map(async (test) => {\n if (test.snippet || !test.filePath || !test.line) {\n return;\n }\n const snippet = await tryExtractSnippet(test, resolved, fileContentCache);\n if (snippet) {\n test.snippet = snippet;\n }\n }));\n}\nasync function tryExtractSnippet(test, options, fileContentCache) {\n const filePath = node_path_1.default.resolve(options.sourceRoot, test.filePath);\n if (!isInsideSourceRoot(filePath, options.sourceRoot)) {\n return undefined;\n }\n const content = await getCachedFileContent(filePath, fileContentCache);\n if (!content) {\n return undefined;\n }\n return extractEnclosingTestBlock(content, test.line, options);\n}\nfunction getCachedFileContent(filePath, fileContentCache) {\n let cached = fileContentCache.get(filePath);\n if (!cached) {\n cached = (0, promises_1.readFile)(filePath, 'utf-8').catch(() => undefined);\n fileContentCache.set(filePath, cached);\n }\n return cached;\n}\nfunction extractEnclosingTestBlock(content, lineNumber, options) {\n const lines = content.split(/\\r?\\n/);\n const index = Math.max(0, Math.min(lines.length - 1, lineNumber - 1));\n const start = findTestStart(lines, index);\n if (start == null) {\n return undefined;\n }\n const selected = [];\n let braceBalance = 0;\n let sawOpeningBrace = false;\n for (let i = start; i < lines.length && selected.length < options.maxLines; i++) {\n const line = lines[i];\n selected.push(line);\n for (const char of line) {\n if (char === '{') {\n braceBalance++;\n sawOpeningBrace = true;\n }\n else if (char === '}') {\n braceBalance--;\n }\n }\n if (sawOpeningBrace && braceBalance <= 0 && isJsTestBlockTerminator(line)) {\n break;\n }\n }\n const snippet = selected.join('\\n').trim();\n if (!snippet) {\n return undefined;\n }\n return snippet.length <= options.maxChars\n ? snippet\n : snippet.slice(0, options.maxChars);\n}\nfunction findTestStart(lines, fromIndex) {\n for (let i = fromIndex; i >= 0; i--) {\n // Walk upward from runner-provided line metadata until we hit a JS/TS\n // test/it call, including common modifiers used by Vitest/Playwright.\n if (/\\b(?:test|it)(?:\\.(?:only|skip|fixme|slow))?\\s*\\(/.test(lines[i])) {\n return i;\n }\n }\n return undefined;\n}\nfunction isJsTestBlockTerminator(line) {\n let i = line.length - 1;\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n if (i >= 0 && line[i] === ';') {\n i--;\n }\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n if (i < 1 || line[i] !== ')') {\n return false;\n }\n i--;\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n return i >= 0 && line[i] === '}';\n}\nfunction isInsideSourceRoot(filePath, sourceRoot) {\n const relative = node_path_1.default.relative(sourceRoot, filePath);\n return relative.length > 0 && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative);\n}\nfunction normalizePositiveInt(value, fallback) {\n return typeof value === 'number' && Number.isInteger(value) && value > 0\n ? value\n : fallback;\n}\n//# sourceMappingURL=source-snippets.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestLocationCollector = createTestLocationCollector;\n/**\n * Generic name-based location mapper for CTRF reports.\n *\n * Different reporters can collect test locations in their own format\n * (Playwright runtime metadata, parsed JUnit XML, etc.) and then feed\n * this collector to apply file/line metadata in a consistent FIFO way.\n */\nfunction createTestLocationCollector() {\n const locationsByTestName = new Map();\n return {\n add(testName, location) {\n if (!testName || !isValidLocation(location)) {\n return;\n }\n const queue = locationsByTestName.get(testName) ?? [];\n queue.push(location);\n locationsByTestName.set(testName, queue);\n },\n applyToReport(report) {\n const queues = new Map([...locationsByTestName.entries()].map(([name, locations]) => [name, [...locations]]));\n for (const test of report.results.tests) {\n const queue = queues.get(test.name);\n const location = queue?.shift();\n if (!location) {\n continue;\n }\n test.filePath ?? (test.filePath = location.filePath);\n test.line ?? (test.line = location.line);\n }\n },\n };\n}\nfunction isValidLocation(location) {\n return Boolean(location.filePath) && Number.isInteger(location.line) && location.line > 0;\n}\n//# sourceMappingURL=test-locations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureReportId = ensureReportId;\nexports.uploadTestRun = uploadTestRun;\nexports.mapAttachmentsToTestResults = mapAttachmentsToTestResults;\nexports.uploadArtifacts = uploadArtifacts;\nconst ci_detection_1 = require(\"./ci-detection\");\nconst source_snippets_1 = require(\"./source-snippets\");\nconst DEFAULT_API_URL = \"https://api.testream.app\";\nfunction ensureReportId(report) {\n if (typeof report.reportId === \"string\" &&\n report.reportId.trim().length > 0) {\n return report.reportId;\n }\n const reportId = crypto.randomUUID();\n report.reportId = reportId;\n return reportId;\n}\nfunction resolveApiUrl(explicitApiUrl) {\n const fromExplicit = normalizeApiUrl(explicitApiUrl);\n if (fromExplicit) {\n return fromExplicit;\n }\n const fromEnv = getEnvApiUrl();\n if (fromEnv) {\n return fromEnv;\n }\n return DEFAULT_API_URL;\n}\nfunction getEnvApiUrl() {\n if (typeof process === \"undefined\" || !process?.env) {\n return undefined;\n }\n return normalizeApiUrl(process.env.TESTREAM_API_URL);\n}\nfunction normalizeApiUrl(value) {\n if (!value) {\n return undefined;\n }\n const trimmed = value.trim();\n if (!trimmed) {\n return undefined;\n }\n // Use while loop instead of regex for better performance and clarity\n let result = trimmed;\n while (result.endsWith(\"/\")) {\n result = result.slice(0, -1);\n }\n return result;\n}\nfunction isReportAlreadyExistsConflict(error) {\n return error.errorCode === \"report_already_exists\";\n}\nfunction formatUploadError(error) {\n const detail = error.detail || error.title || error.rawBody || \"Unknown error\";\n const codeLabel = error.errorCode ? `, code=${error.errorCode}` : \"\";\n return `Upload failed (HTTP ${error.statusCode}${codeLabel}): ${detail}`;\n}\nasync function parseHttpError(response) {\n const rawBody = await response.text();\n const contentType = response.headers.get(\"content-type\") || \"\";\n if (contentType.toLowerCase().includes(\"json\") && rawBody.trim().length > 0) {\n try {\n const parsed = JSON.parse(rawBody);\n return {\n statusCode: response.status,\n title: parsed.title,\n detail: parsed.detail || parsed.details || parsed.error,\n errorCode: parsed.errorCode,\n rawBody,\n };\n }\n catch {\n // Fall through to raw body handling\n }\n }\n return {\n statusCode: response.status,\n rawBody,\n };\n}\nfunction resolveUploadContext(options) {\n const ciContext = (0, ci_detection_1.detectCIContext)();\n return {\n commitSha: options.commitSha ?? ciContext.commitSha,\n branch: options.branch ?? ciContext.branch,\n repositoryUrl: options.repositoryUrl ?? ciContext.repositoryUrl,\n buildName: options.buildName,\n buildNumber: options.buildNumber ?? ciContext.buildNumber,\n buildUrl: options.buildUrl ?? ciContext.buildUrl,\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n };\n}\n/**\n * Upload test run to Testream backend API\n */\nasync function uploadTestRun(options) {\n const { report, apiKey } = options;\n const apiUrl = resolveApiUrl(options.apiUrl);\n const reportId = ensureReportId(report);\n const uploadContext = resolveUploadContext(options);\n await (0, source_snippets_1.enrichReportWithSourceSnippets)(report);\n // Build type-safe IngestRequest payload\n const ingestPayload = {\n report,\n reportId,\n ...uploadContext,\n };\n // Professional logging\n console.log(\"Uploading test results...\");\n let response;\n try {\n response = await fetch(`${apiUrl}/api/v1/ingest`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(ingestPayload),\n });\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n const connectionError = `Connection failed: ${errorMessage}`;\n console.error(connectionError);\n return {\n success: false,\n reportId,\n error: connectionError,\n };\n }\n if (!response.ok) {\n const parsedError = await parseHttpError(response);\n if (response.status === 409 && isReportAlreadyExistsConflict(parsedError)) {\n console.warn(\"Report already exists (workflow may have been re-run)\");\n return {\n success: true,\n reportId,\n summary: {\n passed: report.results.summary.passed,\n failed: report.results.summary.failed,\n skipped: report.results.summary.skipped,\n total: report.results.summary.tests,\n },\n alreadyExists: true,\n statusCode: parsedError.statusCode,\n errorCode: parsedError.errorCode,\n };\n }\n const formattedError = formatUploadError(parsedError);\n console.error(formattedError);\n return {\n success: false,\n reportId,\n error: formattedError,\n statusCode: parsedError.statusCode,\n errorCode: parsedError.errorCode,\n errorDetail: parsedError.detail || parsedError.rawBody,\n };\n }\n // Success\n const result = (await response.json());\n console.log(`✓ Test results uploaded successfully`);\n console.log(` Report ID: ${result.reportId}`);\n console.log(` Test Run ID: ${result.testRunId}`);\n console.log(` Tests: ${result.summary.passed}/${result.summary.total} passed`);\n return {\n success: true,\n reportId: result.reportId,\n testRunId: result.testRunId,\n summary: {\n passed: result.summary.passed,\n failed: result.summary.failed,\n skipped: result.summary.skipped,\n total: result.summary.total,\n },\n testResults: result.testResults,\n };\n}\n/**\n * Maps CTRF tests to ingested test result IDs in a stable order.\n * This avoids incorrect artifact linking when multiple tests share the same name.\n */\nfunction mapAttachmentsToTestResults(tests, ingestedTestResults) {\n const idsByName = new Map();\n for (const result of ingestedTestResults) {\n const queue = idsByName.get(result.name) ?? [];\n queue.push(result.id);\n idsByName.set(result.name, queue);\n }\n const targets = [];\n for (const test of tests) {\n const queue = idsByName.get(test.name);\n const matchedTestResultId = queue?.shift();\n if (!test.attachments || test.attachments.length === 0) {\n continue;\n }\n if (!matchedTestResultId) {\n console.warn(`Skipping artifact upload: could not match test result for \"${test.name}\"`);\n continue;\n }\n targets.push({\n testResultId: matchedTestResultId,\n attachments: test.attachments,\n });\n }\n return targets;\n}\n/**\n * Upload test artifacts (screenshots, videos, etc.) to Testream backend API\n */\nasync function uploadArtifacts(options) {\n const { reportId, apiKey, testResults } = options;\n const apiUrl = resolveApiUrl(options.apiUrl);\n let uploadedCount = 0;\n for (const testResult of testResults) {\n for (const attachment of testResult.attachments) {\n try {\n const success = await uploadSingleArtifact({\n testResultId: testResult.testResultId,\n attachment,\n reportId,\n apiKey,\n apiUrl,\n });\n if (success)\n uploadedCount++;\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`Failed to upload artifact ${attachment.name}: ${errorMessage}`);\n }\n }\n }\n if (uploadedCount > 0) {\n console.log(`✓ Uploaded ${uploadedCount} artifact(s)`);\n }\n return uploadedCount;\n}\nasync function uploadSingleArtifact(options) {\n const { testResultId, attachment, reportId, apiKey, apiUrl } = options;\n // Dynamically import fs for Node.js environments\n const fs = await import(\"node:fs/promises\");\n const path = await import(\"node:path\");\n const filePath = path.resolve(attachment.path);\n // Check if file exists\n try {\n await fs.access(filePath);\n }\n catch {\n console.warn(`Artifact not found: ${path.basename(filePath)}`);\n return false;\n }\n // Read file\n let fileBuffer;\n let sizeBytes;\n const fileName = path.basename(filePath);\n const contentType = attachment.contentType || \"application/octet-stream\";\n try {\n fileBuffer = await fs.readFile(filePath);\n sizeBytes = fileBuffer.byteLength;\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to read file: ${errorMessage}`);\n }\n try {\n return await uploadWithPresignedUrl({\n testResultId,\n reportId,\n apiKey,\n apiUrl,\n attachmentName: attachment.name,\n fileName,\n contentType,\n sizeBytes,\n fileBuffer,\n });\n }\n catch (error) {\n if (!(error instanceof LegacyUploadRequiredError)) {\n throw error;\n }\n return await uploadWithLegacyEndpoint({\n testResultId,\n attachmentName: attachment.name,\n reportId,\n apiKey,\n apiUrl,\n fileName,\n contentType,\n fileBuffer,\n });\n }\n}\nclass LegacyUploadRequiredError extends Error {\n constructor() {\n super(\"Legacy upload endpoint required\");\n }\n}\nasync function uploadWithPresignedUrl(options) {\n const { testResultId, reportId, apiKey, apiUrl, attachmentName, fileName, contentType, sizeBytes, fileBuffer, } = options;\n const initPayload = {\n testResultId,\n ctrfAttachmentName: attachmentName,\n fileName,\n contentType,\n sizeBytes,\n };\n const initResponse = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}/upload-url`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(initPayload),\n });\n if (shouldFallbackToLegacyUpload(initResponse.status)) {\n throw new LegacyUploadRequiredError();\n }\n if (!initResponse.ok) {\n const errorText = await initResponse.text();\n throw new Error(`Failed to create direct upload URL (HTTP ${initResponse.status}): ${errorText}`);\n }\n const uploadInitResult = (await initResponse.json());\n const uploadHeaders = {\n ...(uploadInitResult.requiredHeaders),\n };\n if (!hasHeaderIgnoreCase(uploadHeaders, \"Content-Type\")) {\n uploadHeaders[\"Content-Type\"] = contentType;\n }\n const directUploadResponse = await fetch(uploadInitResult.uploadUrl, {\n method: \"PUT\",\n headers: uploadHeaders,\n body: fileBuffer,\n });\n if (!directUploadResponse.ok) {\n const errorText = await directUploadResponse.text();\n throw new Error(`Direct artifact upload failed (HTTP ${directUploadResponse.status}): ${errorText}`);\n }\n const completePayload = {\n testResultId,\n ctrfAttachmentName: attachmentName,\n fileName,\n contentType,\n sizeBytes,\n storageKey: uploadInitResult.storageKey,\n };\n const completeResponse = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}/complete`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(completePayload),\n });\n if (!completeResponse.ok) {\n const errorText = await completeResponse.text();\n throw new Error(`Failed to finalize artifact upload (HTTP ${completeResponse.status}): ${errorText}`);\n }\n return true;\n}\nasync function uploadWithLegacyEndpoint(options) {\n const { testResultId, attachmentName, reportId, apiKey, apiUrl, fileName, contentType, fileBuffer, } = options;\n const blob = new Blob([new Uint8Array(fileBuffer)], { type: contentType });\n const formData = new FormData();\n formData.append(\"testResultId\", testResultId);\n formData.append(\"ctrfAttachmentName\", attachmentName);\n formData.append(\"file\", blob, fileName);\n const response = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n },\n body: formData,\n });\n if (!response.ok) {\n const errorText = await response.text();\n throw new Error(`Legacy artifact upload failed (HTTP ${response.status}): ${errorText}`);\n }\n return true;\n}\nfunction shouldFallbackToLegacyUpload(statusCode) {\n return statusCode === 404 || statusCode === 405 || statusCode === 501;\n}\nfunction hasHeaderIgnoreCase(headers, headerName) {\n const expected = headerName.toLowerCase();\n return Object.keys(headers).some((key) => key.toLowerCase() === expected);\n}\n//# sourceMappingURL=upload.js.map","\nimport { glob } from 'glob';\nimport * as path from 'path';\nimport * as fs from 'fs/promises';\nimport * as os from 'os';\nimport { spawn } from 'child_process';\nimport { parseTrxFiles } from './trx-parser';\nimport { uploadToApi } from './uploader';\n\ninterface CliOptions {\n apiKey: string;\n // Optional: path to project/solution (defaults to current directory)\n projectPath?: string;\n // Optional: additional dotnet test arguments\n dotnetArgs?: string[];\n // Optional: explicit TRX path (skip running tests)\n trxPath?: string;\n // Git context\n branch?: string;\n commitSha?: string;\n repositoryUrl?: string;\n // Build metadata\n buildName?: string;\n buildNumber?: string;\n buildUrl?: string;\n // Environment metadata\n testEnvironment?: string;\n appName?: string;\n appVersion?: string;\n testType?: string;\n // Upload options\n uploadEnabled?: boolean;\n failOnUploadError?: boolean;\n}\n\nfunction printUsage(): void {\n console.log(String.raw`\n@testream/dotnet-reporter - Run .NET tests and upload results to Testream\n\nUsage:\n npx @testream/dotnet-reporter --api-key <key> [options]\n\nRequired arguments:\n --api-key, -k API key for authentication\n\nOptional arguments:\n --project <path> Path to .NET project/solution (defaults to current directory)\n --trx-path <path> Skip running tests, use existing TRX file(s) instead\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading results to backend\n --fail-on-error Fail the process if upload fails\n\nOther:\n --help, -h Show this help message\n -- <args> Additional arguments to pass to 'dotnet test'\n\nExamples:\n # Run tests and upload (simplest usage)\n npx @testream/dotnet-reporter -k your-api-key\n\n # Run tests for a specific project\n npx @testream/dotnet-reporter -k your-api-key --project ./MyTests\n\n # With environment metadata\n npx @testream/dotnet-reporter -k your-api-key \\\n --test-environment staging --app-name MyApp --app-version 1.0.0\n\n # Pass additional arguments to dotnet test\n npx @testream/dotnet-reporter -k your-api-key -- --filter \"Category=Unit\"\n\n # Use existing TRX file (skip running tests)\n npx @testream/dotnet-reporter -k your-api-key --trx-path TestResults/*.trx\n\nHow it works:\n 1. Runs 'dotnet test' with TRX logging enabled\n 2. Parses the TRX output and converts to CTRF format\n 3. Uploads to Testream (project key inferred from API key)\n\nNo manual steps required - just run and upload!\n`);\n}\n\nfunction parseArgs(args: string[]): CliOptions | null {\n const options: Partial<CliOptions> = {\n uploadEnabled: true, // default to enabled\n failOnUploadError: false, // default to not failing\n };\n const dotnetArgs: string[] = [];\n let collectingDotnetArgs = false;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const nextArg = args[i + 1];\n\n // After '--', collect all remaining args for dotnet test\n if (arg === '--') {\n collectingDotnetArgs = true;\n continue;\n }\n\n if (collectingDotnetArgs) {\n dotnetArgs.push(arg);\n continue;\n }\n\n switch (arg) {\n case '--help':\n case '-h':\n printUsage();\n process.exit(0);\n break;\n\n case '--api-key':\n case '-k':\n options.apiKey = nextArg;\n i++;\n break;\n\n case '--project':\n options.projectPath = nextArg;\n i++;\n break;\n\n case '--trx-path':\n options.trxPath = nextArg;\n i++;\n break;\n\n // Git context\n case '--branch':\n options.branch = nextArg;\n i++;\n break;\n\n case '--commit-sha':\n options.commitSha = nextArg;\n i++;\n break;\n\n case '--repository-url':\n options.repositoryUrl = nextArg;\n i++;\n break;\n\n // Build metadata\n case '--build-name':\n options.buildName = nextArg;\n i++;\n break;\n\n case '--build-number':\n options.buildNumber = nextArg;\n i++;\n break;\n\n case '--build-url':\n options.buildUrl = nextArg;\n i++;\n break;\n\n // Environment metadata\n case '--test-environment':\n options.testEnvironment = nextArg;\n i++;\n break;\n\n case '--app-name':\n options.appName = nextArg;\n i++;\n break;\n\n case '--app-version':\n options.appVersion = nextArg;\n i++;\n break;\n\n case '--test-type':\n options.testType = nextArg;\n i++;\n break;\n\n // Upload options\n case '--no-upload':\n options.uploadEnabled = false;\n break;\n\n case '--fail-on-error':\n options.failOnUploadError = true;\n break;\n }\n }\n\n if (dotnetArgs.length > 0) {\n options.dotnetArgs = dotnetArgs;\n }\n\n // Validate required options\n if (!options.apiKey && options.uploadEnabled) {\n console.error('Error: Missing required argument: --api-key');\n console.error('Run with --help for usage information.');\n return null;\n }\n\n return options as CliOptions;\n}\n\nasync function findTrxFiles(pattern: string): Promise<string[]> {\n // Check if it's a direct file path\n if (!pattern.includes('*') && !pattern.includes('?')) {\n return [path.resolve(pattern)];\n }\n\n // Use glob to find matching files\n const files = await glob(pattern, {\n absolute: true,\n nodir: true,\n });\n\n return files;\n}\n\n/**\n * Run dotnet test and return the path to generated TRX file\n */\nasync function runDotnetTest(\n projectPath: string | undefined,\n additionalArgs: string[] = []\n): Promise<string> {\n const logger = console;\n\n // Create temp directory for TRX output\n const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'dotnet-reporter-'));\n\n // Build dotnet test command\n const args = ['test'];\n\n if (projectPath) {\n args.push(projectPath);\n }\n\n // Add TRX logger without a fixed filename so each test project gets a unique\n // TRX file. Specifying LogFileName causes all projects in a solution to write\n // to the same file, with later projects overwriting earlier ones.\n args.push('--logger', 'trx', '--results-directory', tempDir);\n\n // Add any additional user-provided args\n args.push(...additionalArgs);\n\n logger.info('Running dotnet test...');\n logger.info(` Command: dotnet ${args.join(' ')}`);\n logger.info('');\n\n return new Promise((resolve, reject) => {\n const child = spawn('dotnet', args, {\n stdio: ['inherit', 'inherit', 'inherit'],\n shell: process.platform === 'win32',\n });\n\n child.on('error', (error) => {\n reject(new Error(`Failed to run dotnet test: ${error.message}`));\n });\n\n child.on('close', async (_code) => {\n // Find TRX file(s) in the temp directory\n try {\n const files = await fs.readdir(tempDir);\n const trxFiles = files.filter((f) => f.endsWith('.trx'));\n\n if (trxFiles.length === 0) {\n reject(new Error('No TRX file generated. Make sure dotnet test ran successfully.'));\n return;\n }\n\n // Return the first TRX file (or pattern if multiple)\n if (trxFiles.length === 1) {\n resolve(path.join(tempDir, trxFiles[0]));\n } else {\n resolve(path.join(tempDir, '*.trx'));\n }\n } catch (error) {\n reject(new Error(`Failed to find TRX files: ${error}`));\n }\n });\n });\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (args.length === 0) {\n printUsage();\n process.exit(1);\n }\n\n const options = parseArgs(args);\n if (!options) {\n process.exit(1);\n }\n\n const logger = console;\n\n try {\n let trxPath: string;\n\n // Either use provided TRX path or run dotnet test\n if (options.trxPath) {\n logger.info('Using existing TRX file(s)...');\n trxPath = options.trxPath;\n } else {\n // Run dotnet test\n trxPath = await runDotnetTest(options.projectPath, options.dotnetArgs);\n logger.info('');\n }\n\n // Find TRX files\n logger.info(`Finding TRX files: ${trxPath}`);\n const trxFiles = await findTrxFiles(trxPath);\n\n if (trxFiles.length === 0) {\n throw new Error(`No TRX files found matching: ${trxPath}`);\n }\n\n logger.info(` Found ${trxFiles.length} file(s):`);\n for (const file of trxFiles) {\n logger.info(` - ${path.basename(file)}`);\n }\n logger.info('');\n\n // Parse TRX files to CTRF\n logger.info('Converting TRX to CTRF format...');\n const report = await parseTrxFiles(trxFiles);\n logger.info('');\n\n // Skip upload if disabled\n if (!options.uploadEnabled) {\n logger.info('Upload disabled, skipping API upload');\n logger.info('');\n logger.info('='.repeat(60));\n logger.info('Test run completed (upload skipped)');\n logger.info(` Tests: ${report.results.summary.tests}`);\n logger.info(` Passed: ${report.results.summary.passed}`);\n logger.info(` Failed: ${report.results.summary.failed}`);\n logger.info(` Skipped: ${report.results.summary.skipped}`);\n logger.info('='.repeat(60));\n return;\n }\n\n // Upload to API\n const result = await uploadToApi({\n report,\n apiKey: options.apiKey,\n // Git context\n branch: options.branch,\n commitSha: options.commitSha,\n repositoryUrl: options.repositoryUrl,\n // Build metadata\n buildName: options.buildName,\n buildNumber: options.buildNumber,\n buildUrl: options.buildUrl,\n // Environment metadata\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n });\n\n if (!result.success) {\n if (options.failOnUploadError) {\n process.exit(1);\n } else {\n logger.warn('Upload failed but continuing (use --fail-on-error to fail on upload errors)');\n }\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error(`Error: ${errorMessage}`);\n process.exit(1);\n }\n}\n\nmain();\n","import { readdir, readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nconst DEFAULT_MAX_CHARS = 2000;\nconst DEFAULT_MAX_LINES = 40;\n\nexport interface DotnetSourceSnippet {\n filePath: string;\n line: number;\n snippet: string;\n}\n\ninterface DotnetSourceSnippetCache {\n candidateSourceFiles: Map<string, Promise<string[]>>;\n fileContentByPath: Map<string, Promise<string | undefined>>;\n}\n\nexport interface DotnetSourceSnippetResolver {\n resolve(options: {\n filePath: string | undefined;\n className?: string;\n methodName: string | undefined;\n lineNumber?: number;\n }): Promise<DotnetSourceSnippet | undefined>;\n}\n\nexport function createDotnetSourceSnippetResolver(): DotnetSourceSnippetResolver {\n const cache: DotnetSourceSnippetCache = {\n candidateSourceFiles: new Map(),\n fileContentByPath: new Map(),\n };\n\n return {\n resolve: (options) => resolveDotnetSourceSnippet(options, cache),\n };\n}\n\nexport async function extractDotnetSourceSnippet(\n filePath: string | undefined,\n methodName: string | undefined,\n lineNumber?: number\n): Promise<string | undefined> {\n const result = await resolveDotnetSourceSnippet({ filePath, methodName, lineNumber });\n return result?.snippet;\n}\n\nexport async function resolveDotnetSourceSnippet(\n options: {\n filePath: string | undefined;\n className?: string;\n methodName: string | undefined;\n lineNumber?: number;\n },\n cache?: DotnetSourceSnippetCache\n): Promise<DotnetSourceSnippet | undefined> {\n if (!options.filePath || !options.methodName) {\n return undefined;\n }\n\n const direct = await tryExtractFromSourceFile(\n options.filePath,\n options.methodName,\n options.lineNumber,\n cache\n );\n if (direct) {\n return direct;\n }\n\n const candidates = await getCandidateSourceFiles(options.filePath, options.className, cache);\n for (const candidate of candidates) {\n const resolved = await tryExtractFromSourceFile(\n candidate,\n options.methodName,\n options.lineNumber,\n cache\n );\n if (resolved) {\n return resolved;\n }\n }\n\n return undefined;\n}\n\nasync function tryExtractFromSourceFile(\n filePath: string,\n methodName: string,\n lineNumber?: number,\n cache?: DotnetSourceSnippetCache\n): Promise<DotnetSourceSnippet | undefined> {\n if (path.extname(filePath).toLowerCase() !== '.cs') {\n return undefined;\n }\n\n const resolvedPath = path.resolve(filePath);\n const content = await getFileContent(resolvedPath, cache);\n if (!content) {\n return undefined;\n }\n\n for (const candidateMethodName of getMethodNameCandidates(methodName)) {\n const extracted = extractCSharpMethodBlock(content, candidateMethodName, lineNumber);\n if (extracted) {\n return { filePath: resolvedPath, ...extracted };\n }\n }\n\n return undefined;\n}\n\nfunction getFileContent(\n filePath: string,\n cache?: DotnetSourceSnippetCache\n): Promise<string | undefined> {\n if (!cache) {\n return readFile(filePath, 'utf-8').catch(() => undefined);\n }\n\n let cached = cache.fileContentByPath.get(filePath);\n if (!cached) {\n cached = readFile(filePath, 'utf-8').catch(() => undefined);\n cache.fileContentByPath.set(filePath, cached);\n }\n\n return cached;\n}\n\nfunction extractCSharpMethodBlock(\n content: string,\n methodName: string,\n lineNumber?: number\n): { line: number; snippet: string } | undefined {\n const lines = content.split(/\\r?\\n/);\n const definitionIndex =\n findMethodDefinitionNearLine(lines, methodName, lineNumber) ??\n findMethodDefinition(lines, methodName);\n\n if (definitionIndex == null) {\n return undefined;\n }\n\n const start = includeCSharpAttributes(lines, definitionIndex);\n const selected: string[] = [];\n let braceBalance = 0;\n let sawOpeningBrace = false;\n let isExpressionBodied = false;\n\n for (let i = start; i < lines.length && selected.length < DEFAULT_MAX_LINES; i++) {\n const line = lines[i];\n selected.push(line);\n\n if (!sawOpeningBrace && line.includes('=>')) {\n isExpressionBodied = true;\n }\n\n for (const char of line) {\n if (char === '{') {\n braceBalance++;\n sawOpeningBrace = true;\n } else if (char === '}') {\n braceBalance--;\n }\n }\n\n if (isExpressionBodied && line.includes(';')) {\n break;\n }\n\n if (sawOpeningBrace && braceBalance <= 0) {\n break;\n }\n }\n\n const snippet = selected.join('\\n').trim();\n if (!snippet) {\n return undefined;\n }\n\n return {\n line: start + 1,\n snippet: snippet.length <= DEFAULT_MAX_CHARS ? snippet : snippet.slice(0, DEFAULT_MAX_CHARS),\n };\n}\n\nfunction findMethodDefinitionNearLine(\n lines: string[],\n methodName: string,\n lineNumber?: number\n): number | undefined {\n if (!lineNumber) {\n return undefined;\n }\n\n const startIndex = Math.max(0, Math.min(lines.length - 1, lineNumber - 1));\n for (let i = startIndex; i >= 0; i--) {\n if (containsMethodSignatureName(lines[i], methodName)) {\n return i;\n }\n }\n\n return undefined;\n}\n\nfunction findMethodDefinition(lines: string[], methodName: string): number | undefined {\n for (let i = 0; i < lines.length; i++) {\n if (containsMethodSignatureName(lines[i], methodName)) {\n return i;\n }\n }\n\n return undefined;\n}\n\nfunction containsMethodSignatureName(line: string, methodName: string): boolean {\n const nameIndex = line.indexOf(methodName);\n if (nameIndex < 0) {\n return false;\n }\n\n const before = nameIndex === 0 ? '' : line[nameIndex - 1];\n if (before && isIdentifierChar(before)) {\n return false;\n }\n\n let i = nameIndex + methodName.length;\n while (i < line.length && /\\s/.test(line[i])) {\n i++;\n }\n\n return line[i] === '(';\n}\n\nfunction includeCSharpAttributes(lines: string[], definitionIndex: number): number {\n let start = definitionIndex;\n while (start > 0) {\n const previous = lines[start - 1].trim();\n if (!previous.startsWith('[') || !previous.endsWith(']')) {\n break;\n }\n start--;\n }\n\n return start;\n}\n\nfunction getMethodNameCandidates(methodName: string): string[] {\n const trimmed = methodName.trim();\n const candidates = [trimmed];\n const invocationIndex = trimmed.indexOf('(');\n\n // NUnit can put TestCase argument values in TestMethod/@name, e.g.\n // Password_MinimumLength_Validation(\"pass\",False). Source matching needs\n // the underlying C# method identifier.\n if (invocationIndex > 0) {\n const sourceMethodName = trimmed.slice(0, invocationIndex).trim();\n if (sourceMethodName && sourceMethodName !== trimmed) {\n candidates.push(sourceMethodName);\n }\n }\n\n return candidates;\n}\n\nasync function findCandidateSourceFiles(\n storagePath: string,\n className: string | undefined\n): Promise<string[]> {\n const sourceRoot = getProjectSourceRootFromStorage(storagePath);\n if (!sourceRoot) {\n return [];\n }\n\n const resolvedSourceRoot = await resolveExistingDirectoryCaseInsensitive(sourceRoot);\n if (!resolvedSourceRoot) {\n return [];\n }\n\n const files = await listCSharpFiles(resolvedSourceRoot);\n const classFileName = getClassFileName(className);\n if (!classFileName) {\n return files;\n }\n\n // TRX commonly stores passed tests against the compiled DLL. Prefer the class\n // filename when available, then fall back to every source file for cases where\n // a project keeps multiple test classes in one file.\n return [\n ...files.filter((file) => path.basename(file).toLowerCase() === classFileName),\n ...files.filter((file) => path.basename(file).toLowerCase() !== classFileName),\n ];\n}\n\nfunction getCandidateSourceFiles(\n storagePath: string,\n className: string | undefined,\n cache?: DotnetSourceSnippetCache\n): Promise<string[]> {\n if (!cache) {\n return findCandidateSourceFiles(storagePath, className);\n }\n\n const key = `${path.resolve(storagePath)}\\0${className ?? ''}`;\n let cached = cache.candidateSourceFiles.get(key);\n if (!cached) {\n cached = findCandidateSourceFiles(storagePath, className);\n cache.candidateSourceFiles.set(key, cached);\n }\n\n return cached;\n}\n\nfunction getProjectSourceRootFromStorage(storagePath: string): string | undefined {\n const resolved = path.resolve(storagePath);\n const parts = resolved.split(path.sep);\n // /Project/bin/Debug/net8.0/Project.dll is the normal TRX storage path for\n // passed tests, so the source root is the directory before bin/.\n const binIndex = parts.findIndex((part) => part.toLowerCase() === 'bin');\n if (binIndex <= 0) {\n return undefined;\n }\n\n return parts.slice(0, binIndex).join(path.sep) || path.sep;\n}\n\nasync function resolveExistingDirectoryCaseInsensitive(\n dirPath: string\n): Promise<string | undefined> {\n try {\n await readdir(dirPath, { withFileTypes: true });\n return dirPath;\n } catch {\n // TRX storage paths can lowercase project output paths on Linux\n // (`mstesttests/bin/...`) while the checked-out source directory is\n // case-sensitive (`MSTestTests`). Walk each segment case-insensitively so\n // passed tests can still resolve their project source root.\n }\n\n const resolved = path.resolve(dirPath);\n const parsed = path.parse(resolved);\n const relativeParts = path.relative(parsed.root, resolved).split(path.sep).filter(Boolean);\n let current = parsed.root;\n\n for (const part of relativeParts) {\n let entries;\n try {\n entries = await readdir(current, { withFileTypes: true });\n } catch {\n return undefined;\n }\n\n const match =\n entries.find((entry) => entry.name === part) ??\n entries.find((entry) => entry.name.toLowerCase() === part.toLowerCase());\n\n if (!match) {\n return undefined;\n }\n\n current = path.join(current, match.name);\n }\n\n try {\n await readdir(current, { withFileTypes: true });\n return current;\n } catch {\n return undefined;\n }\n}\n\nasync function listCSharpFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n\n async function visit(dir: string): Promise<void> {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const entryPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n const lowerName = entry.name.toLowerCase();\n if (lowerName === 'bin' || lowerName === 'obj') {\n continue;\n }\n\n await visit(entryPath);\n continue;\n }\n\n if (entry.isFile() && path.extname(entry.name).toLowerCase() === '.cs') {\n files.push(entryPath);\n }\n }\n }\n\n await visit(root);\n return files;\n}\n\nfunction getClassFileName(className: string | undefined): string | undefined {\n const shortName = className?.split(/[.+]/).filter(Boolean).pop();\n return shortName ? `${shortName.toLowerCase()}.cs` : undefined;\n}\n\nfunction isIdentifierChar(char: string): boolean {\n // Prevent matching a method name inside another common C# identifier.\n return /[A-Za-z0-9_]/.test(char);\n}\n","import * as fs from 'node:fs/promises';\nimport { XMLParser } from 'fast-xml-parser';\nimport { randomUUID } from 'node:crypto';\nimport { CTRFReport, CTRFTest, CTRFSummary } from '@jira-test-manager/shared-types';\nimport { createDotnetSourceSnippetResolver } from './source-snippets';\nimport { TrxTestRun, TrxUnitTest } from './types';\n\nconst TOOL_NAME = 'dotnet';\n\n// Use crypto.randomUUID() for secure UUID generation (available in Node.js 15.7.0+)\nfunction generateUUID(): string {\n return randomUUID();\n}\n\n/**\n * Parse TRX duration string (HH:MM:SS.mmmmmmm) to milliseconds\n */\nfunction parseDuration(duration: string): number {\n if (!duration) return 0;\n\n // Use split() instead of regex to avoid ReDoS vulnerability\n const parts = duration.split(':');\n if (parts.length !== 3) return 0;\n\n const hours = parseInt(parts[0], 10);\n if (Number.isNaN(hours)) return 0;\n\n const minutes = parseInt(parts[1], 10);\n if (Number.isNaN(minutes)) return 0;\n\n // Handle seconds and fractional part (may contain decimal point)\n const secondsParts = parts[2].split('.');\n const seconds = Number.parseInt(secondsParts[0], 10);\n if (Number.isNaN(seconds)) return 0;\n\n const fraction = secondsParts[1] ? parseFloat(`0.${secondsParts[1]}`) * 1000 : 0;\n\n return hours * 3600000 + minutes * 60000 + seconds * 1000 + Math.round(fraction);\n}\n\n/**\n * Parse ISO date string to epoch milliseconds\n */\nfunction parseTimestamp(dateStr: string): number {\n if (!dateStr) return Date.now();\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? Date.now() : date.getTime();\n}\n\n/**\n * Map TRX outcome to CTRF status\n */\nfunction mapOutcome(outcome: string): CTRFTest['status'] {\n switch (outcome.toLowerCase()) {\n case 'passed':\n return 'passed';\n case 'failed':\n return 'failed';\n case 'notexecuted':\n case 'skipped':\n return 'skipped';\n case 'inconclusive':\n case 'pending':\n return 'pending';\n default:\n return 'other';\n }\n}\n\n/**\n * Extract line number from stack trace\n */\nfunction extractLineNumber(stackTrace?: string): number | undefined {\n if (!stackTrace) return undefined;\n\n // Match patterns like \":line 79\" or \".cs:79\"\n const match = new RegExp(/:line (\\d+)|\\.cs:(\\d+)/i).exec(stackTrace);\n if (match) {\n return Number.parseInt(match[1] || match[2], 10);\n }\n return undefined;\n}\n\n/**\n * Extract file path from stack trace\n */\nfunction extractFilePath(stackTrace?: string): string | undefined {\n if (!stackTrace) return undefined;\n\n // Match file paths ending in .cs with bounded length to prevent ReDoS\n const match = new RegExp(/([A-Za-z]:\\\\[^\\s:]{1,256}\\.cs|\\/[^\\s:]{1,256}\\.cs)/).exec(stackTrace);\n return match ? match[1] : undefined;\n}\n\n/**\n * Parse a TRX file and convert to CTRF format\n */\nexport async function parseTrxFile(trxPath: string): Promise<CTRFReport> {\n // Read TRX file\n const content = await fs.readFile(trxPath, 'utf-8');\n\n // Parse XML\n const parser = new XMLParser({\n ignoreAttributes: false,\n attributeNamePrefix: '@_',\n isArray: (name: string) => {\n // Ensure these are always arrays\n return name === 'UnitTestResult' || name === 'UnitTest';\n },\n });\n\n const parsed = parser.parse(content);\n const testRun: TrxTestRun = parsed.TestRun;\n\n if (!testRun) {\n throw new Error('Invalid TRX file: missing TestRun element');\n }\n\n // Build test definition lookup\n const testDefinitions = new Map<string, TrxUnitTest>();\n const unitTests = testRun.TestDefinitions?.UnitTest || [];\n for (const test of unitTests) {\n testDefinitions.set(test['@_id'], test);\n }\n\n // Force tool name to 'dotnet' (ignoring testTool parameter)\n const toolName = TOOL_NAME;\n\n // Parse test results\n const results = testRun.Results?.UnitTestResult || [];\n const tests: CTRFTest[] = [];\n const sourceSnippetResolver = createDotnetSourceSnippetResolver();\n\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n let pending = 0;\n let other = 0;\n const suites = new Set<string>();\n\n for (const result of results) {\n const testDef = testDefinitions.get(result['@_testId']);\n const className = testDef?.TestMethod?.['@_className'] || '';\n const suiteName = className.split('.').pop() || '';\n\n if (suiteName) suites.add(suiteName);\n\n const status = mapOutcome(result['@_outcome']);\n const duration = parseDuration(result['@_duration']);\n const start = parseTimestamp(result['@_startTime']);\n const stop = parseTimestamp(result['@_endTime']);\n\n // Count by status\n switch (status) {\n case 'passed':\n passed++;\n break;\n case 'failed':\n failed++;\n break;\n case 'skipped':\n skipped++;\n break;\n case 'pending':\n pending++;\n break;\n default:\n other++;\n }\n\n const errorMessage = result.Output?.ErrorInfo?.Message;\n const stackTrace = result.Output?.ErrorInfo?.StackTrace;\n const stdout = result.Output?.StdOut;\n const stderr = result.Output?.StdErr;\n\n const stackTraceFilePath = extractFilePath(stackTrace);\n const storagePath = testDef?.['@_storage'];\n const line = extractLineNumber(stackTrace);\n const sourceSnippet = await sourceSnippetResolver.resolve({\n filePath: stackTraceFilePath || storagePath,\n className,\n methodName: testDef?.TestMethod?.['@_name'],\n lineNumber: line,\n });\n\n const test: CTRFTest = {\n name: result['@_testName'],\n status,\n duration,\n start,\n stop,\n rawStatus: result['@_outcome'],\n tags: [],\n retries: 0,\n flaky: false,\n steps: [],\n suite: suiteName || undefined,\n stdout: stdout ? [stdout] : [],\n stderr: stderr ? [stderr] : [],\n message: errorMessage,\n trace: stackTrace,\n line: line ?? sourceSnippet?.line,\n filePath: sourceSnippet?.filePath ?? stackTraceFilePath ?? storagePath,\n snippet: sourceSnippet?.snippet,\n };\n\n tests.push(test);\n }\n\n // Parse run times\n const startTime = parseTimestamp(testRun.Times?.['@_start']);\n const stopTime = parseTimestamp(testRun.Times?.['@_finish']);\n\n const summary: CTRFSummary = {\n tests: tests.length,\n passed,\n failed,\n pending,\n skipped,\n other,\n start: startTime,\n stop: stopTime,\n suites: suites.size,\n };\n\n const report: CTRFReport = {\n reportFormat: 'CTRF',\n specVersion: '0.0.0',\n reportId: generateUUID(),\n timestamp: new Date().toISOString(),\n generatedBy: '@testream/dotnet-reporter',\n results: {\n tool: {\n name: toolName,\n },\n summary,\n tests,\n },\n };\n\n return report;\n}\n\n/**\n * Parse multiple TRX files and merge into a single CTRF report\n */\nexport async function parseTrxFiles(trxPaths: string[]): Promise<CTRFReport> {\n if (trxPaths.length === 0) {\n throw new Error('No TRX files provided');\n }\n\n if (trxPaths.length === 1) {\n return parseTrxFile(trxPaths[0]);\n }\n\n // Parse all files\n const reports = await Promise.all(trxPaths.map((path) => parseTrxFile(path)));\n\n // Merge reports\n const allTests: CTRFTest[] = [];\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n let pending = 0;\n let other = 0;\n const suites = new Set<string>();\n let minStart = Infinity;\n let maxStop = 0;\n\n for (const report of reports) {\n allTests.push(...report.results.tests);\n passed += report.results.summary.passed;\n failed += report.results.summary.failed;\n skipped += report.results.summary.skipped;\n pending += report.results.summary.pending;\n other += report.results.summary.other;\n\n for (const test of report.results.tests) {\n if (test.suite) suites.add(test.suite);\n }\n\n if (report.results.summary.start < minStart) {\n minStart = report.results.summary.start;\n }\n if (report.results.summary.stop > maxStop) {\n maxStop = report.results.summary.stop;\n }\n }\n\n const mergedReport: CTRFReport = {\n reportFormat: 'CTRF',\n specVersion: '0.0.0',\n reportId: generateUUID(),\n timestamp: new Date().toISOString(),\n generatedBy: '@testream/dotnet-reporter',\n results: {\n tool: {\n name: TOOL_NAME,\n },\n summary: {\n tests: allTests.length,\n passed,\n failed,\n pending,\n skipped,\n other,\n start: minStart === Infinity ? Date.now() : minStart,\n stop: maxStop,\n suites: suites.size,\n },\n tests: allTests,\n },\n };\n\n return mergedReport;\n}\n","import {\n UploadResult,\n detectCIContext,\n uploadTestRun,\n UploadTestRunOptions,\n} from '@jira-test-manager/shared-types';\n\n/**\n * Upload CTRF report to Testream API\n */\nexport async function uploadToApi(options: UploadTestRunOptions): Promise<UploadResult> {\n return uploadTestRun({\n report: options.report,\n apiKey: options.apiKey,\n apiUrl: options.apiUrl,\n commitSha: options.commitSha,\n branch: options.branch,\n repositoryUrl: options.repositoryUrl,\n buildName: options.buildName,\n buildNumber: options.buildNumber,\n buildUrl: options.buildUrl,\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n });\n}\n\n// Keep old function name for backwards compatibility\nexport const detectGitContext = detectCIContext;\n","module.exports = require(\"child_process\");","module.exports = require(\"fs\");","module.exports = require(\"fs/promises\");","module.exports = require(\"node:crypto\");","module.exports = require(\"node:diagnostics_channel\");","module.exports = require(\"node:events\");","module.exports = require(\"node:fs\");","module.exports = require(\"node:fs/promises\");","module.exports = require(\"node:path\");","module.exports = require(\"node:stream\");","module.exports = require(\"node:string_decoder\");","module.exports = require(\"node:url\");","module.exports = require(\"os\");","module.exports = require(\"path\");","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Glob = void 0;\nconst minimatch_1 = require(\"minimatch\");\nconst node_url_1 = require(\"node:url\");\nconst path_scurry_1 = require(\"path-scurry\");\nconst pattern_js_1 = require(\"./pattern.js\");\nconst walker_js_1 = require(\"./walker.js\");\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform = (typeof process === 'object' &&\n process &&\n typeof process.platform === 'string') ?\n process.platform\n : 'linux';\n/**\n * An object that can perform glob pattern traversals.\n */\nclass Glob {\n absolute;\n cwd;\n root;\n dot;\n dotRelative;\n follow;\n ignore;\n magicalBraces;\n mark;\n matchBase;\n maxDepth;\n nobrace;\n nocase;\n nodir;\n noext;\n noglobstar;\n pattern;\n platform;\n realpath;\n scurry;\n stat;\n signal;\n windowsPathsNoEscape;\n withFileTypes;\n includeChildMatches;\n /**\n * The options provided to the constructor.\n */\n opts;\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns;\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern, opts) {\n /* c8 ignore start */\n if (!opts)\n throw new TypeError('glob options required');\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes;\n this.signal = opts.signal;\n this.follow = !!opts.follow;\n this.dot = !!opts.dot;\n this.dotRelative = !!opts.dotRelative;\n this.nodir = !!opts.nodir;\n this.mark = !!opts.mark;\n if (!opts.cwd) {\n this.cwd = '';\n }\n else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);\n }\n this.cwd = opts.cwd || '';\n this.root = opts.root;\n this.magicalBraces = !!opts.magicalBraces;\n this.nobrace = !!opts.nobrace;\n this.noext = !!opts.noext;\n this.realpath = !!opts.realpath;\n this.absolute = opts.absolute;\n this.includeChildMatches = opts.includeChildMatches !== false;\n this.noglobstar = !!opts.noglobstar;\n this.matchBase = !!opts.matchBase;\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;\n this.stat = !!opts.stat;\n this.ignore = opts.ignore;\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true');\n }\n if (typeof pattern === 'string') {\n pattern = [pattern];\n }\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n opts.allowWindowsEscape ===\n false;\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'));\n }\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar');\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));\n }\n this.pattern = pattern;\n this.platform = opts.platform || defaultPlatform;\n this.opts = { ...opts, platform: this.platform };\n if (opts.scurry) {\n this.scurry = opts.scurry;\n if (opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase) {\n throw new Error('nocase option contradicts provided scurry option');\n }\n }\n else {\n const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32\n : opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin\n : opts.platform ? path_scurry_1.PathScurryPosix\n : path_scurry_1.PathScurry;\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n });\n }\n this.nocase = this.scurry.nocase;\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';\n const mmo = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n };\n const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));\n const [matchSet, globParts] = mms.reduce((set, m) => {\n set[0].push(...m.set);\n set[1].push(...m.globParts);\n return set;\n }, [[], []]);\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i];\n /* c8 ignore start */\n if (!g)\n throw new Error('invalid pattern object');\n /* c8 ignore stop */\n return new pattern_js_1.Pattern(set, g, 0, this.platform);\n });\n }\n async walk() {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth: this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ];\n }\n walkSync() {\n return [\n ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth: this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ];\n }\n stream() {\n return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth: this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream();\n }\n streamSync() {\n return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth: this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync();\n }\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync() {\n return this.streamSync()[Symbol.iterator]();\n }\n [Symbol.iterator]() {\n return this.iterateSync();\n }\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate() {\n return this.stream()[Symbol.asyncIterator]();\n }\n [Symbol.asyncIterator]() {\n return this.iterate();\n }\n}\nexports.Glob = Glob;\n//# sourceMappingURL=glob.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasMagic = void 0;\nconst minimatch_1 = require(\"minimatch\");\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nconst hasMagic = (pattern, options = {}) => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern];\n }\n for (const p of pattern) {\n if (new minimatch_1.Minimatch(p, options).hasMagic())\n return true;\n }\n return false;\n};\nexports.hasMagic = hasMagic;\n//# sourceMappingURL=has-magic.js.map","\"use strict\";\n// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ignore = void 0;\nconst minimatch_1 = require(\"minimatch\");\nconst pattern_js_1 = require(\"./pattern.js\");\nconst defaultPlatform = (typeof process === 'object' &&\n process &&\n typeof process.platform === 'string') ?\n process.platform\n : 'linux';\n/**\n * Class used to process ignored patterns\n */\nclass Ignore {\n relative;\n relativeChildren;\n absolute;\n absoluteChildren;\n platform;\n mmopts;\n constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {\n this.relative = [];\n this.absolute = [];\n this.relativeChildren = [];\n this.absoluteChildren = [];\n this.platform = platform;\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n };\n for (const ign of ignored)\n this.add(ign);\n }\n add(ign) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new minimatch_1.Minimatch(ign, this.mmopts);\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i];\n const globParts = mm.globParts[i];\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object');\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift();\n globParts.shift();\n }\n /* c8 ignore stop */\n const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);\n const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);\n const children = globParts[globParts.length - 1] === '**';\n const absolute = p.isAbsolute();\n if (absolute)\n this.absolute.push(m);\n else\n this.relative.push(m);\n if (children) {\n if (absolute)\n this.absoluteChildren.push(m);\n else\n this.relativeChildren.push(m);\n }\n }\n }\n ignored(p) {\n const fullpath = p.fullpath();\n const fullpaths = `${fullpath}/`;\n const relative = p.relative() || '.';\n const relatives = `${relative}/`;\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives))\n return true;\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths))\n return true;\n }\n return false;\n }\n childrenIgnored(p) {\n const fullpath = p.fullpath() + '/';\n const relative = (p.relative() || '.') + '/';\n for (const m of this.relativeChildren) {\n if (m.match(relative))\n return true;\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath))\n return true;\n }\n return false;\n }\n}\nexports.Ignore = Ignore;\n//# sourceMappingURL=ignore.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;\nexports.globStreamSync = globStreamSync;\nexports.globStream = globStream;\nexports.globSync = globSync;\nexports.globIterateSync = globIterateSync;\nexports.globIterate = globIterate;\nconst minimatch_1 = require(\"minimatch\");\nconst glob_js_1 = require(\"./glob.js\");\nconst has_magic_js_1 = require(\"./has-magic.js\");\nvar minimatch_2 = require(\"minimatch\");\nObject.defineProperty(exports, \"escape\", { enumerable: true, get: function () { return minimatch_2.escape; } });\nObject.defineProperty(exports, \"unescape\", { enumerable: true, get: function () { return minimatch_2.unescape; } });\nvar glob_js_2 = require(\"./glob.js\");\nObject.defineProperty(exports, \"Glob\", { enumerable: true, get: function () { return glob_js_2.Glob; } });\nvar has_magic_js_2 = require(\"./has-magic.js\");\nObject.defineProperty(exports, \"hasMagic\", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });\nvar ignore_js_1 = require(\"./ignore.js\");\nObject.defineProperty(exports, \"Ignore\", { enumerable: true, get: function () { return ignore_js_1.Ignore; } });\nfunction globStreamSync(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).streamSync();\n}\nfunction globStream(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).stream();\n}\nfunction globSync(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).walkSync();\n}\nasync function glob_(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).walk();\n}\nfunction globIterateSync(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).iterateSync();\n}\nfunction globIterate(pattern, options = {}) {\n return new glob_js_1.Glob(pattern, options).iterate();\n}\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexports.streamSync = globStreamSync;\nexports.stream = Object.assign(globStream, { sync: globStreamSync });\nexports.iterateSync = globIterateSync;\nexports.iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n});\nexports.sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n});\nexports.glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync: exports.sync,\n globStream,\n stream: exports.stream,\n globStreamSync,\n streamSync: exports.streamSync,\n globIterate,\n iterate: exports.iterate,\n globIterateSync,\n iterateSync: exports.iterateSync,\n Glob: glob_js_1.Glob,\n hasMagic: has_magic_js_1.hasMagic,\n escape: minimatch_1.escape,\n unescape: minimatch_1.unescape,\n});\nexports.glob.glob = exports.glob;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// this is just a very light wrapper around 2 arrays with an offset index\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pattern = void 0;\nconst minimatch_1 = require(\"minimatch\");\nconst isPatternList = (pl) => pl.length >= 1;\nconst isGlobList = (gl) => gl.length >= 1;\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nclass Pattern {\n #patternList;\n #globList;\n #index;\n length;\n #platform;\n #rest;\n #globString;\n #isDrive;\n #isUNC;\n #isAbsolute;\n #followGlobstar = true;\n constructor(patternList, globList, index, platform) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list');\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list');\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths');\n }\n this.length = patternList.length;\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range');\n }\n this.#patternList = patternList;\n this.#globList = globList;\n this.#index = index;\n this.#platform = platform;\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList;\n const [g0, g1, g2, g3, ...grest] = this.#globList;\n if (prest[0] === '') {\n // ends in /\n prest.shift();\n grest.shift();\n }\n const p = [p0, p1, p2, p3, ''].join('/');\n const g = [g0, g1, g2, g3, ''].join('/');\n this.#patternList = [p, ...prest];\n this.#globList = [g, ...grest];\n this.length = this.#patternList.length;\n }\n else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList;\n const [g1, ...grest] = this.#globList;\n if (prest[0] === '') {\n // ends in /\n prest.shift();\n grest.shift();\n }\n const p = p1 + '/';\n const g = g1 + '/';\n this.#patternList = [p, ...prest];\n this.#globList = [g, ...grest];\n this.length = this.#patternList.length;\n }\n }\n }\n /**\n * The first entry in the parsed list of patterns\n */\n pattern() {\n return this.#patternList[this.#index];\n }\n /**\n * true of if pattern() returns a string\n */\n isString() {\n return typeof this.#patternList[this.#index] === 'string';\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar() {\n return this.#patternList[this.#index] === minimatch_1.GLOBSTAR;\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp() {\n return this.#patternList[this.#index] instanceof RegExp;\n }\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString() {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')));\n }\n /**\n * true if there are more pattern parts after this one\n */\n hasMore() {\n return this.length > this.#index + 1;\n }\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest() {\n if (this.#rest !== undefined)\n return this.#rest;\n if (!this.hasMore())\n return (this.#rest = null);\n this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);\n this.#rest.#isAbsolute = this.#isAbsolute;\n this.#rest.#isUNC = this.#isUNC;\n this.#rest.#isDrive = this.#isDrive;\n return this.#rest;\n }\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC() {\n const pl = this.#patternList;\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3]);\n }\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive() {\n const pl = this.#patternList;\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]));\n }\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute() {\n const pl = this.#patternList;\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC());\n }\n /**\n * consume the root of the pattern, and return it\n */\n root() {\n const p = this.#patternList[0];\n return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?\n p\n : '';\n }\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar() {\n return !(this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar);\n }\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar() {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false;\n this.#followGlobstar = false;\n return true;\n }\n}\nexports.Pattern = Pattern;\n//# sourceMappingURL=pattern.js.map","\"use strict\";\n// synchronous utility for filtering entries and calculating subwalks\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;\nconst minimatch_1 = require(\"minimatch\");\n/**\n * A cache of which patterns have been processed for a given Path\n */\nclass HasWalkedCache {\n store;\n constructor(store = new Map()) {\n this.store = store;\n }\n copy() {\n return new HasWalkedCache(new Map(this.store));\n }\n hasWalked(target, pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString());\n }\n storeWalked(target, pattern) {\n const fullpath = target.fullpath();\n const cached = this.store.get(fullpath);\n if (cached)\n cached.add(pattern.globString());\n else\n this.store.set(fullpath, new Set([pattern.globString()]));\n }\n}\nexports.HasWalkedCache = HasWalkedCache;\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nclass MatchRecord {\n store = new Map();\n add(target, absolute, ifDir) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);\n const current = this.store.get(target);\n this.store.set(target, current === undefined ? n : n & current);\n }\n // match, absolute, ifdir\n entries() {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ]);\n }\n}\nexports.MatchRecord = MatchRecord;\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nclass SubWalks {\n store = new Map();\n add(target, pattern) {\n if (!target.canReaddir()) {\n return;\n }\n const subs = this.store.get(target);\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern);\n }\n }\n else\n this.store.set(target, [pattern]);\n }\n get(target) {\n const subs = this.store.get(target);\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path');\n }\n /* c8 ignore stop */\n return subs;\n }\n entries() {\n return this.keys().map(k => [k, this.store.get(k)]);\n }\n keys() {\n return [...this.store.keys()].filter(t => t.canReaddir());\n }\n}\nexports.SubWalks = SubWalks;\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nclass Processor {\n hasWalkedCache;\n matches = new MatchRecord();\n subwalks = new SubWalks();\n patterns;\n follow;\n dot;\n opts;\n constructor(opts, hasWalkedCache) {\n this.opts = opts;\n this.follow = !!opts.follow;\n this.dot = !!opts.dot;\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();\n }\n processPatterns(target, patterns) {\n this.patterns = patterns;\n const processingSet = patterns.map(p => [target, p]);\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern);\n const root = pattern.root();\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false;\n // start absolute patterns at root\n if (root) {\n t = t.resolve(root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root);\n const rest = pattern.rest();\n if (!rest) {\n this.matches.add(t, true, false);\n continue;\n }\n else {\n pattern = rest;\n }\n }\n if (t.isENOENT())\n continue;\n let p;\n let rest;\n let changed = false;\n while (typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())) {\n const c = t.resolve(p);\n t = c;\n pattern = rest;\n changed = true;\n }\n p = pattern.pattern();\n rest = pattern.rest();\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern))\n continue;\n this.hasWalkedCache.storeWalked(t, pattern);\n }\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.';\n this.matches.add(t.resolve(p), absolute, ifDir);\n continue;\n }\n else if (p === minimatch_1.GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (!t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()) {\n this.subwalks.add(t, pattern);\n }\n const rp = rest?.pattern();\n const rrest = rest?.rest();\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.');\n }\n else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t;\n /* c8 ignore stop */\n if (!rrest)\n this.matches.add(tp, absolute, true);\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest);\n }\n }\n }\n }\n else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern);\n }\n }\n return this;\n }\n subwalkTargets() {\n return this.subwalks.keys();\n }\n child() {\n return new Processor(this.opts, this.hasWalkedCache);\n }\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent, entries) {\n const patterns = this.subwalks.get(parent);\n // put matches and entry walks into the results processor\n const results = this.child();\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute();\n const p = pattern.pattern();\n const rest = pattern.rest();\n if (p === minimatch_1.GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute);\n }\n else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute);\n }\n else {\n results.testString(e, p, rest, absolute);\n }\n }\n }\n return results;\n }\n testGlobstar(e, pattern, rest, absolute) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false);\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern);\n }\n else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest);\n }\n else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern);\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern();\n if (typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.') {\n this.testString(e, rp, rest.rest(), absolute);\n }\n else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e;\n /* c8 ignore stop */\n this.subwalks.add(ep, rest);\n }\n else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute);\n }\n }\n }\n testRegExp(e, p, rest, absolute) {\n if (!p.test(e.name))\n return;\n if (!rest) {\n this.matches.add(e, absolute, false);\n }\n else {\n this.subwalks.add(e, rest);\n }\n }\n testString(e, p, rest, absolute) {\n // should never happen?\n if (!e.isNamed(p))\n return;\n if (!rest) {\n this.matches.add(e, absolute, false);\n }\n else {\n this.subwalks.add(e, rest);\n }\n }\n}\nexports.Processor = Processor;\n//# sourceMappingURL=processor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0;\n/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nconst minipass_1 = require(\"minipass\");\nconst ignore_js_1 = require(\"./ignore.js\");\nconst processor_js_1 = require(\"./processor.js\");\nconst makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts)\n : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts)\n : ignore;\n/**\n * basic walking utilities that all the glob walker types use\n */\nclass GlobUtil {\n path;\n patterns;\n opts;\n seen = new Set();\n paused = false;\n aborted = false;\n #onResume = [];\n #ignore;\n #sep;\n signal;\n maxDepth;\n includeChildMatches;\n constructor(patterns, path, opts) {\n this.patterns = patterns;\n this.path = path;\n this.opts = opts;\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/';\n this.includeChildMatches = opts.includeChildMatches !== false;\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts);\n if (!this.includeChildMatches &&\n typeof this.#ignore.add !== 'function') {\n const m = 'cannot ignore child matches, ignore lacks add() method.';\n throw new Error(m);\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity;\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal;\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0;\n });\n }\n }\n #ignored(path) {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path);\n }\n #childrenIgnored(path) {\n return !!this.#ignore?.childrenIgnored?.(path);\n }\n // backpressure mechanism\n pause() {\n this.paused = true;\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted)\n return;\n /* c8 ignore stop */\n this.paused = false;\n let fn = undefined;\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn();\n }\n }\n onResume(fn) {\n if (this.signal?.aborted)\n return;\n /* c8 ignore start */\n if (!this.paused) {\n fn();\n }\n else {\n /* c8 ignore stop */\n this.#onResume.push(fn);\n }\n }\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e, ifDir) {\n if (ifDir && this.opts.nodir)\n return undefined;\n let rpc;\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath());\n if (!rpc)\n return undefined;\n e = rpc;\n }\n const needStat = e.isUnknown() || this.opts.stat;\n const s = needStat ? await e.lstat() : e;\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath();\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat();\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir);\n }\n matchCheckTest(e, ifDir) {\n return (e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)) ?\n e\n : undefined;\n }\n matchCheckSync(e, ifDir) {\n if (ifDir && this.opts.nodir)\n return undefined;\n let rpc;\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync();\n if (!rpc)\n return undefined;\n e = rpc;\n }\n const needStat = e.isUnknown() || this.opts.stat;\n const s = needStat ? e.lstatSync() : e;\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync();\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync();\n }\n }\n return this.matchCheckTest(s, ifDir);\n }\n matchFinish(e, absolute) {\n if (this.#ignored(e))\n return;\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`;\n this.#ignore.add(ign);\n }\n const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;\n this.seen.add(e);\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e);\n }\n else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();\n this.matchEmit(abs + mark);\n }\n else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative();\n const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : '';\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark);\n }\n }\n async match(e, absolute, ifDir) {\n const p = await this.matchCheck(e, ifDir);\n if (p)\n this.matchFinish(p, absolute);\n }\n matchSync(e, absolute, ifDir) {\n const p = this.matchCheckSync(e, ifDir);\n if (p)\n this.matchFinish(p, absolute);\n }\n walkCB(target, patterns, cb) {\n /* c8 ignore start */\n if (this.signal?.aborted)\n cb();\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb);\n }\n walkCB2(target, patterns, processor, cb) {\n if (this.#childrenIgnored(target))\n return cb();\n if (this.signal?.aborted)\n cb();\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb));\n return;\n }\n processor.processPatterns(target, patterns);\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1;\n const next = () => {\n if (--tasks === 0)\n cb();\n };\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m))\n continue;\n tasks++;\n this.match(m, absolute, ifDir).then(() => next());\n }\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue;\n }\n tasks++;\n const childrenCached = t.readdirCached();\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next);\n else {\n t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);\n }\n }\n next();\n }\n walkCB3(target, entries, processor, cb) {\n processor = processor.filterEntries(target, entries);\n let tasks = 1;\n const next = () => {\n if (--tasks === 0)\n cb();\n };\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m))\n continue;\n tasks++;\n this.match(m, absolute, ifDir).then(() => next());\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++;\n this.walkCB2(target, patterns, processor.child(), next);\n }\n next();\n }\n walkCBSync(target, patterns, cb) {\n /* c8 ignore start */\n if (this.signal?.aborted)\n cb();\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb);\n }\n walkCB2Sync(target, patterns, processor, cb) {\n if (this.#childrenIgnored(target))\n return cb();\n if (this.signal?.aborted)\n cb();\n if (this.paused) {\n this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));\n return;\n }\n processor.processPatterns(target, patterns);\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1;\n const next = () => {\n if (--tasks === 0)\n cb();\n };\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m))\n continue;\n this.matchSync(m, absolute, ifDir);\n }\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue;\n }\n tasks++;\n const children = t.readdirSync();\n this.walkCB3Sync(t, children, processor, next);\n }\n next();\n }\n walkCB3Sync(target, entries, processor, cb) {\n processor = processor.filterEntries(target, entries);\n let tasks = 1;\n const next = () => {\n if (--tasks === 0)\n cb();\n };\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m))\n continue;\n this.matchSync(m, absolute, ifDir);\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++;\n this.walkCB2Sync(target, patterns, processor.child(), next);\n }\n next();\n }\n}\nexports.GlobUtil = GlobUtil;\nclass GlobWalker extends GlobUtil {\n matches = new Set();\n constructor(patterns, path, opts) {\n super(patterns, path, opts);\n }\n matchEmit(e) {\n this.matches.add(e);\n }\n async walk() {\n if (this.signal?.aborted)\n throw this.signal.reason;\n if (this.path.isUnknown()) {\n await this.path.lstat();\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason);\n }\n else {\n res(this.matches);\n }\n });\n });\n return this.matches;\n }\n walkSync() {\n if (this.signal?.aborted)\n throw this.signal.reason;\n if (this.path.isUnknown()) {\n this.path.lstatSync();\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted)\n throw this.signal.reason;\n });\n return this.matches;\n }\n}\nexports.GlobWalker = GlobWalker;\nclass GlobStream extends GlobUtil {\n results;\n constructor(patterns, path, opts) {\n super(patterns, path, opts);\n this.results = new minipass_1.Minipass({\n signal: this.signal,\n objectMode: true,\n });\n this.results.on('drain', () => this.resume());\n this.results.on('resume', () => this.resume());\n }\n matchEmit(e) {\n this.results.write(e);\n if (!this.results.flowing)\n this.pause();\n }\n stream() {\n const target = this.path;\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end());\n });\n }\n else {\n this.walkCB(target, this.patterns, () => this.results.end());\n }\n return this.results;\n }\n streamSync() {\n if (this.path.isUnknown()) {\n this.path.lstatSync();\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end());\n return this.results;\n }\n}\nexports.GlobStream = GlobStream;\n//# sourceMappingURL=walker.js.map","\"use strict\";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{\"use strict\";Object.defineProperty(O,\"__esModule\",{value:!0});O.tracing=O.metrics=void 0;var U=require(\"node:diagnostics_channel\");O.metrics=(0,U.channel)(\"lru-cache:metrics\");O.tracing=(0,U.tracingChannel)(\"lru-cache\")});var P=j(D=>{\"use strict\";Object.defineProperty(D,\"__esModule\",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance==\"object\"&&performance&&typeof performance.now==\"function\"?performance:Date});Object.defineProperty(exports,\"__esModule\",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process==\"object\"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning==\"function\"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},q=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},x=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError(\"instantiate Stack using Stack.create(n)\");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#_;#r;#y;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#y,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!=\"function\")throw new TypeError(\"perf option must have a now() method if specified\");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError(\"max option must be a nonnegative integer\");let E=e?H(e):Array;if(!E)throw new Error(\"invalid max value: \"+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError(\"cannot set sizeCalculation without setting maxSize or maxEntrySize\");if(typeof this.sizeCalculation!=\"function\")throw new TypeError(\"sizeCalculation set to non-function\")}if(S!==void 0&&typeof S!=\"function\")throw new TypeError(\"memoMethod must be a function if defined\");if(this.#j=S,l!==void 0&&typeof l!=\"function\")throw new TypeError(\"fetchMethod must be a function if specified\");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#_=x.create(e),this.#n=0,this.#b=0,typeof o==\"function\"&&(this.#m=o),typeof d==\"function\"&&(this.#W=d),typeof _==\"function\"?(this.#S=_,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError(\"maxSize must be a positive integer if specified\");if(!T(this.maxEntrySize))throw new TypeError(\"maxEntrySize must be a positive integer if specified\");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError(\"ttl must be a positive integer if specified\");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError(\"At least one of max, maxSize, or ttl is required\");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R=\"LRU_CACHE_UNBOUNDED\";q(R)&&(k.add(R),V(\"TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.\",\"UnboundedCacheWarning\",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],\"expire\")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let _=h.now-d;h.remainingTTL=o-_}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let _=(n||r())-d;return o-_},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#y=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!=\"function\")throw new TypeError(\"sizeCalculation must be a function\");if(s=n(i,e),!T(s))throw new TypeError(\"sizeCalculation return invalid (expect positive integer)\")}else throw new TypeError(\"invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.\")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError(\"cannot set size without setting maxSize or maxEntrySize on cache\");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=\"LRUCache\";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#x(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],\"expire\"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#y&&(n.size=this.#y[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#y&&(r.size=this.#y[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op=\"set\",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set=\"deleted\"),this.delete(t),this;let{noUpdateTTL:_=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let y=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&y>this.maxEntrySize)return this.#v(t,\"set\"),o&&(o.set=\"miss\",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,y,o),o&&(o.set=\"add\"),_=!1,this.#D&&!d&&this.#W?.(e,t,\"add\");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error(\"replaced\"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,\"set\"),this.#f&&this.#r?.push([f,t,\"set\"]))}else this.#T&&this.#m?.(p,t,\"set\"),this.#f&&this.#r?.push([p,t,\"set\"]);if(this.#C(u),this.#I(u,y,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?\"add\":e!==f?\"replace\":\"update\";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set=\"update\"),this.#D&&this.onInsert?.(e,t,\"update\"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(_||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error(\"evicted\"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,\"evict\"),this.#f&&this.#r?.push([r,i,\"evict\"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#a=this.#h=0,this.#_.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op=\"has\",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has=\"stale\",this.#E(s,n));else return i&&this.#R(n),s&&(s.has=\"hit\",this.#E(s,n)),!0}else s&&(s.has=\"miss\");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op=\"peek\",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?\"miss\":\"stale\");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek=\"hit\",i.value=h):i.peek=\"miss\"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener(\"abort\",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return _(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,\"fetch\"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),_(f,!1)),_=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,\"fetch\"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},y=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener(\"abort\",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(y).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty(\"__staleWhileFetching\")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#q(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#q(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op=\"fetch\",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch=\"get\"),this.#x(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch=\"miss\");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch=\"inflight\",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch=\"hit\"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?\"stale\":\"refresh\",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#q(t,e);if(i===void 0)throw new Error(\"fetch() returned undefined\");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op=\"memo\",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error(\"no memoMethod provided to constructor\");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#x(t,h),o=r||a===void 0;if(n&&(n.memo=o?\"miss\":\"hit\",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op=\"get\",i.key=t,i.cache=this);let s=this.#x(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#x(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get=\"miss\");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get=\"stale-fetching\"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,\"expire\"),r&&(r.get=\"stale\"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?\"fetching\":\"hit\"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#B(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#B(this.#u[t],this.#l[t]),this.#B(this.#h,t),this.#h=t)}delete(t){return this.#v(t,\"delete\")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:\"delete\",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error(\"deleted\")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#_.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$(\"delete\")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error(\"deleted\"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#a=0,this.#h=0,this.#_.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L;\n//# sourceMappingURL=index.min.js.map\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertValidPattern = void 0;\nconst MAX_PATTERN_LENGTH = 1024 * 64;\nconst assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\nexports.assertValidPattern = assertValidPattern;\n//# sourceMappingURL=assert-valid-pattern.js.map","\"use strict\";\n// parse a single path portion\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AST = void 0;\nconst brace_expressions_js_1 = require(\"./brace-expressions.js\");\nconst unescape_js_1 = require(\"./unescape.js\");\nconst types = new Set(['!', '?', '+', '*', '@']);\nconst isExtglobType = (c) => types.has(c);\nconst isExtglobAST = (c) => isExtglobType(c.type);\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n]);\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n]);\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n]);\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n]);\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))';\nconst startNoDot = '(?!\\\\.)';\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.']);\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.']);\nconst reSpecials = new Set('().*{}+?[]^$\\\\!');\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// any single thing other than /\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?';\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\nlet ID = 0;\nclass AST {\n type;\n #root;\n #hasMagic;\n #uflag = false;\n #parts = [];\n #parent;\n #parentIndex;\n #negs;\n #filledNegs = false;\n #options;\n #toString;\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt = false;\n id = ++ID;\n get depth() {\n return (this.#parent?.depth ?? -1) + 1;\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n };\n }\n constructor(type, parent, options = {}) {\n this.type = type;\n // extglobs are inherently magical\n if (type)\n this.#hasMagic = true;\n this.#parent = parent;\n this.#root = this.#parent ? this.#parent.#root : this;\n this.#options = this.#root === this ? options : this.#root.#options;\n this.#negs = this.#root === this ? [] : this.#root.#negs;\n if (type === '!' && !this.#root.#filledNegs)\n this.#negs.push(this);\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;\n }\n get hasMagic() {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined)\n return this.#hasMagic;\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string')\n continue;\n if (p.type || p.hasMagic)\n return (this.#hasMagic = true);\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic;\n }\n // reconstructs the pattern\n toString() {\n return (this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')'));\n }\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root)\n throw new Error('should only call on root');\n if (this.#filledNegs)\n return this;\n /* c8 ignore stop */\n // call toString() once to fill this out\n this.toString();\n this.#filledNegs = true;\n let n;\n while ((n = this.#negs.pop())) {\n if (n.type !== '!')\n continue;\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p = n;\n let pp = p.#parent;\n while (pp) {\n for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??');\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i]);\n }\n }\n p = pp;\n pp = p.#parent;\n }\n }\n return this;\n }\n push(...parts) {\n for (const p of parts) {\n if (p === '')\n continue;\n /* c8 ignore start */\n if (typeof p !== 'string' &&\n !(p instanceof _a && p.#parent === this)) {\n throw new Error('invalid part: ' + p);\n }\n /* c8 ignore stop */\n this.#parts.push(p);\n }\n }\n toJSON() {\n const ret = this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => p.toJSON())];\n if (this.isStart() && !this.type)\n ret.unshift([]);\n if (this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))) {\n ret.push({});\n }\n return ret;\n }\n isStart() {\n if (this.#root === this)\n return true;\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart())\n return false;\n if (this.#parentIndex === 0)\n return true;\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent;\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i];\n if (!(pp instanceof _a && pp.type === '!')) {\n return false;\n }\n }\n return true;\n }\n isEnd() {\n if (this.#root === this)\n return true;\n if (this.#parent?.type === '!')\n return true;\n if (!this.#parent?.isEnd())\n return false;\n if (!this.type)\n return this.#parent?.isEnd();\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0;\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1;\n }\n copyIn(part) {\n if (typeof part === 'string')\n this.push(part);\n else\n this.push(part.clone(this));\n }\n clone(parent) {\n const c = new _a(this.type, parent);\n for (const p of this.#parts) {\n c.copyIn(p);\n }\n return c;\n }\n static #parseAST(str, ast, pos, opt, extDepth) {\n const maxDepth = opt.maxExtglobRecursion ?? 2;\n let escaping = false;\n let inBrace = false;\n let braceStart = -1;\n let braceNeg = false;\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos;\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth;\n if (doRecurse) {\n ast.push(acc);\n acc = '';\n const ext = new _a(c, ast);\n i = _a.#parseAST(str, ext, i, opt, extDepth + 1);\n ast.push(ext);\n continue;\n }\n acc += c;\n }\n ast.push(acc);\n return i;\n }\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1;\n let part = new _a(null, ast);\n const parts = [];\n let acc = '';\n while (i < str.length) {\n const c = str.charAt(i++);\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping;\n acc += c;\n continue;\n }\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true;\n }\n }\n else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false;\n }\n acc += c;\n continue;\n }\n else if (c === '[') {\n inBrace = true;\n braceStart = i;\n braceNeg = false;\n acc += c;\n continue;\n }\n const doRecurse = !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;\n part.push(acc);\n acc = '';\n const ext = new _a(c, part);\n part.push(ext);\n i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);\n continue;\n }\n if (c === '|') {\n part.push(acc);\n acc = '';\n parts.push(part);\n part = new _a(null, ast);\n continue;\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true;\n }\n part.push(acc);\n acc = '';\n ast.push(...parts, part);\n return i;\n }\n acc += c;\n }\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null;\n ast.#hasMagic = undefined;\n ast.#parts = [str.substring(pos - 1)];\n return i;\n }\n #canAdoptWithSpace(child) {\n return this.#canAdopt(child, adoptionWithSpaceMap);\n }\n #canAdopt(child, map = adoptionMap) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canAdoptType(gc.type, map);\n }\n #canAdoptType(c, map = adoptionAnyMap) {\n return !!map.get(this.type)?.includes(c);\n }\n #adoptWithSpace(child, index) {\n const gc = child.#parts[0];\n const blank = new _a(null, gc, this.options);\n blank.#parts.push('');\n gc.push(blank);\n this.#adopt(child, index);\n }\n #adopt(child, index) {\n const gc = child.#parts[0];\n this.#parts.splice(index, 1, ...gc.#parts);\n for (const p of gc.#parts) {\n if (typeof p === 'object')\n p.#parent = this;\n }\n this.#toString = undefined;\n }\n #canUsurpType(c) {\n const m = usurpMap.get(this.type);\n return !!m?.has(c);\n }\n #canUsurp(child) {\n if (!child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1) {\n return false;\n }\n const gc = child.#parts[0];\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false;\n }\n return this.#canUsurpType(gc.type);\n }\n #usurp(child) {\n const m = usurpMap.get(this.type);\n const gc = child.#parts[0];\n const nt = m?.get(gc.type);\n /* c8 ignore start - impossible */\n if (!nt)\n return false;\n /* c8 ignore stop */\n this.#parts = gc.#parts;\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this;\n }\n }\n this.type = nt;\n this.#toString = undefined;\n this.#emptyExt = false;\n }\n static fromGlob(pattern, options = {}) {\n const ast = new _a(null, undefined, options);\n _a.#parseAST(pattern, ast, 0, options, 0);\n return ast;\n }\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern() {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root)\n return this.#root.toMMPattern();\n /* c8 ignore stop */\n const glob = this.toString();\n const [re, body, hasMagic, uflag] = this.toRegExpSource();\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic = hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase());\n if (!anyMagic) {\n return body;\n }\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n });\n }\n get options() {\n return this.#options;\n }\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(allowDot) {\n const dot = allowDot ?? !!this.#options.dot;\n if (this.#root === this) {\n this.#flatten();\n this.#fillNegs();\n }\n if (!isExtglobAST(this)) {\n const noEmpty = this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string');\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] = typeof p === 'string' ?\n _a.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot);\n this.#hasMagic = this.#hasMagic || hasMagic;\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .join('');\n let start = '';\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);\n if (!dotTravAllowed) {\n const aps = addPatternStart;\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav = \n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)));\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : '';\n }\n }\n }\n // append the \"end of path portion\" pattern to negation tails\n let end = '';\n if (this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!') {\n end = '(?:$|\\\\/)';\n }\n const final = start + src + end;\n return [\n final,\n (0, unescape_js_1.unescape)(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n const repeated = this.type === '*' || this.type === '+';\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:';\n let body = this.#partsToRegExp(dot);\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString();\n const me = this;\n me.#parts = [s];\n me.type = null;\n me.#hasMagic = undefined;\n return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];\n }\n let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true);\n if (bodyDotAllowed === body) {\n bodyDotAllowed = '';\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`;\n }\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = '';\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;\n }\n else {\n const close = this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`;\n final = start + body + close;\n }\n return [\n final,\n (0, unescape_js_1.unescape)(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ];\n }\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten();\n }\n }\n }\n else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0;\n let done = false;\n do {\n done = true;\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i];\n if (typeof c === 'object') {\n c.#flatten();\n if (this.#canAdopt(c)) {\n done = false;\n this.#adopt(c, i);\n }\n else if (this.#canAdoptWithSpace(c)) {\n done = false;\n this.#adoptWithSpace(c, i);\n }\n else if (this.#canUsurp(c)) {\n done = false;\n this.#usurp(c);\n }\n }\n }\n } while (!done && ++iterations < 10);\n }\n this.#toString = undefined;\n }\n #partsToRegExp(dot) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??');\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);\n this.#uflag = this.#uflag || uflag;\n return re;\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|');\n }\n static #parseGlob(glob, hasMagic, noEmpty = false) {\n let escaping = false;\n let re = '';\n let uflag = false;\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false;\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i);\n if (escaping) {\n escaping = false;\n re += (reSpecials.has(c) ? '\\\\' : '') + c;\n continue;\n }\n if (c === '*') {\n if (inStar)\n continue;\n inStar = true;\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;\n hasMagic = true;\n continue;\n }\n else {\n inStar = false;\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\';\n }\n else {\n escaping = true;\n }\n continue;\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);\n if (consumed) {\n re += src;\n uflag = uflag || needUflag;\n i += consumed - 1;\n hasMagic = hasMagic || magic;\n continue;\n }\n }\n if (c === '?') {\n re += qmark;\n hasMagic = true;\n continue;\n }\n re += regExpEscape(c);\n }\n return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];\n }\n}\nexports.AST = AST;\n_a = AST;\n//# sourceMappingURL=ast.js.map","\"use strict\";\n// translate the various posix character classes into unicode properties\n// this works across all unicode locales\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseClass = void 0;\n// { <posix class>: [<translation>, /u flag required, negated]\nconst posixClasses = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n};\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s) => s.replace(/[[\\]\\\\-]/g, '\\\\$&');\n// escape all regexp magic characters\nconst regexpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges) => ranges.join('');\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nconst parseClass = (glob, position) => {\n const pos = position;\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression');\n }\n /* c8 ignore stop */\n const ranges = [];\n const negs = [];\n let i = pos + 1;\n let sawStart = false;\n let uflag = false;\n let escaping = false;\n let negate = false;\n let endPos = pos;\n let rangeStart = '';\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i);\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true;\n i++;\n continue;\n }\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1;\n break;\n }\n sawStart = true;\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true;\n i++;\n continue;\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true];\n }\n i += cls.length;\n if (neg)\n negs.push(unip);\n else\n ranges.push(unip);\n uflag = uflag || u;\n continue WHILE;\n }\n }\n }\n // now it's just a normal character, effectively\n escaping = false;\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));\n }\n else if (c === rangeStart) {\n ranges.push(braceEscape(c));\n }\n rangeStart = '';\n i++;\n continue;\n }\n // now might be the start of a range.\n // can be either c-d or c-] or c<more...>] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'));\n i += 2;\n continue;\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c;\n i += 2;\n continue;\n }\n // not the start of a range, just a single character\n ranges.push(braceEscape(c));\n i++;\n }\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false];\n }\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true];\n }\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];\n return [regexpEscape(r), false, endPos - pos, false];\n }\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';\n const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs;\n return [comb, uflag, endPos - pos, true];\n};\nexports.parseClass = parseClass;\n//# sourceMappingURL=brace-expressions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.escape = void 0;\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nconst escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&');\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&');\n};\nexports.escape = escape;\n//# sourceMappingURL=escape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;\nconst brace_expansion_1 = require(\"brace-expansion\");\nconst assert_valid_pattern_js_1 = require(\"./assert-valid-pattern.js\");\nconst ast_js_1 = require(\"./ast.js\");\nconst escape_js_1 = require(\"./escape.js\");\nconst unescape_js_1 = require(\"./unescape.js\");\nconst minimatch = (p, pattern, options = {}) => {\n (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false;\n }\n return new Minimatch(pattern, options).match(p);\n};\nexports.minimatch = minimatch;\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/;\nconst starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);\nconst starDotExtTestDot = (ext) => (f) => f.endsWith(ext);\nconst starDotExtTestNocase = (ext) => {\n ext = ext.toLowerCase();\n return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);\n};\nconst starDotExtTestNocaseDot = (ext) => {\n ext = ext.toLowerCase();\n return (f) => f.toLowerCase().endsWith(ext);\n};\nconst starDotStarRE = /^\\*+\\.\\*+$/;\nconst starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');\nconst starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');\nconst dotStarRE = /^\\.\\*+$/;\nconst dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');\nconst starRE = /^\\*+$/;\nconst starTest = (f) => f.length !== 0 && !f.startsWith('.');\nconst starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/;\nconst qmarksTestNocase = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestNocaseDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n if (!ext)\n return noext;\n ext = ext.toLowerCase();\n return (f) => noext(f) && f.toLowerCase().endsWith(ext);\n};\nconst qmarksTestDot = ([$0, ext = '']) => {\n const noext = qmarksTestNoExtDot([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTest = ([$0, ext = '']) => {\n const noext = qmarksTestNoExt([$0]);\n return !ext ? noext : (f) => noext(f) && f.endsWith(ext);\n};\nconst qmarksTestNoExt = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && !f.startsWith('.');\n};\nconst qmarksTestNoExtDot = ([$0]) => {\n const len = $0.length;\n return (f) => f.length === len && f !== '.' && f !== '..';\n};\n/* c8 ignore start */\nconst defaultPlatform = (typeof process === 'object' && process ?\n (typeof process.env === 'object' &&\n process.env &&\n process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n process.platform\n : 'posix');\nconst path = {\n win32: { sep: '\\\\' },\n posix: { sep: '/' },\n};\n/* c8 ignore stop */\nexports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;\nexports.minimatch.sep = exports.sep;\nexports.GLOBSTAR = Symbol('globstar **');\nexports.minimatch.GLOBSTAR = exports.GLOBSTAR;\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]';\n// * => any number of characters\nconst star = qmark + '*?';\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?';\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?';\nconst filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options);\nexports.filter = filter;\nexports.minimatch.filter = exports.filter;\nconst ext = (a, b = {}) => Object.assign({}, a, b);\nconst defaults = (def) => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return exports.minimatch;\n }\n const orig = exports.minimatch;\n const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));\n return Object.assign(m, {\n Minimatch: class Minimatch extends orig.Minimatch {\n constructor(pattern, options = {}) {\n super(pattern, ext(def, options));\n }\n static defaults(options) {\n return orig.defaults(ext(def, options)).Minimatch;\n }\n },\n AST: class AST extends orig.AST {\n /* c8 ignore start */\n constructor(type, parent, options = {}) {\n super(type, parent, ext(def, options));\n }\n /* c8 ignore stop */\n static fromGlob(pattern, options = {}) {\n return orig.AST.fromGlob(pattern, ext(def, options));\n }\n },\n unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),\n escape: (s, options = {}) => orig.escape(s, ext(def, options)),\n filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),\n defaults: (options) => orig.defaults(ext(def, options)),\n makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),\n braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),\n match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),\n sep: orig.sep,\n GLOBSTAR: exports.GLOBSTAR,\n });\n};\nexports.defaults = defaults;\nexports.minimatch.defaults = exports.defaults;\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nconst braceExpand = (pattern, options = {}) => {\n (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);\n // Thanks to Yeting Li <https://github.com/yetingli> for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern];\n }\n return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax });\n};\nexports.braceExpand = braceExpand;\nexports.minimatch.braceExpand = exports.braceExpand;\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nconst makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();\nexports.makeRe = makeRe;\nexports.minimatch.makeRe = exports.makeRe;\nconst match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options);\n list = list.filter(f => mm.match(f));\n if (mm.options.nonull && !list.length) {\n list.push(pattern);\n }\n return list;\n};\nexports.match = match;\nexports.minimatch.match = exports.match;\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/;\nconst regExpEscape = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\nclass Minimatch {\n options;\n set;\n pattern;\n windowsPathsNoEscape;\n nonegate;\n negate;\n comment;\n empty;\n preserveMultipleSlashes;\n partial;\n globSet;\n globParts;\n nocase;\n isWindows;\n platform;\n windowsNoMagicRoot;\n maxGlobstarRecursion;\n regexp;\n constructor(pattern, options = {}) {\n (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);\n options = options || {};\n this.options = options;\n this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;\n this.pattern = pattern;\n this.platform = options.platform || defaultPlatform;\n this.isWindows = this.platform === 'win32';\n // avoid the annoying deprecation flag lol\n const awe = ('allowWindow' + 'sEscape');\n this.windowsPathsNoEscape =\n !!options.windowsPathsNoEscape || options[awe] === false;\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/');\n }\n this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;\n this.regexp = null;\n this.negate = false;\n this.nonegate = !!options.nonegate;\n this.comment = false;\n this.empty = false;\n this.partial = !!options.partial;\n this.nocase = !!this.options.nocase;\n this.windowsNoMagicRoot =\n options.windowsNoMagicRoot !== undefined ?\n options.windowsNoMagicRoot\n : !!(this.isWindows && this.nocase);\n this.globSet = [];\n this.globParts = [];\n this.set = [];\n // make the set of regexps etc.\n this.make();\n }\n hasMagic() {\n if (this.options.magicalBraces && this.set.length > 1) {\n return true;\n }\n for (const pattern of this.set) {\n for (const part of pattern) {\n if (typeof part !== 'string')\n return true;\n }\n }\n return false;\n }\n debug(..._) { }\n make() {\n const pattern = this.pattern;\n const options = this.options;\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true;\n return;\n }\n if (!pattern) {\n this.empty = true;\n return;\n }\n // step 1: figure out negation, etc.\n this.parseNegate();\n // step 2: expand braces\n this.globSet = [...new Set(this.braceExpand())];\n if (options.debug) {\n //oxlint-disable-next-line no-console\n this.debug = (...args) => console.error(...args);\n }\n this.debug(this.pattern, this.globSet);\n // step 3: now we have a set, so turn each one into a series of\n // path-portion matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n //\n // First, we preprocess to make the glob pattern sets a bit simpler\n // and deduped. There are some perf-killing patterns that can cause\n // problems with a glob walk, but we can simplify them down a bit.\n const rawGlobParts = this.globSet.map(s => this.slashSplit(s));\n this.globParts = this.preprocess(rawGlobParts);\n this.debug(this.pattern, this.globParts);\n // glob --> regexps\n let set = this.globParts.map((s, _, __) => {\n if (this.isWindows && this.windowsNoMagicRoot) {\n // check if it's a drive or unc path.\n const isUNC = s[0] === '' &&\n s[1] === '' &&\n (s[2] === '?' || !globMagic.test(s[2])) &&\n !globMagic.test(s[3]);\n const isDrive = /^[a-z]:/i.test(s[0]);\n if (isUNC) {\n return [\n ...s.slice(0, 4),\n ...s.slice(4).map(ss => this.parse(ss)),\n ];\n }\n else if (isDrive) {\n return [s[0], ...s.slice(1).map(ss => this.parse(ss))];\n }\n }\n return s.map(ss => this.parse(ss));\n });\n this.debug(this.pattern, set);\n // filter out everything that didn't compile properly.\n this.set = set.filter(s => s.indexOf(false) === -1);\n // do not treat the ? in UNC paths as magic\n if (this.isWindows) {\n for (let i = 0; i < this.set.length; i++) {\n const p = this.set[i];\n if (p[0] === '' &&\n p[1] === '' &&\n this.globParts[i][2] === '?' &&\n typeof p[3] === 'string' &&\n /^[a-z]:$/i.test(p[3])) {\n p[2] = '?';\n }\n }\n }\n this.debug(this.pattern, this.set);\n }\n // various transforms to equivalent pattern sets that are\n // faster to process in a filesystem walk. The goal is to\n // eliminate what we can, and push all ** patterns as far\n // to the right as possible, even if it increases the number\n // of patterns that we have to process.\n preprocess(globParts) {\n // if we're not in globstar mode, then turn ** into *\n if (this.options.noglobstar) {\n for (const partset of globParts) {\n for (let j = 0; j < partset.length; j++) {\n if (partset[j] === '**') {\n partset[j] = '*';\n }\n }\n }\n }\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n // aggressive optimization for the purpose of fs walking\n globParts = this.firstPhasePreProcess(globParts);\n globParts = this.secondPhasePreProcess(globParts);\n }\n else if (optimizationLevel >= 1) {\n // just basic optimizations to remove some .. parts\n globParts = this.levelOneOptimize(globParts);\n }\n else {\n // just collapse multiple ** portions into one\n globParts = this.adjascentGlobstarOptimize(globParts);\n }\n return globParts;\n }\n // just get rid of adjascent ** portions\n adjascentGlobstarOptimize(globParts) {\n return globParts.map(parts => {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let i = gs;\n while (parts[i + 1] === '**') {\n i++;\n }\n if (i !== gs) {\n parts.splice(gs, i - gs);\n }\n }\n return parts;\n });\n }\n // get rid of adjascent ** and resolve .. portions\n levelOneOptimize(globParts) {\n return globParts.map(parts => {\n parts = parts.reduce((set, part) => {\n const prev = set[set.length - 1];\n if (part === '**' && prev === '**') {\n return set;\n }\n if (part === '..') {\n if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n set.pop();\n return set;\n }\n }\n set.push(part);\n return set;\n }, []);\n return parts.length === 0 ? [''] : parts;\n });\n }\n levelTwoFileOptimize(parts) {\n if (!Array.isArray(parts)) {\n parts = this.slashSplit(parts);\n }\n let didSomething = false;\n do {\n didSomething = false;\n // <pre>/<e>/<rest> -> <pre>/<rest>\n if (!this.preserveMultipleSlashes) {\n for (let i = 1; i < parts.length - 1; i++) {\n const p = parts[i];\n // don't squeeze out UNC patterns\n if (i === 1 && p === '' && parts[0] === '')\n continue;\n if (p === '.' || p === '') {\n didSomething = true;\n parts.splice(i, 1);\n i--;\n }\n }\n if (parts[0] === '.' &&\n parts.length === 2 &&\n (parts[1] === '.' || parts[1] === '')) {\n didSomething = true;\n parts.pop();\n }\n }\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n let dd = 0;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p &&\n p !== '.' &&\n p !== '..' &&\n p !== '**' &&\n !(this.isWindows && /^[a-z]:$/i.test(p))) {\n didSomething = true;\n parts.splice(dd - 1, 2);\n dd -= 2;\n }\n }\n } while (didSomething);\n return parts.length === 0 ? [''] : parts;\n }\n // First phase: single-pattern processing\n // <pre> is 1 or more portions\n // <rest> is 1 or more portions\n // <p> is any portion other than ., .., '', or **\n // <e> is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n // <pre>/<e>/<rest> -> <pre>/<rest>\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n // **/**/<rest> -> **/<rest>\n //\n // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow\n // this WOULD be allowed if ** did follow symlinks, or * didn't\n firstPhasePreProcess(globParts) {\n let didSomething = false;\n do {\n didSomething = false;\n // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n for (let parts of globParts) {\n let gs = -1;\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss = gs;\n while (parts[gss + 1] === '**') {\n // <pre>/**/**/<rest> -> <pre>/**/<rest>\n gss++;\n }\n // eg, if gs is 2 and gss is 4, that means we have 3 **\n // parts, and can remove 2 of them.\n if (gss > gs) {\n parts.splice(gs + 1, gss - gs);\n }\n let next = parts[gs + 1];\n const p = parts[gs + 2];\n const p2 = parts[gs + 3];\n if (next !== '..')\n continue;\n if (!p ||\n p === '.' ||\n p === '..' ||\n !p2 ||\n p2 === '.' ||\n p2 === '..') {\n continue;\n }\n didSomething = true;\n // edit parts in place, and push the new one\n parts.splice(gs, 1);\n const other = parts.slice(0);\n other[gs] = '**';\n globParts.push(other);\n gs--;\n }\n // <pre>/<e>/<rest> -> <pre>/<rest>\n if (!this.preserveMultipleSlashes) {\n for (let i = 1; i < parts.length - 1; i++) {\n const p = parts[i];\n // don't squeeze out UNC patterns\n if (i === 1 && p === '' && parts[0] === '')\n continue;\n if (p === '.' || p === '') {\n didSomething = true;\n parts.splice(i, 1);\n i--;\n }\n }\n if (parts[0] === '.' &&\n parts.length === 2 &&\n (parts[1] === '.' || parts[1] === '')) {\n didSomething = true;\n parts.pop();\n }\n }\n // <pre>/<p>/../<rest> -> <pre>/<rest>\n let dd = 0;\n while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n const p = parts[dd - 1];\n if (p && p !== '.' && p !== '..' && p !== '**') {\n didSomething = true;\n const needDot = dd === 1 && parts[dd + 1] === '**';\n const splin = needDot ? ['.'] : [];\n parts.splice(dd - 1, 2, ...splin);\n if (parts.length === 0)\n parts.push('');\n dd -= 2;\n }\n }\n }\n } while (didSomething);\n return globParts;\n }\n // second phase: multi-pattern dedupes\n // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>\n //\n // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>\n // ^-- not valid because ** doens't follow symlinks\n secondPhasePreProcess(globParts) {\n for (let i = 0; i < globParts.length - 1; i++) {\n for (let j = i + 1; j < globParts.length; j++) {\n const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);\n if (matched) {\n globParts[i] = [];\n globParts[j] = matched;\n break;\n }\n }\n }\n return globParts.filter(gs => gs.length);\n }\n partsMatch(a, b, emptyGSMatch = false) {\n let ai = 0;\n let bi = 0;\n let result = [];\n let which = '';\n while (ai < a.length && bi < b.length) {\n if (a[ai] === b[bi]) {\n result.push(which === 'b' ? b[bi] : a[ai]);\n ai++;\n bi++;\n }\n else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n result.push(a[ai]);\n ai++;\n }\n else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n result.push(b[bi]);\n bi++;\n }\n else if (a[ai] === '*' &&\n b[bi] &&\n (this.options.dot || !b[bi].startsWith('.')) &&\n b[bi] !== '**') {\n if (which === 'b')\n return false;\n which = 'a';\n result.push(a[ai]);\n ai++;\n bi++;\n }\n else if (b[bi] === '*' &&\n a[ai] &&\n (this.options.dot || !a[ai].startsWith('.')) &&\n a[ai] !== '**') {\n if (which === 'a')\n return false;\n which = 'b';\n result.push(b[bi]);\n ai++;\n bi++;\n }\n else {\n return false;\n }\n }\n // if we fall out of the loop, it means they two are identical\n // as long as their lengths match\n return a.length === b.length && result;\n }\n parseNegate() {\n if (this.nonegate)\n return;\n const pattern = this.pattern;\n let negate = false;\n let negateOffset = 0;\n for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n negate = !negate;\n negateOffset++;\n }\n if (negateOffset)\n this.pattern = pattern.slice(negateOffset);\n this.negate = negate;\n }\n // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne(file, pattern, partial = false) {\n let fileStartIndex = 0;\n let patternStartIndex = 0;\n // UNC paths like //?/X:/... can match X:/... and vice versa\n // Drive letters in absolute drive or unc paths are always compared\n // case-insensitively.\n if (this.isWindows) {\n const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);\n const fileUNC = !fileDrive &&\n file[0] === '' &&\n file[1] === '' &&\n file[2] === '?' &&\n /^[a-z]:$/i.test(file[3]);\n const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);\n const patternUNC = !patternDrive &&\n pattern[0] === '' &&\n pattern[1] === '' &&\n pattern[2] === '?' &&\n typeof pattern[3] === 'string' &&\n /^[a-z]:$/i.test(pattern[3]);\n const fdi = fileUNC ? 3\n : fileDrive ? 0\n : undefined;\n const pdi = patternUNC ? 3\n : patternDrive ? 0\n : undefined;\n if (typeof fdi === 'number' && typeof pdi === 'number') {\n const [fd, pd] = [\n file[fdi],\n pattern[pdi],\n ];\n // start matching at the drive letter index of each\n if (fd.toLowerCase() === pd.toLowerCase()) {\n pattern[pdi] = fd;\n patternStartIndex = pdi;\n fileStartIndex = fdi;\n }\n }\n }\n // resolve and reduce . and .. portions in the file as well.\n // don't need to do the second phase, because it's only one string[]\n const { optimizationLevel = 1 } = this.options;\n if (optimizationLevel >= 2) {\n file = this.levelTwoFileOptimize(file);\n }\n if (pattern.includes(exports.GLOBSTAR)) {\n return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);\n }\n return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);\n }\n #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {\n // split the pattern into head, tail, and middle of ** delimited parts\n const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);\n const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);\n // split the pattern up into globstar-delimited sections\n // the tail has to be at the end, and the others just have\n // to be found in order from the head.\n const [head, body, tail] = partial ?\n [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1),\n [],\n ]\n : [\n pattern.slice(patternIndex, firstgs),\n pattern.slice(firstgs + 1, lastgs),\n pattern.slice(lastgs + 1),\n ];\n // check the head, from the current file/pattern index.\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length);\n if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n return false;\n }\n fileIndex += head.length;\n patternIndex += head.length;\n }\n // now we know the head matches!\n // if the last portion is not empty, it MUST match the end\n // check the tail\n let fileTailMatch = 0;\n if (tail.length) {\n // if head + tail > file, then we cannot possibly match\n if (tail.length + fileIndex > file.length)\n return false;\n // try to match the tail\n let tailStart = file.length - tail.length;\n if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n fileTailMatch = tail.length;\n }\n else {\n // affordance for stuff like a/**/* matching a/b/\n // if the last file portion is '', and there's more to the pattern\n // then try without the '' bit.\n if (file[file.length - 1] !== '' ||\n fileIndex + tail.length === file.length) {\n return false;\n }\n tailStart--;\n if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n return false;\n }\n fileTailMatch = tail.length + 1;\n }\n }\n // now we know the tail matches!\n // the middle is zero or more portions wrapped in **, possibly\n // containing more ** sections.\n // so a/**/b/**/c/**/d has become **/b/**/c/**\n // if it's empty, it means a/**/b, just verify we have no bad dots\n // if there's no tail, so it ends on /**, then we must have *something*\n // after the head, or it's not a matc\n if (!body.length) {\n let sawSome = !!fileTailMatch;\n for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n const f = String(file[i]);\n sawSome = true;\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n }\n // in partial mode, we just need to get past all file parts\n return partial || sawSome;\n }\n // now we know that there's one or more body sections, which can\n // be matched anywhere from the 0 index (because the head was pruned)\n // through to the length-fileTailMatch index.\n // split the body up into sections, and note the minimum index it can\n // be found at (start with the length of all previous segments)\n // [section, before, after]\n const bodySegments = [[[], 0]];\n let currentBody = bodySegments[0];\n let nonGsParts = 0;\n const nonGsPartsSums = [0];\n for (const b of body) {\n if (b === exports.GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts);\n currentBody = [[], 0];\n bodySegments.push(currentBody);\n }\n else {\n currentBody[0].push(b);\n nonGsParts++;\n }\n }\n let i = bodySegments.length - 1;\n const fileLength = file.length - fileTailMatch;\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);\n }\n return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);\n }\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n #matchGlobStarBodySections(file, \n // pattern section, last possible position for it\n bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {\n // take the first body segment, and walk from fileIndex to its \"after\"\n // value at the end\n // If it doesn't match at that position, we increment, until we hit\n // that final possible position, and give up.\n // If it does match, then advance and try to rest.\n // If any of them fail we keep walking forward.\n // this is still a bit recursively painful, but it's more constrained\n // than previous implementations, because we never test something that\n // can't possibly be a valid matching condition.\n const bs = bodySegments[bodyIndex];\n if (!bs) {\n // just make sure that there's no bad dots\n for (let i = fileIndex; i < file.length; i++) {\n sawTail = true;\n const f = file[i];\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n }\n return sawTail;\n }\n // have a non-globstar body section to test\n const [body, after] = bs;\n while (fileIndex <= after) {\n const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);\n // if limit exceeded, no match. intentional false negative,\n // acceptable break in correctness for security.\n if (m && globStarDepth < this.maxGlobstarRecursion) {\n // match! see if the rest match. if so, we're done!\n const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);\n if (sub !== false) {\n return sub;\n }\n }\n const f = file[fileIndex];\n if (f === '.' ||\n f === '..' ||\n (!this.options.dot && f.startsWith('.'))) {\n return false;\n }\n fileIndex++;\n }\n // walked off. no point continuing\n return partial || null;\n }\n #matchOne(file, pattern, partial, fileIndex, patternIndex) {\n let fi;\n let pi;\n let pl;\n let fl;\n for (fi = fileIndex,\n pi = patternIndex,\n fl = file.length,\n pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {\n this.debug('matchOne loop');\n let p = pattern[pi];\n let f = file[fi];\n this.debug(pattern, p, f);\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* c8 ignore start */\n if (p === false || p === exports.GLOBSTAR) {\n return false;\n }\n /* c8 ignore stop */\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n let hit;\n if (typeof p === 'string') {\n hit = f === p;\n this.debug('string match', p, f, hit);\n }\n else {\n hit = p.test(f);\n this.debug('pattern match', p, f, hit);\n }\n if (!hit)\n return false;\n }\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true;\n }\n else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial;\n }\n else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return fi === fl - 1 && file[fi] === '';\n /* c8 ignore start */\n }\n else {\n // should be unreachable.\n throw new Error('wtf?');\n }\n /* c8 ignore stop */\n }\n braceExpand() {\n return (0, exports.braceExpand)(this.pattern, this.options);\n }\n parse(pattern) {\n (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);\n const options = this.options;\n // shortcuts\n if (pattern === '**')\n return exports.GLOBSTAR;\n if (pattern === '')\n return '';\n // far and away, the most common glob pattern parts are\n // *, *.*, and *.<ext> Add a fast check method for those.\n let m;\n let fastTest = null;\n if ((m = pattern.match(starRE))) {\n fastTest = options.dot ? starTestDot : starTest;\n }\n else if ((m = pattern.match(starDotExtRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n starDotExtTestNocaseDot\n : starDotExtTestNocase\n : options.dot ? starDotExtTestDot\n : starDotExtTest)(m[1]);\n }\n else if ((m = pattern.match(qmarksRE))) {\n fastTest = (options.nocase ?\n options.dot ?\n qmarksTestNocaseDot\n : qmarksTestNocase\n : options.dot ? qmarksTestDot\n : qmarksTest)(m);\n }\n else if ((m = pattern.match(starDotStarRE))) {\n fastTest = options.dot ? starDotStarTestDot : starDotStarTest;\n }\n else if ((m = pattern.match(dotStarRE))) {\n fastTest = dotStarTest;\n }\n const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();\n if (fastTest && typeof re === 'object') {\n // Avoids overriding in frozen environments\n Reflect.defineProperty(re, 'test', { value: fastTest });\n }\n return re;\n }\n makeRe() {\n if (this.regexp || this.regexp === false)\n return this.regexp;\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set;\n if (!set.length) {\n this.regexp = false;\n return this.regexp;\n }\n const options = this.options;\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot;\n const flags = new Set(options.nocase ? ['i'] : []);\n // regexpify non-globstar patterns\n // if ** is only item, then we just do one twoStar\n // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if ** is last, append (\\/twoStar|) to previous\n // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set\n .map(pattern => {\n const pp = pattern.map(p => {\n if (p instanceof RegExp) {\n for (const f of p.flags.split(''))\n flags.add(f);\n }\n return (typeof p === 'string' ? regExpEscape(p)\n : p === exports.GLOBSTAR ? exports.GLOBSTAR\n : p._src);\n });\n pp.forEach((p, i) => {\n const next = pp[i + 1];\n const prev = pp[i - 1];\n if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {\n return;\n }\n if (prev === undefined) {\n if (next !== undefined && next !== exports.GLOBSTAR) {\n pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next;\n }\n else {\n pp[i] = twoStar;\n }\n }\n else if (next === undefined) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?';\n }\n else if (next !== exports.GLOBSTAR) {\n pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next;\n pp[i + 1] = exports.GLOBSTAR;\n }\n });\n const filtered = pp.filter(p => p !== exports.GLOBSTAR);\n // For partial matches, we need to make the pattern match\n // any prefix of the full path. We do this by generating\n // alternative patterns that match progressively longer prefixes.\n if (this.partial && filtered.length >= 1) {\n const prefixes = [];\n for (let i = 1; i <= filtered.length; i++) {\n prefixes.push(filtered.slice(0, i).join('/'));\n }\n return '(?:' + prefixes.join('|') + ')';\n }\n return filtered.join('/');\n })\n .join('|');\n // need to wrap in parens if we had more than one thing with |,\n // otherwise only the first will be anchored to ^ and the last to $\n const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^' + open + re + close + '$';\n // In partial mode, '/' should always match as it's a valid prefix for any pattern\n if (this.partial) {\n re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$';\n }\n // can match anything, as long as it's not this.\n if (this.negate)\n re = '^(?!' + re + ').+$';\n try {\n this.regexp = new RegExp(re, [...flags].join(''));\n /* c8 ignore start */\n }\n catch {\n // should be impossible\n this.regexp = false;\n }\n /* c8 ignore stop */\n return this.regexp;\n }\n slashSplit(p) {\n // if p starts with // on windows, we preserve that\n // so that UNC paths aren't broken. Otherwise, any number of\n // / characters are coalesced into one, unless\n // preserveMultipleSlashes is set to true.\n if (this.preserveMultipleSlashes) {\n return p.split('/');\n }\n else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n // add an extra '' for the one we lose\n return ['', ...p.split(/\\/+/)];\n }\n else {\n return p.split(/\\/+/);\n }\n }\n match(f, partial = this.partial) {\n this.debug('match', f, this.pattern);\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) {\n return false;\n }\n if (this.empty) {\n return f === '';\n }\n if (f === '/' && partial) {\n return true;\n }\n const options = this.options;\n // windows: need to use /, not \\\n if (this.isWindows) {\n f = f.split('\\\\').join('/');\n }\n // treat the test path as a set of pathparts.\n const ff = this.slashSplit(f);\n this.debug(this.pattern, 'split', ff);\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n const set = this.set;\n this.debug(this.pattern, 'set', set);\n // Find the basename of the path by looking for the last non-empty segment\n let filename = ff[ff.length - 1];\n if (!filename) {\n for (let i = ff.length - 2; !filename && i >= 0; i--) {\n filename = ff[i];\n }\n }\n for (const pattern of set) {\n let file = ff;\n if (options.matchBase && pattern.length === 1) {\n file = [filename];\n }\n const hit = this.matchOne(file, pattern, partial);\n if (hit) {\n if (options.flipNegate) {\n return true;\n }\n return !this.negate;\n }\n }\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) {\n return false;\n }\n return this.negate;\n }\n static defaults(def) {\n return exports.minimatch.defaults(def).Minimatch;\n }\n}\nexports.Minimatch = Minimatch;\n/* c8 ignore start */\nvar ast_js_2 = require(\"./ast.js\");\nObject.defineProperty(exports, \"AST\", { enumerable: true, get: function () { return ast_js_2.AST; } });\nvar escape_js_2 = require(\"./escape.js\");\nObject.defineProperty(exports, \"escape\", { enumerable: true, get: function () { return escape_js_2.escape; } });\nvar unescape_js_2 = require(\"./unescape.js\");\nObject.defineProperty(exports, \"unescape\", { enumerable: true, get: function () { return unescape_js_2.unescape; } });\n/* c8 ignore stop */\nexports.minimatch.AST = ast_js_1.AST;\nexports.minimatch.Minimatch = Minimatch;\nexports.minimatch.escape = escape_js_1.escape;\nexports.minimatch.unescape = unescape_js_1.unescape;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unescape = void 0;\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\nconst unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1');\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1');\n};\nexports.unescape = unescape;\n//# sourceMappingURL=unescape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.range = exports.balanced = void 0;\nconst balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nexports.balanced = balanced;\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nconst range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\nexports.range = range;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EXPANSION_MAX = void 0;\nexports.expand = expand;\nconst balanced_match_1 = require(\"balanced-match\");\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexports.EXPANSION_MAX = 100_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n if (!str) {\n return [''];\n }\n const parts = [];\n const m = (0, balanced_match_1.balanced)('{', '}', str);\n if (!m) {\n return str.split(',');\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[p.length - 1] += '{' + body + '}';\n const postParts = parseCommaParts(post);\n if (post.length) {\n ;\n p[p.length - 1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n parts.push.apply(parts, p);\n return parts;\n}\nfunction expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = exports.EXPANSION_MAX } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\nfunction expand_(str, max, isTop) {\n /** @type {string[]} */\n const expansions = [];\n const m = (0, balanced_match_1.balanced)('{', '}', str);\n if (!m)\n return [str];\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n const post = m.post.length ? expand_(m.post, max, false) : [''];\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n }\n else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand_(str, max, true);\n }\n return [str];\n }\n let n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n }\n else {\n n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p);\n }\n /* c8 ignore stop */\n }\n }\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N;\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n N = [];\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n N.push(c);\n }\n }\n else {\n N = [];\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j], max, false));\n }\n }\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion);\n }\n }\n }\n }\n return expansions;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Minipass = exports.isWritable = exports.isReadable = exports.isStream = void 0;\nconst proc = typeof process === 'object' && process\n ? process\n : {\n stdout: null,\n stderr: null,\n };\nconst node_events_1 = require(\"node:events\");\nconst node_stream_1 = __importDefault(require(\"node:stream\"));\nconst node_string_decoder_1 = require(\"node:string_decoder\");\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nconst isStream = (s) => !!s &&\n typeof s === 'object' &&\n (s instanceof Minipass ||\n s instanceof node_stream_1.default ||\n (0, exports.isReadable)(s) ||\n (0, exports.isWritable)(s))\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\n;\nexports.isStream = isStream;\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nconst isReadable = (s) => !!s &&\n typeof s === 'object' &&\n s instanceof node_events_1.EventEmitter &&\n typeof s.pipe === 'function' &&\n // node core Writable streams have a pipe() method, but it throws\n s.pipe !== node_stream_1.default.Writable.prototype.pipe\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\n;\nexports.isReadable = isReadable;\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nconst isWritable = (s) => !!s &&\n typeof s === 'object' &&\n s instanceof node_events_1.EventEmitter &&\n typeof s.write === 'function' &&\n typeof s.end === 'function';\nexports.isWritable = isWritable;\nconst EOF = Symbol('EOF');\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd');\nconst EMITTED_END = Symbol('emittedEnd');\nconst EMITTING_END = Symbol('emittingEnd');\nconst EMITTED_ERROR = Symbol('emittedError');\nconst CLOSED = Symbol('closed');\nconst READ = Symbol('read');\nconst FLUSH = Symbol('flush');\nconst FLUSHCHUNK = Symbol('flushChunk');\nconst ENCODING = Symbol('encoding');\nconst DECODER = Symbol('decoder');\nconst FLOWING = Symbol('flowing');\nconst PAUSED = Symbol('paused');\nconst RESUME = Symbol('resume');\nconst BUFFER = Symbol('buffer');\nconst PIPES = Symbol('pipes');\nconst BUFFERLENGTH = Symbol('bufferLength');\nconst BUFFERPUSH = Symbol('bufferPush');\nconst BUFFERSHIFT = Symbol('bufferShift');\nconst OBJECTMODE = Symbol('objectMode');\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed');\n// internal event when stream has an error\nconst ERROR = Symbol('error');\nconst EMITDATA = Symbol('emitData');\nconst EMITEND = Symbol('emitEnd');\nconst EMITEND2 = Symbol('emitEnd2');\nconst ASYNC = Symbol('async');\nconst ABORT = Symbol('abort');\nconst ABORTED = Symbol('aborted');\nconst SIGNAL = Symbol('signal');\nconst DATALISTENERS = Symbol('dataListeners');\nconst DISCARDED = Symbol('discarded');\nconst defer = (fn) => Promise.resolve().then(fn);\nconst nodefer = (fn) => fn();\nconst isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';\nconst isArrayBufferLike = (b) => b instanceof ArrayBuffer ||\n (!!b &&\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0);\nconst isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n src;\n dest;\n opts;\n ondrain;\n constructor(src, dest, opts) {\n this.src = src;\n this.dest = dest;\n this.opts = opts;\n this.ondrain = () => src[RESUME]();\n this.dest.on('drain', this.ondrain);\n }\n unpipe() {\n this.dest.removeListener('drain', this.ondrain);\n }\n // only here for the prototype\n /* c8 ignore start */\n proxyErrors(_er) { }\n /* c8 ignore stop */\n end() {\n this.unpipe();\n if (this.opts.end)\n this.dest.end();\n }\n}\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n unpipe() {\n this.src.removeListener('error', this.proxyErrors);\n super.unpipe();\n }\n constructor(src, dest, opts) {\n super(src, dest, opts);\n this.proxyErrors = (er) => this.dest.emit('error', er);\n src.on('error', this.proxyErrors);\n }\n}\nconst isObjectModeOptions = (o) => !!o.objectMode;\nconst isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nclass Minipass extends node_events_1.EventEmitter {\n [FLOWING] = false;\n [PAUSED] = false;\n [PIPES] = [];\n [BUFFER] = [];\n [OBJECTMODE];\n [ENCODING];\n [ASYNC];\n [DECODER];\n [EOF] = false;\n [EMITTED_END] = false;\n [EMITTING_END] = false;\n [CLOSED] = false;\n [EMITTED_ERROR] = null;\n [BUFFERLENGTH] = 0;\n [DESTROYED] = false;\n [SIGNAL];\n [ABORTED] = false;\n [DATALISTENERS] = 0;\n [DISCARDED] = false;\n /**\n * true if the stream can be written\n */\n writable = true;\n /**\n * true if the stream can be read\n */\n readable = true;\n /**\n * If `RType` is Buffer, then options do not need to be provided.\n * Otherwise, an options object must be provided to specify either\n * {@link Minipass.SharedOptions.objectMode} or\n * {@link Minipass.SharedOptions.encoding}, as appropriate.\n */\n constructor(...args) {\n const options = (args[0] ||\n {});\n super();\n if (options.objectMode && typeof options.encoding === 'string') {\n throw new TypeError('Encoding and objectMode may not be used together');\n }\n if (isObjectModeOptions(options)) {\n this[OBJECTMODE] = true;\n this[ENCODING] = null;\n }\n else if (isEncodingOptions(options)) {\n this[ENCODING] = options.encoding;\n this[OBJECTMODE] = false;\n }\n else {\n this[OBJECTMODE] = false;\n this[ENCODING] = null;\n }\n this[ASYNC] = !!options.async;\n this[DECODER] = this[ENCODING]\n ? new node_string_decoder_1.StringDecoder(this[ENCODING])\n : null;\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposeBuffer === true) {\n Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });\n }\n //@ts-ignore - private option for debugging and testing\n if (options && options.debugExposePipes === true) {\n Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });\n }\n const { signal } = options;\n if (signal) {\n this[SIGNAL] = signal;\n if (signal.aborted) {\n this[ABORT]();\n }\n else {\n signal.addEventListener('abort', () => this[ABORT]());\n }\n }\n }\n /**\n * The amount of data stored in the buffer waiting to be read.\n *\n * For Buffer strings, this will be the total byte length.\n * For string encoding streams, this will be the string character length,\n * according to JavaScript's `string.length` logic.\n * For objectMode streams, this is a count of the items waiting to be\n * emitted.\n */\n get bufferLength() {\n return this[BUFFERLENGTH];\n }\n /**\n * The `BufferEncoding` currently in use, or `null`\n */\n get encoding() {\n return this[ENCODING];\n }\n /**\n * @deprecated - This is a read only property\n */\n set encoding(_enc) {\n throw new Error('Encoding must be set at instantiation time');\n }\n /**\n * @deprecated - Encoding may only be set at instantiation time\n */\n setEncoding(_enc) {\n throw new Error('Encoding must be set at instantiation time');\n }\n /**\n * True if this is an objectMode stream\n */\n get objectMode() {\n return this[OBJECTMODE];\n }\n /**\n * @deprecated - This is a read-only property\n */\n set objectMode(_om) {\n throw new Error('objectMode must be set at instantiation time');\n }\n /**\n * true if this is an async stream\n */\n get ['async']() {\n return this[ASYNC];\n }\n /**\n * Set to true to make this stream async.\n *\n * Once set, it cannot be unset, as this would potentially cause incorrect\n * behavior. Ie, a sync stream can be made async, but an async stream\n * cannot be safely made sync.\n */\n set ['async'](a) {\n this[ASYNC] = this[ASYNC] || !!a;\n }\n // drop everything and get out of the flow completely\n [ABORT]() {\n this[ABORTED] = true;\n this.emit('abort', this[SIGNAL]?.reason);\n this.destroy(this[SIGNAL]?.reason);\n }\n /**\n * True if the stream has been aborted.\n */\n get aborted() {\n return this[ABORTED];\n }\n /**\n * No-op setter. Stream aborted status is set via the AbortSignal provided\n * in the constructor options.\n */\n set aborted(_) { }\n write(chunk, encoding, cb) {\n if (this[ABORTED])\n return false;\n if (this[EOF])\n throw new Error('write after end');\n if (this[DESTROYED]) {\n this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));\n return true;\n }\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = 'utf8';\n }\n if (!encoding)\n encoding = 'utf8';\n const fn = this[ASYNC] ? defer : nodefer;\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything is only allowed if in object mode, so throw\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n }\n else if (isArrayBufferLike(chunk)) {\n //@ts-ignore - sinful unsafe type changing\n chunk = Buffer.from(chunk);\n }\n else if (typeof chunk !== 'string') {\n throw new Error('Non-contiguous data written to non-objectMode stream');\n }\n }\n // handle object mode up front, since it's simpler\n // this yields better performance, fewer checks later.\n if (this[OBJECTMODE]) {\n // maybe impossible?\n /* c8 ignore start */\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0)\n this[FLUSH](true);\n /* c8 ignore stop */\n if (this[FLOWING])\n this.emit('data', chunk);\n else\n this[BUFFERPUSH](chunk);\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable');\n if (cb)\n fn(cb);\n return this[FLOWING];\n }\n // at this point the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!chunk.length) {\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable');\n if (cb)\n fn(cb);\n return this[FLOWING];\n }\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (typeof chunk === 'string' &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {\n //@ts-ignore - sinful unsafe type change\n chunk = Buffer.from(chunk, encoding);\n }\n if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n //@ts-ignore - sinful unsafe type change\n chunk = this[DECODER].write(chunk);\n }\n // Note: flushing CAN potentially switch us into not-flowing mode\n if (this[FLOWING] && this[BUFFERLENGTH] !== 0)\n this[FLUSH](true);\n if (this[FLOWING])\n this.emit('data', chunk);\n else\n this[BUFFERPUSH](chunk);\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable');\n if (cb)\n fn(cb);\n return this[FLOWING];\n }\n /**\n * Low-level explicit read method.\n *\n * In objectMode, the argument is ignored, and one item is returned if\n * available.\n *\n * `n` is the number of bytes (or in the case of encoding streams,\n * characters) to consume. If `n` is not provided, then the entire buffer\n * is returned, or `null` is returned if no data is available.\n *\n * If `n` is greater that the amount of data in the internal buffer,\n * then `null` is returned.\n */\n read(n) {\n if (this[DESTROYED])\n return null;\n this[DISCARDED] = false;\n if (this[BUFFERLENGTH] === 0 ||\n n === 0 ||\n (n && n > this[BUFFERLENGTH])) {\n this[MAYBE_EMIT_END]();\n return null;\n }\n if (this[OBJECTMODE])\n n = null;\n if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n // not object mode, so if we have an encoding, then RType is string\n // otherwise, must be Buffer\n this[BUFFER] = [\n (this[ENCODING]\n ? this[BUFFER].join('')\n : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),\n ];\n }\n const ret = this[READ](n || null, this[BUFFER][0]);\n this[MAYBE_EMIT_END]();\n return ret;\n }\n [READ](n, chunk) {\n if (this[OBJECTMODE])\n this[BUFFERSHIFT]();\n else {\n const c = chunk;\n if (n === c.length || n === null)\n this[BUFFERSHIFT]();\n else if (typeof c === 'string') {\n this[BUFFER][0] = c.slice(n);\n chunk = c.slice(0, n);\n this[BUFFERLENGTH] -= n;\n }\n else {\n this[BUFFER][0] = c.subarray(n);\n chunk = c.subarray(0, n);\n this[BUFFERLENGTH] -= n;\n }\n }\n this.emit('data', chunk);\n if (!this[BUFFER].length && !this[EOF])\n this.emit('drain');\n return chunk;\n }\n end(chunk, encoding, cb) {\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = undefined;\n }\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = 'utf8';\n }\n if (chunk !== undefined)\n this.write(chunk, encoding);\n if (cb)\n this.once('end', cb);\n this[EOF] = true;\n this.writable = false;\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this[FLOWING] || !this[PAUSED])\n this[MAYBE_EMIT_END]();\n return this;\n }\n // don't let the internal resume be overwritten\n [RESUME]() {\n if (this[DESTROYED])\n return;\n if (!this[DATALISTENERS] && !this[PIPES].length) {\n this[DISCARDED] = true;\n }\n this[PAUSED] = false;\n this[FLOWING] = true;\n this.emit('resume');\n if (this[BUFFER].length)\n this[FLUSH]();\n else if (this[EOF])\n this[MAYBE_EMIT_END]();\n else\n this.emit('drain');\n }\n /**\n * Resume the stream if it is currently in a paused state\n *\n * If called when there are no pipe destinations or `data` event listeners,\n * this will place the stream in a \"discarded\" state, where all data will\n * be thrown away. The discarded state is removed if a pipe destination or\n * data handler is added, if pause() is called, or if any synchronous or\n * asynchronous iteration is started.\n */\n resume() {\n return this[RESUME]();\n }\n /**\n * Pause the stream\n */\n pause() {\n this[FLOWING] = false;\n this[PAUSED] = true;\n this[DISCARDED] = false;\n }\n /**\n * true if the stream has been forcibly destroyed\n */\n get destroyed() {\n return this[DESTROYED];\n }\n /**\n * true if the stream is currently in a flowing state, meaning that\n * any writes will be immediately emitted.\n */\n get flowing() {\n return this[FLOWING];\n }\n /**\n * true if the stream is currently in a paused state\n */\n get paused() {\n return this[PAUSED];\n }\n [BUFFERPUSH](chunk) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] += 1;\n else\n this[BUFFERLENGTH] += chunk.length;\n this[BUFFER].push(chunk);\n }\n [BUFFERSHIFT]() {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] -= 1;\n else\n this[BUFFERLENGTH] -= this[BUFFER][0].length;\n return this[BUFFER].shift();\n }\n [FLUSH](noDrain = false) {\n do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n this[BUFFER].length);\n if (!noDrain && !this[BUFFER].length && !this[EOF])\n this.emit('drain');\n }\n [FLUSHCHUNK](chunk) {\n this.emit('data', chunk);\n return this[FLOWING];\n }\n /**\n * Pipe all data emitted by this stream into the destination provided.\n *\n * Triggers the flow of data.\n */\n pipe(dest, opts) {\n if (this[DESTROYED])\n return dest;\n this[DISCARDED] = false;\n const ended = this[EMITTED_END];\n opts = opts || {};\n if (dest === proc.stdout || dest === proc.stderr)\n opts.end = false;\n else\n opts.end = opts.end !== false;\n opts.proxyErrors = !!opts.proxyErrors;\n // piping an ended stream ends immediately\n if (ended) {\n if (opts.end)\n dest.end();\n }\n else {\n // \"as\" here just ignores the WType, which pipes don't care about,\n // since they're only consuming from us, and writing to the dest\n this[PIPES].push(!opts.proxyErrors\n ? new Pipe(this, dest, opts)\n : new PipeProxyErrors(this, dest, opts));\n if (this[ASYNC])\n defer(() => this[RESUME]());\n else\n this[RESUME]();\n }\n return dest;\n }\n /**\n * Fully unhook a piped destination stream.\n *\n * If the destination stream was the only consumer of this stream (ie,\n * there are no other piped destinations or `'data'` event listeners)\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n unpipe(dest) {\n const p = this[PIPES].find(p => p.dest === dest);\n if (p) {\n if (this[PIPES].length === 1) {\n if (this[FLOWING] && this[DATALISTENERS] === 0) {\n this[FLOWING] = false;\n }\n this[PIPES] = [];\n }\n else\n this[PIPES].splice(this[PIPES].indexOf(p), 1);\n p.unpipe();\n }\n }\n /**\n * Alias for {@link Minipass#on}\n */\n addListener(ev, handler) {\n return this.on(ev, handler);\n }\n /**\n * Mostly identical to `EventEmitter.on`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * - Adding a 'data' event handler will trigger the flow of data\n *\n * - Adding a 'readable' event handler when there is data waiting to be read\n * will cause 'readable' to be emitted immediately.\n *\n * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n * already passed will cause the event to be emitted immediately and all\n * handlers removed.\n *\n * - Adding an 'error' event handler after an error has been emitted will\n * cause the event to be re-emitted immediately with the error previously\n * raised.\n */\n on(ev, handler) {\n const ret = super.on(ev, handler);\n if (ev === 'data') {\n this[DISCARDED] = false;\n this[DATALISTENERS]++;\n if (!this[PIPES].length && !this[FLOWING]) {\n this[RESUME]();\n }\n }\n else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n super.emit('readable');\n }\n else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev);\n this.removeAllListeners(ev);\n }\n else if (ev === 'error' && this[EMITTED_ERROR]) {\n const h = handler;\n if (this[ASYNC])\n defer(() => h.call(this, this[EMITTED_ERROR]));\n else\n h.call(this, this[EMITTED_ERROR]);\n }\n return ret;\n }\n /**\n * Alias for {@link Minipass#off}\n */\n removeListener(ev, handler) {\n return this.off(ev, handler);\n }\n /**\n * Mostly identical to `EventEmitter.off`\n *\n * If a 'data' event handler is removed, and it was the last consumer\n * (ie, there are no pipe destinations or other 'data' event listeners),\n * then the flow of data will stop until there is another consumer or\n * {@link Minipass#resume} is explicitly called.\n */\n off(ev, handler) {\n const ret = super.off(ev, handler);\n // if we previously had listeners, and now we don't, and we don't\n // have any pipes, then stop the flow, unless it's been explicitly\n // put in a discarded flowing state via stream.resume().\n if (ev === 'data') {\n this[DATALISTENERS] = this.listeners('data').length;\n if (this[DATALISTENERS] === 0 &&\n !this[DISCARDED] &&\n !this[PIPES].length) {\n this[FLOWING] = false;\n }\n }\n return ret;\n }\n /**\n * Mostly identical to `EventEmitter.removeAllListeners`\n *\n * If all 'data' event handlers are removed, and they were the last consumer\n * (ie, there are no pipe destinations), then the flow of data will stop\n * until there is another consumer or {@link Minipass#resume} is explicitly\n * called.\n */\n removeAllListeners(ev) {\n const ret = super.removeAllListeners(ev);\n if (ev === 'data' || ev === undefined) {\n this[DATALISTENERS] = 0;\n if (!this[DISCARDED] && !this[PIPES].length) {\n this[FLOWING] = false;\n }\n }\n return ret;\n }\n /**\n * true if the 'end' event has been emitted\n */\n get emittedEnd() {\n return this[EMITTED_END];\n }\n [MAYBE_EMIT_END]() {\n if (!this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this[BUFFER].length === 0 &&\n this[EOF]) {\n this[EMITTING_END] = true;\n this.emit('end');\n this.emit('prefinish');\n this.emit('finish');\n if (this[CLOSED])\n this.emit('close');\n this[EMITTING_END] = false;\n }\n }\n /**\n * Mostly identical to `EventEmitter.emit`, with the following\n * behavior differences to prevent data loss and unnecessary hangs:\n *\n * If the stream has been destroyed, and the event is something other\n * than 'close' or 'error', then `false` is returned and no handlers\n * are called.\n *\n * If the event is 'end', and has already been emitted, then the event\n * is ignored. If the stream is in a paused or non-flowing state, then\n * the event will be deferred until data flow resumes. If the stream is\n * async, then handlers will be called on the next tick rather than\n * immediately.\n *\n * If the event is 'close', and 'end' has not yet been emitted, then\n * the event will be deferred until after 'end' is emitted.\n *\n * If the event is 'error', and an AbortSignal was provided for the stream,\n * and there are no listeners, then the event is ignored, matching the\n * behavior of node core streams in the presense of an AbortSignal.\n *\n * If the event is 'finish' or 'prefinish', then all listeners will be\n * removed after emitting the event, to prevent double-firing.\n */\n emit(ev, ...args) {\n const data = args[0];\n // error and close are only events allowed after calling destroy()\n if (ev !== 'error' &&\n ev !== 'close' &&\n ev !== DESTROYED &&\n this[DESTROYED]) {\n return false;\n }\n else if (ev === 'data') {\n return !this[OBJECTMODE] && !data\n ? false\n : this[ASYNC]\n ? (defer(() => this[EMITDATA](data)), true)\n : this[EMITDATA](data);\n }\n else if (ev === 'end') {\n return this[EMITEND]();\n }\n else if (ev === 'close') {\n this[CLOSED] = true;\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED])\n return false;\n const ret = super.emit('close');\n this.removeAllListeners('close');\n return ret;\n }\n else if (ev === 'error') {\n this[EMITTED_ERROR] = data;\n super.emit(ERROR, data);\n const ret = !this[SIGNAL] || this.listeners('error').length\n ? super.emit('error', data)\n : false;\n this[MAYBE_EMIT_END]();\n return ret;\n }\n else if (ev === 'resume') {\n const ret = super.emit('resume');\n this[MAYBE_EMIT_END]();\n return ret;\n }\n else if (ev === 'finish' || ev === 'prefinish') {\n const ret = super.emit(ev);\n this.removeAllListeners(ev);\n return ret;\n }\n // Some other unknown event\n const ret = super.emit(ev, ...args);\n this[MAYBE_EMIT_END]();\n return ret;\n }\n [EMITDATA](data) {\n for (const p of this[PIPES]) {\n if (p.dest.write(data) === false)\n this.pause();\n }\n const ret = this[DISCARDED] ? false : super.emit('data', data);\n this[MAYBE_EMIT_END]();\n return ret;\n }\n [EMITEND]() {\n if (this[EMITTED_END])\n return false;\n this[EMITTED_END] = true;\n this.readable = false;\n return this[ASYNC]\n ? (defer(() => this[EMITEND2]()), true)\n : this[EMITEND2]();\n }\n [EMITEND2]() {\n if (this[DECODER]) {\n const data = this[DECODER].end();\n if (data) {\n for (const p of this[PIPES]) {\n p.dest.write(data);\n }\n if (!this[DISCARDED])\n super.emit('data', data);\n }\n }\n for (const p of this[PIPES]) {\n p.end();\n }\n const ret = super.emit('end');\n this.removeAllListeners('end');\n return ret;\n }\n /**\n * Return a Promise that resolves to an array of all emitted data once\n * the stream ends.\n */\n async collect() {\n const buf = Object.assign([], {\n dataLength: 0,\n });\n if (!this[OBJECTMODE])\n buf.dataLength = 0;\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise();\n this.on('data', c => {\n buf.push(c);\n if (!this[OBJECTMODE])\n buf.dataLength += c.length;\n });\n await p;\n return buf;\n }\n /**\n * Return a Promise that resolves to the concatenation of all emitted data\n * once the stream ends.\n *\n * Not allowed on objectMode streams.\n */\n async concat() {\n if (this[OBJECTMODE]) {\n throw new Error('cannot concat in objectMode');\n }\n const buf = await this.collect();\n return (this[ENCODING]\n ? buf.join('')\n : Buffer.concat(buf, buf.dataLength));\n }\n /**\n * Return a void Promise that resolves once the stream ends.\n */\n async promise() {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')));\n this.on('error', er => reject(er));\n this.on('end', () => resolve());\n });\n }\n /**\n * Asynchronous `for await of` iteration.\n *\n * This will continue emitting all chunks until the stream terminates.\n */\n [Symbol.asyncIterator]() {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false;\n let stopped = false;\n const stop = async () => {\n this.pause();\n stopped = true;\n return { value: undefined, done: true };\n };\n const next = () => {\n if (stopped)\n return stop();\n const res = this.read();\n if (res !== null)\n return Promise.resolve({ done: false, value: res });\n if (this[EOF])\n return stop();\n let resolve;\n let reject;\n const onerr = (er) => {\n this.off('data', ondata);\n this.off('end', onend);\n this.off(DESTROYED, ondestroy);\n stop();\n reject(er);\n };\n const ondata = (value) => {\n this.off('error', onerr);\n this.off('end', onend);\n this.off(DESTROYED, ondestroy);\n this.pause();\n resolve({ value, done: !!this[EOF] });\n };\n const onend = () => {\n this.off('error', onerr);\n this.off('data', ondata);\n this.off(DESTROYED, ondestroy);\n stop();\n resolve({ done: true, value: undefined });\n };\n const ondestroy = () => onerr(new Error('stream destroyed'));\n return new Promise((res, rej) => {\n reject = rej;\n resolve = res;\n this.once(DESTROYED, ondestroy);\n this.once('error', onerr);\n this.once('end', onend);\n this.once('data', ondata);\n });\n };\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.asyncIterator]() {\n return this;\n },\n [Symbol.asyncDispose]: async () => { },\n };\n }\n /**\n * Synchronous `for of` iteration.\n *\n * The iteration will terminate when the internal buffer runs out, even\n * if the stream has not yet terminated.\n */\n [Symbol.iterator]() {\n // set this up front, in case the consumer doesn't call next()\n // right away.\n this[DISCARDED] = false;\n let stopped = false;\n const stop = () => {\n this.pause();\n this.off(ERROR, stop);\n this.off(DESTROYED, stop);\n this.off('end', stop);\n stopped = true;\n return { done: true, value: undefined };\n };\n const next = () => {\n if (stopped)\n return stop();\n const value = this.read();\n return value === null ? stop() : { done: false, value };\n };\n this.once('end', stop);\n this.once(ERROR, stop);\n this.once(DESTROYED, stop);\n return {\n next,\n throw: stop,\n return: stop,\n [Symbol.iterator]() {\n return this;\n },\n [Symbol.dispose]: () => { },\n };\n }\n /**\n * Destroy a stream, preventing it from being used for any further purpose.\n *\n * If the stream has a `close()` method, then it will be called on\n * destruction.\n *\n * After destruction, any attempt to write data, read data, or emit most\n * events will be ignored.\n *\n * If an error argument is provided, then it will be emitted in an\n * 'error' event.\n */\n destroy(er) {\n if (this[DESTROYED]) {\n if (er)\n this.emit('error', er);\n else\n this.emit(DESTROYED);\n return this;\n }\n this[DESTROYED] = true;\n this[DISCARDED] = true;\n // throw away all buffered data, it's never coming out\n this[BUFFER].length = 0;\n this[BUFFERLENGTH] = 0;\n const wc = this;\n if (typeof wc.close === 'function' && !this[CLOSED])\n wc.close();\n if (er)\n this.emit('error', er);\n // if no error to emit, still reject pending promises\n else\n this.emit(DESTROYED);\n return this;\n }\n /**\n * Alias for {@link isStream}\n *\n * Former export location, maintained for backwards compatibility.\n *\n * @deprecated\n */\n static get isStream() {\n return exports.isStream;\n }\n}\nexports.Minipass = Minipass;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0;\nconst lru_cache_1 = require(\"lru-cache\");\nconst node_path_1 = require(\"node:path\");\nconst node_url_1 = require(\"node:url\");\nconst fs_1 = require(\"fs\");\nconst actualFS = __importStar(require(\"node:fs\"));\nconst realpathSync = fs_1.realpathSync.native;\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\nconst promises_1 = require(\"node:fs/promises\");\nconst minipass_1 = require(\"minipass\");\nconst defaultFS = {\n lstatSync: fs_1.lstatSync,\n readdir: fs_1.readdir,\n readdirSync: fs_1.readdirSync,\n readlinkSync: fs_1.readlinkSync,\n realpathSync,\n promises: {\n lstat: promises_1.lstat,\n readdir: promises_1.readdir,\n readlink: promises_1.readlink,\n realpath: promises_1.realpath,\n },\n};\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n defaultFS\n : {\n ...defaultFS,\n ...fsOption,\n promises: {\n ...defaultFS.promises,\n ...(fsOption.promises || {}),\n },\n };\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i;\nconst uncToDrive = (rootPath) => rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\');\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/;\nconst UNKNOWN = 0; // may not even exist, for all we know\nconst IFIFO = 0b0001;\nconst IFCHR = 0b0010;\nconst IFDIR = 0b0100;\nconst IFBLK = 0b0110;\nconst IFREG = 0b1000;\nconst IFLNK = 0b1010;\nconst IFSOCK = 0b1100;\nconst IFMT = 0b1111;\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT;\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000;\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000;\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000;\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000;\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000;\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000;\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;\nconst TYPEMASK = 0b0011_1111_1111;\nconst entToType = (s) => s.isFile() ? IFREG\n : s.isDirectory() ? IFDIR\n : s.isSymbolicLink() ? IFLNK\n : s.isCharacterDevice() ? IFCHR\n : s.isBlockDevice() ? IFBLK\n : s.isSocket() ? IFSOCK\n : s.isFIFO() ? IFIFO\n : UNKNOWN;\n// normalize unicode path names\nconst normalizeCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });\nconst normalize = (s) => {\n const c = normalizeCache.get(s);\n if (c)\n return c;\n const n = s.normalize('NFKD');\n normalizeCache.set(s, n);\n return n;\n};\nconst normalizeNocaseCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });\nconst normalizeNocase = (s) => {\n const c = normalizeNocaseCache.get(s);\n if (c)\n return c;\n const n = normalize(s.toLowerCase());\n normalizeNocaseCache.set(s, n);\n return n;\n};\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nclass ResolveCache extends lru_cache_1.LRUCache {\n constructor() {\n super({ max: 256 });\n }\n}\nexports.ResolveCache = ResolveCache;\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent. At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache. This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nclass ChildrenCache extends lru_cache_1.LRUCache {\n constructor(maxSize = 16 * 1024) {\n super({\n maxSize,\n // parent + children\n sizeCalculation: a => a.length + 1,\n });\n }\n}\nexports.ChildrenCache = ChildrenCache;\nconst setAsCwd = Symbol('PathScurry setAsCwd');\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nclass PathBase {\n /**\n * the basename of this path\n *\n * **Important**: *always* test the path name against any test string\n * usingthe {@link isNamed} method, and not by directly comparing this\n * string. Otherwise, unicode path strings that the system sees as identical\n * will not be properly treated as the same path, leading to incorrect\n * behavior and possible security issues.\n */\n name;\n /**\n * the Path entry corresponding to the path root.\n *\n * @internal\n */\n root;\n /**\n * All roots found within the current PathScurry family\n *\n * @internal\n */\n roots;\n /**\n * a reference to the parent path, or undefined in the case of root entries\n *\n * @internal\n */\n parent;\n /**\n * boolean indicating whether paths are compared case-insensitively\n * @internal\n */\n nocase;\n /**\n * boolean indicating that this path is the current working directory\n * of the PathScurry collection that contains it.\n */\n isCWD = false;\n // potential default fs override\n #fs;\n // Stats fields\n #dev;\n get dev() {\n return this.#dev;\n }\n #mode;\n get mode() {\n return this.#mode;\n }\n #nlink;\n get nlink() {\n return this.#nlink;\n }\n #uid;\n get uid() {\n return this.#uid;\n }\n #gid;\n get gid() {\n return this.#gid;\n }\n #rdev;\n get rdev() {\n return this.#rdev;\n }\n #blksize;\n get blksize() {\n return this.#blksize;\n }\n #ino;\n get ino() {\n return this.#ino;\n }\n #size;\n get size() {\n return this.#size;\n }\n #blocks;\n get blocks() {\n return this.#blocks;\n }\n #atimeMs;\n get atimeMs() {\n return this.#atimeMs;\n }\n #mtimeMs;\n get mtimeMs() {\n return this.#mtimeMs;\n }\n #ctimeMs;\n get ctimeMs() {\n return this.#ctimeMs;\n }\n #birthtimeMs;\n get birthtimeMs() {\n return this.#birthtimeMs;\n }\n #atime;\n get atime() {\n return this.#atime;\n }\n #mtime;\n get mtime() {\n return this.#mtime;\n }\n #ctime;\n get ctime() {\n return this.#ctime;\n }\n #birthtime;\n get birthtime() {\n return this.#birthtime;\n }\n #matchName;\n #depth;\n #fullpath;\n #fullpathPosix;\n #relative;\n #relativePosix;\n #type;\n #children;\n #linkTarget;\n #realpath;\n /**\n * This property is for compatibility with the Dirent class as of\n * Node v20, where Dirent['parentPath'] refers to the path of the\n * directory that was passed to readdir. For root entries, it's the path\n * to the entry itself.\n */\n get parentPath() {\n return (this.parent || this).fullpath();\n }\n /* c8 ignore start */\n /**\n * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n * this property refers to the *parent* path, not the path object itself.\n *\n * @deprecated\n */\n get path() {\n return this.parentPath;\n }\n /* c8 ignore stop */\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {\n this.name = name;\n this.#matchName = nocase ? normalizeNocase(name) : normalize(name);\n this.#type = type & TYPEMASK;\n this.nocase = nocase;\n this.roots = roots;\n this.root = root || this;\n this.#children = children;\n this.#fullpath = opts.fullpath;\n this.#relative = opts.relative;\n this.#relativePosix = opts.relativePosix;\n this.parent = opts.parent;\n if (this.parent) {\n this.#fs = this.parent.#fs;\n }\n else {\n this.#fs = fsFromOption(opts.fs);\n }\n }\n /**\n * Returns the depth of the Path object from its root.\n *\n * For example, a path at `/foo/bar` would have a depth of 2.\n */\n depth() {\n if (this.#depth !== undefined)\n return this.#depth;\n if (!this.parent)\n return (this.#depth = 0);\n return (this.#depth = this.parent.depth() + 1);\n }\n /**\n * @internal\n */\n childrenCache() {\n return this.#children;\n }\n /**\n * Get the Path object referenced by the string path, resolved from this Path\n */\n resolve(path) {\n if (!path) {\n return this;\n }\n const rootPath = this.getRootString(path);\n const dir = path.substring(rootPath.length);\n const dirParts = dir.split(this.splitSep);\n const result = rootPath ?\n this.getRoot(rootPath).#resolveParts(dirParts)\n : this.#resolveParts(dirParts);\n return result;\n }\n #resolveParts(dirParts) {\n let p = this;\n for (const part of dirParts) {\n p = p.child(part);\n }\n return p;\n }\n /**\n * Returns the cached children Path objects, if still available. If they\n * have fallen out of the cache, then returns an empty array, and resets the\n * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n * lookup.\n *\n * @internal\n */\n children() {\n const cached = this.#children.get(this);\n if (cached) {\n return cached;\n }\n const children = Object.assign([], { provisional: 0 });\n this.#children.set(this, children);\n this.#type &= ~READDIR_CALLED;\n return children;\n }\n /**\n * Resolves a path portion and returns or creates the child Path.\n *\n * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n * `'..'`.\n *\n * This should not be called directly. If `pathPart` contains any path\n * separators, it will lead to unsafe undefined behavior.\n *\n * Use `Path.resolve()` instead.\n *\n * @internal\n */\n child(pathPart, opts) {\n if (pathPart === '' || pathPart === '.') {\n return this;\n }\n if (pathPart === '..') {\n return this.parent || this;\n }\n // find the child\n const children = this.children();\n const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);\n for (const p of children) {\n if (p.#matchName === name) {\n return p;\n }\n }\n // didn't find it, create provisional child, since it might not\n // actually exist. If we know the parent isn't a dir, then\n // in fact it CAN'T exist.\n const s = this.parent ? this.sep : '';\n const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;\n const pchild = this.newChild(pathPart, UNKNOWN, {\n ...opts,\n parent: this,\n fullpath,\n });\n if (!this.canReaddir()) {\n pchild.#type |= ENOENT;\n }\n // don't have to update provisional, because if we have real children,\n // then provisional is set to children.length, otherwise a lower number\n children.push(pchild);\n return pchild;\n }\n /**\n * The relative path from the cwd. If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpath()\n */\n relative() {\n if (this.isCWD)\n return '';\n if (this.#relative !== undefined) {\n return this.#relative;\n }\n const name = this.name;\n const p = this.parent;\n if (!p) {\n return (this.#relative = this.name);\n }\n const pv = p.relative();\n return pv + (!pv || !p.parent ? '' : this.sep) + name;\n }\n /**\n * The relative path from the cwd, using / as the path separator.\n * If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpathPosix()\n * On posix systems, this is identical to relative().\n */\n relativePosix() {\n if (this.sep === '/')\n return this.relative();\n if (this.isCWD)\n return '';\n if (this.#relativePosix !== undefined)\n return this.#relativePosix;\n const name = this.name;\n const p = this.parent;\n if (!p) {\n return (this.#relativePosix = this.fullpathPosix());\n }\n const pv = p.relativePosix();\n return pv + (!pv || !p.parent ? '' : '/') + name;\n }\n /**\n * The fully resolved path string for this Path entry\n */\n fullpath() {\n if (this.#fullpath !== undefined) {\n return this.#fullpath;\n }\n const name = this.name;\n const p = this.parent;\n if (!p) {\n return (this.#fullpath = this.name);\n }\n const pv = p.fullpath();\n const fp = pv + (!p.parent ? '' : this.sep) + name;\n return (this.#fullpath = fp);\n }\n /**\n * On platforms other than windows, this is identical to fullpath.\n *\n * On windows, this is overridden to return the forward-slash form of the\n * full UNC path.\n */\n fullpathPosix() {\n if (this.#fullpathPosix !== undefined)\n return this.#fullpathPosix;\n if (this.sep === '/')\n return (this.#fullpathPosix = this.fullpath());\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/');\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`);\n }\n else {\n return (this.#fullpathPosix = p);\n }\n }\n const p = this.parent;\n const pfpp = p.fullpathPosix();\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;\n return (this.#fullpathPosix = fpp);\n }\n /**\n * Is the Path of an unknown type?\n *\n * Note that we might know *something* about it if there has been a previous\n * filesystem operation, for example that it does not exist, or is not a\n * link, or whether it has child entries.\n */\n isUnknown() {\n return (this.#type & IFMT) === UNKNOWN;\n }\n isType(type) {\n return this[`is${type}`]();\n }\n getType() {\n return (this.isUnknown() ? 'Unknown'\n : this.isDirectory() ? 'Directory'\n : this.isFile() ? 'File'\n : this.isSymbolicLink() ? 'SymbolicLink'\n : this.isFIFO() ? 'FIFO'\n : this.isCharacterDevice() ? 'CharacterDevice'\n : this.isBlockDevice() ? 'BlockDevice'\n : /* c8 ignore start */ this.isSocket() ? 'Socket'\n : 'Unknown');\n /* c8 ignore stop */\n }\n /**\n * Is the Path a regular file?\n */\n isFile() {\n return (this.#type & IFMT) === IFREG;\n }\n /**\n * Is the Path a directory?\n */\n isDirectory() {\n return (this.#type & IFMT) === IFDIR;\n }\n /**\n * Is the path a character device?\n */\n isCharacterDevice() {\n return (this.#type & IFMT) === IFCHR;\n }\n /**\n * Is the path a block device?\n */\n isBlockDevice() {\n return (this.#type & IFMT) === IFBLK;\n }\n /**\n * Is the path a FIFO pipe?\n */\n isFIFO() {\n return (this.#type & IFMT) === IFIFO;\n }\n /**\n * Is the path a socket?\n */\n isSocket() {\n return (this.#type & IFMT) === IFSOCK;\n }\n /**\n * Is the path a symbolic link?\n */\n isSymbolicLink() {\n return (this.#type & IFLNK) === IFLNK;\n }\n /**\n * Return the entry if it has been subject of a successful lstat, or\n * undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* simply\n * mean that we haven't called lstat on it.\n */\n lstatCached() {\n return this.#type & LSTAT_CALLED ? this : undefined;\n }\n /**\n * Return the cached link target if the entry has been the subject of a\n * successful readlink, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readlink() has been called at some point.\n */\n readlinkCached() {\n return this.#linkTarget;\n }\n /**\n * Returns the cached realpath target if the entry has been the subject\n * of a successful realpath, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * realpath() has been called at some point.\n */\n realpathCached() {\n return this.#realpath;\n }\n /**\n * Returns the cached child Path entries array if the entry has been the\n * subject of a successful readdir(), or [] otherwise.\n *\n * Does not read the filesystem, so an empty array *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readdir() has been called recently enough to still be valid.\n */\n readdirCached() {\n const children = this.children();\n return children.slice(0, children.provisional);\n }\n /**\n * Return true if it's worth trying to readlink. Ie, we don't (yet) have\n * any indication that readlink will definitely fail.\n *\n * Returns false if the path is known to not be a symlink, if a previous\n * readlink failed, or if the entry does not exist.\n */\n canReadlink() {\n if (this.#linkTarget)\n return true;\n if (!this.parent)\n return false;\n // cases where it cannot possibly succeed\n const ifmt = this.#type & IFMT;\n return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n this.#type & ENOREADLINK ||\n this.#type & ENOENT);\n }\n /**\n * Return true if readdir has previously been successfully called on this\n * path, indicating that cachedReaddir() is likely valid.\n */\n calledReaddir() {\n return !!(this.#type & READDIR_CALLED);\n }\n /**\n * Returns true if the path is known to not exist. That is, a previous lstat\n * or readdir failed to verify its existence when that would have been\n * expected, or a parent entry was marked either enoent or enotdir.\n */\n isENOENT() {\n return !!(this.#type & ENOENT);\n }\n /**\n * Return true if the path is a match for the given path name. This handles\n * case sensitivity and unicode normalization.\n *\n * Note: even on case-sensitive systems, it is **not** safe to test the\n * equality of the `.name` property to determine whether a given pathname\n * matches, due to unicode normalization mismatches.\n *\n * Always use this method instead of testing the `path.name` property\n * directly.\n */\n isNamed(n) {\n return !this.nocase ?\n this.#matchName === normalize(n)\n : this.#matchName === normalizeNocase(n);\n }\n /**\n * Return the Path object corresponding to the target of a symbolic link.\n *\n * If the Path is not a symbolic link, or if the readlink call fails for any\n * reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n */\n async readlink() {\n const target = this.#linkTarget;\n if (target) {\n return target;\n }\n if (!this.canReadlink()) {\n return undefined;\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined;\n }\n /* c8 ignore stop */\n try {\n const read = await this.#fs.promises.readlink(this.fullpath());\n const linkTarget = (await this.parent.realpath())?.resolve(read);\n if (linkTarget) {\n return (this.#linkTarget = linkTarget);\n }\n }\n catch (er) {\n this.#readlinkFail(er.code);\n return undefined;\n }\n }\n /**\n * Synchronous {@link PathBase.readlink}\n */\n readlinkSync() {\n const target = this.#linkTarget;\n if (target) {\n return target;\n }\n if (!this.canReadlink()) {\n return undefined;\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined;\n }\n /* c8 ignore stop */\n try {\n const read = this.#fs.readlinkSync(this.fullpath());\n const linkTarget = this.parent.realpathSync()?.resolve(read);\n if (linkTarget) {\n return (this.#linkTarget = linkTarget);\n }\n }\n catch (er) {\n this.#readlinkFail(er.code);\n return undefined;\n }\n }\n #readdirSuccess(children) {\n // succeeded, mark readdir called bit\n this.#type |= READDIR_CALLED;\n // mark all remaining provisional children as ENOENT\n for (let p = children.provisional; p < children.length; p++) {\n const c = children[p];\n if (c)\n c.#markENOENT();\n }\n }\n #markENOENT() {\n // mark as UNKNOWN and ENOENT\n if (this.#type & ENOENT)\n return;\n this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;\n this.#markChildrenENOENT();\n }\n #markChildrenENOENT() {\n // all children are provisional and do not exist\n const children = this.children();\n children.provisional = 0;\n for (const p of children) {\n p.#markENOENT();\n }\n }\n #markENOREALPATH() {\n this.#type |= ENOREALPATH;\n this.#markENOTDIR();\n }\n // save the information when we know the entry is not a dir\n #markENOTDIR() {\n // entry is not a directory, so any children can't exist.\n // this *should* be impossible, since any children created\n // after it's been marked ENOTDIR should be marked ENOENT,\n // so it won't even get to this point.\n /* c8 ignore start */\n if (this.#type & ENOTDIR)\n return;\n /* c8 ignore stop */\n let t = this.#type;\n // this could happen if we stat a dir, then delete it,\n // then try to read it or one of its children.\n if ((t & IFMT) === IFDIR)\n t &= IFMT_UNKNOWN;\n this.#type = t | ENOTDIR;\n this.#markChildrenENOENT();\n }\n #readdirFail(code = '') {\n // markENOTDIR and markENOENT also set provisional=0\n if (code === 'ENOTDIR' || code === 'EPERM') {\n this.#markENOTDIR();\n }\n else if (code === 'ENOENT') {\n this.#markENOENT();\n }\n else {\n this.children().provisional = 0;\n }\n }\n #lstatFail(code = '') {\n // Windows just raises ENOENT in this case, disable for win CI\n /* c8 ignore start */\n if (code === 'ENOTDIR') {\n // already know it has a parent by this point\n const p = this.parent;\n p.#markENOTDIR();\n }\n else if (code === 'ENOENT') {\n /* c8 ignore stop */\n this.#markENOENT();\n }\n }\n #readlinkFail(code = '') {\n let ter = this.#type;\n ter |= ENOREADLINK;\n if (code === 'ENOENT')\n ter |= ENOENT;\n // windows gets a weird error when you try to readlink a file\n if (code === 'EINVAL' || code === 'UNKNOWN') {\n // exists, but not a symlink, we don't know WHAT it is, so remove\n // all IFMT bits.\n ter &= IFMT_UNKNOWN;\n }\n this.#type = ter;\n // windows just gets ENOENT in this case. We do cover the case,\n // just disabled because it's impossible on Windows CI\n /* c8 ignore start */\n if (code === 'ENOTDIR' && this.parent) {\n this.parent.#markENOTDIR();\n }\n /* c8 ignore stop */\n }\n #readdirAddChild(e, c) {\n return (this.#readdirMaybePromoteChild(e, c) ||\n this.#readdirAddNewChild(e, c));\n }\n #readdirAddNewChild(e, c) {\n // alloc new entry at head, so it's never provisional\n const type = entToType(e);\n const child = this.newChild(e.name, type, { parent: this });\n const ifmt = child.#type & IFMT;\n if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n child.#type |= ENOTDIR;\n }\n c.unshift(child);\n c.provisional++;\n return child;\n }\n #readdirMaybePromoteChild(e, c) {\n for (let p = c.provisional; p < c.length; p++) {\n const pchild = c[p];\n const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);\n if (name !== pchild.#matchName) {\n continue;\n }\n return this.#readdirPromoteChild(e, pchild, p, c);\n }\n }\n #readdirPromoteChild(e, p, index, c) {\n const v = p.name;\n // retain any other flags, but set ifmt from dirent\n p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);\n // case sensitivity fixing when we learn the true name.\n if (v !== e.name)\n p.name = e.name;\n // just advance provisional index (potentially off the list),\n // otherwise we have to splice/pop it out and re-insert at head\n if (index !== c.provisional) {\n if (index === c.length - 1)\n c.pop();\n else\n c.splice(index, 1);\n c.unshift(p);\n }\n c.provisional++;\n return p;\n }\n /**\n * Call lstat() on this Path, and update all known information that can be\n * determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat() {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));\n return this;\n }\n catch (er) {\n this.#lstatFail(er.code);\n }\n }\n }\n /**\n * synchronous {@link PathBase.lstat}\n */\n lstatSync() {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(this.#fs.lstatSync(this.fullpath()));\n return this;\n }\n catch (er) {\n this.#lstatFail(er.code);\n }\n }\n }\n #applyStat(st) {\n const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;\n this.#atime = atime;\n this.#atimeMs = atimeMs;\n this.#birthtime = birthtime;\n this.#birthtimeMs = birthtimeMs;\n this.#blksize = blksize;\n this.#blocks = blocks;\n this.#ctime = ctime;\n this.#ctimeMs = ctimeMs;\n this.#dev = dev;\n this.#gid = gid;\n this.#ino = ino;\n this.#mode = mode;\n this.#mtime = mtime;\n this.#mtimeMs = mtimeMs;\n this.#nlink = nlink;\n this.#rdev = rdev;\n this.#size = size;\n this.#uid = uid;\n const ifmt = entToType(st);\n // retain any other flags, but set the ifmt\n this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;\n if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n this.#type |= ENOTDIR;\n }\n }\n #onReaddirCB = [];\n #readdirCBInFlight = false;\n #callOnReaddirCB(children) {\n this.#readdirCBInFlight = false;\n const cbs = this.#onReaddirCB.slice();\n this.#onReaddirCB.length = 0;\n cbs.forEach(cb => cb(null, children));\n }\n /**\n * Standard node-style callback interface to get list of directory entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n *\n * @param cb The callback called with (er, entries). Note that the `er`\n * param is somewhat extraneous, as all readdir() errors are handled and\n * simply result in an empty set of entries being returned.\n * @param allowZalgo Boolean indicating that immediately known results should\n * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n * zalgo at your peril, the dark pony lord is devious and unforgiving.\n */\n readdirCB(cb, allowZalgo = false) {\n if (!this.canReaddir()) {\n if (allowZalgo)\n cb(null, []);\n else\n queueMicrotask(() => cb(null, []));\n return;\n }\n const children = this.children();\n if (this.calledReaddir()) {\n const c = children.slice(0, children.provisional);\n if (allowZalgo)\n cb(null, c);\n else\n queueMicrotask(() => cb(null, c));\n return;\n }\n // don't have to worry about zalgo at this point.\n this.#onReaddirCB.push(cb);\n if (this.#readdirCBInFlight) {\n return;\n }\n this.#readdirCBInFlight = true;\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath();\n this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n if (er) {\n this.#readdirFail(er.code);\n children.provisional = 0;\n }\n else {\n // if we didn't get an error, we always get entries.\n //@ts-ignore\n for (const e of entries) {\n this.#readdirAddChild(e, children);\n }\n this.#readdirSuccess(children);\n }\n this.#callOnReaddirCB(children.slice(0, children.provisional));\n return;\n });\n }\n #asyncReaddirInFlight;\n /**\n * Return an array of known child entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async readdir() {\n if (!this.canReaddir()) {\n return [];\n }\n const children = this.children();\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional);\n }\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath();\n if (this.#asyncReaddirInFlight) {\n await this.#asyncReaddirInFlight;\n }\n else {\n /* c8 ignore start */\n let resolve = () => { };\n /* c8 ignore stop */\n this.#asyncReaddirInFlight = new Promise(res => (resolve = res));\n try {\n for (const e of await this.#fs.promises.readdir(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children);\n }\n this.#readdirSuccess(children);\n }\n catch (er) {\n this.#readdirFail(er.code);\n children.provisional = 0;\n }\n this.#asyncReaddirInFlight = undefined;\n resolve();\n }\n return children.slice(0, children.provisional);\n }\n /**\n * synchronous {@link PathBase.readdir}\n */\n readdirSync() {\n if (!this.canReaddir()) {\n return [];\n }\n const children = this.children();\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional);\n }\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath();\n try {\n for (const e of this.#fs.readdirSync(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children);\n }\n this.#readdirSuccess(children);\n }\n catch (er) {\n this.#readdirFail(er.code);\n children.provisional = 0;\n }\n return children.slice(0, children.provisional);\n }\n canReaddir() {\n if (this.#type & ENOCHILD)\n return false;\n const ifmt = IFMT & this.#type;\n // we always set ENOTDIR when setting IFMT, so should be impossible\n /* c8 ignore start */\n if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n return false;\n }\n /* c8 ignore stop */\n return true;\n }\n shouldWalk(dirs, walkFilter) {\n return ((this.#type & IFDIR) === IFDIR &&\n !(this.#type & ENOCHILD) &&\n !dirs.has(this) &&\n (!walkFilter || walkFilter(this)));\n }\n /**\n * Return the Path object corresponding to path as resolved\n * by realpath(3).\n *\n * If the realpath call fails for any reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n * On success, returns a Path object.\n */\n async realpath() {\n if (this.#realpath)\n return this.#realpath;\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)\n return undefined;\n try {\n const rp = await this.#fs.promises.realpath(this.fullpath());\n return (this.#realpath = this.resolve(rp));\n }\n catch (_) {\n this.#markENOREALPATH();\n }\n }\n /**\n * Synchronous {@link realpath}\n */\n realpathSync() {\n if (this.#realpath)\n return this.#realpath;\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)\n return undefined;\n try {\n const rp = this.#fs.realpathSync(this.fullpath());\n return (this.#realpath = this.resolve(rp));\n }\n catch (_) {\n this.#markENOREALPATH();\n }\n }\n /**\n * Internal method to mark this Path object as the scurry cwd,\n * called by {@link PathScurry#chdir}\n *\n * @internal\n */\n [setAsCwd](oldCwd) {\n if (oldCwd === this)\n return;\n oldCwd.isCWD = false;\n this.isCWD = true;\n const changed = new Set([]);\n let rp = [];\n let p = this;\n while (p && p.parent) {\n changed.add(p);\n p.#relative = rp.join(this.sep);\n p.#relativePosix = rp.join('/');\n p = p.parent;\n rp.push('..');\n }\n // now un-memoize parents of old cwd\n p = oldCwd;\n while (p && p.parent && !changed.has(p)) {\n p.#relative = undefined;\n p.#relativePosix = undefined;\n p = p.parent;\n }\n }\n}\nexports.PathBase = PathBase;\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nclass PathWin32 extends PathBase {\n /**\n * Separator for generating path strings.\n */\n sep = '\\\\';\n /**\n * Separator for parsing path strings.\n */\n splitSep = eitherSep;\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {\n super(name, type, root, roots, nocase, children, opts);\n }\n /**\n * @internal\n */\n newChild(name, type = UNKNOWN, opts = {}) {\n return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);\n }\n /**\n * @internal\n */\n getRootString(path) {\n return node_path_1.win32.parse(path).root;\n }\n /**\n * @internal\n */\n getRoot(rootPath) {\n rootPath = uncToDrive(rootPath.toUpperCase());\n if (rootPath === this.root.name) {\n return this.root;\n }\n // ok, not that one, check if it matches another we know about\n for (const [compare, root] of Object.entries(this.roots)) {\n if (this.sameRoot(rootPath, compare)) {\n return (this.roots[rootPath] = root);\n }\n }\n // otherwise, have to create a new one.\n return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);\n }\n /**\n * @internal\n */\n sameRoot(rootPath, compare = this.root.name) {\n // windows can (rarely) have case-sensitive filesystem, but\n // UNC and drive letters are always case-insensitive, and canonically\n // represented uppercase.\n rootPath = rootPath\n .toUpperCase()\n .replace(/\\//g, '\\\\')\n .replace(uncDriveRegexp, '$1\\\\');\n return rootPath === compare;\n }\n}\nexports.PathWin32 = PathWin32;\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nclass PathPosix extends PathBase {\n /**\n * separator for parsing path strings\n */\n splitSep = '/';\n /**\n * separator for generating path strings\n */\n sep = '/';\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {\n super(name, type, root, roots, nocase, children, opts);\n }\n /**\n * @internal\n */\n getRootString(path) {\n return path.startsWith('/') ? '/' : '';\n }\n /**\n * @internal\n */\n getRoot(_rootPath) {\n return this.root;\n }\n /**\n * @internal\n */\n newChild(name, type = UNKNOWN, opts = {}) {\n return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);\n }\n}\nexports.PathPosix = PathPosix;\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nclass PathScurryBase {\n /**\n * The root Path entry for the current working directory of this Scurry\n */\n root;\n /**\n * The string path for the root of this Scurry's current working directory\n */\n rootPath;\n /**\n * A collection of all roots encountered, referenced by rootPath\n */\n roots;\n /**\n * The Path entry corresponding to this PathScurry's current working directory.\n */\n cwd;\n #resolveCache;\n #resolvePosixCache;\n #children;\n /**\n * Perform path comparisons case-insensitively.\n *\n * Defaults true on Darwin and Windows systems, false elsewhere.\n */\n nocase;\n #fs;\n /**\n * This class should not be instantiated directly.\n *\n * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n *\n * @internal\n */\n constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {\n this.#fs = fsFromOption(fs);\n if (cwd instanceof URL || cwd.startsWith('file://')) {\n cwd = (0, node_url_1.fileURLToPath)(cwd);\n }\n // resolve and split root, and then add to the store.\n // this is the only time we call path.resolve()\n const cwdPath = pathImpl.resolve(cwd);\n this.roots = Object.create(null);\n this.rootPath = this.parseRootPath(cwdPath);\n this.#resolveCache = new ResolveCache();\n this.#resolvePosixCache = new ResolveCache();\n this.#children = new ChildrenCache(childrenCacheSize);\n const split = cwdPath.substring(this.rootPath.length).split(sep);\n // resolve('/') leaves '', splits to [''], we don't want that.\n if (split.length === 1 && !split[0]) {\n split.pop();\n }\n /* c8 ignore start */\n if (nocase === undefined) {\n throw new TypeError('must provide nocase setting to PathScurryBase ctor');\n }\n /* c8 ignore stop */\n this.nocase = nocase;\n this.root = this.newRoot(this.#fs);\n this.roots[this.rootPath] = this.root;\n let prev = this.root;\n let len = split.length - 1;\n const joinSep = pathImpl.sep;\n let abs = this.rootPath;\n let sawFirst = false;\n for (const part of split) {\n const l = len--;\n prev = prev.child(part, {\n relative: new Array(l).fill('..').join(joinSep),\n relativePosix: new Array(l).fill('..').join('/'),\n fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n });\n sawFirst = true;\n }\n this.cwd = prev;\n }\n /**\n * Get the depth of a provided path, string, or the cwd\n */\n depth(path = this.cwd) {\n if (typeof path === 'string') {\n path = this.cwd.resolve(path);\n }\n return path.depth();\n }\n /**\n * Return the cache of child entries. Exposed so subclasses can create\n * child Path objects in a platform-specific way.\n *\n * @internal\n */\n childrenCache() {\n return this.#children;\n }\n /**\n * Resolve one or more path strings to a resolved string\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolve(...paths) {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = '';\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i];\n if (!p || p === '.')\n continue;\n r = r ? `${p}/${r}` : p;\n if (this.isAbsolute(p)) {\n break;\n }\n }\n const cached = this.#resolveCache.get(r);\n if (cached !== undefined) {\n return cached;\n }\n const result = this.cwd.resolve(r).fullpath();\n this.#resolveCache.set(r, result);\n return result;\n }\n /**\n * Resolve one or more path strings to a resolved string, returning\n * the posix path. Identical to .resolve() on posix systems, but on\n * windows will return a forward-slash separated UNC path.\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolvePosix(...paths) {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = '';\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i];\n if (!p || p === '.')\n continue;\n r = r ? `${p}/${r}` : p;\n if (this.isAbsolute(p)) {\n break;\n }\n }\n const cached = this.#resolvePosixCache.get(r);\n if (cached !== undefined) {\n return cached;\n }\n const result = this.cwd.resolve(r).fullpathPosix();\n this.#resolvePosixCache.set(r, result);\n return result;\n }\n /**\n * find the relative path from the cwd to the supplied path string or entry\n */\n relative(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.relative();\n }\n /**\n * find the relative path from the cwd to the supplied path string or\n * entry, using / as the path delimiter, even on Windows.\n */\n relativePosix(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.relativePosix();\n }\n /**\n * Return the basename for the provided string or Path object\n */\n basename(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.name;\n }\n /**\n * Return the dirname for the provided string or Path object\n */\n dirname(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return (entry.parent || entry).fullpath();\n }\n async readdir(entry = this.cwd, opts = {\n withFileTypes: true,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes } = opts;\n if (!entry.canReaddir()) {\n return [];\n }\n else {\n const p = await entry.readdir();\n return withFileTypes ? p : p.map(e => e.name);\n }\n }\n readdirSync(entry = this.cwd, opts = {\n withFileTypes: true,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true } = opts;\n if (!entry.canReaddir()) {\n return [];\n }\n else if (withFileTypes) {\n return entry.readdirSync();\n }\n else {\n return entry.readdirSync().map(e => e.name);\n }\n }\n /**\n * Call lstat() on the string or Path object, and update all known\n * information that can be determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.lstat();\n }\n /**\n * synchronous {@link PathScurryBase.lstat}\n */\n lstatSync(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.lstatSync();\n }\n async readlink(entry = this.cwd, { withFileTypes } = {\n withFileTypes: false,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes;\n entry = this.cwd;\n }\n const e = await entry.readlink();\n return withFileTypes ? e : e?.fullpath();\n }\n readlinkSync(entry = this.cwd, { withFileTypes } = {\n withFileTypes: false,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes;\n entry = this.cwd;\n }\n const e = entry.readlinkSync();\n return withFileTypes ? e : e?.fullpath();\n }\n async realpath(entry = this.cwd, { withFileTypes } = {\n withFileTypes: false,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes;\n entry = this.cwd;\n }\n const e = await entry.realpath();\n return withFileTypes ? e : e?.fullpath();\n }\n realpathSync(entry = this.cwd, { withFileTypes } = {\n withFileTypes: false,\n }) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes;\n entry = this.cwd;\n }\n const e = entry.realpathSync();\n return withFileTypes ? e : e?.fullpath();\n }\n async walk(entry = this.cwd, opts = {}) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;\n const results = [];\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath());\n }\n const dirs = new Set();\n const walk = (dir, cb) => {\n dirs.add(dir);\n dir.readdirCB((er, entries) => {\n /* c8 ignore start */\n if (er) {\n return cb(er);\n }\n /* c8 ignore stop */\n let len = entries.length;\n if (!len)\n return cb();\n const next = () => {\n if (--len === 0) {\n cb();\n }\n };\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath());\n }\n if (follow && e.isSymbolicLink()) {\n e.realpath()\n .then(r => (r?.isUnknown() ? r.lstat() : r))\n .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());\n }\n else {\n if (e.shouldWalk(dirs, walkFilter)) {\n walk(e, next);\n }\n else {\n next();\n }\n }\n }\n }, true); // zalgooooooo\n };\n const start = entry;\n return new Promise((res, rej) => {\n walk(start, er => {\n /* c8 ignore start */\n if (er)\n return rej(er);\n /* c8 ignore stop */\n res(results);\n });\n });\n }\n walkSync(entry = this.cwd, opts = {}) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;\n const results = [];\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath());\n }\n const dirs = new Set([entry]);\n for (const dir of dirs) {\n const entries = dir.readdirSync();\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath());\n }\n let r = e;\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync())))\n continue;\n if (r.isUnknown())\n r.lstatSync();\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r);\n }\n }\n }\n return results;\n }\n /**\n * Support for `for await`\n *\n * Alias for {@link PathScurryBase.iterate}\n *\n * Note: As of Node 19, this is very slow, compared to other methods of\n * walking. Consider using {@link PathScurryBase.stream} if memory overhead\n * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n */\n [Symbol.asyncIterator]() {\n return this.iterate();\n }\n iterate(entry = this.cwd, options = {}) {\n // iterating async over the stream is significantly more performant,\n // especially in the warm-cache scenario, because it buffers up directory\n // entries in the background instead of waiting for a yield for each one.\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n options = entry;\n entry = this.cwd;\n }\n return this.stream(entry, options)[Symbol.asyncIterator]();\n }\n /**\n * Iterating over a PathScurry performs a synchronous walk.\n *\n * Alias for {@link PathScurryBase.iterateSync}\n */\n [Symbol.iterator]() {\n return this.iterateSync();\n }\n *iterateSync(entry = this.cwd, opts = {}) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;\n if (!filter || filter(entry)) {\n yield withFileTypes ? entry : entry.fullpath();\n }\n const dirs = new Set([entry]);\n for (const dir of dirs) {\n const entries = dir.readdirSync();\n for (const e of entries) {\n if (!filter || filter(e)) {\n yield withFileTypes ? e : e.fullpath();\n }\n let r = e;\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync())))\n continue;\n if (r.isUnknown())\n r.lstatSync();\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r);\n }\n }\n }\n }\n stream(entry = this.cwd, opts = {}) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;\n const results = new minipass_1.Minipass({ objectMode: true });\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath());\n }\n const dirs = new Set();\n const queue = [entry];\n let processing = 0;\n const process = () => {\n let paused = false;\n while (!paused) {\n const dir = queue.shift();\n if (!dir) {\n if (processing === 0)\n results.end();\n return;\n }\n processing++;\n dirs.add(dir);\n const onReaddir = (er, entries, didRealpaths = false) => {\n /* c8 ignore start */\n if (er)\n return results.emit('error', er);\n /* c8 ignore stop */\n if (follow && !didRealpaths) {\n const promises = [];\n for (const e of entries) {\n if (e.isSymbolicLink()) {\n promises.push(e\n .realpath()\n .then((r) => r?.isUnknown() ? r.lstat() : r));\n }\n }\n if (promises.length) {\n Promise.all(promises).then(() => onReaddir(null, entries, true));\n return;\n }\n }\n for (const e of entries) {\n if (e && (!filter || filter(e))) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true;\n }\n }\n }\n processing--;\n for (const e of entries) {\n const r = e.realpathCached() || e;\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r);\n }\n }\n if (paused && !results.flowing) {\n results.once('drain', process);\n }\n else if (!sync) {\n process();\n }\n };\n // zalgo containment\n let sync = true;\n dir.readdirCB(onReaddir, true);\n sync = false;\n }\n };\n process();\n return results;\n }\n streamSync(entry = this.cwd, opts = {}) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n else if (!(entry instanceof PathBase)) {\n opts = entry;\n entry = this.cwd;\n }\n const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;\n const results = new minipass_1.Minipass({ objectMode: true });\n const dirs = new Set();\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath());\n }\n const queue = [entry];\n let processing = 0;\n const process = () => {\n let paused = false;\n while (!paused) {\n const dir = queue.shift();\n if (!dir) {\n if (processing === 0)\n results.end();\n return;\n }\n processing++;\n dirs.add(dir);\n const entries = dir.readdirSync();\n for (const e of entries) {\n if (!filter || filter(e)) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true;\n }\n }\n }\n processing--;\n for (const e of entries) {\n let r = e;\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync())))\n continue;\n if (r.isUnknown())\n r.lstatSync();\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r);\n }\n }\n }\n if (paused && !results.flowing)\n results.once('drain', process);\n };\n process();\n return results;\n }\n chdir(path = this.cwd) {\n const oldCwd = this.cwd;\n this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;\n this.cwd[setAsCwd](oldCwd);\n }\n}\nexports.PathScurryBase = PathScurryBase;\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings. Uses\n * {@link PathWin32} for Path objects.\n */\nclass PathScurryWin32 extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep = '\\\\';\n constructor(cwd = process.cwd(), opts = {}) {\n const { nocase = true } = opts;\n super(cwd, node_path_1.win32, '\\\\', { ...opts, nocase });\n this.nocase = nocase;\n for (let p = this.cwd; p; p = p.parent) {\n p.nocase = this.nocase;\n }\n }\n /**\n * @internal\n */\n parseRootPath(dir) {\n // if the path starts with a single separator, it's not a UNC, and we'll\n // just get separator as the root, and driveFromUNC will return \\\n // In that case, mount \\ on the root from the cwd.\n return node_path_1.win32.parse(dir).root.toUpperCase();\n }\n /**\n * @internal\n */\n newRoot(fs) {\n return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });\n }\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p) {\n return (p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p));\n }\n}\nexports.PathScurryWin32 = PathScurryWin32;\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nclass PathScurryPosix extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep = '/';\n constructor(cwd = process.cwd(), opts = {}) {\n const { nocase = false } = opts;\n super(cwd, node_path_1.posix, '/', { ...opts, nocase });\n this.nocase = nocase;\n }\n /**\n * @internal\n */\n parseRootPath(_dir) {\n return '/';\n }\n /**\n * @internal\n */\n newRoot(fs) {\n return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });\n }\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p) {\n return p.startsWith('/');\n }\n}\nexports.PathScurryPosix = PathScurryPosix;\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nclass PathScurryDarwin extends PathScurryPosix {\n constructor(cwd = process.cwd(), opts = {}) {\n const { nocase = true } = opts;\n super(cwd, { ...opts, nocase });\n }\n}\nexports.PathScurryDarwin = PathScurryDarwin;\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexports.Path = process.platform === 'win32' ? PathWin32 : PathPosix;\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexports.PathScurry = process.platform === 'win32' ? PathScurryWin32\n : process.platform === 'darwin' ? PathScurryDarwin\n : PathScurryPosix;\n//# sourceMappingURL=index.js.map","(()=>{\"use strict\";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ie,XMLParser:()=>Lt,XMLValidator:()=>se});const n=\":A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\",i=new RegExp(\"^[\"+n+\"][\"+n+\"\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){return!(null==i.exec(t))},o=[\"hasOwnProperty\",\"toString\",\"valueOf\",\"__defineGetter__\",\"__defineSetter__\",\"__lookupGetter__\",\"__lookupSetter__\"],a=[\"__proto__\",\"constructor\",\"prototype\"],h={allowBooleanAttributes:!1,unpairedTags:[]};function l(t,e){e=Object.assign({},h,e);const n=[];let i=!1,s=!1;\"\\ufeff\"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if(\"<\"===t[r]&&\"?\"===t[r+1]){if(r+=2,r=p(t,r),r.err)return r}else{if(\"<\"!==t[r]){if(u(t[r]))continue;return b(\"InvalidChar\",\"char '\"+t[r]+\"' is not expected.\",w(t,r))}{let o=r;if(r++,\"!\"===t[r]){r=c(t,r);continue}{let a=!1;\"/\"===t[r]&&(a=!0,r++);let h=\"\";for(;r<t.length&&\">\"!==t[r]&&\" \"!==t[r]&&\"\\t\"!==t[r]&&\"\\n\"!==t[r]&&\"\\r\"!==t[r];r++)h+=t[r];if(h=h.trim(),\"/\"===h[h.length-1]&&(h=h.substring(0,h.length-1),r--),!E(h)){let e;return e=0===h.trim().length?\"Invalid space after '<'.\":\"Tag '\"+h+\"' is an invalid name.\",b(\"InvalidTag\",e,w(t,r))}const l=g(t,r);if(!1===l)return b(\"InvalidAttr\",\"Attributes for '\"+h+\"' have open quote.\",w(t,r));let d=l.value;if(r=l.index,\"/\"===d[d.length-1]){const n=r-d.length;d=d.substring(0,d.length-1);const s=x(d,e);if(!0!==s)return b(s.err.code,s.err.msg,w(t,n+s.err.line));i=!0}else if(a){if(!l.tagClosed)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' doesn't have proper closing.\",w(t,r));if(d.trim().length>0)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' can't have attributes or invalid starting.\",w(t,o));if(0===n.length)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' has not been opened.\",w(t,o));{const e=n.pop();if(h!==e.tagName){let n=w(t,e.tagStartPos);return b(\"InvalidTag\",\"Expected closing tag '\"+e.tagName+\"' (opened in line \"+n.line+\", col \"+n.col+\") instead of closing tag '\"+h+\"'.\",w(t,o))}0==n.length&&(s=!0)}}else{const a=x(d,e);if(!0!==a)return b(a.err.code,a.err.msg,w(t,r-d.length+a.err.line));if(!0===s)return b(\"InvalidXml\",\"Multiple possible root nodes found.\",w(t,r));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:o}),i=!0}for(r++;r<t.length;r++)if(\"<\"===t[r]){if(\"!\"===t[r+1]){r++,r=c(t,r);continue}if(\"?\"!==t[r+1])break;if(r=p(t,++r),r.err)return r}else if(\"&\"===t[r]){const e=N(t,r);if(-1==e)return b(\"InvalidChar\",\"char '&' is not expected.\",w(t,r));r=e}else if(!0===s&&!u(t[r]))return b(\"InvalidXml\",\"Extra text at the end\",w(t,r));\"<\"===t[r]&&r--}}}return i?1==n.length?b(\"InvalidTag\",\"Unclosed tag '\"+n[0].tagName+\"'.\",w(t,n[0].tagStartPos)):!(n.length>0)||b(\"InvalidXml\",\"Invalid '\"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\\r?\\n/g,\"\")+\"' found.\",{line:1,col:1}):b(\"InvalidXml\",\"Start tag expected.\",1)}function u(t){return\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t}function p(t,e){const n=e;for(;e<t.length;e++)if(\"?\"==t[e]||\" \"==t[e]){const i=t.substr(n,e-n);if(e>5&&\"xml\"===i)return b(\"InvalidXml\",\"XML declaration allowed only at the start of the document.\",w(t,e));if(\"?\"==t[e]&&\">\"==t[e+1]){e++;break}continue}return e}function c(t,e){if(t.length>e+5&&\"-\"===t[e+1]&&\"-\"===t[e+2]){for(e+=3;e<t.length;e++)if(\"-\"===t[e]&&\"-\"===t[e+1]&&\">\"===t[e+2]){e+=2;break}}else if(t.length>e+8&&\"D\"===t[e+1]&&\"O\"===t[e+2]&&\"C\"===t[e+3]&&\"T\"===t[e+4]&&\"Y\"===t[e+5]&&\"P\"===t[e+6]&&\"E\"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if(\"<\"===t[e])n++;else if(\">\"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&\"[\"===t[e+1]&&\"C\"===t[e+2]&&\"D\"===t[e+3]&&\"A\"===t[e+4]&&\"T\"===t[e+5]&&\"A\"===t[e+6]&&\"[\"===t[e+7])for(e+=8;e<t.length;e++)if(\"]\"===t[e]&&\"]\"===t[e+1]&&\">\"===t[e+2]){e+=2;break}return e}const d='\"',f=\"'\";function g(t,e){let n=\"\",i=\"\",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===f)\"\"===i?i=t[e]:i!==t[e]||(i=\"\");else if(\">\"===t[e]&&\"\"===i){s=!0;break}n+=t[e]}return\"\"===i&&{value:n,index:e,tagClosed:s}}const m=new RegExp(\"(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*(['\\\"])(([\\\\s\\\\S])*?)\\\\5)?\",\"g\");function x(t,e){const n=s(t,m),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return b(\"InvalidAttr\",\"Attribute '\"+n[t][2]+\"' has no space in starting.\",v(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return b(\"InvalidAttr\",\"Attribute '\"+n[t][2]+\"' is without value.\",v(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return b(\"InvalidAttr\",\"boolean attribute '\"+n[t][2]+\"' is not allowed.\",v(n[t]));const s=n[t][2];if(!y(s))return b(\"InvalidAttr\",\"Attribute '\"+s+\"' is an invalid name.\",v(n[t]));if(Object.prototype.hasOwnProperty.call(i,s))return b(\"InvalidAttr\",\"Attribute '\"+s+\"' is repeated.\",v(n[t]));i[s]=1}return!0}function N(t,e){if(\";\"===t[++e])return-1;if(\"#\"===t[e])return function(t,e){let n=/\\d/;for(\"x\"===t[e]&&(e++,n=/[\\da-fA-F]/);e<t.length;e++){if(\";\"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\\w/)&&n<20)){if(\";\"===t[e])break;return-1}return e}function b(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function y(t){return r(t)}function E(t){return r(t)}function w(t,e){const n=t.substring(0,e).split(/\\r?\\n/);return{line:n.length,col:n[n.length-1].length+1}}function v(t){return t.startIndex+t[1].length}const S=t=>o.includes(t)?\"__\"+t:t,_={preserveOrder:!1,attributeNamePrefix:\"@_\",attributesGroupName:!1,textNodeName:\"#text\",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function A(t,e){if(\"string\"!=typeof t)return;const n=t.toLowerCase();if(o.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);if(a.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`)}function T(t,e){return\"boolean\"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:\"all\"}:\"object\"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??\"all\"}:T(!0)}const C=function(t){const e=Object.assign({},_,t),n=[{value:e.attributeNamePrefix,name:\"attributeNamePrefix\"},{value:e.attributesGroupName,name:\"attributesGroupName\"},{value:e.textNodeName,name:\"textNodeName\"},{value:e.cdataPropName,name:\"cdataPropName\"},{value:e.commentPropName,name:\"commentPropName\"}];for(const{value:t,name:e}of n)t&&A(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=S),e.processEntities=T(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),e};let P;P=\"function\"!=typeof Symbol?\"@@xmlMetadata\":Symbol(\"XML Node Metadata\");class ${constructor(t){this.tagname=t,this.child=[],this[\":@\"]=Object.create(null)}add(t,e){\"__proto__\"===t&&(t=\"#__proto__\"),this.child.push({[t]:e})}addChild(t,e){\"__proto__\"===t.tagname&&(t.tagname=\"#__proto__\"),t[\":@\"]&&Object.keys(t[\":@\"]).length>0?this.child.push({[t.tagname]:t.child,\":@\":t[\":@\"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][P]={startIndex:e})}static getMetaDataSymbol(){return P}}const O=\":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�\",I=\":A-Za-z_À-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-\",V=I+\"\\\\-\\\\.\\\\d·̀-ͯ҇‿-⁀\",D=(t,e,n=\"\")=>{const i=`[${t.replace(\":\",\"\")}][${e.replace(\":\",\"\")}]*`;return{name:new RegExp(`^[${t}][${e}]*$`,n),ncName:new RegExp(`^${i}$`,n),qName:new RegExp(`^${i}(?::${i})?$`,n),nmToken:new RegExp(`^[${e}]+$`,n),nmTokens:new RegExp(`^[${e}]+(?:\\\\s+[${e}]+)*$`,n)}},M=D(O,O+\"\\\\-\\\\.\\\\d·̀-ͯ‿-⁀\"),j=D(I,V,\"u\"),L=(t,{xmlVersion:e=\"1.0\"}={})=>((t=\"1.0\")=>\"1.1\"===t?j:M)(e).qName.test(t);class k{constructor(t,e){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=e||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,e){const n=Object.create(null);let i=0;if(\"O\"!==t[e+3]||\"C\"!==t[e+4]||\"T\"!==t[e+5]||\"Y\"!==t[e+6]||\"P\"!==t[e+7]||\"E\"!==t[e+8])throw new Error(\"Invalid Tag instead of DOCTYPE\");{e+=9;let s=1,r=!1,o=!1,a=\"\";for(;e<t.length;e++)if(\"<\"!==t[e]||o)if(\">\"===t[e]){if(o?\"-\"===t[e-1]&&\"-\"===t[e-2]&&(o=!1,s--):s--,0===s)break}else\"[\"===t[e]?r=!0:a+=t[e];else{if(r&&F(t,\"!ENTITY\",e)){let s,r;if(e+=7,[s,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf(\"&\")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[s]=r,i++}}else if(r&&F(t,\"!ELEMENT\",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(r&&F(t,\"!ATTLIST\",e))e+=8;else if(r&&F(t,\"!NOTATION\",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!F(t,\"!--\",e))throw new Error(\"Invalid DOCTYPE\");o=!0}s++,a=\"\"}if(0!==s)throw new Error(\"Unclosed DOCTYPE\")}return{entities:n,i:e}}readEntityExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e])&&'\"'!==t[e]&&\"'\"!==t[e];)e++;let i=t.substring(n,e);if(G(i,{xmlVersion:this.xmlVersion}),e=R(t,e),!this.suppressValidationErr){if(\"SYSTEM\"===t.substring(e,e+6).toUpperCase())throw new Error(\"External entities are not supported\");if(\"%\"===t[e])throw new Error(\"Parameter entities are not supported\")}let s=\"\";if([e,s]=this.readIdentifierVal(t,e,\"entity\"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&s.length>this.options.maxEntitySize)throw new Error(`Entity \"${i}\" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[i,s,--e]}readNotationExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);!this.suppressValidationErr&&G(i,{xmlVersion:this.xmlVersion}),e=R(t,e);const s=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&\"SYSTEM\"!==s&&\"PUBLIC\"!==s)throw new Error(`Expected SYSTEM or PUBLIC, found \"${s}\"`);e+=s.length,e=R(t,e);let r=null,o=null;if(\"PUBLIC\"===s)[e,r]=this.readIdentifierVal(t,e,\"publicIdentifier\"),'\"'!==t[e=R(t,e)]&&\"'\"!==t[e]||([e,o]=this.readIdentifierVal(t,e,\"systemIdentifier\"));else if(\"SYSTEM\"===s&&([e,o]=this.readIdentifierVal(t,e,\"systemIdentifier\"),!this.suppressValidationErr&&!o))throw new Error(\"Missing mandatory system identifier for SYSTEM notation\");return{notationName:i,publicIdentifier:r,systemIdentifier:o,index:--e}}readIdentifierVal(t,e,n){let i=\"\";const s=t[e];if('\"'!==s&&\"'\"!==s)throw new Error(`Expected quoted string, found \"${s}\"`);const r=++e;for(;e<t.length&&t[e]!==s;)e++;if(i=t.substring(r,e),t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);if(!this.suppressValidationErr&&!L(i,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: \"${i}\"`);let s=\"\";if(\"E\"===t[e=R(t,e)]&&F(t,\"MPTY\",e))e+=4;else if(\"A\"===t[e]&&F(t,\"NY\",e))e+=2;else if(\"(\"===t[e]){const n=++e;for(;e<t.length&&\")\"!==t[e];)e++;if(s=t.substring(n,e),\")\"!==t[e])throw new Error(\"Unterminated content model\")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found \"${t[e]}\"`);return{elementName:i,contentModel:s.trim(),index:e}}readAttlistExp(t,e){let n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);for(G(i,{xmlVersion:this.xmlVersion}),n=e=R(t,e);e<t.length&&!/\\s/.test(t[e]);)e++;let s=t.substring(n,e);if(!G(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: \"${s}\"`);e=R(t,e);let r=\"\";if(\"NOTATION\"===t.substring(e,e+8).toUpperCase()){if(r=\"NOTATION\",\"(\"!==t[e=R(t,e+=8)])throw new Error(`Expected '(', found \"${t[e]}\"`);e++;let n=[];for(;e<t.length&&\")\"!==t[e];){const i=e;for(;e<t.length&&\"|\"!==t[e]&&\")\"!==t[e];)e++;let s=t.substring(i,e);if(s=s.trim(),!G(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: \"${s}\"`);n.push(s),\"|\"===t[e]&&(e++,e=R(t,e))}if(\")\"!==t[e])throw new Error(\"Unterminated list of notations\");e++,r+=\" (\"+n.join(\"|\")+\")\"}else{const n=e;for(;e<t.length&&!/\\s/.test(t[e]);)e++;r+=t.substring(n,e);const i=[\"CDATA\",\"ID\",\"IDREF\",\"IDREFS\",\"ENTITY\",\"ENTITIES\",\"NMTOKEN\",\"NMTOKENS\"];if(!this.suppressValidationErr&&!i.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: \"${r}\"`)}e=R(t,e);let o=\"\";return\"#REQUIRED\"===t.substring(e,e+8).toUpperCase()?(o=\"#REQUIRED\",e+=8):\"#IMPLIED\"===t.substring(e,e+7).toUpperCase()?(o=\"#IMPLIED\",e+=7):[e,o]=this.readIdentifierVal(t,e,\"ATTLIST\"),{elementName:i,attributeName:s,attributeType:r,defaultValue:o,index:e}}}const R=(t,e)=>{for(;e<t.length&&/\\s/.test(t[e]);)e++;return e};function F(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function G(t,e){if(L(t,{xmlVersion:e}))return t;throw new Error(`Invalid entity name ${t}`)}const U=/^[-+]?0x[a-fA-F0-9]+$/,B=/^0b[01]+$/,W=/^0o[0-7]+$/,z=/^([\\-\\+])?(0*)([0-9]*(\\.[0-9]*)?)$/,X={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:\".\",eNotation:!0,infinity:\"original\"};const Y=/^([-+])?(0*)(\\d*(\\.\\d*)?[eE][-\\+]?\\d+)$/;function q(t,e){const n=t.trim();if(2!==e&&8!==e||(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error(\"parseInt, Number.parseInt, window.parseInt are not supported\")}class Z{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const n=e[e.length-1];return void 0!==n.values&&t in n.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class J{constructor(t={}){this.separator=t.separator||\".\",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Z(this)}push(t,e=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const s=this.siblingStacks[i],r=n?`${n}:${t}`:t,o=s.get(r)||0;let a=0;for(const t of s.values())a+=t;s.set(r,o+1);const h={tag:t,position:a,counter:o};null!=n&&(h.namespace=n),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const n=t||this.separator;if(n===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,n=t.length-1;for(;n>=0&&e>=0;){const i=t[n];if(\"deep-wildcard\"===i.type){if(n--,n<0)return!0;const i=t[n];let s=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,n--,s=!0;break}if(!s)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,n--}}return n<0}_matchSegment(t,e,n){if(\"*\"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&\"*\"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!n)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!n)return!1;const i=e.counter??0;if(\"first\"===t.position&&0!==i)return!1;if(\"odd\"===t.position&&i%2!=1)return!1;if(\"even\"===t.position&&i%2!=0)return!1;if(\"nth\"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class K{constructor(t,e={},n){this.pattern=t,this.separator=e.separator||\".\",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(t=>\"deep-wildcard\"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let n=0,i=\"\";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=\"\"),e.push({type:\"deep-wildcard\"}),n+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i=\"\",n++):(i+=t[n],n++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:\"tag\"};let n=null,i=t;const s=t.match(/^([^\\[]+)(\\[[^\\]]*\\])(.*)$/);if(s&&(i=s[1]+s[3],s[2])){const t=s[2].slice(1,-1);t&&(n=t)}let r,o,a=i;if(i.includes(\"::\")){const e=i.indexOf(\"::\");if(r=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(a.includes(\":\")){const t=a.lastIndexOf(\":\"),e=a.substring(0,t).trim(),n=a.substring(t+1).trim();[\"first\",\"last\",\"odd\",\"even\"].includes(n)||/^nth\\(\\d+\\)$/.test(n)?(o=e,h=n):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,r&&(e.namespace=r),n)if(n.includes(\"=\")){const t=n.indexOf(\"=\");e.attrName=n.substring(0,t).trim(),e.attrValue=n.substring(t+1).trim()}else e.attrName=n.trim();if(h){const t=h.match(/^nth\\((\\d+)\\)$/);t?(e.position=\"nth\",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class Q{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError(\"ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.\");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,n=t.segments[t.segments.length-1],i=n?.tag;if(i&&\"*\"!==i){const n=`${e}:${i}`;this._byDepthAndTag.has(n)||this._byDepthAndTag.set(n,[]),this._byDepthAndTag.get(n).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),n=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(n);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const s=this._wildcardByDepth.get(e);if(s)for(let e=0;e<s.length;e++)if(t.matches(s[e]))return s[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const H={cent:\"¢\",pound:\"£\",curren:\"¤\",yen:\"¥\",euro:\"€\",dollar:\"$\",euro:\"€\",fnof:\"ƒ\",inr:\"₹\",af:\"؋\",birr:\"ብር\",peso:\"₱\",rub:\"₽\",won:\"₩\",yuan:\"¥\",cedil:\"¸\"},tt={amp:\"&\",apos:\"'\",gt:\">\",lt:\"<\",quot:'\"'},et={nbsp:\" \",copy:\"©\",reg:\"®\",trade:\"™\",mdash:\"—\",ndash:\"–\",hellip:\"…\",laquo:\"«\",raquo:\"»\",lsquo:\"‘\",rsquo:\"’\",ldquo:\"“\",rdquo:\"”\",bull:\"•\",para:\"¶\",sect:\"§\",deg:\"°\",frac12:\"½\",frac14:\"¼\",frac34:\"¾\"},nt=new Set(\"!?\\\\\\\\/[]$%{}^&*()<>|+\");function it(t){if(\"#\"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: \"${t}\"`);for(const e of t)if(nt.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: \"${t}\"`);return t}function st(...t){const e=Object.create(null);for(const n of t)if(n)for(const t of Object.keys(n)){const i=n[t];if(\"string\"==typeof i)e[t]=i;else if(i&&\"object\"==typeof i&&void 0!==i.val){const n=i.val;\"string\"==typeof n&&(e[t]=n)}}return e}const rt=\"external\",ot=\"base\",at=\"all\",ht=Object.freeze({allow:0,leave:1,remove:2,throw:3}),lt=new Set([9,10,13]);class ut{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=\"function\"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??rt)&&e!==rt?e===at?new Set([at]):e===ot?new Set([ot]):Array.isArray(e)?new Set(e):new Set([rt]):new Set([rt]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=st(tt,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const n=function(t){if(!t)return{xmlVersion:1,onLevel:ht.allow,nullLevel:ht.remove};const e=1.1===t.xmlVersion?1.1:1,n=ht[t.onNCR]??ht.allow,i=ht[t.nullNCR]??ht.remove;return{xmlVersion:e,onLevel:n,nullLevel:Math.max(i,ht.remove)}}(t.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))it(e);this._externalMap=st(t)}addExternalEntity(t,e){it(t),\"string\"==typeof e&&-1===e.indexOf(\"&\")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=st(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if(\"string\"!=typeof t||0===t.length)return t;const e=t,n=[],i=t.length;let s=0,r=0;const o=this._maxTotalExpansions>0,a=this._maxExpandedLength>0,h=o||a;for(;r<i;){if(38!==t.charCodeAt(r)){r++;continue}let e=r+1;for(;e<i&&59!==t.charCodeAt(e)&&e-r<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){r++;continue}const l=t.slice(r+1,e);if(0===l.length){r++;continue}let u,p;if(this._removeSet.has(l))u=\"\",void 0===p&&(p=rt);else{if(this._leaveSet.has(l)){r++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){r++;continue}u=t,p=ot}else{const t=this._resolveName(l);u=t?.value,p=t?.tier}}if(void 0!==u){if(r>s&&n.push(t.slice(s,r)),n.push(u),s=e+1,r=s,h&&this._tierCounts(p)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(a){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else r++}s<i&&n.push(t.slice(s));const l=0===n.length?t:n.join(\"\");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(at)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:rt}:t in this._externalMap?{value:this._externalMap[t],tier:rt}:t in this._baseMap?{value:this._baseMap[t],tier:ot}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!lt.has(t)?ht.remove:-1}_applyNCRAction(t,e,n){switch(t){case ht.allow:return String.fromCodePoint(n);case ht.remove:return\"\";case ht.leave:return;case ht.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${n.toString(16).toUpperCase().padStart(4,\"0\")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){const e=t.charCodeAt(1);let n;if(n=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;const i=this._classifyNCR(n);if(!this._numericAllowed&&i<ht.remove)return;const s=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(s,t,n)}}function pt(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const t in n)t.startsWith(e.attributeNamePrefix)?i[t.substring(e.attributeNamePrefix.length)]=n[t]:i[t]=n[t];return i}function ct(t){if(!t||\"string\"!=typeof t)return;const e=t.indexOf(\":\");if(-1!==e&&e>0){const n=t.substring(0,e);if(\"xmlns\"!==n)return n}}class dt{constructor(t,e){var n;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Nt,this.parseTextData=ft,this.resolveNameSpace=gt,this.buildAttributesMap=xt,this.isItStopNode=wt,this.replaceEntitiesValue=yt,this.readStopNodeData=At,this.saveTextToParentTag=Et,this.addChild=bt,this.ignoreAttributesFn=\"function\"==typeof(n=this.options.ignoreAttributes)?n:Array.isArray(n)?t=>{for(const e of n){if(\"string\"==typeof e&&t===e)return!0;if(e instanceof RegExp&&e.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let i={...tt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(\"object\"==typeof this.options.htmlEntities?i=this.options.htmlEntities:!0===this.options.htmlEntities&&(i={...et,...H}),this.entityDecoder=new ut({namedEntities:{...i,...e},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new J,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Q;const s=this.options.stopNodes;if(s&&s.length>0){for(let t=0;t<s.length;t++){const e=s[t];\"string\"==typeof e?this.stopNodeExpressionsSet.add(new K(e)):e instanceof K&&this.stopNodeExpressionsSet.add(e)}this.stopNodeExpressionsSet.seal()}}}function ft(t,e,n,i,s,r,o){const a=this.options;if(void 0!==t&&(a.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=a.jPath?n.toString():n,h=a.tagValueProcessor(e,t,i,s,r);return null==h?t:typeof h!=typeof t||h!==t?h:a.trimValues||t.trim()===t?Tt(t,a.parseTagValue,a.numberParseOptions):t}}function gt(t){if(this.options.removeNSPrefix){const e=t.split(\":\"),n=\"/\"===t.charAt(0)?\"/\":\"\";if(\"xmlns\"===e[0])return\"\";2===e.length&&(t=n+e[1])}return t}const mt=new RegExp(\"([^\\\\s=]+)\\\\s*(=\\\\s*(['\\\"])([\\\\s\\\\S]*?)\\\\3)?\",\"gm\");function xt(t,e,n,i=!1){const r=this.options;if(!0===i||!0!==r.ignoreAttributes&&\"string\"==typeof t){const i=s(t,mt),o=i.length,a={},h=new Array(o);let l=!1;const u={};for(let t=0;t<o;t++){const e=this.resolveNameSpace(i[t][1]),s=i[t][4];if(e.length&&void 0!==s){let i=s;r.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i,n,this.readonlyMatcher),h[t]=i,u[e]=i,l=!0}}l&&\"object\"==typeof e&&e.updateCurrent&&e.updateCurrent(u);const p=r.jPath?e.toString():this.readonlyMatcher;let c=!1;for(let t=0;t<o;t++){const e=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(e,p))continue;let n=r.attributeNamePrefix+e;if(e.length)if(r.transformAttributeName&&(n=r.transformAttributeName(n)),n=Pt(n,r),void 0!==i[t][4]){const i=h[t],s=r.attributeValueProcessor(e,i,p);a[n]=null==s?i:typeof s!=typeof i||s!==i?s:Tt(i,r.parseAttributeValue,r.numberParseOptions),c=!0}else r.allowBooleanAttributes&&(a[n]=!0,c=!0)}if(!c)return;if(r.attributesGroupName&&!r.preserveOrder){const t={};return t[r.attributesGroupName]=a,t}return a}}const Nt=function(t){t=t.replace(/\\r\\n?/g,\"\\n\");const e=new $(\"!xml\");let n=e,i=\"\";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const s=this.options,r=new k(s.processEntities),o=t.length;for(let a=0;a<o;a++)if(\"<\"===t[a]){const h=t.charCodeAt(a+1);if(47===h){const e=vt(t,\">\",a,\"Closing Tag is not closed.\");let r=t.substring(a+2,e).trim();if(s.removeNSPrefix){const t=r.indexOf(\":\");-1!==t&&(r=r.substr(t+1))}r=Ct(s.transformTagName,r,\"\",s).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(r&&s.unpairedTagsSet.has(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);o&&s.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i=\"\",a=e}else if(63===h){let e=_t(t,a,!1,\"?>\");if(!e)throw new Error(\"Pi Tag is not closed.\");i=this.saveTextToParentTag(i,n,this.readonlyMatcher);const o=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName,!0);if(o){const t=o[this.options.attributeNamePrefix+\"version\"];this.entityDecoder.setXmlVersion(Number(t)||1),r.setXmlVersion(Number(t)||1)}if(s.ignoreDeclaration&&\"?xml\"===e.tagName||s.ignorePiTags);else{const t=new $(e.tagName);t.add(s.textNodeName,\"\"),e.tagName!==e.tagExp&&e.attrExpPresent&&!0!==s.ignoreAttributes&&(t[\":@\"]=o),this.addChild(n,t,this.readonlyMatcher,a)}a=e.closeIndex+1}else if(33===h&&45===t.charCodeAt(a+2)&&45===t.charCodeAt(a+3)){const e=vt(t,\"--\\x3e\",a+4,\"Comment is not closed.\");if(s.commentPropName){const r=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(s.commentPropName,[{[s.textNodeName]:r}])}a=e}else if(33===h&&68===t.charCodeAt(a+2)){const e=r.readDocType(t,a);this.entityDecoder.addInputEntities(e.entities),a=e.i}else if(33===h&&91===t.charCodeAt(a+2)){const e=vt(t,\"]]>\",a,\"CDATA is not closed.\")-2,r=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let o=this.parseTextData(r,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=\"\"),s.cdataPropName?n.add(s.cdataPropName,[{[s.textNodeName]:r}]):n.add(s.textNodeName,o),a=e+2}else{let r=_t(t,a,s.removeNSPrefix);if(!r){const e=t.substring(Math.max(0,a-50),Math.min(o,a+50));throw new Error(`readTagExp returned undefined at position ${a}. Context: \"${e}\"`)}let h=r.tagName;const l=r.rawTagName;let u=r.tagExp,p=r.attrExpPresent,c=r.closeIndex;if(({tagName:h,tagExp:u}=Ct(s.transformTagName,h,u,s)),s.strictReservedNames&&(h===s.commentPropName||h===s.cdataPropName||h===s.textNodeName||h===s.attributesGroupName))throw new Error(`Invalid tag name: ${h}`);n&&i&&\"!xml\"!==n.tagname&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));const d=n;d&&s.unpairedTagsSet.has(d.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;u.length>0&&u.lastIndexOf(\"/\")===u.length-1&&(f=!0,\"/\"===h[h.length-1]?(h=h.substr(0,h.length-1),u=h):u=u.substr(0,u.length-1),p=h!==u);let g,m=null,x={};g=ct(l),h!==e.tagname&&this.matcher.push(h,{},g),h!==u&&p&&(m=this.buildAttributesMap(u,this.matcher,h),m&&(x=pt(m,s))),h!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const N=a;if(this.isCurrentNodeStopNode){let e=\"\";if(f)a=r.closeIndex;else if(s.unpairedTagsSet.has(h))a=r.closeIndex;else{const n=this.readStopNodeData(t,l,c+1);if(!n)throw new Error(`Unexpected end of ${l}`);a=n.i,e=n.tagContent}const i=new $(h);m&&(i[\":@\"]=m),i.add(s.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,i,this.readonlyMatcher,N)}else{if(f){({tagName:h,tagExp:u}=Ct(s.transformTagName,h,u,s));const t=new $(h);m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(s.unpairedTagsSet.has(h)){const t=new $(h);m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=r.closeIndex;continue}{const t=new $(h);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");this.tagsNodeStack.push(n),m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),n=t}}i=\"\",a=c}}}else i+=t[a];return e.child};function bt(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.jPath?n.toString():n,r=this.options.updateTag(e.tagname,s,e[\":@\"]);!1===r||(\"string\"==typeof r?(e.tagname=r,t.addChild(e,i)):t.addChild(e,i))}function yt(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const s=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,s)))return t}if(i.tagFilter){const s=this.options.jPath?n.toString():n;if(!i.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function Et(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[\":@\"]&&0!==Object.keys(e[\":@\"]).length,i))&&\"\"!==t&&e.add(this.options.textNodeName,t),t=\"\"),t}function wt(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function vt(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function St(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s}function _t(t,e,n,i=\">\"){const s=function(t,e,n=\">\"){let i=0;const s=t.length,r=n.charCodeAt(0),o=n.length>1?n.charCodeAt(1):-1;let a=\"\",h=e;for(let n=e;n<s;n++){const e=t.charCodeAt(n);if(i)e===i&&(i=0);else if(34===e||39===e)i=e;else if(e===r){if(-1===o)return a+=t.substring(h,n),{data:a,index:n};if(t.charCodeAt(n+1)===o)return a+=t.substring(h,n),{data:a,index:n}}else 9!==e||i||(a+=t.substring(h,n)+\" \",h=n+1)}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\\s/);let h=r,l=!0;-1!==a&&(h=r.substring(0,a),r=r.substring(a+1).trimStart());const u=h;if(n){const t=h.indexOf(\":\");-1!==t&&(h=h.substr(t+1),l=h!==s.data.substr(t+1))}return{tagName:h,tagExp:r,closeIndex:o,attrExpPresent:l,rawTagName:u}}function At(t,e,n){const i=n;let s=1;const r=t.length;for(;n<r;n++)if(\"<\"===t[n]){const r=t.charCodeAt(n+1);if(47===r){const r=St(t,\">\",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if(63===r)n=vt(t,\"?>\",n+1,\"StopNode is not closed.\");else if(33===r&&45===t.charCodeAt(n+2)&&45===t.charCodeAt(n+3))n=vt(t,\"--\\x3e\",n+3,\"StopNode is not closed.\");else if(33===r&&91===t.charCodeAt(n+2))n=vt(t,\"]]>\",n,\"StopNode is not closed.\")-2;else{const i=_t(t,n,!1);i&&((i&&i.tagName)===e&&\"/\"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}}function Tt(t,e,n){if(e&&\"string\"==typeof t){const e=t.trim();return\"true\"===e||\"false\"!==e&&function(t,e={}){if(e=Object.assign({},X,e),!t||\"string\"!=typeof t)return t;let n=t.trim();if(0===n.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(\"0\"===n)return 0;if(e.hex&&U.test(n))return q(n,16);if(e.binary&&B.test(n))return q(n,2);if(e.octal&&W.test(n))return q(n,8);if(isFinite(n)){if(n.includes(\"e\")||n.includes(\"E\"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(Y);if(i){let s=i[1]||\"\";const r=-1===i[3].indexOf(\"e\")?\"E\":\"e\",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:(1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r)&&o.length>0?n.leadingZeros&&!a?(e=(i[1]||\"\")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=z.exec(n);if(s){const r=s[1]||\"\",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(\".\")?(\".\"===(i=i.replace(/0+$/,\"\"))?i=\"0\":\".\"===i[0]?i=\"0\"+i:\".\"===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const h=r?\".\"===t[o.length+1]:\".\"===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!h))return t;{const i=Number(n),s=String(i);if(0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf(\".\"))return\"0\"===s||s===a||s===`${r}${a}`?i:t;let h=o?a:n;return o?h===s||r+h===s?i:t:h===s||h===r+s?i:t}}return t}}var i;return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case\"null\":return null;case\"infinity\":return e;case\"string\":return i?\"Infinity\":\"-Infinity\";default:return t}}(t,Number(n),e)}(t,n)}return void 0!==t?t:\"\"}function Ct(t,e,n,i){if(t){const i=t(e);n===e&&(n=i),e=i}return{tagName:e=Pt(e,i),tagExp:n}}function Pt(t,e){if(a.includes(t))throw new Error(`[SECURITY] Invalid name: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);return o.includes(t)?e.onDangerousProperty(t):t}const $t=$.getMetaDataSymbol();function Ot(t,e){if(!t||\"object\"!=typeof t)return{};if(!e)return t;const n={};for(const i in t)i.startsWith(e)?n[i.substring(e.length)]=t[i]:n[i]=t[i];return n}function It(t,e,n,i){return Vt(t,e,n,i)}function Vt(t,e,n,i){let s;const r={};for(let o=0;o<t.length;o++){const a=t[o],h=Dt(a);if(void 0!==h&&h!==e.textNodeName){const t=Ot(a[\":@\"]||{},e.attributeNamePrefix);n.push(h,t)}if(h===e.textNodeName)void 0===s?s=a[h]:s+=\"\"+a[h];else{if(void 0===h)continue;if(a[h]){let t=Vt(a[h],e,n,i);const s=jt(t,e);if(0===Object.keys(t).length&&e.alwaysCreateTextNode&&(t[e.textNodeName]=\"\"),a[\":@\"]?Mt(t,a[\":@\"],i,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]=\"\":t=\"\"):t=t[e.textNodeName],void 0!==a[$t]&&\"object\"==typeof t&&null!==t&&(t[$t]=a[$t]),void 0!==r[h]&&Object.prototype.hasOwnProperty.call(r,h))Array.isArray(r[h])||(r[h]=[r[h]]),r[h].push(t);else{const n=e.jPath?i.toString():i;e.isArray(h,n,s)?r[h]=[t]:r[h]=t}void 0!==h&&h!==e.textNodeName&&n.pop()}}}return\"string\"==typeof s?s.length>0&&(r[e.textNodeName]=s):void 0!==s&&(r[e.textNodeName]=s),r}function Dt(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(\":@\"!==n)return n}}function Mt(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o],a=r.startsWith(i.attributeNamePrefix)?r.substring(i.attributeNamePrefix.length):r,h=i.jPath?n.toString()+\".\"+a:n;i.isArray(r,h,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function jt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&\"boolean\"!=typeof t[n]&&0!==t[n])}class Lt{constructor(t){this.externalEntities={},this.options=C(t)}parse(t,e){if(\"string\"!=typeof t&&t.toString)t=t.toString();else if(\"string\"!=typeof t)throw new Error(\"XML data is accepted in String or Bytes[] form.\");if(e){!0===e&&(e={});const n=l(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new dt(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:It(i,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,e){if(-1!==e.indexOf(\"&\"))throw new Error(\"Entity value can't have '&'\");if(-1!==t.indexOf(\"&\")||-1!==t.indexOf(\";\"))throw new Error(\"An entity must be set without '&' and ';'. Eg. use '#xD' for '
'\");if(\"&\"===e)throw new Error(\"An entity with value '&' is not permitted\");this.externalEntities[t]=e}static getMetaDataSymbol(){return $.getMetaDataSymbol()}}function kt(t){return String(t).replace(/--/g,\"- -\").replace(/--/g,\"- -\").replace(/-$/,\"- \")}function Rt(t){return String(t).replace(/\\]\\]>/g,\"]]]]><![CDATA[>\")}function Ft(t){return String(t).replace(/\"/g,\""\").replace(/'/g,\"'\")}function Gt(t,e,n,i,s){return n.sanitizeName?L(t,{xmlVersion:s})?t:n.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function Ut(t,e){let n=\"\";e.format&&(n=\"\\n\");const i=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let t=0;t<e.stopNodes.length;t++){const n=e.stopNodes[t];\"string\"==typeof n?i.push(new K(n)):n instanceof K&&i.push(n)}const s=function(t,e){if(!Array.isArray(t)||0===t.length)return\"1.0\";const n=t[0];if(\"?xml\"===Yt(n)){const t=n[\":@\"];if(t){const n=e.attributeNamePrefix+\"version\";if(t[n])return t[n]}}return\"1.0\"}(t,e);return Bt(t,e,n,new J,i,s)}function Bt(t,e,n,i,s,r){let o=\"\",a=!1;if(e.maxNestedTags&&i.getDepth()>e.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");if(!Array.isArray(t)){if(null!=t){let n=t.toString();return n=Jt(n,e),n}return\"\"}for(let h=0;h<t.length;h++){const l=t[h],u=Yt(l);if(void 0===u)continue;const p=u===e.textNodeName||u===e.cdataPropName||u===e.commentPropName||\"?\"===u[0]?u:Gt(u,!1,e,i,r),c=Wt(l[\":@\"],e);i.push(p,c);const d=Zt(i,s);if(p===e.textNodeName){let t=l[u];d||(t=e.tagValueProcessor(p,t),t=Jt(t,e)),a&&(o+=n),o+=t,a=!1,i.pop();continue}if(p===e.cdataPropName){a&&(o+=n),o+=`<![CDATA[${Rt(l[u][0][e.textNodeName])}]]>`,a=!1,i.pop();continue}if(p===e.commentPropName){o+=n+`\\x3c!--${kt(l[u][0][e.textNodeName])}--\\x3e`,a=!0,i.pop();continue}if(\"?\"===p[0]){o+=(\"?xml\"===p?\"\":n)+`<${p}${qt(l[\":@\"],e,d,i,r)}?>`,a=!0,i.pop();continue}let f=n;\"\"!==f&&(f+=e.indentBy);const g=n+`<${p}${qt(l[\":@\"],e,d,i,r)}`;let m;m=d?zt(l[u],e):Bt(l[u],e,f,i,s,r),-1!==e.unpairedTags.indexOf(p)?e.suppressUnpairedNode?o+=g+\">\":o+=g+\"/>\":m&&0!==m.length||!e.suppressEmptyNode?m&&m.endsWith(\">\")?o+=g+`>${m}${n}</${p}>`:(o+=g+\">\",m&&\"\"!==n&&(m.includes(\"/>\")||m.includes(\"</\"))?o+=n+e.indentBy+m+n:o+=m,o+=`</${p}>`):o+=g+\"/>\",a=!0,i.pop()}return o}function Wt(t,e){if(!t||e.ignoreAttributes)return null;const n={};let i=!1;for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s.startsWith(e.attributeNamePrefix)?s.substr(e.attributeNamePrefix.length):s]=Ft(t[s]),i=!0);return i?n:null}function zt(t,e){if(!Array.isArray(t))return null!=t?t.toString():\"\";let n=\"\";for(let i=0;i<t.length;i++){const s=t[i],r=Yt(s);if(r===e.textNodeName)n+=s[r];else if(r===e.cdataPropName)n+=s[r][0][e.textNodeName];else if(r===e.commentPropName)n+=s[r][0][e.textNodeName];else{if(r&&\"?\"===r[0])continue;if(r){const t=Xt(s[\":@\"],e),i=zt(s[r],e);i&&0!==i.length?n+=`<${r}${t}>${i}</${r}>`:n+=`<${r}${t}/>`}}}return n}function Xt(t,e){let n=\"\";if(t&&!e.ignoreAttributes)for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let s=t[i];!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}=\"${Ft(s)}\"`}return n}function Yt(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(Object.prototype.hasOwnProperty.call(t,i)&&\":@\"!==i)return i}}function qt(t,e,n,i,s){let r=\"\";if(t&&!e.ignoreAttributes)for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;const a=o.substr(e.attributeNamePrefix.length),h=n?a:Gt(a,!0,e,i,s);let l;n?l=t[o]:(l=e.attributeValueProcessor(o,t[o]),l=Jt(l,e)),!0===l&&e.suppressBooleanAttributes?r+=` ${h}`:r+=` ${h}=\"${Ft(l)}\"`}return r}function Zt(t,e){if(!e||0===e.length)return!1;for(let n=0;n<e.length;n++)if(t.matches(e[n]))return!0;return!1}function Jt(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const Kt={attributeNamePrefix:\"@_\",attributesGroupName:!1,textNodeName:\"#text\",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:\" \",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp(\"&\",\"g\"),val:\"&\"},{regex:new RegExp(\">\",\"g\"),val:\">\"},{regex:new RegExp(\"<\",\"g\"),val:\"<\"},{regex:new RegExp(\"'\",\"g\"),val:\"'\"},{regex:new RegExp('\"',\"g\"),val:\""\"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function Qt(t){if(this.options=Object.assign({},Kt,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];\"string\"==typeof e?this.stopNodeExpressions.push(new K(e)):e instanceof K&&this.stopNodeExpressions.push(e)}var e;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=\"function\"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if(\"string\"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ne),this.processTextOrObjNode=te,this.options.format?(this.indentate=ee,this.tagEndChar=\">\\n\",this.newLine=\"\\n\"):(this.indentate=function(){return\"\"},this.tagEndChar=\">\",this.newLine=\"\")}function Ht(t,e,n,i,s){return n.sanitizeName?L(t,{xmlVersion:s})?t:n.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function te(t,e,n,i,s){const r=this.extractAttributes(t);if(i.push(e,r),this.checkStopNode(i)){const s=this.buildRawContent(t),r=this.buildAttributesForStopNode(t);return i.pop(),this.buildObjectNode(s,e,r,n)}const o=this.j2x(t,n+1,i,s);return i.pop(),\"?\"===e[0]?this.buildTextValNode(\"\",e,o.attrStr,n,i):void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,o.attrStr,n,i):this.buildObjectNode(o.val,e,o.attrStr,n)}function ee(t){return this.options.indentBy.repeat(t)}function ne(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Qt.prototype.build=function(t){if(this.options.preserveOrder)return Ut(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});const e=new J,n=function(t,e){const n=t[\"?xml\"];if(n&&\"object\"==typeof n){if(e.attributesGroupName&&n[e.attributesGroupName]){const t=n[e.attributesGroupName][e.attributeNamePrefix+\"version\"];if(t)return t}const t=n[e.attributeNamePrefix+\"version\"];if(t)return t}return\"1.0\"}(t,this.options);return this.j2x(t,0,e,n).val}},Qt.prototype.j2x=function(t,e,n,i){let s=\"\",r=\"\";if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");const o=this.options.jPath?n.toString():n,a=this.checkStopNode(n);for(let h in t){if(!Object.prototype.hasOwnProperty.call(t,h))continue;const l=h===this.options.textNodeName||h===this.options.cdataPropName||h===this.options.commentPropName||this.options.attributesGroupName&&h===this.options.attributesGroupName||this.isAttribute(h)||\"?\"===h[0]?h:Ht(h,!1,this.options,n,i);if(void 0===t[h])this.isAttribute(h)&&(r+=\"\");else if(null===t[h])this.isAttribute(h)||l===this.options.cdataPropName||l===this.options.commentPropName?r+=\"\":\"?\"===l[0]?r+=this.indentate(e)+\"<\"+l+\"?\"+this.tagEndChar:r+=this.indentate(e)+\"<\"+l+\"/\"+this.tagEndChar;else if(t[h]instanceof Date)r+=this.buildTextValNode(t[h],l,\"\",e,n);else if(\"object\"!=typeof t[h]){const u=this.isAttribute(h);if(u&&!this.ignoreAttributesFn(u,o)){const e=Ht(u,!0,this.options,n,i);s+=this.buildAttrPairStr(e,\"\"+t[h],a)}else if(!u)if(h===this.options.textNodeName){let e=this.options.tagValueProcessor(h,\"\"+t[h]);r+=this.replaceEntitiesValue(e)}else{n.push(l);const i=this.checkStopNode(n);if(n.pop(),i){const n=\"\"+t[h];r+=\"\"===n?this.indentate(e)+\"<\"+l+this.closeTag(l)+this.tagEndChar:this.indentate(e)+\"<\"+l+\">\"+n+\"</\"+l+this.tagEndChar}else r+=this.buildTextValNode(t[h],l,\"\",e,n)}}else if(Array.isArray(t[h])){const s=t[h].length;let o=\"\",a=\"\";for(let u=0;u<s;u++){const s=t[h][u];if(void 0===s);else if(null===s)\"?\"===l[0]?r+=this.indentate(e)+\"<\"+l+\"?\"+this.tagEndChar:r+=this.indentate(e)+\"<\"+l+\"/\"+this.tagEndChar;else if(\"object\"==typeof s)if(this.options.oneListGroup){n.push(l);const t=this.j2x(s,e+1,n,i);n.pop(),o+=t.val,this.options.attributesGroupName&&s.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else o+=this.processTextOrObjNode(s,l,e,n,i);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(l,s);t=this.replaceEntitiesValue(t),o+=t}else{n.push(l);const t=this.checkStopNode(n);if(n.pop(),t){const t=\"\"+s;o+=\"\"===t?this.indentate(e)+\"<\"+l+this.closeTag(l)+this.tagEndChar:this.indentate(e)+\"<\"+l+\">\"+t+\"</\"+l+this.tagEndChar}else o+=this.buildTextValNode(s,l,\"\",e,n)}}this.options.oneListGroup&&(o=this.buildObjectNode(o,l,a,e)),r+=o}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const e=Object.keys(t[h]),r=e.length;for(let o=0;o<r;o++){const r=Ht(e[o],!0,this.options,n,i);s+=this.buildAttrPairStr(r,\"\"+t[h][e[o]],a)}}else r+=this.processTextOrObjNode(t[h],l,e,n,i)}return{attrStr:s,val:r}},Qt.prototype.buildAttrPairStr=function(t,e,n){return n||(e=this.options.attributeValueProcessor(t,\"\"+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&\"true\"===e?\" \"+t:\" \"+t+'=\"'+Ft(e)+'\"'},Qt.prototype.extractAttributes=function(t){if(!t||\"object\"!=typeof t)return null;const e={};let n=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const i=t[this.options.attributesGroupName];for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t]=Ft(i[t]),n=!0)}else for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const s=this.isAttribute(i);s&&(e[s]=Ft(t[i]),n=!0)}return n?e:null},Qt.prototype.buildRawContent=function(t){if(\"string\"==typeof t)return t;if(\"object\"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];let e=\"\";for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(this.isAttribute(n))continue;if(this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;const i=t[n];if(n===this.options.textNodeName)e+=i;else if(Array.isArray(i)){for(let t of i)if(\"string\"==typeof t||\"number\"==typeof t)e+=`<${n}>${t}</${n}>`;else if(\"object\"==typeof t&&null!==t){const i=this.buildRawContent(t),s=this.buildAttributesForStopNode(t);e+=\"\"===i?`<${n}${s}/>`:`<${n}${s}>${i}</${n}>`}}else if(\"object\"==typeof i&&null!==i){const t=this.buildRawContent(i),s=this.buildAttributesForStopNode(i);e+=\"\"===t?`<${n}${s}/>`:`<${n}${s}>${t}</${n}>`}else e+=`<${n}>${i}</${n}>`}return e},Qt.prototype.buildAttributesForStopNode=function(t){if(!t||\"object\"!=typeof t)return\"\";let e=\"\";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const n=t[this.options.attributesGroupName];for(let t in n){if(!Object.prototype.hasOwnProperty.call(n,t))continue;const i=t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t,s=n[t];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+i:e+=\" \"+i+'=\"'+s+'\"'}}else for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const i=this.isAttribute(n);if(i){const s=t[n];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+i:e+=\" \"+i+'=\"'+s+'\"'}}return e},Qt.prototype.buildObjectNode=function(t,e,n,i){if(\"\"===t)return\"?\"===e[0]?this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar:this.indentate(i)+\"<\"+e+n+this.closeTag(e)+this.tagEndChar;if(\"?\"===e[0])return this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar;{let s=\"</\"+e+this.tagEndChar,r=\"\";return\"?\"===e[0]&&(r=\"?\",s=\"\"),!n&&\"\"!==n||-1!==t.indexOf(\"<\")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\\x3c!--${t}--\\x3e`+this.newLine:this.indentate(i)+\"<\"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+\"<\"+e+n+r+\">\"+t+s}},Qt.prototype.closeTag=function(t){let e=\"\";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e=\"/\"):e=this.options.suppressEmptyNode?\"/\":`></${t}`,e},Qt.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(let e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},Qt.prototype.buildTextValNode=function(t,e,n,i,s){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){const e=Rt(t);return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){const e=kt(t);return this.indentate(i)+`\\x3c!--${e}--\\x3e`+this.newLine}if(\"?\"===e[0])return this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),\"\"===s?this.indentate(i)+\"<\"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+\"<\"+e+n+\">\"+s+\"</\"+e+this.tagEndChar}},Qt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const ie=Qt,se={validate:l};module.exports=e})();","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(328);\n",""],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnIA;AACA;AACA;AACA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvYA;AACA;AACA;AACA;AACA;AACA;AACA;AA4BA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AAIA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;ACnXA;AAWA;AASA;AA9CA;AACA;AAEA;AACA;AAsBA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AASA;AACA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAMA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1TA;AAqJA;AAtPA;AACA;AACA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;;;;ACjTA;AAVA;AAOA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;AC7BA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;;;;;;;;ACHA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACNA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../../shared-types/dist/ci-detection.js","../../shared-types/dist/ctrf.js","../../shared-types/dist/index.js","../../shared-types/dist/js-test-name-snippets.js","../../shared-types/dist/source-snippets.js","../../shared-types/dist/test-locations.js","../../shared-types/dist/upload.js",".././src/cli.ts",".././src/source-snippets.ts",".././src/trx-parser.ts",".././src/uploader.ts","../external node-commonjs \"child_process\"","../external node-commonjs \"fs\"","../external node-commonjs \"fs/promises\"","../external node-commonjs \"node:crypto\"","../external node-commonjs \"node:events\"","../external node-commonjs \"node:fs\"","../external node-commonjs \"node:fs/promises\"","../external node-commonjs \"node:path\"","../external node-commonjs \"node:stream\"","../external node-commonjs \"node:string_decoder\"","../external node-commonjs \"node:url\"","../external node-commonjs \"os\"","../external node-commonjs \"path\"",".././node_modules/glob/dist/commonjs/index.min.js","../../../node_modules/fast-xml-parser/lib/fxp.cjs","../webpack/bootstrap","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/compat","../webpack/before-startup","../webpack/startup","../webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.detectCIContext = detectCIContext;\nfunction removePrefix(value, prefix) {\n if (!value) {\n return undefined;\n }\n return value.startsWith(prefix) ? value.slice(prefix.length) : value;\n}\nfunction readEnvironment() {\n const runtime = globalThis;\n return runtime.process?.env ?? {};\n}\nfunction buildGithubRepositoryUrl(env) {\n if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY) {\n return undefined;\n }\n return `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`;\n}\nfunction buildGithubBuildUrl(env) {\n if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY || !env.GITHUB_RUN_ID) {\n return undefined;\n }\n return `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`;\n}\nfunction detectGitHubBranch(env) {\n if (env.GITHUB_HEAD_REF) {\n return env.GITHUB_HEAD_REF;\n }\n if (env.GITHUB_REF?.startsWith('refs/heads/')) {\n return env.GITHUB_REF_NAME ?? removePrefix(env.GITHUB_REF, 'refs/heads/');\n }\n return undefined;\n}\nfunction detectGitHubActionsContext(env) {\n return {\n branch: detectGitHubBranch(env),\n commitSha: env.GITHUB_SHA,\n repositoryUrl: buildGithubRepositoryUrl(env),\n buildNumber: env.GITHUB_RUN_NUMBER,\n buildUrl: buildGithubBuildUrl(env),\n };\n}\nfunction detectGitLabContext(env) {\n return {\n branch: env.CI_COMMIT_BRANCH || env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,\n commitSha: env.CI_COMMIT_SHA,\n repositoryUrl: env.CI_PROJECT_URL,\n buildNumber: env.CI_PIPELINE_IID,\n buildUrl: env.CI_PIPELINE_URL,\n };\n}\nfunction detectAzurePipelinesContext(env) {\n return {\n branch: removePrefix(env.BUILD_SOURCEBRANCH, 'refs/heads/'),\n commitSha: env.BUILD_SOURCEVERSION,\n repositoryUrl: env.BUILD_REPOSITORY_URI,\n buildNumber: env.BUILD_BUILDNUMBER,\n buildUrl: env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI && env.SYSTEM_TEAMPROJECT && env.BUILD_BUILDID\n ? `${env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${env.SYSTEM_TEAMPROJECT}/_build/results?buildId=${env.BUILD_BUILDID}`\n : undefined,\n };\n}\nfunction detectCircleCIContext(env) {\n return {\n branch: env.CIRCLE_BRANCH,\n commitSha: env.CIRCLE_SHA1,\n repositoryUrl: env.CIRCLE_REPOSITORY_URL,\n buildNumber: env.CIRCLE_BUILD_NUM,\n buildUrl: env.CIRCLE_BUILD_URL,\n };\n}\nfunction detectJenkinsContext(env) {\n return {\n branch: removePrefix(env.GIT_BRANCH, 'origin/'),\n commitSha: env.GIT_COMMIT,\n repositoryUrl: env.GIT_URL,\n buildNumber: env.BUILD_NUMBER,\n buildUrl: env.BUILD_URL,\n };\n}\nfunction detectBitbucketContext(env) {\n return {\n branch: env.BITBUCKET_BRANCH,\n commitSha: env.BITBUCKET_COMMIT,\n repositoryUrl: env.BITBUCKET_GIT_HTTP_ORIGIN,\n buildNumber: env.BITBUCKET_BUILD_NUMBER,\n buildUrl: env.BITBUCKET_REPO_FULL_NAME && env.BITBUCKET_BUILD_NUMBER\n ? `https://bitbucket.org/${env.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${env.BITBUCKET_BUILD_NUMBER}`\n : undefined,\n };\n}\nconst CI_PROVIDER_DETECTORS = [\n {\n isMatch: (env) => env.GITHUB_ACTIONS === 'true',\n detect: detectGitHubActionsContext,\n },\n {\n isMatch: (env) => env.GITLAB_CI === 'true',\n detect: detectGitLabContext,\n },\n {\n isMatch: (env) => env.TF_BUILD === 'True',\n detect: detectAzurePipelinesContext,\n },\n {\n isMatch: (env) => env.CIRCLECI === 'true',\n detect: detectCircleCIContext,\n },\n {\n isMatch: (env) => Boolean(env.JENKINS_URL),\n detect: detectJenkinsContext,\n },\n {\n isMatch: (env) => Boolean(env.BITBUCKET_BUILD_NUMBER),\n detect: detectBitbucketContext,\n },\n];\n/**\n * Detect CI context from environment variables\n * Supports: GitHub Actions, GitLab CI, Azure Pipelines, CircleCI, Jenkins, Bitbucket Pipelines\n */\nfunction detectCIContext() {\n const env = readEnvironment();\n for (const provider of CI_PROVIDER_DETECTORS) {\n if (provider.isMatch(env)) {\n return provider.detect(env);\n }\n }\n return {};\n}\n//# sourceMappingURL=ci-detection.js.map","\"use strict\";\n// CTRF (Common Test Report Format) Type Definitions\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ctrf.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestLocationCollector = exports.enrichReportWithJsTestNameSourceSnippets = exports.resolveSourceSnippetOptions = exports.enrichReportWithSourceSnippets = exports.ensureReportId = exports.mapAttachmentsToTestResults = exports.uploadArtifacts = exports.uploadTestRun = exports.detectCIContext = void 0;\n// CTRF types\n__exportStar(require(\"./ctrf\"), exports);\nvar ci_detection_1 = require(\"./ci-detection\");\nObject.defineProperty(exports, \"detectCIContext\", { enumerable: true, get: function () { return ci_detection_1.detectCIContext; } });\nvar upload_1 = require(\"./upload\");\nObject.defineProperty(exports, \"uploadTestRun\", { enumerable: true, get: function () { return upload_1.uploadTestRun; } });\nObject.defineProperty(exports, \"uploadArtifacts\", { enumerable: true, get: function () { return upload_1.uploadArtifacts; } });\nObject.defineProperty(exports, \"mapAttachmentsToTestResults\", { enumerable: true, get: function () { return upload_1.mapAttachmentsToTestResults; } });\nObject.defineProperty(exports, \"ensureReportId\", { enumerable: true, get: function () { return upload_1.ensureReportId; } });\nvar source_snippets_1 = require(\"./source-snippets\");\nObject.defineProperty(exports, \"enrichReportWithSourceSnippets\", { enumerable: true, get: function () { return source_snippets_1.enrichReportWithSourceSnippets; } });\nObject.defineProperty(exports, \"resolveSourceSnippetOptions\", { enumerable: true, get: function () { return source_snippets_1.resolveSourceSnippetOptions; } });\nvar js_test_name_snippets_1 = require(\"./js-test-name-snippets\");\nObject.defineProperty(exports, \"enrichReportWithJsTestNameSourceSnippets\", { enumerable: true, get: function () { return js_test_name_snippets_1.enrichReportWithJsTestNameSourceSnippets; } });\nvar test_locations_1 = require(\"./test-locations\");\nObject.defineProperty(exports, \"createTestLocationCollector\", { enumerable: true, get: function () { return test_locations_1.createTestLocationCollector; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enrichReportWithJsTestNameSourceSnippets = enrichReportWithJsTestNameSourceSnippets;\nconst promises_1 = require(\"node:fs/promises\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst source_snippets_1 = require(\"./source-snippets\");\nconst MAX_CANDIDATES = 3;\n// Finds the start of common JS/TS test declarations, then the title is parsed\n// manually so titles can contain non-delimiting quotes like `it(\"doesn't\")`.\nconst JS_TEST_DECLARATION_PATTERN = /\\b(describe|it|test)(?:\\.(only|skip))?\\s*\\(\\s*(['\"`])/g;\nasync function enrichReportWithJsTestNameSourceSnippets(report, options) {\n const resolved = (0, source_snippets_1.resolveSourceSnippetOptions)(options);\n const fileCandidateCache = new Map();\n await Promise.all(report.results.tests.map(async (test) => {\n if (test.snippet || !test.filePath) {\n return;\n }\n const filePath = node_path_1.default.resolve(resolved.sourceRoot, test.filePath);\n if (!isInsideSourceRoot(filePath, resolved.sourceRoot)) {\n return;\n }\n const candidates = await getCachedJsTestCandidates(filePath, fileCandidateCache);\n if (!candidates) {\n return;\n }\n const matches = rankCandidatesForTest(test, candidates).slice(0, MAX_CANDIDATES);\n if (matches.length === 0) {\n return;\n }\n test.line ?? (test.line = matches[0].line);\n test.snippet = formatCandidateSnippet(matches, resolved);\n }));\n}\nfunction getCachedJsTestCandidates(filePath, fileCandidateCache) {\n let cached = fileCandidateCache.get(filePath);\n if (!cached) {\n cached = (0, promises_1.readFile)(filePath, 'utf-8')\n .then((content) => scanJsTestCandidates(content))\n .catch(() => undefined);\n fileCandidateCache.set(filePath, cached);\n }\n return cached;\n}\n// This scanner intentionally handles the common JS/TS test declaration shapes\n// without adding parser dependencies to every reporter package. Exact runner\n// line metadata still wins; this fallback exists to give AI review bounded\n// source context when the reporter only emitted file path and test name.\nfunction scanJsTestCandidates(content) {\n const lineOffsets = buildLineOffsets(content);\n const blocks = scanJsTestBlocks(content, lineOffsets);\n const describeBlocks = blocks.filter((block) => block.kind === 'describe');\n return blocks\n .filter((block) => block.kind === 'test')\n .map((block) => {\n const describeTitles = describeBlocks\n .filter((describeBlock) => describeBlock.startIndex < block.startIndex && describeBlock.endIndex >= block.endIndex)\n .sort((left, right) => left.startIndex - right.startIndex)\n .map((describeBlock) => describeBlock.title);\n return {\n title: block.title,\n describeTitles,\n fullName: [...describeTitles, block.title].join(' ').trim(),\n line: block.startLine,\n snippet: block.snippet,\n };\n });\n}\nfunction scanJsTestBlocks(content, lineOffsets) {\n const blocks = [];\n JS_TEST_DECLARATION_PATTERN.lastIndex = 0;\n let match;\n while ((match = JS_TEST_DECLARATION_PATTERN.exec(content)) !== null) {\n if (isCommentedLine(content, match.index)) {\n continue;\n }\n const title = readQuotedTitle(content, match.index + match[0].length, match[3]);\n if (!title) {\n continue;\n }\n const commaIndex = skipWhitespaceAndFindComma(content, title.endIndex + 1);\n if (commaIndex == null) {\n continue;\n }\n const kind = match[1] === 'describe' ? 'describe' : 'test';\n const startIndex = match.index;\n const openBraceIndex = findCallbackOpenBrace(content, commaIndex + 1);\n if (openBraceIndex == null) {\n continue;\n }\n const closeBraceIndex = findMatchingBrace(content, openBraceIndex);\n if (closeBraceIndex == null) {\n continue;\n }\n const endIndex = findSnippetEndIndex(content, closeBraceIndex);\n const snippet = content.slice(startIndex, endIndex).trim();\n if (!snippet) {\n continue;\n }\n blocks.push({\n kind,\n title: title.value.trim(),\n startIndex,\n endIndex,\n startLine: getLineNumber(lineOffsets, startIndex),\n snippet,\n });\n }\n return blocks;\n}\nfunction rankCandidatesForTest(test, candidates) {\n const normalizedName = normalizeWhitespace(test.name);\n const suiteChain = normalizeDescribeChain(test.suite);\n const exactFullNameMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.fullName) === normalizedName);\n if (exactFullNameMatches.length > 0) {\n return exactFullNameMatches;\n }\n if (suiteChain) {\n const suiteMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.title) === normalizedName &&\n normalizeWhitespace(candidate.describeTitles.join(' ')) === suiteChain);\n if (suiteMatches.length > 0) {\n return suiteMatches;\n }\n }\n const leafTitleMatches = candidates.filter((candidate) => normalizeWhitespace(candidate.title) === normalizedName);\n if (leafTitleMatches.length > 0) {\n return leafTitleMatches;\n }\n return candidates.filter((candidate) => {\n const normalizedTitle = normalizeWhitespace(candidate.title);\n if (!normalizedName.endsWith(normalizedTitle)) {\n return false;\n }\n const prefix = normalizedName\n .slice(0, normalizedName.length - normalizedTitle.length)\n .trim();\n return prefix.length > 0 && normalizeWhitespace(candidate.describeTitles.join(' ')) === prefix;\n });\n}\nfunction formatCandidateSnippet(candidates, options) {\n const combined = candidates.length === 1\n ? candidates[0].snippet\n : candidates\n .map((candidate, index) => `Candidate ${index + 1} (line ${candidate.line})\\n${candidate.snippet}`)\n .join('\\n\\n');\n const boundedLines = combined.split(/\\r?\\n/).slice(0, options.maxLines).join('\\n').trim();\n if (boundedLines.length <= options.maxChars) {\n return boundedLines;\n }\n return boundedLines.slice(0, options.maxChars);\n}\nfunction findCallbackOpenBrace(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '/' && content[index + 1] === '/') {\n index = skipLineComment(content, index + 2);\n continue;\n }\n if (char === '/' && content[index + 1] === '*') {\n index = skipBlockComment(content, index + 2);\n continue;\n }\n if (content.startsWith('=>', index)) {\n return findNextBlockBrace(content, index + 2);\n }\n if (startsWithWord(content, index, 'function')) {\n return findNextBlockBrace(content, index + 'function'.length);\n }\n if (char === ';') {\n return undefined;\n }\n }\n return undefined;\n}\nfunction findNextBlockBrace(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '{') {\n return index;\n }\n if (char === '\\n' && looksLikeLineTerminator(content, index + 1)) {\n return undefined;\n }\n }\n return undefined;\n}\nfunction findMatchingBrace(content, openBraceIndex) {\n let depth = 0;\n for (let index = openBraceIndex; index < content.length; index++) {\n const char = content[index];\n if (char === \"'\" || char === '\"' || char === '`') {\n index = skipQuotedString(content, index);\n continue;\n }\n if (char === '/' && content[index + 1] === '/') {\n index = skipLineComment(content, index + 2);\n continue;\n }\n if (char === '/' && content[index + 1] === '*') {\n index = skipBlockComment(content, index + 2);\n continue;\n }\n if (char === '{') {\n depth++;\n continue;\n }\n if (char === '}') {\n depth--;\n if (depth === 0) {\n return index;\n }\n }\n }\n return undefined;\n}\nfunction readQuotedTitle(content, startIndex, quote) {\n let value = '';\n for (let index = startIndex; index < content.length; index++) {\n const char = content[index];\n if (char === '\\\\') {\n value += char;\n if (index + 1 < content.length) {\n index++;\n value += content[index];\n }\n continue;\n }\n if (char === quote) {\n return { value, endIndex: index };\n }\n if (char === '\\n' && quote !== '`') {\n return undefined;\n }\n value += char;\n }\n return undefined;\n}\nfunction skipWhitespaceAndFindComma(content, fromIndex) {\n for (let index = fromIndex; index < content.length; index++) {\n const char = content[index];\n if (/\\s/.test(char)) {\n continue;\n }\n return char === ',' ? index : undefined;\n }\n return undefined;\n}\nfunction findSnippetEndIndex(content, closeBraceIndex) {\n let index = closeBraceIndex + 1;\n while (index < content.length) {\n const char = content[index];\n if (char === '\\r' || char === '\\n') {\n return index;\n }\n index++;\n }\n return content.length;\n}\nfunction skipQuotedString(content, startIndex) {\n const quote = content[startIndex];\n for (let index = startIndex + 1; index < content.length; index++) {\n const char = content[index];\n if (char === '\\\\') {\n index++;\n continue;\n }\n if (char === quote) {\n return index;\n }\n }\n return content.length - 1;\n}\nfunction skipLineComment(content, startIndex) {\n for (let index = startIndex; index < content.length; index++) {\n if (content[index] === '\\n') {\n return index;\n }\n }\n return content.length - 1;\n}\nfunction skipBlockComment(content, startIndex) {\n for (let index = startIndex; index < content.length - 1; index++) {\n if (content[index] === '*' && content[index + 1] === '/') {\n return index + 1;\n }\n }\n return content.length - 1;\n}\nfunction looksLikeLineTerminator(content, index) {\n for (let cursor = index; cursor < content.length; cursor++) {\n const char = content[cursor];\n if (!/\\s/.test(char)) {\n return char !== '.' && char !== '(';\n }\n }\n return false;\n}\nfunction buildLineOffsets(content) {\n const offsets = [0];\n for (let index = 0; index < content.length; index++) {\n if (content[index] === '\\n') {\n offsets.push(index + 1);\n }\n }\n return offsets;\n}\nfunction getLineNumber(lineOffsets, index) {\n let line = 0;\n for (let i = 0; i < lineOffsets.length; i++) {\n if (lineOffsets[i] > index) {\n break;\n }\n line = i;\n }\n return line + 1;\n}\nfunction isCommentedLine(content, index) {\n const lineStart = content.lastIndexOf('\\n', index - 1) + 1;\n const prefix = content.slice(lineStart, index).trimStart();\n return prefix.startsWith('//') || prefix.startsWith('*');\n}\nfunction startsWithWord(content, index, word) {\n if (!content.startsWith(word, index)) {\n return false;\n }\n const before = index === 0 ? '' : content[index - 1];\n const after = content[index + word.length] ?? '';\n return !isIdentifierChar(before) && !isIdentifierChar(after);\n}\nfunction isIdentifierChar(char) {\n return /[A-Za-z0-9_$]/.test(char);\n}\nfunction normalizeWhitespace(value) {\n return (value ?? '').trim().replace(/\\s+/g, ' ');\n}\nfunction normalizeDescribeChain(suite) {\n if (!suite) {\n return '';\n }\n const segments = suite\n .split('>')\n .map((segment) => segment.trim())\n .filter(Boolean);\n if (segments.length === 0) {\n return '';\n }\n const firstSegmentLooksLikeFile = segments[0].includes('.');\n const describeSegments = firstSegmentLooksLikeFile ? segments.slice(1) : segments;\n return normalizeWhitespace(describeSegments.join(' '));\n}\nfunction isInsideSourceRoot(filePath, sourceRoot) {\n const relative = node_path_1.default.relative(sourceRoot, filePath);\n return relative.length > 0 && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative);\n}\n//# sourceMappingURL=js-test-name-snippets.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveSourceSnippetOptions = resolveSourceSnippetOptions;\nexports.enrichReportWithSourceSnippets = enrichReportWithSourceSnippets;\nconst promises_1 = require(\"node:fs/promises\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst DEFAULT_MAX_CHARS = 2000;\nconst DEFAULT_MAX_LINES = 40;\nfunction resolveSourceSnippetOptions(options) {\n return {\n sourceRoot: node_path_1.default.resolve(options?.sourceRoot ?? process.cwd()),\n maxChars: normalizePositiveInt(options?.maxChars, DEFAULT_MAX_CHARS),\n maxLines: normalizePositiveInt(options?.maxLines, DEFAULT_MAX_LINES),\n };\n}\n// This implementation only extracts JS/TS-style test()/it() blocks.\n// Other languages need reporter-specific snippet logic after that reporter\n// has supplied file/line metadata for the test.\nasync function enrichReportWithSourceSnippets(report, options) {\n const resolved = resolveSourceSnippetOptions(options);\n const fileContentCache = new Map();\n await Promise.all(report.results.tests.map(async (test) => {\n if (test.snippet || !test.filePath || !test.line) {\n return;\n }\n const snippet = await tryExtractSnippet(test, resolved, fileContentCache);\n if (snippet) {\n test.snippet = snippet;\n }\n }));\n}\nasync function tryExtractSnippet(test, options, fileContentCache) {\n const filePath = node_path_1.default.resolve(options.sourceRoot, test.filePath);\n if (!isInsideSourceRoot(filePath, options.sourceRoot)) {\n return undefined;\n }\n const content = await getCachedFileContent(filePath, fileContentCache);\n if (!content) {\n return undefined;\n }\n return extractEnclosingTestBlock(content, test.line, options);\n}\nfunction getCachedFileContent(filePath, fileContentCache) {\n let cached = fileContentCache.get(filePath);\n if (!cached) {\n cached = (0, promises_1.readFile)(filePath, 'utf-8').catch(() => undefined);\n fileContentCache.set(filePath, cached);\n }\n return cached;\n}\nfunction extractEnclosingTestBlock(content, lineNumber, options) {\n const lines = content.split(/\\r?\\n/);\n const index = Math.max(0, Math.min(lines.length - 1, lineNumber - 1));\n const start = findTestStart(lines, index);\n if (start == null) {\n return undefined;\n }\n const selected = [];\n let braceBalance = 0;\n let sawOpeningBrace = false;\n for (let i = start; i < lines.length && selected.length < options.maxLines; i++) {\n const line = lines[i];\n selected.push(line);\n for (const char of line) {\n if (char === '{') {\n braceBalance++;\n sawOpeningBrace = true;\n }\n else if (char === '}') {\n braceBalance--;\n }\n }\n if (sawOpeningBrace && braceBalance <= 0 && isJsTestBlockTerminator(line)) {\n break;\n }\n }\n const snippet = selected.join('\\n').trim();\n if (!snippet) {\n return undefined;\n }\n return snippet.length <= options.maxChars\n ? snippet\n : snippet.slice(0, options.maxChars);\n}\nfunction findTestStart(lines, fromIndex) {\n for (let i = fromIndex; i >= 0; i--) {\n // Walk upward from runner-provided line metadata until we hit a JS/TS\n // test/it call, including common modifiers used by Vitest/Playwright.\n if (/\\b(?:test|it)(?:\\.(?:only|skip|fixme|slow))?\\s*\\(/.test(lines[i])) {\n return i;\n }\n }\n return undefined;\n}\nfunction isJsTestBlockTerminator(line) {\n let i = line.length - 1;\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n if (i >= 0 && line[i] === ';') {\n i--;\n }\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n if (i < 1 || line[i] !== ')') {\n return false;\n }\n i--;\n while (i >= 0 && /\\s/.test(line[i])) {\n i--;\n }\n return i >= 0 && line[i] === '}';\n}\nfunction isInsideSourceRoot(filePath, sourceRoot) {\n const relative = node_path_1.default.relative(sourceRoot, filePath);\n return relative.length > 0 && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative);\n}\nfunction normalizePositiveInt(value, fallback) {\n return typeof value === 'number' && Number.isInteger(value) && value > 0\n ? value\n : fallback;\n}\n//# sourceMappingURL=source-snippets.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestLocationCollector = createTestLocationCollector;\n/**\n * Generic name-based location mapper for CTRF reports.\n *\n * Different reporters can collect test locations in their own format\n * (Playwright runtime metadata, parsed JUnit XML, etc.) and then feed\n * this collector to apply file/line metadata in a consistent FIFO way.\n */\nfunction createTestLocationCollector() {\n const locationsByTestName = new Map();\n return {\n add(testName, location) {\n if (!testName || !isValidLocation(location)) {\n return;\n }\n const queue = locationsByTestName.get(testName) ?? [];\n queue.push(location);\n locationsByTestName.set(testName, queue);\n },\n applyToReport(report) {\n const queues = new Map([...locationsByTestName.entries()].map(([name, locations]) => [name, [...locations]]));\n for (const test of report.results.tests) {\n const queue = queues.get(test.name);\n const location = queue?.shift();\n if (!location) {\n continue;\n }\n test.filePath ?? (test.filePath = location.filePath);\n test.line ?? (test.line = location.line);\n }\n },\n };\n}\nfunction isValidLocation(location) {\n return Boolean(location.filePath) && Number.isInteger(location.line) && location.line > 0;\n}\n//# sourceMappingURL=test-locations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureReportId = ensureReportId;\nexports.uploadTestRun = uploadTestRun;\nexports.mapAttachmentsToTestResults = mapAttachmentsToTestResults;\nexports.uploadArtifacts = uploadArtifacts;\nconst ci_detection_1 = require(\"./ci-detection\");\nconst source_snippets_1 = require(\"./source-snippets\");\nconst DEFAULT_API_URL = \"https://api.testream.app\";\nfunction ensureReportId(report) {\n if (typeof report.reportId === \"string\" &&\n report.reportId.trim().length > 0) {\n return report.reportId;\n }\n const reportId = crypto.randomUUID();\n report.reportId = reportId;\n return reportId;\n}\nfunction resolveApiUrl(explicitApiUrl) {\n const fromExplicit = normalizeApiUrl(explicitApiUrl);\n if (fromExplicit) {\n return fromExplicit;\n }\n const fromEnv = getEnvApiUrl();\n if (fromEnv) {\n return fromEnv;\n }\n return DEFAULT_API_URL;\n}\nfunction getEnvApiUrl() {\n if (typeof process === \"undefined\" || !process?.env) {\n return undefined;\n }\n return normalizeApiUrl(process.env.TESTREAM_API_URL);\n}\nfunction normalizeApiUrl(value) {\n if (!value) {\n return undefined;\n }\n const trimmed = value.trim();\n if (!trimmed) {\n return undefined;\n }\n // Use while loop instead of regex for better performance and clarity\n let result = trimmed;\n while (result.endsWith(\"/\")) {\n result = result.slice(0, -1);\n }\n return result;\n}\nfunction isReportAlreadyExistsConflict(error) {\n return error.errorCode === \"report_already_exists\";\n}\nfunction formatUploadError(error) {\n const detail = error.detail || error.title || error.rawBody || \"Unknown error\";\n const codeLabel = error.errorCode ? `, code=${error.errorCode}` : \"\";\n return `Upload failed (HTTP ${error.statusCode}${codeLabel}): ${detail}`;\n}\nasync function parseHttpError(response) {\n const rawBody = await response.text();\n const contentType = response.headers.get(\"content-type\") || \"\";\n if (contentType.toLowerCase().includes(\"json\") && rawBody.trim().length > 0) {\n try {\n const parsed = JSON.parse(rawBody);\n return {\n statusCode: response.status,\n title: parsed.title,\n detail: parsed.detail || parsed.details || parsed.error,\n errorCode: parsed.errorCode,\n rawBody,\n };\n }\n catch {\n // Fall through to raw body handling\n }\n }\n return {\n statusCode: response.status,\n rawBody,\n };\n}\nfunction resolveUploadContext(options) {\n const ciContext = (0, ci_detection_1.detectCIContext)();\n return {\n commitSha: options.commitSha ?? ciContext.commitSha,\n branch: options.branch ?? ciContext.branch,\n repositoryUrl: options.repositoryUrl ?? ciContext.repositoryUrl,\n buildName: options.buildName,\n buildNumber: options.buildNumber ?? ciContext.buildNumber,\n buildUrl: options.buildUrl ?? ciContext.buildUrl,\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n };\n}\n/**\n * Upload test run to Testream backend API\n */\nasync function uploadTestRun(options) {\n const { report, apiKey } = options;\n const apiUrl = resolveApiUrl(options.apiUrl);\n const reportId = ensureReportId(report);\n const uploadContext = resolveUploadContext(options);\n await (0, source_snippets_1.enrichReportWithSourceSnippets)(report);\n // Build type-safe IngestRequest payload\n const ingestPayload = {\n report,\n reportId,\n ...uploadContext,\n };\n // Professional logging\n console.log(\"Uploading test results...\");\n let response;\n try {\n response = await fetch(`${apiUrl}/api/v1/ingest`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(ingestPayload),\n });\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n const connectionError = `Connection failed: ${errorMessage}`;\n console.error(connectionError);\n return {\n success: false,\n reportId,\n error: connectionError,\n };\n }\n if (!response.ok) {\n const parsedError = await parseHttpError(response);\n if (response.status === 409 && isReportAlreadyExistsConflict(parsedError)) {\n console.warn(\"Report already exists (workflow may have been re-run)\");\n return {\n success: true,\n reportId,\n summary: {\n passed: report.results.summary.passed,\n failed: report.results.summary.failed,\n skipped: report.results.summary.skipped,\n total: report.results.summary.tests,\n },\n alreadyExists: true,\n statusCode: parsedError.statusCode,\n errorCode: parsedError.errorCode,\n };\n }\n const formattedError = formatUploadError(parsedError);\n console.error(formattedError);\n return {\n success: false,\n reportId,\n error: formattedError,\n statusCode: parsedError.statusCode,\n errorCode: parsedError.errorCode,\n errorDetail: parsedError.detail || parsedError.rawBody,\n };\n }\n // Success\n const result = (await response.json());\n console.log(`✓ Test results uploaded successfully`);\n console.log(` Report ID: ${result.reportId}`);\n console.log(` Test Run ID: ${result.testRunId}`);\n console.log(` Tests: ${result.summary.passed}/${result.summary.total} passed`);\n return {\n success: true,\n reportId: result.reportId,\n testRunId: result.testRunId,\n summary: {\n passed: result.summary.passed,\n failed: result.summary.failed,\n skipped: result.summary.skipped,\n total: result.summary.total,\n },\n testResults: result.testResults,\n };\n}\n/**\n * Maps CTRF tests to ingested test result IDs in a stable order.\n * This avoids incorrect artifact linking when multiple tests share the same name.\n */\nfunction mapAttachmentsToTestResults(tests, ingestedTestResults) {\n const idsByName = new Map();\n for (const result of ingestedTestResults) {\n const queue = idsByName.get(result.name) ?? [];\n queue.push(result.id);\n idsByName.set(result.name, queue);\n }\n const targets = [];\n for (const test of tests) {\n const queue = idsByName.get(test.name);\n const matchedTestResultId = queue?.shift();\n if (!test.attachments || test.attachments.length === 0) {\n continue;\n }\n if (!matchedTestResultId) {\n console.warn(`Skipping artifact upload: could not match test result for \"${test.name}\"`);\n continue;\n }\n targets.push({\n testResultId: matchedTestResultId,\n attachments: test.attachments,\n });\n }\n return targets;\n}\n/**\n * Upload test artifacts (screenshots, videos, etc.) to Testream backend API\n */\nasync function uploadArtifacts(options) {\n const { reportId, apiKey, testResults } = options;\n const apiUrl = resolveApiUrl(options.apiUrl);\n let uploadedCount = 0;\n for (const testResult of testResults) {\n for (const attachment of testResult.attachments) {\n try {\n const success = await uploadSingleArtifact({\n testResultId: testResult.testResultId,\n attachment,\n reportId,\n apiKey,\n apiUrl,\n });\n if (success)\n uploadedCount++;\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`Failed to upload artifact ${attachment.name}: ${errorMessage}`);\n }\n }\n }\n if (uploadedCount > 0) {\n console.log(`✓ Uploaded ${uploadedCount} artifact(s)`);\n }\n return uploadedCount;\n}\nasync function uploadSingleArtifact(options) {\n const { testResultId, attachment, reportId, apiKey, apiUrl } = options;\n // Dynamically import fs for Node.js environments\n const fs = await import(\"node:fs/promises\");\n const path = await import(\"node:path\");\n const filePath = path.resolve(attachment.path);\n // Check if file exists\n try {\n await fs.access(filePath);\n }\n catch {\n console.warn(`Artifact not found: ${path.basename(filePath)}`);\n return false;\n }\n // Read file\n let fileBuffer;\n let sizeBytes;\n const fileName = path.basename(filePath);\n const contentType = attachment.contentType || \"application/octet-stream\";\n try {\n fileBuffer = await fs.readFile(filePath);\n sizeBytes = fileBuffer.byteLength;\n }\n catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to read file: ${errorMessage}`);\n }\n try {\n return await uploadWithPresignedUrl({\n testResultId,\n reportId,\n apiKey,\n apiUrl,\n attachmentName: attachment.name,\n fileName,\n contentType,\n sizeBytes,\n fileBuffer,\n });\n }\n catch (error) {\n if (!(error instanceof LegacyUploadRequiredError)) {\n throw error;\n }\n return await uploadWithLegacyEndpoint({\n testResultId,\n attachmentName: attachment.name,\n reportId,\n apiKey,\n apiUrl,\n fileName,\n contentType,\n fileBuffer,\n });\n }\n}\nclass LegacyUploadRequiredError extends Error {\n constructor() {\n super(\"Legacy upload endpoint required\");\n }\n}\nasync function uploadWithPresignedUrl(options) {\n const { testResultId, reportId, apiKey, apiUrl, attachmentName, fileName, contentType, sizeBytes, fileBuffer, } = options;\n const initPayload = {\n testResultId,\n ctrfAttachmentName: attachmentName,\n fileName,\n contentType,\n sizeBytes,\n };\n const initResponse = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}/upload-url`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(initPayload),\n });\n if (shouldFallbackToLegacyUpload(initResponse.status)) {\n throw new LegacyUploadRequiredError();\n }\n if (!initResponse.ok) {\n const errorText = await initResponse.text();\n throw new Error(`Failed to create direct upload URL (HTTP ${initResponse.status}): ${errorText}`);\n }\n const uploadInitResult = (await initResponse.json());\n const uploadHeaders = {\n ...(uploadInitResult.requiredHeaders),\n };\n if (!hasHeaderIgnoreCase(uploadHeaders, \"Content-Type\")) {\n uploadHeaders[\"Content-Type\"] = contentType;\n }\n const directUploadResponse = await fetch(uploadInitResult.uploadUrl, {\n method: \"PUT\",\n headers: uploadHeaders,\n body: fileBuffer,\n });\n if (!directUploadResponse.ok) {\n const errorText = await directUploadResponse.text();\n throw new Error(`Direct artifact upload failed (HTTP ${directUploadResponse.status}): ${errorText}`);\n }\n const completePayload = {\n testResultId,\n ctrfAttachmentName: attachmentName,\n fileName,\n contentType,\n sizeBytes,\n storageKey: uploadInitResult.storageKey,\n };\n const completeResponse = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}/complete`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(completePayload),\n });\n if (!completeResponse.ok) {\n const errorText = await completeResponse.text();\n throw new Error(`Failed to finalize artifact upload (HTTP ${completeResponse.status}): ${errorText}`);\n }\n return true;\n}\nasync function uploadWithLegacyEndpoint(options) {\n const { testResultId, attachmentName, reportId, apiKey, apiUrl, fileName, contentType, fileBuffer, } = options;\n const blob = new Blob([new Uint8Array(fileBuffer)], { type: contentType });\n const formData = new FormData();\n formData.append(\"testResultId\", testResultId);\n formData.append(\"ctrfAttachmentName\", attachmentName);\n formData.append(\"file\", blob, fileName);\n const response = await fetch(`${apiUrl}/api/v1/artifacts/${reportId}`, {\n method: \"POST\",\n headers: {\n \"X-API-KEY\": apiKey,\n },\n body: formData,\n });\n if (!response.ok) {\n const errorText = await response.text();\n throw new Error(`Legacy artifact upload failed (HTTP ${response.status}): ${errorText}`);\n }\n return true;\n}\nfunction shouldFallbackToLegacyUpload(statusCode) {\n return statusCode === 404 || statusCode === 405 || statusCode === 501;\n}\nfunction hasHeaderIgnoreCase(headers, headerName) {\n const expected = headerName.toLowerCase();\n return Object.keys(headers).some((key) => key.toLowerCase() === expected);\n}\n//# sourceMappingURL=upload.js.map","\nimport { glob } from 'glob';\nimport * as path from 'path';\nimport * as fs from 'fs/promises';\nimport * as os from 'os';\nimport { spawn } from 'child_process';\nimport { parseTrxFiles } from './trx-parser';\nimport { uploadToApi } from './uploader';\n\ninterface CliOptions {\n apiKey: string;\n // Optional: path to project/solution (defaults to current directory)\n projectPath?: string;\n // Optional: additional dotnet test arguments\n dotnetArgs?: string[];\n // Optional: explicit TRX path (skip running tests)\n trxPath?: string;\n // Git context\n branch?: string;\n commitSha?: string;\n repositoryUrl?: string;\n // Build metadata\n buildName?: string;\n buildNumber?: string;\n buildUrl?: string;\n // Environment metadata\n testEnvironment?: string;\n appName?: string;\n appVersion?: string;\n testType?: string;\n // Upload options\n uploadEnabled?: boolean;\n failOnUploadError?: boolean;\n}\n\nfunction printUsage(): void {\n console.log(String.raw`\n@testream/dotnet-reporter - Run .NET tests and upload results to Testream\n\nUsage:\n npx @testream/dotnet-reporter --api-key <key> [options]\n\nRequired arguments:\n --api-key, -k API key for authentication\n\nOptional arguments:\n --project <path> Path to .NET project/solution (defaults to current directory)\n --trx-path <path> Skip running tests, use existing TRX file(s) instead\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading results to backend\n --fail-on-error Fail the process if upload fails\n\nOther:\n --help, -h Show this help message\n -- <args> Additional arguments to pass to 'dotnet test'\n\nExamples:\n # Run tests and upload (simplest usage)\n npx @testream/dotnet-reporter -k your-api-key\n\n # Run tests for a specific project\n npx @testream/dotnet-reporter -k your-api-key --project ./MyTests\n\n # With environment metadata\n npx @testream/dotnet-reporter -k your-api-key \\\n --test-environment staging --app-name MyApp --app-version 1.0.0\n\n # Pass additional arguments to dotnet test\n npx @testream/dotnet-reporter -k your-api-key -- --filter \"Category=Unit\"\n\n # Use existing TRX file (skip running tests)\n npx @testream/dotnet-reporter -k your-api-key --trx-path TestResults/*.trx\n\nHow it works:\n 1. Runs 'dotnet test' with TRX logging enabled\n 2. Parses the TRX output and converts to CTRF format\n 3. Uploads to Testream (project key inferred from API key)\n\nNo manual steps required - just run and upload!\n`);\n}\n\nfunction parseArgs(args: string[]): CliOptions | null {\n const options: Partial<CliOptions> = {\n uploadEnabled: true, // default to enabled\n failOnUploadError: false, // default to not failing\n };\n const dotnetArgs: string[] = [];\n let collectingDotnetArgs = false;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const nextArg = args[i + 1];\n\n // After '--', collect all remaining args for dotnet test\n if (arg === '--') {\n collectingDotnetArgs = true;\n continue;\n }\n\n if (collectingDotnetArgs) {\n dotnetArgs.push(arg);\n continue;\n }\n\n switch (arg) {\n case '--help':\n case '-h':\n printUsage();\n process.exit(0);\n break;\n\n case '--api-key':\n case '-k':\n options.apiKey = nextArg;\n i++;\n break;\n\n case '--project':\n options.projectPath = nextArg;\n i++;\n break;\n\n case '--trx-path':\n options.trxPath = nextArg;\n i++;\n break;\n\n // Git context\n case '--branch':\n options.branch = nextArg;\n i++;\n break;\n\n case '--commit-sha':\n options.commitSha = nextArg;\n i++;\n break;\n\n case '--repository-url':\n options.repositoryUrl = nextArg;\n i++;\n break;\n\n // Build metadata\n case '--build-name':\n options.buildName = nextArg;\n i++;\n break;\n\n case '--build-number':\n options.buildNumber = nextArg;\n i++;\n break;\n\n case '--build-url':\n options.buildUrl = nextArg;\n i++;\n break;\n\n // Environment metadata\n case '--test-environment':\n options.testEnvironment = nextArg;\n i++;\n break;\n\n case '--app-name':\n options.appName = nextArg;\n i++;\n break;\n\n case '--app-version':\n options.appVersion = nextArg;\n i++;\n break;\n\n case '--test-type':\n options.testType = nextArg;\n i++;\n break;\n\n // Upload options\n case '--no-upload':\n options.uploadEnabled = false;\n break;\n\n case '--fail-on-error':\n options.failOnUploadError = true;\n break;\n }\n }\n\n if (dotnetArgs.length > 0) {\n options.dotnetArgs = dotnetArgs;\n }\n\n // Validate required options\n if (!options.apiKey && options.uploadEnabled) {\n console.error('Error: Missing required argument: --api-key');\n console.error('Run with --help for usage information.');\n return null;\n }\n\n return options as CliOptions;\n}\n\nasync function findTrxFiles(pattern: string): Promise<string[]> {\n // Check if it's a direct file path\n if (!pattern.includes('*') && !pattern.includes('?')) {\n return [path.resolve(pattern)];\n }\n\n // Use glob to find matching files\n const files = await glob(pattern, {\n absolute: true,\n nodir: true,\n });\n\n return files;\n}\n\n/**\n * Run dotnet test and return the path to generated TRX file\n */\nasync function runDotnetTest(\n projectPath: string | undefined,\n additionalArgs: string[] = []\n): Promise<string> {\n const logger = console;\n\n // Create temp directory for TRX output\n const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'dotnet-reporter-'));\n\n // Build dotnet test command\n const args = ['test'];\n\n if (projectPath) {\n args.push(projectPath);\n }\n\n // Add TRX logger without a fixed filename so each test project gets a unique\n // TRX file. Specifying LogFileName causes all projects in a solution to write\n // to the same file, with later projects overwriting earlier ones.\n args.push('--logger', 'trx', '--results-directory', tempDir);\n\n // Add any additional user-provided args\n args.push(...additionalArgs);\n\n logger.info('Running dotnet test...');\n logger.info(` Command: dotnet ${args.join(' ')}`);\n logger.info('');\n\n return new Promise((resolve, reject) => {\n const child = spawn('dotnet', args, {\n stdio: ['inherit', 'inherit', 'inherit'],\n shell: process.platform === 'win32',\n });\n\n child.on('error', (error) => {\n reject(new Error(`Failed to run dotnet test: ${error.message}`));\n });\n\n child.on('close', async (_code) => {\n // Find TRX file(s) in the temp directory\n try {\n const files = await fs.readdir(tempDir);\n const trxFiles = files.filter((f) => f.endsWith('.trx'));\n\n if (trxFiles.length === 0) {\n reject(new Error('No TRX file generated. Make sure dotnet test ran successfully.'));\n return;\n }\n\n // Return the first TRX file (or pattern if multiple)\n if (trxFiles.length === 1) {\n resolve(path.join(tempDir, trxFiles[0]));\n } else {\n resolve(path.join(tempDir, '*.trx'));\n }\n } catch (error) {\n reject(new Error(`Failed to find TRX files: ${error}`));\n }\n });\n });\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (args.length === 0) {\n printUsage();\n process.exit(1);\n }\n\n const options = parseArgs(args);\n if (!options) {\n process.exit(1);\n }\n\n const logger = console;\n\n try {\n let trxPath: string;\n\n // Either use provided TRX path or run dotnet test\n if (options.trxPath) {\n logger.info('Using existing TRX file(s)...');\n trxPath = options.trxPath;\n } else {\n // Run dotnet test\n trxPath = await runDotnetTest(options.projectPath, options.dotnetArgs);\n logger.info('');\n }\n\n // Find TRX files\n logger.info(`Finding TRX files: ${trxPath}`);\n const trxFiles = await findTrxFiles(trxPath);\n\n if (trxFiles.length === 0) {\n throw new Error(`No TRX files found matching: ${trxPath}`);\n }\n\n logger.info(` Found ${trxFiles.length} file(s):`);\n for (const file of trxFiles) {\n logger.info(` - ${path.basename(file)}`);\n }\n logger.info('');\n\n // Parse TRX files to CTRF\n logger.info('Converting TRX to CTRF format...');\n const report = await parseTrxFiles(trxFiles);\n logger.info('');\n\n // Skip upload if disabled\n if (!options.uploadEnabled) {\n logger.info('Upload disabled, skipping API upload');\n logger.info('');\n logger.info('='.repeat(60));\n logger.info('Test run completed (upload skipped)');\n logger.info(` Tests: ${report.results.summary.tests}`);\n logger.info(` Passed: ${report.results.summary.passed}`);\n logger.info(` Failed: ${report.results.summary.failed}`);\n logger.info(` Skipped: ${report.results.summary.skipped}`);\n logger.info('='.repeat(60));\n return;\n }\n\n // Upload to API\n const result = await uploadToApi({\n report,\n apiKey: options.apiKey,\n // Git context\n branch: options.branch,\n commitSha: options.commitSha,\n repositoryUrl: options.repositoryUrl,\n // Build metadata\n buildName: options.buildName,\n buildNumber: options.buildNumber,\n buildUrl: options.buildUrl,\n // Environment metadata\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n });\n\n if (!result.success) {\n if (options.failOnUploadError) {\n process.exit(1);\n } else {\n logger.warn('Upload failed but continuing (use --fail-on-error to fail on upload errors)');\n }\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error(`Error: ${errorMessage}`);\n process.exit(1);\n }\n}\n\nmain();\n","import { readdir, readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nconst DEFAULT_MAX_CHARS = 2000;\nconst DEFAULT_MAX_LINES = 40;\n\nexport interface DotnetSourceSnippet {\n filePath: string;\n line: number;\n snippet: string;\n}\n\ninterface DotnetSourceSnippetCache {\n candidateSourceFiles: Map<string, Promise<string[]>>;\n fileContentByPath: Map<string, Promise<string | undefined>>;\n}\n\nexport interface DotnetSourceSnippetResolver {\n resolve(options: {\n filePath: string | undefined;\n className?: string;\n methodName: string | undefined;\n lineNumber?: number;\n }): Promise<DotnetSourceSnippet | undefined>;\n}\n\nexport function createDotnetSourceSnippetResolver(): DotnetSourceSnippetResolver {\n const cache: DotnetSourceSnippetCache = {\n candidateSourceFiles: new Map(),\n fileContentByPath: new Map(),\n };\n\n return {\n resolve: (options) => resolveDotnetSourceSnippet(options, cache),\n };\n}\n\nexport async function extractDotnetSourceSnippet(\n filePath: string | undefined,\n methodName: string | undefined,\n lineNumber?: number\n): Promise<string | undefined> {\n const result = await resolveDotnetSourceSnippet({ filePath, methodName, lineNumber });\n return result?.snippet;\n}\n\nexport async function resolveDotnetSourceSnippet(\n options: {\n filePath: string | undefined;\n className?: string;\n methodName: string | undefined;\n lineNumber?: number;\n },\n cache?: DotnetSourceSnippetCache\n): Promise<DotnetSourceSnippet | undefined> {\n if (!options.filePath || !options.methodName) {\n return undefined;\n }\n\n const direct = await tryExtractFromSourceFile(\n options.filePath,\n options.methodName,\n options.lineNumber,\n cache\n );\n if (direct) {\n return direct;\n }\n\n const candidates = await getCandidateSourceFiles(options.filePath, options.className, cache);\n for (const candidate of candidates) {\n const resolved = await tryExtractFromSourceFile(\n candidate,\n options.methodName,\n options.lineNumber,\n cache\n );\n if (resolved) {\n return resolved;\n }\n }\n\n return undefined;\n}\n\nasync function tryExtractFromSourceFile(\n filePath: string,\n methodName: string,\n lineNumber?: number,\n cache?: DotnetSourceSnippetCache\n): Promise<DotnetSourceSnippet | undefined> {\n if (path.extname(filePath).toLowerCase() !== '.cs') {\n return undefined;\n }\n\n const resolvedPath = path.resolve(filePath);\n const content = await getFileContent(resolvedPath, cache);\n if (!content) {\n return undefined;\n }\n\n for (const candidateMethodName of getMethodNameCandidates(methodName)) {\n const extracted = extractCSharpMethodBlock(content, candidateMethodName, lineNumber);\n if (extracted) {\n return { filePath: resolvedPath, ...extracted };\n }\n }\n\n return undefined;\n}\n\nfunction getFileContent(\n filePath: string,\n cache?: DotnetSourceSnippetCache\n): Promise<string | undefined> {\n if (!cache) {\n return readFile(filePath, 'utf-8').catch(() => undefined);\n }\n\n let cached = cache.fileContentByPath.get(filePath);\n if (!cached) {\n cached = readFile(filePath, 'utf-8').catch(() => undefined);\n cache.fileContentByPath.set(filePath, cached);\n }\n\n return cached;\n}\n\nfunction extractCSharpMethodBlock(\n content: string,\n methodName: string,\n lineNumber?: number\n): { line: number; snippet: string } | undefined {\n const lines = content.split(/\\r?\\n/);\n const definitionIndex =\n findMethodDefinitionNearLine(lines, methodName, lineNumber) ??\n findMethodDefinition(lines, methodName);\n\n if (definitionIndex == null) {\n return undefined;\n }\n\n const start = includeCSharpAttributes(lines, definitionIndex);\n const selected: string[] = [];\n let braceBalance = 0;\n let sawOpeningBrace = false;\n let isExpressionBodied = false;\n\n for (let i = start; i < lines.length && selected.length < DEFAULT_MAX_LINES; i++) {\n const line = lines[i];\n selected.push(line);\n\n if (!sawOpeningBrace && line.includes('=>')) {\n isExpressionBodied = true;\n }\n\n for (const char of line) {\n if (char === '{') {\n braceBalance++;\n sawOpeningBrace = true;\n } else if (char === '}') {\n braceBalance--;\n }\n }\n\n if (isExpressionBodied && line.includes(';')) {\n break;\n }\n\n if (sawOpeningBrace && braceBalance <= 0) {\n break;\n }\n }\n\n const snippet = selected.join('\\n').trim();\n if (!snippet) {\n return undefined;\n }\n\n return {\n line: start + 1,\n snippet: snippet.length <= DEFAULT_MAX_CHARS ? snippet : snippet.slice(0, DEFAULT_MAX_CHARS),\n };\n}\n\nfunction findMethodDefinitionNearLine(\n lines: string[],\n methodName: string,\n lineNumber?: number\n): number | undefined {\n if (!lineNumber) {\n return undefined;\n }\n\n const startIndex = Math.max(0, Math.min(lines.length - 1, lineNumber - 1));\n for (let i = startIndex; i >= 0; i--) {\n if (containsMethodSignatureName(lines[i], methodName)) {\n return i;\n }\n }\n\n return undefined;\n}\n\nfunction findMethodDefinition(lines: string[], methodName: string): number | undefined {\n for (let i = 0; i < lines.length; i++) {\n if (containsMethodSignatureName(lines[i], methodName)) {\n return i;\n }\n }\n\n return undefined;\n}\n\nfunction containsMethodSignatureName(line: string, methodName: string): boolean {\n const nameIndex = line.indexOf(methodName);\n if (nameIndex < 0) {\n return false;\n }\n\n const before = nameIndex === 0 ? '' : line[nameIndex - 1];\n if (before && isIdentifierChar(before)) {\n return false;\n }\n\n let i = nameIndex + methodName.length;\n while (i < line.length && /\\s/.test(line[i])) {\n i++;\n }\n\n return line[i] === '(';\n}\n\nfunction includeCSharpAttributes(lines: string[], definitionIndex: number): number {\n let start = definitionIndex;\n while (start > 0) {\n const previous = lines[start - 1].trim();\n if (!previous.startsWith('[') || !previous.endsWith(']')) {\n break;\n }\n start--;\n }\n\n return start;\n}\n\nfunction getMethodNameCandidates(methodName: string): string[] {\n const trimmed = methodName.trim();\n const candidates = [trimmed];\n const invocationIndex = trimmed.indexOf('(');\n\n // NUnit can put TestCase argument values in TestMethod/@name, e.g.\n // Password_MinimumLength_Validation(\"pass\",False). Source matching needs\n // the underlying C# method identifier.\n if (invocationIndex > 0) {\n const sourceMethodName = trimmed.slice(0, invocationIndex).trim();\n if (sourceMethodName && sourceMethodName !== trimmed) {\n candidates.push(sourceMethodName);\n }\n }\n\n return candidates;\n}\n\nasync function findCandidateSourceFiles(\n storagePath: string,\n className: string | undefined\n): Promise<string[]> {\n const sourceRoot = getProjectSourceRootFromStorage(storagePath);\n if (!sourceRoot) {\n return [];\n }\n\n const resolvedSourceRoot = await resolveExistingDirectoryCaseInsensitive(sourceRoot);\n if (!resolvedSourceRoot) {\n return [];\n }\n\n const files = await listCSharpFiles(resolvedSourceRoot);\n const classFileName = getClassFileName(className);\n if (!classFileName) {\n return files;\n }\n\n // TRX commonly stores passed tests against the compiled DLL. Prefer the class\n // filename when available, then fall back to every source file for cases where\n // a project keeps multiple test classes in one file.\n return [\n ...files.filter((file) => path.basename(file).toLowerCase() === classFileName),\n ...files.filter((file) => path.basename(file).toLowerCase() !== classFileName),\n ];\n}\n\nfunction getCandidateSourceFiles(\n storagePath: string,\n className: string | undefined,\n cache?: DotnetSourceSnippetCache\n): Promise<string[]> {\n if (!cache) {\n return findCandidateSourceFiles(storagePath, className);\n }\n\n const key = `${path.resolve(storagePath)}\\0${className ?? ''}`;\n let cached = cache.candidateSourceFiles.get(key);\n if (!cached) {\n cached = findCandidateSourceFiles(storagePath, className);\n cache.candidateSourceFiles.set(key, cached);\n }\n\n return cached;\n}\n\nfunction getProjectSourceRootFromStorage(storagePath: string): string | undefined {\n const resolved = path.resolve(storagePath);\n const parts = resolved.split(path.sep);\n // /Project/bin/Debug/net8.0/Project.dll is the normal TRX storage path for\n // passed tests, so the source root is the directory before bin/.\n const binIndex = parts.findIndex((part) => part.toLowerCase() === 'bin');\n if (binIndex <= 0) {\n return undefined;\n }\n\n return parts.slice(0, binIndex).join(path.sep) || path.sep;\n}\n\nasync function resolveExistingDirectoryCaseInsensitive(\n dirPath: string\n): Promise<string | undefined> {\n try {\n await readdir(dirPath, { withFileTypes: true });\n return dirPath;\n } catch {\n // TRX storage paths can lowercase project output paths on Linux\n // (`mstesttests/bin/...`) while the checked-out source directory is\n // case-sensitive (`MSTestTests`). Walk each segment case-insensitively so\n // passed tests can still resolve their project source root.\n }\n\n const resolved = path.resolve(dirPath);\n const parsed = path.parse(resolved);\n const relativeParts = path.relative(parsed.root, resolved).split(path.sep).filter(Boolean);\n let current = parsed.root;\n\n for (const part of relativeParts) {\n let entries;\n try {\n entries = await readdir(current, { withFileTypes: true });\n } catch {\n return undefined;\n }\n\n const match =\n entries.find((entry) => entry.name === part) ??\n entries.find((entry) => entry.name.toLowerCase() === part.toLowerCase());\n\n if (!match) {\n return undefined;\n }\n\n current = path.join(current, match.name);\n }\n\n try {\n await readdir(current, { withFileTypes: true });\n return current;\n } catch {\n return undefined;\n }\n}\n\nasync function listCSharpFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n\n async function visit(dir: string): Promise<void> {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const entryPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n const lowerName = entry.name.toLowerCase();\n if (lowerName === 'bin' || lowerName === 'obj') {\n continue;\n }\n\n await visit(entryPath);\n continue;\n }\n\n if (entry.isFile() && path.extname(entry.name).toLowerCase() === '.cs') {\n files.push(entryPath);\n }\n }\n }\n\n await visit(root);\n return files;\n}\n\nfunction getClassFileName(className: string | undefined): string | undefined {\n const shortName = className?.split(/[.+]/).filter(Boolean).pop();\n return shortName ? `${shortName.toLowerCase()}.cs` : undefined;\n}\n\nfunction isIdentifierChar(char: string): boolean {\n // Prevent matching a method name inside another common C# identifier.\n return /[A-Za-z0-9_]/.test(char);\n}\n","import * as fs from 'node:fs/promises';\nimport { XMLParser } from 'fast-xml-parser';\nimport { randomUUID } from 'node:crypto';\nimport { CTRFReport, CTRFTest, CTRFSummary } from '@jira-test-manager/shared-types';\nimport { createDotnetSourceSnippetResolver } from './source-snippets';\nimport { TrxTestRun, TrxUnitTest } from './types';\n\nconst TOOL_NAME = 'dotnet';\n\n// Use crypto.randomUUID() for secure UUID generation (available in Node.js 15.7.0+)\nfunction generateUUID(): string {\n return randomUUID();\n}\n\n/**\n * Parse TRX duration string (HH:MM:SS.mmmmmmm) to milliseconds\n */\nfunction parseDuration(duration: string): number {\n if (!duration) return 0;\n\n // Use split() instead of regex to avoid ReDoS vulnerability\n const parts = duration.split(':');\n if (parts.length !== 3) return 0;\n\n const hours = parseInt(parts[0], 10);\n if (Number.isNaN(hours)) return 0;\n\n const minutes = parseInt(parts[1], 10);\n if (Number.isNaN(minutes)) return 0;\n\n // Handle seconds and fractional part (may contain decimal point)\n const secondsParts = parts[2].split('.');\n const seconds = Number.parseInt(secondsParts[0], 10);\n if (Number.isNaN(seconds)) return 0;\n\n const fraction = secondsParts[1] ? parseFloat(`0.${secondsParts[1]}`) * 1000 : 0;\n\n return hours * 3600000 + minutes * 60000 + seconds * 1000 + Math.round(fraction);\n}\n\n/**\n * Parse ISO date string to epoch milliseconds\n */\nfunction parseTimestamp(dateStr: string): number {\n if (!dateStr) return Date.now();\n const date = new Date(dateStr);\n return Number.isNaN(date.getTime()) ? Date.now() : date.getTime();\n}\n\n/**\n * Map TRX outcome to CTRF status\n */\nfunction mapOutcome(outcome: string): CTRFTest['status'] {\n switch (outcome.toLowerCase()) {\n case 'passed':\n return 'passed';\n case 'failed':\n return 'failed';\n case 'notexecuted':\n case 'skipped':\n return 'skipped';\n case 'inconclusive':\n case 'pending':\n return 'pending';\n default:\n return 'other';\n }\n}\n\n/**\n * Extract line number from stack trace\n */\nfunction extractLineNumber(stackTrace?: string): number | undefined {\n if (!stackTrace) return undefined;\n\n // Match patterns like \":line 79\" or \".cs:79\"\n const match = new RegExp(/:line (\\d+)|\\.cs:(\\d+)/i).exec(stackTrace);\n if (match) {\n return Number.parseInt(match[1] || match[2], 10);\n }\n return undefined;\n}\n\n/**\n * Extract file path from stack trace\n */\nfunction extractFilePath(stackTrace?: string): string | undefined {\n if (!stackTrace) return undefined;\n\n // Match file paths ending in .cs with bounded length to prevent ReDoS\n const match = new RegExp(/([A-Za-z]:\\\\[^\\s:]{1,256}\\.cs|\\/[^\\s:]{1,256}\\.cs)/).exec(stackTrace);\n return match ? match[1] : undefined;\n}\n\n/**\n * Parse a TRX file and convert to CTRF format\n */\nexport async function parseTrxFile(trxPath: string): Promise<CTRFReport> {\n // Read TRX file\n const content = await fs.readFile(trxPath, 'utf-8');\n\n // Parse XML\n const parser = new XMLParser({\n ignoreAttributes: false,\n attributeNamePrefix: '@_',\n isArray: (name: string) => {\n // Ensure these are always arrays\n return name === 'UnitTestResult' || name === 'UnitTest';\n },\n });\n\n const parsed = parser.parse(content);\n const testRun: TrxTestRun = parsed.TestRun;\n\n if (!testRun) {\n throw new Error('Invalid TRX file: missing TestRun element');\n }\n\n // Build test definition lookup\n const testDefinitions = new Map<string, TrxUnitTest>();\n const unitTests = testRun.TestDefinitions?.UnitTest || [];\n for (const test of unitTests) {\n testDefinitions.set(test['@_id'], test);\n }\n\n // Force tool name to 'dotnet' (ignoring testTool parameter)\n const toolName = TOOL_NAME;\n\n // Parse test results\n const results = testRun.Results?.UnitTestResult || [];\n const tests: CTRFTest[] = [];\n const sourceSnippetResolver = createDotnetSourceSnippetResolver();\n\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n let pending = 0;\n let other = 0;\n const suites = new Set<string>();\n\n for (const result of results) {\n const testDef = testDefinitions.get(result['@_testId']);\n const className = testDef?.TestMethod?.['@_className'] || '';\n const suiteName = className.split('.').pop() || '';\n\n if (suiteName) suites.add(suiteName);\n\n const status = mapOutcome(result['@_outcome']);\n const duration = parseDuration(result['@_duration']);\n const start = parseTimestamp(result['@_startTime']);\n const stop = parseTimestamp(result['@_endTime']);\n\n // Count by status\n switch (status) {\n case 'passed':\n passed++;\n break;\n case 'failed':\n failed++;\n break;\n case 'skipped':\n skipped++;\n break;\n case 'pending':\n pending++;\n break;\n default:\n other++;\n }\n\n const errorMessage = result.Output?.ErrorInfo?.Message;\n const stackTrace = result.Output?.ErrorInfo?.StackTrace;\n const stdout = result.Output?.StdOut;\n const stderr = result.Output?.StdErr;\n\n const stackTraceFilePath = extractFilePath(stackTrace);\n const storagePath = testDef?.['@_storage'];\n const line = extractLineNumber(stackTrace);\n const sourceSnippet = await sourceSnippetResolver.resolve({\n filePath: stackTraceFilePath || storagePath,\n className,\n methodName: testDef?.TestMethod?.['@_name'],\n lineNumber: line,\n });\n\n const test: CTRFTest = {\n name: result['@_testName'],\n status,\n duration,\n start,\n stop,\n rawStatus: result['@_outcome'],\n tags: [],\n retries: 0,\n flaky: false,\n steps: [],\n suite: suiteName || undefined,\n stdout: stdout ? [stdout] : [],\n stderr: stderr ? [stderr] : [],\n message: errorMessage,\n trace: stackTrace,\n line: line ?? sourceSnippet?.line,\n filePath: sourceSnippet?.filePath ?? stackTraceFilePath ?? storagePath,\n snippet: sourceSnippet?.snippet,\n };\n\n tests.push(test);\n }\n\n // Parse run times\n const startTime = parseTimestamp(testRun.Times?.['@_start']);\n const stopTime = parseTimestamp(testRun.Times?.['@_finish']);\n\n const summary: CTRFSummary = {\n tests: tests.length,\n passed,\n failed,\n pending,\n skipped,\n other,\n start: startTime,\n stop: stopTime,\n suites: suites.size,\n };\n\n const report: CTRFReport = {\n reportFormat: 'CTRF',\n specVersion: '0.0.0',\n reportId: generateUUID(),\n timestamp: new Date().toISOString(),\n generatedBy: '@testream/dotnet-reporter',\n results: {\n tool: {\n name: toolName,\n },\n summary,\n tests,\n },\n };\n\n return report;\n}\n\n/**\n * Parse multiple TRX files and merge into a single CTRF report\n */\nexport async function parseTrxFiles(trxPaths: string[]): Promise<CTRFReport> {\n if (trxPaths.length === 0) {\n throw new Error('No TRX files provided');\n }\n\n if (trxPaths.length === 1) {\n return parseTrxFile(trxPaths[0]);\n }\n\n // Parse all files\n const reports = await Promise.all(trxPaths.map((path) => parseTrxFile(path)));\n\n // Merge reports\n const allTests: CTRFTest[] = [];\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n let pending = 0;\n let other = 0;\n const suites = new Set<string>();\n let minStart = Infinity;\n let maxStop = 0;\n\n for (const report of reports) {\n allTests.push(...report.results.tests);\n passed += report.results.summary.passed;\n failed += report.results.summary.failed;\n skipped += report.results.summary.skipped;\n pending += report.results.summary.pending;\n other += report.results.summary.other;\n\n for (const test of report.results.tests) {\n if (test.suite) suites.add(test.suite);\n }\n\n if (report.results.summary.start < minStart) {\n minStart = report.results.summary.start;\n }\n if (report.results.summary.stop > maxStop) {\n maxStop = report.results.summary.stop;\n }\n }\n\n const mergedReport: CTRFReport = {\n reportFormat: 'CTRF',\n specVersion: '0.0.0',\n reportId: generateUUID(),\n timestamp: new Date().toISOString(),\n generatedBy: '@testream/dotnet-reporter',\n results: {\n tool: {\n name: TOOL_NAME,\n },\n summary: {\n tests: allTests.length,\n passed,\n failed,\n pending,\n skipped,\n other,\n start: minStart === Infinity ? Date.now() : minStart,\n stop: maxStop,\n suites: suites.size,\n },\n tests: allTests,\n },\n };\n\n return mergedReport;\n}\n","import {\n UploadResult,\n detectCIContext,\n uploadTestRun,\n UploadTestRunOptions,\n} from '@jira-test-manager/shared-types';\n\n/**\n * Upload CTRF report to Testream API\n */\nexport async function uploadToApi(options: UploadTestRunOptions): Promise<UploadResult> {\n return uploadTestRun({\n report: options.report,\n apiKey: options.apiKey,\n apiUrl: options.apiUrl,\n commitSha: options.commitSha,\n branch: options.branch,\n repositoryUrl: options.repositoryUrl,\n buildName: options.buildName,\n buildNumber: options.buildNumber,\n buildUrl: options.buildUrl,\n testEnvironment: options.testEnvironment,\n appName: options.appName,\n appVersion: options.appVersion,\n testType: options.testType,\n });\n}\n\n// Keep old function name for backwards compatibility\nexport const detectGitContext = detectCIContext;\n","module.exports = require(\"child_process\");","module.exports = require(\"fs\");","module.exports = require(\"fs/promises\");","module.exports = require(\"node:crypto\");","module.exports = require(\"node:events\");","module.exports = require(\"node:fs\");","module.exports = require(\"node:fs/promises\");","module.exports = require(\"node:path\");","module.exports = require(\"node:stream\");","module.exports = require(\"node:string_decoder\");","module.exports = require(\"node:url\");","module.exports = require(\"os\");","module.exports = require(\"path\");","\"use strict\";var R=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Ge=R(Y=>{\"use strict\";Object.defineProperty(Y,\"__esModule\",{value:!0});Y.range=Y.balanced=void 0;var Gs=(n,t,e)=>{let s=n instanceof RegExp?Ie(n,e):n,i=t instanceof RegExp?Ie(t,e):t,r=s!==null&&i!=null&&(0,Y.range)(s,i,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+i.length)}};Y.balanced=Gs;var Ie=(n,t)=>{let e=t.match(n);return e?e[0]:null},zs=(n,t,e)=>{let s,i,r,h,o,a=e.indexOf(n),l=e.indexOf(t,a+1),f=a;if(a>=0&&l>0){if(n===t)return[a,l];for(s=[],r=e.length;f>=0&&!o;){if(f===a)s.push(f),a=e.indexOf(n,f+1);else if(s.length===1){let c=s.pop();c!==void 0&&(o=[c,l])}else i=s.pop(),i!==void 0&&i<r&&(r=i,h=l),l=e.indexOf(t,f+1);f=a<l&&a>=0?a:l}s.length&&h!==void 0&&(o=[r,h])}return o};Y.range=zs});var Ke=R(it=>{\"use strict\";Object.defineProperty(it,\"__esModule\",{value:!0});it.EXPANSION_MAX=void 0;it.expand=ei;var ze=Ge(),Ue=\"\\0SLASH\"+Math.random()+\"\\0\",$e=\"\\0OPEN\"+Math.random()+\"\\0\",ue=\"\\0CLOSE\"+Math.random()+\"\\0\",qe=\"\\0COMMA\"+Math.random()+\"\\0\",He=\"\\0PERIOD\"+Math.random()+\"\\0\",Us=new RegExp(Ue,\"g\"),$s=new RegExp($e,\"g\"),qs=new RegExp(ue,\"g\"),Hs=new RegExp(qe,\"g\"),Vs=new RegExp(He,\"g\"),Ks=/\\\\\\\\/g,Xs=/\\\\{/g,Ys=/\\\\}/g,Js=/\\\\,/g,Zs=/\\\\./g;it.EXPANSION_MAX=1e5;function ce(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function Qs(n){return n.replace(Ks,Ue).replace(Xs,$e).replace(Ys,ue).replace(Js,qe).replace(Zs,He)}function ti(n){return n.replace(Us,\"\\\\\").replace($s,\"{\").replace(qs,\"}\").replace(Hs,\",\").replace(Vs,\".\")}function Ve(n){if(!n)return[\"\"];let t=[],e=(0,ze.balanced)(\"{\",\"}\",n);if(!e)return n.split(\",\");let{pre:s,body:i,post:r}=e,h=s.split(\",\");h[h.length-1]+=\"{\"+i+\"}\";let o=Ve(r);return r.length&&(h[h.length-1]+=o.shift(),h.push.apply(h,o)),t.push.apply(t,h),t}function ei(n,t={}){if(!n)return[];let{max:e=it.EXPANSION_MAX}=t;return n.slice(0,2)===\"{}\"&&(n=\"\\\\{\\\\}\"+n.slice(2)),ht(Qs(n),e,!0).map(ti)}function si(n){return\"{\"+n+\"}\"}function ii(n){return/^-?0\\d/.test(n)}function ri(n,t){return n<=t}function ni(n,t){return n>=t}function ht(n,t,e){let s=[],i=(0,ze.balanced)(\"{\",\"}\",n);if(!i)return[n];let r=i.pre,h=i.post.length?ht(i.post,t,!1):[\"\"];if(/\\$$/.test(i.pre))for(let o=0;o<h.length&&o<t;o++){let a=r+\"{\"+i.body+\"}\"+h[o];s.push(a)}else{let o=/^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(i.body),a=/^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(i.body),l=o||a,f=i.body.indexOf(\",\")>=0;if(!l&&!f)return i.post.match(/,(?!,).*\\}/)?(n=i.pre+\"{\"+i.body+ue+i.post,ht(n,t,!0)):[n];let c;if(l)c=i.body.split(/\\.\\./);else if(c=Ve(i.body),c.length===1&&c[0]!==void 0&&(c=ht(c[0],t,!1).map(si),c.length===1))return h.map(u=>i.pre+c[0]+u);let d;if(l&&c[0]!==void 0&&c[1]!==void 0){let u=ce(c[0]),m=ce(c[1]),p=Math.max(c[0].length,c[1].length),b=c.length===3&&c[2]!==void 0?Math.abs(ce(c[2])):1,w=ri;m<u&&(b*=-1,w=ni);let E=c.some(ii);d=[];for(let y=u;w(y,m);y+=b){let S;if(a)S=String.fromCharCode(y),S===\"\\\\\"&&(S=\"\");else if(S=String(y),E){let B=p-S.length;if(B>0){let U=new Array(B+1).join(\"0\");y<0?S=\"-\"+U+S.slice(1):S=U+S}}d.push(S)}}else{d=[];for(let u=0;u<c.length;u++)d.push.apply(d,ht(c[u],t,!1))}for(let u=0;u<d.length;u++)for(let m=0;m<h.length&&s.length<t;m++){let p=r+d[u]+h[m];(!e||l||p)&&s.push(p)}}return s}});var Xe=R(Ct=>{\"use strict\";Object.defineProperty(Ct,\"__esModule\",{value:!0});Ct.assertValidPattern=void 0;var hi=1024*64,oi=n=>{if(typeof n!=\"string\")throw new TypeError(\"invalid pattern\");if(n.length>hi)throw new TypeError(\"pattern is too long\")};Ct.assertValidPattern=oi});var Je=R(Rt=>{\"use strict\";Object.defineProperty(Rt,\"__esModule\",{value:!0});Rt.parseClass=void 0;var ai={\"[:alnum:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\",!0],\"[:alpha:]\":[\"\\\\p{L}\\\\p{Nl}\",!0],\"[:ascii:]\":[\"\\\\x00-\\\\x7f\",!1],\"[:blank:]\":[\"\\\\p{Zs}\\\\t\",!0],\"[:cntrl:]\":[\"\\\\p{Cc}\",!0],\"[:digit:]\":[\"\\\\p{Nd}\",!0],\"[:graph:]\":[\"\\\\p{Z}\\\\p{C}\",!0,!0],\"[:lower:]\":[\"\\\\p{Ll}\",!0],\"[:print:]\":[\"\\\\p{C}\",!0],\"[:punct:]\":[\"\\\\p{P}\",!0],\"[:space:]\":[\"\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f\",!0],\"[:upper:]\":[\"\\\\p{Lu}\",!0],\"[:word:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}\",!0],\"[:xdigit:]\":[\"A-Fa-f0-9\",!1]},ot=n=>n.replace(/[[\\]\\\\-]/g,\"\\\\$&\"),li=n=>n.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),Ye=n=>n.join(\"\"),ci=(n,t)=>{let e=t;if(n.charAt(e)!==\"[\")throw new Error(\"not in a brace expression\");let s=[],i=[],r=e+1,h=!1,o=!1,a=!1,l=!1,f=e,c=\"\";t:for(;r<n.length;){let p=n.charAt(r);if((p===\"!\"||p===\"^\")&&r===e+1){l=!0,r++;continue}if(p===\"]\"&&h&&!a){f=r+1;break}if(h=!0,p===\"\\\\\"&&!a){a=!0,r++;continue}if(p===\"[\"&&!a){for(let[b,[w,v,E]]of Object.entries(ai))if(n.startsWith(b,r)){if(c)return[\"$.\",!1,n.length-e,!0];r+=b.length,E?i.push(w):s.push(w),o=o||v;continue t}}if(a=!1,c){p>c?s.push(ot(c)+\"-\"+ot(p)):p===c&&s.push(ot(p)),c=\"\",r++;continue}if(n.startsWith(\"-]\",r+1)){s.push(ot(p+\"-\")),r+=2;continue}if(n.startsWith(\"-\",r+1)){c=p,r+=2;continue}s.push(ot(p)),r++}if(f<r)return[\"\",!1,0,!1];if(!s.length&&!i.length)return[\"$.\",!1,n.length-e,!0];if(i.length===0&&s.length===1&&/^\\\\?.$/.test(s[0])&&!l){let p=s[0].length===2?s[0].slice(-1):s[0];return[li(p),!1,f-e,!1]}let d=\"[\"+(l?\"^\":\"\")+Ye(s)+\"]\",u=\"[\"+(l?\"\":\"^\")+Ye(i)+\"]\";return[s.length&&i.length?\"(\"+d+\"|\"+u+\")\":s.length?d:u,o,f-e,!0]};Rt.parseClass=ci});var kt=R(At=>{\"use strict\";Object.defineProperty(At,\"__esModule\",{value:!0});At.unescape=void 0;var ui=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\\[([^\\/\\\\])\\]/g,\"$1\"):n.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g,\"$1$2\").replace(/\\\\([^\\/])/g,\"$1\"):t?n.replace(/\\[([^\\/\\\\{}])\\]/g,\"$1\"):n.replace(/((?!\\\\).|^)\\[([^\\/\\\\{}])\\]/g,\"$1$2\").replace(/\\\\([^\\/{}])/g,\"$1\");At.unescape=ui});var pe=R(Dt=>{\"use strict\";Object.defineProperty(Dt,\"__esModule\",{value:!0});Dt.AST=void 0;var fi=Je(),Mt=kt(),di=new Set([\"!\",\"?\",\"+\",\"*\",\"@\"]),Ze=n=>di.has(n),pi=\"(?!(?:^|/)\\\\.\\\\.?(?:$|/))\",Pt=\"(?!\\\\.)\",mi=new Set([\"[\",\".\"]),gi=new Set([\"..\",\".\"]),wi=new Set(\"().*{}+?[]^$\\\\!\"),bi=n=>n.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),de=\"[^/]\",Qe=de+\"*?\",ts=de+\"+?\",fe=class n{type;#t;#s;#n=!1;#r=[];#h;#S;#w;#c=!1;#o;#f;#u=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#h=e,this.#t=this.#h?this.#h.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#w=this.#t===this?[]:this.#t.#w,t===\"!\"&&!this.#t.#c&&this.#w.push(this),this.#S=this.#h?this.#h.#r.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let t of this.#r)if(typeof t!=\"string\"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+\"(\"+this.#r.map(t=>String(t)).join(\"|\")+\")\":this.#f=this.#r.map(t=>String(t)).join(\"\")}#a(){if(this!==this.#t)throw new Error(\"should only call on root\");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#w.pop();){if(t.type!==\"!\")continue;let e=t,s=e.#h;for(;s;){for(let i=e.#S+1;!s.type&&i<s.#r.length;i++)for(let r of t.#r){if(typeof r==\"string\")throw new Error(\"string part in extglob AST??\");r.copyIn(s.#r[i])}e=s,s=e.#h}}return this}push(...t){for(let e of t)if(e!==\"\"){if(typeof e!=\"string\"&&!(e instanceof n&&e.#h===this))throw new Error(\"invalid part: \"+e);this.#r.push(e)}}toJSON(){let t=this.type===null?this.#r.slice().map(e=>typeof e==\"string\"?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&this.#h?.type===\"!\")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#S===0)return!0;let t=this.#h;for(let e=0;e<this.#S;e++){let s=t.#r[e];if(!(s instanceof n&&s.type===\"!\"))return!1}return!0}isEnd(){if(this.#t===this||this.#h?.type===\"!\")return!0;if(!this.#h?.isEnd())return!1;if(!this.type)return this.#h?.isEnd();let t=this.#h?this.#h.#r.length:0;return this.#S===t-1}copyIn(t){typeof t==\"string\"?this.push(t):this.push(t.clone(this))}clone(t){let e=new n(this.type,t);for(let s of this.#r)e.copyIn(s);return e}static#i(t,e,s,i){let r=!1,h=!1,o=-1,a=!1;if(e.type===null){let u=s,m=\"\";for(;u<t.length;){let p=t.charAt(u++);if(r||p===\"\\\\\"){r=!r,m+=p;continue}if(h){u===o+1?(p===\"^\"||p===\"!\")&&(a=!0):p===\"]\"&&!(u===o+2&&a)&&(h=!1),m+=p;continue}else if(p===\"[\"){h=!0,o=u,a=!1,m+=p;continue}if(!i.noext&&Ze(p)&&t.charAt(u)===\"(\"){e.push(m),m=\"\";let b=new n(p,e);u=n.#i(t,b,u,i),e.push(b);continue}m+=p}return e.push(m),u}let l=s+1,f=new n(null,e),c=[],d=\"\";for(;l<t.length;){let u=t.charAt(l++);if(r||u===\"\\\\\"){r=!r,d+=u;continue}if(h){l===o+1?(u===\"^\"||u===\"!\")&&(a=!0):u===\"]\"&&!(l===o+2&&a)&&(h=!1),d+=u;continue}else if(u===\"[\"){h=!0,o=l,a=!1,d+=u;continue}if(Ze(u)&&t.charAt(l)===\"(\"){f.push(d),d=\"\";let m=new n(u,f);f.push(m),l=n.#i(t,m,l,i);continue}if(u===\"|\"){f.push(d),d=\"\",c.push(f),f=new n(null,e);continue}if(u===\")\")return d===\"\"&&e.#r.length===0&&(e.#u=!0),f.push(d),d=\"\",e.push(...c,f),l;d+=u}return e.type=null,e.#s=void 0,e.#r=[t.substring(s-1)],l}static fromGlob(t,e={}){let s=new n(null,void 0,e);return n.#i(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#s||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(this.#o.nocase?\"i\":\"\")+(r?\"u\":\"\");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#o}toRegExpSource(t){let e=t??!!this.#o.dot;if(this.#t===this&&this.#a(),!this.type){let a=this.isStart()&&this.isEnd()&&!this.#r.some(u=>typeof u!=\"string\"),l=this.#r.map(u=>{let[m,p,b,w]=typeof u==\"string\"?n.#v(u,this.#s,a):u.toRegExpSource(t);return this.#s=this.#s||b,this.#n=this.#n||w,m}).join(\"\"),f=\"\";if(this.isStart()&&typeof this.#r[0]==\"string\"&&!(this.#r.length===1&&gi.has(this.#r[0]))){let m=mi,p=e&&m.has(l.charAt(0))||l.startsWith(\"\\\\.\")&&m.has(l.charAt(2))||l.startsWith(\"\\\\.\\\\.\")&&m.has(l.charAt(4)),b=!e&&!t&&m.has(l.charAt(0));f=p?pi:b?Pt:\"\"}let c=\"\";return this.isEnd()&&this.#t.#c&&this.#h?.type===\"!\"&&(c=\"(?:$|\\\\/)\"),[f+l+c,(0,Mt.unescape)(l),this.#s=!!this.#s,this.#n]}let s=this.type===\"*\"||this.type===\"+\",i=this.type===\"!\"?\"(?:(?!(?:\":\"(?:\",r=this.#d(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!==\"!\"){let a=this.toString();return this.#r=[a],this.type=null,this.#s=void 0,[a,(0,Mt.unescape)(this.toString()),!1,!1]}let h=!s||t||e||!Pt?\"\":this.#d(!0);h===r&&(h=\"\"),h&&(r=`(?:${r})(?:${h})*?`);let o=\"\";if(this.type===\"!\"&&this.#u)o=(this.isStart()&&!e?Pt:\"\")+ts;else{let a=this.type===\"!\"?\"))\"+(this.isStart()&&!e&&!t?Pt:\"\")+Qe+\")\":this.type===\"@\"?\")\":this.type===\"?\"?\")?\":this.type===\"+\"&&h?\")\":this.type===\"*\"&&h?\")?\":`)${this.type}`;o=i+r+a}return[o,(0,Mt.unescape)(r),this.#s=!!this.#s,this.#n]}#d(t){return this.#r.map(e=>{if(typeof e==\"string\")throw new Error(\"string type in extglob ast??\");let[s,i,r,h]=e.toRegExpSource(t);return this.#n=this.#n||h,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(\"|\")}static#v(t,e,s=!1){let i=!1,r=\"\",h=!1,o=!1;for(let a=0;a<t.length;a++){let l=t.charAt(a);if(i){i=!1,r+=(wi.has(l)?\"\\\\\":\"\")+l;continue}if(l===\"*\"){if(o)continue;o=!0,r+=s&&/^[*]+$/.test(t)?ts:Qe,e=!0;continue}else o=!1;if(l===\"\\\\\"){a===t.length-1?r+=\"\\\\\\\\\":i=!0;continue}if(l===\"[\"){let[f,c,d,u]=(0,fi.parseClass)(t,a);if(d){r+=f,h=h||c,a+=d-1,e=e||u;continue}}if(l===\"?\"){r+=de,e=!0;continue}r+=bi(l)}return[r,(0,Mt.unescape)(t),!!e,h]}};Dt.AST=fe});var me=R(Ft=>{\"use strict\";Object.defineProperty(Ft,\"__esModule\",{value:!0});Ft.escape=void 0;var yi=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\\]{}]/g,\"[$&]\"):n.replace(/[?*()[\\]\\\\{}]/g,\"\\\\$&\"):t?n.replace(/[?*()[\\]]/g,\"[$&]\"):n.replace(/[?*()[\\]\\\\]/g,\"\\\\$&\");Ft.escape=yi});var H=R(g=>{\"use strict\";Object.defineProperty(g,\"__esModule\",{value:!0});g.unescape=g.escape=g.AST=g.Minimatch=g.match=g.makeRe=g.braceExpand=g.defaults=g.filter=g.GLOBSTAR=g.sep=g.minimatch=void 0;var Si=Ke(),jt=Xe(),is=pe(),vi=me(),Ei=kt(),_i=(n,t,e={})=>((0,jt.assertValidPattern)(t),!e.nocomment&&t.charAt(0)===\"#\"?!1:new J(t,e).match(n));g.minimatch=_i;var Oi=/^\\*+([^+@!?\\*\\[\\(]*)$/,xi=n=>t=>!t.startsWith(\".\")&&t.endsWith(n),Ti=n=>t=>t.endsWith(n),Ci=n=>(n=n.toLowerCase(),t=>!t.startsWith(\".\")&&t.toLowerCase().endsWith(n)),Ri=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),Ai=/^\\*+\\.\\*+$/,ki=n=>!n.startsWith(\".\")&&n.includes(\".\"),Mi=n=>n!==\".\"&&n!==\"..\"&&n.includes(\".\"),Pi=/^\\.\\*+$/,Di=n=>n!==\".\"&&n!==\"..\"&&n.startsWith(\".\"),Fi=/^\\*+$/,ji=n=>n.length!==0&&!n.startsWith(\".\"),Ni=n=>n.length!==0&&n!==\".\"&&n!==\"..\",Li=/^\\?+([^+@!?\\*\\[\\(]*)?$/,Wi=([n,t=\"\"])=>{let e=rs([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Bi=([n,t=\"\"])=>{let e=ns([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Ii=([n,t=\"\"])=>{let e=ns([n]);return t?s=>e(s)&&s.endsWith(t):e},Gi=([n,t=\"\"])=>{let e=rs([n]);return t?s=>e(s)&&s.endsWith(t):e},rs=([n])=>{let t=n.length;return e=>e.length===t&&!e.startsWith(\".\")},ns=([n])=>{let t=n.length;return e=>e.length===t&&e!==\".\"&&e!==\"..\"},hs=typeof process==\"object\"&&process?typeof process.env==\"object\"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:\"posix\",es={win32:{sep:\"\\\\\"},posix:{sep:\"/\"}};g.sep=hs===\"win32\"?es.win32.sep:es.posix.sep;g.minimatch.sep=g.sep;g.GLOBSTAR=Symbol(\"globstar **\");g.minimatch.GLOBSTAR=g.GLOBSTAR;var zi=\"[^/]\",Ui=zi+\"*?\",$i=\"(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?\",qi=\"(?:(?!(?:\\\\/|^)\\\\.).)*?\",Hi=(n,t={})=>e=>(0,g.minimatch)(e,n,t);g.filter=Hi;g.minimatch.filter=g.filter;var F=(n,t={})=>Object.assign({},n,t),Vi=n=>{if(!n||typeof n!=\"object\"||!Object.keys(n).length)return g.minimatch;let t=g.minimatch;return Object.assign((s,i,r={})=>t(s,i,F(n,r)),{Minimatch:class extends t.Minimatch{constructor(i,r={}){super(i,F(n,r))}static defaults(i){return t.defaults(F(n,i)).Minimatch}},AST:class extends t.AST{constructor(i,r,h={}){super(i,r,F(n,h))}static fromGlob(i,r={}){return t.AST.fromGlob(i,F(n,r))}},unescape:(s,i={})=>t.unescape(s,F(n,i)),escape:(s,i={})=>t.escape(s,F(n,i)),filter:(s,i={})=>t.filter(s,F(n,i)),defaults:s=>t.defaults(F(n,s)),makeRe:(s,i={})=>t.makeRe(s,F(n,i)),braceExpand:(s,i={})=>t.braceExpand(s,F(n,i)),match:(s,i,r={})=>t.match(s,i,F(n,r)),sep:t.sep,GLOBSTAR:g.GLOBSTAR})};g.defaults=Vi;g.minimatch.defaults=g.defaults;var Ki=(n,t={})=>((0,jt.assertValidPattern)(n),t.nobrace||!/\\{(?:(?!\\{).)*\\}/.test(n)?[n]:(0,Si.expand)(n,{max:t.braceExpandMax}));g.braceExpand=Ki;g.minimatch.braceExpand=g.braceExpand;var Xi=(n,t={})=>new J(n,t).makeRe();g.makeRe=Xi;g.minimatch.makeRe=g.makeRe;var Yi=(n,t,e={})=>{let s=new J(t,e);return n=n.filter(i=>s.match(i)),s.options.nonull&&!n.length&&n.push(t),n};g.match=Yi;g.minimatch.match=g.match;var ss=/[?*]|[+@!]\\(.*?\\)|\\[|\\]/,Ji=n=>n.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),J=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){(0,jt.assertValidPattern)(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||hs,this.isWindows=this.platform===\"win32\";let s=\"allowWindowsEscape\";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\\\/g,\"/\")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!=\"string\")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)===\"#\"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,h,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=r[0]===\"\"&&r[1]===\"\"&&(r[2]===\"?\"||!ss.test(r[2]))&&!ss.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(a)return[...r.slice(0,4),...r.slice(4).map(f=>this.parse(f))];if(l)return[r[0],...r.slice(1).map(f=>this.parse(f))]}return r.map(a=>this.parse(a))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let h=this.set[r];h[0]===\"\"&&h[1]===\"\"&&this.globParts[r][2]===\"?\"&&typeof h[3]==\"string\"&&/^[a-z]:$/i.test(h[3])&&(h[2]=\"?\")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let i=0;i<t[s].length;i++)t[s][i]===\"**\"&&(t[s][i]=\"*\");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf(\"**\",s+1))!==-1;){let i=s;for(;e[i+1]===\"**\";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let r=s[s.length-1];return i===\"**\"&&r===\"**\"?s:i===\"..\"&&r&&r!==\"..\"&&r!==\".\"&&r!==\"**\"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[\"\"]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let r=t[i];i===1&&r===\"\"&&t[0]===\"\"||(r===\".\"||r===\"\")&&(e=!0,t.splice(i,1),i--)}t[0]===\".\"&&t.length===2&&(t[1]===\".\"||t[1]===\"\")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf(\"..\",s+1))!==-1;){let i=t[s-1];i&&i!==\".\"&&i!==\"..\"&&i!==\"**\"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[\"\"]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;(i=s.indexOf(\"**\",i+1))!==-1;){let h=i;for(;s[h+1]===\"**\";)h++;h>i&&s.splice(i+1,h-i);let o=s[i+1],a=s[i+2],l=s[i+3];if(o!==\"..\"||!a||a===\".\"||a===\"..\"||!l||l===\".\"||l===\"..\")continue;e=!0,s.splice(i,1);let f=s.slice(0);f[i]=\"**\",t.push(f),i--}if(!this.preserveMultipleSlashes){for(let h=1;h<s.length-1;h++){let o=s[h];h===1&&o===\"\"&&s[0]===\"\"||(o===\".\"||o===\"\")&&(e=!0,s.splice(h,1),h--)}s[0]===\".\"&&s.length===2&&(s[1]===\".\"||s[1]===\"\")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf(\"..\",r+1))!==-1;){let h=s[r-1];if(h&&h!==\".\"&&h!==\"..\"&&h!==\"**\"){e=!0;let a=r===1&&s[r+1]===\"**\"?[\".\"]:[];s.splice(r-1,2,...a),s.length===0&&s.push(\"\"),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let i=0,r=0,h=[],o=\"\";for(;i<t.length&&r<e.length;)if(t[i]===e[r])h.push(o===\"b\"?e[r]:t[i]),i++,r++;else if(s&&t[i]===\"**\"&&e[r]===t[i+1])h.push(t[i]),i++;else if(s&&e[r]===\"**\"&&t[i]===e[r+1])h.push(e[r]),r++;else if(t[i]===\"*\"&&e[r]&&(this.options.dot||!e[r].startsWith(\".\"))&&e[r]!==\"**\"){if(o===\"b\")return!1;o=\"a\",h.push(t[i]),i++,r++}else if(e[r]===\"*\"&&t[i]&&(this.options.dot||!t[i].startsWith(\".\"))&&t[i]!==\"**\"){if(o===\"a\")return!1;o=\"b\",h.push(e[r]),i++,r++}else return!1;return t.length===e.length&&h}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)===\"!\";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let i=this.options;if(this.isWindows){let p=typeof t[0]==\"string\"&&/^[a-z]:$/i.test(t[0]),b=!p&&t[0]===\"\"&&t[1]===\"\"&&t[2]===\"?\"&&/^[a-z]:$/i.test(t[3]),w=typeof e[0]==\"string\"&&/^[a-z]:$/i.test(e[0]),v=!w&&e[0]===\"\"&&e[1]===\"\"&&e[2]===\"?\"&&typeof e[3]==\"string\"&&/^[a-z]:$/i.test(e[3]),E=b?3:p?0:void 0,y=v?3:w?0:void 0;if(typeof E==\"number\"&&typeof y==\"number\"){let[S,B]=[t[E],e[y]];S.toLowerCase()===B.toLowerCase()&&(e[y]=S,y>E?e=e.slice(y):E>y&&(t=t.slice(E)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug(\"matchOne\",this,{file:t,pattern:e}),this.debug(\"matchOne\",t.length,e.length);for(var h=0,o=0,a=t.length,l=e.length;h<a&&o<l;h++,o++){this.debug(\"matchOne loop\");var f=e[o],c=t[h];if(this.debug(e,f,c),f===!1)return!1;if(f===g.GLOBSTAR){this.debug(\"GLOBSTAR\",[e,f,c]);var d=h,u=o+1;if(u===l){for(this.debug(\"** at the end\");h<a;h++)if(t[h]===\".\"||t[h]===\"..\"||!i.dot&&t[h].charAt(0)===\".\")return!1;return!0}for(;d<a;){var m=t[d];if(this.debug(`\nglobstar while`,t,d,e,u,m),this.matchOne(t.slice(d),e.slice(u),s))return this.debug(\"globstar found match!\",d,a,m),!0;if(m===\".\"||m===\"..\"||!i.dot&&m.charAt(0)===\".\"){this.debug(\"dot detected!\",t,d,e,u);break}this.debug(\"globstar swallow a segment, and continue\"),d++}return!!(s&&(this.debug(`\n>>> no match, partial?`,t,d,e,u),d===a))}let p;if(typeof f==\"string\"?(p=c===f,this.debug(\"string match\",f,c,p)):(p=f.test(c),this.debug(\"pattern match\",f,c,p)),!p)return!1}if(h===a&&o===l)return!0;if(h===a)return s;if(o===l)return h===a-1&&t[h]===\"\";throw new Error(\"wtf?\")}braceExpand(){return(0,g.braceExpand)(this.pattern,this.options)}parse(t){(0,jt.assertValidPattern)(t);let e=this.options;if(t===\"**\")return g.GLOBSTAR;if(t===\"\")return\"\";let s,i=null;(s=t.match(Fi))?i=e.dot?Ni:ji:(s=t.match(Oi))?i=(e.nocase?e.dot?Ri:Ci:e.dot?Ti:xi)(s[1]):(s=t.match(Li))?i=(e.nocase?e.dot?Bi:Wi:e.dot?Ii:Gi)(s):(s=t.match(Ai))?i=e.dot?Mi:ki:(s=t.match(Pi))&&(i=Di);let r=is.AST.fromGlob(t,this.options).toMMPattern();return i&&typeof r==\"object\"&&Reflect.defineProperty(r,\"test\",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Ui:e.dot?$i:qi,i=new Set(e.nocase?[\"i\"]:[]),r=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let d of c.flags.split(\"\"))i.add(d);return typeof c==\"string\"?Ji(c):c===g.GLOBSTAR?g.GLOBSTAR:c._src});l.forEach((c,d)=>{let u=l[d+1],m=l[d-1];c!==g.GLOBSTAR||m===g.GLOBSTAR||(m===void 0?u!==void 0&&u!==g.GLOBSTAR?l[d+1]=\"(?:\\\\/|\"+s+\"\\\\/)?\"+u:l[d]=s:u===void 0?l[d-1]=m+\"(?:\\\\/|\\\\/\"+s+\")?\":u!==g.GLOBSTAR&&(l[d-1]=m+\"(?:\\\\/|\\\\/\"+s+\"\\\\/)\"+u,l[d+1]=g.GLOBSTAR))});let f=l.filter(c=>c!==g.GLOBSTAR);if(this.partial&&f.length>=1){let c=[];for(let d=1;d<=f.length;d++)c.push(f.slice(0,d).join(\"/\"));return\"(?:\"+c.join(\"|\")+\")\"}return f.join(\"/\")}).join(\"|\"),[h,o]=t.length>1?[\"(?:\",\")\"]:[\"\",\"\"];r=\"^\"+h+r+o+\"$\",this.partial&&(r=\"^(?:\\\\/|\"+h+r.slice(1,-1)+o+\")$\"),this.negate&&(r=\"^(?!\"+r+\").+$\");try{this.regexp=new RegExp(r,[...i].join(\"\"))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split(\"/\"):this.isWindows&&/^\\/\\/[^\\/]+/.test(t)?[\"\",...t.split(/\\/+/)]:t.split(/\\/+/)}match(t,e=this.partial){if(this.debug(\"match\",t,this.pattern),this.comment)return!1;if(this.empty)return t===\"\";if(t===\"/\"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split(\"\\\\\").join(\"/\"));let i=this.slashSplit(t);this.debug(this.pattern,\"split\",i);let r=this.set;this.debug(this.pattern,\"set\",r);let h=i[i.length-1];if(!h)for(let o=i.length-2;!h&&o>=0;o--)h=i[o];for(let o=0;o<r.length;o++){let a=r[o],l=i;if(s.matchBase&&a.length===1&&(l=[h]),this.matchOne(l,a,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return g.minimatch.defaults(t).Minimatch}};g.Minimatch=J;var Zi=pe();Object.defineProperty(g,\"AST\",{enumerable:!0,get:function(){return Zi.AST}});var Qi=me();Object.defineProperty(g,\"escape\",{enumerable:!0,get:function(){return Qi.escape}});var tr=kt();Object.defineProperty(g,\"unescape\",{enumerable:!0,get:function(){return tr.unescape}});g.minimatch.AST=is.AST;g.minimatch.Minimatch=J;g.minimatch.escape=vi.escape;g.minimatch.unescape=Ei.unescape});var fs=R(Wt=>{\"use strict\";Object.defineProperty(Wt,\"__esModule\",{value:!0});Wt.LRUCache=void 0;var er=typeof performance==\"object\"&&performance&&typeof performance.now==\"function\"?performance:Date,as=new Set,ge=typeof process==\"object\"&&process?process:{},ls=(n,t,e,s)=>{typeof ge.emitWarning==\"function\"?ge.emitWarning(n,t,e,s):console.error(`[${e}] ${t}: ${n}`)},Lt=globalThis.AbortController,os=globalThis.AbortSignal;if(typeof Lt>\"u\"){os=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,s){this._onabort.push(s)}},Lt=class{constructor(){t()}signal=new os;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let s of this.signal._onabort)s(e);this.signal.onabort?.(e)}}};let n=ge.env?.LRU_CACHE_IGNORE_AC_WARNING!==\"1\",t=()=>{n&&(n=!1,ls(\"AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.\",\"NO_ABORT_CONTROLLER\",\"ENOTSUP\",t))}}var sr=n=>!as.has(n),V=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),cs=n=>V(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Nt:null:null,Nt=class extends Array{constructor(n){super(n),this.fill(0)}},ir=class at{heap;length;static#t=!1;static create(t){let e=cs(t);if(!e)return[];at.#t=!0;let s=new at(t,e);return at.#t=!1,s}constructor(t,e){if(!at.#t)throw new TypeError(\"instantiate Stack using Stack.create(n)\");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},rr=class us{#t;#s;#n;#r;#h;#S;#w;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#f;#u;#a;#i;#d;#v;#y;#p;#R;#m;#O;#x;#g;#b;#E;#T;#e;#F;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#g,autopurgeTimers:t.#b,sizes:t.#O,keyMap:t.#u,keyList:t.#a,valList:t.#i,next:t.#d,prev:t.#v,get head(){return t.#y},get tail(){return t.#p},free:t.#R,isBackgroundFetch:e=>t.#l(e),backgroundFetch:(e,s,i,r)=>t.#z(e,s,i,r),moveToTail:e=>t.#N(e),indexes:e=>t.#k(e),rindexes:e=>t.#M(e),isStale:e=>t.#_(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#f}get size(){return this.#o}get fetchMethod(){return this.#S}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#h}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:a,dispose:l,onInsert:f,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:u,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:b,fetchMethod:w,memoMethod:v,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:B,ignoreFetchAbort:U,perf:et}=t;if(et!==void 0&&typeof et?.now!=\"function\")throw new TypeError(\"perf option must have a now() method if specified\");if(this.#c=et??er,e!==0&&!V(e))throw new TypeError(\"max option must be a nonnegative integer\");let st=e?cs(e):Array;if(!st)throw new Error(\"invalid max value: \"+e);if(this.#t=e,this.#s=m,this.maxEntrySize=p||this.#s,this.sizeCalculation=b,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError(\"cannot set sizeCalculation without setting maxSize or maxEntrySize\");if(typeof this.sizeCalculation!=\"function\")throw new TypeError(\"sizeCalculation set to non-function\")}if(v!==void 0&&typeof v!=\"function\")throw new TypeError(\"memoMethod must be a function if defined\");if(this.#w=v,w!==void 0&&typeof w!=\"function\")throw new TypeError(\"fetchMethod must be a function if specified\");if(this.#S=w,this.#T=!!w,this.#u=new Map,this.#a=new Array(e).fill(void 0),this.#i=new Array(e).fill(void 0),this.#d=new st(e),this.#v=new st(e),this.#y=0,this.#p=0,this.#R=ir.create(e),this.#o=0,this.#f=0,typeof l==\"function\"&&(this.#n=l),typeof f==\"function\"&&(this.#r=f),typeof c==\"function\"?(this.#h=c,this.#m=[]):(this.#h=void 0,this.#m=void 0),this.#E=!!this.#n,this.#F=!!this.#r,this.#e=!!this.#h,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(this.#s!==0&&!V(this.#s))throw new TypeError(\"maxSize must be a positive integer if specified\");if(!V(this.maxEntrySize))throw new TypeError(\"maxEntrySize must be a positive integer if specified\");this.#$()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=V(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!V(this.ttl))throw new TypeError(\"ttl must be a positive integer if specified\");this.#P()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError(\"At least one of max, maxSize, or ttl is required\");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let le=\"LRU_CACHE_UNBOUNDED\";sr(le)&&(as.add(le),ls(\"TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.\",\"UnboundedCacheWarning\",le,us))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#P(){let t=new Nt(this.#t),e=new Nt(this.#t);this.#g=t,this.#x=e;let s=this.ttlAutopurge?new Array(this.#t):void 0;this.#b=s,this.#W=(h,o,a=this.#c.now())=>{if(e[h]=o!==0?a:0,t[h]=o,s?.[h]&&(clearTimeout(s[h]),s[h]=void 0),o!==0&&s){let l=setTimeout(()=>{this.#_(h)&&this.#A(this.#a[h],\"expire\")},o+1);l.unref&&l.unref(),s[h]=l}},this.#C=h=>{e[h]=t[h]!==0?this.#c.now():0},this.#D=(h,o)=>{if(t[o]){let a=t[o],l=e[o];if(!a||!l)return;h.ttl=a,h.start=l,h.now=i||r();let f=h.now-l;h.remainingTTL=a-f}};let i=0,r=()=>{let h=this.#c.now();if(this.ttlResolution>0){i=h;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return h};this.getRemainingTTL=h=>{let o=this.#u.get(h);if(o===void 0)return 0;let a=t[o],l=e[o];if(!a||!l)return 1/0;let f=(i||r())-l;return a-f},this.#_=h=>{let o=e[h],a=t[h];return!!a&&!!o&&(i||r())-o>a}}#C=()=>{};#D=()=>{};#W=()=>{};#_=()=>!1;#$(){let t=new Nt(this.#t);this.#f=0,this.#O=t,this.#L=e=>{this.#f-=t[e],t[e]=0},this.#B=(e,s,i,r)=>{if(this.#l(s))return 0;if(!V(i))if(r){if(typeof r!=\"function\")throw new TypeError(\"sizeCalculation must be a function\");if(i=r(s,e),!V(i))throw new TypeError(\"sizeCalculation return invalid (expect positive integer)\")}else throw new TypeError(\"invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.\");return i},this.#j=(e,s,i)=>{if(t[e]=s,this.#s){let r=this.#s-t[e];for(;this.#f>r;)this.#G(!0)}this.#f+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#f)}}#L=t=>{};#j=(t,e,s)=>{};#B=(t,e,s,i)=>{if(s||i)throw new TypeError(\"cannot set size without setting maxSize or maxEntrySize on cache\");return 0};*#k({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#p;!(!this.#I(e)||((t||!this.#_(e))&&(yield e),e===this.#y));)e=this.#v[e]}*#M({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#y;!(!this.#I(e)||((t||!this.#_(e))&&(yield e),e===this.#p));)e=this.#d[e]}#I(t){return t!==void 0&&this.#u.get(this.#a[t])===t}*entries(){for(let t of this.#k())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield[this.#a[t],this.#i[t]])}*rentries(){for(let t of this.#M())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield[this.#a[t],this.#i[t]])}*keys(){for(let t of this.#k()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e)}}*rkeys(){for(let t of this.#M()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e)}}*values(){for(let t of this.#k())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t])}*rvalues(){for(let t of this.#M())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=\"LRUCache\";find(t,e={}){for(let s of this.#k()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;if(r!==void 0&&t(r,this.#a[s],this))return this.get(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#k()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#M()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#M({allowStale:!0}))this.#_(e)&&(this.#A(this.#a[e],\"expire\"),t=!0);return t}info(t){let e=this.#u.get(t);if(e===void 0)return;let s=this.#i[e],i=this.#l(s)?s.__staleWhileFetching:s;if(i===void 0)return;let r={value:i};if(this.#g&&this.#x){let h=this.#g[e],o=this.#x[e];if(h&&o){let a=h-(this.#c.now()-o);r.ttl=a,r.start=Date.now()}}return this.#O&&(r.size=this.#O[e]),r}dump(){let t=[];for(let e of this.#k({allowStale:!0})){let s=this.#a[e],i=this.#i[e],r=this.#l(i)?i.__staleWhileFetching:i;if(r===void 0||s===void 0)continue;let h={value:r};if(this.#g&&this.#x){h.ttl=this.#g[e];let o=this.#c.now()-this.#x[e];h.start=Math.floor(Date.now()-o)}this.#O&&(h.size=this.#O[e]),t.unshift([s,h])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#c.now()-i}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,f=this.#B(t,e,s.size||0,o);if(this.maxEntrySize&&f>this.maxEntrySize)return a&&(a.set=\"miss\",a.maxEntrySizeExceeded=!0),this.#A(t,\"set\"),this;let c=this.#o===0?void 0:this.#u.get(t);if(c===void 0)c=this.#o===0?this.#p:this.#R.length!==0?this.#R.pop():this.#o===this.#t?this.#G(!1):this.#o,this.#a[c]=t,this.#i[c]=e,this.#u.set(t,c),this.#d[this.#p]=c,this.#v[c]=this.#p,this.#p=c,this.#o++,this.#j(c,f,a),a&&(a.set=\"add\"),l=!1,this.#F&&this.#r?.(e,t,\"add\");else{this.#N(c);let d=this.#i[c];if(e!==d){if(this.#T&&this.#l(d)){d.__abortController.abort(new Error(\"replaced\"));let{__staleWhileFetching:u}=d;u!==void 0&&!h&&(this.#E&&this.#n?.(u,t,\"set\"),this.#e&&this.#m?.push([u,t,\"set\"]))}else h||(this.#E&&this.#n?.(d,t,\"set\"),this.#e&&this.#m?.push([d,t,\"set\"]));if(this.#L(c),this.#j(c,f,a),this.#i[c]=e,a){a.set=\"replace\";let u=d&&this.#l(d)?d.__staleWhileFetching:d;u!==void 0&&(a.oldValue=u)}}else a&&(a.set=\"update\");this.#F&&this.onInsert?.(e,t,e===d?\"update\":\"replace\")}if(i!==0&&!this.#g&&this.#P(),this.#g&&(l||this.#W(c,i,r),a&&this.#D(a,c)),!h&&this.#e&&this.#m){let d=this.#m,u;for(;u=d?.shift();)this.#h?.(...u)}return this}pop(){try{for(;this.#o;){let t=this.#i[this.#y];if(this.#G(!0),this.#l(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#h?.(...e)}}}#G(t){let e=this.#y,s=this.#a[e],i=this.#i[e];return this.#T&&this.#l(i)?i.__abortController.abort(new Error(\"evicted\")):(this.#E||this.#e)&&(this.#E&&this.#n?.(i,s,\"evict\"),this.#e&&this.#m?.push([i,s,\"evict\"])),this.#L(e),this.#b?.[e]&&(clearTimeout(this.#b[e]),this.#b[e]=void 0),t&&(this.#a[e]=void 0,this.#i[e]=void 0,this.#R.push(e)),this.#o===1?(this.#y=this.#p=0,this.#R.length=0):this.#y=this.#d[e],this.#u.delete(s),this.#o--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#u.get(t);if(r!==void 0){let h=this.#i[r];if(this.#l(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#_(r))i&&(i.has=\"stale\",this.#D(i,r));else return s&&this.#C(r),i&&(i.has=\"hit\",this.#D(i,r)),!0}else i&&(i.has=\"miss\");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,i=this.#u.get(t);if(i===void 0||!s&&this.#_(i))return;let r=this.#i[i];return this.#l(r)?r.__staleWhileFetching:r}#z(t,e,s,i){let r=e===void 0?void 0:this.#i[e];if(this.#l(r))return r;let h=new Lt,{signal:o}=s;o?.addEventListener(\"abort\",()=>h.abort(o.reason),{signal:h.signal});let a={signal:h.signal,options:s,context:i},l=(p,b=!1)=>{let{aborted:w}=h.signal,v=s.ignoreFetchAbort&&p!==void 0,E=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&p!==void 0);if(s.status&&(w&&!b?(s.status.fetchAborted=!0,s.status.fetchError=h.signal.reason,v&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),w&&!v&&!b)return c(h.signal.reason,E);let y=u,S=this.#i[e];return(S===u||v&&b&&S===void 0)&&(p===void 0?y.__staleWhileFetching!==void 0?this.#i[e]=y.__staleWhileFetching:this.#A(t,\"fetch\"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},f=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),c(p,!1)),c=(p,b)=>{let{aborted:w}=h.signal,v=w&&s.allowStaleOnFetchAbort,E=v||s.allowStaleOnFetchRejection,y=E||s.noDeleteOnFetchRejection,S=u;if(this.#i[e]===u&&(!y||!b&&S.__staleWhileFetching===void 0?this.#A(t,\"fetch\"):v||(this.#i[e]=S.__staleWhileFetching)),E)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw p},d=(p,b)=>{let w=this.#S?.(t,r,a);w&&w instanceof Promise&&w.then(v=>p(v===void 0?void 0:v),b),h.signal.addEventListener(\"abort\",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=v=>l(v,!0)))})};s.status&&(s.status.fetchDispatched=!0);let u=new Promise(d).then(l,f),m=Object.assign(u,{__abortController:h,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,m,{...a.options,status:void 0}),e=this.#u.get(t)):this.#i[e]=m,m}#l(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty(\"__staleWhileFetching\")&&e.__abortController instanceof Lt}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:w,signal:v}=e;if(!this.#T)return w&&(w.fetch=\"get\"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:w});let E={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:h,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:f,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:u,status:w,signal:v},y=this.#u.get(t);if(y===void 0){w&&(w.fetch=\"miss\");let S=this.#z(t,y,E,p);return S.__returned=S}else{let S=this.#i[y];if(this.#l(S)){let st=s&&S.__staleWhileFetching!==void 0;return w&&(w.fetch=\"inflight\",st&&(w.returnedStale=!0)),st?S.__staleWhileFetching:S.__returned=S}let B=this.#_(y);if(!b&&!B)return w&&(w.fetch=\"hit\"),this.#N(y),i&&this.#C(y),w&&this.#D(w,y),S;let U=this.#z(t,y,E,p),et=U.__staleWhileFetching!==void 0&&s;return w&&(w.fetch=B?\"stale\":\"refresh\",et&&B&&(w.returnedStale=!0)),et?U.__staleWhileFetching:U.__returned=U}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error(\"fetch() returned undefined\");return s}memo(t,e={}){let s=this.#w;if(!s)throw new Error(\"no memoMethod provided to constructor\");let{context:i,forceRefresh:r,...h}=e,o=this.get(t,h);if(!r&&o!==void 0)return o;let a=s(t,o,{options:h,context:i});return this.set(t,a,h),a}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:h}=e,o=this.#u.get(t);if(o!==void 0){let a=this.#i[o],l=this.#l(a);return h&&this.#D(h,o),this.#_(o)?(h&&(h.get=\"stale\"),l?(h&&s&&a.__staleWhileFetching!==void 0&&(h.returnedStale=!0),s?a.__staleWhileFetching:void 0):(r||this.#A(t,\"expire\"),h&&s&&(h.returnedStale=!0),s?a:void 0)):(h&&(h.get=\"hit\"),l?a.__staleWhileFetching:(this.#N(o),i&&this.#C(o),a))}else h&&(h.get=\"miss\")}#U(t,e){this.#v[e]=t,this.#d[t]=e}#N(t){t!==this.#p&&(t===this.#y?this.#y=this.#d[t]:this.#U(this.#v[t],this.#d[t]),this.#U(this.#p,t),this.#p=t)}delete(t){return this.#A(t,\"delete\")}#A(t,e){let s=!1;if(this.#o!==0){let i=this.#u.get(t);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b?.[i]),this.#b[i]=void 0),s=!0,this.#o===1)this.#q(e);else{this.#L(i);let r=this.#i[i];if(this.#l(r)?r.__abortController.abort(new Error(\"deleted\")):(this.#E||this.#e)&&(this.#E&&this.#n?.(r,t,e),this.#e&&this.#m?.push([r,t,e])),this.#u.delete(t),this.#a[i]=void 0,this.#i[i]=void 0,i===this.#p)this.#p=this.#v[i];else if(i===this.#y)this.#y=this.#d[i];else{let h=this.#v[i];this.#d[h]=this.#d[i];let o=this.#d[i];this.#v[o]=this.#v[i]}this.#o--,this.#R.push(i)}}if(this.#e&&this.#m?.length){let i=this.#m,r;for(;r=i?.shift();)this.#h?.(...r)}return s}clear(){return this.#q(\"delete\")}#q(t){for(let e of this.#M({allowStale:!0})){let s=this.#i[e];if(this.#l(s))s.__abortController.abort(new Error(\"deleted\"));else{let i=this.#a[e];this.#E&&this.#n?.(s,i,t),this.#e&&this.#m?.push([s,i,t])}}if(this.#u.clear(),this.#i.fill(void 0),this.#a.fill(void 0),this.#g&&this.#x){this.#g.fill(0),this.#x.fill(0);for(let e of this.#b??[])e!==void 0&&clearTimeout(e);this.#b?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#p=0,this.#R.length=0,this.#f=0,this.#o=0,this.#e&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#h?.(...s)}}};Wt.LRUCache=rr});var Oe=R(P=>{\"use strict\";var nr=P&&P.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(P,\"__esModule\",{value:!0});P.Minipass=P.isWritable=P.isReadable=P.isStream=void 0;var ds=typeof process==\"object\"&&process?process:{stdout:null,stderr:null},_e=require(\"node:events\"),ws=nr(require(\"node:stream\")),hr=require(\"node:string_decoder\"),or=n=>!!n&&typeof n==\"object\"&&(n instanceof qt||n instanceof ws.default||(0,P.isReadable)(n)||(0,P.isWritable)(n));P.isStream=or;var ar=n=>!!n&&typeof n==\"object\"&&n instanceof _e.EventEmitter&&typeof n.pipe==\"function\"&&n.pipe!==ws.default.Writable.prototype.pipe;P.isReadable=ar;var lr=n=>!!n&&typeof n==\"object\"&&n instanceof _e.EventEmitter&&typeof n.write==\"function\"&&typeof n.end==\"function\";P.isWritable=lr;var $=Symbol(\"EOF\"),q=Symbol(\"maybeEmitEnd\"),K=Symbol(\"emittedEnd\"),Bt=Symbol(\"emittingEnd\"),lt=Symbol(\"emittedError\"),It=Symbol(\"closed\"),ps=Symbol(\"read\"),Gt=Symbol(\"flush\"),ms=Symbol(\"flushChunk\"),L=Symbol(\"encoding\"),rt=Symbol(\"decoder\"),x=Symbol(\"flowing\"),ct=Symbol(\"paused\"),nt=Symbol(\"resume\"),T=Symbol(\"buffer\"),M=Symbol(\"pipes\"),C=Symbol(\"bufferLength\"),we=Symbol(\"bufferPush\"),zt=Symbol(\"bufferShift\"),k=Symbol(\"objectMode\"),O=Symbol(\"destroyed\"),be=Symbol(\"error\"),ye=Symbol(\"emitData\"),gs=Symbol(\"emitEnd\"),Se=Symbol(\"emitEnd2\"),I=Symbol(\"async\"),ve=Symbol(\"abort\"),Ut=Symbol(\"aborted\"),ut=Symbol(\"signal\"),Z=Symbol(\"dataListeners\"),D=Symbol(\"discarded\"),ft=n=>Promise.resolve().then(n),cr=n=>n(),ur=n=>n===\"end\"||n===\"finish\"||n===\"prefinish\",fr=n=>n instanceof ArrayBuffer||!!n&&typeof n==\"object\"&&n.constructor&&n.constructor.name===\"ArrayBuffer\"&&n.byteLength>=0,dr=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),$t=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[nt](),this.dest.on(\"drain\",this.ondrain)}unpipe(){this.dest.removeListener(\"drain\",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ee=class extends $t{unpipe(){this.src.removeListener(\"error\",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit(\"error\",i),t.on(\"error\",this.proxyErrors)}},pr=n=>!!n.objectMode,mr=n=>!n.objectMode&&!!n.encoding&&n.encoding!==\"buffer\",qt=class extends _e.EventEmitter{[x]=!1;[ct]=!1;[M]=[];[T]=[];[k];[L];[I];[rt];[$]=!1;[K]=!1;[Bt]=!1;[It]=!1;[lt]=null;[C]=0;[O]=!1;[ut];[Ut]=!1;[Z]=0;[D]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding==\"string\")throw new TypeError(\"Encoding and objectMode may not be used together\");pr(e)?(this[k]=!0,this[L]=null):mr(e)?(this[L]=e.encoding,this[k]=!1):(this[k]=!1,this[L]=null),this[I]=!!e.async,this[rt]=this[L]?new hr.StringDecoder(this[L]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,\"buffer\",{get:()=>this[T]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,\"pipes\",{get:()=>this[M]});let{signal:s}=e;s&&(this[ut]=s,s.aborted?this[ve]():s.addEventListener(\"abort\",()=>this[ve]()))}get bufferLength(){return this[C]}get encoding(){return this[L]}set encoding(t){throw new Error(\"Encoding must be set at instantiation time\")}setEncoding(t){throw new Error(\"Encoding must be set at instantiation time\")}get objectMode(){return this[k]}set objectMode(t){throw new Error(\"objectMode must be set at instantiation time\")}get async(){return this[I]}set async(t){this[I]=this[I]||!!t}[ve](){this[Ut]=!0,this.emit(\"abort\",this[ut]?.reason),this.destroy(this[ut]?.reason)}get aborted(){return this[Ut]}set aborted(t){}write(t,e,s){if(this[Ut])return!1;if(this[$])throw new Error(\"write after end\");if(this[O])return this.emit(\"error\",Object.assign(new Error(\"Cannot call write after a stream was destroyed\"),{code:\"ERR_STREAM_DESTROYED\"})),!0;typeof e==\"function\"&&(s=e,e=\"utf8\"),e||(e=\"utf8\");let i=this[I]?ft:cr;if(!this[k]&&!Buffer.isBuffer(t)){if(dr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(fr(t))t=Buffer.from(t);else if(typeof t!=\"string\")throw new Error(\"Non-contiguous data written to non-objectMode stream\")}return this[k]?(this[x]&&this[C]!==0&&this[Gt](!0),this[x]?this.emit(\"data\",t):this[we](t),this[C]!==0&&this.emit(\"readable\"),s&&i(s),this[x]):t.length?(typeof t==\"string\"&&!(e===this[L]&&!this[rt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[L]&&(t=this[rt].write(t)),this[x]&&this[C]!==0&&this[Gt](!0),this[x]?this.emit(\"data\",t):this[we](t),this[C]!==0&&this.emit(\"readable\"),s&&i(s),this[x]):(this[C]!==0&&this.emit(\"readable\"),s&&i(s),this[x])}read(t){if(this[O])return null;if(this[D]=!1,this[C]===0||t===0||t&&t>this[C])return this[q](),null;this[k]&&(t=null),this[T].length>1&&!this[k]&&(this[T]=[this[L]?this[T].join(\"\"):Buffer.concat(this[T],this[C])]);let e=this[ps](t||null,this[T][0]);return this[q](),e}[ps](t,e){if(this[k])this[zt]();else{let s=e;t===s.length||t===null?this[zt]():typeof s==\"string\"?(this[T][0]=s.slice(t),e=s.slice(0,t),this[C]-=t):(this[T][0]=s.subarray(t),e=s.subarray(0,t),this[C]-=t)}return this.emit(\"data\",e),!this[T].length&&!this[$]&&this.emit(\"drain\"),e}end(t,e,s){return typeof t==\"function\"&&(s=t,t=void 0),typeof e==\"function\"&&(s=e,e=\"utf8\"),t!==void 0&&this.write(t,e),s&&this.once(\"end\",s),this[$]=!0,this.writable=!1,(this[x]||!this[ct])&&this[q](),this}[nt](){this[O]||(!this[Z]&&!this[M].length&&(this[D]=!0),this[ct]=!1,this[x]=!0,this.emit(\"resume\"),this[T].length?this[Gt]():this[$]?this[q]():this.emit(\"drain\"))}resume(){return this[nt]()}pause(){this[x]=!1,this[ct]=!0,this[D]=!1}get destroyed(){return this[O]}get flowing(){return this[x]}get paused(){return this[ct]}[we](t){this[k]?this[C]+=1:this[C]+=t.length,this[T].push(t)}[zt](){return this[k]?this[C]-=1:this[C]-=this[T][0].length,this[T].shift()}[Gt](t=!1){do;while(this[ms](this[zt]())&&this[T].length);!t&&!this[T].length&&!this[$]&&this.emit(\"drain\")}[ms](t){return this.emit(\"data\",t),this[x]}pipe(t,e){if(this[O])return t;this[D]=!1;let s=this[K];return e=e||{},t===ds.stdout||t===ds.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[M].push(e.proxyErrors?new Ee(this,t,e):new $t(this,t,e)),this[I]?ft(()=>this[nt]()):this[nt]()),t}unpipe(t){let e=this[M].find(s=>s.dest===t);e&&(this[M].length===1?(this[x]&&this[Z]===0&&(this[x]=!1),this[M]=[]):this[M].splice(this[M].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t===\"data\")this[D]=!1,this[Z]++,!this[M].length&&!this[x]&&this[nt]();else if(t===\"readable\"&&this[C]!==0)super.emit(\"readable\");else if(ur(t)&&this[K])super.emit(t),this.removeAllListeners(t);else if(t===\"error\"&&this[lt]){let i=e;this[I]?ft(()=>i.call(this,this[lt])):i.call(this,this[lt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t===\"data\"&&(this[Z]=this.listeners(\"data\").length,this[Z]===0&&!this[D]&&!this[M].length&&(this[x]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t===\"data\"||t===void 0)&&(this[Z]=0,!this[D]&&!this[M].length&&(this[x]=!1)),e}get emittedEnd(){return this[K]}[q](){!this[Bt]&&!this[K]&&!this[O]&&this[T].length===0&&this[$]&&(this[Bt]=!0,this.emit(\"end\"),this.emit(\"prefinish\"),this.emit(\"finish\"),this[It]&&this.emit(\"close\"),this[Bt]=!1)}emit(t,...e){let s=e[0];if(t!==\"error\"&&t!==\"close\"&&t!==O&&this[O])return!1;if(t===\"data\")return!this[k]&&!s?!1:this[I]?(ft(()=>this[ye](s)),!0):this[ye](s);if(t===\"end\")return this[gs]();if(t===\"close\"){if(this[It]=!0,!this[K]&&!this[O])return!1;let r=super.emit(\"close\");return this.removeAllListeners(\"close\"),r}else if(t===\"error\"){this[lt]=s,super.emit(be,s);let r=!this[ut]||this.listeners(\"error\").length?super.emit(\"error\",s):!1;return this[q](),r}else if(t===\"resume\"){let r=super.emit(\"resume\");return this[q](),r}else if(t===\"finish\"||t===\"prefinish\"){let r=super.emit(t);return this.removeAllListeners(t),r}let i=super.emit(t,...e);return this[q](),i}[ye](t){for(let s of this[M])s.dest.write(t)===!1&&this.pause();let e=this[D]?!1:super.emit(\"data\",t);return this[q](),e}[gs](){return this[K]?!1:(this[K]=!0,this.readable=!1,this[I]?(ft(()=>this[Se]()),!0):this[Se]())}[Se](){if(this[rt]){let e=this[rt].end();if(e){for(let s of this[M])s.dest.write(e);this[D]||super.emit(\"data\",e)}}for(let e of this[M])e.end();let t=super.emit(\"end\");return this.removeAllListeners(\"end\"),t}async collect(){let t=Object.assign([],{dataLength:0});this[k]||(t.dataLength=0);let e=this.promise();return this.on(\"data\",s=>{t.push(s),this[k]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[k])throw new Error(\"cannot concat in objectMode\");let t=await this.collect();return this[L]?t.join(\"\"):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(O,()=>e(new Error(\"stream destroyed\"))),this.on(\"error\",s=>e(s)),this.on(\"end\",()=>t())})}[Symbol.asyncIterator](){this[D]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[$])return e();let r,h,o=c=>{this.off(\"data\",a),this.off(\"end\",l),this.off(O,f),e(),h(c)},a=c=>{this.off(\"error\",o),this.off(\"end\",l),this.off(O,f),this.pause(),r({value:c,done:!!this[$]})},l=()=>{this.off(\"error\",o),this.off(\"data\",a),this.off(O,f),e(),r({done:!0,value:void 0})},f=()=>o(new Error(\"stream destroyed\"));return new Promise((c,d)=>{h=d,r=c,this.once(O,f),this.once(\"error\",o),this.once(\"end\",l),this.once(\"data\",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[D]=!1;let t=!1,e=()=>(this.pause(),this.off(be,e),this.off(O,e),this.off(\"end\",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once(\"end\",e),this.once(be,e),this.once(O,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[O])return t?this.emit(\"error\",t):this.emit(O),this;this[O]=!0,this[D]=!0,this[T].length=0,this[C]=0;let e=this;return typeof e.close==\"function\"&&!this[It]&&e.close(),t?this.emit(\"error\",t):this.emit(O),this}static get isStream(){return P.isStream}};P.Minipass=qt});var Ms=R(_=>{\"use strict\";var gr=_&&_.__createBinding||(Object.create?(function(n,t,e,s){s===void 0&&(s=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||(\"get\"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,s,i)}):(function(n,t,e,s){s===void 0&&(s=e),n[s]=t[e]})),wr=_&&_.__setModuleDefault||(Object.create?(function(n,t){Object.defineProperty(n,\"default\",{enumerable:!0,value:t})}):function(n,t){n.default=t}),br=_&&_.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var e in n)e!==\"default\"&&Object.prototype.hasOwnProperty.call(n,e)&&gr(t,n,e);return wr(t,n),t};Object.defineProperty(_,\"__esModule\",{value:!0});_.PathScurry=_.Path=_.PathScurryDarwin=_.PathScurryPosix=_.PathScurryWin32=_.PathScurryBase=_.PathPosix=_.PathWin32=_.PathBase=_.ChildrenCache=_.ResolveCache=void 0;var Qt=fs(),Yt=require(\"node:path\"),yr=require(\"node:url\"),pt=require(\"fs\"),Sr=br(require(\"node:fs\")),vr=pt.realpathSync.native,Ht=require(\"node:fs/promises\"),bs=Oe(),mt={lstatSync:pt.lstatSync,readdir:pt.readdir,readdirSync:pt.readdirSync,readlinkSync:pt.readlinkSync,realpathSync:vr,promises:{lstat:Ht.lstat,readdir:Ht.readdir,readlink:Ht.readlink,realpath:Ht.realpath}},_s=n=>!n||n===mt||n===Sr?mt:{...mt,...n,promises:{...mt.promises,...n.promises||{}}},Os=/^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i,Er=n=>n.replace(/\\//g,\"\\\\\").replace(Os,\"$1\\\\\"),_r=/[\\\\\\/]/,N=0,xs=1,Ts=2,G=4,Cs=6,Rs=8,Q=10,As=12,j=15,dt=~j,xe=16,ys=32,gt=64,W=128,Vt=256,Xt=512,Ss=gt|W|Xt,Or=1023,Te=n=>n.isFile()?Rs:n.isDirectory()?G:n.isSymbolicLink()?Q:n.isCharacterDevice()?Ts:n.isBlockDevice()?Cs:n.isSocket()?As:n.isFIFO()?xs:N,vs=new Qt.LRUCache({max:2**12}),wt=n=>{let t=vs.get(n);if(t)return t;let e=n.normalize(\"NFKD\");return vs.set(n,e),e},Es=new Qt.LRUCache({max:2**12}),Kt=n=>{let t=Es.get(n);if(t)return t;let e=wt(n.toLowerCase());return Es.set(n,e),e},bt=class extends Qt.LRUCache{constructor(){super({max:256})}};_.ResolveCache=bt;var Jt=class extends Qt.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}};_.ChildrenCache=Jt;var ks=Symbol(\"PathScurry setAsCwd\"),A=class{name;root;roots;parent;nocase;isCWD=!1;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#h;get uid(){return this.#h}#S;get gid(){return this.#S}#w;get rdev(){return this.#w}#c;get blksize(){return this.#c}#o;get ino(){return this.#o}#f;get size(){return this.#f}#u;get blocks(){return this.#u}#a;get atimeMs(){return this.#a}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#v;get birthtimeMs(){return this.#v}#y;get atime(){return this.#y}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#O;#x;#g;#b;#E;#T;#e;#F;#P;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=N,s,i,r,h,o){this.name=t,this.#O=r?Kt(t):wt(t),this.#e=e&Or,this.nocase=r,this.roots=i,this.root=s||this,this.#F=h,this.#g=o.fullpath,this.#E=o.relative,this.#T=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=_s(o.fs)}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#F}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#D(i):this.#D(i)}#D(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#F.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#F.set(this,e),this.#e&=~xe,e}child(t,e){if(t===\"\"||t===\".\")return this;if(t===\"..\")return this.parent||this;let s=this.children(),i=this.nocase?Kt(t):wt(t);for(let a of s)if(a.#O===i)return a;let r=this.parent?this.sep:\"\",h=this.#g?this.#g+r+t:void 0,o=this.newChild(t,N,{...e,parent:this,fullpath:h});return this.canReaddir()||(o.#e|=W),s.push(o),o}relative(){if(this.isCWD)return\"\";if(this.#E!==void 0)return this.#E;let t=this.name,e=this.parent;if(!e)return this.#E=this.name;let s=e.relative();return s+(!s||!e.parent?\"\":this.sep)+t}relativePosix(){if(this.sep===\"/\")return this.relative();if(this.isCWD)return\"\";if(this.#T!==void 0)return this.#T;let t=this.name,e=this.parent;if(!e)return this.#T=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?\"\":\"/\")+t}fullpath(){if(this.#g!==void 0)return this.#g;let t=this.name,e=this.parent;if(!e)return this.#g=this.name;let i=e.fullpath()+(e.parent?this.sep:\"\")+t;return this.#g=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep===\"/\")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\\\/g,\"/\");return/^[a-z]:\\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?\"\":\"/\")+this.name;return this.#b=s}isUnknown(){return(this.#e&j)===N}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?\"Unknown\":this.isDirectory()?\"Directory\":this.isFile()?\"File\":this.isSymbolicLink()?\"SymbolicLink\":this.isFIFO()?\"FIFO\":this.isCharacterDevice()?\"CharacterDevice\":this.isBlockDevice()?\"BlockDevice\":this.isSocket()?\"Socket\":\"Unknown\"}isFile(){return(this.#e&j)===Rs}isDirectory(){return(this.#e&j)===G}isCharacterDevice(){return(this.#e&j)===Ts}isBlockDevice(){return(this.#e&j)===Cs}isFIFO(){return(this.#e&j)===xs}isSocket(){return(this.#e&j)===As}isSymbolicLink(){return(this.#e&Q)===Q}lstatCached(){return this.#e&ys?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#C}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let t=this.#e&j;return!(t!==N&&t!==Q||this.#e&Vt||this.#e&W)}calledReaddir(){return!!(this.#e&xe)}isENOENT(){return!!(this.#e&W)}isNamed(t){return this.nocase?this.#O===Kt(t):this.#O===wt(t)}async readlink(){let t=this.#P;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#P=s}catch(e){this.#M(e.code);return}}readlinkSync(){let t=this.#P;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#P=s}catch(e){this.#M(e.code);return}}#W(t){this.#e|=xe;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#_()}}#_(){this.#e&W||(this.#e=(this.#e|W)&dt,this.#$())}#$(){let t=this.children();t.provisional=0;for(let e of t)e.#_()}#L(){this.#e|=Xt,this.#j()}#j(){if(this.#e>)return;let t=this.#e;(t&j)===G&&(t&=dt),this.#e=t|gt,this.#$()}#B(t=\"\"){t===\"ENOTDIR\"||t===\"EPERM\"?this.#j():t===\"ENOENT\"?this.#_():this.children().provisional=0}#k(t=\"\"){t===\"ENOTDIR\"?this.parent.#j():t===\"ENOENT\"&&this.#_()}#M(t=\"\"){let e=this.#e;e|=Vt,t===\"ENOENT\"&&(e|=W),(t===\"EINVAL\"||t===\"UNKNOWN\")&&(e&=dt),this.#e=e,t===\"ENOTDIR\"&&this.parent&&this.parent.#j()}#I(t,e){return this.#z(t,e)||this.#G(t,e)}#G(t,e){let s=Te(t),i=this.newChild(t.name,s,{parent:this}),r=i.#e&j;return r!==G&&r!==Q&&r!==N&&(i.#e|=gt),e.unshift(i),e.provisional++,i}#z(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?Kt(t.name):wt(t.name))===i.#O)return this.#l(t,i,s,e)}}#l(t,e,s,i){let r=e.name;return e.#e=e.#e&dt|Te(t),r!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&W)===0)try{return this.#U(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#k(t.code)}}lstatSync(){if((this.#e&W)===0)try{return this.#U(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#k(t.code)}}#U(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:h,blocks:o,ctime:a,ctimeMs:l,dev:f,gid:c,ino:d,mode:u,mtime:m,mtimeMs:p,nlink:b,rdev:w,size:v,uid:E}=t;this.#y=e,this.#a=s,this.#m=i,this.#v=r,this.#c=h,this.#u=o,this.#R=a,this.#d=l,this.#s=f,this.#S=c,this.#o=d,this.#n=u,this.#p=m,this.#i=p,this.#r=b,this.#w=w,this.#f=v,this.#h=E;let y=Te(t);this.#e=this.#e&dt|y|ys,y!==N&&y!==G&&y!==Q&&(this.#e|=gt)}#N=[];#A=!1;#q(t){this.#A=!1;let e=this.#N.slice();this.#N.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let r=s.slice(0,s.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#N.push(t),this.#A)return;this.#A=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(r,h)=>{if(r)this.#B(r.code),s.provisional=0;else{for(let o of h)this.#I(o,s);this.#W(s)}this.#q(s.slice(0,s.provisional))})}#H;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#H)await this.#H;else{let s=()=>{};this.#H=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#I(i,t);this.#W(t)}catch(i){this.#B(i.code),t.provisional=0}this.#H=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#I(s,t);this.#W(t)}catch(s){this.#B(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&Ss)return!1;let t=j&this.#e;return t===N||t===G||t===Q}shouldWalk(t,e){return(this.#e&G)===G&&!(this.#e&Ss)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#C)return this.#C;if(!((Xt|Vt|W)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(t)}catch{this.#L()}}realpathSync(){if(this.#C)return this.#C;if(!((Xt|Vt|W)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(t)}catch{this.#L()}}[ks](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#E=s.join(this.sep),i.#T=s.join(\"/\"),i=i.parent,s.push(\"..\");for(i=t;i&&i.parent&&!e.has(i);)i.#E=void 0,i.#T=void 0,i=i.parent}};_.PathBase=A;var yt=class n extends A{sep=\"\\\\\";splitSep=_r;constructor(t,e=N,s,i,r,h,o){super(t,e,s,i,r,h,o)}newChild(t,e=N,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return Yt.win32.parse(t).root}getRoot(t){if(t=Er(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new Et(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\\//g,\"\\\\\").replace(Os,\"$1\\\\\"),t===e}};_.PathWin32=yt;var St=class n extends A{splitSep=\"/\";sep=\"/\";constructor(t,e=N,s,i,r,h,o){super(t,e,s,i,r,h,o)}getRootString(t){return t.startsWith(\"/\")?\"/\":\"\"}getRoot(t){return this.root}newChild(t,e=N,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}};_.PathPosix=St;var vt=class{root;rootPath;roots;cwd;#t;#s;#n;nocase;#r;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:h=mt}={}){this.#r=_s(h),(t instanceof URL||t.startsWith(\"file://\"))&&(t=(0,yr.fileURLToPath)(t));let o=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new bt,this.#s=new bt,this.#n=new Jt(r);let a=o.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError(\"must provide nocase setting to PathScurryBase ctor\");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,f=a.length-1,c=e.sep,d=this.rootPath,u=!1;for(let m of a){let p=f--;l=l.child(m,{relative:new Array(p).fill(\"..\").join(c),relativePosix:new Array(p).fill(\"..\").join(\"/\"),fullpath:d+=(u?\"\":c)+m}),u=!0}this.cwd=l}depth(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e=\"\";for(let r=t.length-1;r>=0;r--){let h=t[r];if(!(!h||h===\".\")&&(e=e?`${h}/${e}`:h,this.isAbsolute(h)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e=\"\";for(let r=t.length-1;r>=0;r--){let h=t[r];if(!(!h||h===\".\")&&(e=e?`${h}/${e}`:h,this.isAbsolute(h)))break}let s=this.#s.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,i),i}relative(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(r=>r.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t==\"string\"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:h}=e,o=[];(!r||r(t))&&o.push(s?t:t.fullpath());let a=new Set,l=(c,d)=>{a.add(c),c.readdirCB((u,m)=>{if(u)return d(u);let p=m.length;if(!p)return d();let b=()=>{--p===0&&d()};for(let w of m)(!r||r(w))&&o.push(s?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(a,h)?l(v,b):b()):w.shouldWalk(a,h)?l(w,b):b()},!0)},f=t;return new Promise((c,d)=>{l(f,u=>{if(u)return d(u);c(o)})})}walkSync(t=this.cwd,e={}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:h}=e,o=[];(!r||r(t))&&o.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let f=l.readdirSync();for(let c of f){(!r||r(c))&&o.push(s?c:c.fullpath());let d=c;if(c.isSymbolicLink()){if(!(i&&(d=c.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,h)&&a.add(d)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:h}=e;(!r||r(t))&&(yield s?t:t.fullpath());let o=new Set([t]);for(let a of o){let l=a.readdirSync();for(let f of l){(!r||r(f))&&(yield s?f:f.fullpath());let c=f;if(f.isSymbolicLink()){if(!(i&&(c=f.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(o,h)&&o.add(c)}}}stream(t=this.cwd,e={}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:h}=e,o=new bs.Minipass({objectMode:!0});(!r||r(t))&&o.write(s?t:t.fullpath());let a=new Set,l=[t],f=0,c=()=>{let d=!1;for(;!d;){let u=l.shift();if(!u){f===0&&o.end();return}f++,a.add(u);let m=(b,w,v=!1)=>{if(b)return o.emit(\"error\",b);if(i&&!v){let E=[];for(let y of w)y.isSymbolicLink()&&E.push(y.realpath().then(S=>S?.isUnknown()?S.lstat():S));if(E.length){Promise.all(E).then(()=>m(null,w,!0));return}}for(let E of w)E&&(!r||r(E))&&(o.write(s?E:E.fullpath())||(d=!0));f--;for(let E of w){let y=E.realpathCached()||E;y.shouldWalk(a,h)&&l.push(y)}d&&!o.flowing?o.once(\"drain\",c):p||c()},p=!0;u.readdirCB(m,!0),p=!1}};return c(),o}streamSync(t=this.cwd,e={}){typeof t==\"string\"?t=this.cwd.resolve(t):t instanceof A||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:h}=e,o=new bs.Minipass({objectMode:!0}),a=new Set;(!r||r(t))&&o.write(s?t:t.fullpath());let l=[t],f=0,c=()=>{let d=!1;for(;!d;){let u=l.shift();if(!u){f===0&&o.end();return}f++,a.add(u);let m=u.readdirSync();for(let p of m)(!r||r(p))&&(o.write(s?p:p.fullpath())||(d=!0));f--;for(let p of m){let b=p;if(p.isSymbolicLink()){if(!(i&&(b=p.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,h)&&l.push(b)}}d&&!o.flowing&&o.once(\"drain\",c)};return c(),o}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t==\"string\"?this.cwd.resolve(t):t,this.cwd[ks](e)}};_.PathScurryBase=vt;var Et=class extends vt{sep=\"\\\\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,Yt.win32,\"\\\\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return Yt.win32.parse(t).root.toUpperCase()}newRoot(t){return new yt(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith(\"/\")||t.startsWith(\"\\\\\")||/^[a-z]:(\\/|\\\\)/i.test(t)}};_.PathScurryWin32=Et;var _t=class extends vt{sep=\"/\";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Yt.posix,\"/\",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return\"/\"}newRoot(t){return new St(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith(\"/\")}};_.PathScurryPosix=_t;var Zt=class extends _t{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}};_.PathScurryDarwin=Zt;_.Path=process.platform===\"win32\"?yt:St;_.PathScurry=process.platform===\"win32\"?Et:process.platform===\"darwin\"?Zt:_t});var Re=R(te=>{\"use strict\";Object.defineProperty(te,\"__esModule\",{value:!0});te.Pattern=void 0;var xr=H(),Tr=n=>n.length>=1,Cr=n=>n.length>=1,Rr=Symbol.for(\"nodejs.util.inspect.custom\"),Ce=class n{#t;#s;#n;length;#r;#h;#S;#w;#c;#o;#f=!0;constructor(t,e,s,i){if(!Tr(t))throw new TypeError(\"empty pattern list\");if(!Cr(e))throw new TypeError(\"empty glob list\");if(e.length!==t.length)throw new TypeError(\"mismatched pattern list and glob list lengths\");if(this.length=t.length,s<0||s>=this.length)throw new TypeError(\"index out of range\");if(this.#t=t,this.#s=e,this.#n=s,this.#r=i,this.#n===0){if(this.isUNC()){let[r,h,o,a,...l]=this.#t,[f,c,d,u,...m]=this.#s;l[0]===\"\"&&(l.shift(),m.shift());let p=[r,h,o,a,\"\"].join(\"/\"),b=[f,c,d,u,\"\"].join(\"/\");this.#t=[p,...l],this.#s=[b,...m],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[r,...h]=this.#t,[o,...a]=this.#s;h[0]===\"\"&&(h.shift(),a.shift());let l=r+\"/\",f=o+\"/\";this.#t=[l,...h],this.#s=[f,...a],this.length=this.#t.length}}}[Rr](){return\"Pattern <\"+this.#s.slice(this.#n).join(\"/\")+\">\"}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]==\"string\"}isGlobstar(){return this.#t[this.#n]===xr.GLOBSTAR}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#S=this.#S||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join(\"/\"):this.#s.join(\"/\"):this.#s.slice(this.#n).join(\"/\"))}hasMore(){return this.length>this.#n+1}rest(){return this.#h!==void 0?this.#h:this.hasMore()?(this.#h=new n(this.#t,this.#s,this.#n+1,this.#r),this.#h.#o=this.#o,this.#h.#c=this.#c,this.#h.#w=this.#w,this.#h):this.#h=null}isUNC(){let t=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#r===\"win32\"&&this.#n===0&&t[0]===\"\"&&t[1]===\"\"&&typeof t[2]==\"string\"&&!!t[2]&&typeof t[3]==\"string\"&&!!t[3]}isDrive(){let t=this.#t;return this.#w!==void 0?this.#w:this.#w=this.#r===\"win32\"&&this.#n===0&&this.length>1&&typeof t[0]==\"string\"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===\"\"&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t==\"string\"&&this.isAbsolute()&&this.#n===0?t:\"\"}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}};te.Pattern=Ce});var ke=R(ee=>{\"use strict\";Object.defineProperty(ee,\"__esModule\",{value:!0});ee.Ignore=void 0;var Ps=H(),Ar=Re(),kr=typeof process==\"object\"&&process&&typeof process.platform==\"string\"?process.platform:\"linux\",Ae=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:h=kr}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=h,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:h,nocomment:!0,nonegate:!0};for(let o of t)this.add(o)}add(t){let e=new Ps.Minimatch(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],r=e.globParts[s];if(!i||!r)throw new Error(\"invalid pattern object\");for(;i[0]===\".\"&&r[0]===\".\";)i.shift(),r.shift();let h=new Ar.Pattern(i,r,0,this.platform),o=new Ps.Minimatch(h.globString(),this.mmopts),a=r[r.length-1]===\"**\",l=h.isAbsolute();l?this.absolute.push(o):this.relative.push(o),a&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||\".\",r=`${i}/`;for(let h of this.relative)if(h.match(i)||h.match(r))return!0;for(let h of this.absolute)if(h.match(e)||h.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+\"/\",s=(t.relative()||\".\")+\"/\";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};ee.Ignore=Ae});var Fs=R(z=>{\"use strict\";Object.defineProperty(z,\"__esModule\",{value:!0});z.Processor=z.SubWalks=z.MatchRecord=z.HasWalkedCache=void 0;var Ds=H(),se=class n{store;constructor(t=new Map){this.store=t}copy(){return new n(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}};z.HasWalkedCache=se;var ie=class{store=new Map;add(t,e,s){let i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,r===void 0?i:i&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}};z.MatchRecord=ie;var re=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error(\"attempting to walk unknown path\");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};z.SubWalks=re;var Me=class n{hasWalkedCache;matches=new ie;subwalks=new re;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new se}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,r]of s){this.hasWalkedCache.storeWalked(i,r);let h=r.root(),o=r.isAbsolute()&&this.opts.absolute!==!1;if(h){i=i.resolve(h===\"/\"&&this.opts.root!==void 0?this.opts.root:h);let c=r.rest();if(c)r=c;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,f=!1;for(;typeof(a=r.pattern())==\"string\"&&(l=r.rest());)i=i.resolve(a),r=l,f=!0;if(a=r.pattern(),l=r.rest(),f){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if(typeof a==\"string\"){let c=a===\"..\"||a===\"\"||a===\".\";this.matches.add(i.resolve(a),o,c);continue}else if(a===Ds.GLOBSTAR){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let c=l?.pattern(),d=l?.rest();if(!l||(c===\"\"||c===\".\")&&!d)this.matches.add(i,o,c===\"\"||c===\".\");else if(c===\"..\"){let u=i.parent||i;d?this.hasWalkedCache.hasWalked(u,d)||this.subwalks.add(u,d):this.matches.add(u,o,!0)}}else a instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let r of e)for(let h of s){let o=h.isAbsolute(),a=h.pattern(),l=h.rest();a===Ds.GLOBSTAR?i.testGlobstar(r,h,l,o):a instanceof RegExp?i.testRegExp(r,a,l,o):i.testString(r,a,l,o)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith(\".\"))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let r=s.pattern();if(typeof r==\"string\"&&r!==\"..\"&&r!==\"\"&&r!==\".\")this.testString(t,r,s.rest(),i);else if(r===\"..\"){let h=t.parent||t;this.subwalks.add(h,s)}else r instanceof RegExp&&this.testRegExp(t,r,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};z.Processor=Me});var Ls=R(X=>{\"use strict\";Object.defineProperty(X,\"__esModule\",{value:!0});X.GlobStream=X.GlobWalker=X.GlobUtil=void 0;var Mr=Oe(),js=ke(),Ns=Fs(),Pr=(n,t)=>typeof n==\"string\"?new js.Ignore([n],t):Array.isArray(n)?new js.Ignore(n,t):n,Ot=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform===\"win32\"?\"\\\\\":\"/\",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#s=Pr(s.ignore??[],s),!this.includeChildMatches&&typeof this.#s.add!=\"function\")){let i=\"cannot ignore child matches, ignore lacks add() method.\";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener(\"abort\",()=>{this.#t.length=0}))}#r(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#h(t){return!!this.#s?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let h=await r.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat()}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let h=r.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync()}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${t.relativePosix()}/**`;this.#s.add(r)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#n:\"\";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+i)}else{let r=this.opts.posix?t.relativePosix():t.relative(),h=this.opts.dotRelative&&!r.startsWith(\"..\"+this.#n)?\".\"+this.#n:\"\";this.matchEmit(r?h+r+i:\".\"+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Ns.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let r=1,h=()=>{--r===0&&i()};for(let[o,a,l]of s.matches.entries())this.#r(o)||(r++,this.match(o,a,l).then(()=>h()));for(let o of s.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,s,h):o.readdirCB((l,f)=>this.walkCB3(o,f,s,h),!0)}h()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1,h=()=>{--r===0&&i()};for(let[o,a,l]of s.matches.entries())this.#r(o)||(r++,this.match(o,a,l).then(()=>h()));for(let[o,a]of s.subwalks.entries())r++,this.walkCB2(o,a,s.child(),h);h()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Ns.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let r=1,h=()=>{--r===0&&i()};for(let[o,a,l]of s.matches.entries())this.#r(o)||this.matchSync(o,a,l);for(let o of s.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let a=o.readdirSync();this.walkCB3Sync(o,a,s,h)}h()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1,h=()=>{--r===0&&i()};for(let[o,a,l]of s.matches.entries())this.#r(o)||this.matchSync(o,a,l);for(let[o,a]of s.subwalks.entries())r++,this.walkCB2Sync(o,a,s.child(),h);h()}};X.GlobUtil=Ot;var Pe=class extends Ot{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};X.GlobWalker=Pe;var De=class extends Ot{results;constructor(t,e,s){super(t,e,s),this.results=new Mr.Minipass({signal:this.signal,objectMode:!0}),this.results.on(\"drain\",()=>this.resume()),this.results.on(\"resume\",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};X.GlobStream=De});var je=R(oe=>{\"use strict\";Object.defineProperty(oe,\"__esModule\",{value:!0});oe.Glob=void 0;var Dr=H(),Fr=require(\"node:url\"),ne=Ms(),jr=Re(),he=Ls(),Nr=typeof process==\"object\"&&process&&typeof process.platform==\"string\"?process.platform:\"linux\",Fe=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError(\"glob options required\");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith(\"file://\"))&&(e.cwd=(0,Fr.fileURLToPath)(e.cwd)):this.cwd=\"\",this.cwd=e.cwd||\"\",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth==\"number\"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error(\"cannot set absolute and withFileTypes:true\");if(typeof t==\"string\"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\\\/g,\"/\"))),this.matchBase){if(e.noglobstar)throw new TypeError(\"base matching requires globstar\");t=t.map(a=>a.includes(\"/\")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||Nr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error(\"nocase option contradicts provided scurry option\")}else{let a=e.platform===\"win32\"?ne.PathScurryWin32:e.platform===\"darwin\"?ne.PathScurryDarwin:e.platform?ne.PathScurryPosix:ne.PathScurry;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform===\"darwin\"||this.platform===\"win32\",i={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(a=>new Dr.Minimatch(a,i)),[h,o]=r.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=h.map((a,l)=>{let f=o[l];if(!f)throw new Error(\"invalid pattern object\");return new jr.Pattern(a,f,0,this.platform)})}async walk(){return[...await new he.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new he.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new he.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new he.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};oe.Glob=Fe});var Ne=R(ae=>{\"use strict\";Object.defineProperty(ae,\"__esModule\",{value:!0});ae.hasMagic=void 0;var Lr=H(),Wr=(n,t={})=>{Array.isArray(n)||(n=[n]);for(let e of n)if(new Lr.Minimatch(e,t).hasMagic())return!0;return!1};ae.hasMagic=Wr});Object.defineProperty(exports,\"__esModule\",{value:!0});exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0;exports.globStreamSync=xt;exports.globStream=Le;exports.globSync=We;exports.globIterateSync=Tt;exports.globIterate=Be;var Ws=H(),tt=je(),Br=Ne(),Is=H();Object.defineProperty(exports,\"escape\",{enumerable:!0,get:function(){return Is.escape}});Object.defineProperty(exports,\"unescape\",{enumerable:!0,get:function(){return Is.unescape}});var Ir=je();Object.defineProperty(exports,\"Glob\",{enumerable:!0,get:function(){return Ir.Glob}});var Gr=Ne();Object.defineProperty(exports,\"hasMagic\",{enumerable:!0,get:function(){return Gr.hasMagic}});var zr=ke();Object.defineProperty(exports,\"Ignore\",{enumerable:!0,get:function(){return zr.Ignore}});function xt(n,t={}){return new tt.Glob(n,t).streamSync()}function Le(n,t={}){return new tt.Glob(n,t).stream()}function We(n,t={}){return new tt.Glob(n,t).walkSync()}async function Bs(n,t={}){return new tt.Glob(n,t).walk()}function Tt(n,t={}){return new tt.Glob(n,t).iterateSync()}function Be(n,t={}){return new tt.Glob(n,t).iterate()}exports.streamSync=xt;exports.stream=Object.assign(Le,{sync:xt});exports.iterateSync=Tt;exports.iterate=Object.assign(Be,{sync:Tt});exports.sync=Object.assign(We,{stream:xt,iterate:Tt});exports.glob=Object.assign(Bs,{glob:Bs,globSync:We,sync:exports.sync,globStream:Le,stream:exports.stream,globStreamSync:xt,streamSync:exports.streamSync,globIterate:Be,iterate:exports.iterate,globIterateSync:Tt,iterateSync:exports.iterateSync,Glob:tt.Glob,hasMagic:Br.hasMagic,escape:Ws.escape,unescape:Ws.unescape});exports.glob.glob=exports.glob;\n//# sourceMappingURL=index.min.js.map\n","(()=>{\"use strict\";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ie,XMLParser:()=>Lt,XMLValidator:()=>se});const n=\":A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\",i=new RegExp(\"^[\"+n+\"][\"+n+\"\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){return!(null==i.exec(t))},o=[\"hasOwnProperty\",\"toString\",\"valueOf\",\"__defineGetter__\",\"__defineSetter__\",\"__lookupGetter__\",\"__lookupSetter__\"],a=[\"__proto__\",\"constructor\",\"prototype\"],h={allowBooleanAttributes:!1,unpairedTags:[]};function l(t,e){e=Object.assign({},h,e);const n=[];let i=!1,s=!1;\"\\ufeff\"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if(\"<\"===t[r]&&\"?\"===t[r+1]){if(r+=2,r=p(t,r),r.err)return r}else{if(\"<\"!==t[r]){if(u(t[r]))continue;return b(\"InvalidChar\",\"char '\"+t[r]+\"' is not expected.\",w(t,r))}{let o=r;if(r++,\"!\"===t[r]){r=c(t,r);continue}{let a=!1;\"/\"===t[r]&&(a=!0,r++);let h=\"\";for(;r<t.length&&\">\"!==t[r]&&\" \"!==t[r]&&\"\\t\"!==t[r]&&\"\\n\"!==t[r]&&\"\\r\"!==t[r];r++)h+=t[r];if(h=h.trim(),\"/\"===h[h.length-1]&&(h=h.substring(0,h.length-1),r--),!E(h)){let e;return e=0===h.trim().length?\"Invalid space after '<'.\":\"Tag '\"+h+\"' is an invalid name.\",b(\"InvalidTag\",e,w(t,r))}const l=g(t,r);if(!1===l)return b(\"InvalidAttr\",\"Attributes for '\"+h+\"' have open quote.\",w(t,r));let d=l.value;if(r=l.index,\"/\"===d[d.length-1]){const n=r-d.length;d=d.substring(0,d.length-1);const s=x(d,e);if(!0!==s)return b(s.err.code,s.err.msg,w(t,n+s.err.line));i=!0}else if(a){if(!l.tagClosed)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' doesn't have proper closing.\",w(t,r));if(d.trim().length>0)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' can't have attributes or invalid starting.\",w(t,o));if(0===n.length)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' has not been opened.\",w(t,o));{const e=n.pop();if(h!==e.tagName){let n=w(t,e.tagStartPos);return b(\"InvalidTag\",\"Expected closing tag '\"+e.tagName+\"' (opened in line \"+n.line+\", col \"+n.col+\") instead of closing tag '\"+h+\"'.\",w(t,o))}0==n.length&&(s=!0)}}else{const a=x(d,e);if(!0!==a)return b(a.err.code,a.err.msg,w(t,r-d.length+a.err.line));if(!0===s)return b(\"InvalidXml\",\"Multiple possible root nodes found.\",w(t,r));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:o}),i=!0}for(r++;r<t.length;r++)if(\"<\"===t[r]){if(\"!\"===t[r+1]){r++,r=c(t,r);continue}if(\"?\"!==t[r+1])break;if(r=p(t,++r),r.err)return r}else if(\"&\"===t[r]){const e=N(t,r);if(-1==e)return b(\"InvalidChar\",\"char '&' is not expected.\",w(t,r));r=e}else if(!0===s&&!u(t[r]))return b(\"InvalidXml\",\"Extra text at the end\",w(t,r));\"<\"===t[r]&&r--}}}return i?1==n.length?b(\"InvalidTag\",\"Unclosed tag '\"+n[0].tagName+\"'.\",w(t,n[0].tagStartPos)):!(n.length>0)||b(\"InvalidXml\",\"Invalid '\"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\\r?\\n/g,\"\")+\"' found.\",{line:1,col:1}):b(\"InvalidXml\",\"Start tag expected.\",1)}function u(t){return\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t}function p(t,e){const n=e;for(;e<t.length;e++)if(\"?\"==t[e]||\" \"==t[e]){const i=t.substr(n,e-n);if(e>5&&\"xml\"===i)return b(\"InvalidXml\",\"XML declaration allowed only at the start of the document.\",w(t,e));if(\"?\"==t[e]&&\">\"==t[e+1]){e++;break}continue}return e}function c(t,e){if(t.length>e+5&&\"-\"===t[e+1]&&\"-\"===t[e+2]){for(e+=3;e<t.length;e++)if(\"-\"===t[e]&&\"-\"===t[e+1]&&\">\"===t[e+2]){e+=2;break}}else if(t.length>e+8&&\"D\"===t[e+1]&&\"O\"===t[e+2]&&\"C\"===t[e+3]&&\"T\"===t[e+4]&&\"Y\"===t[e+5]&&\"P\"===t[e+6]&&\"E\"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if(\"<\"===t[e])n++;else if(\">\"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&\"[\"===t[e+1]&&\"C\"===t[e+2]&&\"D\"===t[e+3]&&\"A\"===t[e+4]&&\"T\"===t[e+5]&&\"A\"===t[e+6]&&\"[\"===t[e+7])for(e+=8;e<t.length;e++)if(\"]\"===t[e]&&\"]\"===t[e+1]&&\">\"===t[e+2]){e+=2;break}return e}const d='\"',f=\"'\";function g(t,e){let n=\"\",i=\"\",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===f)\"\"===i?i=t[e]:i!==t[e]||(i=\"\");else if(\">\"===t[e]&&\"\"===i){s=!0;break}n+=t[e]}return\"\"===i&&{value:n,index:e,tagClosed:s}}const m=new RegExp(\"(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*(['\\\"])(([\\\\s\\\\S])*?)\\\\5)?\",\"g\");function x(t,e){const n=s(t,m),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return b(\"InvalidAttr\",\"Attribute '\"+n[t][2]+\"' has no space in starting.\",v(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return b(\"InvalidAttr\",\"Attribute '\"+n[t][2]+\"' is without value.\",v(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return b(\"InvalidAttr\",\"boolean attribute '\"+n[t][2]+\"' is not allowed.\",v(n[t]));const s=n[t][2];if(!y(s))return b(\"InvalidAttr\",\"Attribute '\"+s+\"' is an invalid name.\",v(n[t]));if(Object.prototype.hasOwnProperty.call(i,s))return b(\"InvalidAttr\",\"Attribute '\"+s+\"' is repeated.\",v(n[t]));i[s]=1}return!0}function N(t,e){if(\";\"===t[++e])return-1;if(\"#\"===t[e])return function(t,e){let n=/\\d/;for(\"x\"===t[e]&&(e++,n=/[\\da-fA-F]/);e<t.length;e++){if(\";\"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\\w/)&&n<20)){if(\";\"===t[e])break;return-1}return e}function b(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function y(t){return r(t)}function E(t){return r(t)}function w(t,e){const n=t.substring(0,e).split(/\\r?\\n/);return{line:n.length,col:n[n.length-1].length+1}}function v(t){return t.startIndex+t[1].length}const S=t=>o.includes(t)?\"__\"+t:t,_={preserveOrder:!1,attributeNamePrefix:\"@_\",attributesGroupName:!1,textNodeName:\"#text\",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function A(t,e){if(\"string\"!=typeof t)return;const n=t.toLowerCase();if(o.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);if(a.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`)}function T(t,e){return\"boolean\"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:\"all\"}:\"object\"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??\"all\"}:T(!0)}const C=function(t){const e=Object.assign({},_,t),n=[{value:e.attributeNamePrefix,name:\"attributeNamePrefix\"},{value:e.attributesGroupName,name:\"attributesGroupName\"},{value:e.textNodeName,name:\"textNodeName\"},{value:e.cdataPropName,name:\"cdataPropName\"},{value:e.commentPropName,name:\"commentPropName\"}];for(const{value:t,name:e}of n)t&&A(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=S),e.processEntities=T(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),e};let P;P=\"function\"!=typeof Symbol?\"@@xmlMetadata\":Symbol(\"XML Node Metadata\");class ${constructor(t){this.tagname=t,this.child=[],this[\":@\"]=Object.create(null)}add(t,e){\"__proto__\"===t&&(t=\"#__proto__\"),this.child.push({[t]:e})}addChild(t,e){\"__proto__\"===t.tagname&&(t.tagname=\"#__proto__\"),t[\":@\"]&&Object.keys(t[\":@\"]).length>0?this.child.push({[t.tagname]:t.child,\":@\":t[\":@\"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][P]={startIndex:e})}static getMetaDataSymbol(){return P}}const O=\":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�\",I=\":A-Za-z_À-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-\",V=I+\"\\\\-\\\\.\\\\d·̀-ͯ҇‿-⁀\",D=(t,e,n=\"\")=>{const i=`[${t.replace(\":\",\"\")}][${e.replace(\":\",\"\")}]*`;return{name:new RegExp(`^[${t}][${e}]*$`,n),ncName:new RegExp(`^${i}$`,n),qName:new RegExp(`^${i}(?::${i})?$`,n),nmToken:new RegExp(`^[${e}]+$`,n),nmTokens:new RegExp(`^[${e}]+(?:\\\\s+[${e}]+)*$`,n)}},M=D(O,O+\"\\\\-\\\\.\\\\d·̀-ͯ‿-⁀\"),j=D(I,V,\"u\"),L=(t,{xmlVersion:e=\"1.0\"}={})=>((t=\"1.0\")=>\"1.1\"===t?j:M)(e).qName.test(t);class k{constructor(t,e){this.suppressValidationErr=!t,this.options=t,this.xmlVersion=e||1}setXmlVersion(t=1){this.xmlVersion=t}readDocType(t,e){const n=Object.create(null);let i=0;if(\"O\"!==t[e+3]||\"C\"!==t[e+4]||\"T\"!==t[e+5]||\"Y\"!==t[e+6]||\"P\"!==t[e+7]||\"E\"!==t[e+8])throw new Error(\"Invalid Tag instead of DOCTYPE\");{e+=9;let s=1,r=!1,o=!1,a=\"\";for(;e<t.length;e++)if(\"<\"!==t[e]||o)if(\">\"===t[e]){if(o?\"-\"===t[e-1]&&\"-\"===t[e-2]&&(o=!1,s--):s--,0===s)break}else\"[\"===t[e]?r=!0:a+=t[e];else{if(r&&F(t,\"!ENTITY\",e)){let s,r;if(e+=7,[s,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf(\"&\")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[s]=r,i++}}else if(r&&F(t,\"!ELEMENT\",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(r&&F(t,\"!ATTLIST\",e))e+=8;else if(r&&F(t,\"!NOTATION\",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!F(t,\"!--\",e))throw new Error(\"Invalid DOCTYPE\");o=!0}s++,a=\"\"}if(0!==s)throw new Error(\"Unclosed DOCTYPE\")}return{entities:n,i:e}}readEntityExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e])&&'\"'!==t[e]&&\"'\"!==t[e];)e++;let i=t.substring(n,e);if(G(i,{xmlVersion:this.xmlVersion}),e=R(t,e),!this.suppressValidationErr){if(\"SYSTEM\"===t.substring(e,e+6).toUpperCase())throw new Error(\"External entities are not supported\");if(\"%\"===t[e])throw new Error(\"Parameter entities are not supported\")}let s=\"\";if([e,s]=this.readIdentifierVal(t,e,\"entity\"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&s.length>this.options.maxEntitySize)throw new Error(`Entity \"${i}\" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[i,s,--e]}readNotationExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);!this.suppressValidationErr&&G(i,{xmlVersion:this.xmlVersion}),e=R(t,e);const s=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&\"SYSTEM\"!==s&&\"PUBLIC\"!==s)throw new Error(`Expected SYSTEM or PUBLIC, found \"${s}\"`);e+=s.length,e=R(t,e);let r=null,o=null;if(\"PUBLIC\"===s)[e,r]=this.readIdentifierVal(t,e,\"publicIdentifier\"),'\"'!==t[e=R(t,e)]&&\"'\"!==t[e]||([e,o]=this.readIdentifierVal(t,e,\"systemIdentifier\"));else if(\"SYSTEM\"===s&&([e,o]=this.readIdentifierVal(t,e,\"systemIdentifier\"),!this.suppressValidationErr&&!o))throw new Error(\"Missing mandatory system identifier for SYSTEM notation\");return{notationName:i,publicIdentifier:r,systemIdentifier:o,index:--e}}readIdentifierVal(t,e,n){let i=\"\";const s=t[e];if('\"'!==s&&\"'\"!==s)throw new Error(`Expected quoted string, found \"${s}\"`);const r=++e;for(;e<t.length&&t[e]!==s;)e++;if(i=t.substring(r,e),t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){const n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);if(!this.suppressValidationErr&&!L(i,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: \"${i}\"`);let s=\"\";if(\"E\"===t[e=R(t,e)]&&F(t,\"MPTY\",e))e+=4;else if(\"A\"===t[e]&&F(t,\"NY\",e))e+=2;else if(\"(\"===t[e]){const n=++e;for(;e<t.length&&\")\"!==t[e];)e++;if(s=t.substring(n,e),\")\"!==t[e])throw new Error(\"Unterminated content model\")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found \"${t[e]}\"`);return{elementName:i,contentModel:s.trim(),index:e}}readAttlistExp(t,e){let n=e=R(t,e);for(;e<t.length&&!/\\s/.test(t[e]);)e++;let i=t.substring(n,e);for(G(i,{xmlVersion:this.xmlVersion}),n=e=R(t,e);e<t.length&&!/\\s/.test(t[e]);)e++;let s=t.substring(n,e);if(!G(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: \"${s}\"`);e=R(t,e);let r=\"\";if(\"NOTATION\"===t.substring(e,e+8).toUpperCase()){if(r=\"NOTATION\",\"(\"!==t[e=R(t,e+=8)])throw new Error(`Expected '(', found \"${t[e]}\"`);e++;let n=[];for(;e<t.length&&\")\"!==t[e];){const i=e;for(;e<t.length&&\"|\"!==t[e]&&\")\"!==t[e];)e++;let s=t.substring(i,e);if(s=s.trim(),!G(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: \"${s}\"`);n.push(s),\"|\"===t[e]&&(e++,e=R(t,e))}if(\")\"!==t[e])throw new Error(\"Unterminated list of notations\");e++,r+=\" (\"+n.join(\"|\")+\")\"}else{const n=e;for(;e<t.length&&!/\\s/.test(t[e]);)e++;r+=t.substring(n,e);const i=[\"CDATA\",\"ID\",\"IDREF\",\"IDREFS\",\"ENTITY\",\"ENTITIES\",\"NMTOKEN\",\"NMTOKENS\"];if(!this.suppressValidationErr&&!i.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: \"${r}\"`)}e=R(t,e);let o=\"\";return\"#REQUIRED\"===t.substring(e,e+8).toUpperCase()?(o=\"#REQUIRED\",e+=8):\"#IMPLIED\"===t.substring(e,e+7).toUpperCase()?(o=\"#IMPLIED\",e+=7):[e,o]=this.readIdentifierVal(t,e,\"ATTLIST\"),{elementName:i,attributeName:s,attributeType:r,defaultValue:o,index:e}}}const R=(t,e)=>{for(;e<t.length&&/\\s/.test(t[e]);)e++;return e};function F(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function G(t,e){if(L(t,{xmlVersion:e}))return t;throw new Error(`Invalid entity name ${t}`)}const U=/^[-+]?0x[a-fA-F0-9]+$/,B=/^0b[01]+$/,W=/^0o[0-7]+$/,z=/^([\\-\\+])?(0*)([0-9]*(\\.[0-9]*)?)$/,X={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:\".\",eNotation:!0,infinity:\"original\"};const Y=/^([-+])?(0*)(\\d*(\\.\\d*)?[eE][-\\+]?\\d+)$/;function q(t,e){const n=t.trim();if(2!==e&&8!==e||(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error(\"parseInt, Number.parseInt, window.parseInt are not supported\")}class Z{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const n=e[e.length-1];return void 0!==n.values&&t in n.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class J{constructor(t={}){this.separator=t.separator||\".\",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Z(this)}push(t,e=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const s=this.siblingStacks[i],r=n?`${n}:${t}`:t,o=s.get(r)||0;let a=0;for(const t of s.values())a+=t;s.set(r,o+1);const h={tag:t,position:a,counter:o};null!=n&&(h.namespace=n),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const n=t||this.separator;if(n===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,n=t.length-1;for(;n>=0&&e>=0;){const i=t[n];if(\"deep-wildcard\"===i.type){if(n--,n<0)return!0;const i=t[n];let s=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,n--,s=!0;break}if(!s)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,n--}}return n<0}_matchSegment(t,e,n){if(\"*\"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&\"*\"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!n)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!n)return!1;const i=e.counter??0;if(\"first\"===t.position&&0!==i)return!1;if(\"odd\"===t.position&&i%2!=1)return!1;if(\"even\"===t.position&&i%2!=0)return!1;if(\"nth\"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class K{constructor(t,e={},n){this.pattern=t,this.separator=e.separator||\".\",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(t=>\"deep-wildcard\"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let n=0,i=\"\";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=\"\"),e.push({type:\"deep-wildcard\"}),n+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i=\"\",n++):(i+=t[n],n++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:\"tag\"};let n=null,i=t;const s=t.match(/^([^\\[]+)(\\[[^\\]]*\\])(.*)$/);if(s&&(i=s[1]+s[3],s[2])){const t=s[2].slice(1,-1);t&&(n=t)}let r,o,a=i;if(i.includes(\"::\")){const e=i.indexOf(\"::\");if(r=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(a.includes(\":\")){const t=a.lastIndexOf(\":\"),e=a.substring(0,t).trim(),n=a.substring(t+1).trim();[\"first\",\"last\",\"odd\",\"even\"].includes(n)||/^nth\\(\\d+\\)$/.test(n)?(o=e,h=n):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,r&&(e.namespace=r),n)if(n.includes(\"=\")){const t=n.indexOf(\"=\");e.attrName=n.substring(0,t).trim(),e.attrValue=n.substring(t+1).trim()}else e.attrName=n.trim();if(h){const t=h.match(/^nth\\((\\d+)\\)$/);t?(e.position=\"nth\",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class Q{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError(\"ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.\");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,n=t.segments[t.segments.length-1],i=n?.tag;if(i&&\"*\"!==i){const n=`${e}:${i}`;this._byDepthAndTag.has(n)||this._byDepthAndTag.set(n,[]),this._byDepthAndTag.get(n).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),n=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(n);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const s=this._wildcardByDepth.get(e);if(s)for(let e=0;e<s.length;e++)if(t.matches(s[e]))return s[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const H={cent:\"¢\",pound:\"£\",curren:\"¤\",yen:\"¥\",euro:\"€\",dollar:\"$\",euro:\"€\",fnof:\"ƒ\",inr:\"₹\",af:\"؋\",birr:\"ብር\",peso:\"₱\",rub:\"₽\",won:\"₩\",yuan:\"¥\",cedil:\"¸\"},tt={amp:\"&\",apos:\"'\",gt:\">\",lt:\"<\",quot:'\"'},et={nbsp:\" \",copy:\"©\",reg:\"®\",trade:\"™\",mdash:\"—\",ndash:\"–\",hellip:\"…\",laquo:\"«\",raquo:\"»\",lsquo:\"‘\",rsquo:\"’\",ldquo:\"“\",rdquo:\"”\",bull:\"•\",para:\"¶\",sect:\"§\",deg:\"°\",frac12:\"½\",frac14:\"¼\",frac34:\"¾\"},nt=new Set(\"!?\\\\\\\\/[]$%{}^&*()<>|+\");function it(t){if(\"#\"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: \"${t}\"`);for(const e of t)if(nt.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: \"${t}\"`);return t}function st(...t){const e=Object.create(null);for(const n of t)if(n)for(const t of Object.keys(n)){const i=n[t];if(\"string\"==typeof i)e[t]=i;else if(i&&\"object\"==typeof i&&void 0!==i.val){const n=i.val;\"string\"==typeof n&&(e[t]=n)}}return e}const rt=\"external\",ot=\"base\",at=\"all\",ht=Object.freeze({allow:0,leave:1,remove:2,throw:3}),lt=new Set([9,10,13]);class ut{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=\"function\"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??rt)&&e!==rt?e===at?new Set([at]):e===ot?new Set([ot]):Array.isArray(e)?new Set(e):new Set([rt]):new Set([rt]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=st(tt,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const n=function(t){if(!t)return{xmlVersion:1,onLevel:ht.allow,nullLevel:ht.remove};const e=1.1===t.xmlVersion?1.1:1,n=ht[t.onNCR]??ht.allow,i=ht[t.nullNCR]??ht.remove;return{xmlVersion:e,onLevel:n,nullLevel:Math.max(i,ht.remove)}}(t.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))it(e);this._externalMap=st(t)}addExternalEntity(t,e){it(t),\"string\"==typeof e&&-1===e.indexOf(\"&\")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=st(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if(\"string\"!=typeof t||0===t.length)return t;const e=t,n=[],i=t.length;let s=0,r=0;const o=this._maxTotalExpansions>0,a=this._maxExpandedLength>0,h=o||a;for(;r<i;){if(38!==t.charCodeAt(r)){r++;continue}let e=r+1;for(;e<i&&59!==t.charCodeAt(e)&&e-r<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){r++;continue}const l=t.slice(r+1,e);if(0===l.length){r++;continue}let u,p;if(this._removeSet.has(l))u=\"\",void 0===p&&(p=rt);else{if(this._leaveSet.has(l)){r++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){r++;continue}u=t,p=ot}else{const t=this._resolveName(l);u=t?.value,p=t?.tier}}if(void 0!==u){if(r>s&&n.push(t.slice(s,r)),n.push(u),s=e+1,r=s,h&&this._tierCounts(p)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(a){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else r++}s<i&&n.push(t.slice(s));const l=0===n.length?t:n.join(\"\");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(at)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:rt}:t in this._externalMap?{value:this._externalMap[t],tier:rt}:t in this._baseMap?{value:this._baseMap[t],tier:ot}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!lt.has(t)?ht.remove:-1}_applyNCRAction(t,e,n){switch(t){case ht.allow:return String.fromCodePoint(n);case ht.remove:return\"\";case ht.leave:return;case ht.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${n.toString(16).toUpperCase().padStart(4,\"0\")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){const e=t.charCodeAt(1);let n;if(n=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;const i=this._classifyNCR(n);if(!this._numericAllowed&&i<ht.remove)return;const s=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(s,t,n)}}function pt(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const t in n)t.startsWith(e.attributeNamePrefix)?i[t.substring(e.attributeNamePrefix.length)]=n[t]:i[t]=n[t];return i}function ct(t){if(!t||\"string\"!=typeof t)return;const e=t.indexOf(\":\");if(-1!==e&&e>0){const n=t.substring(0,e);if(\"xmlns\"!==n)return n}}class dt{constructor(t,e){var n;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Nt,this.parseTextData=ft,this.resolveNameSpace=gt,this.buildAttributesMap=xt,this.isItStopNode=wt,this.replaceEntitiesValue=yt,this.readStopNodeData=At,this.saveTextToParentTag=Et,this.addChild=bt,this.ignoreAttributesFn=\"function\"==typeof(n=this.options.ignoreAttributes)?n:Array.isArray(n)?t=>{for(const e of n){if(\"string\"==typeof e&&t===e)return!0;if(e instanceof RegExp&&e.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let i={...tt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(\"object\"==typeof this.options.htmlEntities?i=this.options.htmlEntities:!0===this.options.htmlEntities&&(i={...et,...H}),this.entityDecoder=new ut({namedEntities:{...i,...e},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new J,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Q;const s=this.options.stopNodes;if(s&&s.length>0){for(let t=0;t<s.length;t++){const e=s[t];\"string\"==typeof e?this.stopNodeExpressionsSet.add(new K(e)):e instanceof K&&this.stopNodeExpressionsSet.add(e)}this.stopNodeExpressionsSet.seal()}}}function ft(t,e,n,i,s,r,o){const a=this.options;if(void 0!==t&&(a.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=a.jPath?n.toString():n,h=a.tagValueProcessor(e,t,i,s,r);return null==h?t:typeof h!=typeof t||h!==t?h:a.trimValues||t.trim()===t?Tt(t,a.parseTagValue,a.numberParseOptions):t}}function gt(t){if(this.options.removeNSPrefix){const e=t.split(\":\"),n=\"/\"===t.charAt(0)?\"/\":\"\";if(\"xmlns\"===e[0])return\"\";2===e.length&&(t=n+e[1])}return t}const mt=new RegExp(\"([^\\\\s=]+)\\\\s*(=\\\\s*(['\\\"])([\\\\s\\\\S]*?)\\\\3)?\",\"gm\");function xt(t,e,n,i=!1){const r=this.options;if(!0===i||!0!==r.ignoreAttributes&&\"string\"==typeof t){const i=s(t,mt),o=i.length,a={},h=new Array(o);let l=!1;const u={};for(let t=0;t<o;t++){const e=this.resolveNameSpace(i[t][1]),s=i[t][4];if(e.length&&void 0!==s){let i=s;r.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i,n,this.readonlyMatcher),h[t]=i,u[e]=i,l=!0}}l&&\"object\"==typeof e&&e.updateCurrent&&e.updateCurrent(u);const p=r.jPath?e.toString():this.readonlyMatcher;let c=!1;for(let t=0;t<o;t++){const e=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(e,p))continue;let n=r.attributeNamePrefix+e;if(e.length)if(r.transformAttributeName&&(n=r.transformAttributeName(n)),n=Pt(n,r),void 0!==i[t][4]){const i=h[t],s=r.attributeValueProcessor(e,i,p);a[n]=null==s?i:typeof s!=typeof i||s!==i?s:Tt(i,r.parseAttributeValue,r.numberParseOptions),c=!0}else r.allowBooleanAttributes&&(a[n]=!0,c=!0)}if(!c)return;if(r.attributesGroupName&&!r.preserveOrder){const t={};return t[r.attributesGroupName]=a,t}return a}}const Nt=function(t){t=t.replace(/\\r\\n?/g,\"\\n\");const e=new $(\"!xml\");let n=e,i=\"\";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const s=this.options,r=new k(s.processEntities),o=t.length;for(let a=0;a<o;a++)if(\"<\"===t[a]){const h=t.charCodeAt(a+1);if(47===h){const e=vt(t,\">\",a,\"Closing Tag is not closed.\");let r=t.substring(a+2,e).trim();if(s.removeNSPrefix){const t=r.indexOf(\":\");-1!==t&&(r=r.substr(t+1))}r=Ct(s.transformTagName,r,\"\",s).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(r&&s.unpairedTagsSet.has(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);o&&s.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i=\"\",a=e}else if(63===h){let e=_t(t,a,!1,\"?>\");if(!e)throw new Error(\"Pi Tag is not closed.\");i=this.saveTextToParentTag(i,n,this.readonlyMatcher);const o=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName,!0);if(o){const t=o[this.options.attributeNamePrefix+\"version\"];this.entityDecoder.setXmlVersion(Number(t)||1),r.setXmlVersion(Number(t)||1)}if(s.ignoreDeclaration&&\"?xml\"===e.tagName||s.ignorePiTags);else{const t=new $(e.tagName);t.add(s.textNodeName,\"\"),e.tagName!==e.tagExp&&e.attrExpPresent&&!0!==s.ignoreAttributes&&(t[\":@\"]=o),this.addChild(n,t,this.readonlyMatcher,a)}a=e.closeIndex+1}else if(33===h&&45===t.charCodeAt(a+2)&&45===t.charCodeAt(a+3)){const e=vt(t,\"--\\x3e\",a+4,\"Comment is not closed.\");if(s.commentPropName){const r=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(s.commentPropName,[{[s.textNodeName]:r}])}a=e}else if(33===h&&68===t.charCodeAt(a+2)){const e=r.readDocType(t,a);this.entityDecoder.addInputEntities(e.entities),a=e.i}else if(33===h&&91===t.charCodeAt(a+2)){const e=vt(t,\"]]>\",a,\"CDATA is not closed.\")-2,r=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let o=this.parseTextData(r,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=\"\"),s.cdataPropName?n.add(s.cdataPropName,[{[s.textNodeName]:r}]):n.add(s.textNodeName,o),a=e+2}else{let r=_t(t,a,s.removeNSPrefix);if(!r){const e=t.substring(Math.max(0,a-50),Math.min(o,a+50));throw new Error(`readTagExp returned undefined at position ${a}. Context: \"${e}\"`)}let h=r.tagName;const l=r.rawTagName;let u=r.tagExp,p=r.attrExpPresent,c=r.closeIndex;if(({tagName:h,tagExp:u}=Ct(s.transformTagName,h,u,s)),s.strictReservedNames&&(h===s.commentPropName||h===s.cdataPropName||h===s.textNodeName||h===s.attributesGroupName))throw new Error(`Invalid tag name: ${h}`);n&&i&&\"!xml\"!==n.tagname&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));const d=n;d&&s.unpairedTagsSet.has(d.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;u.length>0&&u.lastIndexOf(\"/\")===u.length-1&&(f=!0,\"/\"===h[h.length-1]?(h=h.substr(0,h.length-1),u=h):u=u.substr(0,u.length-1),p=h!==u);let g,m=null,x={};g=ct(l),h!==e.tagname&&this.matcher.push(h,{},g),h!==u&&p&&(m=this.buildAttributesMap(u,this.matcher,h),m&&(x=pt(m,s))),h!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const N=a;if(this.isCurrentNodeStopNode){let e=\"\";if(f)a=r.closeIndex;else if(s.unpairedTagsSet.has(h))a=r.closeIndex;else{const n=this.readStopNodeData(t,l,c+1);if(!n)throw new Error(`Unexpected end of ${l}`);a=n.i,e=n.tagContent}const i=new $(h);m&&(i[\":@\"]=m),i.add(s.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,i,this.readonlyMatcher,N)}else{if(f){({tagName:h,tagExp:u}=Ct(s.transformTagName,h,u,s));const t=new $(h);m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(s.unpairedTagsSet.has(h)){const t=new $(h);m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=r.closeIndex;continue}{const t=new $(h);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");this.tagsNodeStack.push(n),m&&(t[\":@\"]=m),this.addChild(n,t,this.readonlyMatcher,N),n=t}}i=\"\",a=c}}}else i+=t[a];return e.child};function bt(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.jPath?n.toString():n,r=this.options.updateTag(e.tagname,s,e[\":@\"]);!1===r||(\"string\"==typeof r?(e.tagname=r,t.addChild(e,i)):t.addChild(e,i))}function yt(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const s=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,s)))return t}if(i.tagFilter){const s=this.options.jPath?n.toString():n;if(!i.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function Et(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[\":@\"]&&0!==Object.keys(e[\":@\"]).length,i))&&\"\"!==t&&e.add(this.options.textNodeName,t),t=\"\"),t}function wt(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function vt(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function St(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s}function _t(t,e,n,i=\">\"){const s=function(t,e,n=\">\"){let i=0;const s=t.length,r=n.charCodeAt(0),o=n.length>1?n.charCodeAt(1):-1;let a=\"\",h=e;for(let n=e;n<s;n++){const e=t.charCodeAt(n);if(i)e===i&&(i=0);else if(34===e||39===e)i=e;else if(e===r){if(-1===o)return a+=t.substring(h,n),{data:a,index:n};if(t.charCodeAt(n+1)===o)return a+=t.substring(h,n),{data:a,index:n}}else 9!==e||i||(a+=t.substring(h,n)+\" \",h=n+1)}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\\s/);let h=r,l=!0;-1!==a&&(h=r.substring(0,a),r=r.substring(a+1).trimStart());const u=h;if(n){const t=h.indexOf(\":\");-1!==t&&(h=h.substr(t+1),l=h!==s.data.substr(t+1))}return{tagName:h,tagExp:r,closeIndex:o,attrExpPresent:l,rawTagName:u}}function At(t,e,n){const i=n;let s=1;const r=t.length;for(;n<r;n++)if(\"<\"===t[n]){const r=t.charCodeAt(n+1);if(47===r){const r=St(t,\">\",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if(63===r)n=vt(t,\"?>\",n+1,\"StopNode is not closed.\");else if(33===r&&45===t.charCodeAt(n+2)&&45===t.charCodeAt(n+3))n=vt(t,\"--\\x3e\",n+3,\"StopNode is not closed.\");else if(33===r&&91===t.charCodeAt(n+2))n=vt(t,\"]]>\",n,\"StopNode is not closed.\")-2;else{const i=_t(t,n,!1);i&&((i&&i.tagName)===e&&\"/\"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}}function Tt(t,e,n){if(e&&\"string\"==typeof t){const e=t.trim();return\"true\"===e||\"false\"!==e&&function(t,e={}){if(e=Object.assign({},X,e),!t||\"string\"!=typeof t)return t;let n=t.trim();if(0===n.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(\"0\"===n)return 0;if(e.hex&&U.test(n))return q(n,16);if(e.binary&&B.test(n))return q(n,2);if(e.octal&&W.test(n))return q(n,8);if(isFinite(n)){if(n.includes(\"e\")||n.includes(\"E\"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(Y);if(i){let s=i[1]||\"\";const r=-1===i[3].indexOf(\"e\")?\"E\":\"e\",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:(1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r)&&o.length>0?n.leadingZeros&&!a?(e=(i[1]||\"\")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=z.exec(n);if(s){const r=s[1]||\"\",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(\".\")?(\".\"===(i=i.replace(/0+$/,\"\"))?i=\"0\":\".\"===i[0]?i=\"0\"+i:\".\"===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const h=r?\".\"===t[o.length+1]:\".\"===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!h))return t;{const i=Number(n),s=String(i);if(0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf(\".\"))return\"0\"===s||s===a||s===`${r}${a}`?i:t;let h=o?a:n;return o?h===s||r+h===s?i:t:h===s||h===r+s?i:t}}return t}}var i;return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case\"null\":return null;case\"infinity\":return e;case\"string\":return i?\"Infinity\":\"-Infinity\";default:return t}}(t,Number(n),e)}(t,n)}return void 0!==t?t:\"\"}function Ct(t,e,n,i){if(t){const i=t(e);n===e&&(n=i),e=i}return{tagName:e=Pt(e,i),tagExp:n}}function Pt(t,e){if(a.includes(t))throw new Error(`[SECURITY] Invalid name: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);return o.includes(t)?e.onDangerousProperty(t):t}const $t=$.getMetaDataSymbol();function Ot(t,e){if(!t||\"object\"!=typeof t)return{};if(!e)return t;const n={};for(const i in t)i.startsWith(e)?n[i.substring(e.length)]=t[i]:n[i]=t[i];return n}function It(t,e,n,i){return Vt(t,e,n,i)}function Vt(t,e,n,i){let s;const r={};for(let o=0;o<t.length;o++){const a=t[o],h=Dt(a);if(void 0!==h&&h!==e.textNodeName){const t=Ot(a[\":@\"]||{},e.attributeNamePrefix);n.push(h,t)}if(h===e.textNodeName)void 0===s?s=a[h]:s+=\"\"+a[h];else{if(void 0===h)continue;if(a[h]){let t=Vt(a[h],e,n,i);const s=jt(t,e);if(0===Object.keys(t).length&&e.alwaysCreateTextNode&&(t[e.textNodeName]=\"\"),a[\":@\"]?Mt(t,a[\":@\"],i,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]=\"\":t=\"\"):t=t[e.textNodeName],void 0!==a[$t]&&\"object\"==typeof t&&null!==t&&(t[$t]=a[$t]),void 0!==r[h]&&Object.prototype.hasOwnProperty.call(r,h))Array.isArray(r[h])||(r[h]=[r[h]]),r[h].push(t);else{const n=e.jPath?i.toString():i;e.isArray(h,n,s)?r[h]=[t]:r[h]=t}void 0!==h&&h!==e.textNodeName&&n.pop()}}}return\"string\"==typeof s?s.length>0&&(r[e.textNodeName]=s):void 0!==s&&(r[e.textNodeName]=s),r}function Dt(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(\":@\"!==n)return n}}function Mt(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o],a=r.startsWith(i.attributeNamePrefix)?r.substring(i.attributeNamePrefix.length):r,h=i.jPath?n.toString()+\".\"+a:n;i.isArray(r,h,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function jt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&\"boolean\"!=typeof t[n]&&0!==t[n])}class Lt{constructor(t){this.externalEntities={},this.options=C(t)}parse(t,e){if(\"string\"!=typeof t&&t.toString)t=t.toString();else if(\"string\"!=typeof t)throw new Error(\"XML data is accepted in String or Bytes[] form.\");if(e){!0===e&&(e={});const n=l(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new dt(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:It(i,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,e){if(-1!==e.indexOf(\"&\"))throw new Error(\"Entity value can't have '&'\");if(-1!==t.indexOf(\"&\")||-1!==t.indexOf(\";\"))throw new Error(\"An entity must be set without '&' and ';'. Eg. use '#xD' for '
'\");if(\"&\"===e)throw new Error(\"An entity with value '&' is not permitted\");this.externalEntities[t]=e}static getMetaDataSymbol(){return $.getMetaDataSymbol()}}function kt(t){return String(t).replace(/--/g,\"- -\").replace(/--/g,\"- -\").replace(/-$/,\"- \")}function Rt(t){return String(t).replace(/\\]\\]>/g,\"]]]]><![CDATA[>\")}function Ft(t){return String(t).replace(/\"/g,\""\").replace(/'/g,\"'\")}function Gt(t,e,n,i,s){return n.sanitizeName?L(t,{xmlVersion:s})?t:n.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function Ut(t,e){let n=\"\";e.format&&(n=\"\\n\");const i=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let t=0;t<e.stopNodes.length;t++){const n=e.stopNodes[t];\"string\"==typeof n?i.push(new K(n)):n instanceof K&&i.push(n)}const s=function(t,e){if(!Array.isArray(t)||0===t.length)return\"1.0\";const n=t[0];if(\"?xml\"===Yt(n)){const t=n[\":@\"];if(t){const n=e.attributeNamePrefix+\"version\";if(t[n])return t[n]}}return\"1.0\"}(t,e);return Bt(t,e,n,new J,i,s)}function Bt(t,e,n,i,s,r){let o=\"\",a=!1;if(e.maxNestedTags&&i.getDepth()>e.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");if(!Array.isArray(t)){if(null!=t){let n=t.toString();return n=Jt(n,e),n}return\"\"}for(let h=0;h<t.length;h++){const l=t[h],u=Yt(l);if(void 0===u)continue;const p=u===e.textNodeName||u===e.cdataPropName||u===e.commentPropName||\"?\"===u[0]?u:Gt(u,!1,e,i,r),c=Wt(l[\":@\"],e);i.push(p,c);const d=Zt(i,s);if(p===e.textNodeName){let t=l[u];d||(t=e.tagValueProcessor(p,t),t=Jt(t,e)),a&&(o+=n),o+=t,a=!1,i.pop();continue}if(p===e.cdataPropName){a&&(o+=n),o+=`<![CDATA[${Rt(l[u][0][e.textNodeName])}]]>`,a=!1,i.pop();continue}if(p===e.commentPropName){o+=n+`\\x3c!--${kt(l[u][0][e.textNodeName])}--\\x3e`,a=!0,i.pop();continue}if(\"?\"===p[0]){o+=(\"?xml\"===p?\"\":n)+`<${p}${qt(l[\":@\"],e,d,i,r)}?>`,a=!0,i.pop();continue}let f=n;\"\"!==f&&(f+=e.indentBy);const g=n+`<${p}${qt(l[\":@\"],e,d,i,r)}`;let m;m=d?zt(l[u],e):Bt(l[u],e,f,i,s,r),-1!==e.unpairedTags.indexOf(p)?e.suppressUnpairedNode?o+=g+\">\":o+=g+\"/>\":m&&0!==m.length||!e.suppressEmptyNode?m&&m.endsWith(\">\")?o+=g+`>${m}${n}</${p}>`:(o+=g+\">\",m&&\"\"!==n&&(m.includes(\"/>\")||m.includes(\"</\"))?o+=n+e.indentBy+m+n:o+=m,o+=`</${p}>`):o+=g+\"/>\",a=!0,i.pop()}return o}function Wt(t,e){if(!t||e.ignoreAttributes)return null;const n={};let i=!1;for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s.startsWith(e.attributeNamePrefix)?s.substr(e.attributeNamePrefix.length):s]=Ft(t[s]),i=!0);return i?n:null}function zt(t,e){if(!Array.isArray(t))return null!=t?t.toString():\"\";let n=\"\";for(let i=0;i<t.length;i++){const s=t[i],r=Yt(s);if(r===e.textNodeName)n+=s[r];else if(r===e.cdataPropName)n+=s[r][0][e.textNodeName];else if(r===e.commentPropName)n+=s[r][0][e.textNodeName];else{if(r&&\"?\"===r[0])continue;if(r){const t=Xt(s[\":@\"],e),i=zt(s[r],e);i&&0!==i.length?n+=`<${r}${t}>${i}</${r}>`:n+=`<${r}${t}/>`}}}return n}function Xt(t,e){let n=\"\";if(t&&!e.ignoreAttributes)for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let s=t[i];!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}=\"${Ft(s)}\"`}return n}function Yt(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(Object.prototype.hasOwnProperty.call(t,i)&&\":@\"!==i)return i}}function qt(t,e,n,i,s){let r=\"\";if(t&&!e.ignoreAttributes)for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;const a=o.substr(e.attributeNamePrefix.length),h=n?a:Gt(a,!0,e,i,s);let l;n?l=t[o]:(l=e.attributeValueProcessor(o,t[o]),l=Jt(l,e)),!0===l&&e.suppressBooleanAttributes?r+=` ${h}`:r+=` ${h}=\"${Ft(l)}\"`}return r}function Zt(t,e){if(!e||0===e.length)return!1;for(let n=0;n<e.length;n++)if(t.matches(e[n]))return!0;return!1}function Jt(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const Kt={attributeNamePrefix:\"@_\",attributesGroupName:!1,textNodeName:\"#text\",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:\" \",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp(\"&\",\"g\"),val:\"&\"},{regex:new RegExp(\">\",\"g\"),val:\">\"},{regex:new RegExp(\"<\",\"g\"),val:\"<\"},{regex:new RegExp(\"'\",\"g\"),val:\"'\"},{regex:new RegExp('\"',\"g\"),val:\""\"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function Qt(t){if(this.options=Object.assign({},Kt,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];\"string\"==typeof e?this.stopNodeExpressions.push(new K(e)):e instanceof K&&this.stopNodeExpressions.push(e)}var e;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=\"function\"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if(\"string\"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ne),this.processTextOrObjNode=te,this.options.format?(this.indentate=ee,this.tagEndChar=\">\\n\",this.newLine=\"\\n\"):(this.indentate=function(){return\"\"},this.tagEndChar=\">\",this.newLine=\"\")}function Ht(t,e,n,i,s){return n.sanitizeName?L(t,{xmlVersion:s})?t:n.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function te(t,e,n,i,s){const r=this.extractAttributes(t);if(i.push(e,r),this.checkStopNode(i)){const s=this.buildRawContent(t),r=this.buildAttributesForStopNode(t);return i.pop(),this.buildObjectNode(s,e,r,n)}const o=this.j2x(t,n+1,i,s);return i.pop(),\"?\"===e[0]?this.buildTextValNode(\"\",e,o.attrStr,n,i):void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,o.attrStr,n,i):this.buildObjectNode(o.val,e,o.attrStr,n)}function ee(t){return this.options.indentBy.repeat(t)}function ne(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Qt.prototype.build=function(t){if(this.options.preserveOrder)return Ut(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});const e=new J,n=function(t,e){const n=t[\"?xml\"];if(n&&\"object\"==typeof n){if(e.attributesGroupName&&n[e.attributesGroupName]){const t=n[e.attributesGroupName][e.attributeNamePrefix+\"version\"];if(t)return t}const t=n[e.attributeNamePrefix+\"version\"];if(t)return t}return\"1.0\"}(t,this.options);return this.j2x(t,0,e,n).val}},Qt.prototype.j2x=function(t,e,n,i){let s=\"\",r=\"\";if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");const o=this.options.jPath?n.toString():n,a=this.checkStopNode(n);for(let h in t){if(!Object.prototype.hasOwnProperty.call(t,h))continue;const l=h===this.options.textNodeName||h===this.options.cdataPropName||h===this.options.commentPropName||this.options.attributesGroupName&&h===this.options.attributesGroupName||this.isAttribute(h)||\"?\"===h[0]?h:Ht(h,!1,this.options,n,i);if(void 0===t[h])this.isAttribute(h)&&(r+=\"\");else if(null===t[h])this.isAttribute(h)||l===this.options.cdataPropName||l===this.options.commentPropName?r+=\"\":\"?\"===l[0]?r+=this.indentate(e)+\"<\"+l+\"?\"+this.tagEndChar:r+=this.indentate(e)+\"<\"+l+\"/\"+this.tagEndChar;else if(t[h]instanceof Date)r+=this.buildTextValNode(t[h],l,\"\",e,n);else if(\"object\"!=typeof t[h]){const u=this.isAttribute(h);if(u&&!this.ignoreAttributesFn(u,o)){const e=Ht(u,!0,this.options,n,i);s+=this.buildAttrPairStr(e,\"\"+t[h],a)}else if(!u)if(h===this.options.textNodeName){let e=this.options.tagValueProcessor(h,\"\"+t[h]);r+=this.replaceEntitiesValue(e)}else{n.push(l);const i=this.checkStopNode(n);if(n.pop(),i){const n=\"\"+t[h];r+=\"\"===n?this.indentate(e)+\"<\"+l+this.closeTag(l)+this.tagEndChar:this.indentate(e)+\"<\"+l+\">\"+n+\"</\"+l+this.tagEndChar}else r+=this.buildTextValNode(t[h],l,\"\",e,n)}}else if(Array.isArray(t[h])){const s=t[h].length;let o=\"\",a=\"\";for(let u=0;u<s;u++){const s=t[h][u];if(void 0===s);else if(null===s)\"?\"===l[0]?r+=this.indentate(e)+\"<\"+l+\"?\"+this.tagEndChar:r+=this.indentate(e)+\"<\"+l+\"/\"+this.tagEndChar;else if(\"object\"==typeof s)if(this.options.oneListGroup){n.push(l);const t=this.j2x(s,e+1,n,i);n.pop(),o+=t.val,this.options.attributesGroupName&&s.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else o+=this.processTextOrObjNode(s,l,e,n,i);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(l,s);t=this.replaceEntitiesValue(t),o+=t}else{n.push(l);const t=this.checkStopNode(n);if(n.pop(),t){const t=\"\"+s;o+=\"\"===t?this.indentate(e)+\"<\"+l+this.closeTag(l)+this.tagEndChar:this.indentate(e)+\"<\"+l+\">\"+t+\"</\"+l+this.tagEndChar}else o+=this.buildTextValNode(s,l,\"\",e,n)}}this.options.oneListGroup&&(o=this.buildObjectNode(o,l,a,e)),r+=o}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const e=Object.keys(t[h]),r=e.length;for(let o=0;o<r;o++){const r=Ht(e[o],!0,this.options,n,i);s+=this.buildAttrPairStr(r,\"\"+t[h][e[o]],a)}}else r+=this.processTextOrObjNode(t[h],l,e,n,i)}return{attrStr:s,val:r}},Qt.prototype.buildAttrPairStr=function(t,e,n){return n||(e=this.options.attributeValueProcessor(t,\"\"+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&\"true\"===e?\" \"+t:\" \"+t+'=\"'+Ft(e)+'\"'},Qt.prototype.extractAttributes=function(t){if(!t||\"object\"!=typeof t)return null;const e={};let n=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const i=t[this.options.attributesGroupName];for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t]=Ft(i[t]),n=!0)}else for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const s=this.isAttribute(i);s&&(e[s]=Ft(t[i]),n=!0)}return n?e:null},Qt.prototype.buildRawContent=function(t){if(\"string\"==typeof t)return t;if(\"object\"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];let e=\"\";for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(this.isAttribute(n))continue;if(this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;const i=t[n];if(n===this.options.textNodeName)e+=i;else if(Array.isArray(i)){for(let t of i)if(\"string\"==typeof t||\"number\"==typeof t)e+=`<${n}>${t}</${n}>`;else if(\"object\"==typeof t&&null!==t){const i=this.buildRawContent(t),s=this.buildAttributesForStopNode(t);e+=\"\"===i?`<${n}${s}/>`:`<${n}${s}>${i}</${n}>`}}else if(\"object\"==typeof i&&null!==i){const t=this.buildRawContent(i),s=this.buildAttributesForStopNode(i);e+=\"\"===t?`<${n}${s}/>`:`<${n}${s}>${t}</${n}>`}else e+=`<${n}>${i}</${n}>`}return e},Qt.prototype.buildAttributesForStopNode=function(t){if(!t||\"object\"!=typeof t)return\"\";let e=\"\";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const n=t[this.options.attributesGroupName];for(let t in n){if(!Object.prototype.hasOwnProperty.call(n,t))continue;const i=t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t,s=n[t];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+i:e+=\" \"+i+'=\"'+s+'\"'}}else for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const i=this.isAttribute(n);if(i){const s=t[n];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+i:e+=\" \"+i+'=\"'+s+'\"'}}return e},Qt.prototype.buildObjectNode=function(t,e,n,i){if(\"\"===t)return\"?\"===e[0]?this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar:this.indentate(i)+\"<\"+e+n+this.closeTag(e)+this.tagEndChar;if(\"?\"===e[0])return this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar;{let s=\"</\"+e+this.tagEndChar,r=\"\";return\"?\"===e[0]&&(r=\"?\",s=\"\"),!n&&\"\"!==n||-1!==t.indexOf(\"<\")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\\x3c!--${t}--\\x3e`+this.newLine:this.indentate(i)+\"<\"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+\"<\"+e+n+r+\">\"+t+s}},Qt.prototype.closeTag=function(t){let e=\"\";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e=\"/\"):e=this.options.suppressEmptyNode?\"/\":`></${t}`,e},Qt.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(let e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},Qt.prototype.buildTextValNode=function(t,e,n,i,s){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){const e=Rt(t);return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){const e=kt(t);return this.indentate(i)+`\\x3c!--${e}--\\x3e`+this.newLine}if(\"?\"===e[0])return this.indentate(i)+\"<\"+e+n+\"?\"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),\"\"===s?this.indentate(i)+\"<\"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+\"<\"+e+n+\">\"+s+\"</\"+e+this.tagEndChar}},Qt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const ie=Qt,se={validate:l};module.exports=e})();","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(328);\n",""],"names":[],"sourceRoot":""}
|