replicas-cli 0.2.122 → 0.2.123

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.
Files changed (27) hide show
  1. package/dist/{chunk-NH63C5BC.mjs → chunk-4KZFIKR3.mjs} +1077 -1230
  2. package/dist/{chunk-HDHAEUVR.mjs → chunk-6E4PAXC5.mjs} +1 -1
  3. package/dist/{chunk-OMR2FLSI.mjs → chunk-AEKGTTWT.mjs} +2 -2
  4. package/dist/{chunk-R7VCWGZ2.mjs → chunk-CEE3Y7RM.mjs} +1 -1
  5. package/dist/{chunk-BY7XUH2G.mjs → chunk-F3ZHQCAZ.mjs} +162 -157
  6. package/dist/{chunk-H7SOGPWV.mjs → chunk-H57WOA7R.mjs} +309 -22
  7. package/dist/{chunk-43COQWMG.mjs → chunk-HMKFI7SL.mjs} +19 -19
  8. package/dist/{chunk-G3M3ZN6T.mjs → chunk-K7B6G3FP.mjs} +6 -6
  9. package/dist/{chunk-EHHAQWN3.mjs → chunk-KHHYAMUK.mjs} +12 -12
  10. package/dist/{chunk-ENRF2K6M.mjs → chunk-W27BU2E4.mjs} +72 -355
  11. package/dist/{chunk-PNVVO6MW.mjs → chunk-YZ62XZX5.mjs} +2 -2
  12. package/dist/{dist-es-XKOZULQT.mjs → dist-es-76ZS5ZGX.mjs} +19 -19
  13. package/dist/{dist-es-HC7MGS4M.mjs → dist-es-DRC4RUDF.mjs} +18 -18
  14. package/dist/{dist-es-VFOQQKFA.mjs → dist-es-FTV27CJE.mjs} +3 -3
  15. package/dist/{dist-es-WSBAYZQI.mjs → dist-es-MVWFIO2N.mjs} +7 -7
  16. package/dist/{dist-es-DZIRR447.mjs → dist-es-PGBT2GSM.mjs} +27 -27
  17. package/dist/{dist-es-URIWYPPF.mjs → dist-es-TKQAVPOM.mjs} +12 -14
  18. package/dist/{dist-es-I6P57CZS.mjs → dist-es-X7XEFTLU.mjs} +7 -7
  19. package/dist/index.mjs +3 -3
  20. package/dist/{interactive-OHZFZVXH.mjs → interactive-TRUNJWJL.mjs} +1 -1
  21. package/dist/{loadSso-WA3733QO.mjs → loadSso-PADWQIUG.mjs} +109 -148
  22. package/dist/{signin-QNS25VI4.mjs → signin-4DZRTUJH.mjs} +123 -177
  23. package/dist/{sso-oidc-KJ5X6WUQ.mjs → sso-oidc-VICR4TNH.mjs} +111 -150
  24. package/dist/{sts-7OF5CJSW.mjs → sts-WJPOT3CH.mjs} +2853 -660
  25. package/package.json +1 -1
  26. package/dist/chunk-GXZPN42X.mjs +0 -178
  27. package/dist/event-streams-T3U3ZQLC.mjs +0 -247
@@ -1,12 +1,11 @@
1
1
  #!/usr/bin/env bun
2
- import {
3
- dateToUtcString
4
- } from "./chunk-GXZPN42X.mjs";
5
2
  import {
6
3
  createAggregatedClient
7
4
  } from "./chunk-75QHZ6FC.mjs";
8
5
  import {
6
+ AwsSdkSigV4ASigner,
9
7
  AwsSdkSigV4Signer,
8
+ BinaryDecisionDiagram,
10
9
  Client,
11
10
  Command,
12
11
  DEFAULT_RETRY_MODE,
@@ -21,6 +20,7 @@ import {
21
20
  NODE_REGION_CONFIG_FILE_OPTIONS,
22
21
  NODE_REGION_CONFIG_OPTIONS,
23
22
  NODE_RETRY_MODE_CONFIG_OPTIONS,
23
+ NODE_SIGV4A_CONFIG_OPTIONS,
24
24
  NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
25
25
  NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
26
26
  NoAuthSigner,
@@ -30,6 +30,7 @@ import {
30
30
  ProtocolLib,
31
31
  SerdeContextConfig,
32
32
  ServiceException,
33
+ SignatureV4,
33
34
  TypeRegistry,
34
35
  UnionSerde,
35
36
  awsEndpointFunctions,
@@ -37,6 +38,7 @@ import {
37
38
  collectBody,
38
39
  createDefaultUserAgentProvider,
39
40
  customEndpointFunctions,
41
+ decideEndpoint,
40
42
  deref,
41
43
  determineTimestampFormat,
42
44
  emitWarningIfUnsupportedVersion,
@@ -60,46 +62,48 @@ import {
60
62
  normalizeProvider,
61
63
  package_default,
62
64
  resolveAwsRegionExtensionConfiguration,
65
+ resolveAwsSdkSigV4AConfig,
63
66
  resolveAwsSdkSigV4Config,
64
67
  resolveDefaultRuntimeConfig,
65
68
  resolveDefaultsModeConfig,
66
- resolveEndpoint,
67
69
  resolveEndpointConfig,
68
70
  resolveHostHeaderConfig,
69
71
  resolveHttpHandlerRuntimeConfig,
72
+ resolveParams,
70
73
  resolveRegionConfig,
71
74
  resolveRetryConfig,
72
75
  resolveUserAgentConfig,
73
76
  v4
74
- } from "./chunk-NH63C5BC.mjs";
77
+ } from "./chunk-4KZFIKR3.mjs";
75
78
  import {
76
79
  loadConfig,
77
80
  parseUrl
78
- } from "./chunk-EHHAQWN3.mjs";
79
- import "./chunk-PNVVO6MW.mjs";
80
- import "./chunk-43COQWMG.mjs";
81
+ } from "./chunk-KHHYAMUK.mjs";
82
+ import "./chunk-YZ62XZX5.mjs";
81
83
  import {
82
84
  NodeHttpHandler,
85
+ dateToUtcString,
83
86
  fromBase64,
84
87
  streamCollector,
85
88
  toBase64
86
- } from "./chunk-H7SOGPWV.mjs";
89
+ } from "./chunk-H57WOA7R.mjs";
87
90
  import {
88
91
  HttpRequest
89
- } from "./chunk-HDHAEUVR.mjs";
92
+ } from "./chunk-6E4PAXC5.mjs";
90
93
  import {
91
94
  fromUtf8,
92
95
  toUtf8
93
96
  } from "./chunk-S6VA5TIO.mjs";
97
+ import "./chunk-HMKFI7SL.mjs";
94
98
  import {
95
99
  setCredentialFeature
96
- } from "./chunk-R7VCWGZ2.mjs";
97
- import "./chunk-OMR2FLSI.mjs";
100
+ } from "./chunk-CEE3Y7RM.mjs";
101
+ import "./chunk-AEKGTTWT.mjs";
98
102
  import {
99
103
  __publicField
100
104
  } from "./chunk-FFDYI4OH.mjs";
101
105
 
