@qqbrowser/openclaw-qbot 0.10.11 → 0.10.13

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 (752) hide show
  1. package/dist/build-info.json +3 -3
  2. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  3. package/dist/canvas-host/a2ui/a2ui.bundle.js +63 -53
  4. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/auth/httpAuthSchemeProvider.js +4 -4
  5. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/bdd.js +2 -2
  6. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js +5 -5
  7. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +45 -50
  8. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/models/BedrockRuntimeServiceException.js +3 -3
  9. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.browser.js +16 -18
  10. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js +21 -26
  11. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.native.js +2 -2
  12. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.shared.js +9 -10
  13. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/schemas/schemas_0.js +7 -4
  14. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntime.js +1 -1
  15. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js +7 -10
  16. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthSchemeProvider.js +1 -1
  17. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ApplyGuardrailCommand.js +2 -2
  18. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseCommand.js +2 -2
  19. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseStreamCommand.js +2 -2
  20. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/CountTokensCommand.js +2 -2
  21. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/GetAsyncInvokeCommand.js +2 -2
  22. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelCommand.js +2 -2
  23. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js +2 -2
  24. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithResponseStreamCommand.js +2 -2
  25. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ListAsyncInvokesCommand.js +2 -2
  26. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/StartAsyncInvokeCommand.js +2 -2
  27. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/bdd.js +1 -1
  28. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js +2 -2
  29. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/BedrockRuntimeServiceException.js +1 -1
  30. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.browser.js +6 -8
  31. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js +6 -11
  32. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.native.js +1 -1
  33. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.shared.js +3 -4
  34. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js +3 -3
  35. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js +7 -4
  36. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +13 -46
  37. package/node_modules/@aws-sdk/core/dist-cjs/index.js +67 -55
  38. package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -2
  39. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +595 -0
  40. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +717 -2
  41. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +588 -0
  42. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
  43. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +54 -39
  44. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +59 -0
  45. package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
  46. package/node_modules/@aws-sdk/core/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.js +1 -1
  47. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +36 -0
  48. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +26 -4
  49. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +37 -0
  50. package/node_modules/@aws-sdk/{middleware-host-header/dist-es/index.js → core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js} +1 -1
  51. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.js +3 -0
  52. package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.js +1 -1
  53. package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/check-features.js +2 -2
  54. package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/user-agent-middleware.js +2 -2
  55. package/node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/awsRegionConfig.js +2 -0
  56. package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.js +1 -2
  57. package/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js +1 -1
  58. package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/aws.js +1 -1
  59. package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.js +1 -1
  60. package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/partition.js +1 -1
  61. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +1 -0
  62. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/isIpAddress.js +1 -0
  63. package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.js +1 -1
  64. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/resolveEndpoint.js +1 -0
  65. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/types/EndpointError.js +1 -0
  66. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.browser.js +1 -0
  67. package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.js +1 -1
  68. package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.js +1 -1
  69. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +1 -1
  70. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +1 -1
  71. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +1 -1
  72. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -1
  73. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +1 -1
  74. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +1 -1
  75. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js +2 -2
  76. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +7 -6
  77. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
  78. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +1 -1
  79. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +1 -2
  80. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js +1 -1
  81. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +1 -2
  82. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +26 -11
  83. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +1 -1
  84. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +2 -3
  85. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +1 -1
  86. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +2 -2
  87. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +2 -3
  88. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js +1 -1
  89. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +2 -0
  90. package/node_modules/@aws-sdk/{util-format-url/dist-es/index.js → core/dist-es/submodules/util/util-format-url/format-url.js} +1 -1
  91. package/node_modules/@aws-sdk/core/package.json +39 -17
  92. package/node_modules/@aws-sdk/core/util.js +5 -0
  93. package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +2 -2
  94. package/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js +1 -1
  95. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  96. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +2 -2
  97. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +2 -2
  98. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +15 -9
  99. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +10 -10
  100. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +7 -5
  101. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js +1 -1
  102. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.browser.js +1 -1
  103. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +13 -7
  104. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js +4 -4
  105. package/node_modules/@aws-sdk/credential-provider-http/package.json +18 -12
  106. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +9 -10
  107. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js +1 -1
  108. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js +1 -2
  109. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js +1 -1
  110. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js +1 -1
  111. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -14
  112. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +14 -15
  113. package/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js +2 -3
  114. package/node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js +1 -2
  115. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -8
  116. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +7 -8
  117. package/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js +1 -2
  118. package/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js +1 -1
  119. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -12
  120. package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +7 -8
  121. package/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js +1 -1
  122. package/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js +1 -2
  123. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -6
  124. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +16 -17
  125. package/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js +1 -2
  126. package/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js +2 -3
  127. package/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js +1 -1
  128. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -8
  129. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +3 -4
  130. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +1 -34
  131. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js +1 -2
  132. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -7
  133. package/node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js +2 -2
  134. package/node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventStreamPayloadHandler.js +1 -1
  135. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -5
  136. package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +3 -3
  137. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +1 -1
  138. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +1 -1
  139. package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
  140. package/node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js +13 -15
  141. package/node_modules/@aws-sdk/middleware-websocket/dist-es/WebSocketFetchHandler.js +5 -5
  142. package/node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js +1 -1
  143. package/node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js +1 -1
  144. package/node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/EventSigningTransformStream.js +1 -1
  145. package/node_modules/@aws-sdk/middleware-websocket/dist-es/ws-eventstream/EventStreamPayloadHandler.js +1 -1
  146. package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -12
  147. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +524 -63
  148. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +458 -60
  149. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +403 -60
  150. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +597 -60
  151. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +831 -58
  152. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentity.js +1 -1
  153. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +6 -9
  154. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +1 -1
  155. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +2 -2
  156. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +2 -2
  157. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/bdd.js +1 -1
  158. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +2 -2
  159. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +1 -1
  160. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +5 -7
  161. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +5 -10
  162. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +3 -4
  163. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeExtensions.js +3 -3
  164. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js +1 -1
  165. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +6 -9
  166. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +1 -1
  167. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +2 -2
  168. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +1 -1
  169. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +2 -2
  170. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +1 -1
  171. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +5 -7
  172. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +5 -10
  173. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +3 -4
  174. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +3 -3
  175. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js +1 -1
  176. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js +6 -9
  177. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +1 -1
  178. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +2 -2
  179. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js +1 -1
  180. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js +2 -2
  181. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js +1 -1
  182. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +5 -7
  183. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +5 -10
  184. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js +3 -4
  185. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js +3 -3
  186. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js +1 -1
  187. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +6 -9
  188. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +1 -1
  189. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +2 -2
  190. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js +1 -1
  191. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +2 -2
  192. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +1 -1
  193. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +5 -7
  194. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +5 -10
  195. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +3 -4
  196. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js +3 -3
  197. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js +1 -1
  198. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +6 -9
  199. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +5 -10
  200. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js +2 -2
  201. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +2 -2
  202. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -7
  203. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js +1 -1
  204. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +2 -2
  205. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +1 -1
  206. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +5 -7
  207. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +5 -10
  208. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js +3 -4
  209. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js +3 -3
  210. package/node_modules/@aws-sdk/nested-clients/package.json +8 -37
  211. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +38 -2
  212. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js +2 -2
  213. package/node_modules/@aws-sdk/{middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js → signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js} +5 -10
  214. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js +3 -2
  215. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -6
  216. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +18 -19
  217. package/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +1 -1
  218. package/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +1 -2
  219. package/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +1 -1
  220. package/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +1 -1
  221. package/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +1 -1
  222. package/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +1 -1
  223. package/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +1 -1
  224. package/node_modules/@aws-sdk/token-providers/package.json +6 -7
  225. package/node_modules/@aws-sdk/types/package.json +2 -2
  226. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +60 -0
  227. package/node_modules/@aws-sdk/xml-builder/package.json +6 -6
  228. package/node_modules/@babel/runtime/package.json +1 -1
  229. package/node_modules/@cacheable/memory/package.json +2 -6
  230. package/node_modules/@clack/core/dist/index.mjs +8 -8
  231. package/node_modules/@clack/core/package.json +1 -1
  232. package/node_modules/@clack/prompts/dist/index.mjs +122 -121
  233. package/node_modules/@clack/prompts/package.json +2 -2
  234. package/node_modules/@grammyjs/types/package.json +1 -1
  235. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +440 -73
  236. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +71 -12
  237. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +298 -35
  238. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +1 -12
  239. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +1 -12
  240. package/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +1 -12
  241. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +1 -12
  242. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +1 -12
  243. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +78 -13
  244. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +1 -12
  245. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +1 -12
  246. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +1 -12
  247. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +1 -12
  248. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +2 -13
  249. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +440 -73
  250. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +71 -12
  251. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +298 -35
  252. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +1 -12
  253. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +1 -12
  254. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/internal/utils.js +1 -12
  255. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/SemanticResourceAttributes.js +1 -12
  256. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/index.js +1 -12
  257. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +78 -13
  258. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +1 -12
  259. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_metrics.js +1 -12
  260. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/SemanticAttributes.js +1 -12
  261. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/index.js +1 -12
  262. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +2 -13
  263. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +469 -97
  264. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +72 -13
  265. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +307 -43
  266. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +1 -12
  267. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +1 -12
  268. package/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js +1 -12
  269. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js +1 -12
  270. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js +1 -12
  271. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +81 -16
  272. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +1 -12
  273. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js +1 -12
  274. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js +1 -12
  275. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js +1 -12
  276. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +2 -13
  277. package/node_modules/@opentelemetry/semantic-conventions/package.json +2 -2
  278. package/node_modules/@protobufjs/eventemitter/index.js +17 -7
  279. package/node_modules/@protobufjs/eventemitter/package.json +2 -2
  280. package/node_modules/@protobufjs/fetch/index.js +4 -7
  281. package/node_modules/@protobufjs/fetch/package.json +7 -5
  282. package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
  283. package/node_modules/@protobufjs/inquire/index.js +1 -0
  284. package/node_modules/@protobufjs/inquire/package.json +1 -1
  285. package/node_modules/@slack/web-api/dist/file-upload.js +4 -2
  286. package/node_modules/@slack/web-api/package.json +2 -2
  287. package/node_modules/@smithy/core/cbor.js +0 -1
  288. package/node_modules/@smithy/core/checksum.js +1 -1
  289. package/node_modules/@smithy/core/client.js +0 -1
  290. package/node_modules/@smithy/core/config.js +1 -1
  291. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
  292. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +126 -174
  293. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +181 -85
  294. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +126 -174
  295. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
  296. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +12 -7
  297. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +9 -5
  298. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +10 -3
  299. package/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js +1 -1
  300. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js +19 -21
  301. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/createChecksumStream.browser.js +1 -1
  302. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js +2 -2
  303. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js +1 -1
  304. package/node_modules/{@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js → @smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.browser.js} +1 -1
  305. package/node_modules/@smithy/core/endpoints.js +0 -1
  306. package/node_modules/@smithy/core/event-streams.js +0 -1
  307. package/node_modules/@smithy/core/package.json +2 -2
  308. package/node_modules/@smithy/core/protocols.js +0 -1
  309. package/node_modules/@smithy/core/retry.js +1 -1
  310. package/node_modules/@smithy/core/schema.js +0 -1
  311. package/node_modules/@smithy/core/serde.js +0 -1
  312. package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
  313. package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
  314. package/node_modules/@smithy/node-http-handler/package.json +4 -4
  315. package/node_modules/@smithy/signature-v4/package.json +3 -3
  316. package/node_modules/@smithy/types/package.json +1 -1
  317. package/node_modules/@smithy/util-utf8/dist-cjs/index.js +65 -7
  318. package/node_modules/@smithy/util-utf8/dist-es/index.js +3 -1
  319. package/node_modules/@smithy/util-utf8/package.json +33 -9
  320. package/node_modules/@whiskeysockets/baileys/node_modules/p-queue/dist/index.js +10 -5
  321. package/node_modules/@whiskeysockets/baileys/node_modules/p-queue/package.json +1 -1
  322. package/node_modules/axios/dist/axios.js +81 -53
  323. package/node_modules/axios/dist/axios.min.js +2 -2
  324. package/node_modules/axios/dist/browser/axios.cjs +96 -64
  325. package/node_modules/axios/dist/esm/axios.js +96 -64
  326. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  327. package/node_modules/axios/dist/node/axios.cjs +206 -85
  328. package/node_modules/axios/index.d.cts +1 -1
  329. package/node_modules/axios/lib/adapters/fetch.js +6 -2
  330. package/node_modules/axios/lib/adapters/http.js +139 -29
  331. package/node_modules/axios/lib/adapters/xhr.js +2 -1
  332. package/node_modules/axios/lib/core/AxiosHeaders.js +1 -33
  333. package/node_modules/axios/lib/env/data.js +1 -1
  334. package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
  335. package/node_modules/axios/lib/helpers/formDataToJSON.js +1 -1
  336. package/node_modules/axios/lib/helpers/fromDataURI.js +18 -5
  337. package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
  338. package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  339. package/node_modules/axios/lib/utils.js +8 -7
  340. package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
  341. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
  342. package/node_modules/axios/node_modules/agent-base/package.json +64 -0
  343. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
  344. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
  345. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  346. package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
  347. package/node_modules/axios/package.json +3 -1
  348. package/node_modules/discord-api-types/package.json +8 -8
  349. package/node_modules/discord-api-types/payloads/v10/oauth2.js +7 -0
  350. package/node_modules/discord-api-types/payloads/v9/oauth2.js +7 -0
  351. package/node_modules/discord-api-types/rest/v10/index.js +3 -2
  352. package/node_modules/discord-api-types/rest/v9/index.js +3 -2
  353. package/node_modules/es-object-atoms/package.json +6 -7
  354. package/node_modules/es-object-atoms/tsconfig.json +1 -0
  355. package/node_modules/express-rate-limit/dist/index.cjs +1 -1
  356. package/node_modules/express-rate-limit/dist/index.mjs +1 -1
  357. package/node_modules/express-rate-limit/package.json +9 -9
  358. package/node_modules/fast-wrap-ansi/lib/main.js +0 -1
  359. package/node_modules/fast-wrap-ansi/package.json +10 -10
  360. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  361. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  362. package/node_modules/fast-xml-parser/lib/fxp.d.cts +1 -0
  363. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  364. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  365. package/node_modules/fast-xml-parser/package.json +2 -4
  366. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +1 -1
  367. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +4 -0
  368. package/node_modules/grammy/out/bot.js +1 -0
  369. package/node_modules/grammy/out/context.js +236 -74
  370. package/node_modules/grammy/out/convenience/constants.js +1 -0
  371. package/node_modules/grammy/out/convenience/frameworks.js +21 -17
  372. package/node_modules/grammy/out/core/api.js +280 -141
  373. package/node_modules/grammy/out/filter.js +5 -1
  374. package/node_modules/grammy/out/web.mjs +191 -61
  375. package/node_modules/grammy/package.json +2 -2
  376. package/node_modules/linkify-it/build/index.cjs.js +99 -94
  377. package/node_modules/linkify-it/index.mjs +99 -94
  378. package/node_modules/linkify-it/package.json +11 -1
  379. package/node_modules/lru-cache/dist/commonjs/browser/index.js +81 -41
  380. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
  381. package/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
  382. package/node_modules/lru-cache/dist/commonjs/index.js +81 -41
  383. package/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  384. package/node_modules/lru-cache/dist/commonjs/node/index.js +81 -41
  385. package/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
  386. package/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
  387. package/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
  388. package/node_modules/lru-cache/dist/esm/browser/index.js +81 -41
  389. package/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
  390. package/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
  391. package/node_modules/lru-cache/dist/esm/index.js +81 -41
  392. package/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  393. package/node_modules/lru-cache/dist/esm/node/index.js +81 -41
  394. package/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
  395. package/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
  396. package/node_modules/lru-cache/dist/esm/perf.js +1 -2
  397. package/node_modules/lru-cache/package.json +8 -8
  398. package/node_modules/markdown-it/dist/index.cjs.js +111 -31
  399. package/node_modules/markdown-it/dist/markdown-it.js +117 -31
  400. package/node_modules/markdown-it/dist/markdown-it.min.js +2 -2
  401. package/node_modules/markdown-it/lib/common/utils.mjs +30 -1
  402. package/node_modules/markdown-it/lib/index.mjs +1 -1
  403. package/node_modules/markdown-it/lib/rules_block/heading.mjs +2 -2
  404. package/node_modules/markdown-it/lib/rules_block/html_block.mjs +12 -1
  405. package/node_modules/markdown-it/lib/rules_block/lheading.mjs +4 -1
  406. package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +3 -1
  407. package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +37 -21
  408. package/node_modules/markdown-it/lib/rules_inline/entity.mjs +2 -2
  409. package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +37 -6
  410. package/node_modules/markdown-it/package.json +14 -3
  411. package/node_modules/protobufjs/dist/light/protobuf.js +349 -231
  412. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  413. package/node_modules/protobufjs/dist/minimal/protobuf.js +74 -28
  414. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  415. package/node_modules/protobufjs/dist/protobuf.js +420 -283
  416. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  417. package/node_modules/protobufjs/ext/descriptor/index.js +7 -2
  418. package/node_modules/protobufjs/package.json +8 -5
  419. package/node_modules/protobufjs/src/converter.js +13 -8
  420. package/node_modules/protobufjs/src/encoder.js +8 -5
  421. package/node_modules/protobufjs/src/enum.js +2 -2
  422. package/node_modules/protobufjs/src/field.js +1 -1
  423. package/node_modules/protobufjs/src/namespace.js +10 -4
  424. package/node_modules/protobufjs/src/object.js +6 -6
  425. package/node_modules/protobufjs/src/parse.js +49 -30
  426. package/node_modules/protobufjs/src/root.js +18 -10
  427. package/node_modules/protobufjs/src/service.js +4 -2
  428. package/node_modules/protobufjs/src/type.js +12 -7
  429. package/node_modules/protobufjs/src/util/fs.js +11 -0
  430. package/node_modules/protobufjs/src/util/minimal.js +42 -9
  431. package/node_modules/protobufjs/src/util/patterns.js +0 -1
  432. package/node_modules/protobufjs/src/util.js +19 -4
  433. package/node_modules/protobufjs/src/wrappers.js +11 -7
  434. package/node_modules/protobufjs/src/writer.js +11 -9
  435. package/node_modules/qs/dist/qs.js +15 -15
  436. package/node_modules/qs/eslint.config.mjs +1 -0
  437. package/node_modules/qs/lib/parse.js +52 -22
  438. package/node_modules/qs/lib/stringify.js +11 -4
  439. package/node_modules/qs/package.json +2 -2
  440. package/node_modules/semver/classes/range.js +7 -0
  441. package/node_modules/semver/package.json +1 -1
  442. package/node_modules/semver/ranges/subset.js +2 -2
  443. package/node_modules/shell-quote/package.json +5 -6
  444. package/node_modules/shell-quote/quote.js +43 -1
  445. package/node_modules/type-is/index.js +8 -18
  446. package/node_modules/type-is/node_modules/content-type/dist/index.js +170 -0
  447. package/node_modules/type-is/node_modules/content-type/package.json +52 -0
  448. package/node_modules/type-is/package.json +9 -5
  449. package/node_modules/undici/lib/api/api-request.js +1 -1
  450. package/node_modules/undici/lib/cache/sqlite-cache-store.js +3 -3
  451. package/node_modules/undici/lib/core/connect.js +16 -0
  452. package/node_modules/undici/lib/core/request.js +17 -2
  453. package/node_modules/undici/lib/core/socks5-client.js +10 -5
  454. package/node_modules/undici/lib/core/socks5-utils.js +17 -22
  455. package/node_modules/undici/lib/dispatcher/client-h1.js +64 -20
  456. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  457. package/node_modules/undici/lib/dispatcher/h2c-client.js +1 -1
  458. package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
  459. package/node_modules/undici/lib/util/cache.js +8 -7
  460. package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
  461. package/node_modules/undici/lib/web/fetch/index.js +5 -2
  462. package/node_modules/undici/lib/web/webidl/index.js +5 -5
  463. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +1 -7
  464. package/node_modules/undici/package.json +1 -1
  465. package/node_modules/ws/lib/receiver.js +54 -0
  466. package/node_modules/ws/lib/sender.js +6 -1
  467. package/node_modules/ws/lib/websocket-server.js +8 -0
  468. package/node_modules/ws/lib/websocket.js +14 -0
  469. package/node_modules/ws/package.json +1 -1
  470. package/package.json +1 -1
  471. package/skills/qqbrowser-playbook/SKILL.md +302 -0
  472. package/skills/qqbrowser-skill/SKILL.md +140 -41
  473. package/node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8/dist-cjs/index.js +0 -65
  474. package/node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8/dist-es/index.js +0 -3
  475. package/node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8/package.json +0 -66
  476. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
  477. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
  478. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js +0 -65
  479. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
  480. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
  481. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
  482. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js +0 -1
  483. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js +0 -5
  484. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js +0 -3
  485. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js +0 -9
  486. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.js +0 -10
  487. package/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/package.json +0 -66
  488. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttpTypes.js +0 -2
  489. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +0 -157
  490. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +0 -2
  491. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +0 -16
  492. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +0 -81
  493. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +0 -8
  494. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +0 -11
  495. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +0 -10
  496. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +0 -4
  497. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +0 -5
  498. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +0 -7
  499. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +0 -7
  500. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +0 -8
  501. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +0 -70
  502. package/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +0 -41
  503. package/node_modules/@aws-sdk/middleware-host-header/package.json +0 -59
  504. package/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +0 -48
  505. package/node_modules/@aws-sdk/middleware-logger/dist-es/index.js +0 -1
  506. package/node_modules/@aws-sdk/middleware-logger/package.json +0 -59
  507. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +0 -29
  508. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +0 -33
  509. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.native.js +0 -5
  510. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js +0 -2
  511. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +0 -63
  512. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +0 -581
  513. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/toStream.browser.js +0 -11
  514. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/toStream.js +0 -7
  515. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js +0 -36
  516. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js +0 -32
  517. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js +0 -9
  518. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/protocol/S3RestXmlProtocol.js +0 -25
  519. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js +0 -41
  520. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js +0 -42
  521. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js +0 -33
  522. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js +0 -39
  523. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js +0 -14
  524. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js +0 -49
  525. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js +0 -13
  526. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js +0 -38
  527. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js +0 -41
  528. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js +0 -7
  529. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js +0 -7
  530. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/interfaces/S3ExpressIdentity.js +0 -1
  531. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/interfaces/S3ExpressIdentityProvider.js +0 -1
  532. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js +0 -17
  533. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js +0 -51
  534. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/toStream.browser.js +0 -8
  535. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/toStream.js +0 -4
  536. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js +0 -25
  537. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +0 -79
  538. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +0 -194
  539. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js +0 -2
  540. package/node_modules/@aws-sdk/middleware-user-agent/package.json +0 -63
  541. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +0 -60
  542. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/bdd.js +0 -100
  543. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js +0 -18
  544. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/CognitoIdentityServiceException.js +0 -12
  545. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/errors.js +0 -121
  546. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.browser.js +0 -38
  547. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.js +0 -54
  548. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.native.js +0 -15
  549. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js +0 -50
  550. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/schemas/schemas_0.js +0 -110
  551. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js +0 -56
  552. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/bdd.js +0 -90
  553. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js +0 -18
  554. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/SigninServiceException.js +0 -12
  555. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/errors.js +0 -64
  556. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.browser.js +0 -39
  557. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js +0 -54
  558. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.native.js +0 -15
  559. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js +0 -49
  560. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/schemas/schemas_0.js +0 -125
  561. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js +0 -56
  562. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/bdd.js +0 -80
  563. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js +0 -18
  564. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js +0 -12
  565. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js +0 -56
  566. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.browser.js +0 -38
  567. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js +0 -54
  568. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.native.js +0 -15
  569. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js +0 -49
  570. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js +0 -90
  571. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +0 -56
  572. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/bdd.js +0 -80
  573. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js +0 -18
  574. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/SSOOIDCServiceException.js +0 -12
  575. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/errors.js +0 -195
  576. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.browser.js +0 -38
  577. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js +0 -54
  578. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.native.js +0 -15
  579. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js +0 -49
  580. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/schemas/schemas_0.js +0 -140
  581. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js +0 -55
  582. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js +0 -43
  583. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js +0 -144
  584. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js +0 -19
  585. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/bdd.js +0 -150
  586. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js +0 -18
  587. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/STSServiceException.js +0 -12
  588. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/errors.js +0 -96
  589. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.browser.js +0 -39
  590. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js +0 -74
  591. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.native.js +0 -15
  592. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js +0 -57
  593. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js +0 -13
  594. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/schemas/schemas_0.js +0 -195
  595. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +0 -38
  596. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +0 -20
  597. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.native.js +0 -6
  598. package/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js +0 -3
  599. package/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/awsRegionConfig.js +0 -2
  600. package/node_modules/@aws-sdk/region-config-resolver/package.json +0 -62
  601. package/node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js +0 -27
  602. package/node_modules/@aws-sdk/util-arn-parser/package.json +0 -55
  603. package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +0 -406
  604. package/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +0 -267
  605. package/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +0 -6
  606. package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +0 -3
  607. package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +0 -267
  608. package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js +0 -1
  609. package/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js +0 -1
  610. package/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js +0 -1
  611. package/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +0 -6
  612. package/node_modules/@aws-sdk/util-endpoints/package.json +0 -60
  613. package/node_modules/@aws-sdk/util-format-url/dist-cjs/index.js +0 -34
  614. package/node_modules/@aws-sdk/util-format-url/package.json +0 -56
  615. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/configurations.js +0 -2
  616. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +0 -57
  617. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +0 -58
  618. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js +0 -22
  619. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +0 -55
  620. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +0 -185
  621. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js +0 -2
  622. package/node_modules/@aws-sdk/util-user-agent-node/package.json +0 -69
  623. package/node_modules/@smithy/config-resolver/dist-cjs/index.js +0 -22
  624. package/node_modules/@smithy/config-resolver/dist-es/index.js +0 -1
  625. package/node_modules/@smithy/config-resolver/package.json +0 -41
  626. package/node_modules/@smithy/eventstream-codec/dist-cjs/index.js +0 -11
  627. package/node_modules/@smithy/eventstream-codec/dist-es/index.js +0 -1
  628. package/node_modules/@smithy/eventstream-codec/package.json +0 -44
  629. package/node_modules/@smithy/eventstream-serde-browser/dist-cjs/index.js +0 -9
  630. package/node_modules/@smithy/eventstream-serde-browser/dist-es/index.js +0 -3
  631. package/node_modules/@smithy/eventstream-serde-browser/package.json +0 -44
  632. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js +0 -5
  633. package/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js +0 -1
  634. package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +0 -44
  635. package/node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js +0 -6
  636. package/node_modules/@smithy/eventstream-serde-node/dist-es/index.js +0 -1
  637. package/node_modules/@smithy/eventstream-serde-node/package.json +0 -44
  638. package/node_modules/@smithy/hash-node/dist-cjs/index.js +0 -5
  639. package/node_modules/@smithy/hash-node/dist-es/index.js +0 -1
  640. package/node_modules/@smithy/hash-node/package.json +0 -41
  641. package/node_modules/@smithy/invalid-dependency/dist-cjs/index.js +0 -6
  642. package/node_modules/@smithy/invalid-dependency/dist-es/index.js +0 -1
  643. package/node_modules/@smithy/invalid-dependency/package.json +0 -41
  644. package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +0 -7
  645. package/node_modules/@smithy/middleware-content-length/dist-es/index.js +0 -1
  646. package/node_modules/@smithy/middleware-content-length/package.json +0 -41
  647. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +0 -12
  648. package/node_modules/@smithy/middleware-endpoint/dist-es/index.js +0 -1
  649. package/node_modules/@smithy/middleware-endpoint/package.json +0 -41
  650. package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +0 -22
  651. package/node_modules/@smithy/middleware-retry/dist-es/index.js +0 -1
  652. package/node_modules/@smithy/middleware-retry/package.json +0 -41
  653. package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +0 -9
  654. package/node_modules/@smithy/middleware-serde/dist-es/index.js +0 -1
  655. package/node_modules/@smithy/middleware-serde/package.json +0 -41
  656. package/node_modules/@smithy/middleware-stack/dist-cjs/index.js +0 -5
  657. package/node_modules/@smithy/middleware-stack/dist-es/index.js +0 -1
  658. package/node_modules/@smithy/middleware-stack/package.json +0 -43
  659. package/node_modules/@smithy/node-config-provider/dist-cjs/index.js +0 -5
  660. package/node_modules/@smithy/node-config-provider/dist-es/index.js +0 -1
  661. package/node_modules/@smithy/node-config-provider/package.json +0 -43
  662. package/node_modules/@smithy/property-provider/dist-cjs/index.js +0 -10
  663. package/node_modules/@smithy/property-provider/dist-es/index.js +0 -1
  664. package/node_modules/@smithy/property-provider/package.json +0 -41
  665. package/node_modules/@smithy/protocol-http/dist-cjs/index.js +0 -11
  666. package/node_modules/@smithy/protocol-http/dist-es/index.js +0 -1
  667. package/node_modules/@smithy/protocol-http/package.json +0 -42
  668. package/node_modules/@smithy/querystring-builder/dist-cjs/index.js +0 -5
  669. package/node_modules/@smithy/querystring-builder/dist-es/index.js +0 -1
  670. package/node_modules/@smithy/querystring-builder/package.json +0 -41
  671. package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +0 -16
  672. package/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js +0 -1
  673. package/node_modules/@smithy/shared-ini-file-loader/package.json +0 -41
  674. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +0 -75
  675. package/node_modules/@smithy/smithy-client/dist-es/index.js +0 -3
  676. package/node_modules/@smithy/smithy-client/package.json +0 -42
  677. package/node_modules/@smithy/url-parser/dist-cjs/index.js +0 -5
  678. package/node_modules/@smithy/url-parser/dist-es/index.js +0 -1
  679. package/node_modules/@smithy/url-parser/package.json +0 -41
  680. package/node_modules/@smithy/util-base64/dist-cjs/index.js +0 -6
  681. package/node_modules/@smithy/util-base64/dist-es/index.js +0 -1
  682. package/node_modules/@smithy/util-base64/package.json +0 -42
  683. package/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +0 -5
  684. package/node_modules/@smithy/util-body-length-browser/dist-es/index.js +0 -1
  685. package/node_modules/@smithy/util-body-length-browser/package.json +0 -42
  686. package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +0 -5
  687. package/node_modules/@smithy/util-body-length-node/dist-es/index.js +0 -1
  688. package/node_modules/@smithy/util-body-length-node/package.json +0 -42
  689. package/node_modules/@smithy/util-config-provider/dist-cjs/index.js +0 -7
  690. package/node_modules/@smithy/util-config-provider/dist-es/index.js +0 -1
  691. package/node_modules/@smithy/util-config-provider/package.json +0 -43
  692. package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/index.js +0 -5
  693. package/node_modules/@smithy/util-defaults-mode-browser/dist-es/index.js +0 -1
  694. package/node_modules/@smithy/util-defaults-mode-browser/package.json +0 -41
  695. package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +0 -5
  696. package/node_modules/@smithy/util-defaults-mode-node/dist-es/index.js +0 -1
  697. package/node_modules/@smithy/util-defaults-mode-node/package.json +0 -41
  698. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +0 -12
  699. package/node_modules/@smithy/util-endpoints/dist-es/index.js +0 -1
  700. package/node_modules/@smithy/util-endpoints/package.json +0 -45
  701. package/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +0 -6
  702. package/node_modules/@smithy/util-hex-encoding/dist-es/index.js +0 -1
  703. package/node_modules/@smithy/util-hex-encoding/package.json +0 -42
  704. package/node_modules/@smithy/util-middleware/dist-cjs/index.js +0 -6
  705. package/node_modules/@smithy/util-middleware/dist-es/index.js +0 -1
  706. package/node_modules/@smithy/util-middleware/package.json +0 -46
  707. package/node_modules/@smithy/util-retry/dist-cjs/index.js +0 -21
  708. package/node_modules/@smithy/util-retry/dist-es/index.js +0 -1
  709. package/node_modules/@smithy/util-retry/package.json +0 -46
  710. package/node_modules/@smithy/util-stream/dist-cjs/index.js +0 -14
  711. package/node_modules/@smithy/util-stream/dist-es/index.js +0 -1
  712. package/node_modules/@smithy/util-stream/package.json +0 -43
  713. package/node_modules/shell-quote/print.py +0 -3
  714. /package/node_modules/@aws-sdk/{middleware-logger/dist-es → core/dist-es/submodules/client/middleware-logger}/loggerMiddleware.js +0 -0
  715. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/configuration.js +0 -0
  716. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/getRecursionDetectionPlugin.js +0 -0
  717. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.js +0 -0
  718. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.js +0 -0
  719. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/configurations.js +0 -0
  720. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/constants.js +0 -0
  721. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/encode-features.js +0 -0
  722. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/extensions/index.js → core/dist-es/submodules/client/region-config-resolver/extensions.js} +0 -0
  723. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.js +0 -0
  724. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.js +0 -0
  725. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/parseArn.js +0 -0
  726. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointRuleObject.js +0 -0
  727. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/ErrorRuleObject.js +0 -0
  728. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/RuleSetObject.js +0 -0
  729. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/TreeRuleObject.js +0 -0
  730. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/shared.js +0 -0
  731. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/configurations.js +0 -0
  732. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.js +0 -0
  733. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js} +0 -0
  734. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.native.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.native.js} +0 -0
  735. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/crt-availability.js +0 -0
  736. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/defaultUserAgent.js +0 -0
  737. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.js +0 -0
  738. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.js +0 -0
  739. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.js +0 -0
  740. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.js +0 -0
  741. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/is-crt-available.js +0 -0
  742. /package/node_modules/@aws-sdk/{util-arn-parser/dist-es/index.js → core/dist-es/submodules/util/util-arn-parser/arn.js} +0 -0
  743. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-cjs/fromUtf8.browser.js +0 -0
  744. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-cjs/fromUtf8.js +0 -0
  745. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-cjs/toUint8Array.js +0 -0
  746. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-cjs/toUtf8.browser.js +0 -0
  747. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-cjs/toUtf8.js +0 -0
  748. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-es/fromUtf8.browser.js +0 -0
  749. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-es/fromUtf8.js +0 -0
  750. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-es/toUint8Array.js +0 -0
  751. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-es/toUtf8.browser.js +0 -0
  752. /package/node_modules/{@aws-crypto/sha256-browser/node_modules/@smithy → @smithy}/util-utf8/dist-es/toUtf8.js +0 -0
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxp=e():t.fxp=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>Wt,XMLParser:()=>Pt,XMLValidator:()=>Xt});var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function n(t,e){for(var r=[],i=e.exec(t);i;){var n=[];n.startIndex=e.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)n.push(i[a]);r.push(n),i=e.exec(t)}return r}var s=function(t){return!(null==i.exec(t))},a=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],o=["__proto__","constructor","prototype"],h={allowBooleanAttributes:!1,unpairedTags:[]};function l(t,e){e=Object.assign({},h,e);var r=[],i=!1,n=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if((s=p(t,s+=2)).err)return s}else{if("<"!==t[s]){if(u(t[s]))continue;return b("InvalidChar","char '"+t[s]+"' is not expected.",E(t,s))}var a=s;if("!"===t[++s]){s=d(t,s);continue}var o=!1;"/"===t[s]&&(o=!0,s++);for(var l="";s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)l+=t[s];if("/"===(l=l.trim())[l.length-1]&&(l=l.substring(0,l.length-1),s--),!y(l))return b("InvalidTag",0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",E(t,s));var c=g(t,s);if(!1===c)return b("InvalidAttr","Attributes for '"+l+"' have open quote.",E(t,s));var f=c.value;if(s=c.index,"/"===f[f.length-1]){var m=s-f.length,N=v(f=f.substring(0,f.length-1),e);if(!0!==N)return b(N.err.code,N.err.msg,E(t,m+N.err.line));i=!0}else if(o){if(!c.tagClosed)return b("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",E(t,s));if(f.trim().length>0)return b("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",E(t,a));if(0===r.length)return b("InvalidTag","Closing tag '"+l+"' has not been opened.",E(t,a));var w=r.pop();if(l!==w.tagName){var S=E(t,w.tagStartPos);return b("InvalidTag","Expected closing tag '"+w.tagName+"' (opened in line "+S.line+", col "+S.col+") instead of closing tag '"+l+"'.",E(t,a))}0==r.length&&(n=!0)}else{var _=v(f,e);if(!0!==_)return b(_.err.code,_.err.msg,E(t,s-f.length+_.err.line));if(!0===n)return b("InvalidXml","Multiple possible root nodes found.",E(t,s));-1!==e.unpairedTags.indexOf(l)||r.push({tagName:l,tagStartPos:a}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s=d(t,++s);continue}if("?"!==t[s+1])break;if((s=p(t,++s)).err)return s}else if("&"===t[s]){var A=x(t,s);if(-1==A)return b("InvalidChar","char '&' is not expected.",E(t,s));s=A}else if(!0===n&&!u(t[s]))return b("InvalidXml","Extra text at the end",E(t,s));"<"===t[s]&&s--}return i?1==r.length?b("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",E(t,r[0].tagStartPos)):!(r.length>0)||b("InvalidXml","Invalid '"+JSON.stringify(r.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):b("InvalidXml","Start tag expected.",1)}function u(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function p(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var i=t.substr(r,e-r);if(e>5&&"xml"===i)return b("InvalidXml","XML declaration allowed only at the start of the document.",E(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function d(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var c='"',f="'";function g(t,e){for(var r="",i="",n=!1;e<t.length;e++){if(t[e]===c||t[e]===f)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){n=!0;break}r+=t[e]}return""===i&&{value:r,index:e,tagClosed:n}}var m=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function v(t,e){for(var r=n(t,m),i={},s=0;s<r.length;s++){if(0===r[s][1].length)return b("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",w(r[s]));if(void 0!==r[s][3]&&void 0===r[s][4])return b("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",w(r[s]));if(void 0===r[s][3]&&!e.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",w(r[s]));var a=r[s][2];if(!N(a))return b("InvalidAttr","Attribute '"+a+"' is an invalid name.",w(r[s]));if(Object.prototype.hasOwnProperty.call(i,a))return b("InvalidAttr","Attribute '"+a+"' is repeated.",w(r[s]));i[a]=1}return!0}function x(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function b(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function N(t){return s(t)}function y(t){return s(t)}function E(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function w(t){return t.startIndex+t[1].length}var S=function(t){return a.includes(t)?"__"+t:t},_={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function A(t,e){if("string"==typeof t){var r=t.toLowerCase();if(a.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');if(o.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution')}}function T(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,null!=(r=t.maxEntitySize)?r:1e4),maxExpansionDepth:Math.max(1,null!=(i=t.maxExpansionDepth)?i:1e4),maxTotalExpansions:Math.max(1,null!=(n=t.maxTotalExpansions)?n:1/0),maxExpandedLength:Math.max(1,null!=(s=t.maxExpandedLength)?s:1e5),maxEntityCount:Math.max(1,null!=(a=t.maxEntityCount)?a:1e3),allowedTags:null!=(o=t.allowedTags)?o:null,tagFilter:null!=(h=t.tagFilter)?h:null,appliesTo:null!=(l=t.appliesTo)?l:"all"}:T(!0);var r,i,n,s,a,o,h,l}var C,P=function(t){for(var e=Object.assign({},_,t),r=0,i=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];r<i.length;r++){var n=i[r],s=n.value,a=n.name;s&&A(s,a)}return null===e.onDangerousProperty&&(e.onDangerousProperty=S),e.processEntities=T(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),e};C="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var O=function(){function t(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,i;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((i={})[t.tagname]=t.child,i)),void 0!==e&&(this.child[this.child.length-1][C]={startIndex:e})},t.getMetaDataSymbol=function(){return C},t}(),I=function(){function t(t){this.suppressValidationErr=!t,this.options=t}var e=t.prototype;return e.readDocType=function(t,e){var r=Object.create(null),i=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var n=1,s=!1,a=!1;e<t.length;e++)if("<"!==t[e]||a)if(">"===t[e]){if(a?"-"===t[e-1]&&"-"===t[e-2]&&(a=!1,n--):n--,0===n)break}else"["===t[e]?s=!0:t[e];else{if(s&&D(t,"!ENTITY",e)){e+=7;var o,h=void 0,l=this.readEntityExp(t,e+1,this.suppressValidationErr);if(o=l[0],h=l[1],e=l[2],-1===h.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error("Entity count ("+(i+1)+") exceeds maximum allowed ("+this.options.maxEntityCount+")");r[o]=h,i++}}else if(s&&D(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(s&&D(t,"!ATTLIST",e))e+=8;else if(s&&D(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!D(t,"!--",e))throw new Error("Invalid DOCTYPE");a=!0}n++}if(0!==n)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}},e.readEntityExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;var i=t.substring(r,e);if($(i),e=j(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var n,s=this.readIdentifierVal(t,e,"entity");if(e=s[0],n=s[1],!1!==this.options.enabled&&null!=this.options.maxEntitySize&&n.length>this.options.maxEntitySize)throw new Error('Entity "'+i+'" size ('+n.length+") exceeds maximum allowed size ("+this.options.maxEntitySize+")");return[i,n,--e]},e.readNotationExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);!this.suppressValidationErr&&$(i),e=j(t,e);var n=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==n&&"PUBLIC"!==n)throw new Error('Expected SYSTEM or PUBLIC, found "'+n+'"');e+=n.length,e=j(t,e);var s=null,a=null;if("PUBLIC"===n){var o=this.readIdentifierVal(t,e,"publicIdentifier");if(e=o[0],s=o[1],'"'===t[e=j(t,e)]||"'"===t[e]){var h=this.readIdentifierVal(t,e,"systemIdentifier");e=h[0],a=h[1]}}else if("SYSTEM"===n){var l=this.readIdentifierVal(t,e,"systemIdentifier");if(e=l[0],a=l[1],!this.suppressValidationErr&&!a)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:i,publicIdentifier:s,systemIdentifier:a,index:--e}},e.readIdentifierVal=function(t,e,r){var i,n=t[e];if('"'!==n&&"'"!==n)throw new Error('Expected quoted string, found "'+n+'"');for(var s=++e;e<t.length&&t[e]!==n;)e++;if(i=t.substring(s,e),t[e]!==n)throw new Error("Unterminated "+r+" value");return[++e,i]},e.readElementExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);if(!this.suppressValidationErr&&!s(i))throw new Error('Invalid element name: "'+i+'"');var n="";if("E"===t[e=j(t,e)]&&D(t,"MPTY",e))e+=4;else if("A"===t[e]&&D(t,"NY",e))e+=2;else if("("===t[e]){for(var a=++e;e<t.length&&")"!==t[e];)e++;if(n=t.substring(a,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'+t[e]+'"');return{elementName:i,contentModel:n.trim(),index:e}},e.readAttlistExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);for($(i),r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);if(!$(n))throw new Error('Invalid attribute name: "'+n+'"');e=j(t,e);var s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=j(t,e+=8)])throw new Error("Expected '(', found \""+t[e]+'"');e++;for(var a=[];e<t.length&&")"!==t[e];){for(var o=e;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;var h=t.substring(o,e);if(!$(h=h.trim()))throw new Error('Invalid notation name: "'+h+'"');a.push(h),"|"===t[e]&&(e++,e=j(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+a.join("|")+")"}else{for(var l=e;e<t.length&&!/\s/.test(t[e]);)e++;if(s+=t.substring(l,e),!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(s.toUpperCase()))throw new Error('Invalid attribute type: "'+s+'"')}e=j(t,e);var u="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())u="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())u="#IMPLIED",e+=7;else{var p=this.readIdentifierVal(t,e,"ATTLIST");e=p[0],u=p[1]}return{elementName:i,attributeName:n,attributeType:s,defaultValue:u,index:e}},t}(),j=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function D(t,e,r){for(var i=0;i<e.length;i++)if(e[i]!==t[r+i+1])return!1;return!0}function $(t){if(s(t))return t;throw new Error("Invalid entity name "+t)}const M=/^[-+]?0x[a-fA-F0-9]+$/,V=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,L={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};const k=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}class R{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const r=e[e.length-1];return void 0!==r.values&&t in r.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class G{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new R(this)}push(t,e=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const n=this.siblingStacks[i],s=r?`${r}:${t}`:t,a=n.get(s)||0;let o=0;for(const t of n.values())o+=t;n.set(s,a+1);const h={tag:t,position:o,counter:a};null!=r&&(h.namespace=r),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const r=t||this.separator;if(r===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,r=t.length-1;for(;r>=0&&e>=0;){const i=t[r];if("deep-wildcard"===i.type){if(r--,r<0)return!0;const i=t[r];let n=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,r--,n=!0;break}if(!n)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,r--}}return r<0}_matchSegment(t,e,r){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!r)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!r)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class U{constructor(t,e={},r){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let r=0,i="";for(;r<t.length;)t[r]===this.separator?r+1<t.length&&t[r+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),r+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",r++):(i+=t[r],r++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let r=null,i=t;const n=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(n&&(i=n[1]+n[3],n[2])){const t=n[2].slice(1,-1);t&&(r=t)}let s,a,o=i;if(i.includes("::")){const e=i.indexOf("::");if(s=i.substring(0,e).trim(),o=i.substring(e+2).trim(),!s)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(o.includes(":")){const t=o.lastIndexOf(":"),e=o.substring(0,t).trim(),r=o.substring(t+1).trim();["first","last","odd","even"].includes(r)||/^nth\(\d+\)$/.test(r)?(a=e,h=r):a=o}else a=o;if(!a)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=a,s&&(e.namespace=s),r)if(r.includes("=")){const t=r.indexOf("=");e.attrName=r.substring(0,t).trim(),e.attrValue=r.substring(t+1).trim()}else e.attrName=r.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class B{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,r=t.segments[t.segments.length-1],i=r?.tag;if(i&&"*"!==i){const r=`${e}:${i}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),r=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(r);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const n=this._wildcardByDepth.get(e);if(n)for(let e=0;e<n.length;e++)if(t.matches(n[e]))return n[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const W={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},X={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Y={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},z=new Set("!?\\\\/[]$%{}^&*()<>|+");function q(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(z.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Z(...t){const e=Object.create(null);for(const r of t)if(r)for(const t of Object.keys(r)){const i=r[t];if("string"==typeof i)e[t]=i;else if(i&&"object"==typeof i&&void 0!==i.val){const r=i.val;"string"==typeof r&&(e[t]=r)}}return e}const J="external",K="base",Q="all",H=Object.freeze({allow:0,leave:1,remove:2,throw:3}),tt=new Set([9,10,13]);class et{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??J)&&e!==J?e===Q?new Set([Q]):e===K?new Set([K]):Array.isArray(e)?new Set(e):new Set([J]):new Set([J]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=Z(X,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const r=function(t){if(!t)return{xmlVersion:1,onLevel:H.allow,nullLevel:H.remove};const e=1.1===t.xmlVersion?1.1:1,r=H[t.onNCR]??H.allow,i=H[t.nullNCR]??H.remove;return{xmlVersion:e,onLevel:r,nullLevel:Math.max(i,H.remove)}}(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))q(e);this._externalMap=Z(t)}addExternalEntity(t,e){q(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Z(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;const e=t,r=[],i=t.length;let n=0,s=0;const a=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,h=a||o;for(;s<i;){if(38!==t.charCodeAt(s)){s++;continue}let e=s+1;for(;e<i&&59!==t.charCodeAt(e)&&e-s<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){s++;continue}const l=t.slice(s+1,e);if(0===l.length){s++;continue}let u,p;if(this._removeSet.has(l))u="",void 0===p&&(p=J);else{if(this._leaveSet.has(l)){s++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){s++;continue}u=t,p=K}else{const t=this._resolveName(l);u=t?.value,p=t?.tier}}if(void 0!==u){if(s>n&&r.push(t.slice(n,s)),r.push(u),n=e+1,s=n,h&&this._tierCounts(p)){if(a&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else s++}n<i&&r.push(t.slice(n));const l=0===r.length?t:r.join("");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(Q)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:J}:t in this._externalMap?{value:this._externalMap[t],tier:J}:t in this._baseMap?{value:this._baseMap[t],tier:K}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!tt.has(t)?H.remove:-1}_applyNCRAction(t,e,r){switch(t){case H.allow:return String.fromCodePoint(r);case H.remove:return"";case H.leave:return;case H.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(t){const e=t.charCodeAt(1);let r;if(r=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const i=this._classifyNCR(r);if(!this._numericAllowed&&i<H.remove)return;const n=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(n,t,r)}}function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},rt.apply(null,arguments)}function it(t,e){if(!t)return{};var r=e.attributesGroupName?t[e.attributesGroupName]:t;if(!r)return{};var i={};for(var n in r)n.startsWith(e.attributeNamePrefix)?i[n.substring(e.attributeNamePrefix.length)]=r[n]:i[n]=r[n];return i}function nt(t){if(t&&"string"==typeof t){var e=t.indexOf(":");if(-1!==e&&e>0){var r=t.substring(0,e);if("xmlns"!==r)return r}}}var st=function(t,e){var r;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=ut,this.parseTextData=at,this.resolveNameSpace=ot,this.buildAttributesMap=lt,this.isItStopNode=ft,this.replaceEntitiesValue=dt,this.readStopNodeData=xt,this.saveTextToParentTag=ct,this.addChild=pt,this.ignoreAttributesFn="function"==typeof(r=this.options.ignoreAttributes)?r:Array.isArray(r)?function(t){for(var e,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(e=i()).done;){var n=e.value;if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0;var i=rt({},X);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:("object"==typeof this.options.htmlEntities?i=this.options.htmlEntities:!0===this.options.htmlEntities&&(i=rt({},Y,W)),this.entityDecoder=new et({namedEntities:rt({},i,e),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new G,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new B;var n=this.options.stopNodes;if(n&&n.length>0){for(var s=0;s<n.length;s++){var a=n[s];"string"==typeof a?this.stopNodeExpressionsSet.add(new U(a)):a instanceof U&&this.stopNodeExpressionsSet.add(a)}this.stopNodeExpressionsSet.seal()}};function at(t,e,r,i,n,s,a){var o=this.options;if(void 0!==t&&(o.trimValues&&!i&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,r));var h=o.jPath?r.toString():r,l=o.tagValueProcessor(e,t,h,n,s);return null==l?t:typeof l!=typeof t||l!==t?l:o.trimValues||t.trim()===t?bt(t,o.parseTagValue,o.numberParseOptions):t}}function ot(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var ht=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function lt(t,e,r,i){void 0===i&&(i=!1);var s=this.options;if(!0===i||!0!==s.ignoreAttributes&&"string"==typeof t){for(var a=n(t,ht),o=a.length,h={},l=new Array(o),u=!1,p={},d=0;d<o;d++){var c=this.resolveNameSpace(a[d][1]),f=a[d][4];if(c.length&&void 0!==f){var g=f;s.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g,r,this.readonlyMatcher),l[d]=g,p[c]=g,u=!0}}u&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(p);for(var m=s.jPath?e.toString():this.readonlyMatcher,v=!1,x=0;x<o;x++){var b=this.resolveNameSpace(a[x][1]);if(!this.ignoreAttributesFn(b,m)){var N=s.attributeNamePrefix+b;if(b.length)if(s.transformAttributeName&&(N=s.transformAttributeName(N)),N=yt(N,s),void 0!==a[x][4]){var y=l[x],E=s.attributeValueProcessor(b,y,m);h[N]=null==E?y:typeof E!=typeof y||E!==y?E:bt(y,s.parseAttributeValue,s.numberParseOptions),v=!0}else s.allowBooleanAttributes&&(h[N]=!0,v=!0)}}if(!v)return;if(s.attributesGroupName&&!s.preserveOrder){var w={};return w[s.attributesGroupName]=h,w}return h}}var ut=function(t){t=t.replace(/\r\n?/g,"\n");var e=new O("!xml"),r=e,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;for(var n=this.options,s=new I(n.processEntities),a=t.length,o=0;o<a;o++)if("<"===t[o]){var h=t.charCodeAt(o+1);if(47===h){var l=gt(t,">",o,"Closing Tag is not closed."),u=t.substring(o+2,l).trim();if(n.removeNSPrefix){var p=u.indexOf(":");-1!==p&&(u=u.substr(p+1))}u=Nt(n.transformTagName,u,"",n).tagName,r&&(i=this.saveTextToParentTag(i,r,this.readonlyMatcher));var d=this.matcher.getCurrentTag();if(u&&n.unpairedTagsSet.has(u))throw new Error("Unpaired tag can not be used as closing tag: </"+u+">");d&&n.unpairedTagsSet.has(d)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),i="",o=l}else if(63===h){var c=vt(t,o,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,r,this.readonlyMatcher);var f=this.buildAttributesMap(c.tagExp,this.matcher,c.tagName,!0);if(f){var g=f[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(g)||1)}if(n.ignoreDeclaration&&"?xml"===c.tagName||n.ignorePiTags);else{var m=new O(c.tagName);m.add(n.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&!0!==n.ignoreAttributes&&(m[":@"]=f),this.addChild(r,m,this.readonlyMatcher,o)}o=c.closeIndex+1}else if(33===h&&45===t.charCodeAt(o+2)&&45===t.charCodeAt(o+3)){var v=gt(t,"--\x3e",o+4,"Comment is not closed.");if(n.commentPropName){var x,b=t.substring(o+4,v-2);i=this.saveTextToParentTag(i,r,this.readonlyMatcher),r.add(n.commentPropName,[(x={},x[n.textNodeName]=b,x)])}o=v}else if(33===h&&68===t.charCodeAt(o+2)){var N=s.readDocType(t,o);this.entityDecoder.addInputEntities(N.entities),o=N.i}else if(33===h&&91===t.charCodeAt(o+2)){var y=gt(t,"]]>",o,"CDATA is not closed.")-2,E=t.substring(o+9,y);i=this.saveTextToParentTag(i,r,this.readonlyMatcher);var w,S=this.parseTextData(E,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==S&&(S=""),n.cdataPropName?r.add(n.cdataPropName,[(w={},w[n.textNodeName]=E,w)]):r.add(n.textNodeName,S),o=y+2}else{var _=vt(t,o,n.removeNSPrefix);if(!_){var A=t.substring(Math.max(0,o-50),Math.min(a,o+50));throw new Error("readTagExp returned undefined at position "+o+'. Context: "'+A+'"')}var T=_.tagName,C=_.rawTagName,P=_.tagExp,j=_.attrExpPresent,D=_.closeIndex,$=Nt(n.transformTagName,T,P,n);if(T=$.tagName,P=$.tagExp,n.strictReservedNames&&(T===n.commentPropName||T===n.cdataPropName||T===n.textNodeName||T===n.attributesGroupName))throw new Error("Invalid tag name: "+T);r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,this.readonlyMatcher,!1));var M=r;M&&n.unpairedTagsSet.has(M.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var V=!1;P.length>0&&P.lastIndexOf("/")===P.length-1&&(V=!0,P="/"===T[T.length-1]?T=T.substr(0,T.length-1):P.substr(0,P.length-1),j=T!==P);var L,k=null;L=nt(C),T!==e.tagname&&this.matcher.push(T,{},L),T!==P&&j&&(k=this.buildAttributesMap(P,this.matcher,T))&&it(k,n),T!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var F=o;if(this.isCurrentNodeStopNode){var R="";if(V)o=_.closeIndex;else if(n.unpairedTagsSet.has(T))o=_.closeIndex;else{var G=this.readStopNodeData(t,C,D+1);if(!G)throw new Error("Unexpected end of "+C);o=G.i,R=G.tagContent}var U=new O(T);k&&(U[":@"]=k),U.add(n.textNodeName,R),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,U,this.readonlyMatcher,F)}else{if(V){var B=Nt(n.transformTagName,T,P,n);T=B.tagName,P=B.tagExp;var W=new O(T);k&&(W[":@"]=k),this.addChild(r,W,this.readonlyMatcher,F),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(n.unpairedTagsSet.has(T)){var X=new O(T);k&&(X[":@"]=k),this.addChild(r,X,this.readonlyMatcher,F),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=_.closeIndex;continue}var Y=new O(T);if(this.tagsNodeStack.length>n.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),k&&(Y[":@"]=k),this.addChild(r,Y,this.readonlyMatcher,F),r=Y}i="",o=D}}}else i+=t[o];return e.child};function pt(t,e,r,i){this.options.captureMetaData||(i=void 0);var n=this.options.jPath?r.toString():r,s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}function dt(t,e,r){var i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){var n=this.options.jPath?r.toString():r;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,n)))return t}if(i.tagFilter){var s=this.options.jPath?r.toString():r;if(!i.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function ct(t,e,r,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ft(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function gt(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n+e.length-1}function mt(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n}function vt(t,e,r,i){void 0===i&&(i=">");var n=function(t,e,r){void 0===r&&(r=">");for(var i=0,n=t.length,s=r.charCodeAt(0),a=r.length>1?r.charCodeAt(1):-1,o="",h=e,l=e;l<n;l++){var u=t.charCodeAt(l);if(i)u===i&&(i=0);else if(34===u||39===u)i=u;else if(u===s){if(-1===a)return{data:o+=t.substring(h,l),index:l};if(t.charCodeAt(l+1)===a)return{data:o+=t.substring(h,l),index:l}}else 9!==u||i||(o+=t.substring(h,l)+" ",h=l+1)}}(t,e+1,i);if(n){var s=n.data,a=n.index,o=s.search(/\s/),h=s,l=!0;-1!==o&&(h=s.substring(0,o),s=s.substring(o+1).trimStart());var u=h;if(r){var p=h.indexOf(":");-1!==p&&(l=(h=h.substr(p+1))!==n.data.substr(p+1))}return{tagName:h,tagExp:s,closeIndex:a,attrExpPresent:l,rawTagName:u}}}function xt(t,e,r){for(var i=r,n=1,s=t.length;r<s;r++)if("<"===t[r]){var a=t.charCodeAt(r+1);if(47===a){var o=mt(t,">",r,e+" is not closed");if(t.substring(r+2,o).trim()===e&&0===--n)return{tagContent:t.substring(i,r),i:o};r=o}else if(63===a)r=gt(t,"?>",r+1,"StopNode is not closed.");else if(33===a&&45===t.charCodeAt(r+2)&&45===t.charCodeAt(r+3))r=gt(t,"--\x3e",r+3,"StopNode is not closed.");else if(33===a&&91===t.charCodeAt(r+2))r=gt(t,"]]>",r,"StopNode is not closed.")-2;else{var h=vt(t,r,">");h&&((h&&h.tagName)===e&&"/"!==h.tagExp[h.tagExp.length-1]&&n++,r=h.closeIndex)}}}function bt(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&function(t,e={}){if(e=Object.assign({},L,e),!t||"string"!=typeof t)return t;let r=t.trim();if(0===r.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===r)return 0;if(e.hex&&M.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return function(t,e,r){if(!r.eNotation)return t;const i=e.match(k);if(i){let n=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",a=i[2],o=n?t[a.length+1]===s:t[a.length]===s;return a.length>1&&o?t:(1!==a.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s)&&a.length>0?r.leadingZeros&&!o?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,r,e);{const n=V.exec(r);if(n){const s=n[1]||"",a=n[2];let o=(i=n[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const h=s?"."===t[a.length+1]:"."===t[a.length];if(!e.leadingZeros&&(a.length>1||1===a.length&&!h))return t;{const i=Number(r),n=String(i);if(0===i)return i;if(-1!==n.search(/[eE]/))return e.eNotation?i:t;if(-1!==r.indexOf("."))return"0"===n||n===o||n===`${s}${o}`?i:t;let h=a?o:r;return a?h===n||s+h===n?i:t:h===n||h===s+n?i:t}}return t}}var i;return function(t,e,r){const i=e===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(r),e)}(t,r)}return void 0!==t?t:""}function Nt(t,e,r,i){if(t){var n=t(e);r===e&&(r=n),e=n}return{tagName:e=yt(e,i),tagExp:r}}function yt(t,e){if(o.includes(t))throw new Error('[SECURITY] Invalid name: "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');return a.includes(t)?e.onDangerousProperty(t):t}var Et=O.getMetaDataSymbol();function wt(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;var r={};for(var i in t)i.startsWith(e)?r[i.substring(e.length)]=t[i]:r[i]=t[i];return r}function St(t,e,r,i){return _t(t,e,r,i)}function _t(t,e,r,i){for(var n,s={},a=0;a<t.length;a++){var o=t[a],h=At(o);if(void 0!==h&&h!==e.textNodeName){var l=wt(o[":@"]||{},e.attributeNamePrefix);r.push(h,l)}if(h===e.textNodeName)void 0===n?n=o[h]:n+=""+o[h];else{if(void 0===h)continue;if(o[h]){var u=_t(o[h],e,r,i),p=Ct(u,e);if(o[":@"]?Tt(u,o[":@"],i,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==o[Et]&&"object"==typeof u&&null!==u&&(u[Et]=o[Et]),void 0!==s[h]&&Object.prototype.hasOwnProperty.call(s,h))Array.isArray(s[h])||(s[h]=[s[h]]),s[h].push(u);else{var d=e.jPath?i.toString():i;e.isArray(h,d,p)?s[h]=[u]:s[h]=u}void 0!==h&&h!==e.textNodeName&&r.pop()}}}return"string"==typeof n?n.length>0&&(s[e.textNodeName]=n):void 0!==n&&(s[e.textNodeName]=n),s}function At(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(":@"!==i)return i}}function Tt(t,e,r,i){if(e)for(var n=Object.keys(e),s=n.length,a=0;a<s;a++){var o=n[a],h=o.startsWith(i.attributeNamePrefix)?o.substring(i.attributeNamePrefix.length):o,l=i.jPath?r.toString()+"."+h:r;i.isArray(o,l,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function Ct(t,e){var r=e.textNodeName,i=Object.keys(t).length;return 0===i||!(1!==i||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var Pt=function(){function t(t){this.externalEntities={},this.options=P(t)}var e=t.prototype;return e.parse=function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=l(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var i=new st(this.options,this.externalEntities),n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:St(n,this.options,i.matcher,i.readonlyMatcher)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return O.getMetaDataSymbol()},t}();function Ot(t,e){let r="";e.format&&e.indentBy.length>0&&(r="\n");const i=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let t=0;t<e.stopNodes.length;t++){const r=e.stopNodes[t];"string"==typeof r?i.push(new U(r)):r instanceof U&&i.push(r)}return It(t,e,r,new G,i)}function It(t,e,r,i,n){let s="",a=!1;if(e.maxNestedTags&&i.getDepth()>e.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(t)){if(null!=t){let r=t.toString();return r=kt(r,e),r}return""}for(let o=0;o<t.length;o++){const h=t[o],l=Mt(h);if(void 0===l)continue;const u=jt(h[":@"],e);i.push(l,u);const p=Lt(i,n);if(l===e.textNodeName){let t=h[l];p||(t=e.tagValueProcessor(l,t),t=kt(t,e)),a&&(s+=r),s+=t,a=!1,i.pop();continue}if(l===e.cdataPropName){a&&(s+=r);const t=h[l][0][e.textNodeName];s+=`<![CDATA[${String(t).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`,a=!1,i.pop();continue}if(l===e.commentPropName){const t=h[l][0][e.textNodeName];s+=r+`\x3c!--${String(t).replace(/--/g,"- -").replace(/-$/,"- ")}--\x3e`,a=!0,i.pop();continue}if("?"===l[0]){const t=Vt(h[":@"],e,p),n="?xml"===l?"":r;let o=h[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,a=!0,i.pop();continue}let d=r;""!==d&&(d+=e.indentBy);const c=r+`<${l}${Vt(h[":@"],e,p)}`;let f;f=p?Dt(h[l],e):It(h[l],e,d,i,n),-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=c+">":s+=c+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=c+`>${f}${r}</${l}>`:(s+=c+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?s+=r+e.indentBy+f+r:s+=f,s+=`</${l}>`):s+=c+"/>",a=!0,i.pop()}return s}function jt(t,e){if(!t||e.ignoreAttributes)return null;const r={};let i=!1;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n.startsWith(e.attributeNamePrefix)?n.substr(e.attributeNamePrefix.length):n]=t[n],i=!0);return i?r:null}function Dt(t,e){if(!Array.isArray(t))return null!=t?t.toString():"";let r="";for(let i=0;i<t.length;i++){const n=t[i],s=Mt(n);if(s===e.textNodeName)r+=n[s];else if(s===e.cdataPropName)r+=n[s][0][e.textNodeName];else if(s===e.commentPropName)r+=n[s][0][e.textNodeName];else{if(s&&"?"===s[0])continue;if(s){const t=$t(n[":@"],e),i=Dt(n[s],e);i&&0!==i.length?r+=`<${s}${t}>${i}</${s}>`:r+=`<${s}${t}/>`}}}return r}function $t(t,e){let r="";if(t&&!e.ignoreAttributes)for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let n=t[i];!0===n&&e.suppressBooleanAttributes?r+=` ${i.substr(e.attributeNamePrefix.length)}`:r+=` ${i.substr(e.attributeNamePrefix.length)}="${n}"`}return r}function Mt(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const i=e[r];if(Object.prototype.hasOwnProperty.call(t,i)&&":@"!==i)return i}}function Vt(t,e,r){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s;r?s=t[n]:(s=e.attributeValueProcessor(n,t[n]),s=kt(s,e)),!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${s}"`}return i}function Lt(t,e){if(!e||0===e.length)return!1;for(let r=0;r<e.length;r++)if(t.matches(e[r]))return!0;return!1}function kt(t,e){if(t&&t.length>0&&e.processEntities)for(let r=0;r<e.entities.length;r++){const i=e.entities[r];t=t.replace(i.regex,i.val)}return t}const Ft={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Rt(t){if(this.options=Object.assign({},Ft,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e?this.stopNodeExpressions.push(new U(e)):e instanceof U&&this.stopNodeExpressions.push(e)}var e;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const r of e){if("string"==typeof r&&t===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Bt),this.processTextOrObjNode=Gt,this.options.format?(this.indentate=Ut,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Gt(t,e,r,i){const n=this.extractAttributes(t);if(i.push(e,n),this.checkStopNode(i)){const n=this.buildRawContent(t),s=this.buildAttributesForStopNode(t);return i.pop(),this.buildObjectNode(n,e,s,r)}const s=this.j2x(t,r+1,i);return i.pop(),void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,r,i):this.buildObjectNode(s.val,e,s.attrStr,r)}function Ut(t){return this.options.indentBy.repeat(t)}function Bt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Rt.prototype.build=function(t){if(this.options.preserveOrder)return Ot(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});const e=new G;return this.j2x(t,0,e).val}},Rt.prototype.j2x=function(t,e,r){let i="",n="";if(this.options.maxNestedTags&&r.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");const s=this.options.jPath?r.toString():r,a=this.checkStopNode(r);for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(n+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?n+="":"?"===o[0]?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)n+=this.buildTextValNode(t[o],o,"",e,r);else if("object"!=typeof t[o]){const h=this.isAttribute(o);if(h&&!this.ignoreAttributesFn(h,s))i+=this.buildAttrPairStr(h,""+t[o],a);else if(!h)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);n+=this.replaceEntitiesValue(e)}else{r.push(o);const i=this.checkStopNode(r);if(r.pop(),i){const r=""+t[o];n+=""===r?this.indentate(e)+"<"+o+this.closeTag(o)+this.tagEndChar:this.indentate(e)+"<"+o+">"+r+"</"+o+this.tagEndChar}else n+=this.buildTextValNode(t[o],o,"",e,r)}}else if(Array.isArray(t[o])){const i=t[o].length;let s="",a="";for(let h=0;h<i;h++){const i=t[o][h];if(void 0===i);else if(null===i)"?"===o[0]?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){r.push(o);const t=this.j2x(i,e+1,r);r.pop(),s+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else s+=this.processTextOrObjNode(i,o,e,r);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),s+=t}else{r.push(o);const t=this.checkStopNode(r);if(r.pop(),t){const t=""+i;s+=""===t?this.indentate(e)+"<"+o+this.closeTag(o)+this.tagEndChar:this.indentate(e)+"<"+o+">"+t+"</"+o+this.tagEndChar}else s+=this.buildTextValNode(i,o,"",e,r)}}this.options.oneListGroup&&(s=this.buildObjectNode(s,o,a,e)),n+=s}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),r=e.length;for(let n=0;n<r;n++)i+=this.buildAttrPairStr(e[n],""+t[o][e[n]],a)}else n+=this.processTextOrObjNode(t[o],o,e,r);return{attrStr:i,val:n}},Rt.prototype.buildAttrPairStr=function(t,e,r){return r||(e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Rt.prototype.extractAttributes=function(t){if(!t||"object"!=typeof t)return null;const e={};let r=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const i=t[this.options.attributesGroupName];for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t]=i[t],r=!0)}else for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const n=this.isAttribute(i);n&&(e[n]=t[i],r=!0)}return r?e:null},Rt.prototype.buildRawContent=function(t){if("string"==typeof t)return t;if("object"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];let e="";for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(this.isAttribute(r))continue;if(this.options.attributesGroupName&&r===this.options.attributesGroupName)continue;const i=t[r];if(r===this.options.textNodeName)e+=i;else if(Array.isArray(i)){for(let t of i)if("string"==typeof t||"number"==typeof t)e+=`<${r}>${t}</${r}>`;else if("object"==typeof t&&null!==t){const i=this.buildRawContent(t),n=this.buildAttributesForStopNode(t);e+=""===i?`<${r}${n}/>`:`<${r}${n}>${i}</${r}>`}}else if("object"==typeof i&&null!==i){const t=this.buildRawContent(i),n=this.buildAttributesForStopNode(i);e+=""===t?`<${r}${n}/>`:`<${r}${n}>${t}</${r}>`}else e+=`<${r}>${i}</${r}>`}return e},Rt.prototype.buildAttributesForStopNode=function(t){if(!t||"object"!=typeof t)return"";let e="";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const r=t[this.options.attributesGroupName];for(let t in r){if(!Object.prototype.hasOwnProperty.call(r,t))continue;const i=t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t,n=r[t];!0===n&&this.options.suppressBooleanAttributes?e+=" "+i:e+=" "+i+'="'+n+'"'}}else for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;const i=this.isAttribute(r);if(i){const n=t[r];!0===n&&this.options.suppressBooleanAttributes?e+=" "+i:e+=" "+i+'="'+n+'"'}}return e},Rt.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+r+s+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+s+">"+t+n}},Rt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},Rt.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(let e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},Rt.prototype.buildTextValNode=function(t,e,r,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){const e=String(t).replace(/\]\]>/g,"]]]]><![CDATA[>");return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){const e=String(t).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine}if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,t);return n=this.replaceEntitiesValue(n),""===n?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar}},Rt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};const Wt=Rt;var Xt={validate:l};return e})());
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxp=e():t.fxp=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>zt,XMLParser:()=>Pt,XMLValidator:()=>qt});var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function n(t,e){for(var r=[],i=e.exec(t);i;){var n=[];n.startIndex=e.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)n.push(i[a]);r.push(n),i=e.exec(t)}return r}var s=function(t){return!(null==i.exec(t))},a=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],o=["__proto__","constructor","prototype"],h={allowBooleanAttributes:!1,unpairedTags:[]};function l(t,e){e=Object.assign({},h,e);var r=[],i=!1,n=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if((s=p(t,s+=2)).err)return s}else{if("<"!==t[s]){if(u(t[s]))continue;return b("InvalidChar","char '"+t[s]+"' is not expected.",E(t,s))}var a=s;if("!"===t[++s]){s=d(t,s);continue}var o=!1;"/"===t[s]&&(o=!0,s++);for(var l="";s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)l+=t[s];if("/"===(l=l.trim())[l.length-1]&&(l=l.substring(0,l.length-1),s--),!y(l))return b("InvalidTag",0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",E(t,s));var c=g(t,s);if(!1===c)return b("InvalidAttr","Attributes for '"+l+"' have open quote.",E(t,s));var f=c.value;if(s=c.index,"/"===f[f.length-1]){var m=s-f.length,N=v(f=f.substring(0,f.length-1),e);if(!0!==N)return b(N.err.code,N.err.msg,E(t,m+N.err.line));i=!0}else if(o){if(!c.tagClosed)return b("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",E(t,s));if(f.trim().length>0)return b("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",E(t,a));if(0===r.length)return b("InvalidTag","Closing tag '"+l+"' has not been opened.",E(t,a));var w=r.pop();if(l!==w.tagName){var S=E(t,w.tagStartPos);return b("InvalidTag","Expected closing tag '"+w.tagName+"' (opened in line "+S.line+", col "+S.col+") instead of closing tag '"+l+"'.",E(t,a))}0==r.length&&(n=!0)}else{var _=v(f,e);if(!0!==_)return b(_.err.code,_.err.msg,E(t,s-f.length+_.err.line));if(!0===n)return b("InvalidXml","Multiple possible root nodes found.",E(t,s));-1!==e.unpairedTags.indexOf(l)||r.push({tagName:l,tagStartPos:a}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s=d(t,++s);continue}if("?"!==t[s+1])break;if((s=p(t,++s)).err)return s}else if("&"===t[s]){var A=x(t,s);if(-1==A)return b("InvalidChar","char '&' is not expected.",E(t,s));s=A}else if(!0===n&&!u(t[s]))return b("InvalidXml","Extra text at the end",E(t,s));"<"===t[s]&&s--}return i?1==r.length?b("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",E(t,r[0].tagStartPos)):!(r.length>0)||b("InvalidXml","Invalid '"+JSON.stringify(r.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):b("InvalidXml","Start tag expected.",1)}function u(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function p(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var i=t.substr(r,e-r);if(e>5&&"xml"===i)return b("InvalidXml","XML declaration allowed only at the start of the document.",E(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function d(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var c='"',f="'";function g(t,e){for(var r="",i="",n=!1;e<t.length;e++){if(t[e]===c||t[e]===f)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){n=!0;break}r+=t[e]}return""===i&&{value:r,index:e,tagClosed:n}}var m=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function v(t,e){for(var r=n(t,m),i={},s=0;s<r.length;s++){if(0===r[s][1].length)return b("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",w(r[s]));if(void 0!==r[s][3]&&void 0===r[s][4])return b("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",w(r[s]));if(void 0===r[s][3]&&!e.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",w(r[s]));var a=r[s][2];if(!N(a))return b("InvalidAttr","Attribute '"+a+"' is an invalid name.",w(r[s]));if(Object.prototype.hasOwnProperty.call(i,a))return b("InvalidAttr","Attribute '"+a+"' is repeated.",w(r[s]));i[a]=1}return!0}function x(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function b(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function N(t){return s(t)}function y(t){return s(t)}function E(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function w(t){return t.startIndex+t[1].length}var S=function(t){return a.includes(t)?"__"+t:t},_={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function A(t,e){if("string"==typeof t){var r=t.toLowerCase();if(a.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');if(o.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution')}}function T(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,null!=(r=t.maxEntitySize)?r:1e4),maxExpansionDepth:Math.max(1,null!=(i=t.maxExpansionDepth)?i:1e4),maxTotalExpansions:Math.max(1,null!=(n=t.maxTotalExpansions)?n:1/0),maxExpandedLength:Math.max(1,null!=(s=t.maxExpandedLength)?s:1e5),maxEntityCount:Math.max(1,null!=(a=t.maxEntityCount)?a:1e3),allowedTags:null!=(o=t.allowedTags)?o:null,tagFilter:null!=(h=t.tagFilter)?h:null,appliesTo:null!=(l=t.appliesTo)?l:"all"}:T(!0);var r,i,n,s,a,o,h,l}var C,P=function(t){for(var e=Object.assign({},_,t),r=0,i=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];r<i.length;r++){var n=i[r],s=n.value,a=n.name;s&&A(s,a)}return null===e.onDangerousProperty&&(e.onDangerousProperty=S),e.processEntities=T(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),e};C="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var O=function(){function t(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,i;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((i={})[t.tagname]=t.child,i)),void 0!==e&&(this.child[this.child.length-1][C]={startIndex:e})},t.getMetaDataSymbol=function(){return C},t}(),I=function(){function t(t){this.suppressValidationErr=!t,this.options=t}var e=t.prototype;return e.readDocType=function(t,e){var r=Object.create(null),i=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var n=1,s=!1,a=!1;e<t.length;e++)if("<"!==t[e]||a)if(">"===t[e]){if(a?"-"===t[e-1]&&"-"===t[e-2]&&(a=!1,n--):n--,0===n)break}else"["===t[e]?s=!0:t[e];else{if(s&&D(t,"!ENTITY",e)){e+=7;var o,h=void 0,l=this.readEntityExp(t,e+1,this.suppressValidationErr);if(o=l[0],h=l[1],e=l[2],-1===h.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error("Entity count ("+(i+1)+") exceeds maximum allowed ("+this.options.maxEntityCount+")");r[o]=h,i++}}else if(s&&D(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(s&&D(t,"!ATTLIST",e))e+=8;else if(s&&D(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!D(t,"!--",e))throw new Error("Invalid DOCTYPE");a=!0}n++}if(0!==n)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}},e.readEntityExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;var i=t.substring(r,e);if(M(i),e=j(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var n,s=this.readIdentifierVal(t,e,"entity");if(e=s[0],n=s[1],!1!==this.options.enabled&&null!=this.options.maxEntitySize&&n.length>this.options.maxEntitySize)throw new Error('Entity "'+i+'" size ('+n.length+") exceeds maximum allowed size ("+this.options.maxEntitySize+")");return[i,n,--e]},e.readNotationExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);!this.suppressValidationErr&&M(i),e=j(t,e);var n=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==n&&"PUBLIC"!==n)throw new Error('Expected SYSTEM or PUBLIC, found "'+n+'"');e+=n.length,e=j(t,e);var s=null,a=null;if("PUBLIC"===n){var o=this.readIdentifierVal(t,e,"publicIdentifier");if(e=o[0],s=o[1],'"'===t[e=j(t,e)]||"'"===t[e]){var h=this.readIdentifierVal(t,e,"systemIdentifier");e=h[0],a=h[1]}}else if("SYSTEM"===n){var l=this.readIdentifierVal(t,e,"systemIdentifier");if(e=l[0],a=l[1],!this.suppressValidationErr&&!a)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:i,publicIdentifier:s,systemIdentifier:a,index:--e}},e.readIdentifierVal=function(t,e,r){var i,n=t[e];if('"'!==n&&"'"!==n)throw new Error('Expected quoted string, found "'+n+'"');for(var s=++e;e<t.length&&t[e]!==n;)e++;if(i=t.substring(s,e),t[e]!==n)throw new Error("Unterminated "+r+" value");return[++e,i]},e.readElementExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);if(!this.suppressValidationErr&&!s(i))throw new Error('Invalid element name: "'+i+'"');var n="";if("E"===t[e=j(t,e)]&&D(t,"MPTY",e))e+=4;else if("A"===t[e]&&D(t,"NY",e))e+=2;else if("("===t[e]){for(var a=++e;e<t.length&&")"!==t[e];)e++;if(n=t.substring(a,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'+t[e]+'"');return{elementName:i,contentModel:n.trim(),index:e}},e.readAttlistExp=function(t,e){for(var r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);for(M(i),r=e=j(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);if(!M(n))throw new Error('Invalid attribute name: "'+n+'"');e=j(t,e);var s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=j(t,e+=8)])throw new Error("Expected '(', found \""+t[e]+'"');e++;for(var a=[];e<t.length&&")"!==t[e];){for(var o=e;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;var h=t.substring(o,e);if(!M(h=h.trim()))throw new Error('Invalid notation name: "'+h+'"');a.push(h),"|"===t[e]&&(e++,e=j(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+a.join("|")+")"}else{for(var l=e;e<t.length&&!/\s/.test(t[e]);)e++;if(s+=t.substring(l,e),!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(s.toUpperCase()))throw new Error('Invalid attribute type: "'+s+'"')}e=j(t,e);var u="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())u="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())u="#IMPLIED",e+=7;else{var p=this.readIdentifierVal(t,e,"ATTLIST");e=p[0],u=p[1]}return{elementName:i,attributeName:n,attributeType:s,defaultValue:u,index:e}},t}(),j=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function D(t,e,r){for(var i=0;i<e.length;i++)if(e[i]!==t[r+i+1])return!1;return!0}function M(t){if(s(t))return t;throw new Error("Invalid entity name "+t)}const $=/^[-+]?0x[a-fA-F0-9]+$/,V=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,L={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};const k=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}class R{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const r=e[e.length-1];return void 0!==r.values&&t in r.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class G{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new R(this)}push(t,e=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const n=this.siblingStacks[i],s=r?`${r}:${t}`:t,a=n.get(s)||0;let o=0;for(const t of n.values())o+=t;n.set(s,a+1);const h={tag:t,position:o,counter:a};null!=r&&(h.namespace=r),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const r=t||this.separator;if(r===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,r=t.length-1;for(;r>=0&&e>=0;){const i=t[r];if("deep-wildcard"===i.type){if(r--,r<0)return!0;const i=t[r];let n=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,r--,n=!0;break}if(!n)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,r--}}return r<0}_matchSegment(t,e,r){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!r)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!r)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class U{constructor(t,e={},r){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let r=0,i="";for(;r<t.length;)t[r]===this.separator?r+1<t.length&&t[r+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),r+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",r++):(i+=t[r],r++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let r=null,i=t;const n=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(n&&(i=n[1]+n[3],n[2])){const t=n[2].slice(1,-1);t&&(r=t)}let s,a,o=i;if(i.includes("::")){const e=i.indexOf("::");if(s=i.substring(0,e).trim(),o=i.substring(e+2).trim(),!s)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(o.includes(":")){const t=o.lastIndexOf(":"),e=o.substring(0,t).trim(),r=o.substring(t+1).trim();["first","last","odd","even"].includes(r)||/^nth\(\d+\)$/.test(r)?(a=e,h=r):a=o}else a=o;if(!a)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=a,s&&(e.namespace=s),r)if(r.includes("=")){const t=r.indexOf("=");e.attrName=r.substring(0,t).trim(),e.attrValue=r.substring(t+1).trim()}else e.attrName=r.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class B{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,r=t.segments[t.segments.length-1],i=r?.tag;if(i&&"*"!==i){const r=`${e}:${i}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),r=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(r);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const n=this._wildcardByDepth.get(e);if(n)for(let e=0;e<n.length;e++)if(t.matches(n[e]))return n[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const W={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},X={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Y={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},z=new Set("!?\\\\/[]$%{}^&*()<>|+");function q(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(z.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Z(...t){const e=Object.create(null);for(const r of t)if(r)for(const t of Object.keys(r)){const i=r[t];if("string"==typeof i)e[t]=i;else if(i&&"object"==typeof i&&void 0!==i.val){const r=i.val;"string"==typeof r&&(e[t]=r)}}return e}const J="external",K="base",Q="all",H=Object.freeze({allow:0,leave:1,remove:2,throw:3}),tt=new Set([9,10,13]);class et{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??J)&&e!==J?e===Q?new Set([Q]):e===K?new Set([K]):Array.isArray(e)?new Set(e):new Set([J]):new Set([J]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=Z(X,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const r=function(t){if(!t)return{xmlVersion:1,onLevel:H.allow,nullLevel:H.remove};const e=1.1===t.xmlVersion?1.1:1,r=H[t.onNCR]??H.allow,i=H[t.nullNCR]??H.remove;return{xmlVersion:e,onLevel:r,nullLevel:Math.max(i,H.remove)}}(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))q(e);this._externalMap=Z(t)}addExternalEntity(t,e){q(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Z(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;const e=t,r=[],i=t.length;let n=0,s=0;const a=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,h=a||o;for(;s<i;){if(38!==t.charCodeAt(s)){s++;continue}let e=s+1;for(;e<i&&59!==t.charCodeAt(e)&&e-s<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){s++;continue}const l=t.slice(s+1,e);if(0===l.length){s++;continue}let u,p;if(this._removeSet.has(l))u="",void 0===p&&(p=J);else{if(this._leaveSet.has(l)){s++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){s++;continue}u=t,p=K}else{const t=this._resolveName(l);u=t?.value,p=t?.tier}}if(void 0!==u){if(s>n&&r.push(t.slice(n,s)),r.push(u),n=e+1,s=n,h&&this._tierCounts(p)){if(a&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else s++}n<i&&r.push(t.slice(n));const l=0===r.length?t:r.join("");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(Q)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:J}:t in this._externalMap?{value:this._externalMap[t],tier:J}:t in this._baseMap?{value:this._baseMap[t],tier:K}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!tt.has(t)?H.remove:-1}_applyNCRAction(t,e,r){switch(t){case H.allow:return String.fromCodePoint(r);case H.remove:return"";case H.leave:return;case H.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(t){const e=t.charCodeAt(1);let r;if(r=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const i=this._classifyNCR(r);if(!this._numericAllowed&&i<H.remove)return;const n=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(n,t,r)}}function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},rt.apply(null,arguments)}function it(t,e){if(!t)return{};var r=e.attributesGroupName?t[e.attributesGroupName]:t;if(!r)return{};var i={};for(var n in r)n.startsWith(e.attributeNamePrefix)?i[n.substring(e.attributeNamePrefix.length)]=r[n]:i[n]=r[n];return i}function nt(t){if(t&&"string"==typeof t){var e=t.indexOf(":");if(-1!==e&&e>0){var r=t.substring(0,e);if("xmlns"!==r)return r}}}var st=function(t,e){var r;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=ut,this.parseTextData=at,this.resolveNameSpace=ot,this.buildAttributesMap=lt,this.isItStopNode=ft,this.replaceEntitiesValue=dt,this.readStopNodeData=xt,this.saveTextToParentTag=ct,this.addChild=pt,this.ignoreAttributesFn="function"==typeof(r=this.options.ignoreAttributes)?r:Array.isArray(r)?function(t){for(var e,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(e=i()).done;){var n=e.value;if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0;var i=rt({},X);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:("object"==typeof this.options.htmlEntities?i=this.options.htmlEntities:!0===this.options.htmlEntities&&(i=rt({},Y,W)),this.entityDecoder=new et({namedEntities:rt({},i,e),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new G,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new B;var n=this.options.stopNodes;if(n&&n.length>0){for(var s=0;s<n.length;s++){var a=n[s];"string"==typeof a?this.stopNodeExpressionsSet.add(new U(a)):a instanceof U&&this.stopNodeExpressionsSet.add(a)}this.stopNodeExpressionsSet.seal()}};function at(t,e,r,i,n,s,a){var o=this.options;if(void 0!==t&&(o.trimValues&&!i&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,r));var h=o.jPath?r.toString():r,l=o.tagValueProcessor(e,t,h,n,s);return null==l?t:typeof l!=typeof t||l!==t?l:o.trimValues||t.trim()===t?bt(t,o.parseTagValue,o.numberParseOptions):t}}function ot(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var ht=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function lt(t,e,r,i){void 0===i&&(i=!1);var s=this.options;if(!0===i||!0!==s.ignoreAttributes&&"string"==typeof t){for(var a=n(t,ht),o=a.length,h={},l=new Array(o),u=!1,p={},d=0;d<o;d++){var c=this.resolveNameSpace(a[d][1]),f=a[d][4];if(c.length&&void 0!==f){var g=f;s.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g,r,this.readonlyMatcher),l[d]=g,p[c]=g,u=!0}}u&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(p);for(var m=s.jPath?e.toString():this.readonlyMatcher,v=!1,x=0;x<o;x++){var b=this.resolveNameSpace(a[x][1]);if(!this.ignoreAttributesFn(b,m)){var N=s.attributeNamePrefix+b;if(b.length)if(s.transformAttributeName&&(N=s.transformAttributeName(N)),N=yt(N,s),void 0!==a[x][4]){var y=l[x],E=s.attributeValueProcessor(b,y,m);h[N]=null==E?y:typeof E!=typeof y||E!==y?E:bt(y,s.parseAttributeValue,s.numberParseOptions),v=!0}else s.allowBooleanAttributes&&(h[N]=!0,v=!0)}}if(!v)return;if(s.attributesGroupName&&!s.preserveOrder){var w={};return w[s.attributesGroupName]=h,w}return h}}var ut=function(t){t=t.replace(/\r\n?/g,"\n");var e=new O("!xml"),r=e,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;for(var n=this.options,s=new I(n.processEntities),a=t.length,o=0;o<a;o++)if("<"===t[o]){var h=t.charCodeAt(o+1);if(47===h){var l=gt(t,">",o,"Closing Tag is not closed."),u=t.substring(o+2,l).trim();if(n.removeNSPrefix){var p=u.indexOf(":");-1!==p&&(u=u.substr(p+1))}u=Nt(n.transformTagName,u,"",n).tagName,r&&(i=this.saveTextToParentTag(i,r,this.readonlyMatcher));var d=this.matcher.getCurrentTag();if(u&&n.unpairedTagsSet.has(u))throw new Error("Unpaired tag can not be used as closing tag: </"+u+">");d&&n.unpairedTagsSet.has(d)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),i="",o=l}else if(63===h){var c=vt(t,o,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,r,this.readonlyMatcher);var f=this.buildAttributesMap(c.tagExp,this.matcher,c.tagName,!0);if(f){var g=f[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(g)||1)}if(n.ignoreDeclaration&&"?xml"===c.tagName||n.ignorePiTags);else{var m=new O(c.tagName);m.add(n.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&!0!==n.ignoreAttributes&&(m[":@"]=f),this.addChild(r,m,this.readonlyMatcher,o)}o=c.closeIndex+1}else if(33===h&&45===t.charCodeAt(o+2)&&45===t.charCodeAt(o+3)){var v=gt(t,"--\x3e",o+4,"Comment is not closed.");if(n.commentPropName){var x,b=t.substring(o+4,v-2);i=this.saveTextToParentTag(i,r,this.readonlyMatcher),r.add(n.commentPropName,[(x={},x[n.textNodeName]=b,x)])}o=v}else if(33===h&&68===t.charCodeAt(o+2)){var N=s.readDocType(t,o);this.entityDecoder.addInputEntities(N.entities),o=N.i}else if(33===h&&91===t.charCodeAt(o+2)){var y=gt(t,"]]>",o,"CDATA is not closed.")-2,E=t.substring(o+9,y);i=this.saveTextToParentTag(i,r,this.readonlyMatcher);var w,S=this.parseTextData(E,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==S&&(S=""),n.cdataPropName?r.add(n.cdataPropName,[(w={},w[n.textNodeName]=E,w)]):r.add(n.textNodeName,S),o=y+2}else{var _=vt(t,o,n.removeNSPrefix);if(!_){var A=t.substring(Math.max(0,o-50),Math.min(a,o+50));throw new Error("readTagExp returned undefined at position "+o+'. Context: "'+A+'"')}var T=_.tagName,C=_.rawTagName,P=_.tagExp,j=_.attrExpPresent,D=_.closeIndex,M=Nt(n.transformTagName,T,P,n);if(T=M.tagName,P=M.tagExp,n.strictReservedNames&&(T===n.commentPropName||T===n.cdataPropName||T===n.textNodeName||T===n.attributesGroupName))throw new Error("Invalid tag name: "+T);r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,this.readonlyMatcher,!1));var $=r;$&&n.unpairedTagsSet.has($.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var V=!1;P.length>0&&P.lastIndexOf("/")===P.length-1&&(V=!0,P="/"===T[T.length-1]?T=T.substr(0,T.length-1):P.substr(0,P.length-1),j=T!==P);var L,k=null;L=nt(C),T!==e.tagname&&this.matcher.push(T,{},L),T!==P&&j&&(k=this.buildAttributesMap(P,this.matcher,T))&&it(k,n),T!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var F=o;if(this.isCurrentNodeStopNode){var R="";if(V)o=_.closeIndex;else if(n.unpairedTagsSet.has(T))o=_.closeIndex;else{var G=this.readStopNodeData(t,C,D+1);if(!G)throw new Error("Unexpected end of "+C);o=G.i,R=G.tagContent}var U=new O(T);k&&(U[":@"]=k),U.add(n.textNodeName,R),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,U,this.readonlyMatcher,F)}else{if(V){var B=Nt(n.transformTagName,T,P,n);T=B.tagName,P=B.tagExp;var W=new O(T);k&&(W[":@"]=k),this.addChild(r,W,this.readonlyMatcher,F),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(n.unpairedTagsSet.has(T)){var X=new O(T);k&&(X[":@"]=k),this.addChild(r,X,this.readonlyMatcher,F),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=_.closeIndex;continue}var Y=new O(T);if(this.tagsNodeStack.length>n.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),k&&(Y[":@"]=k),this.addChild(r,Y,this.readonlyMatcher,F),r=Y}i="",o=D}}}else i+=t[o];return e.child};function pt(t,e,r,i){this.options.captureMetaData||(i=void 0);var n=this.options.jPath?r.toString():r,s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}function dt(t,e,r){var i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){var n=this.options.jPath?r.toString():r;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,n)))return t}if(i.tagFilter){var s=this.options.jPath?r.toString():r;if(!i.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function ct(t,e,r,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ft(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function gt(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n+e.length-1}function mt(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n}function vt(t,e,r,i){void 0===i&&(i=">");var n=function(t,e,r){void 0===r&&(r=">");for(var i=0,n=t.length,s=r.charCodeAt(0),a=r.length>1?r.charCodeAt(1):-1,o="",h=e,l=e;l<n;l++){var u=t.charCodeAt(l);if(i)u===i&&(i=0);else if(34===u||39===u)i=u;else if(u===s){if(-1===a)return{data:o+=t.substring(h,l),index:l};if(t.charCodeAt(l+1)===a)return{data:o+=t.substring(h,l),index:l}}else 9!==u||i||(o+=t.substring(h,l)+" ",h=l+1)}}(t,e+1,i);if(n){var s=n.data,a=n.index,o=s.search(/\s/),h=s,l=!0;-1!==o&&(h=s.substring(0,o),s=s.substring(o+1).trimStart());var u=h;if(r){var p=h.indexOf(":");-1!==p&&(l=(h=h.substr(p+1))!==n.data.substr(p+1))}return{tagName:h,tagExp:s,closeIndex:a,attrExpPresent:l,rawTagName:u}}}function xt(t,e,r){for(var i=r,n=1,s=t.length;r<s;r++)if("<"===t[r]){var a=t.charCodeAt(r+1);if(47===a){var o=mt(t,">",r,e+" is not closed");if(t.substring(r+2,o).trim()===e&&0===--n)return{tagContent:t.substring(i,r),i:o};r=o}else if(63===a)r=gt(t,"?>",r+1,"StopNode is not closed.");else if(33===a&&45===t.charCodeAt(r+2)&&45===t.charCodeAt(r+3))r=gt(t,"--\x3e",r+3,"StopNode is not closed.");else if(33===a&&91===t.charCodeAt(r+2))r=gt(t,"]]>",r,"StopNode is not closed.")-2;else{var h=vt(t,r,!1);h&&((h&&h.tagName)===e&&"/"!==h.tagExp[h.tagExp.length-1]&&n++,r=h.closeIndex)}}}function bt(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&function(t,e={}){if(e=Object.assign({},L,e),!t||"string"!=typeof t)return t;let r=t.trim();if(0===r.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===r)return 0;if(e.hex&&$.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return function(t,e,r){if(!r.eNotation)return t;const i=e.match(k);if(i){let n=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",a=i[2],o=n?t[a.length+1]===s:t[a.length]===s;return a.length>1&&o?t:(1!==a.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s)&&a.length>0?r.leadingZeros&&!o?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,r,e);{const n=V.exec(r);if(n){const s=n[1]||"",a=n[2];let o=(i=n[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const h=s?"."===t[a.length+1]:"."===t[a.length];if(!e.leadingZeros&&(a.length>1||1===a.length&&!h))return t;{const i=Number(r),n=String(i);if(0===i)return i;if(-1!==n.search(/[eE]/))return e.eNotation?i:t;if(-1!==r.indexOf("."))return"0"===n||n===o||n===`${s}${o}`?i:t;let h=a?o:r;return a?h===n||s+h===n?i:t:h===n||h===s+n?i:t}}return t}}var i;return function(t,e,r){const i=e===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(r),e)}(t,r)}return void 0!==t?t:""}function Nt(t,e,r,i){if(t){var n=t(e);r===e&&(r=n),e=n}return{tagName:e=yt(e,i),tagExp:r}}function yt(t,e){if(o.includes(t))throw new Error('[SECURITY] Invalid name: "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');return a.includes(t)?e.onDangerousProperty(t):t}var Et=O.getMetaDataSymbol();function wt(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;var r={};for(var i in t)i.startsWith(e)?r[i.substring(e.length)]=t[i]:r[i]=t[i];return r}function St(t,e,r,i){return _t(t,e,r,i)}function _t(t,e,r,i){for(var n,s={},a=0;a<t.length;a++){var o=t[a],h=At(o);if(void 0!==h&&h!==e.textNodeName){var l=wt(o[":@"]||{},e.attributeNamePrefix);r.push(h,l)}if(h===e.textNodeName)void 0===n?n=o[h]:n+=""+o[h];else{if(void 0===h)continue;if(o[h]){var u=_t(o[h],e,r,i),p=Ct(u,e);if(0===Object.keys(u).length&&e.alwaysCreateTextNode&&(u[e.textNodeName]=""),o[":@"]?Tt(u,o[":@"],i,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==o[Et]&&"object"==typeof u&&null!==u&&(u[Et]=o[Et]),void 0!==s[h]&&Object.prototype.hasOwnProperty.call(s,h))Array.isArray(s[h])||(s[h]=[s[h]]),s[h].push(u);else{var d=e.jPath?i.toString():i;e.isArray(h,d,p)?s[h]=[u]:s[h]=u}void 0!==h&&h!==e.textNodeName&&r.pop()}}}return"string"==typeof n?n.length>0&&(s[e.textNodeName]=n):void 0!==n&&(s[e.textNodeName]=n),s}function At(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(":@"!==i)return i}}function Tt(t,e,r,i){if(e)for(var n=Object.keys(e),s=n.length,a=0;a<s;a++){var o=n[a],h=o.startsWith(i.attributeNamePrefix)?o.substring(i.attributeNamePrefix.length):o,l=i.jPath?r.toString()+"."+h:r;i.isArray(o,l,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function Ct(t,e){var r=e.textNodeName,i=Object.keys(t).length;return 0===i||!(1!==i||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var Pt=function(){function t(t){this.externalEntities={},this.options=P(t)}var e=t.prototype;return e.parse=function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=l(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var i=new st(this.options,this.externalEntities),n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:St(n,this.options,i.matcher,i.readonlyMatcher)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return O.getMetaDataSymbol()},t}();function Ot(t){return String(t).replace(/--/g,"- -").replace(/--/g,"- -").replace(/-$/,"- ")}function It(t){return String(t).replace(/\]\]>/g,"]]]]><![CDATA[>")}function jt(t){return String(t).replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Dt(t,e){let r="";e.format&&e.indentBy.length>0&&(r="\n");const i=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let t=0;t<e.stopNodes.length;t++){const r=e.stopNodes[t];"string"==typeof r?i.push(new U(r)):r instanceof U&&i.push(r)}return Mt(t,e,r,new G,i)}function Mt(t,e,r,i,n){let s="",a=!1;if(e.maxNestedTags&&i.getDepth()>e.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(t)){if(null!=t){let r=t.toString();return r=Gt(r,e),r}return""}for(let o=0;o<t.length;o++){const h=t[o],l=kt(h);if(void 0===l)continue;const u=$t(h[":@"],e);i.push(l,u);const p=Rt(i,n);if(l===e.textNodeName){let t=h[l];p||(t=e.tagValueProcessor(l,t),t=Gt(t,e)),a&&(s+=r),s+=t,a=!1,i.pop();continue}if(l===e.cdataPropName){a&&(s+=r),s+=`<![CDATA[${It(h[l][0][e.textNodeName])}]]>`,a=!1,i.pop();continue}if(l===e.commentPropName){s+=r+`\x3c!--${Ot(h[l][0][e.textNodeName])}--\x3e`,a=!0,i.pop();continue}if("?"===l[0]){const t=Ft(h[":@"],e,p),n="?xml"===l?"":r;let o=h[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,a=!0,i.pop();continue}let d=r;""!==d&&(d+=e.indentBy);const c=r+`<${l}${Ft(h[":@"],e,p)}`;let f;f=p?Vt(h[l],e):Mt(h[l],e,d,i,n),-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=c+">":s+=c+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?s+=c+`>${f}${r}</${l}>`:(s+=c+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?s+=r+e.indentBy+f+r:s+=f,s+=`</${l}>`):s+=c+"/>",a=!0,i.pop()}return s}function $t(t,e){if(!t||e.ignoreAttributes)return null;const r={};let i=!1;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n.startsWith(e.attributeNamePrefix)?n.substr(e.attributeNamePrefix.length):n]=jt(t[n]),i=!0);return i?r:null}function Vt(t,e){if(!Array.isArray(t))return null!=t?t.toString():"";let r="";for(let i=0;i<t.length;i++){const n=t[i],s=kt(n);if(s===e.textNodeName)r+=n[s];else if(s===e.cdataPropName)r+=n[s][0][e.textNodeName];else if(s===e.commentPropName)r+=n[s][0][e.textNodeName];else{if(s&&"?"===s[0])continue;if(s){const t=Lt(n[":@"],e),i=Vt(n[s],e);i&&0!==i.length?r+=`<${s}${t}>${i}</${s}>`:r+=`<${s}${t}/>`}}}return r}function Lt(t,e){let r="";if(t&&!e.ignoreAttributes)for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let n=t[i];!0===n&&e.suppressBooleanAttributes?r+=` ${i.substr(e.attributeNamePrefix.length)}`:r+=` ${i.substr(e.attributeNamePrefix.length)}="${jt(n)}"`}return r}function kt(t){const e=Object.keys(t);for(let r=0;r<e.length;r++){const i=e[r];if(Object.prototype.hasOwnProperty.call(t,i)&&":@"!==i)return i}}function Ft(t,e,r){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s;r?s=t[n]:(s=e.attributeValueProcessor(n,t[n]),s=Gt(s,e)),!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${jt(s)}"`}return i}function Rt(t,e){if(!e||0===e.length)return!1;for(let r=0;r<e.length;r++)if(t.matches(e[r]))return!0;return!1}function Gt(t,e){if(t&&t.length>0&&e.processEntities)for(let r=0;r<e.entities.length;r++){const i=e.entities[r];t=t.replace(i.regex,i.val)}return t}const Ut={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Bt(t){if(this.options=Object.assign({},Ut,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e?this.stopNodeExpressions.push(new U(e)):e instanceof U&&this.stopNodeExpressions.push(e)}var e;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const r of e){if("string"==typeof r&&t===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Yt),this.processTextOrObjNode=Wt,this.options.format?(this.indentate=Xt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Wt(t,e,r,i){const n=this.extractAttributes(t);if(i.push(e,n),this.checkStopNode(i)){const n=this.buildRawContent(t),s=this.buildAttributesForStopNode(t);return i.pop(),this.buildObjectNode(n,e,s,r)}const s=this.j2x(t,r+1,i);return i.pop(),void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,r,i):this.buildObjectNode(s.val,e,s.attrStr,r)}function Xt(t){return this.options.indentBy.repeat(t)}function Yt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Bt.prototype.build=function(t){if(this.options.preserveOrder)return Dt(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});const e=new G;return this.j2x(t,0,e).val}},Bt.prototype.j2x=function(t,e,r){let i="",n="";if(this.options.maxNestedTags&&r.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");const s=this.options.jPath?r.toString():r,a=this.checkStopNode(r);for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(n+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName||o===this.options.commentPropName?n+="":"?"===o[0]?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)n+=this.buildTextValNode(t[o],o,"",e,r);else if("object"!=typeof t[o]){const h=this.isAttribute(o);if(h&&!this.ignoreAttributesFn(h,s))i+=this.buildAttrPairStr(h,""+t[o],a);else if(!h)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);n+=this.replaceEntitiesValue(e)}else{r.push(o);const i=this.checkStopNode(r);if(r.pop(),i){const r=""+t[o];n+=""===r?this.indentate(e)+"<"+o+this.closeTag(o)+this.tagEndChar:this.indentate(e)+"<"+o+">"+r+"</"+o+this.tagEndChar}else n+=this.buildTextValNode(t[o],o,"",e,r)}}else if(Array.isArray(t[o])){const i=t[o].length;let s="",a="";for(let h=0;h<i;h++){const i=t[o][h];if(void 0===i);else if(null===i)"?"===o[0]?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){r.push(o);const t=this.j2x(i,e+1,r);r.pop(),s+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else s+=this.processTextOrObjNode(i,o,e,r);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),s+=t}else{r.push(o);const t=this.checkStopNode(r);if(r.pop(),t){const t=""+i;s+=""===t?this.indentate(e)+"<"+o+this.closeTag(o)+this.tagEndChar:this.indentate(e)+"<"+o+">"+t+"</"+o+this.tagEndChar}else s+=this.buildTextValNode(i,o,"",e,r)}}this.options.oneListGroup&&(s=this.buildObjectNode(s,o,a,e)),n+=s}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),r=e.length;for(let n=0;n<r;n++)i+=this.buildAttrPairStr(e[n],""+t[o][e[n]],a)}else n+=this.processTextOrObjNode(t[o],o,e,r);return{attrStr:i,val:n}},Bt.prototype.buildAttrPairStr=function(t,e,r){return r||(e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+jt(e)+'"'},Bt.prototype.extractAttributes=function(t){if(!t||"object"!=typeof t)return null;const e={};let r=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const i=t[this.options.attributesGroupName];for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t]=jt(i[t]),r=!0)}else for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const n=this.isAttribute(i);n&&(e[n]=jt(t[i]),r=!0)}return r?e:null},Bt.prototype.buildRawContent=function(t){if("string"==typeof t)return t;if("object"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];let e="";for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(this.isAttribute(r))continue;if(this.options.attributesGroupName&&r===this.options.attributesGroupName)continue;const i=t[r];if(r===this.options.textNodeName)e+=i;else if(Array.isArray(i)){for(let t of i)if("string"==typeof t||"number"==typeof t)e+=`<${r}>${t}</${r}>`;else if("object"==typeof t&&null!==t){const i=this.buildRawContent(t),n=this.buildAttributesForStopNode(t);e+=""===i?`<${r}${n}/>`:`<${r}${n}>${i}</${r}>`}}else if("object"==typeof i&&null!==i){const t=this.buildRawContent(i),n=this.buildAttributesForStopNode(i);e+=""===t?`<${r}${n}/>`:`<${r}${n}>${t}</${r}>`}else e+=`<${r}>${i}</${r}>`}return e},Bt.prototype.buildAttributesForStopNode=function(t){if(!t||"object"!=typeof t)return"";let e="";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const r=t[this.options.attributesGroupName];for(let t in r){if(!Object.prototype.hasOwnProperty.call(r,t))continue;const i=t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t,n=r[t];!0===n&&this.options.suppressBooleanAttributes?e+=" "+i:e+=" "+i+'="'+n+'"'}}else for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;const i=this.isAttribute(r);if(i){const n=t[r];!0===n&&this.options.suppressBooleanAttributes?e+=" "+i:e+=" "+i+'="'+n+'"'}}return e},Bt.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+r+s+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+s+">"+t+n}},Bt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},Bt.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(let e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},Bt.prototype.buildTextValNode=function(t,e,r,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){const e=It(t);return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){const e=Ot(t);return this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine}if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,t);return n=this.replaceEntitiesValue(n),""===n?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar}},Bt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};const zt=Bt;var qt={validate:l};return e})());
2
2
  //# sourceMappingURL=fxp.min.js.map
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.XMLParser=e():t.XMLParser=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>Tt});var r=":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",n=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function i(t,e){for(var r=[],n=e.exec(t);n;){var i=[];i.startIndex=e.lastIndex-n[0].length;for(var a=n.length,s=0;s<a;s++)i.push(n[s]);r.push(i),n=e.exec(t)}return r}var a=function(t){return!(null==n.exec(t))},s=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],o=["__proto__","constructor","prototype"],h=function(t){return s.includes(t)?"__"+t:t},l={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:h};function u(t,e){if("string"==typeof t){var r=t.toLowerCase();if(s.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');if(o.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution')}}function d(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,null!=(r=t.maxEntitySize)?r:1e4),maxExpansionDepth:Math.max(1,null!=(n=t.maxExpansionDepth)?n:1e4),maxTotalExpansions:Math.max(1,null!=(i=t.maxTotalExpansions)?i:1/0),maxExpandedLength:Math.max(1,null!=(a=t.maxExpandedLength)?a:1e5),maxEntityCount:Math.max(1,null!=(s=t.maxEntityCount)?s:1e3),allowedTags:null!=(o=t.allowedTags)?o:null,tagFilter:null!=(h=t.tagFilter)?h:null,appliesTo:null!=(l=t.appliesTo)?l:"all"}:d(!0);var r,n,i,a,s,o,h,l}var p,c=function(t){for(var e=Object.assign({},l,t),r=0,n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];r<n.length;r++){var i=n[r],a=i.value,s=i.name;a&&u(a,s)}return null===e.onDangerousProperty&&(e.onDangerousProperty=h),e.processEntities=d(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),e};p="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var f=function(){function t(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,n;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((n={})[t.tagname]=t.child,n)),void 0!==e&&(this.child[this.child.length-1][p]={startIndex:e})},t.getMetaDataSymbol=function(){return p},t}(),g=function(){function t(t){this.suppressValidationErr=!t,this.options=t}var e=t.prototype;return e.readDocType=function(t,e){var r=Object.create(null),n=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var i=1,a=!1,s=!1;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?a=!0:t[e];else{if(a&&v(t,"!ENTITY",e)){e+=7;var o,h=void 0,l=this.readEntityExp(t,e+1,this.suppressValidationErr);if(o=l[0],h=l[1],e=l[2],-1===h.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&n>=this.options.maxEntityCount)throw new Error("Entity count ("+(n+1)+") exceeds maximum allowed ("+this.options.maxEntityCount+")");r[o]=h,n++}}else if(a&&v(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(a&&v(t,"!ATTLIST",e))e+=8;else if(a&&v(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!v(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}},e.readEntityExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;var n=t.substring(r,e);if(x(n),e=m(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var i,a=this.readIdentifierVal(t,e,"entity");if(e=a[0],i=a[1],!1!==this.options.enabled&&null!=this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw new Error('Entity "'+n+'" size ('+i.length+") exceeds maximum allowed size ("+this.options.maxEntitySize+")");return[n,i,--e]},e.readNotationExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);!this.suppressValidationErr&&x(n),e=m(t,e);var i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error('Expected SYSTEM or PUBLIC, found "'+i+'"');e+=i.length,e=m(t,e);var a=null,s=null;if("PUBLIC"===i){var o=this.readIdentifierVal(t,e,"publicIdentifier");if(e=o[0],a=o[1],'"'===t[e=m(t,e)]||"'"===t[e]){var h=this.readIdentifierVal(t,e,"systemIdentifier");e=h[0],s=h[1]}}else if("SYSTEM"===i){var l=this.readIdentifierVal(t,e,"systemIdentifier");if(e=l[0],s=l[1],!this.suppressValidationErr&&!s)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:n,publicIdentifier:a,systemIdentifier:s,index:--e}},e.readIdentifierVal=function(t,e,r){var n,i=t[e];if('"'!==i&&"'"!==i)throw new Error('Expected quoted string, found "'+i+'"');for(var a=++e;e<t.length&&t[e]!==i;)e++;if(n=t.substring(a,e),t[e]!==i)throw new Error("Unterminated "+r+" value");return[++e,n]},e.readElementExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);if(!this.suppressValidationErr&&!a(n))throw new Error('Invalid element name: "'+n+'"');var i="";if("E"===t[e=m(t,e)]&&v(t,"MPTY",e))e+=4;else if("A"===t[e]&&v(t,"NY",e))e+=2;else if("("===t[e]){for(var s=++e;e<t.length&&")"!==t[e];)e++;if(i=t.substring(s,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'+t[e]+'"');return{elementName:n,contentModel:i.trim(),index:e}},e.readAttlistExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);for(x(n),r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);if(!x(i))throw new Error('Invalid attribute name: "'+i+'"');e=m(t,e);var a="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(a="NOTATION","("!==t[e=m(t,e+=8)])throw new Error("Expected '(', found \""+t[e]+'"');e++;for(var s=[];e<t.length&&")"!==t[e];){for(var o=e;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;var h=t.substring(o,e);if(!x(h=h.trim()))throw new Error('Invalid notation name: "'+h+'"');s.push(h),"|"===t[e]&&(e++,e=m(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,a+=" ("+s.join("|")+")"}else{for(var l=e;e<t.length&&!/\s/.test(t[e]);)e++;if(a+=t.substring(l,e),!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(a.toUpperCase()))throw new Error('Invalid attribute type: "'+a+'"')}e=m(t,e);var u="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())u="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())u="#IMPLIED",e+=7;else{var d=this.readIdentifierVal(t,e,"ATTLIST");e=d[0],u=d[1]}return{elementName:n,attributeName:i,attributeType:a,defaultValue:u,index:e}},t}(),m=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function v(t,e,r){for(var n=0;n<e.length;n++)if(e[n]!==t[r+n+1])return!1;return!0}function x(t){if(a(t))return t;throw new Error("Invalid entity name "+t)}const y=/^[-+]?0x[a-fA-F0-9]+$/,b=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,E={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};const N=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}class _{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const r=e[e.length-1];return void 0!==r.values&&t in r.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class S{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new _(this)}push(t,e=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const i=this.siblingStacks[n],a=r?`${r}:${t}`:t,s=i.get(a)||0;let o=0;for(const t of i.values())o+=t;i.set(a,s+1);const h={tag:t,position:o,counter:s};null!=r&&(h.namespace=r),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const r=t||this.separator;if(r===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,r=t.length-1;for(;r>=0&&e>=0;){const n=t[r];if("deep-wildcard"===n.type){if(r--,r<0)return!0;const n=t[r];let i=!1;for(let t=e;t>=0;t--)if(this._matchSegment(n,this.path[t],t===this.path.length-1)){e=t-1,r--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(n,this.path[e],e===this.path.length-1))return!1;e--,r--}}return r<0}_matchSegment(t,e,r){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!r)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!r)return!1;const n=e.counter??0;if("first"===t.position&&0!==n)return!1;if("odd"===t.position&&n%2!=1)return!1;if("even"===t.position&&n%2!=0)return!1;if("nth"===t.position&&n!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class T{constructor(t,e={},r){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let r=0,n="";for(;r<t.length;)t[r]===this.separator?r+1<t.length&&t[r+1]===this.separator?(n.trim()&&(e.push(this._parseSegment(n.trim())),n=""),e.push({type:"deep-wildcard"}),r+=2):(n.trim()&&e.push(this._parseSegment(n.trim())),n="",r++):(n+=t[r],r++);return n.trim()&&e.push(this._parseSegment(n.trim())),e}_parseSegment(t){const e={type:"tag"};let r=null,n=t;const i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(n=i[1]+i[3],i[2])){const t=i[2].slice(1,-1);t&&(r=t)}let a,s,o=n;if(n.includes("::")){const e=n.indexOf("::");if(a=n.substring(0,e).trim(),o=n.substring(e+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(o.includes(":")){const t=o.lastIndexOf(":"),e=o.substring(0,t).trim(),r=o.substring(t+1).trim();["first","last","odd","even"].includes(r)||/^nth\(\d+\)$/.test(r)?(s=e,h=r):s=o}else s=o;if(!s)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=s,a&&(e.namespace=a),r)if(r.includes("=")){const t=r.indexOf("=");e.attrName=r.substring(0,t).trim(),e.attrValue=r.substring(t+1).trim()}else e.attrName=r.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class C{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,r=t.segments[t.segments.length-1],n=r?.tag;if(n&&"*"!==n){const r=`${e}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),r=`${e}:${t.getCurrentTag()}`,n=this._byDepthAndTag.get(r);if(n)for(let e=0;e<n.length;e++)if(t.matches(n[e]))return n[e];const i=this._wildcardByDepth.get(e);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const A={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},I={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},P={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},M=new Set("!?\\\\/[]$%{}^&*()<>|+");function O(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(M.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function D(...t){const e=Object.create(null);for(const r of t)if(r)for(const t of Object.keys(r)){const n=r[t];if("string"==typeof n)e[t]=n;else if(n&&"object"==typeof n&&void 0!==n.val){const r=n.val;"string"==typeof r&&(e[t]=r)}}return e}const j="external",L="base",k="all",V=Object.freeze({allow:0,leave:1,remove:2,throw:3}),F=new Set([9,10,13]);class ${constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??j)&&e!==j?e===k?new Set([k]):e===L?new Set([L]):Array.isArray(e)?new Set(e):new Set([j]):new Set([j]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=D(I,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const r=function(t){if(!t)return{xmlVersion:1,onLevel:V.allow,nullLevel:V.remove};const e=1.1===t.xmlVersion?1.1:1,r=V[t.onNCR]??V.allow,n=V[t.nullNCR]??V.remove;return{xmlVersion:e,onLevel:r,nullLevel:Math.max(n,V.remove)}}(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))O(e);this._externalMap=D(t)}addExternalEntity(t,e){O(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=D(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;const e=t,r=[],n=t.length;let i=0,a=0;const s=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,h=s||o;for(;a<n;){if(38!==t.charCodeAt(a)){a++;continue}let e=a+1;for(;e<n&&59!==t.charCodeAt(e)&&e-a<=32;)e++;if(e>=n||59!==t.charCodeAt(e)){a++;continue}const l=t.slice(a+1,e);if(0===l.length){a++;continue}let u,d;if(this._removeSet.has(l))u="",void 0===d&&(d=j);else{if(this._leaveSet.has(l)){a++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){a++;continue}u=t,d=L}else{const t=this._resolveName(l);u=t?.value,d=t?.tier}}if(void 0!==u){if(a>i&&r.push(t.slice(i,a)),r.push(u),i=e+1,a=i,h&&this._tierCounts(d)){if(s&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else a++}i<n&&r.push(t.slice(i));const l=0===r.length?t:r.join("");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(k)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:j}:t in this._externalMap?{value:this._externalMap[t],tier:j}:t in this._baseMap?{value:this._baseMap[t],tier:L}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!F.has(t)?V.remove:-1}_applyNCRAction(t,e,r){switch(t){case V.allow:return String.fromCodePoint(r);case V.remove:return"";case V.leave:return;case V.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(t){const e=t.charCodeAt(1);let r;if(r=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const n=this._classifyNCR(r);if(!this._numericAllowed&&n<V.remove)return;const i=-1===n?this._ncrOnLevel:Math.max(this._ncrOnLevel,n);return this._applyNCRAction(i,t,r)}}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},R.apply(null,arguments)}function U(t,e){if(!t)return{};var r=e.attributesGroupName?t[e.attributesGroupName]:t;if(!r)return{};var n={};for(var i in r)i.startsWith(e.attributeNamePrefix)?n[i.substring(e.attributeNamePrefix.length)]=r[i]:n[i]=r[i];return n}function W(t){if(t&&"string"==typeof t){var e=t.indexOf(":");if(-1!==e&&e>0){var r=t.substring(0,e);if("xmlns"!==r)return r}}}var X=function(t,e){var r;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=q,this.parseTextData=Y,this.resolveNameSpace=B,this.buildAttributesMap=G,this.isItStopNode=Q,this.replaceEntitiesValue=J,this.readStopNodeData=rt,this.saveTextToParentTag=K,this.addChild=Z,this.ignoreAttributesFn="function"==typeof(r=this.options.ignoreAttributes)?r:Array.isArray(r)?function(t){for(var e,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(e=n()).done;){var i=e.value;if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0;var n=R({},I);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:("object"==typeof this.options.htmlEntities?n=this.options.htmlEntities:!0===this.options.htmlEntities&&(n=R({},P,A)),this.entityDecoder=new $({namedEntities:R({},n,e),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new S,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new C;var i=this.options.stopNodes;if(i&&i.length>0){for(var a=0;a<i.length;a++){var s=i[a];"string"==typeof s?this.stopNodeExpressionsSet.add(new T(s)):s instanceof T&&this.stopNodeExpressionsSet.add(s)}this.stopNodeExpressionsSet.seal()}};function Y(t,e,r,n,i,a,s){var o=this.options;if(void 0!==t&&(o.trimValues&&!n&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t,e,r));var h=o.jPath?r.toString():r,l=o.tagValueProcessor(e,t,h,i,a);return null==l?t:typeof l!=typeof t||l!==t?l:o.trimValues||t.trim()===t?nt(t,o.parseTagValue,o.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var z=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function G(t,e,r,n){void 0===n&&(n=!1);var a=this.options;if(!0===n||!0!==a.ignoreAttributes&&"string"==typeof t){for(var s=i(t,z),o=s.length,h={},l=new Array(o),u=!1,d={},p=0;p<o;p++){var c=this.resolveNameSpace(s[p][1]),f=s[p][4];if(c.length&&void 0!==f){var g=f;a.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g,r,this.readonlyMatcher),l[p]=g,d[c]=g,u=!0}}u&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(d);for(var m=a.jPath?e.toString():this.readonlyMatcher,v=!1,x=0;x<o;x++){var y=this.resolveNameSpace(s[x][1]);if(!this.ignoreAttributesFn(y,m)){var b=a.attributeNamePrefix+y;if(y.length)if(a.transformAttributeName&&(b=a.transformAttributeName(b)),b=at(b,a),void 0!==s[x][4]){var E=l[x],N=a.attributeValueProcessor(y,E,m);h[b]=null==N?E:typeof N!=typeof E||N!==E?N:nt(E,a.parseAttributeValue,a.numberParseOptions),v=!0}else a.allowBooleanAttributes&&(h[b]=!0,v=!0)}}if(!v)return;if(a.attributesGroupName&&!a.preserveOrder){var w={};return w[a.attributesGroupName]=h,w}return h}}var q=function(t){t=t.replace(/\r\n?/g,"\n");var e=new f("!xml"),r=e,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;for(var i=this.options,a=new g(i.processEntities),s=t.length,o=0;o<s;o++)if("<"===t[o]){var h=t.charCodeAt(o+1);if(47===h){var l=H(t,">",o,"Closing Tag is not closed."),u=t.substring(o+2,l).trim();if(i.removeNSPrefix){var d=u.indexOf(":");-1!==d&&(u=u.substr(d+1))}u=it(i.transformTagName,u,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));var p=this.matcher.getCurrentTag();if(u&&i.unpairedTagsSet.has(u))throw new Error("Unpaired tag can not be used as closing tag: </"+u+">");p&&i.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",o=l}else if(63===h){var c=et(t,o,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var m=this.buildAttributesMap(c.tagExp,this.matcher,c.tagName,!0);if(m){var v=m[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(v)||1)}if(i.ignoreDeclaration&&"?xml"===c.tagName||i.ignorePiTags);else{var x=new f(c.tagName);x.add(i.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&!0!==i.ignoreAttributes&&(x[":@"]=m),this.addChild(r,x,this.readonlyMatcher,o)}o=c.closeIndex+1}else if(33===h&&45===t.charCodeAt(o+2)&&45===t.charCodeAt(o+3)){var y=H(t,"--\x3e",o+4,"Comment is not closed.");if(i.commentPropName){var b,E=t.substring(o+4,y-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[(b={},b[i.textNodeName]=E,b)])}o=y}else if(33===h&&68===t.charCodeAt(o+2)){var N=a.readDocType(t,o);this.entityDecoder.addInputEntities(N.entities),o=N.i}else if(33===h&&91===t.charCodeAt(o+2)){var w=H(t,"]]>",o,"CDATA is not closed.")-2,_=t.substring(o+9,w);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var S,T=this.parseTextData(_,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==T&&(T=""),i.cdataPropName?r.add(i.cdataPropName,[(S={},S[i.textNodeName]=_,S)]):r.add(i.textNodeName,T),o=w+2}else{var C=et(t,o,i.removeNSPrefix);if(!C){var A=t.substring(Math.max(0,o-50),Math.min(s,o+50));throw new Error("readTagExp returned undefined at position "+o+'. Context: "'+A+'"')}var I=C.tagName,P=C.rawTagName,M=C.tagExp,O=C.attrExpPresent,D=C.closeIndex,j=it(i.transformTagName,I,M,i);if(I=j.tagName,M=j.tagExp,i.strictReservedNames&&(I===i.commentPropName||I===i.cdataPropName||I===i.textNodeName||I===i.attributesGroupName))throw new Error("Invalid tag name: "+I);r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));var L=r;L&&i.unpairedTagsSet.has(L.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var k=!1;M.length>0&&M.lastIndexOf("/")===M.length-1&&(k=!0,M="/"===I[I.length-1]?I=I.substr(0,I.length-1):M.substr(0,M.length-1),O=I!==M);var V,F=null;V=W(P),I!==e.tagname&&this.matcher.push(I,{},V),I!==M&&O&&(F=this.buildAttributesMap(M,this.matcher,I))&&U(F,i),I!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var $=o;if(this.isCurrentNodeStopNode){var R="";if(k)o=C.closeIndex;else if(i.unpairedTagsSet.has(I))o=C.closeIndex;else{var X=this.readStopNodeData(t,P,D+1);if(!X)throw new Error("Unexpected end of "+P);o=X.i,R=X.tagContent}var Y=new f(I);F&&(Y[":@"]=F),Y.add(i.textNodeName,R),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,Y,this.readonlyMatcher,$)}else{if(k){var B=it(i.transformTagName,I,M,i);I=B.tagName,M=B.tagExp;var z=new f(I);F&&(z[":@"]=F),this.addChild(r,z,this.readonlyMatcher,$),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(i.unpairedTagsSet.has(I)){var G=new f(I);F&&(G[":@"]=F),this.addChild(r,G,this.readonlyMatcher,$),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=C.closeIndex;continue}var q=new f(I);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),F&&(q[":@"]=F),this.addChild(r,q,this.readonlyMatcher,$),r=q}n="",o=D}}}else n+=t[o];return e.child};function Z(t,e,r,n){this.options.captureMetaData||(n=void 0);var i=this.options.jPath?r.toString():r,a=this.options.updateTag(e.tagname,i,e[":@"]);!1===a||("string"==typeof a?(e.tagname=a,t.addChild(e,n)):t.addChild(e,n))}function J(t,e,r){var n=this.options.processEntities;if(!n||!n.enabled)return t;if(n.allowedTags){var i=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(e):n.allowedTags(e,i)))return t}if(n.tagFilter){var a=this.options.jPath?r.toString():r;if(!n.tagFilter(e,a))return t}return this.entityDecoder.decode(t)}function K(t,e,r,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Q(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function H(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function tt(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i}function et(t,e,r,n){void 0===n&&(n=">");var i=function(t,e,r){void 0===r&&(r=">");for(var n=0,i=t.length,a=r.charCodeAt(0),s=r.length>1?r.charCodeAt(1):-1,o="",h=e,l=e;l<i;l++){var u=t.charCodeAt(l);if(n)u===n&&(n=0);else if(34===u||39===u)n=u;else if(u===a){if(-1===s)return{data:o+=t.substring(h,l),index:l};if(t.charCodeAt(l+1)===s)return{data:o+=t.substring(h,l),index:l}}else 9!==u||n||(o+=t.substring(h,l)+" ",h=l+1)}}(t,e+1,n);if(i){var a=i.data,s=i.index,o=a.search(/\s/),h=a,l=!0;-1!==o&&(h=a.substring(0,o),a=a.substring(o+1).trimStart());var u=h;if(r){var d=h.indexOf(":");-1!==d&&(l=(h=h.substr(d+1))!==i.data.substr(d+1))}return{tagName:h,tagExp:a,closeIndex:s,attrExpPresent:l,rawTagName:u}}}function rt(t,e,r){for(var n=r,i=1,a=t.length;r<a;r++)if("<"===t[r]){var s=t.charCodeAt(r+1);if(47===s){var o=tt(t,">",r,e+" is not closed");if(t.substring(r+2,o).trim()===e&&0===--i)return{tagContent:t.substring(n,r),i:o};r=o}else if(63===s)r=H(t,"?>",r+1,"StopNode is not closed.");else if(33===s&&45===t.charCodeAt(r+2)&&45===t.charCodeAt(r+3))r=H(t,"--\x3e",r+3,"StopNode is not closed.");else if(33===s&&91===t.charCodeAt(r+2))r=H(t,"]]>",r,"StopNode is not closed.")-2;else{var h=et(t,r,">");h&&((h&&h.tagName)===e&&"/"!==h.tagExp[h.tagExp.length-1]&&i++,r=h.closeIndex)}}}function nt(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&function(t,e={}){if(e=Object.assign({},E,e),!t||"string"!=typeof t)return t;let r=t.trim();if(0===r.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===r)return 0;if(e.hex&&y.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return function(t,e,r){if(!r.eNotation)return t;const n=e.match(N);if(n){let i=n[1]||"";const a=-1===n[3].indexOf("e")?"E":"e",s=n[2],o=i?t[s.length+1]===a:t[s.length]===a;return s.length>1&&o?t:(1!==s.length||!n[3].startsWith(`.${a}`)&&n[3][0]!==a)&&s.length>0?r.leadingZeros&&!o?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,r,e);{const i=b.exec(r);if(i){const a=i[1]||"",s=i[2];let o=(n=i[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const h=a?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!h))return t;{const n=Number(r),i=String(n);if(0===n)return n;if(-1!==i.search(/[eE]/))return e.eNotation?n:t;if(-1!==r.indexOf("."))return"0"===i||i===o||i===`${a}${o}`?n:t;let h=s?o:r;return s?h===i||a+h===i?n:t:h===i||h===a+i?n:t}}return t}}var n;return function(t,e,r){const n=e===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return n?"Infinity":"-Infinity";default:return t}}(t,Number(r),e)}(t,r)}return void 0!==t?t:""}function it(t,e,r,n){if(t){var i=t(e);r===e&&(r=i),e=i}return{tagName:e=at(e,n),tagExp:r}}function at(t,e){if(o.includes(t))throw new Error('[SECURITY] Invalid name: "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');return s.includes(t)?e.onDangerousProperty(t):t}var st=f.getMetaDataSymbol();function ot(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;var r={};for(var n in t)n.startsWith(e)?r[n.substring(e.length)]=t[n]:r[n]=t[n];return r}function ht(t,e,r,n){return lt(t,e,r,n)}function lt(t,e,r,n){for(var i,a={},s=0;s<t.length;s++){var o=t[s],h=ut(o);if(void 0!==h&&h!==e.textNodeName){var l=ot(o[":@"]||{},e.attributeNamePrefix);r.push(h,l)}if(h===e.textNodeName)void 0===i?i=o[h]:i+=""+o[h];else{if(void 0===h)continue;if(o[h]){var u=lt(o[h],e,r,n),d=pt(u,e);if(o[":@"]?dt(u,o[":@"],n,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==o[st]&&"object"==typeof u&&null!==u&&(u[st]=o[st]),void 0!==a[h]&&Object.prototype.hasOwnProperty.call(a,h))Array.isArray(a[h])||(a[h]=[a[h]]),a[h].push(u);else{var p=e.jPath?n.toString():n;e.isArray(h,p,d)?a[h]=[u]:a[h]=u}void 0!==h&&h!==e.textNodeName&&r.pop()}}}return"string"==typeof i?i.length>0&&(a[e.textNodeName]=i):void 0!==i&&(a[e.textNodeName]=i),a}function ut(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(":@"!==n)return n}}function dt(t,e,r,n){if(e)for(var i=Object.keys(e),a=i.length,s=0;s<a;s++){var o=i[s],h=o.startsWith(n.attributeNamePrefix)?o.substring(n.attributeNamePrefix.length):o,l=n.jPath?r.toString()+"."+h:r;n.isArray(o,l,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function pt(t,e){var r=e.textNodeName,n=Object.keys(t).length;return 0===n||!(1!==n||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var ct={allowBooleanAttributes:!1,unpairedTags:[]};function ft(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function gt(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return Et("InvalidXml","XML declaration allowed only at the start of the document.",_t(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function mt(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function vt(t,e){for(var r="",n="",i=!1;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var xt=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function yt(t,e){for(var r=i(t,xt),n={},a=0;a<r.length;a++){if(0===r[a][1].length)return Et("InvalidAttr","Attribute '"+r[a][2]+"' has no space in starting.",St(r[a]));if(void 0!==r[a][3]&&void 0===r[a][4])return Et("InvalidAttr","Attribute '"+r[a][2]+"' is without value.",St(r[a]));if(void 0===r[a][3]&&!e.allowBooleanAttributes)return Et("InvalidAttr","boolean attribute '"+r[a][2]+"' is not allowed.",St(r[a]));var s=r[a][2];if(!Nt(s))return Et("InvalidAttr","Attribute '"+s+"' is an invalid name.",St(r[a]));if(Object.prototype.hasOwnProperty.call(n,s))return Et("InvalidAttr","Attribute '"+s+"' is repeated.",St(r[a]));n[s]=1}return!0}function bt(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function Et(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function Nt(t){return a(t)}function wt(t){return a(t)}function _t(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function St(t){return t.startIndex+t[1].length}var Tt=function(){function t(t){this.externalEntities={},this.options=c(t)}var e=t.prototype;return e.parse=function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=function(t,e){e=Object.assign({},ct,e);var r=[],n=!1,i=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var a=0;a<t.length;a++)if("<"===t[a]&&"?"===t[a+1]){if((a=gt(t,a+=2)).err)return a}else{if("<"!==t[a]){if(ft(t[a]))continue;return Et("InvalidChar","char '"+t[a]+"' is not expected.",_t(t,a))}var s=a;if("!"===t[++a]){a=mt(t,a);continue}var o=!1;"/"===t[a]&&(o=!0,a++);for(var h="";a<t.length&&">"!==t[a]&&" "!==t[a]&&"\t"!==t[a]&&"\n"!==t[a]&&"\r"!==t[a];a++)h+=t[a];if("/"===(h=h.trim())[h.length-1]&&(h=h.substring(0,h.length-1),a--),!wt(h))return Et("InvalidTag",0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",_t(t,a));var l=vt(t,a);if(!1===l)return Et("InvalidAttr","Attributes for '"+h+"' have open quote.",_t(t,a));var u=l.value;if(a=l.index,"/"===u[u.length-1]){var d=a-u.length,p=yt(u=u.substring(0,u.length-1),e);if(!0!==p)return Et(p.err.code,p.err.msg,_t(t,d+p.err.line));n=!0}else if(o){if(!l.tagClosed)return Et("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",_t(t,a));if(u.trim().length>0)return Et("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",_t(t,s));if(0===r.length)return Et("InvalidTag","Closing tag '"+h+"' has not been opened.",_t(t,s));var c=r.pop();if(h!==c.tagName){var f=_t(t,c.tagStartPos);return Et("InvalidTag","Expected closing tag '"+c.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+h+"'.",_t(t,s))}0==r.length&&(i=!0)}else{var g=yt(u,e);if(!0!==g)return Et(g.err.code,g.err.msg,_t(t,a-u.length+g.err.line));if(!0===i)return Et("InvalidXml","Multiple possible root nodes found.",_t(t,a));-1!==e.unpairedTags.indexOf(h)||r.push({tagName:h,tagStartPos:s}),n=!0}for(a++;a<t.length;a++)if("<"===t[a]){if("!"===t[a+1]){a=mt(t,++a);continue}if("?"!==t[a+1])break;if((a=gt(t,++a)).err)return a}else if("&"===t[a]){var m=bt(t,a);if(-1==m)return Et("InvalidChar","char '&' is not expected.",_t(t,a));a=m}else if(!0===i&&!ft(t[a]))return Et("InvalidXml","Extra text at the end",_t(t,a));"<"===t[a]&&a--}return n?1==r.length?Et("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",_t(t,r[0].tagStartPos)):!(r.length>0)||Et("InvalidXml","Invalid '"+JSON.stringify(r.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Et("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var n=new X(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:ht(i,this.options,n.matcher,n.readonlyMatcher)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return f.getMetaDataSymbol()},t}();return e})());
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.XMLParser=e():t.XMLParser=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>Tt});var r=":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",n=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function i(t,e){for(var r=[],n=e.exec(t);n;){var i=[];i.startIndex=e.lastIndex-n[0].length;for(var a=n.length,s=0;s<a;s++)i.push(n[s]);r.push(i),n=e.exec(t)}return r}var a=function(t){return!(null==n.exec(t))},s=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],o=["__proto__","constructor","prototype"],h=function(t){return s.includes(t)?"__"+t:t},l={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:h};function u(t,e){if("string"==typeof t){var r=t.toLowerCase();if(s.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');if(o.some(function(t){return r===t.toLowerCase()}))throw new Error("[SECURITY] Invalid "+e+': "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution')}}function d(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,null!=(r=t.maxEntitySize)?r:1e4),maxExpansionDepth:Math.max(1,null!=(n=t.maxExpansionDepth)?n:1e4),maxTotalExpansions:Math.max(1,null!=(i=t.maxTotalExpansions)?i:1/0),maxExpandedLength:Math.max(1,null!=(a=t.maxExpandedLength)?a:1e5),maxEntityCount:Math.max(1,null!=(s=t.maxEntityCount)?s:1e3),allowedTags:null!=(o=t.allowedTags)?o:null,tagFilter:null!=(h=t.tagFilter)?h:null,appliesTo:null!=(l=t.appliesTo)?l:"all"}:d(!0);var r,n,i,a,s,o,h,l}var p,c=function(t){for(var e=Object.assign({},l,t),r=0,n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];r<n.length;r++){var i=n[r],a=i.value,s=i.name;a&&u(a,s)}return null===e.onDangerousProperty&&(e.onDangerousProperty=h),e.processEntities=d(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),e};p="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var f=function(){function t(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,n;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((n={})[t.tagname]=t.child,n)),void 0!==e&&(this.child[this.child.length-1][p]={startIndex:e})},t.getMetaDataSymbol=function(){return p},t}(),g=function(){function t(t){this.suppressValidationErr=!t,this.options=t}var e=t.prototype;return e.readDocType=function(t,e){var r=Object.create(null),n=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var i=1,a=!1,s=!1;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?a=!0:t[e];else{if(a&&v(t,"!ENTITY",e)){e+=7;var o,h=void 0,l=this.readEntityExp(t,e+1,this.suppressValidationErr);if(o=l[0],h=l[1],e=l[2],-1===h.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&n>=this.options.maxEntityCount)throw new Error("Entity count ("+(n+1)+") exceeds maximum allowed ("+this.options.maxEntityCount+")");r[o]=h,n++}}else if(a&&v(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(a&&v(t,"!ATTLIST",e))e+=8;else if(a&&v(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!v(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}},e.readEntityExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;var n=t.substring(r,e);if(x(n),e=m(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var i,a=this.readIdentifierVal(t,e,"entity");if(e=a[0],i=a[1],!1!==this.options.enabled&&null!=this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw new Error('Entity "'+n+'" size ('+i.length+") exceeds maximum allowed size ("+this.options.maxEntitySize+")");return[n,i,--e]},e.readNotationExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);!this.suppressValidationErr&&x(n),e=m(t,e);var i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error('Expected SYSTEM or PUBLIC, found "'+i+'"');e+=i.length,e=m(t,e);var a=null,s=null;if("PUBLIC"===i){var o=this.readIdentifierVal(t,e,"publicIdentifier");if(e=o[0],a=o[1],'"'===t[e=m(t,e)]||"'"===t[e]){var h=this.readIdentifierVal(t,e,"systemIdentifier");e=h[0],s=h[1]}}else if("SYSTEM"===i){var l=this.readIdentifierVal(t,e,"systemIdentifier");if(e=l[0],s=l[1],!this.suppressValidationErr&&!s)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:n,publicIdentifier:a,systemIdentifier:s,index:--e}},e.readIdentifierVal=function(t,e,r){var n,i=t[e];if('"'!==i&&"'"!==i)throw new Error('Expected quoted string, found "'+i+'"');for(var a=++e;e<t.length&&t[e]!==i;)e++;if(n=t.substring(a,e),t[e]!==i)throw new Error("Unterminated "+r+" value");return[++e,n]},e.readElementExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);if(!this.suppressValidationErr&&!a(n))throw new Error('Invalid element name: "'+n+'"');var i="";if("E"===t[e=m(t,e)]&&v(t,"MPTY",e))e+=4;else if("A"===t[e]&&v(t,"NY",e))e+=2;else if("("===t[e]){for(var s=++e;e<t.length&&")"!==t[e];)e++;if(i=t.substring(s,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'+t[e]+'"');return{elementName:n,contentModel:i.trim(),index:e}},e.readAttlistExp=function(t,e){for(var r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var n=t.substring(r,e);for(x(n),r=e=m(t,e);e<t.length&&!/\s/.test(t[e]);)e++;var i=t.substring(r,e);if(!x(i))throw new Error('Invalid attribute name: "'+i+'"');e=m(t,e);var a="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(a="NOTATION","("!==t[e=m(t,e+=8)])throw new Error("Expected '(', found \""+t[e]+'"');e++;for(var s=[];e<t.length&&")"!==t[e];){for(var o=e;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;var h=t.substring(o,e);if(!x(h=h.trim()))throw new Error('Invalid notation name: "'+h+'"');s.push(h),"|"===t[e]&&(e++,e=m(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,a+=" ("+s.join("|")+")"}else{for(var l=e;e<t.length&&!/\s/.test(t[e]);)e++;if(a+=t.substring(l,e),!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(a.toUpperCase()))throw new Error('Invalid attribute type: "'+a+'"')}e=m(t,e);var u="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())u="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())u="#IMPLIED",e+=7;else{var d=this.readIdentifierVal(t,e,"ATTLIST");e=d[0],u=d[1]}return{elementName:n,attributeName:i,attributeType:a,defaultValue:u,index:e}},t}(),m=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function v(t,e,r){for(var n=0;n<e.length;n++)if(e[n]!==t[r+n+1])return!1;return!0}function x(t){if(a(t))return t;throw new Error("Invalid entity name "+t)}const y=/^[-+]?0x[a-fA-F0-9]+$/,b=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,E={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};const N=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}class _{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const r=e[e.length-1];return void 0!==r.values&&t in r.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class S{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new _(this)}push(t,e=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const i=this.siblingStacks[n],a=r?`${r}:${t}`:t,s=i.get(a)||0;let o=0;for(const t of i.values())o+=t;i.set(a,s+1);const h={tag:t,position:o,counter:s};null!=r&&(h.namespace=r),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const r=t||this.separator;if(r===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,r=t.length-1;for(;r>=0&&e>=0;){const n=t[r];if("deep-wildcard"===n.type){if(r--,r<0)return!0;const n=t[r];let i=!1;for(let t=e;t>=0;t--)if(this._matchSegment(n,this.path[t],t===this.path.length-1)){e=t-1,r--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(n,this.path[e],e===this.path.length-1))return!1;e--,r--}}return r<0}_matchSegment(t,e,r){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!r)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!r)return!1;const n=e.counter??0;if("first"===t.position&&0!==n)return!1;if("odd"===t.position&&n%2!=1)return!1;if("even"===t.position&&n%2!=0)return!1;if("nth"===t.position&&n!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class T{constructor(t,e={},r){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let r=0,n="";for(;r<t.length;)t[r]===this.separator?r+1<t.length&&t[r+1]===this.separator?(n.trim()&&(e.push(this._parseSegment(n.trim())),n=""),e.push({type:"deep-wildcard"}),r+=2):(n.trim()&&e.push(this._parseSegment(n.trim())),n="",r++):(n+=t[r],r++);return n.trim()&&e.push(this._parseSegment(n.trim())),e}_parseSegment(t){const e={type:"tag"};let r=null,n=t;const i=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(n=i[1]+i[3],i[2])){const t=i[2].slice(1,-1);t&&(r=t)}let a,s,o=n;if(n.includes("::")){const e=n.indexOf("::");if(a=n.substring(0,e).trim(),o=n.substring(e+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(o.includes(":")){const t=o.lastIndexOf(":"),e=o.substring(0,t).trim(),r=o.substring(t+1).trim();["first","last","odd","even"].includes(r)||/^nth\(\d+\)$/.test(r)?(s=e,h=r):s=o}else s=o;if(!s)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=s,a&&(e.namespace=a),r)if(r.includes("=")){const t=r.indexOf("=");e.attrName=r.substring(0,t).trim(),e.attrValue=r.substring(t+1).trim()}else e.attrName=r.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class C{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,r=t.segments[t.segments.length-1],n=r?.tag;if(n&&"*"!==n){const r=`${e}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),r=`${e}:${t.getCurrentTag()}`,n=this._byDepthAndTag.get(r);if(n)for(let e=0;e<n.length;e++)if(t.matches(n[e]))return n[e];const i=this._wildcardByDepth.get(e);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const A={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},I={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},P={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},M=new Set("!?\\\\/[]$%{}^&*()<>|+");function O(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(M.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function D(...t){const e=Object.create(null);for(const r of t)if(r)for(const t of Object.keys(r)){const n=r[t];if("string"==typeof n)e[t]=n;else if(n&&"object"==typeof n&&void 0!==n.val){const r=n.val;"string"==typeof r&&(e[t]=r)}}return e}const j="external",k="base",L="all",V=Object.freeze({allow:0,leave:1,remove:2,throw:3}),F=new Set([9,10,13]);class ${constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??j)&&e!==j?e===L?new Set([L]):e===k?new Set([k]):Array.isArray(e)?new Set(e):new Set([j]):new Set([j]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=D(I,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const r=function(t){if(!t)return{xmlVersion:1,onLevel:V.allow,nullLevel:V.remove};const e=1.1===t.xmlVersion?1.1:1,r=V[t.onNCR]??V.allow,n=V[t.nullNCR]??V.remove;return{xmlVersion:e,onLevel:r,nullLevel:Math.max(n,V.remove)}}(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))O(e);this._externalMap=D(t)}addExternalEntity(t,e){O(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=D(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;const e=t,r=[],n=t.length;let i=0,a=0;const s=this._maxTotalExpansions>0,o=this._maxExpandedLength>0,h=s||o;for(;a<n;){if(38!==t.charCodeAt(a)){a++;continue}let e=a+1;for(;e<n&&59!==t.charCodeAt(e)&&e-a<=32;)e++;if(e>=n||59!==t.charCodeAt(e)){a++;continue}const l=t.slice(a+1,e);if(0===l.length){a++;continue}let u,d;if(this._removeSet.has(l))u="",void 0===d&&(d=j);else{if(this._leaveSet.has(l)){a++;continue}if(35===l.charCodeAt(0)){const t=this._resolveNCR(l);if(void 0===t){a++;continue}u=t,d=k}else{const t=this._resolveName(l);u=t?.value,d=t?.tier}}if(void 0!==u){if(a>i&&r.push(t.slice(i,a)),r.push(u),i=e+1,a=i,h&&this._tierCounts(d)){if(s&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(o){const t=u.length-(l.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else a++}i<n&&r.push(t.slice(i));const l=0===r.length?t:r.join("");return this._postCheck(l,e)}_tierCounts(t){return!!this._limitTiers.has(L)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:j}:t in this._externalMap?{value:this._externalMap[t],tier:j}:t in this._baseMap?{value:this._baseMap[t],tier:k}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!F.has(t)?V.remove:-1}_applyNCRAction(t,e,r){switch(t){case V.allow:return String.fromCodePoint(r);case V.remove:return"";case V.leave:return;case V.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(t){const e=t.charCodeAt(1);let r;if(r=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;const n=this._classifyNCR(r);if(!this._numericAllowed&&n<V.remove)return;const i=-1===n?this._ncrOnLevel:Math.max(this._ncrOnLevel,n);return this._applyNCRAction(i,t,r)}}function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},R.apply(null,arguments)}function U(t,e){if(!t)return{};var r=e.attributesGroupName?t[e.attributesGroupName]:t;if(!r)return{};var n={};for(var i in r)i.startsWith(e.attributeNamePrefix)?n[i.substring(e.attributeNamePrefix.length)]=r[i]:n[i]=r[i];return n}function W(t){if(t&&"string"==typeof t){var e=t.indexOf(":");if(-1!==e&&e>0){var r=t.substring(0,e);if("xmlns"!==r)return r}}}var X=function(t,e){var r;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=q,this.parseTextData=Y,this.resolveNameSpace=B,this.buildAttributesMap=G,this.isItStopNode=Q,this.replaceEntitiesValue=J,this.readStopNodeData=rt,this.saveTextToParentTag=K,this.addChild=Z,this.ignoreAttributesFn="function"==typeof(r=this.options.ignoreAttributes)?r:Array.isArray(r)?function(t){for(var e,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(e=n()).done;){var i=e.value;if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0;var n=R({},I);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:("object"==typeof this.options.htmlEntities?n=this.options.htmlEntities:!0===this.options.htmlEntities&&(n=R({},P,A)),this.entityDecoder=new $({namedEntities:R({},n,e),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new S,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new C;var i=this.options.stopNodes;if(i&&i.length>0){for(var a=0;a<i.length;a++){var s=i[a];"string"==typeof s?this.stopNodeExpressionsSet.add(new T(s)):s instanceof T&&this.stopNodeExpressionsSet.add(s)}this.stopNodeExpressionsSet.seal()}};function Y(t,e,r,n,i,a,s){var o=this.options;if(void 0!==t&&(o.trimValues&&!n&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t,e,r));var h=o.jPath?r.toString():r,l=o.tagValueProcessor(e,t,h,i,a);return null==l?t:typeof l!=typeof t||l!==t?l:o.trimValues||t.trim()===t?nt(t,o.parseTagValue,o.numberParseOptions):t}}function B(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var z=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function G(t,e,r,n){void 0===n&&(n=!1);var a=this.options;if(!0===n||!0!==a.ignoreAttributes&&"string"==typeof t){for(var s=i(t,z),o=s.length,h={},l=new Array(o),u=!1,d={},p=0;p<o;p++){var c=this.resolveNameSpace(s[p][1]),f=s[p][4];if(c.length&&void 0!==f){var g=f;a.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g,r,this.readonlyMatcher),l[p]=g,d[c]=g,u=!0}}u&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(d);for(var m=a.jPath?e.toString():this.readonlyMatcher,v=!1,x=0;x<o;x++){var y=this.resolveNameSpace(s[x][1]);if(!this.ignoreAttributesFn(y,m)){var b=a.attributeNamePrefix+y;if(y.length)if(a.transformAttributeName&&(b=a.transformAttributeName(b)),b=at(b,a),void 0!==s[x][4]){var E=l[x],N=a.attributeValueProcessor(y,E,m);h[b]=null==N?E:typeof N!=typeof E||N!==E?N:nt(E,a.parseAttributeValue,a.numberParseOptions),v=!0}else a.allowBooleanAttributes&&(h[b]=!0,v=!0)}}if(!v)return;if(a.attributesGroupName&&!a.preserveOrder){var w={};return w[a.attributesGroupName]=h,w}return h}}var q=function(t){t=t.replace(/\r\n?/g,"\n");var e=new f("!xml"),r=e,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;for(var i=this.options,a=new g(i.processEntities),s=t.length,o=0;o<s;o++)if("<"===t[o]){var h=t.charCodeAt(o+1);if(47===h){var l=H(t,">",o,"Closing Tag is not closed."),u=t.substring(o+2,l).trim();if(i.removeNSPrefix){var d=u.indexOf(":");-1!==d&&(u=u.substr(d+1))}u=it(i.transformTagName,u,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));var p=this.matcher.getCurrentTag();if(u&&i.unpairedTagsSet.has(u))throw new Error("Unpaired tag can not be used as closing tag: </"+u+">");p&&i.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",o=l}else if(63===h){var c=et(t,o,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var m=this.buildAttributesMap(c.tagExp,this.matcher,c.tagName,!0);if(m){var v=m[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(v)||1)}if(i.ignoreDeclaration&&"?xml"===c.tagName||i.ignorePiTags);else{var x=new f(c.tagName);x.add(i.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&!0!==i.ignoreAttributes&&(x[":@"]=m),this.addChild(r,x,this.readonlyMatcher,o)}o=c.closeIndex+1}else if(33===h&&45===t.charCodeAt(o+2)&&45===t.charCodeAt(o+3)){var y=H(t,"--\x3e",o+4,"Comment is not closed.");if(i.commentPropName){var b,E=t.substring(o+4,y-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[(b={},b[i.textNodeName]=E,b)])}o=y}else if(33===h&&68===t.charCodeAt(o+2)){var N=a.readDocType(t,o);this.entityDecoder.addInputEntities(N.entities),o=N.i}else if(33===h&&91===t.charCodeAt(o+2)){var w=H(t,"]]>",o,"CDATA is not closed.")-2,_=t.substring(o+9,w);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var S,T=this.parseTextData(_,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==T&&(T=""),i.cdataPropName?r.add(i.cdataPropName,[(S={},S[i.textNodeName]=_,S)]):r.add(i.textNodeName,T),o=w+2}else{var C=et(t,o,i.removeNSPrefix);if(!C){var A=t.substring(Math.max(0,o-50),Math.min(s,o+50));throw new Error("readTagExp returned undefined at position "+o+'. Context: "'+A+'"')}var I=C.tagName,P=C.rawTagName,M=C.tagExp,O=C.attrExpPresent,D=C.closeIndex,j=it(i.transformTagName,I,M,i);if(I=j.tagName,M=j.tagExp,i.strictReservedNames&&(I===i.commentPropName||I===i.cdataPropName||I===i.textNodeName||I===i.attributesGroupName))throw new Error("Invalid tag name: "+I);r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));var k=r;k&&i.unpairedTagsSet.has(k.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var L=!1;M.length>0&&M.lastIndexOf("/")===M.length-1&&(L=!0,M="/"===I[I.length-1]?I=I.substr(0,I.length-1):M.substr(0,M.length-1),O=I!==M);var V,F=null;V=W(P),I!==e.tagname&&this.matcher.push(I,{},V),I!==M&&O&&(F=this.buildAttributesMap(M,this.matcher,I))&&U(F,i),I!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var $=o;if(this.isCurrentNodeStopNode){var R="";if(L)o=C.closeIndex;else if(i.unpairedTagsSet.has(I))o=C.closeIndex;else{var X=this.readStopNodeData(t,P,D+1);if(!X)throw new Error("Unexpected end of "+P);o=X.i,R=X.tagContent}var Y=new f(I);F&&(Y[":@"]=F),Y.add(i.textNodeName,R),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,Y,this.readonlyMatcher,$)}else{if(L){var B=it(i.transformTagName,I,M,i);I=B.tagName,M=B.tagExp;var z=new f(I);F&&(z[":@"]=F),this.addChild(r,z,this.readonlyMatcher,$),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(i.unpairedTagsSet.has(I)){var G=new f(I);F&&(G[":@"]=F),this.addChild(r,G,this.readonlyMatcher,$),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=C.closeIndex;continue}var q=new f(I);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),F&&(q[":@"]=F),this.addChild(r,q,this.readonlyMatcher,$),r=q}n="",o=D}}}else n+=t[o];return e.child};function Z(t,e,r,n){this.options.captureMetaData||(n=void 0);var i=this.options.jPath?r.toString():r,a=this.options.updateTag(e.tagname,i,e[":@"]);!1===a||("string"==typeof a?(e.tagname=a,t.addChild(e,n)):t.addChild(e,n))}function J(t,e,r){var n=this.options.processEntities;if(!n||!n.enabled)return t;if(n.allowedTags){var i=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(e):n.allowedTags(e,i)))return t}if(n.tagFilter){var a=this.options.jPath?r.toString():r;if(!n.tagFilter(e,a))return t}return this.entityDecoder.decode(t)}function K(t,e,r,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Q(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function H(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function tt(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i}function et(t,e,r,n){void 0===n&&(n=">");var i=function(t,e,r){void 0===r&&(r=">");for(var n=0,i=t.length,a=r.charCodeAt(0),s=r.length>1?r.charCodeAt(1):-1,o="",h=e,l=e;l<i;l++){var u=t.charCodeAt(l);if(n)u===n&&(n=0);else if(34===u||39===u)n=u;else if(u===a){if(-1===s)return{data:o+=t.substring(h,l),index:l};if(t.charCodeAt(l+1)===s)return{data:o+=t.substring(h,l),index:l}}else 9!==u||n||(o+=t.substring(h,l)+" ",h=l+1)}}(t,e+1,n);if(i){var a=i.data,s=i.index,o=a.search(/\s/),h=a,l=!0;-1!==o&&(h=a.substring(0,o),a=a.substring(o+1).trimStart());var u=h;if(r){var d=h.indexOf(":");-1!==d&&(l=(h=h.substr(d+1))!==i.data.substr(d+1))}return{tagName:h,tagExp:a,closeIndex:s,attrExpPresent:l,rawTagName:u}}}function rt(t,e,r){for(var n=r,i=1,a=t.length;r<a;r++)if("<"===t[r]){var s=t.charCodeAt(r+1);if(47===s){var o=tt(t,">",r,e+" is not closed");if(t.substring(r+2,o).trim()===e&&0===--i)return{tagContent:t.substring(n,r),i:o};r=o}else if(63===s)r=H(t,"?>",r+1,"StopNode is not closed.");else if(33===s&&45===t.charCodeAt(r+2)&&45===t.charCodeAt(r+3))r=H(t,"--\x3e",r+3,"StopNode is not closed.");else if(33===s&&91===t.charCodeAt(r+2))r=H(t,"]]>",r,"StopNode is not closed.")-2;else{var h=et(t,r,!1);h&&((h&&h.tagName)===e&&"/"!==h.tagExp[h.tagExp.length-1]&&i++,r=h.closeIndex)}}}function nt(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&function(t,e={}){if(e=Object.assign({},E,e),!t||"string"!=typeof t)return t;let r=t.trim();if(0===r.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===r)return 0;if(e.hex&&y.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return function(t,e,r){if(!r.eNotation)return t;const n=e.match(N);if(n){let i=n[1]||"";const a=-1===n[3].indexOf("e")?"E":"e",s=n[2],o=i?t[s.length+1]===a:t[s.length]===a;return s.length>1&&o?t:(1!==s.length||!n[3].startsWith(`.${a}`)&&n[3][0]!==a)&&s.length>0?r.leadingZeros&&!o?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,r,e);{const i=b.exec(r);if(i){const a=i[1]||"",s=i[2];let o=(n=i[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const h=a?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!h))return t;{const n=Number(r),i=String(n);if(0===n)return n;if(-1!==i.search(/[eE]/))return e.eNotation?n:t;if(-1!==r.indexOf("."))return"0"===i||i===o||i===`${a}${o}`?n:t;let h=s?o:r;return s?h===i||a+h===i?n:t:h===i||h===a+i?n:t}}return t}}var n;return function(t,e,r){const n=e===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return n?"Infinity":"-Infinity";default:return t}}(t,Number(r),e)}(t,r)}return void 0!==t?t:""}function it(t,e,r,n){if(t){var i=t(e);r===e&&(r=i),e=i}return{tagName:e=at(e,n),tagExp:r}}function at(t,e){if(o.includes(t))throw new Error('[SECURITY] Invalid name: "'+t+'" is a reserved JavaScript keyword that could cause prototype pollution');return s.includes(t)?e.onDangerousProperty(t):t}var st=f.getMetaDataSymbol();function ot(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;var r={};for(var n in t)n.startsWith(e)?r[n.substring(e.length)]=t[n]:r[n]=t[n];return r}function ht(t,e,r,n){return lt(t,e,r,n)}function lt(t,e,r,n){for(var i,a={},s=0;s<t.length;s++){var o=t[s],h=ut(o);if(void 0!==h&&h!==e.textNodeName){var l=ot(o[":@"]||{},e.attributeNamePrefix);r.push(h,l)}if(h===e.textNodeName)void 0===i?i=o[h]:i+=""+o[h];else{if(void 0===h)continue;if(o[h]){var u=lt(o[h],e,r,n),d=pt(u,e);if(0===Object.keys(u).length&&e.alwaysCreateTextNode&&(u[e.textNodeName]=""),o[":@"]?dt(u,o[":@"],n,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==o[st]&&"object"==typeof u&&null!==u&&(u[st]=o[st]),void 0!==a[h]&&Object.prototype.hasOwnProperty.call(a,h))Array.isArray(a[h])||(a[h]=[a[h]]),a[h].push(u);else{var p=e.jPath?n.toString():n;e.isArray(h,p,d)?a[h]=[u]:a[h]=u}void 0!==h&&h!==e.textNodeName&&r.pop()}}}return"string"==typeof i?i.length>0&&(a[e.textNodeName]=i):void 0!==i&&(a[e.textNodeName]=i),a}function ut(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(":@"!==n)return n}}function dt(t,e,r,n){if(e)for(var i=Object.keys(e),a=i.length,s=0;s<a;s++){var o=i[s],h=o.startsWith(n.attributeNamePrefix)?o.substring(n.attributeNamePrefix.length):o,l=n.jPath?r.toString()+"."+h:r;n.isArray(o,l,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function pt(t,e){var r=e.textNodeName,n=Object.keys(t).length;return 0===n||!(1!==n||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var ct={allowBooleanAttributes:!1,unpairedTags:[]};function ft(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function gt(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return Et("InvalidXml","XML declaration allowed only at the start of the document.",_t(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function mt(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function vt(t,e){for(var r="",n="",i=!1;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var xt=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function yt(t,e){for(var r=i(t,xt),n={},a=0;a<r.length;a++){if(0===r[a][1].length)return Et("InvalidAttr","Attribute '"+r[a][2]+"' has no space in starting.",St(r[a]));if(void 0!==r[a][3]&&void 0===r[a][4])return Et("InvalidAttr","Attribute '"+r[a][2]+"' is without value.",St(r[a]));if(void 0===r[a][3]&&!e.allowBooleanAttributes)return Et("InvalidAttr","boolean attribute '"+r[a][2]+"' is not allowed.",St(r[a]));var s=r[a][2];if(!Nt(s))return Et("InvalidAttr","Attribute '"+s+"' is an invalid name.",St(r[a]));if(Object.prototype.hasOwnProperty.call(n,s))return Et("InvalidAttr","Attribute '"+s+"' is repeated.",St(r[a]));n[s]=1}return!0}function bt(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function Et(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function Nt(t){return a(t)}function wt(t){return a(t)}function _t(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function St(t){return t.startIndex+t[1].length}var Tt=function(){function t(t){this.externalEntities={},this.options=c(t)}var e=t.prototype;return e.parse=function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=function(t,e){e=Object.assign({},ct,e);var r=[],n=!1,i=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var a=0;a<t.length;a++)if("<"===t[a]&&"?"===t[a+1]){if((a=gt(t,a+=2)).err)return a}else{if("<"!==t[a]){if(ft(t[a]))continue;return Et("InvalidChar","char '"+t[a]+"' is not expected.",_t(t,a))}var s=a;if("!"===t[++a]){a=mt(t,a);continue}var o=!1;"/"===t[a]&&(o=!0,a++);for(var h="";a<t.length&&">"!==t[a]&&" "!==t[a]&&"\t"!==t[a]&&"\n"!==t[a]&&"\r"!==t[a];a++)h+=t[a];if("/"===(h=h.trim())[h.length-1]&&(h=h.substring(0,h.length-1),a--),!wt(h))return Et("InvalidTag",0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",_t(t,a));var l=vt(t,a);if(!1===l)return Et("InvalidAttr","Attributes for '"+h+"' have open quote.",_t(t,a));var u=l.value;if(a=l.index,"/"===u[u.length-1]){var d=a-u.length,p=yt(u=u.substring(0,u.length-1),e);if(!0!==p)return Et(p.err.code,p.err.msg,_t(t,d+p.err.line));n=!0}else if(o){if(!l.tagClosed)return Et("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",_t(t,a));if(u.trim().length>0)return Et("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",_t(t,s));if(0===r.length)return Et("InvalidTag","Closing tag '"+h+"' has not been opened.",_t(t,s));var c=r.pop();if(h!==c.tagName){var f=_t(t,c.tagStartPos);return Et("InvalidTag","Expected closing tag '"+c.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+h+"'.",_t(t,s))}0==r.length&&(i=!0)}else{var g=yt(u,e);if(!0!==g)return Et(g.err.code,g.err.msg,_t(t,a-u.length+g.err.line));if(!0===i)return Et("InvalidXml","Multiple possible root nodes found.",_t(t,a));-1!==e.unpairedTags.indexOf(h)||r.push({tagName:h,tagStartPos:s}),n=!0}for(a++;a<t.length;a++)if("<"===t[a]){if("!"===t[a+1]){a=mt(t,++a);continue}if("?"!==t[a+1])break;if((a=gt(t,++a)).err)return a}else if("&"===t[a]){var m=bt(t,a);if(-1==m)return Et("InvalidChar","char '&' is not expected.",_t(t,a));a=m}else if(!0===i&&!ft(t[a]))return Et("InvalidXml","Extra text at the end",_t(t,a));"<"===t[a]&&a--}return n?1==r.length?Et("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",_t(t,r[0].tagStartPos)):!(r.length>0)||Et("InvalidXml","Invalid '"+JSON.stringify(r.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Et("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var n=new X(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:ht(i,this.options,n.matcher,n.readonlyMatcher)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return f.getMetaDataSymbol()},t}();return e})());
2
2
  //# sourceMappingURL=fxparser.min.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-xml-parser",
3
- "version": "5.7.2",
3
+ "version": "5.7.3",
4
4
  "description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
5
5
  "main": "./lib/fxp.cjs",
6
6
  "type": "module",
@@ -23,7 +23,6 @@
23
23
  "test": "c8 --reporter=lcov --reporter=text jasmine spec/*spec.js",
24
24
  "test-types": "tsc --noEmit spec/typings/typings-test.ts",
25
25
  "unit": "jasmine",
26
- "coverage": "nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary",
27
26
  "perf": "node ./benchmark/perfTest3.js",
28
27
  "lint": "eslint src/**/*.js spec/**/*.js benchmark/**/*.js",
29
28
  "bundle": "webpack --config webpack.cjs.config.js",
@@ -72,7 +71,6 @@
72
71
  "babel-loader": "^8.2.2",
73
72
  "c8": "^10.1.3",
74
73
  "eslint": "^8.3.0",
75
- "he": "^1.2.0",
76
74
  "jasmine": "^5.6.0",
77
75
  "prettier": "^3.5.1",
78
76
  "publish-please": "^5.5.2",
@@ -88,7 +86,7 @@
88
86
  ],
89
87
  "dependencies": {
90
88
  "@nodable/entities": "^2.1.0",
91
- "fast-xml-builder": "^1.1.5",
89
+ "fast-xml-builder": "^1.1.7",
92
90
  "path-expression-matcher": "^1.5.0",
93
91
  "strnum": "^2.2.3"
94
92
  }
@@ -776,7 +776,7 @@ function readStopNodeData(xmlData, tagName, i) {
776
776
  const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
777
777
  i = closeIndex;
778
778
  } else {
779
- const tagData = readTagExp(xmlData, i, '>')
779
+ const tagData = readTagExp(xmlData, i, false)
780
780
 
781
781
  if (tagData) {
782
782
  const openTagName = tagData && tagData.tagName;
@@ -71,6 +71,10 @@ function compress(arr, options, matcher, readonlyMatcher) {
71
71
  let val = compress(tagObj[property], options, matcher, readonlyMatcher);
72
72
  const isLeaf = isLeafTag(val, options);
73
73
 
74
+ if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) {
75
+ val[options.textNodeName] = "";
76
+ }
77
+
74
78
  if (tagObj[":@"]) {
75
79
  assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
76
80
  } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode) {
@@ -21,6 +21,7 @@ exports.DEFAULT_UPDATE_TYPES = [
21
21
  "business_message",
22
22
  "edited_business_message",
23
23
  "deleted_business_messages",
24
+ "guest_message",
24
25
  "inline_query",
25
26
  "chosen_inline_result",
26
27
  "callback_query",