@mongosh/node-runtime-worker-thread 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/AUTHORS +1 -0
  2. package/dist/153.js +1 -0
  3. package/dist/41.js +1 -0
  4. package/dist/502.js +1 -0
  5. package/dist/{578.js → 503.js} +1 -1
  6. package/dist/{43.js → 527.js} +1 -1
  7. package/dist/534.js +1 -0
  8. package/dist/711.js +1 -0
  9. package/dist/739.js +1 -0
  10. package/dist/index.d.ts +6 -8
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/report.html +2 -2
  14. package/dist/rpc.d.ts +6 -15
  15. package/dist/rpc.js +7 -71
  16. package/dist/rpc.js.map +1 -1
  17. package/dist/worker-process-mongosh-bus.d.ts +7 -0
  18. package/dist/{child-process-mongosh-bus.js → worker-process-mongosh-bus.js} +8 -8
  19. package/dist/worker-process-mongosh-bus.js.map +1 -0
  20. package/dist/worker-runtime.js +16 -16
  21. package/dist/worker-runtime.js.map +1 -1
  22. package/dist/{child-process-evaluation-listener.d.ts → worker-thread-evaluation-listener.d.ts} +2 -4
  23. package/dist/{child-process-evaluation-listener.js → worker-thread-evaluation-listener.js} +6 -6
  24. package/dist/worker-thread-evaluation-listener.js.map +1 -0
  25. package/package.json +13 -12
  26. package/src/index.spec.ts +148 -147
  27. package/src/index.ts +98 -120
  28. package/src/lock.spec.ts +1 -1
  29. package/src/rpc.spec.ts +24 -90
  30. package/src/rpc.ts +17 -98
  31. package/src/{child-process-mongosh-bus.ts → worker-process-mongosh-bus.ts} +5 -6
  32. package/src/worker-runtime.spec.ts +19 -29
  33. package/src/worker-runtime.ts +15 -22
  34. package/src/{child-process-evaluation-listener.ts → worker-thread-evaluation-listener.ts} +3 -4
  35. package/tests/register-worker.js +1 -0
  36. package/tsconfig.json +2 -1
  37. package/webpack.config.js +4 -6
  38. package/__fixtures__/script-that-throws.js +0 -1
  39. package/dist/354.js +0 -1
  40. package/dist/528.js +0 -1
  41. package/dist/650.js +0 -1
  42. package/dist/722.js +0 -1
  43. package/dist/777.js +0 -1
  44. package/dist/942.js +0 -1
  45. package/dist/child-process-evaluation-listener.js.map +0 -1
  46. package/dist/child-process-mongosh-bus.d.ts +0 -9
  47. package/dist/child-process-mongosh-bus.js.map +0 -1
  48. package/dist/child-process-proxy.d.ts +0 -1
  49. package/dist/child-process-proxy.js +0 -1
  50. package/dist/child-process-proxy.js.map +0 -1
  51. package/dist/spawn-child-from-source.d.ts +0 -5
  52. package/dist/spawn-child-from-source.js +0 -74
  53. package/dist/spawn-child-from-source.js.map +0 -1
  54. package/src/child-process-proxy.spec.ts +0 -84
  55. package/src/child-process-proxy.ts +0 -124
  56. package/src/spawn-child-from-source.spec.ts +0 -90
  57. package/src/spawn-child-from-source.ts +0 -102
  58. package/tsconfig.test.json +0 -11
@@ -1,25 +1,24 @@
1
- import type { ChildProcess } from 'child_process';
2
1
  import type { MongoshBus } from '@mongosh/types';
3
2
  import type { Exposed } from './rpc';
4
3
  import { exposeAll, close } from './rpc';
5
4
 