102
- // ../node_modules/.bun/@smithy+core@3.23.13/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
106
+ // ../node_modules/.bun/@smithy+core@3.23.17/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
103
107
  var RpcProtocol = class extends HttpProtocol {
104
108
  async serializeRequest(operationSchema, _input, context) {
105
109
  const serializer = this.serializer;
@@ -200,77 +204,57 @@ var getValueFromTextNode = (obj) => {
200
204
  return obj;
201
205
  };
202
206
 
203
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js
204
- var defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
205
- return {
206
- operation: getSmithyContext(context).operation,
207
- region: await normalizeProvider(config.region)() || (() => {
208
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
209
- })()
210
- };
207
+ // ../node_modules/.bun/@smithy+signature-v4@5.3.14/node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js
208
+ var signatureV4aContainer = {
209
+ SignatureV4a: null
211
210
  };
212
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
213
- return {
214
- schemeId: "aws.auth#sigv4",
215
- signingProperties: {
216
- name: "sts",
217
- region: authParameters.region
218
- },
219
- propertiesExtractor: (config, context) => ({
220
- signingProperties: {
221
- config,
222
- context
223
- }
224
- })
211
+
212
+ // ../node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.37/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js
213
+ var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
214
+ var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
215
+
216
+ // ../node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.37/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js
217
+ var SignatureV4S3Express = class extends SignatureV4 {
218
+ async signWithCredentials(requestToSign, credentials, options) {
219
+ const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
220
+ requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
221
+ const privateAccess = this;
222
+ setSingleOverride(privateAccess, credentialsWithoutSessionToken);
223
+ return privateAccess.signRequest(requestToSign, options ?? {});
224
+ }
225
+ async presignWithCredentials(requestToSign, credentials, options) {
226
+ const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
227
+ delete requestToSign.headers[SESSION_TOKEN_HEADER];
228
+ requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
229
+ requestToSign.query = requestToSign.query ?? {};
230
+ requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
231
+ const privateAccess = this;
232
+ setSingleOverride(privateAccess, credentialsWithoutSessionToken);
233
+ return this.presign(requestToSign, options);
234
+ }
235
+ };
236
+ function getCredentialsWithoutSessionToken(credentials) {
237
+ const credentialsWithoutSessionToken = {
238
+ accessKeyId: credentials.accessKeyId,
239
+ secretAccessKey: credentials.secretAccessKey,
240
+ expiration: credentials.expiration
225
241
  };
242
+ return credentialsWithoutSessionToken;
226
243
  }
227
- function createSmithyApiNoAuthHttpAuthOption(authParameters) {
228
- return {
229
- schemeId: "smithy.api#noAuth"
244
+ function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
245
+ const id = setTimeout(() => {
246
+ throw new Error("SignatureV4S3Express credential override was created but not called.");
247
+ }, 10);
248
+ const currentCredentialProvider = privateAccess.credentialProvider;
249
+ const overrideCredentialsProviderOnce = () => {
250
+ clearTimeout(id);
251
+ privateAccess.credentialProvider = currentCredentialProvider;
252
+ return Promise.resolve(credentialsWithoutSessionToken);
230
253
  };
254
+ privateAccess.credentialProvider = overrideCredentialsProviderOnce;
231
255
  }
232
- var defaultSTSHttpAuthSchemeProvider = (authParameters) => {
233
- const options = [];
234
- switch (authParameters.operation) {
235
- case "AssumeRoleWithWebIdentity": {
236
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
237
- break;
238
- }
239
- default: {
240
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
241
- }
242
- }
243
- return options;
244
- };
245
- var resolveStsAuthConfig = (input) => Object.assign(input, {
246
- stsClientCtor: STSClient
247
- });
248
- var resolveHttpAuthSchemeConfig = (config) => {
249
- const config_0 = resolveStsAuthConfig(config);
250
- const config_1 = resolveAwsSdkSigV4Config(config_0);
251
- return Object.assign(config_1, {
252
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
253
- });
254
- };
255
-
256
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js
257
- var resolveClientEndpointParameters = (options) => {
258
- return Object.assign(options, {
259
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
260
- useFipsEndpoint: options.useFipsEndpoint ?? false,
261
- useGlobalEndpoint: options.useGlobalEndpoint ?? false,
262
- defaultSigningName: "sts"
263
- });
264
- };
265
- var commonParams = {
266
- UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
267
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
268
- Endpoint: { type: "builtInParams", name: "endpoint" },
269
- Region: { type: "builtInParams", name: "region" },
270
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
271
- };
272
256
 
273
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/util.js
257
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/util.js
274
258
  var nameStartChar = ":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";
275
259
  var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
276
260
  var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
@@ -294,8 +278,8 @@ var isName = function(string) {
294
278
  const match = regexName.exec(string);
295
279
  return !(match === null || typeof match === "undefined");
296
280
  };
297
- function isExist(v2) {
298
- return typeof v2 !== "undefined";
281
+ function isExist(v) {
282
+ return typeof v !== "undefined";
299
283
  }
300
284
  var DANGEROUS_PROPERTY_NAMES = [
301
285
  // '__proto__',
@@ -311,7 +295,7 @@ var DANGEROUS_PROPERTY_NAMES = [
311
295
  ];
312
296
  var criticalProperties = ["__proto__", "constructor", "prototype"];
313
297
 
314
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/validator.js
298
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/validator.js
315
299
  var defaultOptions = {
316
300
  allowBooleanAttributes: false,
317
301
  //A tag can have attributes without any value
@@ -448,7 +432,7 @@ function validate(xmlData, options) {
448
432
  } else if (tags.length == 1) {
449
433
  return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
450
434
  } else if (tags.length > 0) {
451
- return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t2) => t2.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
435
+ return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
452
436
  }
453
437
  return true;
454
438
  }
@@ -617,7 +601,1476 @@ function getPositionFromMatch(match) {
617
601
  return match.startIndex + match[1].length;
618
602
  }
619
603
 
620
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
604
+ // ../node_modules/.bun/@nodable+entities@2.1.0/node_modules/@nodable/entities/src/entities.js
605
+ var BASIC_LATIN = {
606
+ amp: "&",
607
+ AMP: "&",
608
+ lt: "<",
609
+ LT: "<",
610
+ gt: ">",
611
+ GT: ">",
612
+ quot: '"',
613
+ QUOT: '"',
614
+ apos: "'",
615
+ lsquo: "\u2018",
616
+ rsquo: "\u2019",
617
+ ldquo: "\u201C",
618
+ rdquo: "\u201D",
619
+ lsquor: "\u201A",
620
+ rsquor: "\u2019",
621
+ ldquor: "\u201E",
622
+ bdquo: "\u201E",
623
+ comma: ",",
624
+ period: ".",
625
+ colon: ":",
626
+ semi: ";",
627
+ excl: "!",
628
+ quest: "?",
629
+ num: "#",
630
+ dollar: "$",
631
+ percent: "%",
632
+ amp: "&",
633
+ ast: "*",
634
+ commat: "@",
635
+ lowbar: "_",
636
+ verbar: "|",
637
+ vert: "|",
638
+ sol: "/",
639
+ bsol: "\\",
640
+ lbrace: "{",
641
+ rbrace: "}",
642
+ lbrack: "[",
643
+ rbrack: "]",
644
+ lpar: "(",
645
+ rpar: ")",
646
+ nbsp: "\xA0",
647
+ iexcl: "\xA1",
648
+ cent: "\xA2",
649
+ pound: "\xA3",
650
+ curren: "\xA4",
651
+ yen: "\xA5",
652
+ brvbar: "\xA6",
653
+ sect: "\xA7",
654
+ uml: "\xA8",
655
+ copy: "\xA9",
656
+ COPY: "\xA9",
657
+ ordf: "\xAA",
658
+ laquo: "\xAB",
659
+ not: "\xAC",
660
+ shy: "\xAD",
661
+ reg: "\xAE",
662
+ REG: "\xAE",
663
+ macr: "\xAF",
664
+ deg: "\xB0",
665
+ plusmn: "\xB1",
666
+ sup2: "\xB2",
667
+ sup3: "\xB3",
668
+ acute: "\xB4",
669
+ micro: "\xB5",
670
+ para: "\xB6",
671
+ middot: "\xB7",
672
+ cedil: "\xB8",
673
+ sup1: "\xB9",
674
+ ordm: "\xBA",
675
+ raquo: "\xBB",
676
+ frac14: "\xBC",
677
+ frac12: "\xBD",
678
+ half: "\xBD",
679
+ frac34: "\xBE",
680
+ iquest: "\xBF",
681
+ times: "\xD7",
682
+ div: "\xF7",
683
+ divide: "\xF7"
684
+ };
685
+ var LATIN_ACCENTS = {
686
+ Agrave: "\xC0",
687
+ agrave: "\xE0",
688
+ Aacute: "\xC1",
689
+ aacute: "\xE1",
690
+ Acirc: "\xC2",
691
+ acirc: "\xE2",
692
+ Atilde: "\xC3",
693
+ atilde: "\xE3",
694
+ Auml: "\xC4",
695
+ auml: "\xE4",
696
+ Aring: "\xC5",
697
+ aring: "\xE5",
698
+ AElig: "\xC6",
699
+ aelig: "\xE6",
700
+ Ccedil: "\xC7",
701
+ ccedil: "\xE7",
702
+ Egrave: "\xC8",
703
+ egrave: "\xE8",
704
+ Eacute: "\xC9",
705
+ eacute: "\xE9",
706
+ Ecirc: "\xCA",
707
+ ecirc: "\xEA",
708
+ Euml: "\xCB",
709
+ euml: "\xEB",
710
+ Igrave: "\xCC",
711
+ igrave: "\xEC",
712
+ Iacute: "\xCD",
713
+ iacute: "\xED",
714
+ Icirc: "\xCE",
715
+ icirc: "\xEE",
716
+ Iuml: "\xCF",
717
+ iuml: "\xEF",
718
+ ETH: "\xD0",
719
+ eth: "\xF0",
720
+ Ntilde: "\xD1",
721
+ ntilde: "\xF1",
722
+ Ograve: "\xD2",
723
+ ograve: "\xF2",
724
+ Oacute: "\xD3",
725
+ oacute: "\xF3",
726
+ Ocirc: "\xD4",
727
+ ocirc: "\xF4",
728
+ Otilde: "\xD5",
729
+ otilde: "\xF5",
730
+ Ouml: "\xD6",
731
+ ouml: "\xF6",
732
+ Oslash: "\xD8",
733
+ oslash: "\xF8",
734
+ Ugrave: "\xD9",
735
+ ugrave: "\xF9",
736
+ Uacute: "\xDA",
737
+ uacute: "\xFA",
738
+ Ucirc: "\xDB",
739
+ ucirc: "\xFB",
740
+ Uuml: "\xDC",
741
+ uuml: "\xFC",
742
+ Yacute: "\xDD",
743
+ yacute: "\xFD",
744
+ THORN: "\xDE",
745
+ thorn: "\xFE",
746
+ szlig: "\xDF",
747
+ yuml: "\xFF",
748
+ Yuml: "\u0178"
749
+ };
750
+ var LATIN_EXTENDED = {
751
+ Amacr: "\u0100",
752
+ amacr: "\u0101",
753
+ Abreve: "\u0102",
754
+ abreve: "\u0103",
755
+ Aogon: "\u0104",
756
+ aogon: "\u0105",
757
+ Cacute: "\u0106",
758
+ cacute: "\u0107",
759
+ Ccirc: "\u0108",
760
+ ccirc: "\u0109",
761
+ Cdot: "\u010A",
762
+ cdot: "\u010B",
763
+ Ccaron: "\u010C",
764
+ ccaron: "\u010D",
765
+ Dcaron: "\u010E",
766
+ dcaron: "\u010F",
767
+ Dstrok: "\u0110",
768
+ dstrok: "\u0111",
769
+ Emacr: "\u0112",
770
+ emacr: "\u0113",
771
+ Ecaron: "\u011A",
772
+ ecaron: "\u011B",
773
+ Edot: "\u0116",
774
+ edot: "\u0117",
775
+ Eogon: "\u0118",
776
+ eogon: "\u0119",
777
+ Gcirc: "\u011C",
778
+ gcirc: "\u011D",
779
+ Gbreve: "\u011E",
780
+ gbreve: "\u011F",
781
+ Gdot: "\u0120",
782
+ gdot: "\u0121",
783
+ Gcedil: "\u0122",
784
+ Hcirc: "\u0124",
785
+ hcirc: "\u0125",
786
+ Hstrok: "\u0126",
787
+ hstrok: "\u0127",
788
+ Itilde: "\u0128",
789
+ itilde: "\u0129",
790
+ Imacr: "\u012A",
791
+ imacr: "\u012B",
792
+ Iogon: "\u012E",
793
+ iogon: "\u012F",
794
+ Idot: "\u0130",
795
+ IJlig: "\u0132",
796
+ ijlig: "\u0133",
797
+ Jcirc: "\u0134",
798
+ jcirc: "\u0135",
799
+ Kcedil: "\u0136",
800
+ kcedil: "\u0137",
801
+ kgreen: "\u0138",
802
+ Lacute: "\u0139",
803
+ lacute: "\u013A",
804
+ Lcedil: "\u013B",
805
+ lcedil: "\u013C",
806
+ Lcaron: "\u013D",
807
+ lcaron: "\u013E",
808
+ Lmidot: "\u013F",
809
+ lmidot: "\u0140",
810
+ Lstrok: "\u0141",
811
+ lstrok: "\u0142",
812
+ Nacute: "\u0143",
813
+ nacute: "\u0144",
814
+ Ncaron: "\u0147",
815
+ ncaron: "\u0148",
816
+ Ncedil: "\u0145",
817
+ ncedil: "\u0146",
818
+ ENG: "\u014A",
819
+ eng: "\u014B",
820
+ Omacr: "\u014C",
821
+ omacr: "\u014D",
822
+ Odblac: "\u0150",
823
+ odblac: "\u0151",
824
+ OElig: "\u0152",
825
+ oelig: "\u0153",
826
+ Racute: "\u0154",
827
+ racute: "\u0155",
828
+ Rcaron: "\u0158",
829
+ rcaron: "\u0159",
830
+ Rcedil: "\u0156",
831
+ rcedil: "\u0157",
832
+ Sacute: "\u015A",
833
+ sacute: "\u015B",
834
+ Scirc: "\u015C",
835
+ scirc: "\u015D",
836
+ Scedil: "\u015E",
837
+ scedil: "\u015F",
838
+ Scaron: "\u0160",
839
+ scaron: "\u0161",
840
+ Tcedil: "\u0162",
841
+ tcedil: "\u0163",
842
+ Tcaron: "\u0164",
843
+ tcaron: "\u0165",
844
+ Tstrok: "\u0166",
845
+ tstrok: "\u0167",
846
+ Utilde: "\u0168",
847
+ utilde: "\u0169",
848
+ Umacr: "\u016A",
849
+ umacr: "\u016B",
850
+ Ubreve: "\u016C",
851
+ ubreve: "\u016D",
852
+ Uring: "\u016E",
853
+ uring: "\u016F",
854
+ Udblac: "\u0170",
855
+ udblac: "\u0171",
856
+ Uogon: "\u0172",
857
+ uogon: "\u0173",
858
+ Wcirc: "\u0174",
859
+ wcirc: "\u0175",
860
+ Ycirc: "\u0176",
861
+ ycirc: "\u0177",
862
+ Zacute: "\u0179",
863
+ zacute: "\u017A",
864
+ Zdot: "\u017B",
865
+ zdot: "\u017C",
866
+ Zcaron: "\u017D",
867
+ zcaron: "\u017E"
868
+ };
869
+ var GREEK = {
870
+ Alpha: "\u0391",
871
+ alpha: "\u03B1",
872
+ Beta: "\u0392",
873
+ beta: "\u03B2",
874
+ Gamma: "\u0393",
875
+ gamma: "\u03B3",
876
+ Delta: "\u0394",
877
+ delta: "\u03B4",
878
+ Epsilon: "\u0395",
879
+ epsilon: "\u03B5",
880
+ epsiv: "\u03F5",
881
+ varepsilon: "\u03F5",
882
+ Zeta: "\u0396",
883
+ zeta: "\u03B6",
884
+ Eta: "\u0397",
885
+ eta: "\u03B7",
886
+ Theta: "\u0398",
887
+ theta: "\u03B8",
888
+ thetasym: "\u03D1",
889
+ vartheta: "\u03D1",
890
+ Iota: "\u0399",
891
+ iota: "\u03B9",
892
+ Kappa: "\u039A",
893
+ kappa: "\u03BA",
894
+ kappav: "\u03F0",
895
+ varkappa: "\u03F0",
896
+ Lambda: "\u039B",
897
+ lambda: "\u03BB",
898
+ Mu: "\u039C",
899
+ mu: "\u03BC",
900
+ Nu: "\u039D",
901
+ nu: "\u03BD",
902
+ Xi: "\u039E",
903
+ xi: "\u03BE",
904
+ Omicron: "\u039F",
905
+ omicron: "\u03BF",
906
+ Pi: "\u03A0",
907
+ pi: "\u03C0",
908
+ piv: "\u03D6",
909
+ varpi: "\u03D6",
910
+ Rho: "\u03A1",
911
+ rho: "\u03C1",
912
+ rhov: "\u03F1",
913
+ varrho: "\u03F1",
914
+ Sigma: "\u03A3",
915
+ sigma: "\u03C3",
916
+ sigmaf: "\u03C2",
917
+ sigmav: "\u03C2",
918
+ varsigma: "\u03C2",
919
+ Tau: "\u03A4",
920
+ tau: "\u03C4",
921
+ Upsilon: "\u03A5",
922
+ upsilon: "\u03C5",
923
+ upsi: "\u03C5",
924
+ Upsi: "\u03D2",
925
+ upsih: "\u03D2",
926
+ Phi: "\u03A6",
927
+ phi: "\u03C6",
928
+ phiv: "\u03D5",
929
+ varphi: "\u03D5",
930
+ Chi: "\u03A7",
931
+ chi: "\u03C7",
932
+ Psi: "\u03A8",
933
+ psi: "\u03C8",
934
+ Omega: "\u03A9",
935
+ omega: "\u03C9",
936
+ ohm: "\u03A9",
937
+ Gammad: "\u03DC",
938
+ gammad: "\u03DD",
939
+ digamma: "\u03DD"
940
+ };
941
+ var CYRILLIC = {
942
+ Afr: "\u{1D504}",
943
+ afr: "\u{1D51E}",
944
+ Acy: "\u0410",
945
+ acy: "\u0430",
946
+ Bcy: "\u0411",
947
+ bcy: "\u0431",
948
+ Vcy: "\u0412",
949
+ vcy: "\u0432",
950
+ Gcy: "\u0413",
951
+ gcy: "\u0433",
952
+ Dcy: "\u0414",
953
+ dcy: "\u0434",
954
+ IEcy: "\u0415",
955
+ iecy: "\u0435",
956
+ IOcy: "\u0401",
957
+ iocy: "\u0451",
958
+ ZHcy: "\u0416",
959
+ zhcy: "\u0436",
960
+ Zcy: "\u0417",
961
+ zcy: "\u0437",
962
+ Icy: "\u0418",
963
+ icy: "\u0438",
964
+ Jcy: "\u0419",
965
+ jcy: "\u0439",
966
+ Kcy: "\u041A",
967
+ kcy: "\u043A",
968
+ Lcy: "\u041B",
969
+ lcy: "\u043B",
970
+ Mcy: "\u041C",
971
+ mcy: "\u043C",
972
+ Ncy: "\u041D",
973
+ ncy: "\u043D",
974
+ Ocy: "\u041E",
975
+ ocy: "\u043E",
976
+ Pcy: "\u041F",
977
+ pcy: "\u043F",
978
+ Rcy: "\u0420",
979
+ rcy: "\u0440",
980
+ Scy: "\u0421",
981
+ scy: "\u0441",
982
+ Tcy: "\u0422",
983
+ tcy: "\u0442",
984
+ Ucy: "\u0423",
985
+ ucy: "\u0443",
986
+ Fcy: "\u0424",
987
+ fcy: "\u0444",
988
+ KHcy: "\u0425",
989
+ khcy: "\u0445",
990
+ TScy: "\u0426",
991
+ tscy: "\u0446",
992
+ CHcy: "\u0427",
993
+ chcy: "\u0447",
994
+ SHcy: "\u0428",
995
+ shcy: "\u0448",
996
+ SHCHcy: "\u0429",
997
+ shchcy: "\u0449",
998
+ HARDcy: "\u042A",
999
+ hardcy: "\u044A",
1000
+ Ycy: "\u042B",
1001
+ ycy: "\u044B",
1002
+ SOFTcy: "\u042C",
1003
+ softcy: "\u044C",
1004
+ Ecy: "\u042D",
1005
+ ecy: "\u044D",
1006
+ YUcy: "\u042E",
1007
+ yucy: "\u044E",
1008
+ YAcy: "\u042F",
1009
+ yacy: "\u044F",
1010
+ DJcy: "\u0402",
1011
+ djcy: "\u0452",
1012
+ GJcy: "\u0403",
1013
+ gjcy: "\u0453",
1014
+ Jukcy: "\u0404",
1015
+ jukcy: "\u0454",
1016
+ DScy: "\u0405",
1017
+ dscy: "\u0455",
1018
+ Iukcy: "\u0406",
1019
+ iukcy: "\u0456",
1020
+ YIcy: "\u0407",
1021
+ yicy: "\u0457",
1022
+ Jsercy: "\u0408",
1023
+ jsercy: "\u0458",
1024
+ LJcy: "\u0409",
1025
+ ljcy: "\u0459",
1026
+ NJcy: "\u040A",
1027
+ njcy: "\u045A",
1028
+ TSHcy: "\u040B",
1029
+ tshcy: "\u045B",
1030
+ KJcy: "\u040C",
1031
+ kjcy: "\u045C",
1032
+ Ubrcy: "\u040E",
1033
+ ubrcy: "\u045E",
1034
+ DZcy: "\u040F",
1035
+ dzcy: "\u045F"
1036
+ };
1037
+ var MATH = {
1038
+ plus: "+",
1039
+ minus: "\u2212",
1040
+ mnplus: "\u2213",
1041
+ mp: "\u2213",
1042
+ pm: "\xB1",
1043
+ times: "\xD7",
1044
+ div: "\xF7",
1045
+ divide: "\xF7",
1046
+ sdot: "\u22C5",
1047
+ star: "\u2606",
1048
+ starf: "\u2605",
1049
+ bigstar: "\u2605",
1050
+ lowast: "\u2217",
1051
+ ast: "*",
1052
+ midast: "*",
1053
+ compfn: "\u2218",
1054
+ smallcircle: "\u2218",
1055
+ bullet: "\u2022",
1056
+ bull: "\u2022",
1057
+ nbsp: "\xA0",
1058
+ hellip: "\u2026",
1059
+ mldr: "\u2026",
1060
+ prime: "\u2032",
1061
+ Prime: "\u2033",
1062
+ tprime: "\u2034",
1063
+ bprime: "\u2035",
1064
+ backprime: "\u2035",
1065
+ minus: "\u2212",
1066
+ minusd: "\u2238",
1067
+ dotminus: "\u2238",
1068
+ plusdo: "\u2214",
1069
+ dotplus: "\u2214",
1070
+ plusmn: "\xB1",
1071
+ minusplus: "\u2213",
1072
+ mnplus: "\u2213",
1073
+ mp: "\u2213",
1074
+ setminus: "\u2216",
1075
+ smallsetminus: "\u2216",
1076
+ Backslash: "\u2216",
1077
+ setmn: "\u2216",
1078
+ ssetmn: "\u2216",
1079
+ lowbar: "_",
1080
+ verbar: "|",
1081
+ vert: "|",
1082
+ VerticalLine: "|",
1083
+ colon: ":",
1084
+ Colon: "\u2237",
1085
+ Proportion: "\u2237",
1086
+ ratio: "\u2236",
1087
+ equals: "=",
1088
+ ne: "\u2260",
1089
+ nequiv: "\u2262",
1090
+ equiv: "\u2261",
1091
+ Congruent: "\u2261",
1092
+ sim: "\u223C",
1093
+ thicksim: "\u223C",
1094
+ thksim: "\u223C",
1095
+ sime: "\u2243",
1096
+ simeq: "\u2243",
1097
+ TildeEqual: "\u2243",
1098
+ asymp: "\u2248",
1099
+ approx: "\u2248",
1100
+ thickapprox: "\u2248",
1101
+ thkap: "\u2248",
1102
+ TildeTilde: "\u2248",
1103
+ ncong: "\u2247",
1104
+ cong: "\u2245",
1105
+ TildeFullEqual: "\u2245",
1106
+ asympeq: "\u224D",
1107
+ CupCap: "\u224D",
1108
+ bump: "\u224E",
1109
+ Bumpeq: "\u224E",
1110
+ HumpDownHump: "\u224E",
1111
+ bumpe: "\u224F",
1112
+ bumpeq: "\u224F",
1113
+ HumpEqual: "\u224F",
1114
+ dotminus: "\u2238",
1115
+ minusd: "\u2238",
1116
+ plusdo: "\u2214",
1117
+ dotplus: "\u2214",
1118
+ le: "\u2264",
1119
+ LessEqual: "\u2264",
1120
+ ge: "\u2265",
1121
+ GreaterEqual: "\u2265",
1122
+ lesseqgtr: "\u22DA",
1123
+ lesseqqgtr: "\u2A8B",
1124
+ greater: ">",
1125
+ less: "<"
1126
+ };
1127
+ var MATH_ADVANCED = {
1128
+ alefsym: "\u2135",
1129
+ aleph: "\u2135",
1130
+ beth: "\u2136",
1131
+ gimel: "\u2137",
1132
+ daleth: "\u2138",
1133
+ forall: "\u2200",
1134
+ ForAll: "\u2200",
1135
+ part: "\u2202",
1136
+ PartialD: "\u2202",
1137
+ exist: "\u2203",
1138
+ Exists: "\u2203",
1139
+ nexist: "\u2204",
1140
+ nexists: "\u2204",
1141
+ empty: "\u2205",
1142
+ emptyset: "\u2205",
1143
+ emptyv: "\u2205",
1144
+ varnothing: "\u2205",
1145
+ nabla: "\u2207",
1146
+ Del: "\u2207",
1147
+ isin: "\u2208",
1148
+ isinv: "\u2208",
1149
+ in: "\u2208",
1150
+ Element: "\u2208",
1151
+ notin: "\u2209",
1152
+ notinva: "\u2209",
1153
+ ni: "\u220B",
1154
+ niv: "\u220B",
1155
+ SuchThat: "\u220B",
1156
+ ReverseElement: "\u220B",
1157
+ notni: "\u220C",
1158
+ notniva: "\u220C",
1159
+ prod: "\u220F",
1160
+ Product: "\u220F",
1161
+ coprod: "\u2210",
1162
+ Coproduct: "\u2210",
1163
+ sum: "\u2211",
1164
+ Sum: "\u2211",
1165
+ minus: "\u2212",
1166
+ mp: "\u2213",
1167
+ plusdo: "\u2214",
1168
+ dotplus: "\u2214",
1169
+ setminus: "\u2216",
1170
+ lowast: "\u2217",
1171
+ radic: "\u221A",
1172
+ Sqrt: "\u221A",
1173
+ prop: "\u221D",
1174
+ propto: "\u221D",
1175
+ Proportional: "\u221D",
1176
+ varpropto: "\u221D",
1177
+ infin: "\u221E",
1178
+ infintie: "\u29DD",
1179
+ ang: "\u2220",
1180
+ angle: "\u2220",
1181
+ angmsd: "\u2221",
1182
+ measuredangle: "\u2221",
1183
+ angsph: "\u2222",
1184
+ mid: "\u2223",
1185
+ VerticalBar: "\u2223",
1186
+ nmid: "\u2224",
1187
+ nsmid: "\u2224",
1188
+ npar: "\u2226",
1189
+ parallel: "\u2225",
1190
+ spar: "\u2225",
1191
+ nparallel: "\u2226",
1192
+ nspar: "\u2226",
1193
+ and: "\u2227",
1194
+ wedge: "\u2227",
1195
+ or: "\u2228",
1196
+ vee: "\u2228",
1197
+ cap: "\u2229",
1198
+ cup: "\u222A",
1199
+ int: "\u222B",
1200
+ Integral: "\u222B",
1201
+ conint: "\u222E",
1202
+ ContourIntegral: "\u222E",
1203
+ Conint: "\u222F",
1204
+ DoubleContourIntegral: "\u222F",
1205
+ Cconint: "\u2230",
1206
+ there4: "\u2234",
1207
+ therefore: "\u2234",
1208
+ Therefore: "\u2234",
1209
+ becaus: "\u2235",
1210
+ because: "\u2235",
1211
+ Because: "\u2235",
1212
+ ratio: "\u2236",
1213
+ Proportion: "\u2237",
1214
+ minusd: "\u2238",
1215
+ dotminus: "\u2238",
1216
+ mDDot: "\u223A",
1217
+ homtht: "\u223B",
1218
+ sim: "\u223C",
1219
+ bsimg: "\u223D",
1220
+ backsim: "\u223D",
1221
+ ac: "\u223E",
1222
+ mstpos: "\u223E",
1223
+ acd: "\u223F",
1224
+ VerticalTilde: "\u2240",
1225
+ wr: "\u2240",
1226
+ wreath: "\u2240",
1227
+ nsime: "\u2244",
1228
+ nsimeq: "\u2244",
1229
+ nsimeq: "\u2244",
1230
+ ncong: "\u2247",
1231
+ simne: "\u2246",
1232
+ ncongdot: "\u2A6D\u0338",
1233
+ ngsim: "\u2275",
1234
+ nsim: "\u2241",
1235
+ napprox: "\u2249",
1236
+ nap: "\u2249",
1237
+ ngeq: "\u2271",
1238
+ nge: "\u2271",
1239
+ nleq: "\u2270",
1240
+ nle: "\u2270",
1241
+ ngtr: "\u226F",
1242
+ ngt: "\u226F",
1243
+ nless: "\u226E",
1244
+ nlt: "\u226E",
1245
+ nprec: "\u2280",
1246
+ npr: "\u2280",
1247
+ nsucc: "\u2281",
1248
+ nsc: "\u2281"
1249
+ };
1250
+ var ARROWS = {
1251
+ larr: "\u2190",
1252
+ leftarrow: "\u2190",
1253
+ LeftArrow: "\u2190",
1254
+ uarr: "\u2191",
1255
+ uparrow: "\u2191",
1256
+ UpArrow: "\u2191",
1257
+ rarr: "\u2192",
1258
+ rightarrow: "\u2192",
1259
+ RightArrow: "\u2192",
1260
+ darr: "\u2193",
1261
+ downarrow: "\u2193",
1262
+ DownArrow: "\u2193",
1263
+ harr: "\u2194",
1264
+ leftrightarrow: "\u2194",
1265
+ LeftRightArrow: "\u2194",
1266
+ varr: "\u2195",
1267
+ updownarrow: "\u2195",
1268
+ UpDownArrow: "\u2195",
1269
+ nwarr: "\u2196",
1270
+ nwarrow: "\u2196",
1271
+ UpperLeftArrow: "\u2196",
1272
+ nearr: "\u2197",
1273
+ nearrow: "\u2197",
1274
+ UpperRightArrow: "\u2197",
1275
+ searr: "\u2198",
1276
+ searrow: "\u2198",
1277
+ LowerRightArrow: "\u2198",
1278
+ swarr: "\u2199",
1279
+ swarrow: "\u2199",
1280
+ LowerLeftArrow: "\u2199",
1281
+ lArr: "\u21D0",
1282
+ Leftarrow: "\u21D0",
1283
+ uArr: "\u21D1",
1284
+ Uparrow: "\u21D1",
1285
+ rArr: "\u21D2",
1286
+ Rightarrow: "\u21D2",
1287
+ dArr: "\u21D3",
1288
+ Downarrow: "\u21D3",
1289
+ hArr: "\u21D4",
1290
+ Leftrightarrow: "\u21D4",
1291
+ iff: "\u21D4",
1292
+ vArr: "\u21D5",
1293
+ Updownarrow: "\u21D5",
1294
+ lAarr: "\u21DA",
1295
+ Lleftarrow: "\u21DA",
1296
+ rAarr: "\u21DB",
1297
+ Rrightarrow: "\u21DB",
1298
+ lrarr: "\u21C6",
1299
+ leftrightarrows: "\u21C6",
1300
+ rlarr: "\u21C4",
1301
+ rightleftarrows: "\u21C4",
1302
+ lrhar: "\u21CB",
1303
+ leftrightharpoons: "\u21CB",
1304
+ ReverseEquilibrium: "\u21CB",
1305
+ rlhar: "\u21CC",
1306
+ rightleftharpoons: "\u21CC",
1307
+ Equilibrium: "\u21CC",
1308
+ udarr: "\u21C5",
1309
+ UpArrowDownArrow: "\u21C5",
1310
+ duarr: "\u21F5",
1311
+ DownArrowUpArrow: "\u21F5",
1312
+ llarr: "\u21C7",
1313
+ leftleftarrows: "\u21C7",
1314
+ rrarr: "\u21C9",
1315
+ rightrightarrows: "\u21C9",
1316
+ ddarr: "\u21CA",
1317
+ downdownarrows: "\u21CA",
1318
+ har: "\u21BD",
1319
+ lhard: "\u21BD",
1320
+ leftharpoondown: "\u21BD",
1321
+ lharu: "\u21BC",
1322
+ leftharpoonup: "\u21BC",
1323
+ rhard: "\u21C1",
1324
+ rightharpoondown: "\u21C1",
1325
+ rharu: "\u21C0",
1326
+ rightharpoonup: "\u21C0",
1327
+ lsh: "\u21B0",
1328
+ Lsh: "\u21B0",
1329
+ rsh: "\u21B1",
1330
+ Rsh: "\u21B1",
1331
+ ldsh: "\u21B2",
1332
+ rdsh: "\u21B3",
1333
+ hookleftarrow: "\u21A9",
1334
+ hookrightarrow: "\u21AA",
1335
+ mapstoleft: "\u21A4",
1336
+ mapstoup: "\u21A5",
1337
+ map: "\u21A6",
1338
+ mapsto: "\u21A6",
1339
+ mapstodown: "\u21A7",
1340
+ crarr: "\u21B5",
1341
+ nwarrow: "\u2196",
1342
+ nearrow: "\u2197",
1343
+ searrow: "\u2198",
1344
+ swarrow: "\u2199",
1345
+ nleftarrow: "\u219A",
1346
+ nleftrightarrow: "\u21AE",
1347
+ nrightarrow: "\u219B",
1348
+ nrarr: "\u219B",
1349
+ larrtl: "\u21A2",
1350
+ rarrtl: "\u21A3",
1351
+ leftarrowtail: "\u21A2",
1352
+ rightarrowtail: "\u21A3",
1353
+ twoheadleftarrow: "\u219E",
1354
+ twoheadrightarrow: "\u21A0",
1355
+ Larr: "\u219E",
1356
+ Rarr: "\u21A0",
1357
+ larrhk: "\u21A9",
1358
+ rarrhk: "\u21AA",
1359
+ larrlp: "\u21AB",
1360
+ looparrowleft: "\u21AB",
1361
+ rarrlp: "\u21AC",
1362
+ looparrowright: "\u21AC",
1363
+ harrw: "\u21AD",
1364
+ leftrightsquigarrow: "\u21AD",
1365
+ nrarrw: "\u219D\u0338",
1366
+ rarrw: "\u219D",
1367
+ rightsquigarrow: "\u219D",
1368
+ larrbfs: "\u291F",
1369
+ rarrbfs: "\u2920",
1370
+ nvHarr: "\u2904",
1371
+ nvlArr: "\u2902",
1372
+ nvrArr: "\u2903",
1373
+ larrfs: "\u291D",
1374
+ rarrfs: "\u291E",
1375
+ Map: "\u2905",
1376
+ larrsim: "\u2973",
1377
+ rarrsim: "\u2974",
1378
+ harrcir: "\u2948",
1379
+ Uarrocir: "\u2949",
1380
+ lurdshar: "\u294A",
1381
+ ldrdhar: "\u2967",
1382
+ ldrushar: "\u294B",
1383
+ rdldhar: "\u2969",
1384
+ lrhard: "\u296D",
1385
+ rlhar: "\u21CC",
1386
+ uharr: "\u21BE",
1387
+ uharl: "\u21BF",
1388
+ dharr: "\u21C2",
1389
+ dharl: "\u21C3",
1390
+ Uarr: "\u219F",
1391
+ Darr: "\u21A1",
1392
+ zigrarr: "\u21DD",
1393
+ nwArr: "\u21D6",
1394
+ neArr: "\u21D7",
1395
+ seArr: "\u21D8",
1396
+ swArr: "\u21D9",
1397
+ nharr: "\u21AE",
1398
+ nhArr: "\u21CE",
1399
+ nlarr: "\u219A",
1400
+ nlArr: "\u21CD",
1401
+ nrarr: "\u219B",
1402
+ nrArr: "\u21CF",
1403
+ larrb: "\u21E4",
1404
+ LeftArrowBar: "\u21E4",
1405
+ rarrb: "\u21E5",
1406
+ RightArrowBar: "\u21E5"
1407
+ };
1408
+ var SHAPES = {
1409
+ square: "\u25A1",
1410
+ Square: "\u25A1",
1411
+ squ: "\u25A1",
1412
+ squf: "\u25AA",
1413
+ squarf: "\u25AA",
1414
+ blacksquar: "\u25AA",
1415
+ blacksquare: "\u25AA",
1416
+ FilledVerySmallSquare: "\u25AA",
1417
+ blk34: "\u2593",
1418
+ blk12: "\u2592",
1419
+ blk14: "\u2591",
1420
+ block: "\u2588",
1421
+ srect: "\u25AD",
1422
+ rect: "\u25AD",
1423
+ sdot: "\u22C5",
1424
+ sdotb: "\u22A1",
1425
+ dotsquare: "\u22A1",
1426
+ triangle: "\u25B5",
1427
+ tri: "\u25B5",
1428
+ trine: "\u25B5",
1429
+ utri: "\u25B5",
1430
+ triangledown: "\u25BF",
1431
+ dtri: "\u25BF",
1432
+ tridown: "\u25BF",
1433
+ triangleleft: "\u25C3",
1434
+ ltri: "\u25C3",
1435
+ triangleright: "\u25B9",
1436
+ rtri: "\u25B9",
1437
+ blacktriangle: "\u25B4",
1438
+ utrif: "\u25B4",
1439
+ blacktriangledown: "\u25BE",
1440
+ dtrif: "\u25BE",
1441
+ blacktriangleleft: "\u25C2",
1442
+ ltrif: "\u25C2",
1443
+ blacktriangleright: "\u25B8",
1444
+ rtrif: "\u25B8",
1445
+ loz: "\u25CA",
1446
+ lozenge: "\u25CA",
1447
+ blacklozenge: "\u29EB",
1448
+ lozf: "\u29EB",
1449
+ bigcirc: "\u25EF",
1450
+ xcirc: "\u25EF",
1451
+ circ: "\u02C6",
1452
+ Circle: "\u25CB",
1453
+ cir: "\u25CB",
1454
+ o: "\u25CB",
1455
+ bullet: "\u2022",
1456
+ bull: "\u2022",
1457
+ hellip: "\u2026",
1458
+ mldr: "\u2026",
1459
+ nldr: "\u2025",
1460
+ boxh: "\u2500",
1461
+ HorizontalLine: "\u2500",
1462
+ boxv: "\u2502",
1463
+ boxdr: "\u250C",
1464
+ boxdl: "\u2510",
1465
+ boxur: "\u2514",
1466
+ boxul: "\u2518",
1467
+ boxvr: "\u251C",
1468
+ boxvl: "\u2524",
1469
+ boxhd: "\u252C",
1470
+ boxhu: "\u2534",
1471
+ boxvh: "\u253C",
1472
+ boxH: "\u2550",
1473
+ boxV: "\u2551",
1474
+ boxdR: "\u2552",
1475
+ boxDr: "\u2553",
1476
+ boxDR: "\u2554",
1477
+ boxDl: "\u2555",
1478
+ boxdL: "\u2556",
1479
+ boxDL: "\u2557",
1480
+ boxuR: "\u2558",
1481
+ boxUr: "\u2559",
1482
+ boxUR: "\u255A",
1483
+ boxUl: "\u255C",
1484
+ boxuL: "\u255B",
1485
+ boxUL: "\u255D",
1486
+ boxvR: "\u255E",
1487
+ boxVr: "\u255F",
1488
+ boxVR: "\u2560",
1489
+ boxVl: "\u2562",
1490
+ boxvL: "\u2561",
1491
+ boxVL: "\u2563",
1492
+ boxHd: "\u2564",
1493
+ boxhD: "\u2565",
1494
+ boxHD: "\u2566",
1495
+ boxHu: "\u2567",
1496
+ boxhU: "\u2568",
1497
+ boxHU: "\u2569",
1498
+ boxvH: "\u256A",
1499
+ boxVh: "\u256B",
1500
+ boxVH: "\u256C"
1501
+ };
1502
+ var PUNCTUATION = {
1503
+ excl: "!",
1504
+ iexcl: "\xA1",
1505
+ brvbar: "\xA6",
1506
+ sect: "\xA7",
1507
+ uml: "\xA8",
1508
+ copy: "\xA9",
1509
+ ordf: "\xAA",
1510
+ laquo: "\xAB",
1511
+ not: "\xAC",
1512
+ shy: "\xAD",
1513
+ reg: "\xAE",
1514
+ macr: "\xAF",
1515
+ deg: "\xB0",
1516
+ plusmn: "\xB1",
1517
+ sup2: "\xB2",
1518
+ sup3: "\xB3",
1519
+ acute: "\xB4",
1520
+ micro: "\xB5",
1521
+ para: "\xB6",
1522
+ middot: "\xB7",
1523
+ cedil: "\xB8",
1524
+ sup1: "\xB9",
1525
+ ordm: "\xBA",
1526
+ raquo: "\xBB",
1527
+ frac14: "\xBC",
1528
+ frac12: "\xBD",
1529
+ frac34: "\xBE",
1530
+ iquest: "\xBF",
1531
+ nbsp: "\xA0",
1532
+ comma: ",",
1533
+ period: ".",
1534
+ colon: ":",
1535
+ semi: ";",
1536
+ vert: "|",
1537
+ Verbar: "\u2016",
1538
+ verbar: "|",
1539
+ dblac: "\u02DD",
1540
+ circ: "\u02C6",
1541
+ caron: "\u02C7",
1542
+ breve: "\u02D8",
1543
+ dot: "\u02D9",
1544
+ ring: "\u02DA",
1545
+ ogon: "\u02DB",
1546
+ tilde: "\u02DC",
1547
+ DiacriticalGrave: "`",
1548
+ DiacriticalAcute: "\xB4",
1549
+ DiacriticalTilde: "\u02DC",
1550
+ DiacriticalDot: "\u02D9",
1551
+ DiacriticalDoubleAcute: "\u02DD",
1552
+ grave: "`",
1553
+ acute: "\xB4"
1554
+ };
1555
+ var CURRENCY = {
1556
+ cent: "\xA2",
1557
+ pound: "\xA3",
1558
+ curren: "\xA4",
1559
+ yen: "\xA5",
1560
+ euro: "\u20AC",
1561
+ dollar: "$",
1562
+ euro: "\u20AC",
1563
+ fnof: "\u0192",
1564
+ inr: "\u20B9",
1565
+ af: "\u060B",
1566
+ birr: "\u1265\u122D",
1567
+ peso: "\u20B1",
1568
+ rub: "\u20BD",
1569
+ won: "\u20A9",
1570
+ yuan: "\xA5",
1571
+ cedil: "\xB8"
1572
+ };
1573
+ var FRACTIONS = {
1574
+ frac12: "\xBD",
1575
+ half: "\xBD",
1576
+ frac13: "\u2153",
1577
+ frac14: "\xBC",
1578
+ frac15: "\u2155",
1579
+ frac16: "\u2159",
1580
+ frac18: "\u215B",
1581
+ frac23: "\u2154",
1582
+ frac25: "\u2156",
1583
+ frac34: "\xBE",
1584
+ frac35: "\u2157",
1585
+ frac38: "\u215C",
1586
+ frac45: "\u2158",
1587
+ frac56: "\u215A",
1588
+ frac58: "\u215D",
1589
+ frac78: "\u215E",
1590
+ frasl: "\u2044"
1591
+ };
1592
+ var MISC_SYMBOLS = {
1593
+ trade: "\u2122",
1594
+ TRADE: "\u2122",
1595
+ telrec: "\u2315",
1596
+ target: "\u2316",
1597
+ ulcorn: "\u231C",
1598
+ ulcorner: "\u231C",
1599
+ urcorn: "\u231D",
1600
+ urcorner: "\u231D",
1601
+ dlcorn: "\u231E",
1602
+ llcorner: "\u231E",
1603
+ drcorn: "\u231F",
1604
+ lrcorner: "\u231F",
1605
+ intercal: "\u22BA",
1606
+ intcal: "\u22BA",
1607
+ oplus: "\u2295",
1608
+ CirclePlus: "\u2295",
1609
+ ominus: "\u2296",
1610
+ CircleMinus: "\u2296",
1611
+ otimes: "\u2297",
1612
+ CircleTimes: "\u2297",
1613
+ osol: "\u2298",
1614
+ odot: "\u2299",
1615
+ CircleDot: "\u2299",
1616
+ oast: "\u229B",
1617
+ circledast: "\u229B",
1618
+ odash: "\u229D",
1619
+ circleddash: "\u229D",
1620
+ ocirc: "\u229A",
1621
+ circledcirc: "\u229A",
1622
+ boxplus: "\u229E",
1623
+ plusb: "\u229E",
1624
+ boxminus: "\u229F",
1625
+ minusb: "\u229F",
1626
+ boxtimes: "\u22A0",
1627
+ timesb: "\u22A0",
1628
+ boxdot: "\u22A1",
1629
+ sdotb: "\u22A1",
1630
+ veebar: "\u22BB",
1631
+ vee: "\u2228",
1632
+ barvee: "\u22BD",
1633
+ and: "\u2227",
1634
+ wedge: "\u2227",
1635
+ Cap: "\u22D2",
1636
+ Cup: "\u22D3",
1637
+ Fork: "\u22D4",
1638
+ pitchfork: "\u22D4",
1639
+ epar: "\u22D5",
1640
+ ltlarr: "\u2976",
1641
+ nvap: "\u224D\u20D2",
1642
+ nvsim: "\u223C\u20D2",
1643
+ nvge: "\u2265\u20D2",
1644
+ nvle: "\u2264\u20D2",
1645
+ nvlt: "<\u20D2",
1646
+ nvgt: ">\u20D2",
1647
+ nvltrie: "\u22B4\u20D2",
1648
+ nvrtrie: "\u22B5\u20D2",
1649
+ Vdash: "\u22A9",
1650
+ dashv: "\u22A3",
1651
+ vDash: "\u22A8",
1652
+ Vdash: "\u22A9",
1653
+ Vvdash: "\u22AA",
1654
+ nvdash: "\u22AC",
1655
+ nvDash: "\u22AD",
1656
+ nVdash: "\u22AE",
1657
+ nVDash: "\u22AF"
1658
+ };
1659
+ var ALL_ENTITIES = {
1660
+ ...BASIC_LATIN,
1661
+ ...LATIN_ACCENTS,
1662
+ ...LATIN_EXTENDED,
1663
+ ...GREEK,
1664
+ ...CYRILLIC,
1665
+ ...MATH,
1666
+ ...MATH_ADVANCED,
1667
+ ...ARROWS,
1668
+ ...SHAPES,
1669
+ ...PUNCTUATION,
1670
+ ...CURRENCY,
1671
+ ...FRACTIONS,
1672
+ ...MISC_SYMBOLS
1673
+ };
1674
+ var XML = {
1675
+ amp: "&",
1676
+ apos: "'",
1677
+ gt: ">",
1678
+ lt: "<",
1679
+ quot: '"'
1680
+ };
1681
+ var COMMON_HTML = {
1682
+ nbsp: "\xA0",
1683
+ copy: "\xA9",
1684
+ reg: "\xAE",
1685
+ trade: "\u2122",
1686
+ mdash: "\u2014",
1687
+ ndash: "\u2013",
1688
+ hellip: "\u2026",
1689
+ laquo: "\xAB",
1690
+ raquo: "\xBB",
1691
+ lsquo: "\u2018",
1692
+ rsquo: "\u2019",
1693
+ ldquo: "\u201C",
1694
+ rdquo: "\u201D",
1695
+ bull: "\u2022",
1696
+ para: "\xB6",
1697
+ sect: "\xA7",
1698
+ deg: "\xB0",
1699
+ frac12: "\xBD",
1700
+ frac14: "\xBC",
1701
+ frac34: "\xBE"
1702
+ };
1703
+
1704
+ // ../node_modules/.bun/@nodable+entities@2.1.0/node_modules/@nodable/entities/src/EntityDecoder.js
1705
+ var SPECIAL_CHARS = new Set("!?\\\\/[]$%{}^&*()<>|+");
1706
+ function validateEntityName(name) {
1707
+ if (name[0] === "#") {
1708
+ throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
1709
+ }
1710
+ for (const ch of name) {
1711
+ if (SPECIAL_CHARS.has(ch)) {
1712
+ throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
1713
+ }
1714
+ }
1715
+ return name;
1716
+ }
1717
+ function mergeEntityMaps(...maps) {
1718
+ const out = /* @__PURE__ */ Object.create(null);
1719
+ for (const map of maps) {
1720
+ if (!map) continue;
1721
+ for (const key of Object.keys(map)) {
1722
+ const raw = map[key];
1723
+ if (typeof raw === "string") {
1724
+ out[key] = raw;
1725
+ } else if (raw && typeof raw === "object" && raw.val !== void 0) {
1726
+ const val = raw.val;
1727
+ if (typeof val === "string") {
1728
+ out[key] = val;
1729
+ }
1730
+ }
1731
+ }
1732
+ }
1733
+ return out;
1734
+ }
1735
+ var LIMIT_TIER_EXTERNAL = "external";
1736
+ var LIMIT_TIER_BASE = "base";
1737
+ var LIMIT_TIER_ALL = "all";
1738
+ function parseLimitTiers(raw) {
1739
+ if (!raw || raw === LIMIT_TIER_EXTERNAL) return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]);
1740
+ if (raw === LIMIT_TIER_ALL) return /* @__PURE__ */ new Set([LIMIT_TIER_ALL]);
1741
+ if (raw === LIMIT_TIER_BASE) return /* @__PURE__ */ new Set([LIMIT_TIER_BASE]);
1742
+ if (Array.isArray(raw)) return new Set(raw);
1743
+ return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]);
1744
+ }
1745
+ var NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });
1746
+ var XML10_ALLOWED_C0 = /* @__PURE__ */ new Set([9, 10, 13]);
1747
+ function parseNCRConfig(ncr) {
1748
+ if (!ncr) {
1749
+ return { xmlVersion: 1, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove };
1750
+ }
1751
+ const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1;
1752
+ const onLevel = NCR_LEVEL[ncr.onNCR] ?? NCR_LEVEL.allow;
1753
+ const nullLevel = NCR_LEVEL[ncr.nullNCR] ?? NCR_LEVEL.remove;
1754
+ const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove);
1755
+ return { xmlVersion, onLevel, nullLevel: clampedNull };
1756
+ }
1757
+ var EntityDecoder = class {
1758
+ /**
1759
+ * @param {object} [options]
1760
+ * @param {object|null} [options.namedEntities] — extra named entities merged into base map
1761
+ * @param {object} [options.limit] — security limits
1762
+ * @param {number} [options.limit.maxTotalExpansions=0] — 0 = unlimited
1763
+ * @param {number} [options.limit.maxExpandedLength=0] — 0 = unlimited
1764
+ * @param {'external'|'base'|'all'|string[]} [options.limit.applyLimitsTo='external']
1765
+ * Which entity tiers count against the security limits:
1766
+ * - 'external' (default) — only input/runtime + persistent external entities
1767
+ * - 'base' — only DEFAULT_XML_ENTITIES + namedEntities
1768
+ * - 'all' — every entity regardless of tier
1769
+ * - string[] — explicit combination, e.g. ['external', 'base']
1770
+ * @param {((resolved: string, original: string) => string)|null} [options.postCheck=null]
1771
+ * @param {string[]} [options.remove=[]] — entity names (e.g. ['nbsp', '#13']) to delete (replace with empty string)
1772
+ * @param {string[]} [options.leave=[]] — entity names to keep as literal (unchanged in output)
1773
+ * @param {object} [options.ncr] — Numeric Character Reference controls
1774
+ * @param {1.0|1.1} [options.ncr.xmlVersion=1.0]
1775
+ * XML version governing which codepoint ranges are restricted:
1776
+ * - 1.0 — C0 controls U+0001–U+001F (except U+0009/000A/000D) are prohibited
1777
+ * - 1.1 — C0 controls are allowed when written as NCRs; C1 (U+007F–U+009F) decoded as-is
1778
+ * @param {'allow'|'leave'|'remove'|'throw'} [options.ncr.onNCR='allow']
1779
+ * Base action for numeric references. Severity order: allow < leave < remove < throw.
1780
+ * For codepoint ranges that carry a minimum level (surrogates → remove, XML 1.0 C0 → remove),
1781
+ * the effective action is max(onNCR, rangeMinimum).
1782
+ * @param {'remove'|'throw'} [options.ncr.nullNCR='remove']
1783
+ * Action for U+0000 (null). 'allow' and 'leave' are clamped to 'remove' since null is never safe.
1784
+ */
1785
+ constructor(options = {}) {
1786
+ this._limit = options.limit || {};
1787
+ this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
1788
+ this._maxExpandedLength = this._limit.maxExpandedLength || 0;
1789
+ this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r2) => r2;
1790
+ this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL);
1791
+ this._numericAllowed = options.numericAllowed ?? true;
1792
+ this._baseMap = mergeEntityMaps(XML, options.namedEntities || null);
1793
+ this._externalMap = /* @__PURE__ */ Object.create(null);
1794
+ this._inputMap = /* @__PURE__ */ Object.create(null);
1795
+ this._totalExpansions = 0;
1796
+ this._expandedLength = 0;
1797
+ this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
1798
+ this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
1799
+ const ncrCfg = parseNCRConfig(options.ncr);
1800
+ this._ncrXmlVersion = ncrCfg.xmlVersion;
1801
+ this._ncrOnLevel = ncrCfg.onLevel;
1802
+ this._ncrNullLevel = ncrCfg.nullLevel;
1803
+ }
1804
+ // -------------------------------------------------------------------------
1805
+ // Persistent external entity registration
1806
+ // -------------------------------------------------------------------------
1807
+ /**
1808
+ * Replace the full set of persistent external entities.
1809
+ * All keys are validated — throws on invalid characters.
1810
+ * @param {Record<string, string | { regex?: RegExp, val: string }>} map
1811
+ */
1812
+ setExternalEntities(map) {
1813
+ if (map) {
1814
+ for (const key of Object.keys(map)) {
1815
+ validateEntityName(key);
1816
+ }
1817
+ }
1818
+ this._externalMap = mergeEntityMaps(map);
1819
+ }
1820
+ /**
1821
+ * Add a single persistent external entity.
1822
+ * @param {string} key
1823
+ * @param {string} value
1824
+ */
1825
+ addExternalEntity(key, value) {
1826
+ validateEntityName(key);
1827
+ if (typeof value === "string" && value.indexOf("&") === -1) {
1828
+ this._externalMap[key] = value;
1829
+ }
1830
+ }
1831
+ // -------------------------------------------------------------------------
1832
+ // Input / runtime entity registration (per document)
1833
+ // -------------------------------------------------------------------------
1834
+ /**
1835
+ * Inject DOCTYPE entities for the current document.
1836
+ * Also resets per-document expansion counters.
1837
+ * @param {Record<string, string | { regx?: RegExp, regex?: RegExp, val: string }>} map
1838
+ */
1839
+ addInputEntities(map) {
1840
+ this._totalExpansions = 0;
1841
+ this._expandedLength = 0;
1842
+ this._inputMap = mergeEntityMaps(map);
1843
+ }
1844
+ // -------------------------------------------------------------------------
1845
+ // Per-document reset
1846
+ // -------------------------------------------------------------------------
1847
+ /**
1848
+ * Wipe input/runtime entities and reset counters.
1849
+ * Call this before processing each new document.
1850
+ * @returns {this}
1851
+ */
1852
+ reset() {
1853
+ this._inputMap = /* @__PURE__ */ Object.create(null);
1854
+ this._totalExpansions = 0;
1855
+ this._expandedLength = 0;
1856
+ return this;
1857
+ }
1858
+ // -------------------------------------------------------------------------
1859
+ // XML version (can be set after construction, e.g. once parser reads <?xml?>)
1860
+ // -------------------------------------------------------------------------
1861
+ /**
1862
+ * Update the XML version used for NCR classification.
1863
+ * Call this as soon as the document's `<?xml version="...">` declaration is parsed.
1864
+ * @param {1.0|1.1|number} version
1865
+ */
1866
+ setXmlVersion(version) {
1867
+ this._ncrXmlVersion = version === 1.1 ? 1.1 : 1;
1868
+ }
1869
+ // -------------------------------------------------------------------------
1870
+ // Primary API
1871
+ // -------------------------------------------------------------------------
1872
+ /**
1873
+ * Replace all entity references in `str` in a single pass.
1874
+ *
1875
+ * @param {string} str
1876
+ * @returns {string}
1877
+ */
1878
+ decode(str) {
1879
+ if (typeof str !== "string" || str.length === 0) return str;
1880
+ const original = str;
1881
+ const chunks = [];
1882
+ const len = str.length;
1883
+ let last = 0;
1884
+ let i2 = 0;
1885
+ const limitExpansions = this._maxTotalExpansions > 0;
1886
+ const limitLength = this._maxExpandedLength > 0;
1887
+ const checkLimits = limitExpansions || limitLength;
1888
+ while (i2 < len) {
1889
+ if (str.charCodeAt(i2) !== 38) {
1890
+ i2++;
1891
+ continue;
1892
+ }
1893
+ let j2 = i2 + 1;
1894
+ while (j2 < len && str.charCodeAt(j2) !== 59 && j2 - i2 <= 32) j2++;
1895
+ if (j2 >= len || str.charCodeAt(j2) !== 59) {
1896
+ i2++;
1897
+ continue;
1898
+ }
1899
+ const token = str.slice(i2 + 1, j2);
1900
+ if (token.length === 0) {
1901
+ i2++;
1902
+ continue;
1903
+ }
1904
+ let replacement;
1905
+ let tier;
1906
+ if (this._removeSet.has(token)) {
1907
+ replacement = "";
1908
+ if (tier === void 0) {
1909
+ tier = LIMIT_TIER_EXTERNAL;
1910
+ }
1911
+ } else if (this._leaveSet.has(token)) {
1912
+ i2++;
1913
+ continue;
1914
+ } else if (token.charCodeAt(0) === 35) {
1915
+ const ncrResult = this._resolveNCR(token);
1916
+ if (ncrResult === void 0) {
1917
+ i2++;
1918
+ continue;
1919
+ }
1920
+ replacement = ncrResult;
1921
+ tier = LIMIT_TIER_BASE;
1922
+ } else {
1923
+ const resolved = this._resolveName(token);
1924
+ replacement = resolved?.value;
1925
+ tier = resolved?.tier;
1926
+ }
1927
+ if (replacement === void 0) {
1928
+ i2++;
1929
+ continue;
1930
+ }
1931
+ if (i2 > last) chunks.push(str.slice(last, i2));
1932
+ chunks.push(replacement);
1933
+ last = j2 + 1;
1934
+ i2 = last;
1935
+ if (checkLimits && this._tierCounts(tier)) {
1936
+ if (limitExpansions) {
1937
+ this._totalExpansions++;
1938
+ if (this._totalExpansions > this._maxTotalExpansions) {
1939
+ throw new Error(
1940
+ `[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`
1941
+ );
1942
+ }
1943
+ }
1944
+ if (limitLength) {
1945
+ const delta = replacement.length - (token.length + 2);
1946
+ if (delta > 0) {
1947
+ this._expandedLength += delta;
1948
+ if (this._expandedLength > this._maxExpandedLength) {
1949
+ throw new Error(
1950
+ `[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`
1951
+ );
1952
+ }
1953
+ }
1954
+ }
1955
+ }
1956
+ }
1957
+ if (last < len) chunks.push(str.slice(last));
1958
+ const result = chunks.length === 0 ? str : chunks.join("");
1959
+ return this._postCheck(result, original);
1960
+ }
1961
+ // -------------------------------------------------------------------------
1962
+ // Private: limit tier check
1963
+ // -------------------------------------------------------------------------
1964
+ /**
1965
+ * Returns true if a resolved entity of the given tier should count
1966
+ * against the expansion/length limits.
1967
+ * @param {string} tier — LIMIT_TIER_EXTERNAL | LIMIT_TIER_BASE
1968
+ * @returns {boolean}
1969
+ */
1970
+ _tierCounts(tier) {
1971
+ if (this._limitTiers.has(LIMIT_TIER_ALL)) return true;
1972
+ return this._limitTiers.has(tier);
1973
+ }
1974
+ // -------------------------------------------------------------------------
1975
+ // Private: entity resolution
1976
+ // -------------------------------------------------------------------------
1977
+ /**
1978
+ * Resolve a named entity token (without & and ;).
1979
+ * Priority: inputMap > externalMap > baseMap
1980
+ * Returns the resolved value tagged with its limit tier.
1981
+ *
1982
+ * @param {string} name
1983
+ * @returns {{ value: string, tier: string }|undefined}
1984
+ */
1985
+ _resolveName(name) {
1986
+ if (name in this._inputMap) return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL };
1987
+ if (name in this._externalMap) return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL };
1988
+ if (name in this._baseMap) return { value: this._baseMap[name], tier: LIMIT_TIER_BASE };
1989
+ return void 0;
1990
+ }
1991
+ /**
1992
+ * Classify a codepoint and return the minimum action level that must be applied.
1993
+ * Returns -1 when no minimum is imposed (normal allow path).
1994
+ *
1995
+ * Ranges checked (in priority order):
1996
+ * 1. U+0000 — null, governed by nullNCR (always ≥ remove)
1997
+ * 2. U+D800–U+DFFF — surrogates, always prohibited (min: remove)
1998
+ * 3. U+0001–U+001F \ {0x09,0x0A,0x0D} — XML 1.0 restricted C0 (min: remove)
1999
+ * (skipped in XML 1.1 — C0 controls are allowed when written as NCRs)
2000
+ *
2001
+ * @param {number} cp — codepoint
2002
+ * @returns {number} — minimum NCR_LEVEL value, or -1 for no restriction
2003
+ */
2004
+ _classifyNCR(cp) {
2005
+ if (cp === 0) return this._ncrNullLevel;
2006
+ if (cp >= 55296 && cp <= 57343) return NCR_LEVEL.remove;
2007
+ if (this._ncrXmlVersion === 1) {
2008
+ if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C0.has(cp)) return NCR_LEVEL.remove;
2009
+ }
2010
+ return -1;
2011
+ }
2012
+ /**
2013
+ * Execute a resolved NCR action.
2014
+ *
2015
+ * @param {number} action — NCR_LEVEL value
2016
+ * @param {string} token — raw token (e.g. '#38') for error messages
2017
+ * @param {number} cp — codepoint, used only for error messages
2018
+ * @returns {string|undefined}
2019
+ * - decoded character string → 'allow'
2020
+ * - '' → 'remove'
2021
+ * - undefined → 'leave' (caller must skip past '&' only)
2022
+ * - throws Error → 'throw'
2023
+ */
2024
+ _applyNCRAction(action, token, cp) {
2025
+ switch (action) {
2026
+ case NCR_LEVEL.allow:
2027
+ return String.fromCodePoint(cp);
2028
+ case NCR_LEVEL.remove:
2029
+ return "";
2030
+ case NCR_LEVEL.leave:
2031
+ return void 0;
2032
+ // signal: keep literal
2033
+ case NCR_LEVEL.throw:
2034
+ throw new Error(
2035
+ `[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`
2036
+ );
2037
+ default:
2038
+ return String.fromCodePoint(cp);
2039
+ }
2040
+ }
2041
+ /**
2042
+ * Full NCR resolution pipeline for a numeric token.
2043
+ *
2044
+ * Steps:
2045
+ * 1. Parse the codepoint (decimal or hex).
2046
+ * 2. Validate the raw codepoint range (NaN, <0, >0x10FFFF).
2047
+ * 3. If numericAllowed is false and no minimum restriction applies → leave as-is.
2048
+ * 4. Classify the codepoint to find the minimum required action level.
2049
+ * 5. Resolve effective action = max(onNCR, minimum).
2050
+ * 6. Apply and return.
2051
+ *
2052
+ * @param {string} token — e.g. '#38', '#x26', '#X26'
2053
+ * @returns {string|undefined}
2054
+ * - string (incl. '') — replacement ('' = remove)
2055
+ * - undefined — leave original &token; as-is
2056
+ */
2057
+ _resolveNCR(token) {
2058
+ const second = token.charCodeAt(1);
2059
+ let cp;
2060
+ if (second === 120 || second === 88) {
2061
+ cp = parseInt(token.slice(2), 16);
2062
+ } else {
2063
+ cp = parseInt(token.slice(1), 10);
2064
+ }
2065
+ if (Number.isNaN(cp) || cp < 0 || cp > 1114111) return void 0;
2066
+ const minimum = this._classifyNCR(cp);
2067
+ if (!this._numericAllowed && minimum < NCR_LEVEL.remove) return void 0;
2068
+ const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
2069
+ return this._applyNCRAction(effective, token, cp);
2070
+ }
2071
+ };
2072
+
2073
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
621
2074
  var defaultOnDangerousProperty = (name) => {
622
2075
  if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
623
2076
  return "__" + name;
@@ -659,6 +2112,7 @@ var defaultOptions2 = {
659
2112
  unpairedTags: [],
660
2113
  processEntities: true,
661
2114
  htmlEntities: false,
2115
+ entityDecoder: null,
662
2116
  ignoreDeclaration: false,
663
2117
  ignorePiTags: false,
664
2118
  transformTagName: false,
@@ -690,30 +2144,32 @@ function validatePropertyName(propertyName, optionName) {
690
2144
  );
691
2145
  }
692
2146
  }
693
- function normalizeProcessEntities(value) {
2147
+ function normalizeProcessEntities(value, htmlEntities) {
694
2148
  if (typeof value === "boolean") {
695
2149
  return {
696
2150
  enabled: value,
697
2151
  // true or false
698
2152
  maxEntitySize: 1e4,
699
- maxExpansionDepth: 10,
700
- maxTotalExpansions: 1e3,
2153
+ maxExpansionDepth: 1e4,
2154
+ maxTotalExpansions: Infinity,
701
2155
  maxExpandedLength: 1e5,
702
- maxEntityCount: 100,
2156
+ maxEntityCount: 1e3,
703
2157
  allowedTags: null,
704
- tagFilter: null
2158
+ tagFilter: null,
2159
+ appliesTo: "all"
705
2160
  };
706
2161
  }
707
2162
  if (typeof value === "object" && value !== null) {
708
2163
  return {
709
2164
  enabled: value.enabled !== false,
710
2165
  maxEntitySize: Math.max(1, value.maxEntitySize ?? 1e4),
711
- maxExpansionDepth: Math.max(1, value.maxExpansionDepth ?? 10),
712
- maxTotalExpansions: Math.max(1, value.maxTotalExpansions ?? 1e3),
2166
+ maxExpansionDepth: Math.max(1, value.maxExpansionDepth ?? 1e4),
2167
+ maxTotalExpansions: Math.max(1, value.maxTotalExpansions ?? Infinity),
713
2168
  maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 1e5),
714
- maxEntityCount: Math.max(1, value.maxEntityCount ?? 100),
2169
+ maxEntityCount: Math.max(1, value.maxEntityCount ?? 1e3),
715
2170
  allowedTags: value.allowedTags ?? null,
716
- tagFilter: value.tagFilter ?? null
2171
+ tagFilter: value.tagFilter ?? null,
2172
+ appliesTo: value.appliesTo ?? "all"
717
2173
  };
718
2174
  }
719
2175
  return normalizeProcessEntities(true);
@@ -735,7 +2191,8 @@ var buildOptions = function(options) {
735
2191
  if (built.onDangerousProperty === null) {
736
2192
  built.onDangerousProperty = defaultOnDangerousProperty;
737
2193
  }
738
- built.processEntities = normalizeProcessEntities(built.processEntities);
2194
+ built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities);
2195
+ built.unpairedTagsSet = new Set(built.unpairedTags);
739
2196
  if (built.stopNodes && Array.isArray(built.stopNodes)) {
740
2197
  built.stopNodes = built.stopNodes.map((node) => {
741
2198
  if (typeof node === "string" && node.startsWith("*.")) {
@@ -747,7 +2204,7 @@ var buildOptions = function(options) {
747
2204
  return built;
748
2205
  };
749
2206
 
750
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
2207
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
751
2208
  var METADATA_SYMBOL;
752
2209
  if (typeof Symbol !== "function") {
753
2210
  METADATA_SYMBOL = "@@xmlMetadata";
@@ -781,7 +2238,7 @@ var XmlNode = class {
781
2238
  }
782
2239
  };
783
2240
 
784
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
2241
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
785
2242
  var DocTypeReader = class {
786
2243
  constructor(options) {
787
2244
  this.suppressValidationErr = !options;
@@ -807,11 +2264,7 @@ var DocTypeReader = class {
807
2264
  `Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`
808
2265
  );
809
2266
  }
810
- const escaped = entityName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
811
- entities[entityName] = {
812
- regx: RegExp(`&${escaped};`, "g"),
813
- val
814
- };
2267
+ entities[entityName] = val;
815
2268
  entityCount++;
816
2269
  }
817
2270
  } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i2)) {
@@ -861,7 +2314,7 @@ var DocTypeReader = class {
861
2314
  i2++;
862
2315
  }
863
2316
  let entityName = xmlData.substring(startIndex, i2);
864
- validateEntityName(entityName);
2317
+ validateEntityName2(entityName);
865
2318
  i2 = skipWhitespace(xmlData, i2);
866
2319
  if (!this.suppressValidationErr) {
867
2320
  if (xmlData.substring(i2, i2 + 6).toUpperCase() === "SYSTEM") {
@@ -887,7 +2340,7 @@ var DocTypeReader = class {
887
2340
  i2++;
888
2341
  }
889
2342
  let notationName = xmlData.substring(startIndex, i2);
890
- !this.suppressValidationErr && validateEntityName(notationName);
2343
+ !this.suppressValidationErr && validateEntityName2(notationName);
891
2344
  i2 = skipWhitespace(xmlData, i2);
892
2345
  const identifierType = xmlData.substring(i2, i2 + 6).toUpperCase();
893
2346
  if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") {
@@ -969,14 +2422,14 @@ var DocTypeReader = class {
969
2422
  i2++;
970
2423
  }
971
2424
  let elementName = xmlData.substring(startIndex, i2);
972
- validateEntityName(elementName);
2425
+ validateEntityName2(elementName);
973
2426
  i2 = skipWhitespace(xmlData, i2);
974
2427
  startIndex = i2;
975
2428
  while (i2 < xmlData.length && !/\s/.test(xmlData[i2])) {
976
2429
  i2++;
977
2430
  }
978
2431
  let attributeName = xmlData.substring(startIndex, i2);
979
- if (!validateEntityName(attributeName)) {
2432
+ if (!validateEntityName2(attributeName)) {
980
2433
  throw new Error(`Invalid attribute name: "${attributeName}"`);
981
2434
  }
982
2435
  i2 = skipWhitespace(xmlData, i2);
@@ -997,7 +2450,7 @@ var DocTypeReader = class {
997
2450
  }
998
2451
  let notation = xmlData.substring(startIndex2, i2);
999
2452
  notation = notation.trim();
1000
- if (!validateEntityName(notation)) {
2453
+ if (!validateEntityName2(notation)) {
1001
2454
  throw new Error(`Invalid notation name: "${notation}"`);
1002
2455
  }
1003
2456
  allowedNotations.push(notation);
@@ -1054,19 +2507,22 @@ function hasSeq(data, seq, i2) {
1054
2507
  }
1055
2508
  return true;
1056
2509
  }
1057
- function validateEntityName(name) {
2510
+ function validateEntityName2(name) {
1058
2511
  if (isName(name))
1059
2512
  return name;
1060
2513
  else
1061
2514
  throw new Error(`Invalid entity name ${name}`);
1062
2515
  }
1063
2516
 
1064
- // ../node_modules/.bun/strnum@2.2.2/node_modules/strnum/strnum.js
2517
+ // ../node_modules/.bun/strnum@2.3.0/node_modules/strnum/strnum.js
1065
2518
  var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
2519
+ var binRegex = /^0b[01]+$/;
2520
+ var octRegex = /^0o[0-7]+$/;
1066
2521
  var numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
1067
2522
  var consider = {
1068
2523
  hex: true,
1069
- // oct: false,
2524
+ binary: false,
2525
+ octal: false,
1070
2526
  leadingZeros: true,
1071
2527
  decimalPoint: ".",
1072
2528
  eNotation: true,
@@ -1083,6 +2539,10 @@ function toNumber(str, options = {}) {
1083
2539
  else if (trimmedStr === "0") return 0;
1084
2540
  else if (options.hex && hexRegex.test(trimmedStr)) {
1085
2541
  return parse_int(trimmedStr, 16);
2542
+ } else if (options.binary && binRegex.test(trimmedStr)) {
2543
+ return parse_int(trimmedStr, 2);
2544
+ } else if (options.octal && octRegex.test(trimmedStr)) {
2545
+ return parse_int(trimmedStr, 8);
1086
2546
  } else if (!isFinite(trimmedStr)) {
1087
2547
  return handleInfinity(str, Number(trimmedStr), options);
1088
2548
  } else if (trimmedStr.includes("e") || trimmedStr.includes("E")) {
@@ -1162,6 +2622,8 @@ function trimZeros(numStr) {
1162
2622
  return numStr;
1163
2623
  }
1164
2624
  function parse_int(numStr, base) {
2625
+ const str = numStr.trim();
2626
+ if (base === 2 || base === 8) numStr = str.substring(2);
1165
2627
  if (parseInt) return parseInt(numStr, base);
1166
2628
  else if (Number.parseInt) return Number.parseInt(numStr, base);
1167
2629
  else if (window && window.parseInt) return window.parseInt(numStr, base);
@@ -1183,7 +2645,7 @@ function handleInfinity(str, num, options) {
1183
2645
  }
1184
2646
  }
1185
2647
 
1186
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/ignoreAttributes.js
2648
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/ignoreAttributes.js
1187
2649
  function getIgnoreAttributesFn(ignoreAttributes) {
1188
2650
  if (typeof ignoreAttributes === "function") {
1189
2651
  return ignoreAttributes;
@@ -1203,7 +2665,7 @@ function getIgnoreAttributesFn(ignoreAttributes) {
1203
2665
  return () => false;
1204
2666
  }
1205
2667
 
1206
- // ../node_modules/.bun/path-expression-matcher@1.2.1/node_modules/path-expression-matcher/src/Expression.js
2668
+ // ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/Expression.js
1207
2669
  var Expression = class {
1208
2670
  /**
1209
2671
  * Create a new Expression
@@ -1211,10 +2673,11 @@ var Expression = class {
1211
2673
  * @param {Object} options - Configuration options
1212
2674
  * @param {string} options.separator - Path separator (default: '.')
1213
2675
  */
1214
- constructor(pattern, options = {}) {
2676
+ constructor(pattern, options = {}, data) {
1215
2677
  this.pattern = pattern;
1216
2678
  this.separator = options.separator || ".";
1217
2679
  this.segments = this._parse(pattern);
2680
+ this.data = data;
1218
2681
  this._hasDeepWildcard = this.segments.some((seg) => seg.type === "deep-wildcard");
1219
2682
  this._hasAttributeCondition = this.segments.some((seg) => seg.attrName !== void 0);
1220
2683
  this._hasPositionSelector = this.segments.some((seg) => seg.position !== void 0);
@@ -1365,30 +2828,302 @@ var Expression = class {
1365
2828
  }
1366
2829
  };
1367
2830
 
1368
- // ../node_modules/.bun/path-expression-matcher@1.2.1/node_modules/path-expression-matcher/src/Matcher.js
1369
- var MUTATING_METHODS = /* @__PURE__ */ new Set(["push", "pop", "reset", "updateCurrent", "restore"]);
2831
+ // ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/ExpressionSet.js
2832
+ var ExpressionSet = class {
2833
+ constructor() {
2834
+ this._byDepthAndTag = /* @__PURE__ */ new Map();
2835
+ this._wildcardByDepth = /* @__PURE__ */ new Map();
2836
+ this._deepWildcards = [];
2837
+ this._patterns = /* @__PURE__ */ new Set();
2838
+ this._sealed = false;
2839
+ }
2840
+ /**
2841
+ * Add an Expression to the set.
2842
+ * Duplicate patterns (same pattern string) are silently ignored.
2843
+ *
2844
+ * @param {import('./Expression.js').default} expression - A pre-constructed Expression instance
2845
+ * @returns {this} for chaining
2846
+ * @throws {TypeError} if called after seal()
2847
+ *
2848
+ * @example
2849
+ * set.add(new Expression('root.users.user'));
2850
+ * set.add(new Expression('..script'));
2851
+ */
2852
+ add(expression) {
2853
+ if (this._sealed) {
2854
+ throw new TypeError(
2855
+ "ExpressionSet is sealed. Create a new ExpressionSet to add more expressions."
2856
+ );
2857
+ }
2858
+ if (this._patterns.has(expression.pattern)) return this;
2859
+ this._patterns.add(expression.pattern);
2860
+ if (expression.hasDeepWildcard()) {
2861
+ this._deepWildcards.push(expression);
2862
+ return this;
2863
+ }
2864
+ const depth = expression.length;
2865
+ const lastSeg = expression.segments[expression.segments.length - 1];
2866
+ const tag = lastSeg?.tag;
2867
+ if (!tag || tag === "*") {
2868
+ if (!this._wildcardByDepth.has(depth)) this._wildcardByDepth.set(depth, []);
2869
+ this._wildcardByDepth.get(depth).push(expression);
2870
+ } else {
2871
+ const key = `${depth}:${tag}`;
2872
+ if (!this._byDepthAndTag.has(key)) this._byDepthAndTag.set(key, []);
2873
+ this._byDepthAndTag.get(key).push(expression);
2874
+ }
2875
+ return this;
2876
+ }
2877
+ /**
2878
+ * Add multiple expressions at once.
2879
+ *
2880
+ * @param {import('./Expression.js').default[]} expressions - Array of Expression instances
2881
+ * @returns {this} for chaining
2882
+ *
2883
+ * @example
2884
+ * set.addAll([
2885
+ * new Expression('root.users.user'),
2886
+ * new Expression('root.config.setting'),
2887
+ * ]);
2888
+ */
2889
+ addAll(expressions) {
2890
+ for (const expr of expressions) this.add(expr);
2891
+ return this;
2892
+ }
2893
+ /**
2894
+ * Check whether a pattern string is already present in the set.
2895
+ *
2896
+ * @param {import('./Expression.js').default} expression
2897
+ * @returns {boolean}
2898
+ */
2899
+ has(expression) {
2900
+ return this._patterns.has(expression.pattern);
2901
+ }
2902
+ /**
2903
+ * Number of expressions in the set.
2904
+ * @type {number}
2905
+ */
2906
+ get size() {
2907
+ return this._patterns.size;
2908
+ }
2909
+ /**
2910
+ * Seal the set against further modifications.
2911
+ * Useful to prevent accidental mutations after config is built.
2912
+ * Calling add() or addAll() on a sealed set throws a TypeError.
2913
+ *
2914
+ * @returns {this}
2915
+ */
2916
+ seal() {
2917
+ this._sealed = true;
2918
+ return this;
2919
+ }
2920
+ /**
2921
+ * Whether the set has been sealed.
2922
+ * @type {boolean}
2923
+ */
2924
+ get isSealed() {
2925
+ return this._sealed;
2926
+ }
2927
+ /**
2928
+ * Test whether the matcher's current path matches any expression in the set.
2929
+ *
2930
+ * Evaluation order (cheapest → most expensive):
2931
+ * 1. Exact depth + tag bucket — O(1) lookup, typically 0–2 expressions
2932
+ * 2. Depth-only wildcard bucket — O(1) lookup, rare
2933
+ * 3. Deep-wildcard list — always checked, but usually small
2934
+ *
2935
+ * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)
2936
+ * @returns {boolean} true if any expression matches the current path
2937
+ *
2938
+ * @example
2939
+ * if (stopNodes.matchesAny(matcher)) {
2940
+ * // handle stop node
2941
+ * }
2942
+ */
2943
+ matchesAny(matcher) {
2944
+ return this.findMatch(matcher) !== null;
2945
+ }
2946
+ /**
2947
+ * Find and return the first Expression that matches the matcher's current path.
2948
+ *
2949
+ * Uses the same evaluation order as matchesAny (cheapest → most expensive):
2950
+ * 1. Exact depth + tag bucket
2951
+ * 2. Depth-only wildcard bucket
2952
+ * 3. Deep-wildcard list
2953
+ *
2954
+ * @param {import('./Matcher.js').default} matcher - Matcher instance (or readOnly view)
2955
+ * @returns {import('./Expression.js').default | null} the first matching Expression, or null
2956
+ *
2957
+ * @example
2958
+ * const expr = stopNodes.findMatch(matcher);
2959
+ * if (expr) {
2960
+ * // access expr.config, expr.pattern, etc.
2961
+ * }
2962
+ */
2963
+ findMatch(matcher) {
2964
+ const depth = matcher.getDepth();
2965
+ const tag = matcher.getCurrentTag();
2966
+ const exactKey = `${depth}:${tag}`;
2967
+ const exactBucket = this._byDepthAndTag.get(exactKey);
2968
+ if (exactBucket) {
2969
+ for (let i2 = 0; i2 < exactBucket.length; i2++) {
2970
+ if (matcher.matches(exactBucket[i2])) return exactBucket[i2];
2971
+ }
2972
+ }
2973
+ const wildcardBucket = this._wildcardByDepth.get(depth);
2974
+ if (wildcardBucket) {
2975
+ for (let i2 = 0; i2 < wildcardBucket.length; i2++) {
2976
+ if (matcher.matches(wildcardBucket[i2])) return wildcardBucket[i2];
2977
+ }
2978
+ }
2979
+ for (let i2 = 0; i2 < this._deepWildcards.length; i2++) {
2980
+ if (matcher.matches(this._deepWildcards[i2])) return this._deepWildcards[i2];
2981
+ }
2982
+ return null;
2983
+ }
2984
+ };
2985
+
2986
+ // ../node_modules/.bun/path-expression-matcher@1.5.0/node_modules/path-expression-matcher/src/Matcher.js
2987
+ var MatcherView = class {
2988
+ /**
2989
+ * @param {Matcher} matcher - The parent Matcher instance to read from.
2990
+ */
2991
+ constructor(matcher) {
2992
+ this._matcher = matcher;
2993
+ }
2994
+ /**
2995
+ * Get the path separator used by the parent matcher.
2996
+ * @returns {string}
2997
+ */
2998
+ get separator() {
2999
+ return this._matcher.separator;
3000
+ }
3001
+ /**
3002
+ * Get current tag name.
3003
+ * @returns {string|undefined}
3004
+ */
3005
+ getCurrentTag() {
3006
+ const path = this._matcher.path;
3007
+ return path.length > 0 ? path[path.length - 1].tag : void 0;
3008
+ }
3009
+ /**
3010
+ * Get current namespace.
3011
+ * @returns {string|undefined}
3012
+ */
3013
+ getCurrentNamespace() {
3014
+ const path = this._matcher.path;
3015
+ return path.length > 0 ? path[path.length - 1].namespace : void 0;
3016
+ }
3017
+ /**
3018
+ * Get current node's attribute value.
3019
+ * @param {string} attrName
3020
+ * @returns {*}
3021
+ */
3022
+ getAttrValue(attrName) {
3023
+ const path = this._matcher.path;
3024
+ if (path.length === 0) return void 0;
3025
+ return path[path.length - 1].values?.[attrName];
3026
+ }
3027
+ /**
3028
+ * Check if current node has an attribute.
3029
+ * @param {string} attrName
3030
+ * @returns {boolean}
3031
+ */
3032
+ hasAttr(attrName) {
3033
+ const path = this._matcher.path;
3034
+ if (path.length === 0) return false;
3035
+ const current = path[path.length - 1];
3036
+ return current.values !== void 0 && attrName in current.values;
3037
+ }
3038
+ /**
3039
+ * Get current node's sibling position (child index in parent).
3040
+ * @returns {number}
3041
+ */
3042
+ getPosition() {
3043
+ const path = this._matcher.path;
3044
+ if (path.length === 0) return -1;
3045
+ return path[path.length - 1].position ?? 0;
3046
+ }
3047
+ /**
3048
+ * Get current node's repeat counter (occurrence count of this tag name).
3049
+ * @returns {number}
3050
+ */
3051
+ getCounter() {
3052
+ const path = this._matcher.path;
3053
+ if (path.length === 0) return -1;
3054
+ return path[path.length - 1].counter ?? 0;
3055
+ }
3056
+ /**
3057
+ * Get current node's sibling index (alias for getPosition).
3058
+ * @returns {number}
3059
+ * @deprecated Use getPosition() or getCounter() instead
3060
+ */
3061
+ getIndex() {
3062
+ return this.getPosition();
3063
+ }
3064
+ /**
3065
+ * Get current path depth.
3066
+ * @returns {number}
3067
+ */
3068
+ getDepth() {
3069
+ return this._matcher.path.length;
3070
+ }
3071
+ /**
3072
+ * Get path as string.
3073
+ * @param {string} [separator] - Optional separator (uses default if not provided)
3074
+ * @param {boolean} [includeNamespace=true]
3075
+ * @returns {string}
3076
+ */
3077
+ toString(separator, includeNamespace = true) {
3078
+ return this._matcher.toString(separator, includeNamespace);
3079
+ }
3080
+ /**
3081
+ * Get path as array of tag names.
3082
+ * @returns {string[]}
3083
+ */
3084
+ toArray() {
3085
+ return this._matcher.path.map((n2) => n2.tag);
3086
+ }
3087
+ /**
3088
+ * Match current path against an Expression.
3089
+ * @param {Expression} expression
3090
+ * @returns {boolean}
3091
+ */
3092
+ matches(expression) {
3093
+ return this._matcher.matches(expression);
3094
+ }
3095
+ /**
3096
+ * Match any expression in the given set against the current path.
3097
+ * @param {ExpressionSet} exprSet
3098
+ * @returns {boolean}
3099
+ */
3100
+ matchesAny(exprSet) {
3101
+ return exprSet.matchesAny(this._matcher);
3102
+ }
3103
+ };
1370
3104
  var Matcher = class {
1371
3105
  /**
1372
- * Create a new Matcher
1373
- * @param {Object} options - Configuration options
1374
- * @param {string} options.separator - Default path separator (default: '.')
3106
+ * Create a new Matcher.
3107
+ * @param {Object} [options={}]
3108
+ * @param {string} [options.separator='.'] - Default path separator
1375
3109
  */
1376
3110
  constructor(options = {}) {
1377
3111
  this.separator = options.separator || ".";
1378
3112
  this.path = [];
1379
3113
  this.siblingStacks = [];
3114
+ this._pathStringCache = null;
3115
+ this._view = new MatcherView(this);
1380
3116
  }
1381
3117
  /**
1382
- * Push a new tag onto the path
1383
- * @param {string} tagName - Name of the tag
1384
- * @param {Object} attrValues - Attribute key-value pairs for current node (optional)
1385
- * @param {string} namespace - Namespace for the tag (optional)
3118
+ * Push a new tag onto the path.
3119
+ * @param {string} tagName
3120
+ * @param {Object|null} [attrValues=null]
3121
+ * @param {string|null} [namespace=null]
1386
3122
  */
1387
3123
  push(tagName, attrValues = null, namespace = null) {
1388
3124
  this._pathStringCache = null;
1389
3125
  if (this.path.length > 0) {
1390
- const prev = this.path[this.path.length - 1];
1391
- prev.values = void 0;
3126
+ this.path[this.path.length - 1].values = void 0;
1392
3127
  }
1393
3128
  const currentLevel = this.path.length;
1394
3129
  if (!this.siblingStacks[currentLevel]) {
@@ -1416,13 +3151,11 @@ var Matcher = class {
1416
3151
  this.path.push(node);
1417
3152
  }
1418
3153
  /**
1419
- * Pop the last tag from the path
3154
+ * Pop the last tag from the path.
1420
3155
  * @returns {Object|undefined} The popped node
1421
3156
  */
1422
3157
  pop() {
1423
- if (this.path.length === 0) {
1424
- return void 0;
1425
- }
3158
+ if (this.path.length === 0) return void 0;
1426
3159
  this._pathStringCache = null;
1427
3160
  const node = this.path.pop();
1428
3161
  if (this.siblingStacks.length > this.path.length + 1) {
@@ -1431,9 +3164,9 @@ var Matcher = class {
1431
3164
  return node;
1432
3165
  }
1433
3166
  /**
1434
- * Update current node's attribute values
1435
- * Useful when attributes are parsed after push
1436
- * @param {Object} attrValues - Attribute values
3167
+ * Update current node's attribute values.
3168
+ * Useful when attributes are parsed after push.
3169
+ * @param {Object} attrValues
1437
3170
  */
1438
3171
  updateCurrent(attrValues) {
1439
3172
  if (this.path.length > 0) {
@@ -1444,32 +3177,31 @@ var Matcher = class {
1444
3177
  }
1445
3178
  }
1446
3179
  /**
1447
- * Get current tag name
3180
+ * Get current tag name.
1448
3181
  * @returns {string|undefined}
1449
3182
  */
1450
3183
  getCurrentTag() {
1451
3184
  return this.path.length > 0 ? this.path[this.path.length - 1].tag : void 0;
1452
3185
  }
1453
3186
  /**
1454
- * Get current namespace
3187
+ * Get current namespace.
1455
3188
  * @returns {string|undefined}
1456
3189
  */
1457
3190
  getCurrentNamespace() {
1458
3191
  return this.path.length > 0 ? this.path[this.path.length - 1].namespace : void 0;
1459
3192
  }
1460
3193
  /**
1461
- * Get current node's attribute value
1462
- * @param {string} attrName - Attribute name
1463
- * @returns {*} Attribute value or undefined
3194
+ * Get current node's attribute value.
3195
+ * @param {string} attrName
3196
+ * @returns {*}
1464
3197
  */
1465
3198
  getAttrValue(attrName) {
1466
3199
  if (this.path.length === 0) return void 0;
1467
- const current = this.path[this.path.length - 1];
1468
- return current.values?.[attrName];
3200
+ return this.path[this.path.length - 1].values?.[attrName];
1469
3201
  }
1470
3202
  /**
1471
- * Check if current node has an attribute
1472
- * @param {string} attrName - Attribute name
3203
+ * Check if current node has an attribute.
3204
+ * @param {string} attrName
1473
3205
  * @returns {boolean}
1474
3206
  */
1475
3207
  hasAttr(attrName) {
@@ -1478,7 +3210,7 @@ var Matcher = class {
1478
3210
  return current.values !== void 0 && attrName in current.values;
1479
3211
  }
1480
3212
  /**
1481
- * Get current node's sibling position (child index in parent)
3213
+ * Get current node's sibling position (child index in parent).
1482
3214
  * @returns {number}
1483
3215
  */
1484
3216
  getPosition() {
@@ -1486,7 +3218,7 @@ var Matcher = class {
1486
3218
  return this.path[this.path.length - 1].position ?? 0;
1487
3219
  }
1488
3220
  /**
1489
- * Get current node's repeat counter (occurrence count of this tag name)
3221
+ * Get current node's repeat counter (occurrence count of this tag name).
1490
3222
  * @returns {number}
1491
3223
  */
1492
3224
  getCounter() {
@@ -1494,7 +3226,7 @@ var Matcher = class {
1494
3226
  return this.path[this.path.length - 1].counter ?? 0;
1495
3227
  }
1496
3228
  /**
1497
- * Get current node's sibling index (alias for getPosition for backward compatibility)
3229
+ * Get current node's sibling index (alias for getPosition).
1498
3230
  * @returns {number}
1499
3231
  * @deprecated Use getPosition() or getCounter() instead
1500
3232
  */
@@ -1502,27 +3234,27 @@ var Matcher = class {
1502
3234
  return this.getPosition();
1503
3235
  }
1504
3236
  /**
1505
- * Get current path depth
3237
+ * Get current path depth.
1506
3238
  * @returns {number}
1507
3239
  */
1508
3240
  getDepth() {
1509
3241
  return this.path.length;
1510
3242
  }
1511
3243
  /**
1512
- * Get path as string
1513
- * @param {string} separator - Optional separator (uses default if not provided)
1514
- * @param {boolean} includeNamespace - Whether to include namespace in output (default: true)
3244
+ * Get path as string.
3245
+ * @param {string} [separator] - Optional separator (uses default if not provided)
3246
+ * @param {boolean} [includeNamespace=true]
1515
3247
  * @returns {string}
1516
3248
  */
1517
3249
  toString(separator, includeNamespace = true) {
1518
3250
  const sep = separator || this.separator;
1519
3251
  const isDefault = sep === this.separator && includeNamespace === true;
1520
3252
  if (isDefault) {
1521
- if (this._pathStringCache !== null && this._pathStringCache !== void 0) {
3253
+ if (this._pathStringCache !== null) {
1522
3254
  return this._pathStringCache;
1523
3255
  }
1524
3256
  const result = this.path.map(
1525
- (n2) => includeNamespace && n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
3257
+ (n2) => n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
1526
3258
  ).join(sep);
1527
3259
  this._pathStringCache = result;
1528
3260
  return result;
@@ -1532,14 +3264,14 @@ var Matcher = class {
1532
3264
  ).join(sep);
1533
3265
  }
1534
3266
  /**
1535
- * Get path as array of tag names
3267
+ * Get path as array of tag names.
1536
3268
  * @returns {string[]}
1537
3269
  */
1538
3270
  toArray() {
1539
3271
  return this.path.map((n2) => n2.tag);
1540
3272
  }
1541
3273
  /**
1542
- * Reset the path to empty
3274
+ * Reset the path to empty.
1543
3275
  */
1544
3276
  reset() {
1545
3277
  this._pathStringCache = null;
@@ -1547,9 +3279,9 @@ var Matcher = class {
1547
3279
  this.siblingStacks = [];
1548
3280
  }
1549
3281
  /**
1550
- * Match current path against an Expression
1551
- * @param {Expression} expression - The expression to match against
1552
- * @returns {boolean} True if current path matches the expression
3282
+ * Match current path against an Expression.
3283
+ * @param {Expression} expression
3284
+ * @returns {boolean}
1553
3285
  */
1554
3286
  matches(expression) {
1555
3287
  const segments = expression.segments;
@@ -1562,7 +3294,6 @@ var Matcher = class {
1562
3294
  return this._matchSimple(segments);
1563
3295
  }
1564
3296
  /**
1565
- * Match simple path (no deep wildcards)
1566
3297
  * @private
1567
3298
  */
1568
3299
  _matchSimple(segments) {
@@ -1570,17 +3301,13 @@ var Matcher = class {
1570
3301
  return false;
1571
3302
  }
1572
3303
  for (let i2 = 0; i2 < segments.length; i2++) {
1573
- const segment = segments[i2];
1574
- const node = this.path[i2];
1575
- const isCurrentNode = i2 === this.path.length - 1;
1576
- if (!this._matchSegment(segment, node, isCurrentNode)) {
3304
+ if (!this._matchSegment(segments[i2], this.path[i2], i2 === this.path.length - 1)) {
1577
3305
  return false;
1578
3306
  }
1579
3307
  }
1580
3308
  return true;
1581
3309
  }
1582
3310
  /**
1583
- * Match path with deep wildcards
1584
3311
  * @private
1585
3312
  */
1586
3313
  _matchWithDeepWildcard(segments) {
@@ -1596,8 +3323,7 @@ var Matcher = class {
1596
3323
  const nextSeg = segments[segIdx];
1597
3324
  let found = false;
1598
3325
  for (let i2 = pathIdx; i2 >= 0; i2--) {
1599
- const isCurrentNode = i2 === this.path.length - 1;
1600
- if (this._matchSegment(nextSeg, this.path[i2], isCurrentNode)) {
3326
+ if (this._matchSegment(nextSeg, this.path[i2], i2 === this.path.length - 1)) {
1601
3327
  pathIdx = i2 - 1;
1602
3328
  segIdx--;
1603
3329
  found = true;
@@ -1608,8 +3334,7 @@ var Matcher = class {
1608
3334
  return false;
1609
3335
  }
1610
3336
  } else {
1611
- const isCurrentNode = pathIdx === this.path.length - 1;
1612
- if (!this._matchSegment(segment, this.path[pathIdx], isCurrentNode)) {
3337
+ if (!this._matchSegment(segment, this.path[pathIdx], pathIdx === this.path.length - 1)) {
1613
3338
  return false;
1614
3339
  }
1615
3340
  pathIdx--;
@@ -1619,12 +3344,7 @@ var Matcher = class {
1619
3344
  return segIdx < 0;
1620
3345
  }
1621
3346
  /**
1622
- * Match a single segment against a node
1623
3347
  * @private
1624
- * @param {Object} segment - Segment from Expression
1625
- * @param {Object} node - Node from path
1626
- * @param {boolean} isCurrentNode - Whether this is the current (last) node
1627
- * @returns {boolean}
1628
3348
  */
1629
3349
  _matchSegment(segment, node, isCurrentNode) {
1630
3350
  if (segment.tag !== "*" && segment.tag !== node.tag) {
@@ -1643,8 +3363,7 @@ var Matcher = class {
1643
3363
  return false;
1644
3364
  }
1645
3365
  if (segment.attrValue !== void 0) {
1646
- const actualValue = node.values[segment.attrName];
1647
- if (String(actualValue) !== String(segment.attrValue)) {
3366
+ if (String(node.values[segment.attrName]) !== String(segment.attrValue)) {
1648
3367
  return false;
1649
3368
  }
1650
3369
  }
@@ -1660,17 +3379,23 @@ var Matcher = class {
1660
3379
  return false;
1661
3380
  } else if (segment.position === "even" && counter % 2 !== 0) {
1662
3381
  return false;
1663
- } else if (segment.position === "nth") {
1664
- if (counter !== segment.positionValue) {
1665
- return false;
1666
- }
3382
+ } else if (segment.position === "nth" && counter !== segment.positionValue) {
3383
+ return false;
1667
3384
  }
1668
3385
  }
1669
3386
  return true;
1670
3387
  }
1671
3388
  /**
1672
- * Create a snapshot of current state
1673
- * @returns {Object} State snapshot
3389
+ * Match any expression in the given set against the current path.
3390
+ * @param {ExpressionSet} exprSet
3391
+ * @returns {boolean}
3392
+ */
3393
+ matchesAny(exprSet) {
3394
+ return exprSet.matchesAny(this);
3395
+ }
3396
+ /**
3397
+ * Create a snapshot of current state.
3398
+ * @returns {Object}
1674
3399
  */
1675
3400
  snapshot() {
1676
3401
  return {
@@ -1679,8 +3404,8 @@ var Matcher = class {
1679
3404
  };
1680
3405
  }
1681
3406
  /**
1682
- * Restore state from snapshot
1683
- * @param {Object} snapshot - State snapshot
3407
+ * Restore state from snapshot.
3408
+ * @param {Object} snapshot
1684
3409
  */
1685
3410
  restore(snapshot) {
1686
3411
  this._pathStringCache = null;
@@ -1688,68 +3413,27 @@ var Matcher = class {
1688
3413
  this.siblingStacks = snapshot.siblingStacks.map((map) => new Map(map));
1689
3414
  }
1690
3415
  /**
1691
- * Return a read-only view of this matcher.
3416
+ * Return the read-only {@link MatcherView} for this matcher.
1692
3417
  *
1693
- * The returned object exposes all query/inspection methods but throws a
1694
- * TypeError if any state-mutating method is called (`push`, `pop`, `reset`,
1695
- * `updateCurrent`, `restore`). Property reads (e.g. `.path`, `.separator`)
1696
- * are allowed but the returned arrays/objects are frozen so callers cannot
1697
- * mutate internal state through them either.
3418
+ * The same instance is returned on every call no allocation occurs.
3419
+ * It always reflects the current parser state and is safe to pass to
3420
+ * user callbacks without risk of accidental mutation.
1698
3421
  *
1699
- * @returns {ReadOnlyMatcher} A proxy that forwards read operations and blocks writes.
3422
+ * @returns {MatcherView}
1700
3423
  *
1701
3424
  * @example
1702
- * const matcher = new Matcher();
1703
- * matcher.push("root", {});
1704
- *
1705
- * const ro = matcher.readOnly();
1706
- * ro.matches(expr); // works
1707
- * ro.getCurrentTag(); // ✓ works
1708
- * ro.push("child", {}); // ✗ throws TypeError
1709
- * ro.reset(); // ✗ throws TypeError
3425
+ * const view = matcher.readOnly();
3426
+ * // pass view to callbacks — it stays in sync automatically
3427
+ * view.matches(expr); // ✓
3428
+ * view.getCurrentTag(); // ✓
3429
+ * // view.push(...) // method does not exist — caught by TypeScript
1710
3430
  */
1711
3431
  readOnly() {
1712
- const self = this;
1713
- return new Proxy(self, {
1714
- get(target, prop, receiver) {
1715
- if (MUTATING_METHODS.has(prop)) {
1716
- return () => {
1717
- throw new TypeError(
1718
- `Cannot call '${prop}' on a read-only Matcher. Obtain a writable instance to mutate state.`
1719
- );
1720
- };
1721
- }
1722
- const value = Reflect.get(target, prop, receiver);
1723
- if (prop === "path" || prop === "siblingStacks") {
1724
- return Object.freeze(
1725
- Array.isArray(value) ? value.map(
1726
- (item) => item instanceof Map ? Object.freeze(new Map(item)) : Object.freeze({ ...item })
1727
- // freeze a copy of each node
1728
- ) : value
1729
- );
1730
- }
1731
- if (typeof value === "function") {
1732
- return value.bind(target);
1733
- }
1734
- return value;
1735
- },
1736
- // Prevent any property assignment on the read-only view
1737
- set(_target, prop) {
1738
- throw new TypeError(
1739
- `Cannot set property '${String(prop)}' on a read-only Matcher.`
1740
- );
1741
- },
1742
- // Prevent property deletion
1743
- deleteProperty(_target, prop) {
1744
- throw new TypeError(
1745
- `Cannot delete property '${String(prop)}' from a read-only Matcher.`
1746
- );
1747
- }
1748
- });
3432
+ return this._view;
1749
3433
  }
1750
3434
  };
1751
3435
 
1752
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
3436
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
1753
3437
  function extractRawAttributes(prefixedAttrs, options) {
1754
3438
  if (!prefixedAttrs) return {};
1755
3439
  const attrs = options.attributesGroupName ? prefixedAttrs[options.attributesGroupName] : prefixedAttrs;
@@ -1777,36 +3461,10 @@ function extractNamespace(rawTagName) {
1777
3461
  return void 0;
1778
3462
  }
1779
3463
  var OrderedObjParser = class {
1780
- constructor(options) {
3464
+ constructor(options, externalEntities) {
1781
3465
  this.options = options;
1782
3466
  this.currentNode = null;
1783
3467
  this.tagsNodeStack = [];
1784
- this.docTypeEntities = {};
1785
- this.lastEntities = {
1786
- "apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
1787
- "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
1788
- "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
1789
- "quot": { regex: /&(quot|#34|#x22);/g, val: '"' }
1790
- };
1791
- this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
1792
- this.htmlEntities = {
1793
- "space": { regex: /&(nbsp|#160);/g, val: " " },
1794
- // "lt" : { regex: /&(lt|#60);/g, val: "<" },
1795
- // "gt" : { regex: /&(gt|#62);/g, val: ">" },
1796
- // "amp" : { regex: /&(amp|#38);/g, val: "&" },
1797
- // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
1798
- // "apos" : { regex: /&(apos|#39);/g, val: "'" },
1799
- "cent": { regex: /&(cent|#162);/g, val: "\xA2" },
1800
- "pound": { regex: /&(pound|#163);/g, val: "\xA3" },
1801
- "yen": { regex: /&(yen|#165);/g, val: "\xA5" },
1802
- "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" },
1803
- "copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
1804
- "reg": { regex: /&(reg|#174);/g, val: "\xAE" },
1805
- "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" },
1806
- "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str) => fromCodePoint(str, 10, "&#") },
1807
- "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str) => fromCodePoint(str, 16, "&#x") }
1808
- };
1809
- this.addExternalEntities = addExternalEntities;
1810
3468
  this.parseXml = parseXml;
1811
3469
  this.parseTextData = parseTextData;
1812
3470
  this.resolveNameSpace = resolveNameSpace;
@@ -1819,52 +3477,61 @@ var OrderedObjParser = class {
1819
3477
  this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes);
1820
3478
  this.entityExpansionCount = 0;
1821
3479
  this.currentExpandedLength = 0;
3480
+ let namedEntities = { ...XML };
3481
+ if (this.options.entityDecoder) {
3482
+ this.entityDecoder = this.options.entityDecoder;
3483
+ } else {
3484
+ if (typeof this.options.htmlEntities === "object") namedEntities = this.options.htmlEntities;
3485
+ else if (this.options.htmlEntities === true) namedEntities = { ...COMMON_HTML, ...CURRENCY };
3486
+ this.entityDecoder = new EntityDecoder({
3487
+ namedEntities: { ...namedEntities, ...externalEntities },
3488
+ numericAllowed: this.options.htmlEntities,
3489
+ limit: {
3490
+ maxTotalExpansions: this.options.processEntities.maxTotalExpansions,
3491
+ maxExpandedLength: this.options.processEntities.maxExpandedLength,
3492
+ applyLimitsTo: this.options.processEntities.appliesTo
3493
+ }
3494
+ //postCheck: resolved => resolved
3495
+ });
3496
+ }
1822
3497
  this.matcher = new Matcher();
1823
3498
  this.readonlyMatcher = this.matcher.readOnly();
1824
3499
  this.isCurrentNodeStopNode = false;
1825
- if (this.options.stopNodes && this.options.stopNodes.length > 0) {
1826
- this.stopNodeExpressions = [];
1827
- for (let i2 = 0; i2 < this.options.stopNodes.length; i2++) {
1828
- const stopNodeExp = this.options.stopNodes[i2];
3500
+ this.stopNodeExpressionsSet = new ExpressionSet();
3501
+ const stopNodesOpts = this.options.stopNodes;
3502
+ if (stopNodesOpts && stopNodesOpts.length > 0) {
3503
+ for (let i2 = 0; i2 < stopNodesOpts.length; i2++) {
3504
+ const stopNodeExp = stopNodesOpts[i2];
1829
3505
  if (typeof stopNodeExp === "string") {
1830
- this.stopNodeExpressions.push(new Expression(stopNodeExp));
3506
+ this.stopNodeExpressionsSet.add(new Expression(stopNodeExp));
1831
3507
  } else if (stopNodeExp instanceof Expression) {
1832
- this.stopNodeExpressions.push(stopNodeExp);
3508
+ this.stopNodeExpressionsSet.add(stopNodeExp);
1833
3509
  }
1834
3510
  }
3511
+ this.stopNodeExpressionsSet.seal();
1835
3512
  }
1836
3513
  }
1837
3514
  };
1838
- function addExternalEntities(externalEntities) {
1839
- const entKeys = Object.keys(externalEntities);
1840
- for (let i2 = 0; i2 < entKeys.length; i2++) {
1841
- const ent = entKeys[i2];
1842
- const escaped = ent.replace(/[.\-+*:]/g, "\\.");
1843
- this.lastEntities[ent] = {
1844
- regex: new RegExp("&" + escaped + ";", "g"),
1845
- val: externalEntities[ent]
1846
- };
1847
- }
1848
- }
1849
3515
  function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
3516
+ const options = this.options;
1850
3517
  if (val !== void 0) {
1851
- if (this.options.trimValues && !dontTrim) {
3518
+ if (options.trimValues && !dontTrim) {
1852
3519
  val = val.trim();
1853
3520
  }
1854
3521
  if (val.length > 0) {
1855
3522
  if (!escapeEntities) val = this.replaceEntitiesValue(val, tagName, jPath);
1856
- const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
1857
- const newval = this.options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);
3523
+ const jPathOrMatcher = options.jPath ? jPath.toString() : jPath;
3524
+ const newval = options.tagValueProcessor(tagName, val, jPathOrMatcher, hasAttributes, isLeafNode);
1858
3525
  if (newval === null || newval === void 0) {
1859
3526
  return val;
1860
3527
  } else if (typeof newval !== typeof val || newval !== val) {
1861
3528
  return newval;
1862
- } else if (this.options.trimValues) {
1863
- return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
3529
+ } else if (options.trimValues) {
3530
+ return parseValue(val, options.parseTagValue, options.numberParseOptions);
1864
3531
  } else {
1865
3532
  const trimmedVal = val.trim();
1866
3533
  if (trimmedVal === val) {
1867
- return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
3534
+ return parseValue(val, options.parseTagValue, options.numberParseOptions);
1868
3535
  } else {
1869
3536
  return val;
1870
3537
  }
@@ -1886,69 +3553,62 @@ function resolveNameSpace(tagname) {
1886
3553
  return tagname;
1887
3554
  }
1888
3555
  var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1889
- function buildAttributesMap(attrStr, jPath, tagName) {
1890
- if (this.options.ignoreAttributes !== true && typeof attrStr === "string") {
3556
+ function buildAttributesMap(attrStr, jPath, tagName, force = false) {
3557
+ const options = this.options;
3558
+ if (force === true || options.ignoreAttributes !== true && typeof attrStr === "string") {
1891
3559
  const matches = getAllMatches(attrStr, attrsRegx);
1892
3560
  const len = matches.length;
1893
3561
  const attrs = {};
3562
+ const processedVals = new Array(len);
3563
+ let hasRawAttrs = false;
1894
3564
  const rawAttrsForMatcher = {};
1895
3565
  for (let i2 = 0; i2 < len; i2++) {
1896
3566
  const attrName = this.resolveNameSpace(matches[i2][1]);
1897
3567
  const oldVal = matches[i2][4];
1898
3568
  if (attrName.length && oldVal !== void 0) {
1899
- let parsedVal = oldVal;
1900
- if (this.options.trimValues) {
1901
- parsedVal = parsedVal.trim();
1902
- }
1903
- parsedVal = this.replaceEntitiesValue(parsedVal, tagName, this.readonlyMatcher);
1904
- rawAttrsForMatcher[attrName] = parsedVal;
3569
+ let val = oldVal;
3570
+ if (options.trimValues) val = val.trim();
3571
+ val = this.replaceEntitiesValue(val, tagName, this.readonlyMatcher);
3572
+ processedVals[i2] = val;
3573
+ rawAttrsForMatcher[attrName] = val;
3574
+ hasRawAttrs = true;
1905
3575
  }
1906
3576
  }
1907
- if (Object.keys(rawAttrsForMatcher).length > 0 && typeof jPath === "object" && jPath.updateCurrent) {
3577
+ if (hasRawAttrs && typeof jPath === "object" && jPath.updateCurrent) {
1908
3578
  jPath.updateCurrent(rawAttrsForMatcher);
1909
3579
  }
3580
+ const jPathStr = options.jPath ? jPath.toString() : this.readonlyMatcher;
3581
+ let hasAttrs = false;
1910
3582
  for (let i2 = 0; i2 < len; i2++) {
1911
3583
  const attrName = this.resolveNameSpace(matches[i2][1]);
1912
- const jPathStr = this.options.jPath ? jPath.toString() : this.readonlyMatcher;
1913
- if (this.ignoreAttributesFn(attrName, jPathStr)) {
1914
- continue;
1915
- }
1916
- let oldVal = matches[i2][4];
1917
- let aName = this.options.attributeNamePrefix + attrName;
3584
+ if (this.ignoreAttributesFn(attrName, jPathStr)) continue;
3585
+ let aName = options.attributeNamePrefix + attrName;
1918
3586
  if (attrName.length) {
1919
- if (this.options.transformAttributeName) {
1920
- aName = this.options.transformAttributeName(aName);
3587
+ if (options.transformAttributeName) {
3588
+ aName = options.transformAttributeName(aName);
1921
3589
  }
1922
- aName = sanitizeName(aName, this.options);
1923
- if (oldVal !== void 0) {
1924
- if (this.options.trimValues) {
1925
- oldVal = oldVal.trim();
1926
- }
1927
- oldVal = this.replaceEntitiesValue(oldVal, tagName, this.readonlyMatcher);
1928
- const jPathOrMatcher = this.options.jPath ? jPath.toString() : this.readonlyMatcher;
1929
- const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPathOrMatcher);
3590
+ aName = sanitizeName(aName, options);
3591
+ if (matches[i2][4] !== void 0) {
3592
+ const oldVal = processedVals[i2];
3593
+ const newVal = options.attributeValueProcessor(attrName, oldVal, jPathStr);
1930
3594
  if (newVal === null || newVal === void 0) {
1931
3595
  attrs[aName] = oldVal;
1932
3596
  } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
1933
3597
  attrs[aName] = newVal;
1934
3598
  } else {
1935
- attrs[aName] = parseValue(
1936
- oldVal,
1937
- this.options.parseAttributeValue,
1938
- this.options.numberParseOptions
1939
- );
3599
+ attrs[aName] = parseValue(oldVal, options.parseAttributeValue, options.numberParseOptions);
1940
3600
  }
1941
- } else if (this.options.allowBooleanAttributes) {
3601
+ hasAttrs = true;
3602
+ } else if (options.allowBooleanAttributes) {
1942
3603
  attrs[aName] = true;
3604
+ hasAttrs = true;
1943
3605
  }
1944
3606
  }
1945
3607
  }
1946
- if (!Object.keys(attrs).length) {
1947
- return;
1948
- }
1949
- if (this.options.attributesGroupName) {
3608
+ if (!hasAttrs) return;
3609
+ if (options.attributesGroupName && !options.preserveOrder) {
1950
3610
  const attrCollection = {};
1951
- attrCollection[this.options.attributesGroupName] = attrs;
3611
+ attrCollection[options.attributesGroupName] = attrs;
1952
3612
  return attrCollection;
1953
3613
  }
1954
3614
  return attrs;
@@ -1960,30 +3620,34 @@ var parseXml = function(xmlData) {
1960
3620
  let currentNode = xmlObj;
1961
3621
  let textData = "";
1962
3622
  this.matcher.reset();
3623
+ this.entityDecoder.reset();
1963
3624
  this.entityExpansionCount = 0;
1964
3625
  this.currentExpandedLength = 0;
1965
- const docTypeReader = new DocTypeReader(this.options.processEntities);
1966
- for (let i2 = 0; i2 < xmlData.length; i2++) {
3626
+ const options = this.options;
3627
+ const docTypeReader = new DocTypeReader(options.processEntities);
3628
+ const xmlLen = xmlData.length;
3629
+ for (let i2 = 0; i2 < xmlLen; i2++) {
1967
3630
  const ch = xmlData[i2];
1968
3631
  if (ch === "<") {
1969
- if (xmlData[i2 + 1] === "/") {
3632
+ const c1 = xmlData.charCodeAt(i2 + 1);
3633
+ if (c1 === 47) {
1970
3634
  const closeIndex = findClosingIndex(xmlData, ">", i2, "Closing Tag is not closed.");
1971
3635
  let tagName = xmlData.substring(i2 + 2, closeIndex).trim();
1972
- if (this.options.removeNSPrefix) {
3636
+ if (options.removeNSPrefix) {
1973
3637
  const colonIndex = tagName.indexOf(":");
1974
3638
  if (colonIndex !== -1) {
1975
3639
  tagName = tagName.substr(colonIndex + 1);
1976
3640
  }
1977
3641
  }
1978
- tagName = transformTagName(this.options.transformTagName, tagName, "", this.options).tagName;
3642
+ tagName = transformTagName(options.transformTagName, tagName, "", options).tagName;
1979
3643
  if (currentNode) {
1980
3644
  textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
1981
3645
  }
1982
3646
  const lastTagName = this.matcher.getCurrentTag();
1983
- if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {
3647
+ if (tagName && options.unpairedTagsSet.has(tagName)) {
1984
3648
  throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
1985
3649
  }
1986
- if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {
3650
+ if (lastTagName && options.unpairedTagsSet.has(lastTagName)) {
1987
3651
  this.matcher.pop();
1988
3652
  this.tagsNodeStack.pop();
1989
3653
  }
@@ -1992,48 +3656,53 @@ var parseXml = function(xmlData) {
1992
3656
  currentNode = this.tagsNodeStack.pop();
1993
3657
  textData = "";
1994
3658
  i2 = closeIndex;
1995
- } else if (xmlData[i2 + 1] === "?") {
3659
+ } else if (c1 === 63) {
1996
3660
  let tagData = readTagExp(xmlData, i2, false, "?>");
1997
3661
  if (!tagData) throw new Error("Pi Tag is not closed.");
1998
3662
  textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
1999
- if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) {
3663
+ const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true);
3664
+ if (attsMap) {
3665
+ const ver = attsMap[this.options.attributeNamePrefix + "version"];
3666
+ this.entityDecoder.setXmlVersion(Number(ver) || 1);
3667
+ }
3668
+ if (options.ignoreDeclaration && tagData.tagName === "?xml" || options.ignorePiTags) {
2000
3669
  } else {
2001
3670
  const childNode = new XmlNode(tagData.tagName);
2002
- childNode.add(this.options.textNodeName, "");
2003
- if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
2004
- childNode[":@"] = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName);
3671
+ childNode.add(options.textNodeName, "");
3672
+ if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) {
3673
+ childNode[":@"] = attsMap;
2005
3674
  }
2006
3675
  this.addChild(currentNode, childNode, this.readonlyMatcher, i2);
2007
3676
  }
2008
3677
  i2 = tagData.closeIndex + 1;
2009
- } else if (xmlData.substr(i2 + 1, 3) === "!--") {
3678
+ } else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 45 && xmlData.charCodeAt(i2 + 3) === 45) {
2010
3679
  const endIndex = findClosingIndex(xmlData, "-->", i2 + 4, "Comment is not closed.");
2011
- if (this.options.commentPropName) {
3680
+ if (options.commentPropName) {
2012
3681
  const comment = xmlData.substring(i2 + 4, endIndex - 2);
2013
3682
  textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
2014
- currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
3683
+ currentNode.add(options.commentPropName, [{ [options.textNodeName]: comment }]);
2015
3684
  }
2016
3685
  i2 = endIndex;
2017
- } else if (xmlData.substr(i2 + 1, 2) === "!D") {
3686
+ } else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 68) {
2018
3687
  const result = docTypeReader.readDocType(xmlData, i2);
2019
- this.docTypeEntities = result.entities;
3688
+ this.entityDecoder.addInputEntities(result.entities);
2020
3689
  i2 = result.i;
2021
- } else if (xmlData.substr(i2 + 1, 2) === "![") {
3690
+ } else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 91) {
2022
3691
  const closeIndex = findClosingIndex(xmlData, "]]>", i2, "CDATA is not closed.") - 2;
2023
3692
  const tagExp = xmlData.substring(i2 + 9, closeIndex);
2024
3693
  textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
2025
3694
  let val = this.parseTextData(tagExp, currentNode.tagname, this.readonlyMatcher, true, false, true, true);
2026
3695
  if (val == void 0) val = "";
2027
- if (this.options.cdataPropName) {
2028
- currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
3696
+ if (options.cdataPropName) {
3697
+ currentNode.add(options.cdataPropName, [{ [options.textNodeName]: tagExp }]);
2029
3698
  } else {
2030
- currentNode.add(this.options.textNodeName, val);
3699
+ currentNode.add(options.textNodeName, val);
2031
3700
  }
2032
3701
  i2 = closeIndex + 2;
2033
3702
  } else {
2034
- let result = readTagExp(xmlData, i2, this.options.removeNSPrefix);
3703
+ let result = readTagExp(xmlData, i2, options.removeNSPrefix);
2035
3704
  if (!result) {
2036
- const context = xmlData.substring(Math.max(0, i2 - 50), Math.min(xmlData.length, i2 + 50));
3705
+ const context = xmlData.substring(Math.max(0, i2 - 50), Math.min(xmlLen, i2 + 50));
2037
3706
  throw new Error(`readTagExp returned undefined at position ${i2}. Context: "${context}"`);
2038
3707
  }
2039
3708
  let tagName = result.tagName;
@@ -2041,8 +3710,8 @@ var parseXml = function(xmlData) {
2041
3710
  let tagExp = result.tagExp;
2042
3711
  let attrExpPresent = result.attrExpPresent;
2043
3712
  let closeIndex = result.closeIndex;
2044
- ({ tagName, tagExp } = transformTagName(this.options.transformTagName, tagName, tagExp, this.options));
2045
- if (this.options.strictReservedNames && (tagName === this.options.commentPropName || tagName === this.options.cdataPropName || tagName === this.options.textNodeName || tagName === this.options.attributesGroupName)) {
3713
+ ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
3714
+ if (options.strictReservedNames && (tagName === options.commentPropName || tagName === options.cdataPropName || tagName === options.textNodeName || tagName === options.attributesGroupName)) {
2046
3715
  throw new Error(`Invalid tag name: ${tagName}`);
2047
3716
  }
2048
3717
  if (currentNode && textData) {
@@ -2051,7 +3720,7 @@ var parseXml = function(xmlData) {
2051
3720
  }
2052
3721
  }
2053
3722
  const lastTag = currentNode;
2054
- if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {
3723
+ if (lastTag && options.unpairedTagsSet.has(lastTag.tagname)) {
2055
3724
  currentNode = this.tagsNodeStack.pop();
2056
3725
  this.matcher.pop();
2057
3726
  }
@@ -2076,18 +3745,18 @@ var parseXml = function(xmlData) {
2076
3745
  if (tagName !== tagExp && attrExpPresent) {
2077
3746
  prefixedAttrs = this.buildAttributesMap(tagExp, this.matcher, tagName);
2078
3747
  if (prefixedAttrs) {
2079
- rawAttrs = extractRawAttributes(prefixedAttrs, this.options);
3748
+ rawAttrs = extractRawAttributes(prefixedAttrs, options);
2080
3749
  }
2081
3750
  }
2082
3751
  if (tagName !== xmlObj.tagname) {
2083
- this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher);
3752
+ this.isCurrentNodeStopNode = this.isItStopNode();
2084
3753
  }
2085
3754
  const startIndex = i2;
2086
3755
  if (this.isCurrentNodeStopNode) {
2087
3756
  let tagContent = "";
2088
3757
  if (isSelfClosing) {
2089
3758
  i2 = result.closeIndex;
2090
- } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
3759
+ } else if (options.unpairedTagsSet.has(tagName)) {
2091
3760
  i2 = result.closeIndex;
2092
3761
  } else {
2093
3762
  const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
@@ -2099,13 +3768,13 @@ var parseXml = function(xmlData) {
2099
3768
  if (prefixedAttrs) {
2100
3769
  childNode[":@"] = prefixedAttrs;
2101
3770
  }
2102
- childNode.add(this.options.textNodeName, tagContent);
3771
+ childNode.add(options.textNodeName, tagContent);
2103
3772
  this.matcher.pop();
2104
3773
  this.isCurrentNodeStopNode = false;
2105
3774
  this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
2106
3775
  } else {
2107
3776
  if (isSelfClosing) {
2108
- ({ tagName, tagExp } = transformTagName(this.options.transformTagName, tagName, tagExp, this.options));
3777
+ ({ tagName, tagExp } = transformTagName(options.transformTagName, tagName, tagExp, options));
2109
3778
  const childNode = new XmlNode(tagName);
2110
3779
  if (prefixedAttrs) {
2111
3780
  childNode[":@"] = prefixedAttrs;
@@ -2113,7 +3782,7 @@ var parseXml = function(xmlData) {
2113
3782
  this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
2114
3783
  this.matcher.pop();
2115
3784
  this.isCurrentNodeStopNode = false;
2116
- } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
3785
+ } else if (options.unpairedTagsSet.has(tagName)) {
2117
3786
  const childNode = new XmlNode(tagName);
2118
3787
  if (prefixedAttrs) {
2119
3788
  childNode[":@"] = prefixedAttrs;
@@ -2125,7 +3794,7 @@ var parseXml = function(xmlData) {
2125
3794
  continue;
2126
3795
  } else {
2127
3796
  const childNode = new XmlNode(tagName);
2128
- if (this.tagsNodeStack.length > this.options.maxNestedTags) {
3797
+ if (this.tagsNodeStack.length > options.maxNestedTags) {
2129
3798
  throw new Error("Maximum nested tags exceeded");
2130
3799
  }
2131
3800
  this.tagsNodeStack.push(currentNode);
@@ -2175,59 +3844,7 @@ function replaceEntitiesValue(val, tagName, jPath) {
2175
3844
  return val;
2176
3845
  }
2177
3846
  }
2178
- for (const entityName of Object.keys(this.docTypeEntities)) {
2179
- const entity = this.docTypeEntities[entityName];
2180
- const matches = val.match(entity.regx);
2181
- if (matches) {
2182
- this.entityExpansionCount += matches.length;
2183
- if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
2184
- throw new Error(
2185
- `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
2186
- );
2187
- }
2188
- const lengthBefore = val.length;
2189
- val = val.replace(entity.regx, entity.val);
2190
- if (entityConfig.maxExpandedLength) {
2191
- this.currentExpandedLength += val.length - lengthBefore;
2192
- if (this.currentExpandedLength > entityConfig.maxExpandedLength) {
2193
- throw new Error(
2194
- `Total expanded content size exceeded: ${this.currentExpandedLength} > ${entityConfig.maxExpandedLength}`
2195
- );
2196
- }
2197
- }
2198
- }
2199
- }
2200
- for (const entityName of Object.keys(this.lastEntities)) {
2201
- const entity = this.lastEntities[entityName];
2202
- const matches = val.match(entity.regex);
2203
- if (matches) {
2204
- this.entityExpansionCount += matches.length;
2205
- if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
2206
- throw new Error(
2207
- `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
2208
- );
2209
- }
2210
- }
2211
- val = val.replace(entity.regex, entity.val);
2212
- }
2213
- if (val.indexOf("&") === -1) return val;
2214
- if (this.options.htmlEntities) {
2215
- for (const entityName of Object.keys(this.htmlEntities)) {
2216
- const entity = this.htmlEntities[entityName];
2217
- const matches = val.match(entity.regex);
2218
- if (matches) {
2219
- this.entityExpansionCount += matches.length;
2220
- if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) {
2221
- throw new Error(
2222
- `Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`
2223
- );
2224
- }
2225
- }
2226
- val = val.replace(entity.regex, entity.val);
2227
- }
2228
- }
2229
- val = val.replace(this.ampEntity.regex, this.ampEntity.val);
2230
- return val;
3847
+ return this.entityDecoder.decode(val);
2231
3848
  }
2232
3849
  function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
2233
3850
  if (textData) {
@@ -2246,42 +3863,37 @@ function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
2246
3863
  }
2247
3864
  return textData;
2248
3865
  }
2249
- function isItStopNode(stopNodeExpressions, matcher) {
2250
- if (!stopNodeExpressions || stopNodeExpressions.length === 0) return false;
2251
- for (let i2 = 0; i2 < stopNodeExpressions.length; i2++) {
2252
- if (matcher.matches(stopNodeExpressions[i2])) {
2253
- return true;
2254
- }
2255
- }
2256
- return false;
3866
+ function isItStopNode() {
3867
+ if (this.stopNodeExpressionsSet.size === 0) return false;
3868
+ return this.matcher.matchesAny(this.stopNodeExpressionsSet);
2257
3869
  }
2258
3870
  function tagExpWithClosingIndex(xmlData, i2, closingChar = ">") {
2259
- let attrBoundary;
2260
- let tagExp = "";
2261
- for (let index = i2; index < xmlData.length; index++) {
2262
- let ch = xmlData[index];
3871
+ let attrBoundary = 0;
3872
+ const len = xmlData.length;
3873
+ const closeCode0 = closingChar.charCodeAt(0);
3874
+ const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1;
3875
+ let result = "";
3876
+ let segmentStart = i2;
3877
+ for (let index = i2; index < len; index++) {
3878
+ const code = xmlData.charCodeAt(index);
2263
3879
  if (attrBoundary) {
2264
- if (ch === attrBoundary) attrBoundary = "";
2265
- } else if (ch === '"' || ch === "'") {
2266
- attrBoundary = ch;
2267
- } else if (ch === closingChar[0]) {
2268
- if (closingChar[1]) {
2269
- if (xmlData[index + 1] === closingChar[1]) {
2270
- return {
2271
- data: tagExp,
2272
- index
2273
- };
3880
+ if (code === attrBoundary) attrBoundary = 0;
3881
+ } else if (code === 34 || code === 39) {
3882
+ attrBoundary = code;
3883
+ } else if (code === closeCode0) {
3884
+ if (closeCode1 !== -1) {
3885
+ if (xmlData.charCodeAt(index + 1) === closeCode1) {
3886
+ result += xmlData.substring(segmentStart, index);
3887
+ return { data: result, index };
2274
3888
  }
2275
3889
  } else {
2276
- return {
2277
- data: tagExp,
2278
- index
2279
- };
3890
+ result += xmlData.substring(segmentStart, index);
3891
+ return { data: result, index };
2280
3892
  }
2281
- } else if (ch === " ") {
2282
- ch = " ";
3893
+ } else if (code === 9 && !attrBoundary) {
3894
+ result += xmlData.substring(segmentStart, index) + " ";
3895
+ segmentStart = index + 1;
2283
3896
  }
2284
- tagExp += ch;
2285
3897
  }
2286
3898
  }
2287
3899
  function findClosingIndex(xmlData, str, i2, errMsg) {
@@ -2292,6 +3904,11 @@ function findClosingIndex(xmlData, str, i2, errMsg) {
2292
3904
  return closingIndex + str.length - 1;
2293
3905
  }
2294
3906
  }
3907
+ function findClosingChar(xmlData, char, i2, errMsg) {
3908
+ const closingIndex = xmlData.indexOf(char, i2);
3909
+ if (closingIndex === -1) throw new Error(errMsg);
3910
+ return closingIndex;
3911
+ }
2295
3912
  function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
2296
3913
  const result = tagExpWithClosingIndex(xmlData, i2 + 1, closingChar);
2297
3914
  if (!result) return;
@@ -2323,10 +3940,12 @@ function readTagExp(xmlData, i2, removeNSPrefix, closingChar = ">") {
2323
3940
  function readStopNodeData(xmlData, tagName, i2) {
2324
3941
  const startIndex = i2;
2325
3942
  let openTagCount = 1;
2326
- for (; i2 < xmlData.length; i2++) {
3943
+ const xmllen = xmlData.length;
3944
+ for (; i2 < xmllen; i2++) {
2327
3945
  if (xmlData[i2] === "<") {
2328
- if (xmlData[i2 + 1] === "/") {
2329
- const closeIndex = findClosingIndex(xmlData, ">", i2, `${tagName} is not closed`);
3946
+ const c1 = xmlData.charCodeAt(i2 + 1);
3947
+ if (c1 === 47) {
3948
+ const closeIndex = findClosingChar(xmlData, ">", i2, `${tagName} is not closed`);
2330
3949
  let closeTagName = xmlData.substring(i2 + 2, closeIndex).trim();
2331
3950
  if (closeTagName === tagName) {
2332
3951
  openTagCount--;
@@ -2338,13 +3957,13 @@ function readStopNodeData(xmlData, tagName, i2) {
2338
3957
  }
2339
3958
  }
2340
3959
  i2 = closeIndex;
2341
- } else if (xmlData[i2 + 1] === "?") {
3960
+ } else if (c1 === 63) {
2342
3961
  const closeIndex = findClosingIndex(xmlData, "?>", i2 + 1, "StopNode is not closed.");
2343
3962
  i2 = closeIndex;
2344
- } else if (xmlData.substr(i2 + 1, 3) === "!--") {
3963
+ } else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 45 && xmlData.charCodeAt(i2 + 3) === 45) {
2345
3964
  const closeIndex = findClosingIndex(xmlData, "-->", i2 + 3, "StopNode is not closed.");
2346
3965
  i2 = closeIndex;
2347
- } else if (xmlData.substr(i2 + 1, 2) === "![") {
3966
+ } else if (c1 === 33 && xmlData.charCodeAt(i2 + 2) === 91) {
2348
3967
  const closeIndex = findClosingIndex(xmlData, "]]>", i2, "StopNode is not closed.") - 2;
2349
3968
  i2 = closeIndex;
2350
3969
  } else {
@@ -2374,14 +3993,6 @@ function parseValue(val, shouldParse, options) {
2374
3993
  }
2375
3994
  }
2376
3995
  }
2377
- function fromCodePoint(str, base, prefix) {
2378
- const codePoint = Number.parseInt(str, base);
2379
- if (codePoint >= 0 && codePoint <= 1114111) {
2380
- return String.fromCodePoint(codePoint);
2381
- } else {
2382
- return prefix + str + ";";
2383
- }
2384
- }
2385
3996
  function transformTagName(fn, tagName, tagExp, options) {
2386
3997
  if (fn) {
2387
3998
  const newTagName = fn(tagName);
@@ -2402,7 +4013,7 @@ function sanitizeName(name, options) {
2402
4013
  return name;
2403
4014
  }
2404
4015
 
2405
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/node2json.js
4016
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/node2json.js
2406
4017
  var METADATA_SYMBOL2 = XmlNode.getMetaDataSymbol();
2407
4018
  function stripAttributePrefix(attrs, prefix) {
2408
4019
  if (!attrs || typeof attrs !== "object") return {};
@@ -2511,7 +4122,7 @@ function isLeafTag(obj, options) {
2511
4122
  return false;
2512
4123
  }
2513
4124
 
2514
- // ../node_modules/.bun/fast-xml-parser@5.5.8/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
4125
+ // ../node_modules/.bun/fast-xml-parser@5.7.2/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
2515
4126
  var XMLParser = class {
2516
4127
  constructor(options) {
2517
4128
  this.externalEntities = {};
@@ -2535,8 +4146,7 @@ var XMLParser = class {
2535
4146
  throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
2536
4147
  }
2537
4148
  }
2538
- const orderedObjParser = new OrderedObjParser(this.options);
2539
- orderedObjParser.addExternalEntities(this.externalEntities);
4149
+ const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);
2540
4150
  const orderedResult = orderedObjParser.parseXml(xmlData);
2541
4151
  if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;
2542
4152
  else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);
@@ -2572,7 +4182,343 @@ var XMLParser = class {
2572
4182
  }
2573
4183
  };
2574
4184
 
2575
- // ../node_modules/.bun/@aws-sdk+xml-builder@3.972.16/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js
4185
+ // ../node_modules/.bun/@aws-sdk+xml-builder@3.972.22/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js
4186
+ var XML2 = {
4187
+ amp: "&",
4188
+ apos: "'",
4189
+ gt: ">",
4190
+ lt: "<",
4191
+ quot: '"'
4192
+ };
4193
+ var COMMON_HTML2 = {
4194
+ nbsp: "\xA0",
4195
+ copy: "\xA9",
4196
+ reg: "\xAE",
4197
+ trade: "\u2122",
4198
+ mdash: "\u2014",
4199
+ ndash: "\u2013",
4200
+ hellip: "\u2026",
4201
+ laquo: "\xAB",
4202
+ raquo: "\xBB",
4203
+ lsquo: "\u2018",
4204
+ rsquo: "\u2019",
4205
+ ldquo: "\u201C",
4206
+ rdquo: "\u201D",
4207
+ bull: "\u2022",
4208
+ para: "\xB6",
4209
+ sect: "\xA7",
4210
+ deg: "\xB0",
4211
+ frac12: "\xBD",
4212
+ frac14: "\xBC",
4213
+ frac34: "\xBE"
4214
+ };
4215
+ var CURRENCY2 = {
4216
+ cent: "\xA2",
4217
+ pound: "\xA3",
4218
+ curren: "\xA4",
4219
+ yen: "\xA5",
4220
+ euro: "\u20AC",
4221
+ dollar: "$",
4222
+ fnof: "\u0192",
4223
+ inr: "\u20B9",
4224
+ af: "\u060B",
4225
+ birr: "\u1265\u122D",
4226
+ peso: "\u20B1",
4227
+ rub: "\u20BD",
4228
+ won: "\u20A9",
4229
+ yuan: "\xA5",
4230
+ cedil: "\xB8"
4231
+ };
4232
+ var SPECIAL_CHARS2 = new Set("!?\\/[]$%{}^&*()<>|+");
4233
+ function validateEntityName3(name) {
4234
+ if (name[0] === "#") {
4235
+ throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
4236
+ }
4237
+ for (const ch of name) {
4238
+ if (SPECIAL_CHARS2.has(ch)) {
4239
+ throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
4240
+ }
4241
+ }
4242
+ return name;
4243
+ }
4244
+ function mergeEntityMaps2(...maps) {
4245
+ const out = /* @__PURE__ */ Object.create(null);
4246
+ for (const map of maps) {
4247
+ if (!map) {
4248
+ continue;
4249
+ }
4250
+ for (const key of Object.keys(map)) {
4251
+ const raw = map[key];
4252
+ if (typeof raw === "string") {
4253
+ out[key] = raw;
4254
+ } else if (raw && typeof raw === "object" && raw.val !== void 0) {
4255
+ const val = raw.val;
4256
+ if (typeof val === "string") {
4257
+ out[key] = val;
4258
+ }
4259
+ }
4260
+ }
4261
+ }
4262
+ return out;
4263
+ }
4264
+ var LIMIT_TIER_EXTERNAL2 = "external";
4265
+ var LIMIT_TIER_BASE2 = "base";
4266
+ var LIMIT_TIER_ALL2 = "all";
4267
+ function parseLimitTiers2(raw) {
4268
+ if (!raw || raw === LIMIT_TIER_EXTERNAL2) {
4269
+ return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]);
4270
+ }
4271
+ if (raw === LIMIT_TIER_ALL2) {
4272
+ return /* @__PURE__ */ new Set([LIMIT_TIER_ALL2]);
4273
+ }
4274
+ if (raw === LIMIT_TIER_BASE2) {
4275
+ return /* @__PURE__ */ new Set([LIMIT_TIER_BASE2]);
4276
+ }
4277
+ if (Array.isArray(raw)) {
4278
+ return new Set(raw);
4279
+ }
4280
+ return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL2]);
4281
+ }
4282
+ var NCR_LEVEL2 = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 });
4283
+ var XML10_ALLOWED_C02 = /* @__PURE__ */ new Set([9, 10, 13]);
4284
+ function parseNCRConfig2(ncr) {
4285
+ if (!ncr) {
4286
+ return { xmlVersion: 1, onLevel: NCR_LEVEL2.allow, nullLevel: NCR_LEVEL2.remove };
4287
+ }
4288
+ const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1;
4289
+ const onLevel = NCR_LEVEL2[ncr.onNCR ?? "allow"] ?? NCR_LEVEL2.allow;
4290
+ const nullLevel = NCR_LEVEL2[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL2.remove;
4291
+ const clampedNull = Math.max(nullLevel, NCR_LEVEL2.remove);
4292
+ return { xmlVersion, onLevel, nullLevel: clampedNull };
4293
+ }
4294
+ var EntityDecoderImpl = class EntityDecoderImpl2 {
4295
+ constructor(options = {}) {
4296
+ __publicField(this, "_limit");
4297
+ __publicField(this, "_maxTotalExpansions");
4298
+ __publicField(this, "_maxExpandedLength");
4299
+ __publicField(this, "_postCheck");
4300
+ __publicField(this, "_limitTiers");
4301
+ __publicField(this, "_numericAllowed");
4302
+ __publicField(this, "_baseMap");
4303
+ __publicField(this, "_externalMap");
4304
+ __publicField(this, "_inputMap");
4305
+ __publicField(this, "_totalExpansions");
4306
+ __publicField(this, "_expandedLength");
4307
+ __publicField(this, "_removeSet");
4308
+ __publicField(this, "_leaveSet");
4309
+ __publicField(this, "_ncrXmlVersion");
4310
+ __publicField(this, "_ncrOnLevel");
4311
+ __publicField(this, "_ncrNullLevel");
4312
+ this._limit = options.limit || {};
4313
+ this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
4314
+ this._maxExpandedLength = this._limit.maxExpandedLength || 0;
4315
+ this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r2) => r2;
4316
+ this._limitTiers = parseLimitTiers2(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL2);
4317
+ this._numericAllowed = options.numericAllowed ?? true;
4318
+ this._baseMap = mergeEntityMaps2(XML2, options.namedEntities || null);
4319
+ this._externalMap = /* @__PURE__ */ Object.create(null);
4320
+ this._inputMap = /* @__PURE__ */ Object.create(null);
4321
+ this._totalExpansions = 0;
4322
+ this._expandedLength = 0;
4323
+ this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
4324
+ this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
4325
+ const ncrCfg = parseNCRConfig2(options.ncr);
4326
+ this._ncrXmlVersion = ncrCfg.xmlVersion;
4327
+ this._ncrOnLevel = ncrCfg.onLevel;
4328
+ this._ncrNullLevel = ncrCfg.nullLevel;
4329
+ }
4330
+ setExternalEntities(map) {
4331
+ if (map) {
4332
+ for (const key of Object.keys(map)) {
4333
+ validateEntityName3(key);
4334
+ }
4335
+ }
4336
+ this._externalMap = mergeEntityMaps2(map);
4337
+ }
4338
+ addExternalEntity(key, value) {
4339
+ validateEntityName3(key);
4340
+ if (typeof value === "string" && value.indexOf("&") === -1) {
4341
+ this._externalMap[key] = value;
4342
+ }
4343
+ }
4344
+ addInputEntities(map) {
4345
+ this._totalExpansions = 0;
4346
+ this._expandedLength = 0;
4347
+ this._inputMap = mergeEntityMaps2(map);
4348
+ }
4349
+ reset() {
4350
+ this._inputMap = /* @__PURE__ */ Object.create(null);
4351
+ this._totalExpansions = 0;
4352
+ this._expandedLength = 0;
4353
+ return this;
4354
+ }
4355
+ setXmlVersion(version) {
4356
+ this._ncrXmlVersion = version === "1.1" || version === 1.1 ? 1.1 : 1;
4357
+ }
4358
+ decode(str) {
4359
+ if (typeof str !== "string" || str.length === 0) {
4360
+ return str;
4361
+ }
4362
+ const original = str;
4363
+ const chunks = [];
4364
+ const len = str.length;
4365
+ let last = 0;
4366
+ let i2 = 0;
4367
+ const limitExpansions = this._maxTotalExpansions > 0;
4368
+ const limitLength = this._maxExpandedLength > 0;
4369
+ const checkLimits = limitExpansions || limitLength;
4370
+ while (i2 < len) {
4371
+ if (str.charCodeAt(i2) !== 38) {
4372
+ i2++;
4373
+ continue;
4374
+ }
4375
+ let j2 = i2 + 1;
4376
+ while (j2 < len && str.charCodeAt(j2) !== 59 && j2 - i2 <= 32) {
4377
+ j2++;
4378
+ }
4379
+ if (j2 >= len || str.charCodeAt(j2) !== 59) {
4380
+ i2++;
4381
+ continue;
4382
+ }
4383
+ const token = str.slice(i2 + 1, j2);
4384
+ if (token.length === 0) {
4385
+ i2++;
4386
+ continue;
4387
+ }
4388
+ let replacement;
4389
+ let tier;
4390
+ if (this._removeSet.has(token)) {
4391
+ replacement = "";
4392
+ if (tier === void 0) {
4393
+ tier = LIMIT_TIER_EXTERNAL2;
4394
+ }
4395
+ } else if (this._leaveSet.has(token)) {
4396
+ i2++;
4397
+ continue;
4398
+ } else if (token.charCodeAt(0) === 35) {
4399
+ const ncrResult = this._resolveNCR(token);
4400
+ if (ncrResult === void 0) {
4401
+ i2++;
4402
+ continue;
4403
+ }
4404
+ replacement = ncrResult;
4405
+ tier = LIMIT_TIER_BASE2;
4406
+ } else {
4407
+ const resolved = this._resolveName(token);
4408
+ replacement = resolved?.value;
4409
+ tier = resolved?.tier;
4410
+ }
4411
+ if (replacement === void 0) {
4412
+ i2++;
4413
+ continue;
4414
+ }
4415
+ if (i2 > last) {
4416
+ chunks.push(str.slice(last, i2));
4417
+ }
4418
+ chunks.push(replacement);
4419
+ last = j2 + 1;
4420
+ i2 = last;
4421
+ if (checkLimits && this._tierCounts(tier)) {
4422
+ if (limitExpansions) {
4423
+ this._totalExpansions++;
4424
+ if (this._totalExpansions > this._maxTotalExpansions) {
4425
+ throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);
4426
+ }
4427
+ }
4428
+ if (limitLength) {
4429
+ const delta = replacement.length - (token.length + 2);
4430
+ if (delta > 0) {
4431
+ this._expandedLength += delta;
4432
+ if (this._expandedLength > this._maxExpandedLength) {
4433
+ throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`);
4434
+ }
4435
+ }
4436
+ }
4437
+ }
4438
+ }
4439
+ if (last < len) {
4440
+ chunks.push(str.slice(last));
4441
+ }
4442
+ const result = chunks.length === 0 ? str : chunks.join("");
4443
+ return this._postCheck(result, original);
4444
+ }
4445
+ _tierCounts(tier) {
4446
+ if (this._limitTiers.has(LIMIT_TIER_ALL2)) {
4447
+ return true;
4448
+ }
4449
+ return this._limitTiers.has(tier);
4450
+ }
4451
+ _resolveName(name) {
4452
+ if (name in this._inputMap) {
4453
+ return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL2 };
4454
+ }
4455
+ if (name in this._externalMap) {
4456
+ return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL2 };
4457
+ }
4458
+ if (name in this._baseMap) {
4459
+ return { value: this._baseMap[name], tier: LIMIT_TIER_BASE2 };
4460
+ }
4461
+ return void 0;
4462
+ }
4463
+ _classifyNCR(cp) {
4464
+ if (cp === 0) {
4465
+ return this._ncrNullLevel;
4466
+ }
4467
+ if (cp >= 55296 && cp <= 57343) {
4468
+ return NCR_LEVEL2.remove;
4469
+ }
4470
+ if (this._ncrXmlVersion === 1) {
4471
+ if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C02.has(cp)) {
4472
+ return NCR_LEVEL2.remove;
4473
+ }
4474
+ }
4475
+ return -1;
4476
+ }
4477
+ _applyNCRAction(action, token, cp) {
4478
+ switch (action) {
4479
+ case NCR_LEVEL2.allow:
4480
+ return String.fromCodePoint(cp);
4481
+ case NCR_LEVEL2.remove:
4482
+ return "";
4483
+ case NCR_LEVEL2.leave:
4484
+ return void 0;
4485
+ case NCR_LEVEL2.throw:
4486
+ throw new Error(`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`);
4487
+ default:
4488
+ return String.fromCodePoint(cp);
4489
+ }
4490
+ }
4491
+ _resolveNCR(token) {
4492
+ const second = token.charCodeAt(1);
4493
+ let cp;
4494
+ if (second === 120 || second === 88) {
4495
+ cp = parseInt(token.slice(2), 16);
4496
+ } else {
4497
+ cp = parseInt(token.slice(1), 10);
4498
+ }
4499
+ if (Number.isNaN(cp) || cp < 0 || cp > 1114111) {
4500
+ return void 0;
4501
+ }
4502
+ const minimum = this._classifyNCR(cp);
4503
+ if (!this._numericAllowed && minimum < NCR_LEVEL2.remove) {
4504
+ return void 0;
4505
+ }
4506
+ const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
4507
+ return this._applyNCRAction(effective, token, cp);
4508
+ }
4509
+ };
4510
+
4511
+ // ../node_modules/.bun/@aws-sdk+xml-builder@3.972.22/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js
4512
+ var entityDecoder = new EntityDecoderImpl({
4513
+ namedEntities: { ...XML2, ...COMMON_HTML2, ...CURRENCY2 },
4514
+ numericAllowed: true,
4515
+ limit: {
4516
+ maxTotalExpansions: Infinity
4517
+ },
4518
+ ncr: {
4519
+ xmlVersion: 1.1
4520
+ }
4521
+ });
2576
4522
  var parser = new XMLParser({
2577
4523
  attributeNamePrefix: "",
2578
4524
  processEntities: {
@@ -2580,6 +4526,21 @@ var parser = new XMLParser({
2580
4526
  maxTotalExpansions: Infinity
2581
4527
  },
2582
4528
  htmlEntities: true,
4529
+ entityDecoder: {
4530
+ setExternalEntities: (entities) => {
4531
+ entityDecoder.setExternalEntities(entities);
4532
+ },
4533
+ addInputEntities: (entities) => {
4534
+ entityDecoder.addInputEntities(entities);
4535
+ },
4536
+ reset: () => {
4537
+ entityDecoder.reset();
4538
+ },
4539
+ decode: (text) => {
4540
+ return entityDecoder.decode(text);
4541
+ },
4542
+ setXmlVersion: (version) => void {}
4543
+ },
2583
4544
  ignoreAttributes: false,
2584
4545
  ignoreDeclaration: true,
2585
4546
  parseTagValue: false,
@@ -2587,13 +4548,11 @@ var parser = new XMLParser({
2587
4548
  tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0,
2588
4549
  maxNestedTags: Infinity
2589
4550
  });
2590
- parser.addEntity("#xD", "\r");
2591
- parser.addEntity("#10", "\n");
2592
4551
  function parseXML(xmlString) {
2593
4552
  return parser.parse(xmlString, true);
2594
4553
  }
2595
4554
 
2596
- // ../node_modules/.bun/@aws-sdk+core@3.973.26/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js
4555
+ // ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js
2597
4556
  var XmlShapeDeserializer = class extends SerdeContextConfig {
2598
4557
  constructor(settings) {
2599
4558
  super();
@@ -2650,8 +4609,8 @@ var XmlShapeDeserializer = class extends SerdeContextConfig {
2650
4609
  return buffer2;
2651
4610
  }
2652
4611
  const sourceArray = Array.isArray(source) ? source : [source];
2653
- for (const v2 of sourceArray) {
2654
- buffer2.push(this.readSchema(listValue, v2));
4612
+ for (const v of sourceArray) {
4613
+ buffer2.push(this.readSchema(listValue, v));
2655
4614
  }
2656
4615
  return buffer2;
2657
4616
  }
@@ -2734,7 +4693,7 @@ var XmlShapeDeserializer = class extends SerdeContextConfig {
2734
4693
  }
2735
4694
  };
2736
4695
 
2737
- // ../node_modules/.bun/@aws-sdk+core@3.973.26/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js
4696
+ // ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js
2738
4697
  var QueryShapeSerializer = class extends SerdeContextConfig {
2739
4698
  constructor(settings) {
2740
4699
  super();
@@ -2831,8 +4790,9 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
2831
4790
  const memberSchema = ns.getValueSchema();
2832
4791
  const flat = ns.getMergedTraits().xmlFlattened;
2833
4792
  let i2 = 1;
2834
- for (const [k2, v2] of Object.entries(value)) {
2835
- if (v2 == null) {
4793
+ for (const k2 in value) {
4794
+ const v = value[k2];
4795
+ if (v == null) {
2836
4796
  continue;
2837
4797
  }
2838
4798
  const keyTraits = keySchema.getMergedTraits();
@@ -2842,7 +4802,7 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
2842
4802
  const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName);
2843
4803
  const valueKey = flat ? `${prefix}${i2}.${valueSuffix}` : `${prefix}entry.${i2}.${valueSuffix}`;
2844
4804
  this.write(keySchema, k2, key);
2845
- this.write(memberSchema, v2, valueKey);
4805
+ this.write(memberSchema, v, valueKey);
2846
4806
  ++i2;
2847
4807
  }
2848
4808
  }
@@ -2862,9 +4822,9 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
2862
4822
  if (!didWriteMember && ns.isUnionSchema()) {
2863
4823
  const { $unknown } = value;
2864
4824
  if (Array.isArray($unknown)) {
2865
- const [k2, v2] = $unknown;
4825
+ const [k2, v] = $unknown;
2866
4826
  const key = `${prefix}${k2}`;
2867
- this.write(15, v2, key);
4827
+ this.write(15, v, key);
2868
4828
  }
2869
4829
  }
2870
4830
  }
@@ -2903,7 +4863,7 @@ var QueryShapeSerializer = class extends SerdeContextConfig {
2903
4863
  }
2904
4864
  };
2905
4865
 
2906
- // ../node_modules/.bun/@aws-sdk+core@3.973.26/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js
4866
+ // ../node_modules/.bun/@aws-sdk+core@3.974.8/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js
2907
4867
  var AwsQueryProtocol = class extends RpcProtocol {
2908
4868
  constructor(options) {
2909
4869
  super({
@@ -2943,9 +4903,7 @@ var AwsQueryProtocol = class extends RpcProtocol {
2943
4903
  if (!request.path.endsWith("/")) {
2944
4904
  request.path += "/";
2945
4905
  }
2946
- Object.assign(request.headers, {
2947
- "content-type": `application/x-www-form-urlencoded`
2948
- });
4906
+ request.headers["content-type"] = "application/x-www-form-urlencoded";
2949
4907
  if (deref(operationSchema.input) === "unit" || !request.body) {
2950
4908
  request.body = "";
2951
4909
  }
@@ -2978,11 +4936,8 @@ var AwsQueryProtocol = class extends RpcProtocol {
2978
4936
  if (bytes.byteLength > 0) {
2979
4937
  Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
2980
4938
  }
2981
- const output = {
2982
- $metadata: this.deserializeMetadata(response),
2983
- ...dataObject
2984
- };
2985
- return output;
4939
+ dataObject.$metadata = this.deserializeMetadata(response);
4940
+ return dataObject;
2986
4941
  }
2987
4942
  useNestedResult() {
2988
4943
  return true;
@@ -3038,198 +4993,422 @@ var AwsQueryProtocol = class extends RpcProtocol {
3038
4993
  }
3039
4994
  };
3040
4995
 
3041
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js
3042
- var F = "required";
3043
- var G = "type";
3044
- var H = "fn";
3045
- var I = "argv";
3046
- var J = "ref";
3047
- var a = false;
4996
+ // ../node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.25/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
4997
+ var signatureV4CrtContainer = {
4998
+ CrtSignerV4: null
4999
+ };
5000
+
5001
+ // ../node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.25/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
5002
+ var SignatureV4MultiRegion = class {
5003
+ constructor(options) {
5004
+ __publicField(this, "sigv4aSigner");
5005
+ __publicField(this, "sigv4Signer");
5006
+ __publicField(this, "signerOptions");
5007
+ this.sigv4Signer = new SignatureV4S3Express(options);
5008
+ this.signerOptions = options;
5009
+ }
5010
+ static sigv4aDependency() {
5011
+ if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
5012
+ return "crt";
5013
+ } else if (typeof signatureV4aContainer.SignatureV4a === "function") {
5014
+ return "js";
5015
+ }
5016
+ return "none";
5017
+ }
5018
+ async sign(requestToSign, options = {}) {
5019
+ if (options.signingRegion === "*") {
5020
+ return this.getSigv4aSigner().sign(requestToSign, options);
5021
+ }
5022
+ return this.sigv4Signer.sign(requestToSign, options);
5023
+ }
5024
+ async signWithCredentials(requestToSign, credentials, options = {}) {
5025
+ if (options.signingRegion === "*") {
5026
+ const signer = this.getSigv4aSigner();
5027
+ const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
5028
+ if (CrtSignerV4 && signer instanceof CrtSignerV4) {
5029
+ return signer.signWithCredentials(requestToSign, credentials, options);
5030
+ } else {
5031
+ throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
5032
+ }
5033
+ }
5034
+ return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
5035
+ }
5036
+ async presign(originalRequest, options = {}) {
5037
+ if (options.signingRegion === "*") {
5038
+ const signer = this.getSigv4aSigner();
5039
+ const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
5040
+ if (CrtSignerV4 && signer instanceof CrtSignerV4) {
5041
+ return signer.presign(originalRequest, options);
5042
+ } else {
5043
+ throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
5044
+ }
5045
+ }
5046
+ return this.sigv4Signer.presign(originalRequest, options);
5047
+ }
5048
+ async presignWithCredentials(originalRequest, credentials, options = {}) {
5049
+ if (options.signingRegion === "*") {
5050
+ throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
5051
+ }
5052
+ return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
5053
+ }
5054
+ getSigv4aSigner() {
5055
+ if (!this.sigv4aSigner) {
5056
+ const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
5057
+ const JsSigV4aSigner = signatureV4aContainer.SignatureV4a;
5058
+ if (this.signerOptions.runtime === "node") {
5059
+ if (!CrtSignerV4 && !JsSigV4aSigner) {
5060
+ throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
5061
+ }
5062
+ if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
5063
+ this.sigv4aSigner = new CrtSignerV4({
5064
+ ...this.signerOptions,
5065
+ signingAlgorithm: 1
5066
+ });
5067
+ } else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
5068
+ this.sigv4aSigner = new JsSigV4aSigner({
5069
+ ...this.signerOptions
5070
+ });
5071
+ } else {
5072
+ throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
5073
+ }
5074
+ } else {
5075
+ if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
5076
+ throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");
5077
+ }
5078
+ this.sigv4aSigner = new JsSigV4aSigner({
5079
+ ...this.signerOptions
5080
+ });
5081
+ }
5082
+ }
5083
+ return this.sigv4aSigner;
5084
+ }
5085
+ };
5086
+
5087
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js
5088
+ var q = "ref";
5089
+ var a = -1;
3048
5090
  var b = true;
3049
- var c = "booleanEquals";
3050
- var d = "stringEquals";
3051
- var e = "sigv4";
3052
- var f = "sts";
3053
- var g = "us-east-1";
3054
- var h = "endpoint";
3055
- var i = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
3056
- var j = "tree";
3057
- var k = "error";
3058
- var l = "getAttr";
3059
- var m = { [F]: false, [G]: "string" };
3060
- var n = { [F]: true, default: false, [G]: "boolean" };
3061
- var o = { [J]: "Endpoint" };
3062
- var p = { [H]: "isSet", [I]: [{ [J]: "Region" }] };
3063
- var q = { [J]: "Region" };
3064
- var r = { [H]: "aws.partition", [I]: [q], assign: "PartitionResult" };
3065
- var s = { [J]: "UseFIPS" };
3066
- var t = { [J]: "UseDualStack" };
3067
- var u = {
3068
- url: "https://sts.amazonaws.com",
3069
- properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] },
3070
- headers: {}
3071
- };
3072
- var v = {};
3073
- var w = { conditions: [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h };
3074
- var x = { [H]: c, [I]: [s, true] };
3075
- var y = { [H]: c, [I]: [t, true] };
3076
- var z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] };
3077
- var A = { [J]: "PartitionResult" };
3078
- var B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] };
3079
- var C = [{ [H]: "isSet", [I]: [o] }];
3080
- var D = [x];
3081
- var E = [y];
5091
+ var c = "isSet";
5092
+ var d = "PartitionResult";
5093
+ var e = "booleanEquals";
5094
+ var f = "stringEquals";
5095
+ var g = "getAttr";
5096
+ var h = "us-east-1";
5097
+ var i = "sigv4";
5098
+ var j = "sts";
5099
+ var k = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
5100
+ var l = { [q]: "Endpoint" };
5101
+ var m = { [q]: "Region" };
5102
+ var n = { [q]: d };
5103
+ var o = {};
5104
+ var p = [m];
3082
5105
  var _data = {
3083
- version: "1.0",
3084
- parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n },
3085
- rules: [
3086
- {
3087
- conditions: [
3088
- { [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] },
3089
- { [H]: "not", [I]: C },
3090
- p,
3091
- r,
3092
- { [H]: c, [I]: [s, a] },
3093
- { [H]: c, [I]: [t, a] }
3094
- ],
3095
- rules: [
3096
- { conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h },
3097
- { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h },
3098
- { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h },
3099
- { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h },
3100
- w,
3101
- { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h },
3102
- { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h },
3103
- { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h },
3104
- { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h },
3105
- { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h },
3106
- { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h },
3107
- { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h },
3108
- { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h },
3109
- { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h },
3110
- { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h },
3111
- { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h },
3112
- {
3113
- endpoint: {
3114
- url: i,
3115
- properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] },
3116
- headers: v
3117
- },
3118
- [G]: h
3119
- }
3120
- ],
3121
- [G]: j
3122
- },
3123
- {
3124
- conditions: C,
3125
- rules: [
3126
- { conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k },
3127
- { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k },
3128
- { endpoint: { url: o, properties: v, headers: v }, [G]: h }
3129
- ],
3130
- [G]: j
3131
- },
3132
- {
3133
- conditions: [p],
3134
- rules: [
3135
- {
3136
- conditions: [r],
3137
- rules: [
3138
- {
3139
- conditions: [x, y],
3140
- rules: [
3141
- {
3142
- conditions: [{ [H]: c, [I]: [b, z] }, B],
3143
- rules: [
3144
- {
3145
- endpoint: {
3146
- url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
3147
- properties: v,
3148
- headers: v
3149
- },
3150
- [G]: h
3151
- }
3152
- ],
3153
- [G]: j
3154
- },
3155
- { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }
3156
- ],
3157
- [G]: j
3158
- },
3159
- {
3160
- conditions: D,
3161
- rules: [
3162
- {
3163
- conditions: [{ [H]: c, [I]: [z, b] }],
3164
- rules: [
3165
- {
3166
- conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }],
3167
- endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v },
3168
- [G]: h
3169
- },
3170
- {
3171
- endpoint: {
3172
- url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",
3173
- properties: v,
3174
- headers: v
3175
- },
3176
- [G]: h
3177
- }
3178
- ],
3179
- [G]: j
3180
- },
3181
- { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }
3182
- ],
3183
- [G]: j
3184
- },
3185
- {
3186
- conditions: E,
3187
- rules: [
3188
- {
3189
- conditions: [B],
3190
- rules: [
3191
- {
3192
- endpoint: {
3193
- url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",
3194
- properties: v,
3195
- headers: v
3196
- },
3197
- [G]: h
3198
- }
3199
- ],
3200
- [G]: j
3201
- },
3202
- { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }
3203
- ],
3204
- [G]: j
3205
- },
3206
- w,
3207
- { endpoint: { url: i, properties: v, headers: v }, [G]: h }
3208
- ],
3209
- [G]: j
3210
- }
3211
- ],
3212
- [G]: j
3213
- },
3214
- { error: "Invalid Configuration: Missing Region", [G]: k }
5106
+ conditions: [
5107
+ [c, [l]],
5108
+ [c, p],
5109
+ ["aws.partition", p, d],
5110
+ [e, [{ [q]: "UseFIPS" }, b]],
5111
+ [e, [{ [q]: "UseDualStack" }, b]],
5112
+ [f, [m, "aws-global"]],
5113
+ [e, [{ [q]: "UseGlobalEndpoint" }, b]],
5114
+ [f, [m, "eu-central-1"]],
5115
+ [e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
5116
+ [e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
5117
+ [f, [m, "ap-south-1"]],
5118
+ [f, [m, "eu-north-1"]],
5119
+ [f, [m, "eu-west-1"]],
5120
+ [f, [m, "eu-west-2"]],
5121
+ [f, [m, "eu-west-3"]],
5122
+ [f, [m, "sa-east-1"]],
5123
+ [f, [m, h]],
5124
+ [f, [m, "us-east-2"]],
5125
+ [f, [m, "us-west-2"]],
5126
+ [f, [m, "us-west-1"]],
5127
+ [f, [m, "ca-central-1"]],
5128
+ [f, [m, "ap-southeast-1"]],
5129
+ [f, [m, "ap-northeast-1"]],
5130
+ [f, [m, "ap-southeast-2"]],
5131
+ [f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]]
5132
+ ],
5133
+ results: [
5134
+ [a],
5135
+ ["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
5136
+ [k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
5137
+ [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
5138
+ [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
5139
+ [l, o],
5140
+ ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
5141
+ [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
5142
+ ["https://sts.{Region}.amazonaws.com", o],
5143
+ ["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
5144
+ [a, "FIPS is enabled but this partition does not support FIPS"],
5145
+ ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
5146
+ [a, "DualStack is enabled but this partition does not support DualStack"],
5147
+ [k, o],
5148
+ [a, "Invalid Configuration: Missing Region"]
3215
5149
  ]
3216
5150
  };
3217
- var ruleSet = _data;
5151
+ var root = 2;
5152
+ var r = 1e8;
5153
+ var nodes = new Int32Array([
5154
+ -1,
5155
+ 1,
5156
+ -1,
5157
+ 0,
5158
+ 30,
5159
+ 3,
5160
+ 1,
5161
+ 4,
5162
+ r + 14,
5163
+ 2,
5164
+ 5,
5165
+ r + 14,
5166
+ 3,
5167
+ 25,
5168
+ 6,
5169
+ 4,
5170
+ 24,
5171
+ 7,
5172
+ 5,
5173
+ r + 1,
5174
+ 8,
5175
+ 6,
5176
+ 9,
5177
+ r + 13,
5178
+ 7,
5179
+ r + 1,
5180
+ 10,
5181
+ 10,
5182
+ r + 1,
5183
+ 11,
5184
+ 11,
5185
+ r + 1,
5186
+ 12,
5187
+ 12,
5188
+ r + 1,
5189
+ 13,
5190
+ 13,
5191
+ r + 1,
5192
+ 14,
5193
+ 14,
5194
+ r + 1,
5195
+ 15,
5196
+ 15,
5197
+ r + 1,
5198
+ 16,
5199
+ 16,
5200
+ r + 1,
5201
+ 17,
5202
+ 17,
5203
+ r + 1,
5204
+ 18,
5205
+ 18,
5206
+ r + 1,
5207
+ 19,
5208
+ 19,
5209
+ r + 1,
5210
+ 20,
5211
+ 20,
5212
+ r + 1,
5213
+ 21,
5214
+ 21,
5215
+ r + 1,
5216
+ 22,
5217
+ 22,
5218
+ r + 1,
5219
+ 23,
5220
+ 23,
5221
+ r + 1,
5222
+ r + 2,
5223
+ 8,
5224
+ r + 11,
5225
+ r + 12,
5226
+ 4,
5227
+ 28,
5228
+ 26,
5229
+ 9,
5230
+ 27,
5231
+ r + 10,
5232
+ 24,
5233
+ r + 8,
5234
+ r + 9,
5235
+ 8,
5236
+ 29,
5237
+ r + 7,
5238
+ 9,
5239
+ r + 6,
5240
+ r + 7,
5241
+ 3,
5242
+ r + 3,
5243
+ 31,
5244
+ 4,
5245
+ r + 4,
5246
+ r + 5
5247
+ ]);
5248
+ var bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
3218
5249
 
3219
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js
5250
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js
3220
5251
  var cache = new EndpointCache({
3221
5252
  size: 50,
3222
5253
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
3223
5254
  });
3224
5255
  var defaultEndpointResolver = (endpointParams, context = {}) => {
3225
- return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
5256
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
3226
5257
  endpointParams,
3227
5258
  logger: context.logger
3228
5259
  }));
3229
5260
  };
3230
5261
  customEndpointFunctions.aws = awsEndpointFunctions;
3231
5262
 
3232
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js
5263
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js
5264
+ var createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
5265
+ if (!input) {
5266
+ throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
5267
+ }
5268
+ const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
5269
+ const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor?.getEndpointParameterInstructions;
5270
+ if (!instructionsFn) {
5271
+ throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
5272
+ }
5273
+ const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
5274
+ return Object.assign(defaultParameters, endpointParameters);
5275
+ };
5276
+ var _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
5277
+ return {
5278
+ operation: getSmithyContext(context).operation,
5279
+ region: await normalizeProvider(config.region)() || (() => {
5280
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
5281
+ })()
5282
+ };
5283
+ };
5284
+ var defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
5285
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
5286
+ return {
5287
+ schemeId: "aws.auth#sigv4",
5288
+ signingProperties: {
5289
+ name: "sts",
5290
+ region: authParameters.region
5291
+ },
5292
+ propertiesExtractor: (config, context) => ({
5293
+ signingProperties: {
5294
+ config,
5295
+ context
5296
+ }
5297
+ })
5298
+ };
5299
+ }
5300
+ function createAwsAuthSigv4aHttpAuthOption(authParameters) {
5301
+ return {
5302
+ schemeId: "aws.auth#sigv4a",
5303
+ signingProperties: {
5304
+ name: "sts",
5305
+ region: authParameters.region
5306
+ },
5307
+ propertiesExtractor: (config, context) => ({
5308
+ signingProperties: {
5309
+ config,
5310
+ context
5311
+ }
5312
+ })
5313
+ };
5314
+ }
5315
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
5316
+ return {
5317
+ schemeId: "smithy.api#noAuth"
5318
+ };
5319
+ }
5320
+ var createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver2, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
5321
+ const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
5322
+ const endpoint = defaultEndpointResolver2(authParameters);
5323
+ const authSchemes = endpoint.properties?.authSchemes;
5324
+ if (!authSchemes) {
5325
+ return defaultHttpAuthSchemeResolver(authParameters);
5326
+ }
5327
+ const options = [];
5328
+ for (const scheme of authSchemes) {
5329
+ const { name: resolvedName, properties = {}, ...rest } = scheme;
5330
+ const name = resolvedName.toLowerCase();
5331
+ if (resolvedName !== name) {
5332
+ console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
5333
+ }
5334
+ let schemeId;
5335
+ if (name === "sigv4a") {
5336
+ schemeId = "aws.auth#sigv4a";
5337
+ const sigv4Present = authSchemes.find((s) => {
5338
+ const name2 = s.name.toLowerCase();
5339
+ return name2 !== "sigv4a" && name2.startsWith("sigv4");
5340
+ });
5341
+ if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
5342
+ continue;
5343
+ }
5344
+ } else if (name.startsWith("sigv4")) {
5345
+ schemeId = "aws.auth#sigv4";
5346
+ } else {
5347
+ throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
5348
+ }
5349
+ const createOption = createHttpAuthOptionFunctions[schemeId];
5350
+ if (!createOption) {
5351
+ throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
5352
+ }
5353
+ const option = createOption(authParameters);
5354
+ option.schemeId = schemeId;
5355
+ option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties };
5356
+ options.push(option);
5357
+ }
5358
+ return options;
5359
+ };
5360
+ return endpointRuleSetHttpAuthSchemeProvider;
5361
+ };
5362
+ var _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
5363
+ const options = [];
5364
+ switch (authParameters.operation) {
5365
+ case "AssumeRoleWithWebIdentity": {
5366
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
5367
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
5368
+ break;
5369
+ }
5370
+ default: {
5371
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
5372
+ options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
5373
+ }
5374
+ }
5375
+ return options;
5376
+ };
5377
+ var defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
5378
+ "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
5379
+ "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
5380
+ "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption
5381
+ });
5382
+ var resolveStsAuthConfig = (input) => Object.assign(input, {
5383
+ stsClientCtor: STSClient
5384
+ });
5385
+ var resolveHttpAuthSchemeConfig = (config) => {
5386
+ const config_0 = resolveStsAuthConfig(config);
5387
+ const config_1 = resolveAwsSdkSigV4Config(config_0);
5388
+ const config_2 = resolveAwsSdkSigV4AConfig(config_1);
5389
+ return Object.assign(config_2, {
5390
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
5391
+ });
5392
+ };
5393
+
5394
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js
5395
+ var resolveClientEndpointParameters = (options) => {
5396
+ return Object.assign(options, {
5397
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
5398
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
5399
+ useGlobalEndpoint: options.useGlobalEndpoint ?? false,
5400
+ defaultSigningName: "sts"
5401
+ });
5402
+ };
5403
+ var commonParams = {
5404
+ UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
5405
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
5406
+ Endpoint: { type: "builtInParams", name: "endpoint" },
5407
+ Region: { type: "builtInParams", name: "region" },
5408
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
5409
+ };
5410
+
5411
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js
3233
5412
  var STSServiceException = class _STSServiceException extends ServiceException {
3234
5413
  constructor(options) {
3235
5414
  super(options);
@@ -3237,7 +5416,7 @@ var STSServiceException = class _STSServiceException extends ServiceException {
3237
5416
  }
3238
5417
  };
3239
5418
 
3240
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js
5419
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js
3241
5420
  var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
3242
5421
  constructor(opts) {
3243
5422
  super({
@@ -3319,11 +5498,12 @@ var IDPCommunicationErrorException = class _IDPCommunicationErrorException exten
3319
5498
  });
3320
5499
  __publicField(this, "name", "IDPCommunicationErrorException");
3321
5500
  __publicField(this, "$fault", "client");
5501
+ __publicField(this, "$retryable", {});
3322
5502
  Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
3323
5503
  }
3324
5504
  };
3325
5505
 
3326
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js
5506
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js
3327
5507
  var _A = "Arn";
3328
5508
  var _AKI = "AccessKeyId";
3329
5509
  var _AR = "AssumeRole";
@@ -3514,7 +5694,7 @@ var AssumeRoleWithWebIdentity$ = [
3514
5694
  () => AssumeRoleWithWebIdentityResponse$
3515
5695
  ];
3516
5696
 
3517
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js
5697
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js
3518
5698
  var getRuntimeConfig = (config) => {
3519
5699
  return {
3520
5700
  apiVersion: "2011-06-15",
@@ -3530,6 +5710,11 @@ var getRuntimeConfig = (config) => {
3530
5710
  identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
3531
5711
  signer: new AwsSdkSigV4Signer()
3532
5712
  },
5713
+ {
5714
+ schemeId: "aws.auth#sigv4a",
5715
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
5716
+ signer: new AwsSdkSigV4ASigner()
5717
+ },
3533
5718
  {
3534
5719
  schemeId: "smithy.api#noAuth",
3535
5720
  identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
@@ -3546,13 +5731,14 @@ var getRuntimeConfig = (config) => {
3546
5731
  serviceTarget: "AWSSecurityTokenServiceV20110615"
3547
5732
  },
3548
5733
  serviceId: config?.serviceId ?? "STS",
5734
+ signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
3549
5735
  urlParser: config?.urlParser ?? parseUrl,
3550
5736
  utf8Decoder: config?.utf8Decoder ?? fromUtf8,
3551
5737
  utf8Encoder: config?.utf8Encoder ?? toUtf8
3552
5738
  };
3553
5739
  };
3554
5740
 
3555
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js
5741
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js
3556
5742
  var getRuntimeConfig2 = (config) => {
3557
5743
  emitWarningIfUnsupportedVersion2(process.version);
3558
5744
  const defaultsMode = resolveDefaultsModeConfig(config);
@@ -3577,6 +5763,11 @@ var getRuntimeConfig2 = (config) => {
3577
5763
  identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
3578
5764
  signer: new AwsSdkSigV4Signer()
3579
5765
  },
5766
+ {
5767
+ schemeId: "aws.auth#sigv4a",
5768
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
5769
+ signer: new AwsSdkSigV4ASigner()
5770
+ },
3580
5771
  {
3581
5772
  schemeId: "smithy.api#noAuth",
3582
5773
  identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
@@ -3591,6 +5782,7 @@ var getRuntimeConfig2 = (config) => {
3591
5782
  default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE
3592
5783
  }, config),
3593
5784
  sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
5785
+ sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
3594
5786
  streamCollector: config?.streamCollector ?? streamCollector,
3595
5787
  useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
3596
5788
  useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
@@ -3598,7 +5790,7 @@ var getRuntimeConfig2 = (config) => {
3598
5790
  };
3599
5791
  };
3600
5792
 
3601
- // ../node_modules/.bun/@aws-sdk+region-config-resolver@3.972.10/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js
5793
+ // ../node_modules/.bun/@aws-sdk+region-config-resolver@3.972.13/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/stsRegionDefaultResolver.js
3602
5794
  function stsRegionDefaultResolver(loaderConfig = {}) {
3603
5795
  return loadConfig({
3604
5796
  ...NODE_REGION_CONFIG_OPTIONS,
@@ -3614,7 +5806,7 @@ var warning = {
3614
5806
  silence: false
3615
5807
  };
3616
5808
 
3617
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js
5809
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js
3618
5810
  var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
3619
5811
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3620
5812
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
@@ -3653,14 +5845,14 @@ var resolveHttpAuthRuntimeConfig = (config) => {
3653
5845
  };
3654
5846
  };
3655
5847
 
3656
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js
5848
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js
3657
5849
  var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
3658
5850
  const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
3659
5851
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
3660
5852
  return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
3661
5853
  };
3662
5854
 
3663
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js
5855
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js
3664
5856
  var STSClient = class extends Client {
3665
5857
  constructor(...[configuration]) {
3666
5858
  const _config_0 = getRuntimeConfig2(configuration || {});
@@ -3686,7 +5878,8 @@ var STSClient = class extends Client {
3686
5878
  this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
3687
5879
  httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
3688
5880
  identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
3689
- "aws.auth#sigv4": config.credentials
5881
+ "aws.auth#sigv4": config.credentials,
5882
+ "aws.auth#sigv4a": config.credentials
3690
5883
  })
3691
5884
  }));
3692
5885
  this.middlewareStack.use(getHttpSigningPlugin(this.config));
@@ -3696,19 +5889,19 @@ var STSClient = class extends Client {
3696
5889
  }
3697
5890
  };
3698
5891
 
3699
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js
5892
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js
3700
5893
  var AssumeRoleCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
3701
5894
  return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
3702
5895
  }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() {
3703
5896
  };
3704
5897
 
3705
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js
5898
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js
3706
5899
  var AssumeRoleWithWebIdentityCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
3707
5900
  return [getEndpointPlugin(config, Command2.getEndpointParameterInstructions())];
3708
5901
  }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() {
3709
5902
  };
3710
5903
 
3711
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js
5904
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js
3712
5905
  var commands = {
3713
5906
  AssumeRoleCommand,
3714
5907
  AssumeRoleWithWebIdentityCommand
@@ -3717,7 +5910,7 @@ var STS = class extends STSClient {
3717
5910
  };
3718
5911
  createAggregatedClient(commands, STS);
3719
5912
 
3720
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js
5913
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js
3721
5914
  var getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
3722
5915
  if (typeof assumedRoleUser?.Arn === "string") {
3723
5916
  const arnComponents = assumedRoleUser.Arn.split(":");
@@ -3817,7 +6010,7 @@ var isH2 = (requestHandler) => {
3817
6010
  return requestHandler?.metadata?.handlerProtocol === "h2";
3818
6011
  };
3819
6012
 
3820
- // ../node_modules/.bun/@aws-sdk+nested-clients@3.996.18/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js
6013
+ // ../node_modules/.bun/@aws-sdk+nested-clients@3.997.6/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js
3821
6014
  var getCustomizableStsClientCtor = (baseCtor, customizations) => {
3822
6015
  if (!customizations)
3823
6016
  return baseCtor;