6
- export class ChildProcessMongoshBus {
5
+ export class WorkerProcessMongoshBus {
7
6
  exposedEmitter: Exposed<MongoshBus>;
8
7
 
9
- constructor(eventEmitter: MongoshBus, childProcess: ChildProcess) {
8
+ constructor(eventEmitter: MongoshBus, worker: Worker) {
10
9
  const exposedEmitter: Exposed<MongoshBus> = exposeAll(
11
10
  {
12
11
  emit(...args) {
13
12
  eventEmitter.emit(...args);
14
13
  },
15
14
  on() {
16
- throw new Error("Can't use `on` method on ChildProcessMongoshBus");
15
+ throw new Error("Can't use `on` method on WorkerProcessMongoshBus");
17
16
  },
18
17
  once() {
19
- throw new Error("Can't use `once` method on ChildProcessMongoshBus");
18
+ throw new Error("Can't use `once` method on WorkerProcessMongoshBus");
20
19
  },
21
20
  },
22
- childProcess
21
+ worker
23
22
  );
24
23
  this.exposedEmitter = exposedEmitter;
25
24
  }
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
  import { once } from 'events';
3
- import { Worker } from 'worker_threads';
3
+ import Worker from 'web-worker';
4
4
  import chai, { expect } from 'chai';
5
5
  import sinonChai from 'sinon-chai';
6
6
  import sinon from 'sinon';
@@ -13,6 +13,7 @@ import type { WorkerRuntime } from './worker-runtime';
13
13
  import type { RuntimeEvaluationResult } from '@mongosh/browser-runtime-core';
14
14
  import { interrupt } from 'interruptor';
15
15
  import { dummyOptions } from './index.spec';
16
+ import { pathToFileURL } from 'url';
16
17
 
17
18
  chai.use(sinonChai);
18
19
 
@@ -28,12 +29,12 @@ function sleep(ms: number) {
28
29
  return new Promise((resolve) => setTimeout(resolve, ms));
29
30
  }
30
31
 
31
- describe('worker', function () {
32
- let worker: Worker;
32
+ describe('worker-runtime', function () {
33
+ let worker: any;
33
34
  let caller: Caller<WorkerRuntime>;
34
35
 
35
36
  beforeEach(async function () {
36
- worker = new Worker(workerThreadModule);
37
+ worker = new Worker(pathToFileURL(workerThreadModule).href);
37
38
  await once(worker, 'message');
38
39
 
39
40
  caller = createCaller(
@@ -55,32 +56,21 @@ describe('worker', function () {
55
56
  };
56
57
  });
57
58
 
58
- afterEach(async function () {
59
+ afterEach(function () {
59
60
  if (worker) {
60
- // There is a Node.js bug that causes worker process to still be ref-ed
61
- // after termination. To work around that, we are unrefing worker manually
62
- // *immediately* after terminate method is called even though it should
63
- // not be necessary. If this is not done in rare cases our test suite can
64
- // get stuck. Even though the issue is fixed we would still need to keep
65
- // this workaround for compat reasons.
66
- //
67
- // See: https://github.com/nodejs/node/pull/37319
68
- const terminationPromise = worker.terminate();
69
- worker.unref();
70
- await terminationPromise;
71
- worker = null;
61
+ worker.terminate();
72
62
  }
73
63
 
74
64
  if (caller) {
75
65
  caller[cancel]();
76
- caller = null;
66
+ caller = null as any;
77
67
  }
78
68
  });
79
69
 
80
70
  it('should throw if worker is not initialized yet', async function () {
81
71
  const { evaluate } = caller;
82
72
 
83
- let err: Error;
73
+ let err!: Error;
84
74
 
85
75
  try {
86
76
  await evaluate('1 + 1');
@@ -171,18 +161,18 @@ describe('worker', function () {
171
161
  describe('shell-api results', function () {
172
162
  const testServer = startSharedTestServer();
173
163
  const db = `test-db-${Date.now().toString(16)}`;
174
- let exposed: Exposed<unknown>;
164
+ let exposed: Exposed<unknown>; // adding `| null` breaks TS type inference
175
165
 
176
166
  afterEach(function () {
177
167
  if (exposed) {
178
168
  exposed[close]();
179
- exposed = null;
169
+ exposed = null as any;
180
170
  }
181
171
  });
182
172
 
183
173
  type CommandTestRecord =
184
174
  | [string | string[], string]
185
- | [string | string[], string, any];
175
+ | [string | string[], string | null, any];
186
176
 
187
177
  const showCommand: CommandTestRecord[] = [
188
178
  [
@@ -337,7 +327,7 @@ describe('worker', function () {
337
327
  let prepare: undefined | string[];
338
328
 
339
329
  if (Array.isArray(commands)) {
340
- command = commands.pop();
330
+ command = commands.pop()!;
341
331
  prepare = commands;
342
332
  } else {
343
333
  command = commands;
@@ -386,7 +376,7 @@ describe('worker', function () {
386
376
 
387
377
  await init('mongodb://nodb/', dummyOptions, { nodb: true });
388
378
 
389
- let err: Error;
379
+ let err!: Error;
390
380
  try {
391
381
  await evaluate('throw new TypeError("Oh no, types!")');
392
382
  } catch (e: any) {
@@ -406,7 +396,7 @@ describe('worker', function () {
406
396
 
407
397
  await init('mongodb://nodb/', dummyOptions, { nodb: true });
408
398
 
409
- let err: Error;
399
+ let err!: Error;
410
400
  try {
411
401
  await evaluate(
412
402
  'throw Object.assign(new TypeError("Oh no, types!"), { errInfo: { message: "wrong type :S" } })'
@@ -440,7 +430,7 @@ describe('worker', function () {
440
430
  const { init, evaluate } = caller;
441
431
  await init('mongodb://nodb/', dummyOptions, { nodb: true });
442
432
 
443
- let err: Error;
433
+ let err!: Error;
444
434
 
445
435
  try {
446
436
  await Promise.all([
@@ -522,7 +512,7 @@ describe('worker', function () {
522
512
  return evalListener;
523
513
  };
524
514
 
525
- let exposed: Exposed<unknown>;
515
+ let exposed: Exposed<unknown> | null;
526
516
 
527
517
  afterEach(function () {
528
518
  if (exposed) {
@@ -675,7 +665,7 @@ describe('worker', function () {
675
665
 
676
666
  await init('mongodb://nodb/', dummyOptions, { nodb: true });
677
667
 
678
- let err: Error;
668
+ let err!: Error;
679
669
 
680
670
  try {
681
671
  await Promise.all([
@@ -705,7 +695,7 @@ describe('worker', function () {
705
695
 
706
696
  await init('mongodb://nodb/', dummyOptions, { nodb: true });
707
697
 
708
- let err: Error;
698
+ let err!: Error;
709
699
 
710
700
  try {
711
701
  await Promise.all([
@@ -1,7 +1,6 @@
1
1
  /* istanbul ignore file */
2
- /* ^^^ we test the dist directly, so isntanbul can't calculate the coverage correctly */
2
+ /* ^^^ we test the dist directly, so istanbul can't calculate the coverage correctly */
3
3
 
4
- import { parentPort, isMainThread } from 'worker_threads';
5
4
  import type {
6
5
  Completion,
7
6
  Runtime,
@@ -22,14 +21,16 @@ import { Lock } from './lock';
22
21
  import type { InterruptHandle } from 'interruptor';
23
22
  import { runInterruptible } from 'interruptor';
24
23
 
24
+ const mainMessageBus = {
25
+ addEventListener: self.addEventListener.bind(self),
26
+ removeEventListener: self.removeEventListener.bind(self),
27
+ postMessage: self.postMessage.bind(self),
28
+ };
29
+
25
30
  type DevtoolsConnectOptions = Parameters<
26
31
  (typeof CompassServiceProvider)['connect']
27
32
  >[1];
28
33
 
29
- if (!parentPort || isMainThread) {
30
- throw new Error('Worker runtime can be used only in a worker thread');
31
- }
32
-
33
34
  let runtime: Runtime | null = null;
34
35
  let provider: ServiceProvider | null = null;
35
36
 
@@ -62,7 +63,7 @@ const evaluationListener = createCaller<WorkerRuntimeEvaluationListener>(
62
63
  'onExit',
63
64
  'onRunInterruptible',
64
65
  ],
65
- parentPort,
66
+ mainMessageBus,
66
67
  {
67
68
  onPrint: function (
68
69
  results: RuntimeEvaluationResult[]
@@ -76,8 +77,8 @@ const evaluationListener = createCaller<WorkerRuntimeEvaluationListener>(
76
77
  }
77
78
  );
78
79
 
79
- const messageBus: MongoshBus = Object.assign(
80
- createCaller(['emit'], parentPort),
80
+ const mongoshBus: MongoshBus = Object.assign(
81
+ createCaller(['emit'], mainMessageBus),
81
82
  {
82
83
  on() {
83
84
  throw new Error("Can't call `on` method on worker runtime MongoshBus");
@@ -112,13 +113,13 @@ const workerRuntime: WorkerRuntime = {
112
113
  // TS2589: Type instantiation is excessively deep and possibly infinite.
113
114
  // I could not figure out why exactly that was the case, so 'as any'
114
115
  // will have to do for now.
115
- provider = await (CompassServiceProvider as any).connect(
116
+ provider = await CompassServiceProvider.connect(
116
117
  uri,
117
118
  deserializeConnectOptions(driverOptions),
118
119
  cliOptions,
119
- messageBus
120
+ mongoshBus
120
121
  );
121
- runtime = new ElectronRuntime(provider as ServiceProvider, messageBus);
122
+ runtime = new ElectronRuntime(provider, mongoshBus);
122
123
  runtime.setEvaluationListener(evaluationListener);
123
124
  },
124
125
 
@@ -197,16 +198,8 @@ const workerRuntime: WorkerRuntime = {
197
198
  },
198
199
  };
199
200
 
200
- // We expect the amount of listeners to be more than the default value of 10 but
201
- // probably not more than ~25 (all exposed methods on
202
- // ChildProcessEvaluationListener and ChildProcessMongoshBus + any concurrent
203
- // in-flight calls on ChildProcessRuntime) at once
204
- parentPort.setMaxListeners(25);
205
-
206
- exposeAll(workerRuntime, parentPort);
201
+ exposeAll(workerRuntime, mainMessageBus);
207
202
 
208
203
  process.nextTick(() => {
209
- if (parentPort) {
210
- parentPort.postMessage('ready');
211
- }
204
+ mainMessageBus.postMessage('ready');
212
205
  });
@@ -1,18 +1,17 @@
1
- import type { ChildProcess } from 'child_process';
2
1
  import type { Exposed } from './rpc';
3
2
  import { exposeAll, close } from './rpc';
4
3
  import type { WorkerRuntime } from './index';
5
4
  import { deserializeEvaluationResult } from './serializer';
6
5
  import type { RuntimeEvaluationListener } from '@mongosh/browser-runtime-core';
7
6
 
8
- export class ChildProcessEvaluationListener {
7
+ export class WorkerThreadEvaluationListener {
9
8
  exposedListener: Exposed<
10
9
  Required<
11
10
  Omit<RuntimeEvaluationListener, 'onLoad' | 'getCryptLibraryOptions'>
12
11
  >
13
12
  >;
14
13
 
15
- constructor(workerRuntime: WorkerRuntime, childProcess: ChildProcess) {
14
+ constructor(workerRuntime: WorkerRuntime, worker: Worker) {
16
15
  this.exposedListener = exposeAll(
17
16
  {
18
17
  onPrompt(question, type) {
@@ -58,7 +57,7 @@ export class ChildProcessEvaluationListener {
58
57
  );
59
58
  },
60
59
  },
61
- childProcess
60
+ worker
62
61
  );
63
62
  }
64
63
 
@@ -0,0 +1 @@
1
+ global.Worker = require('web-worker');
package/tsconfig.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "extends": "@mongodb-js/tsconfig-mongosh/tsconfig.common.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
- "allowJs": true
5
+ "allowJs": true,
6
+ "lib": ["WebWorker"]
6
7
  },
7
8
  "files": ["./src/index.d.ts"],
8
9
  "include": ["src/**/*"],
package/webpack.config.js CHANGED
@@ -22,9 +22,7 @@ const config = {
22
22
  },
23
23
  };
24
24
 
25
- module.exports = ['index', 'child-process-proxy', 'worker-runtime'].map(
26
- (entry) => ({
27
- entry: { [entry]: path.resolve(__dirname, 'src', `${entry}.ts`) },
28
- ...merge(baseWebpackConfig, config),
29
- })
30
- );
25
+ module.exports = ['index', 'worker-runtime'].map((entry) => ({
26
+ entry: { [entry]: path.resolve(__dirname, 'src', `${entry}.ts`) },
27
+ ...merge(baseWebpackConfig, config),
28
+ }));
@@ -1 +0,0 @@
1
- throw new Error("Nope, I'm not starting");
package/dist/354.js DELETED
@@ -1 +0,0 @@
1
- exports.id=354,exports.ids=[354],exports.modules={58292:(t,e,n)=>{"use strict";n.d(e,{X:()=>STSClient});var i=n(37493),s=n(70183),o=n(23703),r=n(88610),a=n(22144),l=n(71818),c=n(89362),u=n(75795),d=n(48643),p=n(51630),h=n(35413),g=n(95773);const f=async(t,e,n)=>({operation:(0,g.J)(e).operation,region:await(0,g.$)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const m=t=>{const e=[];switch(t.operation){case"AssumeRoleWithSAML":case"AssumeRoleWithWebIdentity":e.push({schemeId:"smithy.api#noAuth"});break;default:e.push(function(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}(t))}return e},x=t=>{const e=(n=t,{...n,stsClientCtor:STSClient});var n;return{...(0,h.K)(e)}};var b=n(69337);const E="3.621.0";var y=n(74658),v=n(234),P=n(66495),N=n(95640),w=n(87954),A=n(88320),T=n(11728),I=n(91743),S=n(88383),O=n(53918),C=n(76954),k=n(7242),D=n(99558),$=n(92718);const j="required",R="type",V="fn",F="argv",M="ref",L=!0,_="booleanEquals",z="stringEquals",Y="sigv4",B="us-east-1",G="endpoint",W="https://sts.{Region}.{PartitionResult#dnsSuffix}",U="tree",X="error",q="getAttr",H={[j]:!1,[R]:"String"},K={[j]:!0,default:!1,[R]:"Boolean"},Z={[M]:"Endpoint"},J={[V]:"isSet",[F]:[{[M]:"Region"}]},Q={[M]:"Region"},tt={[V]:"aws.partition",[F]:[Q],assign:"PartitionResult"},et={[M]:"UseFIPS"},nt={[M]:"UseDualStack"},it={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Y,signingName:"sts",signingRegion:B}]},headers:{}},st={},ot={conditions:[{[V]:z,[F]:[Q,"aws-global"]}],[G]:it,[R]:G},rt={[V]:_,[F]:[et,!0]},at={[V]:_,[F]:[nt,!0]},lt={[V]:q,[F]:[{[M]:"PartitionResult"},"supportsFIPS"]},ct={[M]:"PartitionResult"},ut={[V]:_,[F]:[!0,{[V]:q,[F]:[ct,"supportsDualStack"]}]},dt=[{[V]:"isSet",[F]:[Z]}],pt=[rt],ht=[at],gt={version:"1.0",parameters:{Region:H,UseDualStack:K,UseFIPS:K,Endpoint:H,UseGlobalEndpoint:K},rules:[{conditions:[{[V]:_,[F]:[{[M]:"UseGlobalEndpoint"},L]},{[V]:"not",[F]:dt},J,tt,{[V]:_,[F]:[et,false]},{[V]:_,[F]:[nt,false]}],rules:[{conditions:[{[V]:z,[F]:[Q,"ap-northeast-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"ap-south-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"ap-southeast-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"ap-southeast-2"]}],endpoint:it,[R]:G},ot,{conditions:[{[V]:z,[F]:[Q,"ca-central-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"eu-central-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"eu-north-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"eu-west-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"eu-west-2"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"eu-west-3"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"sa-east-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,B]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"us-east-2"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"us-west-1"]}],endpoint:it,[R]:G},{conditions:[{[V]:z,[F]:[Q,"us-west-2"]}],endpoint:it,[R]:G},{endpoint:{url:W,properties:{authSchemes:[{name:Y,signingName:"sts",signingRegion:"{Region}"}]},headers:st},[R]:G}],[R]:U},{conditions:dt,rules:[{conditions:pt,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[R]:X},{conditions:ht,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[R]:X},{endpoint:{url:Z,properties:st,headers:st},[R]:G}],[R]:U},{conditions:[J],rules:[{conditions:[tt],rules:[{conditions:[rt,at],rules:[{conditions:[{[V]:_,[F]:[L,lt]},ut],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:st,headers:st},[R]:G}],[R]:U},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[R]:X}],[R]:U},{conditions:pt,rules:[{conditions:[{[V]:_,[F]:[lt,L]}],rules:[{conditions:[{[V]:z,[F]:[{[V]:q,[F]:[ct,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:st,headers:st},[R]:G},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:st,headers:st},[R]:G}],[R]:U},{error:"FIPS is enabled but this partition does not support FIPS",[R]:X}],[R]:U},{conditions:ht,rules:[{conditions:[ut],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:st,headers:st},[R]:G}],[R]:U},{error:"DualStack is enabled but this partition does not support DualStack",[R]:X}],[R]:U},ot,{endpoint:{url:W,properties:st,headers:st},[R]:G}],[R]:U}],[R]:U},{error:"Invalid Configuration: Missing Region",[R]:X}]},ft=(t,e={})=>(0,$.B1)(gt,{endpointParams:t,logger:e.logger});$.DY.aws=D.Iu;var mt=n(66918);const xt=t=>{(0,p.H_)(process.version);const e=(0,mt.j)(t),n=()=>e().then(p.jv),i=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??C.G,base64Encoder:t?.base64Encoder??C.s,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??ft,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??m,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new v.V},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new l.oH}],logger:t?.logger??new p.vk,serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??O.e,utf8Decoder:t?.utf8Decoder??k.$x,utf8Encoder:t?.utf8Encoder??k.GZ}))(t);return(0,y.H)(process.version),{...i,...t,runtime:"node",defaultsMode:e,bodyLengthChecker:t?.bodyLengthChecker??I.W,credentialDefaultProvider:t?.credentialDefaultProvider??P.iw,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,N.fV)({serviceId:i.serviceId,clientVersion:E}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4")||(async t=>await(0,P.iw)(t?.__config||{})()),signer:new v.V},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new l.oH}],maxAttempts:t?.maxAttempts??(0,A.M)(d.Hs),region:t?.region??(0,A.M)(a._c,a.zb),requestHandler:T.NA.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,A.M)({...d.aK,default:async()=>(await n()).retryMode||S.CA}),sha256:t?.sha256??w.k.bind(null,"sha256"),streamCollector:t?.streamCollector??T.CF,useDualstackEndpoint:t?.useDualstackEndpoint??(0,A.M)(a.G7),useFipsEndpoint:t?.useFipsEndpoint??(0,A.M)(a.NL)}};var bt=n(31716),Et=n(25640);const yt=t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex((e=>e.schemeId===t.schemeId));-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}};class STSClient extends p.KU{constructor(...[t]){const e=xt(t||{}),n=(0,b.z)(e),h=(0,a.Xb)(n),g=(0,u.uW)(h),f=(0,i.S8)(g),m=(0,r.er)(f),E=(0,d.BC)(m),y=((t,e)=>{const n={...(0,bt.GW)(t),...(0,p.kE)(t),...(0,Et.cA)(t),...yt(t)};return e.forEach((t=>t.configure(n))),{...t,...(0,bt.A1)(n),...(0,p.SQ)(n),...(0,Et.AO)(n),...(i=n,{httpAuthSchemes:i.httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()})};var i})(x(E),t?.extensions||[]);super(y),this.config=y,this.middlewareStack.use((0,i.G2)(this.config)),this.middlewareStack.use((0,s.cV)(this.config)),this.middlewareStack.use((0,o.eV)(this.config)),this.middlewareStack.use((0,r.XJ)(this.config)),this.middlewareStack.use((0,d.NQ)(this.config)),this.middlewareStack.use((0,c.VG)(this.config)),this.middlewareStack.use((0,l.tZ)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,l.aZ)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return f}getIdentityProviderConfigProvider(){return async t=>new l.K5({"aws.auth#sigv4":t.credentials})}}},31388:(t,e,n)=>{"use strict";n.d(e,{x:()=>AssumeRoleCommand});var i=n(75795),s=n(43080),o=n(51630),r=n(69337),a=n(20782),l=n(23780);class AssumeRoleCommand extends(o.mY.classBuilder().ep({...r.q}).m((function(t,e,n,o){return[(0,s.p2)(n,this.serialize,this.deserialize),(0,i.a3)(n,t.getEndpointParameterInstructions())]})).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,a.TE).ser(l.db).de(l.oB).build()){}},69337:(t,e,n)=>{"use strict";n.d(e,{q:()=>s,z:()=>i});const i=t=>({...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),s={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}},41968:(t,e,n)=>{"use strict";n.d(e,{A:()=>STSServiceException});var i=n(51630);class STSServiceException extends i.sI{constructor(t){super(t),Object.setPrototypeOf(this,STSServiceException.prototype)}}},20782:(t,e,n)=>{"use strict";n.d(e,{AK:()=>RegionDisabledException,Br:()=>ExpiredTokenException,Cz:()=>a,Dk:()=>IDPCommunicationErrorException,Lg:()=>InvalidAuthorizationMessageException,TE:()=>r,VS:()=>MalformedPolicyDocumentException,WE:()=>PackedPolicyTooLargeException,b4:()=>l,bu:()=>IDPRejectedClaimException,fl:()=>InvalidIdentityTokenException});var i=n(51630),s=n(41968);class ExpiredTokenException extends s.A{constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,ExpiredTokenException.prototype)}}class MalformedPolicyDocumentException extends s.A{constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,MalformedPolicyDocumentException.prototype)}}class PackedPolicyTooLargeException extends s.A{constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,PackedPolicyTooLargeException.prototype)}}class RegionDisabledException extends s.A{constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,RegionDisabledException.prototype)}}class IDPRejectedClaimException extends s.A{constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,IDPRejectedClaimException.prototype)}}class InvalidIdentityTokenException extends s.A{constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,InvalidIdentityTokenException.prototype)}}class IDPCommunicationErrorException extends s.A{constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,IDPCommunicationErrorException.prototype)}}class InvalidAuthorizationMessageException extends s.A{constructor(t){super({name:"InvalidAuthorizationMessageException",$fault:"client",...t}),this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,InvalidAuthorizationMessageException.prototype)}}const o=t=>({...t,...t.SecretAccessKey&&{SecretAccessKey:i.oc}}),r=t=>({...t,...t.Credentials&&{Credentials:o(t.Credentials)}}),a=t=>({...t,...t.WebIdentityToken&&{WebIdentityToken:i.oc}}),l=t=>({...t,...t.Credentials&&{Credentials:o(t.Credentials)}})},23780:(t,e,n)=>{"use strict";n.d(e,{oB:()=>h,l$:()=>g,db:()=>d,pO:()=>p});var i=n(51630),s=n(22215),o=n(29311);const r=(t,e)=>(0,o.J)(t,e).then((t=>{if(t.length){const e=new s.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0});let n;e.addEntity("#xD","\r"),e.addEntity("#10","\n");try{n=e.parse(t,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const o="#text",r=Object.keys(n)[0],a=n[r];return a[o]&&(a[r]=a[o],delete a[o]),(0,i.sT)(a)}return{}})),a=async(t,e)=>{const n=await r(t,e);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n};var l=n(25640),c=n(20782),u=n(41968);const d=async(t,e)=>{const n=q;let i;return i=Dt({...w(t,e),[K]:J,[It]:H}),X(e,n,"/",void 0,i)},p=async(t,e)=>{const n=q;let i;return i=Dt({...A(t,e),[K]:et,[It]:H}),X(e,n,"/",void 0,i)},h=async(t,e)=>{if(t.statusCode>=300)return f(t,e);const n=await r(t.body,e);let i={};i=j(n.AssumeRoleResult,e);return{$metadata:W(t),...i}},g=async(t,e)=>{if(t.statusCode>=300)return f(t,e);const n=await r(t.body,e);let i={};i=R(n.AssumeRoleWithWebIdentityResult,e);return{$metadata:W(t),...i}},f=async(t,e)=>{const n={...t,body:await a(t.body,e)},i=$t(t,n.body);switch(i){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await m(n,e);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await v(n,e);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await P(n,e);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await N(n,e);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await b(n,e);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await y(n,e);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await x(n,e);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await E(n,e);default:const s=n.body;return U({output:t,parsedBody:s.Error,errorCode:i})}},m=async(t,e)=>{const n=t.body,s=F(n.Error,e),o=new c.Br({$metadata:W(t),...s});return(0,i.to)(o,n)},x=async(t,e)=>{const n=t.body,s=M(n.Error,e),o=new c.Dk({$metadata:W(t),...s});return(0,i.to)(o,n)},b=async(t,e)=>{const n=t.body,s=L(n.Error,e),o=new c.bu({$metadata:W(t),...s});return(0,i.to)(o,n)},E=async(t,e)=>{const n=t.body,s=_(n.Error,e),o=new c.Lg({$metadata:W(t),...s});return(0,i.to)(o,n)},y=async(t,e)=>{const n=t.body,s=z(n.Error,e),o=new c.fl({$metadata:W(t),...s});return(0,i.to)(o,n)},v=async(t,e)=>{const n=t.body,s=Y(n.Error,e),o=new c.VS({$metadata:W(t),...s});return(0,i.to)(o,n)},P=async(t,e)=>{const n=t.body,s=B(n.Error,e),o=new c.WE({$metadata:W(t),...s});return(0,i.to)(o,n)},N=async(t,e)=>{const n=t.body,s=G(n.Error,e),o=new c.AK({$metadata:W(t),...s});return(0,i.to)(o,n)},w=(t,e)=>{const n={};if(null!=t[xt]&&(n[xt]=t[xt]),null!=t[bt]&&(n[bt]=t[bt]),null!=t[dt]){const i=T(t[dt],e);0===t[dt]?.length&&(n.PolicyArns=[]),Object.entries(i).forEach((([t,e])=>{n[`PolicyArns.${t}`]=e}))}if(null!=t[ut]&&(n[ut]=t[ut]),null!=t[rt]&&(n[rt]=t[rt]),null!=t[wt]){const i=D(t[wt],e);0===t[wt]?.length&&(n.Tags=[]),Object.entries(i).forEach((([t,e])=>{n[`Tags.${t}`]=e}))}if(null!=t[Tt]){const i=k(t[Tt],e);0===t[Tt]?.length&&(n.TransitiveTagKeys=[]),Object.entries(i).forEach((([t,e])=>{n[`TransitiveTagKeys.${t}`]=e}))}if(null!=t[lt]&&(n[lt]=t[lt]),null!=t[Pt]&&(n[Pt]=t[Pt]),null!=t[At]&&(n[At]=t[At]),null!=t[vt]&&(n[vt]=t[vt]),null!=t[ht]){const i=O(t[ht],e);0===t[ht]?.length&&(n.ProvidedContexts=[]),Object.entries(i).forEach((([t,e])=>{n[`ProvidedContexts.${t}`]=e}))}return n},A=(t,e)=>{const n={};if(null!=t[xt]&&(n[xt]=t[xt]),null!=t[bt]&&(n[bt]=t[bt]),null!=t[Ot]&&(n[Ot]=t[Ot]),null!=t[gt]&&(n[gt]=t[gt]),null!=t[dt]){const i=T(t[dt],e);0===t[dt]?.length&&(n.PolicyArns=[]),Object.entries(i).forEach((([t,e])=>{n[`PolicyArns.${t}`]=e}))}return null!=t[ut]&&(n[ut]=t[ut]),null!=t[rt]&&(n[rt]=t[rt]),n},T=(t,e)=>{const n={};let i=1;for(const s of t){if(null===s)continue;const t=I(s,e);Object.entries(t).forEach((([t,e])=>{n[`member.${i}.${t}`]=e})),i++}return n},I=(t,e)=>{const n={};return null!=t[Ct]&&(n[Ct]=t[Ct]),n},S=(t,e)=>{const n={};return null!=t[pt]&&(n[pt]=t[pt]),null!=t[ot]&&(n[ot]=t[ot]),n},O=(t,e)=>{const n={};let i=1;for(const e of t){if(null===e)continue;const t=S(e);Object.entries(t).forEach((([t,e])=>{n[`member.${i}.${t}`]=e})),i++}return n},C=(t,e)=>{const n={};return null!=t[ct]&&(n[ct]=t[ct]),null!=t[St]&&(n[St]=t[St]),n},k=(t,e)=>{const n={};let i=1;for(const e of t)null!==e&&(n[`member.${i}`]=e,i++);return n},D=(t,e)=>{const n={};let i=1;for(const e of t){if(null===e)continue;const t=C(e);Object.entries(t).forEach((([t,e])=>{n[`member.${i}.${t}`]=e})),i++}return n},$=(t,e)=>{const n={};return null!=t[Q]&&(n[Q]=(0,i.pY)(t[Q])),null!=t[nt]&&(n[nt]=(0,i.pY)(t[nt])),n},j=(t,e)=>{const n={};return null!=t[st]&&(n[st]=V(t[st],e)),null!=t[tt]&&(n[tt]=$(t[tt])),null!=t[ft]&&(n[ft]=(0,i.AF)(t[ft])),null!=t[vt]&&(n[vt]=(0,i.pY)(t[vt])),n},R=(t,e)=>{const n={};return null!=t[st]&&(n[st]=V(t[st],e)),null!=t[yt]&&(n[yt]=(0,i.pY)(t[yt])),null!=t[tt]&&(n[tt]=$(t[tt])),null!=t[ft]&&(n[ft]=(0,i.AF)(t[ft])),null!=t[mt]&&(n[mt]=(0,i.pY)(t[mt])),null!=t[it]&&(n[it]=(0,i.pY)(t[it])),null!=t[vt]&&(n[vt]=(0,i.pY)(t[vt])),n},V=(t,e)=>{const n={};return null!=t[Z]&&(n[Z]=(0,i.pY)(t[Z])),null!=t[Et]&&(n[Et]=(0,i.pY)(t[Et])),null!=t[Nt]&&(n[Nt]=(0,i.pY)(t[Nt])),null!=t[at]&&(n[at]=(0,i.CE)((0,i.aH)(t[at]))),n},F=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},M=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},L=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},_=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},z=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},Y=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},B=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},G=(t,e)=>{const n={};return null!=t[kt]&&(n[kt]=(0,i.pY)(t[kt])),n},W=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),U=(0,i.PC)(u.A),X=async(t,e,n,i,s)=>{const{hostname:o,protocol:r="https",port:a,path:c}=await t.endpoint(),u={protocol:r,hostname:o,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:e};return void 0!==i&&(u.hostname=i),void 0!==s&&(u.body=s),new l.aW(u)},q={"content-type":"application/x-www-form-urlencoded"},H="2011-06-15",K="Action",Z="AccessKeyId",J="AssumeRole",Q="AssumedRoleId",tt="AssumedRoleUser",et="AssumeRoleWithWebIdentity",nt="Arn",it="Audience",st="Credentials",ot="ContextAssertion",rt="DurationSeconds",at="Expiration",lt="ExternalId",ct="Key",ut="Policy",dt="PolicyArns",pt="ProviderArn",ht="ProvidedContexts",gt="ProviderId",ft="PackedPolicySize",mt="Provider",xt="RoleArn",bt="RoleSessionName",Et="SecretAccessKey",yt="SubjectFromWebIdentityToken",vt="SourceIdentity",Pt="SerialNumber",Nt="SessionToken",wt="Tags",At="TokenCode",Tt="TransitiveTagKeys",It="Version",St="Value",Ot="WebIdentityToken",Ct="arn",kt="message",Dt=t=>Object.entries(t).map((([t,e])=>(0,i.jc)(t)+"="+(0,i.jc)(e))).join("&"),$t=(t,e)=>void 0!==e.Error?.Code?e.Error.Code:404==t.statusCode?"NotFound":void 0},22215:(t,e,n)=>{"use strict";const i=n(33325),s=n(43281),o=n(87932);t.exports={XMLParser:s,XMLValidator:i,XMLBuilder:o}},44056:(t,e)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"]["+(n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",s=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const i=Object.keys(e),s=i.length;for(let o=0;o<s;o++)t[i[o]]="strict"===n?[e[i[o]]]:e[i[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(t){const e=s.exec(t);return!(null==e)},e.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const o=i.length;for(let t=0;t<o;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n},e.nameRegexp=i},33325:(t,e,n)=>{"use strict";const i=n(44056),s={allowBooleanAttributes:!1,unpairedTags:[]};function o(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function r(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return g("InvalidXml","XML declaration allowed only at the start of the document.",m(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},s,e);const n=[];let l=!1,c=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if(s+=2,s=r(t,s),s.err)return s}else{if("<"!==t[s]){if(o(t[s]))continue;return g("InvalidChar","char '"+t[s]+"' is not expected.",m(t,s))}{let f=s;if(s++,"!"===t[s]){s=a(t,s);continue}{let x=!1;"/"===t[s]&&(x=!0,s++);let b="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)b+=t[s];if(b=b.trim(),"/"===b[b.length-1]&&(b=b.substring(0,b.length-1),s--),d=b,!i.isName(d)){let e;return e=0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",g("InvalidTag",e,m(t,s))}const E=u(t,s);if(!1===E)return g("InvalidAttr","Attributes for '"+b+"' have open quote.",m(t,s));let y=E.value;if(s=E.index,"/"===y[y.length-1]){const n=s-y.length;y=y.substring(0,y.length-1);const i=p(y,e);if(!0!==i)return g(i.err.code,i.err.msg,m(t,n+i.err.line));l=!0}else if(x){if(!E.tagClosed)return g("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",m(t,s));if(y.trim().length>0)return g("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",m(t,f));if(0===n.length)return g("InvalidTag","Closing tag '"+b+"' has not been opened.",m(t,f));{const e=n.pop();if(b!==e.tagName){let n=m(t,e.tagStartPos);return g("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+b+"'.",m(t,f))}0==n.length&&(c=!0)}}else{const i=p(y,e);if(!0!==i)return g(i.err.code,i.err.msg,m(t,s-y.length+i.err.line));if(!0===c)return g("InvalidXml","Multiple possible root nodes found.",m(t,s));-1!==e.unpairedTags.indexOf(b)||n.push({tagName:b,tagStartPos:f}),l=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s++,s=a(t,s);continue}if("?"!==t[s+1])break;if(s=r(t,++s),s.err)return s}else if("&"===t[s]){const e=h(t,s);if(-1==e)return g("InvalidChar","char '&' is not expected.",m(t,s));s=e}else if(!0===c&&!o(t[s]))return g("InvalidXml","Extra text at the end",m(t,s));"<"===t[s]&&s--}}}var d;return l?1==n.length?g("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",m(t,n[0].tagStartPos)):!(n.length>0)||g("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):g("InvalidXml","Start tag expected.",1)};const l='"',c="'";function u(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===l||t[e]===c)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(t,e){const n=i.getAllMatches(t,d),s={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return g("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",x(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return g("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",x(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return g("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",x(n[t]));const i=n[t][2];if(!f(i))return g("InvalidAttr","Attribute '"+i+"' is an invalid name.",x(n[t]));if(s.hasOwnProperty(i))return g("InvalidAttr","Attribute '"+i+"' is repeated.",x(n[t]));s[i]=1}return!0}function h(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function g(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function f(t){return i.isName(t)}function m(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function x(t){return t.startIndex+t[1].length}},87932:(t,e,n)=>{"use strict";const i=n(26704),s={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};function o(t){this.options=Object.assign({},s,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=r,this.options.format?(this.indentate=a,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function r(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function a(t){return this.options.indentBy.repeat(t)}function l(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}o.prototype.build=function(t){return this.options.preserveOrder?i(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},o.prototype.j2x=function(t,e){let n="",i="";for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(void 0===t[s])this.isAttribute(s)&&(i+="");else if(null===t[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){const o=this.isAttribute(s);if(o)n+=this.buildAttrPairStr(o,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const n=t[s].length;let o="",r="";for(let a=0;a<n;a++){const n=t[s][a];if(void 0===n);else if(null===n)"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof n)if(this.options.oneListGroup){const t=this.j2x(n,e+1);o+=t.val,this.options.attributesGroupName&&n.hasOwnProperty(this.options.attributesGroupName)&&(r+=t.attrStr)}else o+=this.processTextOrObjNode(n,s,e);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(s,n);t=this.replaceEntitiesValue(t),o+=t}else o+=this.buildTextValNode(n,s,"",e)}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,r,e)),i+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const e=Object.keys(t[s]),i=e.length;for(let o=0;o<i;o++)n+=this.buildAttrPairStr(e[o],""+t[s][e[o]])}else i+=this.processTextOrObjNode(t[s],s,e);return{attrStr:n,val:i}},o.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},o.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",s=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+o+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+o+">"+t+s}},o.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},o.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},o.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t},t.exports=o},26704:t=>{function e(t,r,a,l){let c="",u=!1;for(let d=0;d<t.length;d++){const p=t[d],h=n(p);if(void 0===h)continue;let g="";if(g=0===a.length?h:`${a}.${h}`,h===r.textNodeName){let t=p[h];s(g,r)||(t=r.tagValueProcessor(h,t),t=o(t,r)),u&&(c+=l),c+=t,u=!1;continue}if(h===r.cdataPropName){u&&(c+=l),c+=`<![CDATA[${p[h][0][r.textNodeName]}]]>`,u=!1;continue}if(h===r.commentPropName){c+=l+`\x3c!--${p[h][0][r.textNodeName]}--\x3e`,u=!0;continue}if("?"===h[0]){const t=i(p[":@"],r),e="?xml"===h?"":l;let n=p[h][0][r.textNodeName];n=0!==n.length?" "+n:"",c+=e+`<${h}${n}${t}?>`,u=!0;continue}let f=l;""!==f&&(f+=r.indentBy);const m=l+`<${h}${i(p[":@"],r)}`,x=e(p[h],r,g,f);-1!==r.unpairedTags.indexOf(h)?r.suppressUnpairedNode?c+=m+">":c+=m+"/>":x&&0!==x.length||!r.suppressEmptyNode?x&&x.endsWith(">")?c+=m+`>${x}${l}</${h}>`:(c+=m+">",x&&""!==l&&(x.includes("/>")||x.includes("</"))?c+=l+r.indentBy+x+l:c+=x,c+=`</${h}>`):c+=m+"/>",u=!0}return c}function n(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function i(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=o(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function s(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function o(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}t.exports=function(t,n){let i="";return n.format&&n.indentBy.length>0&&(i="\n"),e(t,n,"",i)}},13770:(t,e,n)=>{const i=n(44056);function s(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let s="";for(;e<t.length&&t[e]!==i;e++)s+=t[e];return[n,s,e]}function o(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function r(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function a(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function l(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function c(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function u(t){if(i.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}t.exports=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,d=!1,p=!1,h="";for(;e<t.length;e++)if("<"!==t[e]||p)if(">"===t[e]){if(p?"-"===t[e-1]&&"-"===t[e-2]&&(p=!1,i--):i--,0===i)break}else"["===t[e]?d=!0:h+=t[e];else{if(d&&r(t,e))e+=7,[entityName,val,e]=s(t,e+1),-1===val.indexOf("&")&&(n[u(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(d&&a(t,e))e+=8;else if(d&&l(t,e))e+=8;else if(d&&c(t,e))e+=9;else{if(!o)throw new Error("Invalid DOCTYPE");p=!0}i++,h=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}},14238:(t,e)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};e.buildOptions=function(t){return Object.assign({},n,t)},e.defaultOptions=n},22848:(t,e,n)=>{"use strict";const i=n(44056),s=n(14499),o=n(13770),r=n(85580);function a(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function l(t,e,n,i,s,o,r){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){r||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,o);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return y(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?y(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function c(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const u=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=i.getAllMatches(t,u),s=n.length,o={};for(let t=0;t<s;t++){const i=this.resolveNameSpace(n[t][1]);let s=n[t][4],r=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(r=this.options.transformAttributeName(r)),"__proto__"===r&&(r="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);o[r]=null==t?s:typeof t!=typeof s||t!==s?t:y(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[r]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=o,t}return o}}const p=function(t){t=t.replace(/\r\n?/g,"\n");const e=new s("!xml");let n=e,i="",r="";for(let a=0;a<t.length;a++){if("<"===t[a])if("/"===t[a+1]){const e=x(t,">",a,"Closing Tag is not closed.");let s=t.substring(a+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(i=this.saveTextToParentTag(i,n,r));const o=r.substring(r.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;o&&-1!==this.options.unpairedTags.indexOf(o)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",a=e}else if("?"===t[a+1]){let e=b(t,a,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new s(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}a=e.closeIndex+1}else if("!--"===t.substr(a+1,3)){const e=x(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const s=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}a=e}else if("!D"===t.substr(a+1,2)){const e=o(t,a);this.docTypeEntities=e.entities,a=e.i}else if("!["===t.substr(a+1,2)){const e=x(t,"]]>",a,"CDATA is not closed.")-2,s=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,r);let o=this.parseTextData(s,n.tagname,r,!0,!1,!0,!0);null==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,o),a=e+2}else{let o=b(t,a,this.options.removeNSPrefix),l=o.tagName;const c=o.rawTagName;let u=o.tagExp,d=o.attrExpPresent,p=o.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),l!==e.tagname&&(r+=r?"."+l:l),this.isItStopNode(this.options.stopNodes,r,l)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),u=l):u=u.substr(0,u.length-1),a=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))a=o.closeIndex;else{const n=this.readStopNodeData(t,c,p+1);if(!n)throw new Error(`Unexpected end of ${c}`);a=n.i,e=n.tagContent}const i=new s(l);l!==u&&d&&(i[":@"]=this.buildAttributesMap(u,r,l)),e&&(e=this.parseTextData(e,l,r,!0,d,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),u=l):u=u.substr(0,u.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const t=new s(l);l!==u&&d&&(t[":@"]=this.buildAttributesMap(u,r,l)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new s(l);this.tagsNodeStack.push(n),l!==u&&d&&(t[":@"]=this.buildAttributesMap(u,r,l)),this.addChild(n,t,r),n=t}i="",a=p}}else i+=t[a]}return e.child};function h(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const g=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function f(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function m(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function x(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function b(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let o=e;o<t.length;o++){let e=t[o];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:o};if(t[o+1]===n[1])return{data:s,index:o}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,i);if(!s)return;let o=s.data;const r=s.index,a=o.search(/\s/);let l=o,c=!0;-1!==a&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const u=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),c=l!==s.data.substr(t+1))}return{tagName:l,tagExp:o,closeIndex:r,attrExpPresent:c,rawTagName:u}}function E(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const o=x(t,">",n,`${e} is not closed`);if(t.substring(n+2,o).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:o};n=o}else if("?"===t[n+1]){n=x(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=x(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=x(t,"]]>",n,"StopNode is not closed.")-2}else{const i=b(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex}}}function y(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&r(t,n)}return i.isExist(t)?t:""}t.exports=class OrderedObjParser{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xa2"},pound:{regex:/&(pound|#163);/g,val:"\xa3"},yen:{regex:/&(yen|#165);/g,val:"\xa5"},euro:{regex:/&(euro|#8364);/g,val:"\u20ac"},copyright:{regex:/&(copy|#169);/g,val:"\xa9"},reg:{regex:/&(reg|#174);/g,val:"\xae"},inr:{regex:/&(inr|#8377);/g,val:"\u20b9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=a,this.parseXml=p,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=d,this.isItStopNode=m,this.replaceEntitiesValue=g,this.readStopNodeData=E,this.saveTextToParentTag=f,this.addChild=h}}},43281:(t,e,n)=>{const{buildOptions:i}=n(14238),s=n(22848),{prettify:o}=n(64416),r=n(33325);t.exports=class XMLParser{constructor(t){this.externalEntities={},this.options=i(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=r.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new s(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:o(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}},64416:(t,e)=>{"use strict";function n(t,e,r){let a;const l={};for(let c=0;c<t.length;c++){const u=t[c],d=i(u);let p="";if(p=void 0===r?d:r+"."+d,d===e.textNodeName)void 0===a?a=u[d]:a+=""+u[d];else{if(void 0===d)continue;if(u[d]){let t=n(u[d],e,p);const i=o(t,e);u[":@"]?s(t,u[":@"],p,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==l[d]&&l.hasOwnProperty(d)?(Array.isArray(l[d])||(l[d]=[l[d]]),l[d].push(t)):e.isArray(d,p,i)?l[d]=[t]:l[d]=t}}}return"string"==typeof a?a.length>0&&(l[e.textNodeName]=a):void 0!==a&&(l[e.textNodeName]=a),l}function i(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function s(t,e,n,i){if(e){const s=Object.keys(e),o=s.length;for(let r=0;r<o;r++){const o=s[r];i.isArray(o,n+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}}function o(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}e.prettify=function(t,e){return n(t,e)}},14499:t=>{"use strict";t.exports=class XmlNode{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},85580:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};t.exports=function(t,s={}){if(s=Object.assign({},i,s),!t||"string"!=typeof t)return t;let o=t.trim();if(void 0!==s.skipLike&&s.skipLike.test(o))return t;if(s.hex&&e.test(o))return Number.parseInt(o,16);{const e=n.exec(o);if(e){const n=e[1],i=e[2];let r=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(e[3]);const a=e[4]||e[6];if(!s.leadingZeros&&i.length>0&&n&&"."!==o[2])return t;if(!s.leadingZeros&&i.length>0&&!n&&"."!==o[1])return t;{const e=Number(o),l=""+e;return-1!==l.search(/[eE]/)||a?s.eNotation?e:t:-1!==o.indexOf(".")?"0"===l&&""===r||l===r||n&&l==="-"+r?e:t:i?r===l||n+r===l?e:t:o===l||o===n+l?e:t}}return t}}}};
package/dist/528.js DELETED
@@ -1 +0,0 @@
1
- "use strict";exports.id=528,exports.ids=[528],exports.modules={10247:(e,t,o)=>{o.d(t,{e1:()=>i,fk:()=>r,mJ:()=>s});var n=o(29311);const i=(e,t)=>(0,n.J)(e,t).then((e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}})),r=async(e,t)=>{const o=await i(e,t);return o.message=o.message??o.Message,o},s=(e,t)=>{const o=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},n=(i=e.headers,r="x-amzn-errortype",Object.keys(i).find((e=>e.toLowerCase()===r.toLowerCase())));var i,r;return void 0!==n?o(e.headers[n]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):void 0}},58528:(e,t,o)=>{o.d(t,{CognitoIdentityClient:()=>CognitoIdentityClient,GetCredentialsForIdentityCommand:()=>GetCredentialsForIdentityCommand,GetIdCommand:()=>GetIdCommand});var n=o(37493),i=o(70183),r=o(23703),s=o(88610),a=o(22144),c=o(71818),d=o(89362),p=o(75795),u=o(48643),l=o(51630),y=o(35413),h=o(95773);const m=async(e,t,o)=>({operation:(0,h.J)(t).operation,region:await(0,h.$)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const x=e=>{const t=[];switch(e.operation){case"GetCredentialsForIdentity":case"GetId":case"GetOpenIdToken":case"UnlinkIdentity":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},E={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},g="3.621.0";var f=o(74658),v=o(66495),I=o(95640),C=o(87954),S=o(88320),P=o(11728),w=o(91743),b=o(88383),A=o(234),F=o(53918),R=o(76954),$=o(7242),k=o(99558),O=o(92718);const z="required",D="fn",M="argv",G="ref",N="isSet",q="booleanEquals",j="error",U="endpoint",H="tree",L="PartitionResult",T={[z]:!1,type:"String"},J={[z]:!0,default:!1,type:"Boolean"},W={[G]:"Endpoint"},B={[D]:q,[M]:[{[G]:"UseFIPS"},!0]},K={[D]:q,[M]:[{[G]:"UseDualStack"},!0]},V={},Y={[D]:"getAttr",[M]:[{[G]:L},"supportsFIPS"]},_={[D]:q,[M]:[!0,{[D]:"getAttr",[M]:[{[G]:L},"supportsDualStack"]}]},X=[B],Z=[K],Q=[{[G]:"Region"}],ee={version:"1.0",parameters:{Region:T,UseDualStack:J,UseFIPS:J,Endpoint:T},rules:[{conditions:[{[D]:N,[M]:[W]}],rules:[{conditions:X,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:j},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:j},{endpoint:{url:W,properties:V,headers:V},type:U}],type:H},{conditions:[{[D]:N,[M]:Q}],rules:[{conditions:[{[D]:"aws.partition",[M]:Q,assign:L}],rules:[{conditions:[B,K],rules:[{conditions:[{[D]:q,[M]:[true,Y]},_],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:V,headers:V},type:U}],type:H},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:j}],type:H},{conditions:X,rules:[{conditions:[{[D]:q,[M]:[Y,true]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:V,headers:V},type:U}],type:H},{error:"FIPS is enabled but this partition does not support FIPS",type:j}],type:H},{conditions:Z,rules:[{conditions:[_],rules:[{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:V,headers:V},type:U}],type:H},{error:"DualStack is enabled but this partition does not support DualStack",type:j}],type:H},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:V,headers:V},type:U}],type:H}],type:H},{error:"Invalid Configuration: Missing Region",type:j}]},te=(e,t={})=>(0,O.B1)(ee,{endpointParams:e,logger:t.logger});O.DY.aws=k.Iu;var oe=o(66918);const ne=e=>{(0,l.H_)(process.version);const t=(0,oe.j)(e),o=()=>t().then(l.jv),n=(e=>({apiVersion:"2014-06-30",base64Decoder:e?.base64Decoder??R.G,base64Encoder:e?.base64Encoder??R.s,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??te,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??x,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new A.V},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new c.oH}],logger:e?.logger??new l.vk,serviceId:e?.serviceId??"Cognito Identity",urlParser:e?.urlParser??F.e,utf8Decoder:e?.utf8Decoder??$.$x,utf8Encoder:e?.utf8Encoder??$.GZ}))(e);return(0,f.H)(process.version),{...n,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??w.W,credentialDefaultProvider:e?.credentialDefaultProvider??v.iw,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,I.fV)({serviceId:n.serviceId,clientVersion:g}),maxAttempts:e?.maxAttempts??(0,S.M)(u.Hs),region:e?.region??(0,S.M)(a._c,a.zb),requestHandler:P.NA.create(e?.requestHandler??o),retryMode:e?.retryMode??(0,S.M)({...u.aK,default:async()=>(await o()).retryMode||b.CA}),sha256:e?.sha256??C.k.bind(null,"sha256"),streamCollector:e?.streamCollector??P.CF,useDualstackEndpoint:e?.useDualstackEndpoint??(0,S.M)(a.G7),useFipsEndpoint:e?.useFipsEndpoint??(0,S.M)(a.NL)}};var ie=o(31716),re=o(25640);const se=e=>{const t=e.httpAuthSchemes;let o=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(e){const o=t.findIndex((t=>t.schemeId===e.schemeId));-1===o?t.push(e):t.splice(o,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){o=e},httpAuthSchemeProvider:()=>o,setCredentials(e){n=e},credentials:()=>n}};class CognitoIdentityClient extends l.KU{constructor(...[e]){const t=ne(e||{}),o=(h=t,{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"});var h;const m=(0,a.Xb)(o),x=(0,p.uW)(m),E=(0,n.S8)(x),g=(0,s.er)(E),f=(0,u.BC)(g);var v;const I=((e,t)=>{const o={...(0,ie.GW)(e),...(0,l.kE)(e),...(0,re.cA)(e),...se(e)};return t.forEach((e=>e.configure(o))),{...e,...(0,ie.A1)(o),...(0,l.SQ)(o),...(0,re.AO)(o),...(n=o,{httpAuthSchemes:n.httpAuthSchemes(),httpAuthSchemeProvider:n.httpAuthSchemeProvider(),credentials:n.credentials()})};var n})((v=f,{...(0,y.K)(v)}),e?.extensions||[]);super(I),this.config=I,this.middlewareStack.use((0,n.G2)(this.config)),this.middlewareStack.use((0,i.cV)(this.config)),this.middlewareStack.use((0,r.eV)(this.config)),this.middlewareStack.use((0,s.XJ)(this.config)),this.middlewareStack.use((0,u.NQ)(this.config)),this.middlewareStack.use((0,d.VG)(this.config)),this.middlewareStack.use((0,c.tZ)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,c.aZ)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return m}getIdentityProviderConfigProvider(){return async e=>new c.K5({"aws.auth#sigv4":e.credentials})}}var ae=o(43080),ce=o(10247);class CognitoIdentityServiceException extends l.sI{constructor(e){super(e),Object.setPrototypeOf(this,CognitoIdentityServiceException.prototype)}}class InternalErrorException extends CognitoIdentityServiceException{constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),this.name="InternalErrorException",this.$fault="server",Object.setPrototypeOf(this,InternalErrorException.prototype)}}class InvalidParameterException extends CognitoIdentityServiceException{constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),this.name="InvalidParameterException",this.$fault="client",Object.setPrototypeOf(this,InvalidParameterException.prototype)}}class LimitExceededException extends CognitoIdentityServiceException{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,LimitExceededException.prototype)}}class NotAuthorizedException extends CognitoIdentityServiceException{constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),this.name="NotAuthorizedException",this.$fault="client",Object.setPrototypeOf(this,NotAuthorizedException.prototype)}}class ResourceConflictException extends CognitoIdentityServiceException{constructor(e){super({name:"ResourceConflictException",$fault:"client",...e}),this.name="ResourceConflictException",this.$fault="client",Object.setPrototypeOf(this,ResourceConflictException.prototype)}}class TooManyRequestsException extends CognitoIdentityServiceException{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,TooManyRequestsException.prototype)}}class ResourceNotFoundException extends CognitoIdentityServiceException{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,ResourceNotFoundException.prototype)}}class ExternalServiceException extends CognitoIdentityServiceException{constructor(e){super({name:"ExternalServiceException",$fault:"client",...e}),this.name="ExternalServiceException",this.$fault="client",Object.setPrototypeOf(this,ExternalServiceException.prototype)}}class InvalidIdentityPoolConfigurationException extends CognitoIdentityServiceException{constructor(e){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...e}),this.name="InvalidIdentityPoolConfigurationException",this.$fault="client",Object.setPrototypeOf(this,InvalidIdentityPoolConfigurationException.prototype)}}class DeveloperUserAlreadyRegisteredException extends CognitoIdentityServiceException{constructor(e){super({name:"DeveloperUserAlreadyRegisteredException",$fault:"client",...e}),this.name="DeveloperUserAlreadyRegisteredException",this.$fault="client",Object.setPrototypeOf(this,DeveloperUserAlreadyRegisteredException.prototype)}}class ConcurrentModificationException extends CognitoIdentityServiceException{constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),this.name="ConcurrentModificationException",this.$fault="client",Object.setPrototypeOf(this,ConcurrentModificationException.prototype)}}const de=async(e,t)=>{const o=Re("GetCredentialsForIdentity");let n;return n=JSON.stringify((0,l.F3)(e)),Fe(t,o,"/",void 0,n)},pe=async(e,t)=>{const o=Re("GetId");let n;return n=JSON.stringify((0,l.F3)(e)),Fe(t,o,"/",void 0,n)},ue=async(e,t)=>{if(e.statusCode>=300)return ye(e,t);const o=await(0,ce.e1)(e.body,t);let n={};n=we(o,t);return{$metadata:be(e),...n}},le=async(e,t)=>{if(e.statusCode>=300)return ye(e,t);const o=await(0,ce.e1)(e.body,t);let n={};n=(0,l.F3)(o);return{$metadata:be(e),...n}},ye=async(e,t)=>{const o={...e,body:await(0,ce.fk)(e.body,t)},n=(0,ce.mJ)(e,o.body);switch(n){case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":throw await Ee(o,t);case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":throw await fe(o,t);case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":throw await ve(o,t);case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":throw await Ie(o,t);case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":throw await Ce(o,t);case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":throw await Pe(o,t);case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":throw await Se(o,t);case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":throw await xe(o,t);case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":throw await ge(o,t);case"DeveloperUserAlreadyRegisteredException":case"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException":throw await me(o,t);case"ConcurrentModificationException":case"com.amazonaws.cognitoidentity#ConcurrentModificationException":throw await he(o,t);default:const i=o.body;return Ae({output:e,parsedBody:i,errorCode:n})}},he=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new ConcurrentModificationException({$metadata:be(e),...n});return(0,l.to)(i,o)},me=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new DeveloperUserAlreadyRegisteredException({$metadata:be(e),...n});return(0,l.to)(i,o)},xe=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new ExternalServiceException({$metadata:be(e),...n});return(0,l.to)(i,o)},Ee=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new InternalErrorException({$metadata:be(e),...n});return(0,l.to)(i,o)},ge=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new InvalidIdentityPoolConfigurationException({$metadata:be(e),...n});return(0,l.to)(i,o)},fe=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new InvalidParameterException({$metadata:be(e),...n});return(0,l.to)(i,o)},ve=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new LimitExceededException({$metadata:be(e),...n});return(0,l.to)(i,o)},Ie=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new NotAuthorizedException({$metadata:be(e),...n});return(0,l.to)(i,o)},Ce=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new ResourceConflictException({$metadata:be(e),...n});return(0,l.to)(i,o)},Se=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new ResourceNotFoundException({$metadata:be(e),...n});return(0,l.to)(i,o)},Pe=async(e,t)=>{const o=e.body,n=(0,l.F3)(o),i=new TooManyRequestsException({$metadata:be(e),...n});return(0,l.to)(i,o)},we=(e,t)=>(0,l.qn)(e,{Credentials:e=>((e,t)=>(0,l.qn)(e,{AccessKeyId:l.pY,Expiration:e=>(0,l.CE)((0,l.KX)((0,l.Fx)(e))),SecretKey:l.pY,SessionToken:l.pY}))(e),IdentityId:l.pY}),be=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ae=(0,l.PC)(CognitoIdentityServiceException),Fe=async(e,t,o,n,i)=>{const{hostname:r,protocol:s="https",port:a,path:c}=await e.endpoint(),d={protocol:s,hostname:r,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+o:c+o,headers:t};return void 0!==n&&(d.hostname=n),void 0!==i&&(d.body=i),new re.aW(d)};function Re(e){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}}class GetCredentialsForIdentityCommand extends(l.mY.classBuilder().ep({...E}).m((function(e,t,o,n){return[(0,ae.p2)(o,this.serialize,this.deserialize),(0,p.a3)(o,e.getEndpointParameterInstructions())]})).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").f(void 0,void 0).ser(de).de(ue).build()){}class GetIdCommand extends(l.mY.classBuilder().ep({...E}).m((function(e,t,o,n){return[(0,ae.p2)(o,this.serialize,this.deserialize),(0,p.a3)(o,e.getEndpointParameterInstructions())]})).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").f(void 0,void 0).ser(pe).de(le).build()){}}};
package/dist/650.js DELETED
@@ -1 +0,0 @@
1
- "use strict";exports.id=650,exports.ids=[650],exports.modules={10247:(e,t,s)=>{s.d(t,{e1:()=>n,fk:()=>r,mJ:()=>i});var o=s(29311);const n=(e,t)=>(0,o.J)(e,t).then((e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}})),r=async(e,t)=>{const s=await n(e,t);return s.message=s.message??s.Message,s},i=(e,t)=>{const s=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((e=>e.toLowerCase()===r.toLowerCase())));var n,r;return void 0!==o?s(e.headers[o]):void 0!==t.code?s(t.code):void 0!==t.__type?s(t.__type):void 0}},72650:(e,t,s)=>{s.d(t,{GetRoleCredentialsCommand:()=>GetRoleCredentialsCommand,SSOClient:()=>SSOClient});var o=s(75795),n=s(43080),r=s(51630);const i={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class SSOServiceException extends r.sI{constructor(e){super(e),Object.setPrototypeOf(this,SSOServiceException.prototype)}}class InvalidRequestException extends SSOServiceException{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,InvalidRequestException.prototype)}}class ResourceNotFoundException extends SSOServiceException{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,ResourceNotFoundException.prototype)}}class TooManyRequestsException extends SSOServiceException{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,TooManyRequestsException.prototype)}}class UnauthorizedException extends SSOServiceException{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,UnauthorizedException.prototype)}}const a=e=>({...e,...e.accessToken&&{accessToken:r.oc}}),c=e=>({...e,...e.secretAccessKey&&{secretAccessKey:r.oc},...e.sessionToken&&{sessionToken:r.oc}}),d=e=>({...e,...e.roleCredentials&&{roleCredentials:c(e.roleCredentials)}});var u=s(10247),p=s(71818);const l=async(e,t)=>{const s=(0,p.cu)(e,t),o=(0,r.UI)({},E,{[R]:e[b]});s.bp("/federation/credentials");const n=(0,r.UI)({[C]:[,(0,r.CE)(e[I],"roleName")],[w]:[,(0,r.CE)(e[P],"accountId")]});return s.m("GET").h(o).q(n).b(undefined),s.build()},h=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return m(e,t);const s=(0,r.UI)({$metadata:x(e)}),o=(0,r.CE)((0,r.Wh)(await(0,u.e1)(e.body,t)),"body"),n=(0,r.qn)(o,{roleCredentials:r.F3});return Object.assign(s,n),s},m=async(e,t)=>{const s={...e,body:await(0,u.fk)(e.body,t)},o=(0,u.mJ)(e,s.body);switch(o){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await g(s,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await S(s,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await f(s,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await v(s,t);default:const n=s.body;return y({output:e,parsedBody:n,errorCode:o})}},y=(0,r.PC)(SSOServiceException),g=async(e,t)=>{const s=(0,r.UI)({}),o=e.body,n=(0,r.qn)(o,{message:r.pY});Object.assign(s,n);const i=new InvalidRequestException({$metadata:x(e),...s});return(0,r.to)(i,e.body)},S=async(e,t)=>{const s=(0,r.UI)({}),o=e.body,n=(0,r.qn)(o,{message:r.pY});Object.assign(s,n);const i=new ResourceNotFoundException({$metadata:x(e),...s});return(0,r.to)(i,e.body)},f=async(e,t)=>{const s=(0,r.UI)({}),o=e.body,n=(0,r.qn)(o,{message:r.pY});Object.assign(s,n);const i=new TooManyRequestsException({$metadata:x(e),...s});return(0,r.to)(i,e.body)},v=async(e,t)=>{const s=(0,r.UI)({}),o=e.body,n=(0,r.qn)(o,{message:r.pY});Object.assign(s,n);const i=new UnauthorizedException({$metadata:x(e),...s});return(0,r.to)(i,e.body)},x=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),E=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),P="accountId",b="accessToken",w="account_id",I="roleName",C="role_name",R="x-amz-sso_bearer_token";class GetRoleCredentialsCommand extends(r.mY.classBuilder().ep({...i}).m((function(e,t,s,r){return[(0,n.p2)(s,this.serialize,this.deserialize),(0,o.a3)(s,e.getEndpointParameterInstructions())]})).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(a,d).ser(l).de(h).build()){}var k=s(37493),O=s(70183),A=s(23703),q=s(88610),z=s(22144),U=s(89362),D=s(48643),F=s(35413),M=s(95773);const j=async(e,t,s)=>({operation:(0,M.J)(t).operation,region:await(0,M.$)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const N=e=>{const t=[];switch(e.operation){case"GetRoleCredentials":case"ListAccountRoles":case"ListAccounts":case"Logout":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},$="3.621.0";var T=s(74658),G=s(95640),H=s(87954),_=s(88320),L=s(11728),B=s(91743),V=s(88383),J=s(234),K=s(53918),Y=s(76954),W=s(7242),Z=s(99558),Q=s(92718);const X="required",ee="fn",te="argv",se="ref",oe="isSet",ne="booleanEquals",re="error",ie="endpoint",ae="tree",ce="PartitionResult",de="getAttr",ue={[X]:!1,type:"String"},pe={[X]:!0,default:!1,type:"Boolean"},le={[se]:"Endpoint"},he={[ee]:ne,[te]:[{[se]:"UseFIPS"},!0]},me={[ee]:ne,[te]:[{[se]:"UseDualStack"},!0]},ye={},ge={[ee]:de,[te]:[{[se]:ce},"supportsFIPS"]},Se={[se]:ce},fe={[ee]:ne,[te]:[!0,{[ee]:de,[te]:[Se,"supportsDualStack"]}]},ve=[he],xe=[me],Ee=[{[se]:"Region"}],Pe={version:"1.0",parameters:{Region:ue,UseDualStack:pe,UseFIPS:pe,Endpoint:ue},rules:[{conditions:[{[ee]:oe,[te]:[le]}],rules:[{conditions:ve,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:re},{conditions:xe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:re},{endpoint:{url:le,properties:ye,headers:ye},type:ie}],type:ae},{conditions:[{[ee]:oe,[te]:Ee}],rules:[{conditions:[{[ee]:"aws.partition",[te]:Ee,assign:ce}],rules:[{conditions:[he,me],rules:[{conditions:[{[ee]:ne,[te]:[true,ge]},fe],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ye,headers:ye},type:ie}],type:ae},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:re}],type:ae},{conditions:ve,rules:[{conditions:[{[ee]:ne,[te]:[ge,true]}],rules:[{conditions:[{[ee]:"stringEquals",[te]:[{[ee]:de,[te]:[Se,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:ye,headers:ye},type:ie},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ye,headers:ye},type:ie}],type:ae},{error:"FIPS is enabled but this partition does not support FIPS",type:re}],type:ae},{conditions:xe,rules:[{conditions:[fe],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ye,headers:ye},type:ie}],type:ae},{error:"DualStack is enabled but this partition does not support DualStack",type:re}],type:ae},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:ye,headers:ye},type:ie}],type:ae}],type:ae},{error:"Invalid Configuration: Missing Region",type:re}]},be=(e,t={})=>(0,Q.B1)(Pe,{endpointParams:e,logger:t.logger});Q.DY.aws=Z.Iu;var we=s(66918);const Ie=e=>{(0,r.H_)(process.version);const t=(0,we.j)(e),s=()=>t().then(r.jv),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Y.G,base64Encoder:e?.base64Encoder??Y.s,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??be,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??N,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new J.V},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new p.oH}],logger:e?.logger??new r.vk,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??K.e,utf8Decoder:e?.utf8Decoder??W.$x,utf8Encoder:e?.utf8Encoder??W.GZ}))(e);return(0,T.H)(process.version),{...o,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??B.W,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,G.fV)({serviceId:o.serviceId,clientVersion:$}),maxAttempts:e?.maxAttempts??(0,_.M)(D.Hs),region:e?.region??(0,_.M)(z._c,z.zb),requestHandler:L.NA.create(e?.requestHandler??s),retryMode:e?.retryMode??(0,_.M)({...D.aK,default:async()=>(await s()).retryMode||V.CA}),sha256:e?.sha256??H.k.bind(null,"sha256"),streamCollector:e?.streamCollector??L.CF,useDualstackEndpoint:e?.useDualstackEndpoint??(0,_.M)(z.G7),useFipsEndpoint:e?.useFipsEndpoint??(0,_.M)(z.NL)}};var Ce=s(31716),Re=s(25640);const ke=e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const s=t.findIndex((t=>t.schemeId===e.schemeId));-1===s?t.push(e):t.splice(s,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){s=e},httpAuthSchemeProvider:()=>s,setCredentials(e){o=e},credentials:()=>o}};class SSOClient extends r.KU{constructor(...[e]){const t=Ie(e||{}),s=(n=t,{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const i=(0,z.Xb)(s),a=(0,o.uW)(i),c=(0,k.S8)(a),d=(0,q.er)(c),u=(0,D.BC)(d);var l;const h=((e,t)=>{const s={...(0,Ce.GW)(e),...(0,r.kE)(e),...(0,Re.cA)(e),...ke(e)};return t.forEach((e=>e.configure(s))),{...e,...(0,Ce.A1)(s),...(0,r.SQ)(s),...(0,Re.AO)(s),...(o=s,{httpAuthSchemes:o.httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()})};var o})((l=u,{...(0,F.K)(l)}),e?.extensions||[]);super(h),this.config=h,this.middlewareStack.use((0,k.G2)(this.config)),this.middlewareStack.use((0,O.cV)(this.config)),this.middlewareStack.use((0,A.eV)(this.config)),this.middlewareStack.use((0,q.XJ)(this.config)),this.middlewareStack.use((0,D.NQ)(this.config)),this.middlewareStack.use((0,U.VG)(this.config)),this.middlewareStack.use((0,p.tZ)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,p.aZ)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return j}getIdentityProviderConfigProvider(){return async e=>new p.K5({"aws.auth#sigv4":e.credentials})}}}};