scimgateway 5.0.15 → 5.1.0

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.
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
package/README.md CHANGED
@@ -16,6 +16,7 @@ Validated through IdP's:
16
16
 
17
17
  Latest news:
18
18
 
19
+ - By configuring the chainingBaseUrl, it is now possible to chain multiple gateways in sequence, such as `gateway1->gateway2->gateway3->endpoint`. In this setup, gateway beave much like a reverse proxy, validating authorization at each step unless PassThrough mode is enabled. Chaining is also supported in stream subscriber mode
19
20
  - Email, onError and sendMail() supports more secure RESTful OAuth for Microsoft Exchange Online (ExO) and Google Workspace Gmail, alongside traditional SMTP Auth for all mail systems. HelperRest supports a wide range of common authentication methods, including basicAuth, bearerAuth, tokenAuth, oauth, oauthSamlBearer, oauthJwtBearer and Auth PassTrough
20
21
  - Major version **v5.0.0** marks a shift to native TypeScript support and prioritizes [Bun](https://bun.sh/) over Node.js. This upgrade requires some modifications to existing plugins.
21
22
  - **BREAKING**: [SCIM Stream](https://elshaug.xyz/docs/scim-stream) is the modern way of user provisioning letting clients subscribe to messages instead of traditional IGA top-down provisioning. SCIM Gateway now offers enhanced functionality with support for message subscription and automated provisioning using SCIM Stream
@@ -185,7 +186,7 @@ For Node.js (and also Bun), we might set the property `scimgateway_postinstall_s
185
186
  // example starting all default plugins:
186
187
  // const plugins = ['loki', 'scim', 'entra-id', 'ldap', 'mssql', 'api', 'mongodb', 'saphana', 'soap']
187
188
 
188
- const plugins = ['ldap']
189
+ const plugins = ['loki']
189
190
 
190
191
  for (const plugin of plugins) {
191
192
  try {
@@ -354,6 +355,8 @@ Definitions in `endpoint` object are customized according to our plugin code. Pl
354
355
 
355
356
  - **localhostonly** - true or false. False means gateway accepts incoming requests from all clients. True means traffic from only localhost (127.0.0.1) is accepted.
356
357
 
358
+ - **chainingBaseUrl** - baseUrl for chaining anohter gateway, syntax: `http(s)://host:port`. If defined, gateway beave much like a reverse proxy, validating authorization unless PassThrough mode is enabled. See `Configuration notes` for details
359
+
357
360
  - **idleTimeout** - default 120, sets the the number of seconds to wait before timing out a connection due to inactivity
358
361
 
359
362
  - **scim.version** - "1.1" or "2.0". Default is "2.0".
@@ -399,7 +402,7 @@ Definitions in `endpoint` object are customized according to our plugin code. Pl
399
402
 
400
403
  - **auth.bearerJwt** - Array of one or more standard JWT objects. Using **secret** or **publicKey** for signature verification. publicKey should be set to the filename of public key or certificate pem-file located in `<package-root>\config\certs` or absolute path being used. Clear text secret will become encrypted when gateway is started. **options.issuer** is mandatory. Other options may also be included according to jsonwebtoken npm package definition.
401
404
 
402
- - **auth.bearerOAuth** - Array of one or more Client Credentials OAuth configuration objects. **`clientId`** and **`clientSecret`** are mandatory. clientSecret value will become encrypted when gateway is started. OAuth token request url is **/oauth/token** e.g. http://localhost:8880/oauth/token
405
+ - **auth.bearerOAuth** - Array of one or more Client Credentials OAuth configuration objects. **`clientId`** and **`clientSecret`** are mandatory. clientSecret value will become encrypted when gateway is started. OAuth token request url is **/oauth/token** e.g. `http://localhost:8880/oauth/token`
403
406
 
404
407
  - **auth.passThrough** - Setting **auth.passThrough.enabled=true** will bypass SCIM Gateway authentication. Gateway will instead pass ctx containing authentication header to the plugin. Plugin could then use this information for endpoint authentication and we don't have any password/token stored at the gateway. Note, this also requires plugin binary having `scimgateway.authPassThroughAllowed = true` and endpoint logic for handling/passing ctx.request.header.authorization
405
408
 
@@ -441,9 +444,9 @@ Definitions in `endpoint` object are customized according to our plugin code. Pl
441
444
  - **email.auth** - Authentication configuration
442
445
  - **email.auth.type** - `oauth` or `smtp`
443
446
  - **email.auth.options** - Authentication options - note, different options for type oauth and smtp
444
- - **email.auth.options.tenantIdGUID (oauth/ExO)** - Entra ID tenant id, mandatory/recommended when using Microsoft Exchange Online
445
- - **email.auth.options.clientId (oauth/ExO)** - Client ID
446
- - **email.auth.options.clientSecret (oauth/ExO)** - Client Secret
447
+ - **email.auth.options.tenantIdGUID (oauth/ExO)** - Entra tenant id or domain name
448
+ - **email.auth.options.clientId (oauth/ExO)** - Entra OAuth application Client ID
449
+ - **email.auth.options.clientSecret (oauth/ExO)** - Entra OAuth application Client Secret
447
450
  - **email.auth.options.serviceAccountKeyFile (oauth/Gmail)** - Google Service Account key json-file name located in the `package-root>\config\certs` directory unless absolute path being defined
448
451
  - **email.auth.options.host (smtp)** - Mailserver e.g. "smtp.gmail.com" - mandatory for smtp
449
452
  - **email.auth.options.port (smtp)** - Port used by mailserver e.g. 587, 25 or 465 - mandatory for smtp
@@ -561,6 +564,50 @@ Definitions in `endpoint` object are customized according to our plugin code. Pl
561
564
  - Licenses > Edit > enable Google Workspace license
562
565
  `email.emailOnError.from` mail address must have Google Workspace license
563
566
 
567
+ - Gateway chainging and chainingBaseUrl configuration
568
+
569
+ By configuring the `chainingBaseUrl`, it is possible to chain multiple gateways in sequence, such as `gateway1->gateway2->gateway3->endpoint`. In this setup, gateway behave much like a reverse proxy, validating authorization at each step unless PassThrough mode is enabled. Chaining is also supported in stream subscriber mode
570
+
571
+ {
572
+ "scimgateway": {
573
+ ...
574
+ "chainingBaseUrl": "https:\\gateway2:8880",
575
+ ...
576
+ "auth": {
577
+ ...
578
+ "passThrough": {
579
+ "enabled": false,
580
+ "readOnly": false,
581
+ "baseEntities": []
582
+ }
583
+ ...
584
+ }
585
+ },
586
+ ...
587
+ }
588
+
589
+
590
+ Using above configuration example on gateway1, incoming requests will be routed to `https:\\gateway2:8880`
591
+
592
+ The plugin and its associated authentication configuration can mirror the setup running on the final gateway. However, in chaining mode, the plugin binary is used solely for initializing and configuring the gateway. This allows for the use of a simplified `plugin-<name>.ts` binary containing only the essential mandatory components:
593
+
594
+ // start - mandatory plugin initialization
595
+ const ScimGateway: typeof import('scimgateway').ScimGateway = await (async () => {
596
+ try {
597
+ return (await import('scimgateway')).ScimGateway
598
+ } catch (err) {
599
+ const source = './scimgateway.ts'
600
+ return (await import(source)).ScimGateway
601
+ }
602
+ })()
603
+ const scimgateway = new ScimGateway()
604
+ const config = scimgateway.getConfig()
605
+ scimgateway.authPassThroughAllowed = false
606
+ // end - mandatory plugin initialization
607
+
608
+ Using `scimgateway.authPassThroughAllowed = true` and `plugin-<name>.json` configuration `scimgateway.auth.passThrough=true` enables Authentication PassTrhough
609
+
610
+
564
611
 
565
612
  ## Manual startup
566
613
 
@@ -1136,6 +1183,15 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1136
1183
 
1137
1184
  ## Change log
1138
1185
 
1186
+ ### v5.1.0
1187
+
1188
+ [Improved]
1189
+
1190
+ - By configuring the `chainingBaseUrl`, it is now possible to chain multiple gateways in sequence, such as `gateway1->gateway2->gateway3->endpoint`. In this setup, gateway beave much like a reverse proxy, validating authorization at each step unless PassThrough mode is enabled. Chaining is also supported in stream subscriber mode
1191
+
1192
+ Please see `Configuration notes` for details
1193
+
1194
+
1139
1195
  ### v5.0.15
1140
1196
 
1141
1197
  [Improved]
package/bun.lockb CHANGED
Binary file
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8890,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8881,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "customSchema": null,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8883,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8880,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8885,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8888,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8884,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8886,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -2,6 +2,7 @@
2
2
  "scimgateway": {
3
3
  "port": 8882,
4
4
  "localhostonly": false,
5
+ "chainingBaseUrl": null,
5
6
  "scim": {
6
7
  "version": "2.0",
7
8
  "skipTypeConvert": false,
@@ -1,7 +1,16 @@
1
+ // =================================================================================
2
+ // File: helper-rest.ts
3
+ //
4
+ // Author: Jarle Elshaug
5
+ //
6
+ // Purpose: HelperRest class for executing REST calls supporting various auth types
7
+ // Plugins may use this class: import { HelperRest } from 'scimgateway'
8
+ // =================================================================================
9
+
1
10
  import { HttpsProxyAgent } from 'https-proxy-agent'
2
11
  import { URL } from 'url'
3
12
  import { Buffer } from 'node:buffer'
4
- import { samlAssertion } from './samlAssertion.ts' // prereq: saml
13
+ import { samlAssertion } from './samlAssertion.ts'
5
14
  import { sign as jwtSign } from 'jsonwebtoken'
6
15
  import fs from 'node:fs'
7
16
  import querystring from 'querystring'
@@ -428,9 +437,9 @@ export class HelperRest {
428
437
  return cli // final client
429
438
  }
430
439
  //
431
- // url path - none config based and used as is (no cache)
440
+ // url path - none config based (enpoint.entity) and used as is (no cache)
432
441
  //
433
- this.scimgateway.logDebug(baseEntity, `${action}: Using none config based client`)
442
+ this.scimgateway.logDebug(baseEntity, `${action}: Using raw client`)
434
443
  let options: any = {
435
444
  json: true,
436
445
  headers: {
@@ -440,7 +449,7 @@ export class HelperRest {
440
449
  port: urlObj.port,
441
450
  protocol: urlObj.protocol,
442
451
  method: method,
443
- path: urlObj.pathname,
452
+ path: urlObj.pathname + urlObj.search,
444
453
  }
445
454
 
446
455
  // proxy
@@ -1,4 +1,5 @@
1
1
  //
2
+ // File: samlAssertion.ts
2
3
  // Purpose: create SAML token assertion that can be used by OAuth token request having grant type saml2-bearer
3
4
  // Based on: https://github.com/edersouza38/insomnia-plugin-sfsf-samlassertion
4
5
  //
@@ -11,4 +11,4 @@
11
11
  // for details see: https://elshaug.xyz/docs/scim-stream
12
12
  //
13
13
  // ================================================================
14
- 'use strict';(function(_0x9489f9,_0xa108ad){const _0x3d4f8b=a0_0xb16d,_0x364ee3=_0x9489f9();while(!![]){try{const _0x4537eb=-parseInt(_0x3d4f8b(0x15f))/0x1*(parseInt(_0x3d4f8b(0x123))/0x2)+-parseInt(_0x3d4f8b(0x181))/0x3+parseInt(_0x3d4f8b(0x1cc))/0x4+parseInt(_0x3d4f8b(0x188))/0x5+parseInt(_0x3d4f8b(0x1df))/0x6*(parseInt(_0x3d4f8b(0xe4))/0x7)+parseInt(_0x3d4f8b(0x13d))/0x8*(parseInt(_0x3d4f8b(0x1ab))/0x9)+-parseInt(_0x3d4f8b(0x150))/0xa*(parseInt(_0x3d4f8b(0x117))/0xb);if(_0x4537eb===_0xa108ad)break;else _0x364ee3['push'](_0x364ee3['shift']());}catch(_0x41e5c4){_0x364ee3['push'](_0x364ee3['shift']());}}}(a0_0x4ebe,0x6e113));import{jwtAuthenticator,headers}from'@nats-io/nats-core';import{jetstream,jetstreamManager,DeliverPolicy,AckPolicy}from'@nats-io/jetstream';import{connect as a0_0x1eb4cc}from'@nats-io/transport-node';function a0_0x4ebe(){const _0x918521=['typeId','utf8','\x22\x20with\x20chunks\x20and\x20awaiting\x20result','indexOf','4rgyKDU','ENOTFOUND','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20','elementnumber','Resources','baseUrls','debug',']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity=',']\x20error:\x20','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true','subject','approles','\x20getUserId()\x20error:\x20','\x20error:\x20','groups','reason','password','drain','normalize','forEach','write',']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20','all','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','filter','status','8yiwNOh','Operations','\x22\x20and\x20awaiting\x20result','{\x22error\x22:\x22','prototype','randomUUID','getGroups','lowercase','filter_subject','SIGINT','constructor','modifyOnly','obj',']\x20handling\x20\x22',']\x20client\x20disconnected\x20','true','GW.',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1','schemas','2673590zcWHHt','staleConnection','\x20or\x20','\x20missing\x20user\x20object\x20in\x20message:\x20',',\x20id=','modifyGroup','activityOperation','\x20createUser()\x20obj=','\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected','Msg-Id','isClosed','createUser','publisher\x20not\x20initialized/connected','subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted','query','10321vRbKAY','handle','replaceDomains','getProcessed','active','deleteGroup','attributes','userName','attribute','copyObj','getApi',']\x20subscriber[','nats','endsWith','logger','allSettled','skipConvertRolesToGroups',']\x20closed\x20with\x20error:\x20','encode','createRandomPassword','certificate','baseEntity',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','pingInterval','convertedScim20','delete','maxPingOut','\x20handling\x20message:\x20','isArray','increment','info','message',',\x20obj=','startsWith','813705OBJWxl','replaceAll','deleteUser',']\x20client\x20reconnected\x20','request','\x20(count=','operator','2780350YTjVbI','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true','type','/approles','503','getMemberOf','get','slice','\x20-\x20',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','ctxPassThrough','pluginName','gwName',']\x20initialization\x20error:\x20missing\x20configuration\x20nats',']\x20initialization\x20certificate\x20error:\x20','stringify','from','splice','\x20result=','SCIM\x20Stream\x20-\x20Autogenerated','rejected','level','configDir','\x20role\x20removal\x20error:\x20','deleteApi','rawFilter','name','_info',',true','\x27\x20not\x20supported','operation','closed','durable_','add',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','845694wSPWrJ','getAppRoles','display','ack','passThrough','\x20message:\x20user\x20does\x20not\x20exist','caller','roles','maxReconnectAttempts','publish','string','ECONNREFUSED','disconnect','HR.','displayName','SCIM\x20Stream','append',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}','reconnect','consumers',']\x20client\x20error\x20','data','func','split','sub','server_name','path','Users','error','servers','rejectUnauthorized','config','769264vuvHlv','modifyUser','\x20error:\x20missing\x20result',']\x20initialization\x20error:\x20missing\x20certificate\x20configuration',']\x20publisher[','getUsers()\x20getObj=','\x20message\x20handled:\x20','close','\x20Delete\x20User\x20id=','push','waitOnFirstConnect','\x20message\x20json\x20parsing\x20error:\x20','\x20Create\x20User\x20userName=','secret','toUpperCase','call','\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','2202buZmkM','tls','/certs/','map',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','getuniquevalue','reconnectTimeWait','\x20Create\x20userName=','apply','toLowerCase','\x20calling\x20\x22','replaceUsrGrp',']\x20connect\x20error:\x20','\x20Delete\x20User\x20userName=','3199vvveZk','file-not-configured','\x20message\x20error\x20response:\x20','\x20group\x20removal\x20error:\x20','UnableConnectingHost',']\x20client\x20has\x20a\x20stale\x20connection\x20','transports','publisher[','publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','headers','utf-8','\x20error:\x20missing\x20id}','substring','includes','\x20convertedScim20\x20error:\x20','ETIMEDOUT','deliver_policy','onCreate','foldReplacing','\x20message:\x20','\x20with\x20chunks\x20returned\x20errors:\x20',',\x20attributes=','charAt','hasOwnProperty','undefined','createWriteStream','createGroup','User','_autogenerated.cfg','All','respond','reconnecting','mkdirSync','SIGTERM','length','file','parse','tenant','readFileSync','trim','getUsers','Explicit',']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted','publisher\x20response\x20error:\x20','then','consumer_not_found',']\x20subscriber\x20stopped\x20error:\x20','subscribe','jwt','\x20processing\x20incoming\x20message',',false','11HWeXwY','value','\x20Replace\x20User\x20id=','join','consume','replace','\x20done','usePutSoftSync'];a0_0x4ebe=function(){return _0x918521;};return a0_0x4ebe();}import a0_0x15849a from'fold-to-ascii';import a0_0x5517ab from'node:fs';import a0_0x31a0e9 from'node:path';import a0_0xf9b720 from'node:crypto';import*as a0_0x2da0c2 from'./utils.ts';import*as a0_0x370d20 from'./utils-scim.ts';export class Subscriber{constructor(_0x231acd){const _0x576821=a0_0xb16d,_0x6c3bac=_0x231acd,_0x2106a9={};let _0x3fcecc='';for(let _0x544b46=0x0;_0x544b46<_0x6c3bac['logger']['transports'][_0x576821(0x106)];_0x544b46++){if(_0x6c3bac[_0x576821(0x16d)][_0x576821(0xea)][_0x544b46][_0x576821(0x1a2)]===_0x576821(0x107)){_0x3fcecc=_0x6c3bac[_0x576821(0x16d)][_0x576821(0xea)][_0x544b46][_0x576821(0x19d)];break;}}const _0x146a38=''+(_0x3fcecc==='debug'?'\x0a':''),_0x4a81e6=async(_0x1cab3b,_0x2e5da1)=>{const _0x2f3463=_0x576821,_0x3d4a61=_0x2106a9[_0x1cab3b][_0x2f3463(0x1cb)]?.['nats']?.['subject'];let _0x2c390c;try{_0x2c390c=await a0_0x1eb4cc(_0x2e5da1);if(_0x2c390c[_0x2f3463(0x17d)][_0x2f3463(0x1c5)]!==_0x2f3463(0x1ba)){_0x2c390c[_0x2f3463(0x1d3)]();return;}_0x2106a9[_0x1cab3b]['nc']=_0x2c390c,_0x5232e7(_0x1cab3b,_0x2c390c),_0x499d06(_0x1cab3b,_0x2c390c);}catch(_0x3ed5f6){_0x6c3bac[_0x2f3463(0x16d)][_0x2f3463(0x1c8)](_0x6c3bac[_0x2f3463(0x194)]+'['+_0x6c3bac['pluginName']+_0x2f3463(0x16a)+_0x1cab3b+']['+_0x3d4a61+_0x2f3463(0xe2)+_0x3ed5f6[_0x2f3463(0x17e)]+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x2e5da1[_0x2f3463(0x1d6)]=!![];try{_0x2c390c=await a0_0x1eb4cc(_0x2e5da1);if(_0x2c390c[_0x2f3463(0x17d)]['server_name']!=='SCIM\x20Stream'){_0x2c390c['close']();return;}_0x2106a9[_0x1cab3b]['nc']=_0x2c390c,_0x5232e7(_0x1cab3b,_0x2c390c),_0x499d06(_0x1cab3b,_0x2c390c);}catch(_0x3451a1){_0x6c3bac[_0x2f3463(0x16d)][_0x2f3463(0x1c8)](_0x6c3bac[_0x2f3463(0x194)]+'['+_0x6c3bac[_0x2f3463(0x193)]+_0x2f3463(0x16a)+_0x1cab3b+']['+_0x3d4a61+_0x2f3463(0xe2)+_0x3451a1[_0x2f3463(0x17e)]);return;}}_0x6c3bac['logger'][_0x2f3463(0x129)](_0x6c3bac['gwName']+'['+_0x6c3bac[_0x2f3463(0x193)]+']\x20subscriber['+_0x1cab3b+']['+_0x3d4a61+']\x20connected\x20'+(_0x2e5da1[_0x2f3463(0x1e0)]['ca']?_0x2f3463(0x1e0):'')+'\x20'+_0x2c390c['getServer']()),_0x2c390c['closed']()[_0x2f3463(0x110)](_0x2bc89f=>{const _0x4d451b=_0x2f3463;_0x2bc89f&&_0x6c3bac[_0x4d451b(0x16d)][_0x4d451b(0x1c8)](_0x6c3bac['gwName']+'['+_0x6c3bac[_0x4d451b(0x193)]+_0x4d451b(0x16a)+_0x1cab3b+']['+_0x3d4a61+_0x4d451b(0x170)+_0x2bc89f['message']);});};this[_0x576821(0x1a9)]=async(_0x33e51c,_0x16bb18)=>{const _0x129325=_0x576821;if(!_0x16bb18?.[_0x129325(0x16b)]){_0x6c3bac[_0x129325(0x16d)][_0x129325(0x1c8)](_0x6c3bac[_0x129325(0x194)]+'['+_0x6c3bac['pluginName']+']\x20subscriber['+_0x33e51c+_0x129325(0x195));return;}if(!_0x16bb18?.['nats']?.[_0x129325(0x109)]){_0x6c3bac['logger'][_0x129325(0x1c8)](_0x6c3bac[_0x129325(0x194)]+'['+_0x6c3bac[_0x129325(0x193)]+']\x20subscriber['+_0x33e51c+_0x129325(0x1aa));return;}if(!_0x16bb18?.[_0x129325(0x16b)]?.[_0x129325(0x12d)]){_0x6c3bac['logger'][_0x129325(0x1c8)](_0x6c3bac[_0x129325(0x194)]+'['+_0x6c3bac['pluginName']+_0x129325(0x16a)+_0x33e51c+_0x129325(0x175));return;}if(!_0x16bb18?.['certificate']?.['ca']){_0x6c3bac[_0x129325(0x16d)][_0x129325(0x1c8)](_0x6c3bac[_0x129325(0x194)]+'['+_0x6c3bac[_0x129325(0x193)]+_0x129325(0x16a)+_0x33e51c+']\x20initialization\x20error:\x20missing\x20certificate\x20configuration');return;}if(!_0x16bb18[_0x129325(0x128)]||!Array['isArray'](_0x16bb18[_0x129325(0x128)])||_0x16bb18['baseUrls'][_0x129325(0x106)]<0x1){_0x6c3bac[_0x129325(0x16d)][_0x129325(0x1c8)](_0x6c3bac[_0x129325(0x194)]+'['+_0x6c3bac[_0x129325(0x193)]+_0x129325(0x16a)+_0x33e51c+_0x129325(0x1e3));return;}if(!_0x16bb18[_0x129325(0x11e)]){const _0x4f1cc4=_0x16bb18?.[_0x129325(0x16b)]?.[_0x129325(0x12d)][_0x129325(0x1da)]();if(_0x4f1cc4[_0x129325(0x180)](_0x129325(0x1b8)))_0x16bb18[_0x129325(0x11e)]=!![];}const _0x2794d6={};try{let _0x3038fa=a0_0x31a0e9[_0x129325(0x11a)](_0x6c3bac[_0x129325(0x19e)],_0x129325(0x1e1),_0x16bb18?.['certificate']?.['ca']||_0x129325(0xe5));(_0x16bb18?.[_0x129325(0x173)]?.['ca']?.['startsWith']('/')||_0x16bb18?.[_0x129325(0x173)]?.['ca']?.[_0x129325(0xf1)]('\x5c'))&&(_0x3038fa=_0x16bb18[_0x129325(0x173)]['ca']),_0x2794d6['ca']=[a0_0x5517ab[_0x129325(0x10a)](_0x3038fa)],_0x2794d6[_0x129325(0x1ca)]=!![];}catch(_0x1ba58a){_0x6c3bac[_0x129325(0x16d)][_0x129325(0x1c8)](_0x6c3bac['gwName']+'['+_0x6c3bac['pluginName']+_0x129325(0x16a)+_0x33e51c+_0x129325(0x196)+_0x1ba58a['message']);return;}const _0x5ecf52={},_0xd0664=new TextEncoder()[_0x129325(0x171)](_0x16bb18?.[_0x129325(0x16b)]?.[_0x129325(0x1d9)]),_0x40ca4c=_0x16bb18?.[_0x129325(0x16b)]?.['jwt'];_0x5ecf52['authenticator']=jwtAuthenticator(_0x40ca4c,_0xd0664),_0x5ecf52[_0x129325(0x1c9)]=_0x16bb18[_0x129325(0x128)],_0x5ecf52[_0x129325(0x1e0)]=_0x2794d6,_0x5ecf52[_0x129325(0x1d6)]=![],_0x5ecf52[_0x129325(0x1be)]=!![],_0x5ecf52[_0x129325(0x1e5)]=0x3e8*0xa,_0x5ecf52['maxReconnectAttempts']=-0x1,_0x5ecf52[_0x129325(0x176)]=0x2*0x3c*0x3e8,_0x5ecf52[_0x129325(0x179)]=0x5,_0x5ecf52['debug']=![],_0x2106a9[_0x33e51c]={},_0x2106a9[_0x33e51c][_0x129325(0x1cb)]=_0x16bb18,_0x2106a9[_0x33e51c]['nc']=undefined,_0x2106a9[_0x33e51c][_0x129325(0x1c4)]=undefined,_0x4a81e6(_0x33e51c,_0x5ecf52);};const _0x499d06=async(_0x5f05b4,_0x2fe531)=>{const _0x73c459=_0x576821,_0x55455f=_0x2106a9[_0x5f05b4][_0x73c459(0x1cb)],_0x3c536d=_0x55455f?.[_0x73c459(0x16b)]?.[_0x73c459(0x12d)];if(!_0x2fe531){_0x6c3bac['logger'][_0x73c459(0x1c8)](_0x6c3bac['gwName']+'['+_0x6c3bac[_0x73c459(0x193)]+_0x73c459(0x16a)+_0x5f05b4+']['+_0x3c536d+_0x73c459(0x191));return;}const _0x58d20e=async(_0x4b165b,_0x5ab24c)=>{const _0x29b91c=_0x73c459;try{_0x6c3bac[_0x29b91c(0x16d)]['info'](_0x4b165b+_0x29b91c(0x17a)+_0x5ab24c);let _0xdb60de;try{if(_0x55455f[_0x29b91c(0x161)]&&Array[_0x29b91c(0x17b)](_0x55455f[_0x29b91c(0x161)]))for(let _0x1d3b3b=0x0;_0x1d3b3b<_0x55455f[_0x29b91c(0x161)]['length'];_0x1d3b3b++){const _0x4683a8=_0x55455f[_0x29b91c(0x161)][_0x1d3b3b];if(!_0x4683a8[_0x29b91c(0x198)]||!_0x4683a8['from'][_0x29b91c(0xf1)]('.')||!_0x4683a8['to']||!_0x4683a8['to']['includes']('.'))continue;const _0x1d95ee=new RegExp('@'+_0x4683a8[_0x29b91c(0x198)]+'\x22','gi');_0x5ab24c=_0x5ab24c[_0x29b91c(0x11c)](_0x1d95ee,'@'+_0x4683a8['to']+'\x22');}_0xdb60de=JSON[_0x29b91c(0x108)](_0x5ab24c);}catch(_0x20ffee){_0x6c3bac[_0x29b91c(0x16d)]['error'](_0x4b165b+_0x29b91c(0x1d7)+_0x20ffee[_0x29b91c(0x17e)]+_0x29b91c(0xf7)+_0x5ab24c),_0x6c3bac['logger'][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}const _0x14bf89=_0xdb60de['user'];if(!_0x14bf89){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x153)+JSON['stringify'](_0xdb60de)),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+'\x20done'+_0x146a38);return;}if(!_0x14bf89[_0x29b91c(0x166)]){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x125)+JSON[_0x29b91c(0x197)](_0xdb60de)),_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}delete _0x14bf89[_0x29b91c(0x14f)];let _0x5c7ee4;_0x14bf89['id']&&(_0x5c7ee4=_0x14bf89['id'],delete _0x14bf89['id']);let _0x127398;_0x14bf89[_0x29b91c(0xf5)]&&(_0x127398=a0_0x2da0c2['copyObj'](_0x14bf89['onCreate']),delete _0x14bf89['onCreate']);await _0x11ce40(_0x5f05b4,_0x14bf89);const _0xf9ab78=_0x14bf89[_0x29b91c(0x166)];let _0x2d3a22,_0x311b53;try{_0x2d3a22=await _0x53ada3(_0x5f05b4,_0x29b91c(0x166),_0xf9ab78);}catch(_0x2f916f){_0x6c3bac['logger'][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x12f)+_0x2f916f[_0x29b91c(0x17e)]),_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+'\x20done'+_0x146a38);const _0x47c51c=[_0x29b91c(0xe8),'UnableConnectingService',_0x29b91c(0x1b6),_0x29b91c(0x124),_0x29b91c(0xf3),'timeout'];for(const _0x6f66bb in _0x47c51c){if(_0x2f916f[_0x29b91c(0x17e)][_0x29b91c(0xf1)](_0x6f66bb))return!![];}return;}if(!_0x55455f[_0x29b91c(0x16f)]){let _0x5ae404=![];if(_0xdb60de[_0x29b91c(0x13e)]&&Array[_0x29b91c(0x17b)](_0xdb60de[_0x29b91c(0x13e)]))for(let _0x3d883b=0x0;_0x3d883b<_0xdb60de[_0x29b91c(0x13e)]['length'];_0x3d883b++){const _0x11449a=_0xdb60de[_0x29b91c(0x13e)][_0x3d883b];_0x11449a[_0x29b91c(0x1c6)][_0x29b91c(0x180)](_0x29b91c(0x1b2))&&(_0x11449a[_0x29b91c(0x1c6)]=_0x29b91c(0x131),Array[_0x29b91c(0x17b)](_0x11449a[_0x29b91c(0x118)])?(_0x11449a[_0x29b91c(0x118)][0x0]['id']=_0x11449a[_0x29b91c(0x118)][0x0]['value'],_0x11449a['value'][0x0][_0x29b91c(0x1ad)]=_0x11449a[_0x29b91c(0x118)][0x0][_0x29b91c(0x18a)]+_0x29b91c(0x190)+_0x11449a['value'][0x0][_0x29b91c(0x118)],delete _0x11449a[_0x29b91c(0x118)][0x0][_0x29b91c(0x118)],delete _0x11449a['value'][0x0][_0x29b91c(0x18a)]):_0x11449a['value']=[{'id':_0x11449a[_0x29b91c(0x118)],'display':_0x11449a['value']}],delete _0x11449a['typeId'],_0x5ae404=!![]);}if(_0x14bf89[_0x29b91c(0x1b2)]&&Array[_0x29b91c(0x17b)](_0x14bf89['roles'])&&_0x14bf89[_0x29b91c(0x1b2)]['length']>0x0){if(!_0x14bf89[_0x29b91c(0x131)])_0x14bf89[_0x29b91c(0x131)]=[];if(!Array[_0x29b91c(0x17b)](_0x14bf89[_0x29b91c(0x131)]))_0x14bf89[_0x29b91c(0x131)]=[];for(let _0x36fb19=0x0;_0x36fb19<_0x14bf89['roles'][_0x29b91c(0x106)];_0x36fb19++){const _0x26b22d={},_0x3d906d=_0x14bf89['roles'][_0x36fb19];_0x26b22d['value']=_0x3d906d[_0x29b91c(0x118)],_0x26b22d[_0x29b91c(0x1ad)]=_0x3d906d[_0x29b91c(0x18a)]+'\x20-\x20'+_0x3d906d['display'],_0x14bf89[_0x29b91c(0x131)][_0x29b91c(0x1d5)](_0x26b22d);}delete _0x14bf89[_0x29b91c(0x1b2)],_0x5ae404=!![];}if(_0x5ae404)_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+'\x20roles\x20converted\x20to\x20groups:\x20'+JSON['stringify'](_0xdb60de));}if(!_0x2d3a22){if(_0xdb60de[_0x29b91c(0x156)]===_0x29b91c(0x183)){_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+_0x29b91c(0xe3)+_0xf9ab78+_0x29b91c(0x1b0)),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}if(_0x55455f['modifyOnly']&&_0x55455f[_0x29b91c(0x148)]===!![]){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x1e6)+_0xf9ab78+_0x29b91c(0x12c)),_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}if(Object[_0x29b91c(0x141)][_0x29b91c(0xfb)]['call'](_0x14bf89,_0x29b91c(0x163))){if(typeof _0x14bf89[_0x29b91c(0x163)]===_0x29b91c(0x1b5)){const _0x564718=_0x14bf89[_0x29b91c(0x163)][_0x29b91c(0x1e8)]();if(_0x564718==='true')_0x14bf89[_0x29b91c(0x163)]=!![];else{if(_0x564718==='false')_0x14bf89['active']=![];}}if(_0x14bf89[_0x29b91c(0x163)]===![]){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x1e6)+_0xf9ab78+_0x29b91c(0x13a)),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}}_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x1d8)+_0xf9ab78);const _0x4f6e28=a0_0x2da0c2[_0x29b91c(0x168)](_0x14bf89);try{delete _0x4f6e28[_0x29b91c(0x131)];!_0x4f6e28[_0x29b91c(0x133)]&&_0x55455f['generateUserPassword']&&_0x55455f['generateUserPassword']===!![]&&(_0x4f6e28[_0x29b91c(0x133)]=a0_0x2da0c2[_0x29b91c(0x172)](0xf));if(_0x127398||_0x5c7ee4){if(_0x127398)for(const _0x203075 in _0x127398){_0x4f6e28[_0x203075]=_0x127398[_0x203075];}if(_0x5c7ee4)_0x4f6e28['id']=_0x5c7ee4;await _0x11ce40(_0x5f05b4,_0x4f6e28);}await _0x6c3bac[_0x29b91c(0x15b)](_0x5f05b4,_0x4f6e28),_0x14bf89[_0x29b91c(0x131)]&&Array[_0x29b91c(0x17b)](_0x14bf89[_0x29b91c(0x131)])&&_0x14bf89[_0x29b91c(0x131)][_0x29b91c(0x106)]>0x0&&(_0x311b53=await _0x53ada3(_0x5f05b4,_0x29b91c(0x166),_0xf9ab78));}catch(_0x24e317){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x157)+JSON['stringify'](_0x4f6e28)+'\x20error:\x20'+_0x24e317[_0x29b91c(0x17e)]+'}'),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+'\x20done'+_0x146a38);return;}}if(_0x2d3a22||_0x311b53){if(_0xdb60de['activityOperation']===_0x29b91c(0x183)){if(_0x55455f[_0x29b91c(0x148)]&&_0x55455f['modifyOnly']===!![]){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+'\x20Delete\x20User\x20id='+_0x2d3a22+_0x29b91c(0x189)),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x1d4)+_0x2d3a22);try{await _0x6c3bac[_0x29b91c(0x183)](_0x5f05b4,_0x2d3a22);}catch(_0x28a64d){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x1d4)+_0x2d3a22+_0x29b91c(0x130)+_0x28a64d[_0x29b91c(0x17e)]+'}'),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}}else{if(_0x311b53)_0x2d3a22=_0x311b53;_0x6c3bac['logger'][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x119)+_0x2d3a22);try{await _0x6c3bac[_0x29b91c(0x1ea)](_0x29b91c(0x1c7),_0x5f05b4,_0x2d3a22,_0x14bf89,_0x55455f['usePutSoftSync']);}catch(_0x8caade){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x119)+_0x2d3a22+'\x20error:\x20'+_0x8caade[_0x29b91c(0x17e)]),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+'\x20done'+_0x146a38);return;}if(_0x55455f[_0x29b91c(0x11e)]){const [_0x35d644,_0x506944]=a0_0x370d20[_0x29b91c(0x177)]({'Operations':_0xdb60de['Operations']});if(_0x506944){_0x6c3bac['logger'][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x119)+_0x2d3a22+_0x29b91c(0xf2)+_0x506944[_0x29b91c(0x17e)]),_0x6c3bac[_0x29b91c(0x16d)]['debug'](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);return;}const _0x31c0a9=[];if(_0x35d644[_0x29b91c(0x1b2)]&&Array[_0x29b91c(0x17b)](_0x35d644['roles']))for(let _0x1b5da8=0x0;_0x1b5da8<_0x35d644[_0x29b91c(0x1b2)][_0x29b91c(0x106)];_0x1b5da8++){_0x35d644[_0x29b91c(0x1b2)][_0x1b5da8][_0x29b91c(0x1a6)]&&_0x35d644[_0x29b91c(0x1b2)][_0x1b5da8][_0x29b91c(0x1a6)]===_0x29b91c(0x178)&&_0x31c0a9[_0x29b91c(0x1d5)](_0x35d644['roles'][_0x1b5da8]);}if(_0x31c0a9['length']>0x0)try{await _0x6c3bac[_0x29b91c(0x1cd)](_0x5f05b4,_0x2d3a22,{'roles':_0x31c0a9});}catch(_0x5a9285){_0x6c3bac['logger'][_0x29b91c(0x1c8)](_0x4b165b+_0x29b91c(0x119)+_0x2d3a22+_0x29b91c(0x19f)+_0x5a9285['message']);}const _0xac8fc6=[];if(_0x35d644[_0x29b91c(0x131)]&&Array[_0x29b91c(0x17b)](_0x35d644[_0x29b91c(0x131)]))for(let _0x1b72af=0x0;_0x1b72af<_0x35d644[_0x29b91c(0x131)]['length'];_0x1b72af++){_0x35d644[_0x29b91c(0x131)][_0x1b72af][_0x29b91c(0x1a6)]&&_0x35d644[_0x29b91c(0x131)][_0x1b72af][_0x29b91c(0x1a6)]==='delete'&&_0xac8fc6['push'](_0x35d644[_0x29b91c(0x131)][_0x1b72af]);}if(_0xac8fc6[_0x29b91c(0x106)]>0x0)for(let _0xae40ca=0x0;_0xae40ca<_0xac8fc6[_0x29b91c(0x106)];_0xae40ca++){try{await _0x6c3bac[_0x29b91c(0x155)](_0x5f05b4,_0xac8fc6[_0xae40ca]['id'],{'members':[{'operation':'delete','value':_0x2d3a22}]});}catch(_0x2d9e6a){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+'\x20Replace\x20User\x20id='+_0x2d3a22+_0x29b91c(0xe7)+_0x2d9e6a['message']);}}}if(_0x55455f['deleteUserOnLastGroupRoleRemoval']&&_0xdb60de[_0x29b91c(0x156)]===_0x29b91c(0x1cd)){if(_0x14bf89[_0x29b91c(0x131)]&&Array['isArray'](_0x14bf89['groups'])&&_0x14bf89[_0x29b91c(0x131)][_0x29b91c(0x106)]===0x0){if(_0x14bf89['roles']&&Array[_0x29b91c(0x17b)](_0x14bf89[_0x29b91c(0x1b2)])&&_0x14bf89[_0x29b91c(0x1b2)][_0x29b91c(0x106)]===0x0){if(_0xdb60de[_0x29b91c(0x13e)]&&Array[_0x29b91c(0x17b)](_0xdb60de[_0x29b91c(0x13e)])&&_0xdb60de[_0x29b91c(0x13e)][_0x29b91c(0x106)]>0x0){let _0x3afc39=![];for(let _0x4d5bfb=0x0;_0x4d5bfb<_0xdb60de[_0x29b91c(0x13e)]['length'];_0x4d5bfb++){const _0x34134a=_0xdb60de[_0x29b91c(0x13e)][_0x4d5bfb];if(_0x34134a['op']==='remove'){if(_0x34134a['path']){if(_0x34134a[_0x29b91c(0x1c6)][_0x29b91c(0x180)]('roles')&&_0x34134a[_0x29b91c(0x11f)]){_0x3afc39=!![];break;}else{if(_0x34134a['path']==='groups'){_0x3afc39=!![];break;}}}}}if(_0x3afc39){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x1d4)+_0x2d3a22);try{await _0x6c3bac[_0x29b91c(0x183)](_0x5f05b4,_0x2d3a22);}catch(_0x1872a3){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x4b165b+'\x20Delete\x20User\x20id='+_0x2d3a22+_0x29b91c(0x130)+_0x1872a3[_0x29b91c(0x17e)]+'}'),_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+'\x20done'+_0x146a38);return;}}}}}}}}_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x129)](_0x4b165b+_0x29b91c(0x11d)+_0x146a38);}catch(_0x54c35d){_0x6c3bac[_0x29b91c(0x16d)][_0x29b91c(0x1c8)](_0x6c3bac[_0x29b91c(0x194)]+'['+_0x6c3bac['pluginName']+_0x29b91c(0x16a)+_0x5f05b4+']['+_0x3c536d+_0x29b91c(0x12b)+_0x54c35d[_0x29b91c(0x17e)]+'\x20=>\x20subscriber\x20not\x20activated'+_0x146a38);}},_0x381681=jetstream(_0x2fe531),_0x312a19=(_0x73c459(0x1a8)+_0x6c3bac[_0x73c459(0x193)]+'_'+_0x5f05b4)[_0x73c459(0x182)]('*','#')[_0x73c459(0x182)]('>','##')[_0x73c459(0x182)]('.','_'),_0x42cd1c=_0x3c536d[_0x73c459(0x1c3)]('.')[0x0][_0x73c459(0x1da)]()==='GW',_0xdfe09a=async()=>{const _0x3b5637=_0x73c459;try{let _0x3fcf66;const _0x10bea2=''+_0x55455f?.[_0x3b5637(0x16b)]?.['tenant'],_0x1d79dd=await jetstreamManager(_0x2fe531),_0x10140c=async()=>{const _0x5e5ad1=_0x3b5637;let _0x38f7cc;try{_0x38f7cc=await _0x381681[_0x5e5ad1(0x1bf)][_0x5e5ad1(0x18e)](_0x10bea2,_0x312a19);}catch(_0x3c3663){const _0xd49452={'durable_name':_0x312a19,'deliver_policy':DeliverPolicy[_0x5e5ad1(0x101)],'ack_policy':AckPolicy[_0x5e5ad1(0x10d)],'filter_subject':_0x3c536d};await _0x1d79dd['consumers']['add'](_0x10bea2,_0xd49452),_0x38f7cc=await _0x381681[_0x5e5ad1(0x1bf)][_0x5e5ad1(0x18e)](_0x10bea2,_0x312a19);}if(_0x38f7cc?.[_0x5e5ad1(0x1a3)]?.[_0x5e5ad1(0x1cb)]?.[_0x5e5ad1(0xf4)]!==_0x5e5ad1(0x139))throw new Error(_0x5e5ad1(0x1dd));_0x38f7cc?.[_0x5e5ad1(0x1a3)]?.['config']?.[_0x5e5ad1(0x145)]!==_0x3c536d&&(await _0x1d79dd[_0x5e5ad1(0x1bf)]['update'](_0x10bea2,_0x312a19,{'filter_subject':_0x3c536d}),_0x38f7cc=await _0x381681[_0x5e5ad1(0x1bf)][_0x5e5ad1(0x18e)](_0x10bea2,_0x312a19)),_0x3fcf66=await _0x38f7cc[_0x5e5ad1(0x11b)]({'max_messages':0x64}),_0x1d1616(_0x3fcf66);},_0x1d1616=async _0x2086ce=>{const _0x2df83e=_0x3b5637;for await(const _0x440d13 of await _0x2086ce[_0x2df83e(0x13c)]()){switch(_0x440d13[_0x2df83e(0x18a)]){case _0x2df83e(0x111):_0x6c3bac[_0x2df83e(0x16d)][_0x2df83e(0x17d)](_0x6c3bac[_0x2df83e(0x194)]+'['+_0x6c3bac['pluginName']+_0x2df83e(0x16a)+_0x5f05b4+']['+_0x3c536d+']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20'+_0x440d13[_0x2df83e(0x18a)]),_0x10140c();return;}}};await _0x10140c();let _0x560173=-0x1;do{for await(const _0x477f02 of _0x3fcf66){if(!_0x477f02[_0x3b5637(0xed)]||!_0x477f02[_0x3b5637(0xed)][_0x3b5637(0x18e)](_0x3b5637(0x159))){_0x477f02[_0x3b5637(0x1ae)]();continue;}_0x560173=_0x3fcf66[_0x3b5637(0x162)]();const _0x4b6e1f=_0x6c3bac['gwName']+'['+_0x6c3bac[_0x3b5637(0x193)]+_0x3b5637(0x16a)+_0x5f05b4+']['+_0x477f02['subject']+']['+_0x560173+']['+(_0x477f02['headers']?_0x477f02[_0x3b5637(0xed)][_0x3b5637(0x18e)](_0x3b5637(0x159)):'')+']',_0x560198=_0x477f02['string'](),_0x46ddd9=await _0x58d20e(_0x4b6e1f,_0x560198);if(!_0x46ddd9||_0x46ddd9!==!![])_0x477f02['ack']();else _0x6c3bac[_0x3b5637(0x16d)][_0x3b5637(0x1c8)](_0x4b6e1f+_0x3b5637(0x158));if(_0x560173<0x1)break;}}while(_0x560173===0x0);}catch(_0x3ae582){_0x6c3bac[_0x3b5637(0x16d)]['error'](_0x6c3bac['gwName']+'['+_0x6c3bac['pluginName']+']\x20subscriber['+_0x5f05b4+']['+_0x3c536d+_0x3b5637(0x112)+_0x3ae582['message']);}},_0x5dd8c3=async()=>{const _0x20d9c3=_0x73c459,_0xaf7598=_0x2fe531[_0x20d9c3(0x113)](_0x3c536d,{'max':0x64});for await(const _0xf36dbf of _0xaf7598){if(!_0xf36dbf[_0x20d9c3(0xed)]||!_0xf36dbf['headers']['get']('Msg-Id'))continue;let _0x5351c,_0x1967da;try{try{_0x5351c=JSON[_0x20d9c3(0x108)](_0xf36dbf[_0x20d9c3(0x1b5)]());}catch(_0x24ca89){const _0x466523=_0x20d9c3(0x15d);_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x1c8)](_0x6c3bac[_0x20d9c3(0x194)]+'['+_0x6c3bac[_0x20d9c3(0x193)]+_0x20d9c3(0x16a)+_0x5f05b4+']['+_0x3c536d+']\x20'+_0x466523+':\x20'+_0xf36dbf[_0x20d9c3(0x1b5)]());throw new Error(_0x466523);}if(!_0x5351c||!_0x5351c['func']){const _0x23d771='subscriber\x20message\x20error:\x20message\x20missing\x20method';this[_0x20d9c3(0x1b1)]['logger'][_0x20d9c3(0x1c8)](this[_0x20d9c3(0x1b1)]['gwName']+'['+this[_0x20d9c3(0x1b1)][_0x20d9c3(0x193)]+']\x20subscriber['+_0x5f05b4+']['+_0x3c536d+']\x20'+_0x23d771+':\x20'+_0x5351c);throw new Error(_0x23d771);}!Object[_0x20d9c3(0x141)]['hasOwnProperty'][_0x20d9c3(0x1db)](_0x5351c,_0x20d9c3(0x174))&&(_0x5351c[_0x20d9c3(0x174)]=_0x20d9c3(0xfc));if(_0x5351c[_0x20d9c3(0x174)]!==_0x5f05b4){const _0x29c9b5='subscriber\x20message\x20error:\x20message\x20baseEntity='+_0x5351c[_0x20d9c3(0x174)]+'\x20not\x20equal\x20subscriber\x20configured\x20baseEntity='+_0x5f05b4;_0x6c3bac[_0x20d9c3(0x16d)]['error'](_0x6c3bac[_0x20d9c3(0x194)]+'['+_0x6c3bac[_0x20d9c3(0x193)]+_0x20d9c3(0x16a)+_0x5f05b4+']['+_0x3c536d+']\x20'+_0x29c9b5);throw new Error(_0x29c9b5);}_0x1967da=_0x6c3bac[_0x20d9c3(0x194)]+'['+_0x6c3bac[_0x20d9c3(0x193)]+_0x20d9c3(0x16a)+_0x5f05b4+']['+_0xf36dbf['subject']+']['+(_0xf36dbf[_0x20d9c3(0xed)]?_0xf36dbf[_0x20d9c3(0xed)][_0x20d9c3(0x18e)]('Msg-Id'):'')+']',_0x6c3bac[_0x20d9c3(0x16d)]['debug'](_0x1967da+_0x20d9c3(0x115));let _0x2eac7b,_0x2eddee;switch(_0x5351c[_0x20d9c3(0x1c2)]){case _0x20d9c3(0x10c):if(!_0x5351c[_0x20d9c3(0x149)][_0x20d9c3(0x187)]&&_0x5351c[_0x20d9c3(0x149)][_0x20d9c3(0x1a1)]&&_0x5351c[_0x20d9c3(0x149)]['rawFilter'][_0x20d9c3(0xf1)](_0x20d9c3(0x152))){const _0x14d8c0=_0x5351c[_0x20d9c3(0x149)][_0x20d9c3(0x1a1)][_0x20d9c3(0x1c3)](_0x20d9c3(0x152));let _0xcc0a4d=[];for(let _0x168cf5=0x0;_0x168cf5<_0x14d8c0[_0x20d9c3(0x106)];_0x168cf5++){_0x14d8c0[_0x168cf5]=_0x14d8c0[_0x168cf5][_0x20d9c3(0x11c)](/\(/g,'')[_0x20d9c3(0x11c)](/\)/g,'')[_0x20d9c3(0x10b)]();const _0x53653b=_0x14d8c0[_0x168cf5]['split']('\x20');if(_0x53653b[_0x20d9c3(0x106)]===0x3||_0x53653b['length']>0x2&&_0x53653b[0x2][_0x20d9c3(0x180)]('\x22')&&_0x53653b[_0x53653b['length']-0x1][_0x20d9c3(0x16c)]('\x22')){const _0x20ed2e={};_0x20ed2e[_0x20d9c3(0x167)]=_0x53653b[0x0],_0x20ed2e[_0x20d9c3(0x187)]=_0x53653b[0x1][_0x20d9c3(0x1e8)](),_0x20ed2e[_0x20d9c3(0x118)]=decodeURIComponent(_0x53653b[_0x20d9c3(0x18f)](0x2)[_0x20d9c3(0x11a)]('\x20')[_0x20d9c3(0x11c)](/"/g,'')),_0xcc0a4d[_0x20d9c3(0x1d5)](_0x20ed2e);}else{_0xcc0a4d=[];break;}}if(_0xcc0a4d[_0x20d9c3(0x106)]>0x0){const _0x1bb7f2=async _0x1b01fd=>{const _0x137908=_0x20d9c3;return await _0x6c3bac[_0x5351c['func']](_0x5f05b4,_0x1b01fd,_0x5351c[_0x137908(0x165)],_0x5351c[_0x137908(0x1af)]);},_0x3aad60=0x5,_0x173d22=[];_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+'\x20calling\x20\x22'+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x121));do{const _0x3fa170=_0xcc0a4d[_0x20d9c3(0x199)](0x0,_0x3aad60),_0x2bc681=await Promise[_0x20d9c3(0x16e)](_0x3fa170['map'](_0x1759bc=>_0x1bb7f2(_0x1759bc))),_0x30b986=_0x2bc681[_0x20d9c3(0x13b)](_0x8881d0=>_0x8881d0[_0x20d9c3(0x13c)]===_0x20d9c3(0x19c))[_0x20d9c3(0x1e2)](_0x96d875=>_0x96d875[_0x20d9c3(0x132)][_0x20d9c3(0x17e)]);if(_0x30b986['length']>0x0){const _0x34811d=_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0xf8)+_0x30b986[_0x20d9c3(0x11a)](',\x20');throw new Error(_0x34811d);}const _0x56bc7e=_0x2bc681[_0x20d9c3(0x1e2)](_0x2c7f8b=>_0x2c7f8b?.['value']?.[_0x20d9c3(0x127)]);for(let _0x5d9193=0x0;_0x5d9193<_0x56bc7e[_0x20d9c3(0x106)];_0x5d9193++){Array[_0x20d9c3(0x141)][_0x20d9c3(0x1d5)][_0x20d9c3(0x1e7)](_0x173d22,_0x56bc7e[_0x5d9193]);}}while(_0xcc0a4d[_0x20d9c3(0x106)]>0x0);_0x2eac7b={'Resources':_0x173d22};}}!_0x2eac7b&&(_0x6c3bac['logger'][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x165)],_0x5351c['ctxPassThrough']));if(Array[_0x20d9c3(0x17b)](_0x2eac7b?.[_0x20d9c3(0x127)])){if(_0x5351c?.[_0x20d9c3(0x165)]?.[_0x20d9c3(0x106)]===0x0||_0x5351c?.[_0x20d9c3(0x165)]?.[_0x20d9c3(0xf1)](_0x20d9c3(0x131)))for(let _0x1c816b=0x0;_0x1c816b<_0x2eac7b[_0x20d9c3(0x127)][_0x20d9c3(0x106)];_0x1c816b++){const _0x95ff8b=_0x2eac7b[_0x20d9c3(0x127)][_0x1c816b];if(!_0x95ff8b['id'])break;if(_0x95ff8b['groups'])break;_0x95ff8b[_0x20d9c3(0x131)]=await _0x6c3bac[_0x20d9c3(0x18d)](_0x5f05b4,_0x95ff8b['id'],_0x20d9c3(0x143),_0x5351c['ctxPassThrough']);}}break;case _0x20d9c3(0x143):_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['obj'],_0x5351c[_0x20d9c3(0x165)],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0x15b):_0x6c3bac['logger'][_0x20d9c3(0x129)](_0x1967da+'\x20calling\x20\x22'+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0xfe):_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c['func']+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c['func']](_0x5f05b4,_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0x183):_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0x164):_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c['func']+'\x22\x20and\x20awaiting\x20result'),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x192)]);break;case'modifyUser':_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+'\x20calling\x20\x22'+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0x155):_0x6c3bac['logger']['debug'](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x192)]);break;case'replaceUsrGrp':_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+'\x20calling\x20\x22'+_0x5351c[_0x20d9c3(0x1c2)]+'\x22\x20and\x20awaiting\x20result'),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5351c[_0x20d9c3(0x160)],_0x5f05b4,_0x5351c['id'],_0x5351c['obj'],_0x55455f[_0x20d9c3(0x11e)],_0x5351c[_0x20d9c3(0x192)]);break;case'postApi':_0x6c3bac['logger'][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c['func']](_0x5f05b4,_0x5351c[_0x20d9c3(0x149)],_0x5351c['ctxPassThrough']);break;case'putApi':_0x6c3bac[_0x20d9c3(0x16d)]['debug'](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+'\x22\x20and\x20awaiting\x20result'),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x149)],_0x5351c[_0x20d9c3(0x192)]);break;case'patchApi':_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c['func']+'\x22\x20and\x20awaiting\x20result'),_0x2eac7b=await _0x6c3bac[_0x5351c[_0x20d9c3(0x1c2)]](_0x5f05b4,_0x5351c['id'],_0x5351c['obj'],_0x5351c[_0x20d9c3(0x192)]);break;case _0x20d9c3(0x169):_0x6c3bac[_0x20d9c3(0x16d)][_0x20d9c3(0x129)](_0x1967da+'\x20calling\x20\x22'+_0x5351c[_0x20d9c3(0x1c2)]+'\x22\x20and\x20awaiting\x20result'),_0x2eac7b=await _0x6c3bac[_0x5351c['func']](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x15e)],_0x5351c[_0x20d9c3(0x149)],_0x5351c['ctxPassThrough']);break;case _0x20d9c3(0x1a0):_0x6c3bac[_0x20d9c3(0x16d)]['debug'](_0x1967da+_0x20d9c3(0x1e9)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x13f)),_0x2eac7b=await _0x6c3bac[_0x5351c['func']](_0x5f05b4,_0x5351c['id'],_0x5351c[_0x20d9c3(0x192)]);break;default:_0x2eddee='subscriber\x20message\x20error:\x20handle\x20\x27'+_0x5351c['func']+_0x20d9c3(0x1a5),_0x6c3bac[_0x20d9c3(0x16d)]['error'](_0x1967da+'\x20'+_0x2eddee);throw new Error(_0x2eddee);}if(!_0x2eac7b)_0x2eac7b=null;const _0x32abd1=JSON['stringify'](_0x2eac7b);_0xf36dbf[_0x20d9c3(0x102)](_0x32abd1),_0x6c3bac['logger'][_0x20d9c3(0x17d)](_0x1967da+_0x20d9c3(0x1d2)+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x17f)+(_0x5351c[_0x20d9c3(0x149)]?JSON['stringify'](_0x5351c[_0x20d9c3(0x149)]):'')+_0x20d9c3(0x154)+(_0x5351c['id']?_0x5351c['id']:'')+_0x20d9c3(0xf9)+(_0x5351c[_0x20d9c3(0x165)]?_0x5351c[_0x20d9c3(0x165)]:'')+'\x20message\x20response:\x20'+_0x32abd1+_0x146a38);}catch(_0x1c8c48){const _0x175a1f=_0x20d9c3(0x140)+_0x1c8c48[_0x20d9c3(0x17e)]+'\x22,\x22errName\x22:\x22'+_0x1c8c48['name']+'\x22}';_0xf36dbf[_0x20d9c3(0x102)](_0x175a1f),_0x6c3bac['logger'][_0x20d9c3(0x17d)]((_0x1967da||'')+'\x20message\x20handled:\x20'+_0x5351c[_0x20d9c3(0x1c2)]+_0x20d9c3(0x17f)+(_0x5351c['obj']?JSON[_0x20d9c3(0x197)](_0x5351c[_0x20d9c3(0x149)]):'')+_0x20d9c3(0x154)+(_0x5351c['id']?_0x5351c['id']:'')+_0x20d9c3(0xf9)+(_0x5351c[_0x20d9c3(0x165)]?_0x5351c[_0x20d9c3(0x165)]:'')+_0x20d9c3(0xe6)+_0x175a1f+_0x146a38);}}};if(_0x42cd1c)_0x5dd8c3();else _0xdfe09a();},_0x5232e7=async(_0x4ca753,_0x206473)=>{const _0x17b5d6=_0x576821,_0x4641ed=_0x2106a9[_0x4ca753][_0x17b5d6(0x1cb)]?.[_0x17b5d6(0x16b)]?.[_0x17b5d6(0x12d)];let _0x3cc8cc=0x0;for await(const _0x470d49 of _0x206473['status']()){switch(_0x470d49[_0x17b5d6(0x18a)]){case _0x17b5d6(0x1b7):_0x6c3bac['logger']['error'](_0x6c3bac[_0x17b5d6(0x194)]+'['+_0x6c3bac[_0x17b5d6(0x193)]+']\x20subscriber['+_0x4ca753+']['+_0x4641ed+_0x17b5d6(0x14b)+_0x470d49[_0x17b5d6(0x1c1)]+_0x17b5d6(0x1de)),_0x3cc8cc=0x0;break;case _0x17b5d6(0x1be):_0x6c3bac['logger']['info'](_0x6c3bac['gwName']+'['+_0x6c3bac[_0x17b5d6(0x193)]+_0x17b5d6(0x16a)+_0x4ca753+']['+_0x4641ed+_0x17b5d6(0x184)+_0x470d49[_0x17b5d6(0x1c1)]);break;case _0x17b5d6(0x1c8):_0x6c3bac[_0x17b5d6(0x16d)]['error'](_0x6c3bac[_0x17b5d6(0x194)]+'['+_0x6c3bac['pluginName']+_0x17b5d6(0x16a)+_0x4ca753+']['+_0x4641ed+_0x17b5d6(0x1c0)+_0x470d49[_0x17b5d6(0x1c1)]);break;case _0x17b5d6(0x103):_0x3cc8cc+=0x1;_0x3cc8cc%0x1e===0x0&&_0x6c3bac['logger'][_0x17b5d6(0x129)](_0x6c3bac[_0x17b5d6(0x194)]+'['+_0x6c3bac[_0x17b5d6(0x193)]+_0x17b5d6(0x16a)+_0x4ca753+']['+_0x4641ed+']\x20client\x20is\x20attempting\x20to\x20reconnect\x20'+_0x470d49['data']+'\x20(count='+_0x3cc8cc+')');break;case _0x17b5d6(0x151):_0x6c3bac['logger']['debug'](_0x6c3bac[_0x17b5d6(0x194)]+'['+_0x6c3bac[_0x17b5d6(0x193)]+_0x17b5d6(0x16a)+_0x4ca753+']['+_0x4641ed+_0x17b5d6(0xe9)+_0x470d49[_0x17b5d6(0x1c1)]);break;}}};process['on'](_0x576821(0x105),async()=>{const _0x1bc137=_0x576821;for(const _0x8aca66 in _0x2106a9){_0x2106a9[_0x8aca66]['nc']&&!_0x2106a9[_0x8aca66]['nc'][_0x1bc137(0x15a)]()&&await _0x2106a9[_0x8aca66]['nc']['drain']();}}),process['on'](_0x576821(0x146),async()=>{for(const _0xec8e97 in _0x2106a9){_0x2106a9[_0xec8e97]['nc']&&!_0x2106a9[_0xec8e97]['nc']['isClosed']()&&await _0x2106a9[_0xec8e97]['nc']['drain']();}});const _0x53ada3=async(_0x5f5b0e,_0x580281,_0xed166b)=>{const _0x31ca58=_0x576821,_0x5e5b48={'attribute':_0x580281,'operator':'eq','value':_0xed166b,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x4f6a70=[_0x580281];if(_0x580281!=='id')_0x4f6a70['push']('id');try{const _0x53cc77=await _0x6c3bac[_0x31ca58(0x10c)](_0x5f5b0e,_0x5e5b48,_0x4f6a70);if(!_0x53cc77||!_0x53cc77['Resources']||!Array['isArray'](_0x53cc77[_0x31ca58(0x127)]))throw new Error('getUsers()\x20getObj='+JSON[_0x31ca58(0x197)](_0x5e5b48)+_0x31ca58(0x1ce));if(_0x53cc77['Resources'][_0x31ca58(0x106)]===0x0)return null;else{if(_0x53cc77[_0x31ca58(0x127)][_0x31ca58(0x106)]>0x2)throw new Error('getUsers()\x20getObj='+JSON['stringify'](_0x5e5b48)+_0x31ca58(0x1bd));else{const _0x3e2914=_0x53cc77[_0x31ca58(0x127)][0x0];if(!_0x3e2914['id'])throw new Error(_0x31ca58(0x1d1)+JSON[_0x31ca58(0x197)](_0x5e5b48)+_0x31ca58(0x19a)+JSON[_0x31ca58(0x197)](_0x3e2914)+_0x31ca58(0xef));return decodeURIComponent(_0x3e2914['id']);}}}catch(_0x3b910f){throw new Error(_0x31ca58(0x1d1)+JSON[_0x31ca58(0x197)](_0x5e5b48)+_0x31ca58(0x130)+_0x3b910f['message']+'}');}},_0x1688ba=_0x15e411=>{const _0x421f81=_0x576821;if(!_0x15e411||typeof _0x15e411!==_0x421f81(0x1b5))return[null,null];_0x15e411=_0x15e411[_0x421f81(0x10b)]();const _0x109335=_0x15e411[_0x421f81(0x122)]('(');if(_0x109335<0x1)return[null,null];if(_0x15e411[_0x421f81(0xf0)](_0x15e411[_0x421f81(0x106)]-0x1)!==')')return[null,null];if(_0x120dce(_0x15e411,'(')!==_0x120dce(_0x15e411,')'))return[null,null];const _0x2a7dd4=_0x15e411[_0x421f81(0xf0)](0x0,_0x109335),_0x5151b9=_0x15e411[_0x421f81(0xf0)](_0x109335+0x1,_0x15e411['length']-0x1);let _0x976cdf=[];const _0x561a0d=_0x5151b9[_0x421f81(0x1c3)](',');let _0x523dac='';for(let _0x2f8eda=0x0;_0x2f8eda<_0x561a0d[_0x421f81(0x106)];_0x2f8eda++){const _0x15f99a=_0x523dac?_0x523dac+','+_0x561a0d[_0x2f8eda]:_0x561a0d[_0x2f8eda],_0x2025de=_0x120dce(_0x15f99a,'('),_0x189285=_0x120dce(_0x15f99a,')');if(_0x2025de===_0x189285)_0x976cdf[_0x421f81(0x1d5)](_0x3ff864(_0x15f99a,'\x22')),_0x523dac='';else{if(_0x523dac)_0x523dac+=','+_0x561a0d[_0x2f8eda];else _0x523dac+=_0x561a0d[_0x2f8eda];}}if(_0x976cdf[_0x421f81(0x106)]===0x0)_0x976cdf=null;return[_0x2a7dd4,_0x976cdf];};function _0x120dce(_0x41fcb1,_0x5cafde){const _0x319cc1=_0x576821;let _0x5662c0=0x0;for(let _0x3a3436=0x0;_0x3a3436<_0x41fcb1[_0x319cc1(0x106)];_0x3a3436++){_0x41fcb1[_0x319cc1(0xfa)](_0x3a3436)===_0x5cafde&&(_0x5662c0+=0x1);}return _0x5662c0;}const _0x3ff864=(_0x1865e4,_0x4975c3)=>{const _0x5edcc7=_0x576821;if(typeof _0x1865e4!==_0x5edcc7(0x1b5)||typeof _0x4975c3!==_0x5edcc7(0x1b5))return _0x1865e4;if(_0x1865e4[_0x5edcc7(0x106)]===0x1)return _0x1865e4;if(_0x4975c3[_0x5edcc7(0x106)]!==0x1)return _0x1865e4;return _0x1865e4=_0x1865e4['trim'](),_0x1865e4['substring'](0x0,0x1)===_0x4975c3&&(_0x1865e4=_0x1865e4[_0x5edcc7(0xf0)](0x1)),_0x1865e4['substring'](_0x1865e4[_0x5edcc7(0x106)]-0x1)===_0x4975c3&&(_0x1865e4=_0x1865e4['substring'](0x0,_0x1865e4[_0x5edcc7(0x106)]-0x1)),_0x1865e4;},_0x2865b8=async(_0x11138d,_0x385a69,_0x2e4f82,_0x2ed6b7)=>{const _0x152a2e=_0x576821;if(!_0x385a69||!_0x2e4f82||!_0x2ed6b7)return null;const [_0x1f905d,_0xd0e325]=_0x1688ba(_0x2ed6b7);if(!_0x1f905d||!_0xd0e325){const _0x2b2585=_0x2ed6b7[_0x152a2e(0x1c3)]('(');if(_0x2b2585[_0x152a2e(0x106)]>0x1){const _0x176e91=[_0x152a2e(0x144),'uppercase','firstn',_0x152a2e(0x126),_0x152a2e(0x11a),_0x152a2e(0x11c),_0x152a2e(0x135),_0x152a2e(0x17c),_0x152a2e(0x1e4)],_0x1192c4=_0x2b2585[0x0][_0x152a2e(0x1e8)]();if(_0x176e91[_0x152a2e(0xf1)](_0x1192c4))return null;}return _0x2ed6b7;}for(let _0x27b3cc=0x0;_0x27b3cc<_0xd0e325[_0x152a2e(0x106)];_0x27b3cc++){if(_0xd0e325[_0x27b3cc][_0x152a2e(0xf0)](0x0,0x1)==='['){const _0x169c07=_0xd0e325[_0x27b3cc][_0x152a2e(0x122)](']');if(_0x169c07<0x0)return null;const _0x5a6ea5=_0xd0e325[_0x27b3cc]['substring'](0x1,_0x169c07),_0x11f5cd=_0x5a6ea5['split']('.');let _0x88f068;for(let _0x19d23d=0x0;_0x19d23d<_0x11f5cd['length'];_0x19d23d++){if(_0x19d23d===0x0)_0x88f068=_0x385a69[_0x11f5cd[_0x19d23d]];else{if(!_0x88f068)return null;_0x88f068=_0x88f068[_0x11f5cd[_0x19d23d]];}}if(!_0x88f068)return null;_0xd0e325[_0x27b3cc]=_0x88f068;}}for(let _0x4b64c2=0x0;_0x4b64c2<_0xd0e325['length'];_0x4b64c2++){const [_0x2ce42b]=_0x1688ba(_0xd0e325[_0x4b64c2]);_0x2ce42b&&(_0xd0e325[_0x4b64c2]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0xd0e325[_0x4b64c2]));}if(_0xd0e325[0x0]===null)return null;switch(_0x1f905d[_0x152a2e(0x1e8)]()){case _0x152a2e(0x144):{if(_0xd0e325[_0x152a2e(0x106)]!==0x1)return null;const [_0x5d5af8]=_0x1688ba(_0xd0e325[0x0]);if(_0x5d5af8)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x5d5af8);if(_0xd0e325[0x0]===null)return null;return _0xd0e325[0x0]['toLowerCase']();}case'uppercase':{if(_0xd0e325[_0x152a2e(0x106)]!==0x1)return null;const [_0x380077]=_0x1688ba(_0xd0e325[0x0]);if(_0x380077)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x380077);if(_0xd0e325[0x0]===null)return null;return _0xd0e325[0x0][_0x152a2e(0x1da)]();}case'firstn':{if(_0xd0e325[_0x152a2e(0x106)]!==0x2)return null;const [_0x1a7fb8]=_0x1688ba(_0xd0e325[0x0]);if(_0x1a7fb8)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x1a7fb8);if(_0xd0e325[0x0]===null)return null;if(isNaN(_0xd0e325[0x1]))return null;return _0xd0e325[0x0][_0x152a2e(0xf0)](0x0,_0xd0e325[0x1]);}case _0x152a2e(0x126):{const [_0x3ae8ec]=_0x1688ba(_0xd0e325[0x0]);if(_0xd0e325['length']<0x2)return null;if(_0x3ae8ec)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x3ae8ec);if(_0xd0e325[0x0]===null)return null;const _0x4a552a=_0xd0e325[0x1];if(isNaN(_0x4a552a))return null;let _0x46f541;if(_0xd0e325[_0x152a2e(0x106)]===0x3)_0x46f541=_0xd0e325[0x0]['split'](_0xd0e325[0x2]);else _0x46f541=_0x46f541=_0xd0e325[0x0][_0x152a2e(0x1c3)]('\x20');if(_0x4a552a<=_0x46f541[_0x152a2e(0x106)])return _0x46f541[_0x4a552a-0x1];else return'';}case _0x152a2e(0x11c):{const [_0x61582e]=_0x1688ba(_0xd0e325[0x0]);if(_0x61582e)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x61582e);if(_0xd0e325[0x0]===null)return null;if(_0xd0e325[_0x152a2e(0x106)]!==0x3)return null;return _0xd0e325[0x0][_0x152a2e(0x182)](_0xd0e325[0x1],_0xd0e325[0x2]);}case _0x152a2e(0x135):{if(_0xd0e325[_0x152a2e(0x106)]!==0x1)return null;const [_0x2f909e]=_0x1688ba(_0xd0e325[0x0]);if(_0x2f909e)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x2f909e);if(_0xd0e325[0x0]===null)return null;return a0_0x15849a[_0x152a2e(0xf6)](_0xd0e325[0x0]);}case _0x152a2e(0x11a):{let _0x322a8a='';for(let _0x376337=0x0;_0x376337<_0xd0e325[_0x152a2e(0x106)];_0x376337++){const [_0x5292ce]=_0x1688ba(_0xd0e325[_0x376337]);if(_0x5292ce)_0xd0e325[_0x376337]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x5292ce);if(_0xd0e325[_0x376337]===null)return null;_0x322a8a+=_0xd0e325[_0x376337];}return _0x322a8a;}case _0x152a2e(0x17c):{if(_0xd0e325['length']>0x2)return null;const [_0x394058]=_0x1688ba(_0xd0e325[0x0]);if(_0x394058)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x394058);if(_0xd0e325[0x0]===null)return null;const _0x3a8f3b=parseInt(_0xd0e325[0x0]);if(isNaN(_0x3a8f3b))return null;let _0x4b829d='##doIncrement';_0x4b829d+=','+_0xd0e325[0x0];if(_0xd0e325['length']===0x2&&_0xd0e325[0x1][_0x152a2e(0x1e8)]()===_0x152a2e(0x14c))_0x4b829d+=_0x152a2e(0x1a4);else _0x4b829d+=_0x152a2e(0x116);return _0x4b829d+='##',_0x4b829d;}case _0x152a2e(0x1e4):{if(_0xd0e325[_0x152a2e(0x106)]!==0x1)return null;const [_0x24c038]=_0x1688ba(_0xd0e325[0x0]);if(_0x24c038)_0xd0e325[0x0]=await _0x2865b8(_0x11138d,_0x385a69,_0x2e4f82,_0x24c038);if(_0xd0e325[0x0]===null)return null;let _0x29c337,_0x44c28d=![],_0x4cbf9a='';const _0x315897=_0xd0e325[0x0]['split']('##');if(_0x315897[_0x152a2e(0x106)]>0x2)for(let _0x5bf13c=0x0;_0x5bf13c<_0x315897['length'];_0x5bf13c++){if(_0x315897[_0x5bf13c][_0x152a2e(0x180)]('doIncrement')){const _0x5b921e=_0x315897[_0x5bf13c][_0x152a2e(0x1c3)](',');if(_0x5b921e[_0x152a2e(0x106)]<0x2)return null;const _0x13ec64=parseInt(_0x5b921e[0x1]);if(isNaN(_0x13ec64))return null;_0x4cbf9a='##'+_0x315897[_0x5bf13c]+'##',_0x29c337=_0x5b921e[0x1],_0x5b921e[_0x152a2e(0x106)]>0x2&&(_0x44c28d=_0x5b921e[0x2][_0x152a2e(0x1e8)]()===_0x152a2e(0x14c));}}let _0x4f37e0,_0x58d535=0x0,_0x2347c3=0x0;if(_0x29c337){_0x2347c3=_0x29c337[_0x152a2e(0x106)],_0x58d535=0xa;for(let _0x2fbf64=0x1;_0x2fbf64<_0x2347c3;_0x2fbf64++){_0x58d535*=0xa;}_0x58d535-=0x1,_0x4f37e0=parseInt(_0x29c337);if(isNaN(_0x4f37e0))return null;_0x4f37e0-=0x1;}else _0x4f37e0=0x0;do{_0x4f37e0+=0x1;let _0x1512d8=_0xd0e325[0x0];if(_0x29c337!==undefined&&_0x4cbf9a){let _0x4cfc5e=_0x4f37e0['toString']();while(_0x4cfc5e[_0x152a2e(0x106)]<_0x2347c3){_0x4cfc5e='0'+_0x4cfc5e;}_0x44c28d?_0x1512d8=_0x1512d8[_0x152a2e(0x11c)](_0x4cbf9a,_0x4cfc5e):(_0x1512d8=_0x1512d8[_0x152a2e(0x11c)](_0x4cbf9a,''),_0x44c28d=!![],_0x4f37e0-=0x1);}try{const _0x17a3d8=await _0x53ada3(_0x11138d,_0x2e4f82,_0x1512d8);if(!_0x17a3d8)return _0x1512d8;}catch(_0x293a6e){return _0x6c3bac[_0x152a2e(0x16d)][_0x152a2e(0x1c8)](_0x6c3bac[_0x152a2e(0x194)]+'['+_0x6c3bac[_0x152a2e(0x193)]+']\x20'+_0x1f905d+_0x152a2e(0x12f)+_0x293a6e[_0x152a2e(0x17e)]),null;}}while(_0x4f37e0<_0x58d535);return null;}default:}return null;},_0x11ce40=async(_0x524b83,_0x46bfe3)=>{const _0x3ae344=_0x576821;for(const _0x22d61c in _0x46bfe3){const _0x27a394=_0x46bfe3[_0x22d61c],[_0x2e80eb,_0x362945]=_0x1688ba(_0x27a394);if(_0x2e80eb){const _0x372e83=''+_0x22d61c,_0x2d5339=_0x2e80eb+'('+_0x362945[_0x3ae344(0x11a)](',')+')',_0x4d6396=await _0x2865b8(_0x524b83,_0x46bfe3,_0x372e83,_0x2d5339);if(_0x4d6396===null)delete _0x46bfe3[_0x22d61c];else _0x46bfe3[_0x22d61c]=_0x4d6396;}for(const _0xec2e5 in _0x27a394){const _0x13d2f0=_0x27a394[_0xec2e5],[_0x1d2305,_0x5eb2ef]=_0x1688ba(_0x13d2f0);if(_0x1d2305){const _0x10e852=_0x22d61c+'.'+_0xec2e5,_0x21c32f=_0x1d2305+'('+_0x5eb2ef[_0x3ae344(0x11a)](',')+')',_0x29749b=await _0x2865b8(_0x524b83,_0x46bfe3,_0x10e852,_0x21c32f);if(_0x29749b===null)delete _0x27a394[_0xec2e5];else _0x27a394[_0xec2e5]=_0x29749b;}}}return _0x46bfe3;};}}function a0_0xb16d(_0x207a7c,_0x13d1c0){const _0x4ebe68=a0_0x4ebe();return a0_0xb16d=function(_0xb16d14,_0x56d99e){_0xb16d14=_0xb16d14-0xe2;let _0x2555ee=_0x4ebe68[_0xb16d14];return _0x2555ee;},a0_0xb16d(_0x207a7c,_0x13d1c0);}export class Publisher{constructor(_0x37c773){const _0x2b202e=a0_0xb16d,_0x2a6e0f=_0x37c773,_0x3e6888={},_0x305537=async(_0x357da7,_0x2043ca)=>{const _0x4e7c19=a0_0xb16d,_0x5074ad=_0x3e6888[_0x357da7][_0x4e7c19(0x1cb)]?.[_0x4e7c19(0x16b)]?.[_0x4e7c19(0x12d)];let _0x137331=0x0;for await(const _0x2340c8 of _0x2043ca[_0x4e7c19(0x13c)]()){switch(_0x2340c8['type']){case _0x4e7c19(0x1b7):_0x2a6e0f[_0x4e7c19(0x16d)][_0x4e7c19(0x1c8)](_0x2a6e0f[_0x4e7c19(0x194)]+'['+_0x2a6e0f['pluginName']+_0x4e7c19(0x1d0)+_0x357da7+']['+_0x5074ad+']\x20client\x20disconnected\x20'+_0x2340c8[_0x4e7c19(0x1c1)]+_0x4e7c19(0x1de)),_0x137331=0x0;break;case _0x4e7c19(0x1be):_0x2a6e0f[_0x4e7c19(0x16d)][_0x4e7c19(0x17d)](_0x2a6e0f[_0x4e7c19(0x194)]+'['+_0x2a6e0f[_0x4e7c19(0x193)]+']\x20publisher['+_0x357da7+']['+_0x5074ad+_0x4e7c19(0x184)+_0x2340c8[_0x4e7c19(0x1c1)]);break;case _0x4e7c19(0x1c8):_0x2a6e0f[_0x4e7c19(0x16d)]['error'](_0x2a6e0f[_0x4e7c19(0x194)]+'['+_0x2a6e0f[_0x4e7c19(0x193)]+']\x20publisher['+_0x357da7+']['+_0x5074ad+_0x4e7c19(0x1c0)+_0x2340c8[_0x4e7c19(0x1c1)]);break;case _0x4e7c19(0x103):_0x137331+=0x1;_0x137331%0x1e===0x0&&_0x2a6e0f[_0x4e7c19(0x16d)][_0x4e7c19(0x129)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0x4e7c19(0x193)]+_0x4e7c19(0x1d0)+_0x357da7+']['+_0x5074ad+_0x4e7c19(0x1bc)+_0x2340c8['data']+_0x4e7c19(0x186)+_0x137331+')');break;case'staleConnection':_0x2a6e0f[_0x4e7c19(0x16d)]['debug'](_0x2a6e0f[_0x4e7c19(0x194)]+'['+_0x2a6e0f[_0x4e7c19(0x193)]+_0x4e7c19(0x1d0)+_0x357da7+']['+_0x5074ad+_0x4e7c19(0xe9)+_0x2340c8[_0x4e7c19(0x1c1)]);break;}}},_0x330396=async(_0x34a171,_0x134916)=>{const _0xfd622d=a0_0xb16d,_0x1e247a=_0x3e6888[_0x34a171][_0xfd622d(0x1cb)]?.[_0xfd622d(0x16b)]?.[_0xfd622d(0x12d)];let _0x2d02ee;try{_0x2d02ee=await a0_0x1eb4cc(_0x134916);if(_0x2d02ee[_0xfd622d(0x17d)][_0xfd622d(0x1c5)]!==_0xfd622d(0x1ba)){_0x2d02ee[_0xfd622d(0x1d3)]();return;}_0x3e6888[_0x34a171]['nc']=_0x2d02ee,_0x305537(_0x34a171,_0x2d02ee);}catch(_0x177d35){_0x2a6e0f[_0xfd622d(0x16d)][_0xfd622d(0x1c8)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0xfd622d(0x193)]+_0xfd622d(0x1d0)+_0x34a171+']['+_0x1e247a+_0xfd622d(0xe2)+_0x177d35[_0xfd622d(0x17e)]+_0xfd622d(0x1dc)),_0x134916[_0xfd622d(0x1d6)]=!![];try{_0x2d02ee=await a0_0x1eb4cc(_0x134916);if(_0x2d02ee[_0xfd622d(0x17d)]['server_name']!==_0xfd622d(0x1ba)){_0x2d02ee[_0xfd622d(0x1d3)]();return;}_0x3e6888[_0x34a171]['nc']=_0x2d02ee,_0x305537(_0x34a171,_0x2d02ee);}catch(_0x3206c5){_0x2a6e0f[_0xfd622d(0x16d)]['error'](_0x2a6e0f[_0xfd622d(0x194)]+'['+_0x2a6e0f[_0xfd622d(0x193)]+_0xfd622d(0x1d0)+_0x34a171+']['+_0x1e247a+_0xfd622d(0xe2)+_0x3206c5['message']);return;}}_0x2a6e0f['logger'][_0xfd622d(0x129)](_0x2a6e0f[_0xfd622d(0x194)]+'['+_0x2a6e0f[_0xfd622d(0x193)]+']\x20publisher['+_0x34a171+']['+_0x1e247a+']\x20connected\x20'+(_0x134916[_0xfd622d(0x1e0)]['ca']?'tls':'')+'\x20'+_0x2d02ee['getServer']()),_0x2d02ee[_0xfd622d(0x1a7)]()[_0xfd622d(0x110)](_0x13a29d=>{const _0x35c46a=_0xfd622d;_0x13a29d&&_0x2a6e0f[_0x35c46a(0x16d)]['error'](_0x2a6e0f[_0x35c46a(0x194)]+'['+_0x2a6e0f[_0x35c46a(0x193)]+_0x35c46a(0x1d0)+_0x34a171+']['+_0x1e247a+_0x35c46a(0x170)+_0x13a29d[_0x35c46a(0x17e)]);});};this[_0x2b202e(0x1a9)]=async(_0x6d4e4b,_0x5620cc)=>{const _0x36eb5b=_0x2b202e;if(!_0x5620cc?.[_0x36eb5b(0x16b)]){_0x2a6e0f['logger'][_0x36eb5b(0x1c8)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0x36eb5b(0x193)]+']\x20publisher['+_0x6d4e4b+_0x36eb5b(0x195));return;}if(!_0x5620cc?.[_0x36eb5b(0x16b)]?.[_0x36eb5b(0x109)]){_0x2a6e0f[_0x36eb5b(0x16d)][_0x36eb5b(0x1c8)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0x36eb5b(0x193)]+_0x36eb5b(0x1d0)+_0x6d4e4b+_0x36eb5b(0x1aa));return;}if(!_0x5620cc?.[_0x36eb5b(0x16b)]?.[_0x36eb5b(0x12d)]){_0x2a6e0f['logger'][_0x36eb5b(0x1c8)](_0x2a6e0f[_0x36eb5b(0x194)]+'['+_0x2a6e0f[_0x36eb5b(0x193)]+_0x36eb5b(0x1d0)+_0x6d4e4b+']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject');return;}if(!_0x5620cc?.[_0x36eb5b(0x16b)]?.[_0x36eb5b(0x12d)][_0x36eb5b(0x180)](_0x36eb5b(0x14d))){_0x2a6e0f[_0x36eb5b(0x16d)][_0x36eb5b(0x1c8)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0x36eb5b(0x193)]+_0x36eb5b(0x1d0)+_0x6d4e4b+_0x36eb5b(0x14e));return;}if(!_0x5620cc[_0x36eb5b(0x128)]||!Array['isArray'](_0x5620cc[_0x36eb5b(0x128)])||_0x5620cc[_0x36eb5b(0x128)]['length']<0x1){_0x2a6e0f[_0x36eb5b(0x16d)][_0x36eb5b(0x1c8)](_0x2a6e0f[_0x36eb5b(0x194)]+'['+_0x2a6e0f['pluginName']+_0x36eb5b(0x1d0)+_0x6d4e4b+_0x36eb5b(0x1e3));return;}if(!_0x5620cc?.['certificate']?.['ca']){_0x2a6e0f[_0x36eb5b(0x16d)][_0x36eb5b(0x1c8)](_0x2a6e0f['gwName']+'['+_0x2a6e0f[_0x36eb5b(0x193)]+_0x36eb5b(0x1d0)+_0x6d4e4b+_0x36eb5b(0x1cf));return;}const _0x2a4cf7={};try{let _0x154206=a0_0x31a0e9['join'](_0x2a6e0f['configDir'],_0x36eb5b(0x1e1),_0x5620cc?.['certificate']?.['ca']||_0x36eb5b(0xe5));(_0x5620cc?.[_0x36eb5b(0x173)]?.['ca']?.['startsWith']('/')||_0x5620cc?.['certificate']?.['ca']?.[_0x36eb5b(0xf1)]('\x5c'))&&(_0x154206=_0x5620cc[_0x36eb5b(0x173)]['ca']),_0x2a4cf7['ca']=[a0_0x5517ab[_0x36eb5b(0x10a)](_0x154206)],_0x2a4cf7[_0x36eb5b(0x1ca)]=!![];}catch(_0x307d4e){_0x2a6e0f['logger'][_0x36eb5b(0x1c8)](_0x2a6e0f[_0x36eb5b(0x194)]+'['+_0x2a6e0f[_0x36eb5b(0x193)]+_0x36eb5b(0x1d0)+_0x6d4e4b+_0x36eb5b(0x196)+_0x307d4e[_0x36eb5b(0x17e)]);return;}const _0xae1db2={},_0x509c6d=new TextEncoder()[_0x36eb5b(0x171)](_0x5620cc?.[_0x36eb5b(0x16b)]?.[_0x36eb5b(0x1d9)]),_0x5b7d3d=_0x5620cc?.[_0x36eb5b(0x16b)]?.[_0x36eb5b(0x114)];_0xae1db2['authenticator']=jwtAuthenticator(_0x5b7d3d,_0x509c6d),_0xae1db2['servers']=_0x5620cc[_0x36eb5b(0x128)],_0xae1db2[_0x36eb5b(0x1e0)]=_0x2a4cf7,_0xae1db2[_0x36eb5b(0x1d6)]=![],_0xae1db2[_0x36eb5b(0x1be)]=!![],_0xae1db2[_0x36eb5b(0x1e5)]=0x3e8*0xa,_0xae1db2[_0x36eb5b(0x1b3)]=-0x1,_0xae1db2[_0x36eb5b(0x176)]=0x2*0x3c*0x3e8,_0xae1db2[_0x36eb5b(0x179)]=0x5,_0xae1db2[_0x36eb5b(0x129)]=![],_0x3e6888[_0x6d4e4b]={},_0x3e6888[_0x6d4e4b]['config']=_0x5620cc,_0x3e6888[_0x6d4e4b]['nc']=undefined,_0x330396(_0x6d4e4b,_0xae1db2);},this[_0x2b202e(0x1b4)]=async _0x2ab967=>{const _0x487da8=_0x2b202e;let _0x494527;try{if(_0x2ab967[_0x487da8(0x147)]===Object){_0x494527=_0x2ab967[_0x487da8(0x174)];if(!_0x494527)_0x2ab967[_0x487da8(0x174)]=_0x487da8(0xfc);_0x2ab967=JSON['stringify'](_0x2ab967);}else{const _0x4a646f=JSON[_0x487da8(0x108)](_0x2ab967);_0x494527=_0x4a646f[_0x487da8(0x174)];}}catch(_0x37b689){throw new Error(_0x487da8(0xeb)+_0x494527+_0x487da8(0x10e));}if(!_0x3e6888[_0x494527])throw new Error(_0x487da8(0xeb)+_0x494527+_0x487da8(0x12a)+_0x494527);const _0x83ed7a=headers();_0x83ed7a[_0x487da8(0x1bb)](_0x487da8(0x159),a0_0xf9b720['randomUUID']());let _0x3ef29a;try{if(!_0x3e6888[_0x494527]['nc'])throw new Error(_0x487da8(0x15c));_0x3ef29a=await _0x3e6888[_0x494527]['nc'][_0x487da8(0x185)](_0x3e6888[_0x494527][_0x487da8(0x1cb)]?.[_0x487da8(0x16b)]?.['subject'],_0x2ab967,{'headers':_0x83ed7a});}catch(_0x5aeece){if(_0x5aeece['message']===_0x487da8(0x18c))throw new Error(_0x487da8(0xeb)+_0x494527+_0x487da8(0x138)+_0x3e6888[_0x494527][_0x487da8(0x1cb)]?.[_0x487da8(0x16b)]?.[_0x487da8(0x12d)]);else throw new Error(_0x487da8(0xeb)+_0x494527+_0x487da8(0x12b)+_0x5aeece['message']);}let _0x36f94b;try{_0x36f94b=JSON['parse'](_0x3ef29a[_0x487da8(0x1b5)]());}catch(_0x1de63d){throw new Error(_0x487da8(0xec)+_0x3ef29a[_0x487da8(0x1b5)]());}if(_0x36f94b?.[_0x487da8(0x1c8)]){const _0xbc1f36=new Error(_0x487da8(0x10f)+_0x36f94b[_0x487da8(0x1c8)]);_0xbc1f36[_0x487da8(0x1a2)]=_0x36f94b['errName'];throw _0xbc1f36;}return _0x36f94b;},process['on'](_0x2b202e(0x105),async()=>{const _0x4a813d=_0x2b202e;for(const _0x5dfdf7 in _0x3e6888){_0x3e6888[_0x5dfdf7]['nc']&&!_0x3e6888[_0x5dfdf7]['nc']['isClosed']()&&await _0x3e6888[_0x5dfdf7]['nc'][_0x4a813d(0x134)]();}}),process['on'](_0x2b202e(0x146),async()=>{const _0x19bd8f=_0x2b202e;for(const _0x35271a in _0x3e6888){_0x3e6888[_0x35271a]['nc']&&!_0x3e6888[_0x35271a]['nc'][_0x19bd8f(0x15a)]()&&await _0x3e6888[_0x35271a]['nc']['drain']();}});}}export const getAppRoles=async(_0xf04722,_0x561713)=>{const _0x5b993d=a0_0xb16d,_0x192e78=_0x5b993d(0x1ac),_0x20e2aa=_0xf04722;_0x20e2aa[_0x5b993d(0x16d)][_0x5b993d(0x129)](_0x20e2aa[_0x5b993d(0x194)]+'['+_0x20e2aa[_0x5b993d(0x193)]+_0x5b993d(0x14a)+_0x192e78+'\x22');try{if(!a0_0x5517ab['existsSync'](_0x20e2aa[_0x5b993d(0x19e)]+'/approles'))a0_0x5517ab[_0x5b993d(0x104)](_0x20e2aa[_0x5b993d(0x19e)]+_0x5b993d(0x18b));}catch(_0x3b8198){void 0x0;}const _0x1cb423=a0_0x31a0e9[_0x5b993d(0x11a)](''+_0x20e2aa['configDir'],_0x5b993d(0x12e),'approles_'+_0x20e2aa[_0x5b993d(0x193)]+_0x5b993d(0x100)),_0x101a6c={};a0_0x2da0c2['fsExistsSync'](_0x1cb423)&&a0_0x5517ab[_0x5b993d(0x10a)](_0x1cb423,_0x5b993d(0xee))[_0x5b993d(0x1c3)](/\r?\n/)[_0x5b993d(0x136)](_0x5327ce=>{const _0x16423a=_0x5b993d,_0x72ef1d=_0x5327ce[_0x16423a(0x1c3)]('\x20');_0x72ef1d['length']===0x2&&(_0x101a6c[_0x72ef1d[0x0]]=_0x72ef1d[0x1]);});const _0x4e5606=a0_0x5517ab[_0x5b993d(0xfd)](_0x1cb423,{'flags':'w','encoding':_0x5b993d(0x120),'mode':0x1b6,'autoClose':!![]}),_0x537233=[],_0x3ccbb9=await _0x20e2aa[_0x5b993d(0x143)](_0x561713,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x5b993d(0x1b9)]);return _0x3ccbb9[_0x5b993d(0x127)][_0x5b993d(0x136)](_0x31e6c1=>{const _0xa0cd82=_0x5b993d;if(_0x31e6c1['id']){let _0x574da8=a0_0xf9b720[_0xa0cd82(0x142)]();if(_0x101a6c[_0x31e6c1['id']])_0x574da8=_0x101a6c[_0x31e6c1['id']];const _0x1f73fd={'allowedMemberTypes':[_0xa0cd82(0xff)],'description':_0xa0cd82(0x19b),'displayName':_0x31e6c1[_0xa0cd82(0x1b9)]||_0x31e6c1['id'],'id':_0x574da8,'isEnabled':!![],'lang':null,'origin':'Application','value':decodeURIComponent(_0x31e6c1['id'])};_0x537233[_0xa0cd82(0x1d5)](_0x1f73fd),_0x4e5606[_0xa0cd82(0x137)](_0x31e6c1['id']+'\x20'+_0x574da8+'\x0a');}}),_0x4e5606['close'](),_0x20e2aa[_0x5b993d(0x16d)][_0x5b993d(0x129)](_0x20e2aa[_0x5b993d(0x194)]+'['+_0x20e2aa[_0x5b993d(0x193)]+']\x20approle\x20uuid\x20file\x20created:\x20'+_0x1cb423),{'Resources':[{'appRoles':_0x537233}]};};
14
+ 'use strict';(function(_0x1bc805,_0x388521){const _0x33ddb4=a0_0x24a2,_0x1e67eb=_0x1bc805();while(!![]){try{const _0x51ec16=-parseInt(_0x33ddb4(0x27a))/0x1+parseInt(_0x33ddb4(0x225))/0x2+parseInt(_0x33ddb4(0x1f8))/0x3+parseInt(_0x33ddb4(0x1d9))/0x4+-parseInt(_0x33ddb4(0x1f4))/0x5*(parseInt(_0x33ddb4(0x252))/0x6)+-parseInt(_0x33ddb4(0x27f))/0x7+parseInt(_0x33ddb4(0x1f0))/0x8;if(_0x51ec16===_0x388521)break;else _0x1e67eb['push'](_0x1e67eb['shift']());}catch(_0x13ba79){_0x1e67eb['push'](_0x1e67eb['shift']());}}}(a0_0x47b0,0x62bea));function a0_0x24a2(_0x2f0a4d,_0x47d9cc){const _0x47b07a=a0_0x47b0();return a0_0x24a2=function(_0x24a29c,_0x1e2dae){_0x24a29c=_0x24a29c-0x1b3;let _0x4348a6=_0x47b07a[_0x24a29c];return _0x4348a6;},a0_0x24a2(_0x2f0a4d,_0x47d9cc);}import{jwtAuthenticator,headers}from'@nats-io/nats-core';import{jetstream,jetstreamManager,DeliverPolicy,AckPolicy}from'@nats-io/jetstream';function a0_0x47b0(){const _0x4de22e=['all','\x20message\x20json\x20parsing\x20error:\x20','close','secret','bearerToken','increment','GET\x20api','drain','\x22,\x22errName\x22:\x22','POST\x20users','onCreate','active','origin','\x20-\x20','streamChaining\x20called\x20but\x20missing\x20chainingBaseUrl','ack','patchApiHandler','getUsers()\x20getObj=','file-not-configured','stringify',']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20','includes','lowercase','UnableConnectingHost','errName',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','delete','SIGINT','PUT\x20api','foldReplacing','UnableConnectingService','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','modifyOnly','type','subscribe',',\x20obj=','url','indexOf','Resources','debug','name','content-type','37050pZjlnS','postApiHandler',']\x20connect\x20error:\x20','\x20convertedScim20\x20error:\x20','getServer','utf-8','statusCode','HR.','ctx','GET\x20serviceproviderconfig','then','users','path','/Users','application/scim+json;\x20charset=utf-8',']\x20client\x20reconnected\x20','startsWith','normalize','doRequest','join','charAt','convertedScim20','routeObj','##doIncrement','\x20Create\x20User\x20userName=','from','nats',']\x20handling\x20\x22','Msg-Id','split','patchHandler','timeout','putHandler','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true',']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20must\x20use\x20correct\x20syntax\x20\x27http(s)://host:port\x27\x20error:\x20','Basic\x20','func','reconnectTimeWait','reconnect','parse','352710kdQFjR','getuniquevalue','\x20done',']\x20initialization\x20error:\x20missing\x20certificate\x20configuration','config','491603xQBpTM','true','roles','/certs/','length','certificate','createRandomPassword','chainingBaseUrl','substring','consumers','replaceDomains','POST\x20api','modifyGroup',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','toLowerCase','randomUUID','getHandlerId','ECONNREFUSED','tenant','pluginName',']\x20closed\x20with\x20error:\x20','ENOTFOUND','/approles','push','request','string','constructor',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration','PATCH\x20api',']\x20client\x20disconnected\x20','subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted','streamChaining\x20error:\x20','Operations','\x20message\x20handled:\x20',',true','tls','Explicit','publisher[','response','toString',']\x20subscriber[','message','_info','getProcessed','PUT\x20groups','authenticator','createWriteStream','usePutSoftSync','body','configDir','helperRest','call','jwt','maxReconnectAttempts','uppercase','Bearer\x20','publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','publisher\x20not\x20initialized/connected','/Users/','activityOperation',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','file','gwName','schemas','closed','filter_subject','PUT\x20users','\x20error:\x20missing\x20id}','respond','generateUserPassword','password','copyObj','existsSync','basic','\x20(count=',']\x20subscriber\x20stopped\x20error:\x20','encode','All','operation',']\x20publisher[','SIGTERM','?filter=userName\x20eq\x20\x22','groups','error','newHelperRest','append','\x20Create\x20userName=','getEncrypted','info','Users','reconnecting','add','replace','GW.','isArray','NOT_FOUND','GET\x20groups',']\x20error:\x20','\x20group\x20removal\x20error:\x20','forEach','?attributes=','token','displayName','base64','utf8','publisher\x20response\x20error:\x20','consumer_not_found','\x20processing\x20incoming\x20message','baseUrls','deleteUserOnLastGroupRoleRemoval','subscriber\x20using\x20remote\x20gateway\x20through\x20chainingBaseUrl\x20requires\x20either\x20auth.tokenBearer\x20or\x20auth.basic\x20to\x20be\x20configured',']\x20initialization\x20error:\x20missing\x20configuration\x20nats','deleteHandler','rejectUnauthorized','trim','waitOnFirstConnect','pingInterval','doIncrement',',\x20id=',']\x20connected\x20','status','DELETE\x20groups',']\x20approle\x20uuid\x20file\x20created:\x20','durable_','\x20Delete\x20User\x20id=',']\x20client\x20has\x20a\x20stale\x20connection\x20','userName','get','putApiHandler','31876rWXYDk','deleteUser','display','\x20error:\x20','value','authorization','obj','false','toUpperCase','headers','GET','undefined','staleConnection','write','\x20roles\x20converted\x20to\x20groups:\x20','GET\x20users','baseEntity','passThrough','consume','maxPingOut','operator','getGroups','\x20getUserId()\x20error:\x20','3740632Ixokmg','auth','DELETE\x20api','mkdirSync','295RTBriT',']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20','getUsers','scimgateway','274200bSLygP','\x20Replace\x20User\x20id=','_autogenerated.cfg',']\x20initialization\x20certificate\x20error:\x20','GET\x20schemas','transports','getAppRoles','SCIM\x20Stream',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','server_name','servers','set',']\x20client\x20error\x20','update','}\x20message\x20error\x20response:\x20','?filter=externalId\x20eq\x20\x22','replaceAll','logger','getHandlerSchemas','\x20role\x20removal\x20error:\x20','\x20=>\x20subscriber\x20not\x20activated','getUsers()\x20error:\x20unsupported\x20operator\x20for\x20getObj:\x20','user',']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted','publish','typeId','ETIMEDOUT','modifyUser','approles','\x20createUser()\x20obj=','\x20result=','\x20missing\x20user\x20object\x20in\x20message:\x20','attribute','isClosed','method','subject','getHandlerServiceProviderConfig','readFileSync','data','remove','replaceUsrGrp','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','DELETE\x20users',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1','createUser','1249548XVGFPE','username','prototype'];a0_0x47b0=function(){return _0x4de22e;};return a0_0x47b0();}import{connect as a0_0x2d222d}from'@nats-io/transport-node';import a0_0x442400 from'fold-to-ascii';import a0_0x42a5b2 from'node:fs';import a0_0x5d9708 from'node:path';import a0_0x385c0f from'node:crypto';import*as a0_0xfd4a34 from'./utils.ts';import*as a0_0x34c478 from'./utils-scim.ts';export class Subscriber{constructor(_0x43b748,_0x5d1d0b){const _0x309557=a0_0x24a2,_0x1c6ff4=_0x43b748,_0x46b9da={},_0x28d126=_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)]['chainingBaseUrl'];let _0x3184ae='';if(_0x28d126){if(_0x1c6ff4[_0x309557(0x27e)]['scimgateway']?.[_0x309557(0x1f1)]?.[_0x309557(0x22c)]&&Array[_0x309557(0x1b6)](_0x1c6ff4[_0x309557(0x27e)]['scimgateway'][_0x309557(0x1f1)][_0x309557(0x22c)])&&_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)][_0x309557(0x1f1)][_0x309557(0x22c)]['length']>0x0){const _0xfe26d6=_0x1c6ff4['config'][_0x309557(0x1f7)][_0x309557(0x1f1)][_0x309557(0x22c)];if(_0xfe26d6[0x0]['token']){const _0x2309b0=Buffer[_0x309557(0x26b)](_0xfe26d6[0x0][_0x309557(0x1bd)])[_0x309557(0x2a7)](_0x309557(0x1bf));_0x3184ae=_0x309557(0x2b7)+_0x2309b0;}}if(!_0x3184ae&&_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)]?.['auth']?.[_0x309557(0x2c9)]&&Array[_0x309557(0x1b6)](_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)][_0x309557(0x1f1)][_0x309557(0x2c9)])&&_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)][_0x309557(0x1f1)][_0x309557(0x2c9)][_0x309557(0x283)]>0x0){const _0x256b14=_0x1c6ff4[_0x309557(0x27e)][_0x309557(0x1f7)]['auth'][_0x309557(0x2c9)];if(_0x256b14[0x0][_0x309557(0x226)]&&_0x256b14[0x0]['password']){const _0x2acb04=Buffer[_0x309557(0x26b)](_0x256b14[0x0][_0x309557(0x226)]+':'+_0x256b14[0x0][_0x309557(0x2c6)])[_0x309557(0x2a7)]('base64');_0x3184ae=_0x309557(0x275)+_0x2acb04;}}}let _0x134e4c='';for(let _0x1bf604=0x0;_0x1bf604<_0x1c6ff4['logger']['transports'][_0x309557(0x283)];_0x1bf604++){if(_0x1c6ff4['logger']['transports'][_0x1bf604]['name']===_0x309557(0x2bd)){_0x134e4c=_0x1c6ff4[_0x309557(0x209)][_0x309557(0x1fd)][_0x1bf604]['level'];break;}}const _0x29f29d=''+(_0x134e4c===_0x309557(0x24f)?'\x0a':''),_0x1a80c6=async(_0x2bf9f4,_0x51944c)=>{const _0x1c1576=_0x309557,_0x3b81d8=_0x46b9da[_0x2bf9f4][_0x1c1576(0x27e)]?.['nats']?.[_0x1c1576(0x21b)];let _0x5bdafc;try{_0x5bdafc=await a0_0x2d222d(_0x51944c);if(_0x5bdafc['info'][_0x1c1576(0x201)]!==_0x1c1576(0x1ff)){_0x5bdafc[_0x1c1576(0x22a)]();return;}_0x46b9da[_0x2bf9f4]['nc']=_0x5bdafc,_0x535678(_0x2bf9f4,_0x5bdafc),_0x5b9f53(_0x2bf9f4,_0x5bdafc);}catch(_0x2feafe){_0x1c6ff4[_0x1c1576(0x209)][_0x1c1576(0x2d3)](_0x1c6ff4[_0x1c1576(0x2be)]+'['+_0x1c6ff4[_0x1c1576(0x292)]+']\x20subscriber['+_0x2bf9f4+']['+_0x3b81d8+_0x1c1576(0x254)+_0x2feafe['message']+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x51944c[_0x1c1576(0x1cb)]=!![];try{_0x5bdafc=await a0_0x2d222d(_0x51944c);if(_0x5bdafc[_0x1c1576(0x2d8)][_0x1c1576(0x201)]!=='SCIM\x20Stream'){_0x5bdafc[_0x1c1576(0x22a)]();return;}_0x46b9da[_0x2bf9f4]['nc']=_0x5bdafc,_0x535678(_0x2bf9f4,_0x5bdafc),_0x5b9f53(_0x2bf9f4,_0x5bdafc);}catch(_0x3c6319){_0x1c6ff4['logger']['error'](_0x1c6ff4[_0x1c1576(0x2be)]+'['+_0x1c6ff4[_0x1c1576(0x292)]+_0x1c1576(0x2a8)+_0x2bf9f4+']['+_0x3b81d8+']\x20connect\x20error:\x20'+_0x3c6319[_0x1c1576(0x2a9)]);return;}}_0x1c6ff4[_0x1c1576(0x209)][_0x1c1576(0x24f)](_0x1c6ff4[_0x1c1576(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x1c1576(0x2a8)+_0x2bf9f4+']['+_0x3b81d8+_0x1c1576(0x1cf)+(_0x51944c['tls']['ca']?_0x1c1576(0x2a3):'')+'\x20'+_0x5bdafc[_0x1c1576(0x256)]()),_0x5bdafc[_0x1c1576(0x2c0)]()['then'](_0x1a163c=>{const _0x3de332=_0x1c1576;_0x1a163c&&_0x1c6ff4[_0x3de332(0x209)][_0x3de332(0x2d3)](_0x1c6ff4[_0x3de332(0x2be)]+'['+_0x1c6ff4[_0x3de332(0x292)]+_0x3de332(0x2a8)+_0x2bf9f4+']['+_0x3b81d8+_0x3de332(0x293)+_0x1a163c[_0x3de332(0x2a9)]);});};this['add']=async(_0x4ea94b,_0x5e4d7e)=>{const _0x3f8690=_0x309557;if(!_0x5e4d7e?.[_0x3f8690(0x26c)]){_0x1c6ff4[_0x3f8690(0x209)][_0x3f8690(0x2d3)](_0x1c6ff4[_0x3f8690(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x3f8690(0x2a8)+_0x4ea94b+_0x3f8690(0x1c7));return;}if(!_0x5e4d7e?.[_0x3f8690(0x26c)]?.[_0x3f8690(0x291)]){_0x1c6ff4['logger'][_0x3f8690(0x2d3)](_0x1c6ff4[_0x3f8690(0x2be)]+'['+_0x1c6ff4[_0x3f8690(0x292)]+_0x3f8690(0x2a8)+_0x4ea94b+_0x3f8690(0x2bc));return;}if(!_0x5e4d7e?.[_0x3f8690(0x26c)]?.[_0x3f8690(0x21b)]){_0x1c6ff4[_0x3f8690(0x209)][_0x3f8690(0x2d3)](_0x1c6ff4['gwName']+'['+_0x1c6ff4['pluginName']+_0x3f8690(0x2a8)+_0x4ea94b+_0x3f8690(0x200));return;}if(!_0x5e4d7e?.[_0x3f8690(0x284)]?.['ca']){_0x1c6ff4[_0x3f8690(0x209)][_0x3f8690(0x2d3)](_0x1c6ff4[_0x3f8690(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x3f8690(0x2a8)+_0x4ea94b+_0x3f8690(0x27d));return;}if(!_0x5e4d7e['baseUrls']||!Array[_0x3f8690(0x1b6)](_0x5e4d7e[_0x3f8690(0x1c4)])||_0x5e4d7e[_0x3f8690(0x1c4)][_0x3f8690(0x283)]<0x1){_0x1c6ff4[_0x3f8690(0x209)]['error'](_0x1c6ff4['gwName']+'['+_0x1c6ff4[_0x3f8690(0x292)]+']\x20subscriber['+_0x4ea94b+_0x3f8690(0x29a));return;}if(!_0x5e4d7e[_0x3f8690(0x2af)]){const _0x4fcc45=_0x5e4d7e?.[_0x3f8690(0x26c)]?.[_0x3f8690(0x21b)][_0x3f8690(0x1e1)]();if(_0x4fcc45[_0x3f8690(0x262)](_0x3f8690(0x259)))_0x5e4d7e[_0x3f8690(0x2af)]=!![];}const _0xf07295={};try{let _0x27735f=a0_0x5d9708[_0x3f8690(0x265)](_0x1c6ff4[_0x3f8690(0x2b1)],_0x3f8690(0x282),_0x5e4d7e?.[_0x3f8690(0x284)]?.['ca']||_0x3f8690(0x23a));(_0x5e4d7e?.[_0x3f8690(0x284)]?.['ca']?.[_0x3f8690(0x262)]('/')||_0x5e4d7e?.[_0x3f8690(0x284)]?.['ca']?.[_0x3f8690(0x23d)]('\x5c'))&&(_0x27735f=_0x5e4d7e[_0x3f8690(0x284)]['ca']),_0xf07295['ca']=[a0_0x42a5b2[_0x3f8690(0x21d)](_0x27735f)],_0xf07295[_0x3f8690(0x1c9)]=!![];}catch(_0x41acec){_0x1c6ff4['logger'][_0x3f8690(0x2d3)](_0x1c6ff4[_0x3f8690(0x2be)]+'['+_0x1c6ff4[_0x3f8690(0x292)]+_0x3f8690(0x2a8)+_0x4ea94b+_0x3f8690(0x1fb)+_0x41acec[_0x3f8690(0x2a9)]);return;}const _0x2b36f3={},_0x458208=new TextEncoder()[_0x3f8690(0x2cc)](_0x5e4d7e?.[_0x3f8690(0x26c)]?.[_0x3f8690(0x22b)]),_0x17889b=_0x5e4d7e?.[_0x3f8690(0x26c)]?.['jwt'];_0x2b36f3[_0x3f8690(0x2ad)]=jwtAuthenticator(_0x17889b,_0x458208),_0x2b36f3['servers']=_0x5e4d7e[_0x3f8690(0x1c4)],_0x2b36f3[_0x3f8690(0x2a3)]=_0xf07295,_0x2b36f3['waitOnFirstConnect']=![],_0x2b36f3[_0x3f8690(0x278)]=!![],_0x2b36f3[_0x3f8690(0x277)]=0x3e8*0xa,_0x2b36f3[_0x3f8690(0x2b5)]=-0x1,_0x2b36f3['pingInterval']=0x2*0x3c*0x3e8,_0x2b36f3[_0x3f8690(0x1ec)]=0x5,_0x2b36f3[_0x3f8690(0x24f)]=![],_0x46b9da[_0x4ea94b]={},_0x46b9da[_0x4ea94b]['config']=_0x5e4d7e,_0x46b9da[_0x4ea94b]['nc']=undefined,_0x46b9da[_0x4ea94b]['sub']=undefined,_0x1a80c6(_0x4ea94b,_0x2b36f3);};const _0x5b9f53=async(_0x145816,_0x24cb52)=>{const _0x2e6485=_0x309557,_0x1dd1fa=_0x46b9da[_0x145816]['config'],_0x21440c=_0x1dd1fa?.[_0x2e6485(0x26c)]?.[_0x2e6485(0x21b)];if(!_0x24cb52){_0x1c6ff4[_0x2e6485(0x209)][_0x2e6485(0x2d3)](_0x1c6ff4['gwName']+'['+_0x1c6ff4[_0x2e6485(0x292)]+_0x2e6485(0x2a8)+_0x145816+']['+_0x21440c+_0x2e6485(0x28c));return;}const _0xb01e09=async(_0x216019,_0x32d198)=>{const _0x572eb0=_0x2e6485;try{_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d8)](_0x216019+'\x20handling\x20message:\x20'+_0x32d198);let _0x225deb;try{if(_0x1dd1fa[_0x572eb0(0x289)]&&Array[_0x572eb0(0x1b6)](_0x1dd1fa['replaceDomains']))for(let _0x261d0f=0x0;_0x261d0f<_0x1dd1fa[_0x572eb0(0x289)][_0x572eb0(0x283)];_0x261d0f++){const _0x28d152=_0x1dd1fa[_0x572eb0(0x289)][_0x261d0f];if(!_0x28d152[_0x572eb0(0x26b)]||!_0x28d152['from'][_0x572eb0(0x23d)]('.')||!_0x28d152['to']||!_0x28d152['to'][_0x572eb0(0x23d)]('.'))continue;const _0x59fcef=new RegExp('@'+_0x28d152[_0x572eb0(0x26b)]+'\x22','gi');_0x32d198=_0x32d198[_0x572eb0(0x1b4)](_0x59fcef,'@'+_0x28d152['to']+'\x22');}_0x225deb=JSON[_0x572eb0(0x279)](_0x32d198);}catch(_0x1b8edf){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x229)+_0x1b8edf[_0x572eb0(0x2a9)]+'\x20message:\x20'+_0x32d198),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}const _0x450d76=_0x225deb[_0x572eb0(0x20e)];if(!_0x450d76){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x217)+JSON[_0x572eb0(0x23b)](_0x225deb)),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}if(!_0x450d76[_0x572eb0(0x1d6)]){_0x1c6ff4['logger']['error'](_0x216019+'\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20'+JSON[_0x572eb0(0x23b)](_0x225deb)),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}delete _0x450d76[_0x572eb0(0x2bf)];let _0x19f06f;_0x450d76['id']&&(_0x19f06f=_0x450d76['id'],delete _0x450d76['id']);let _0x31bca4;_0x450d76['onCreate']&&(_0x31bca4=a0_0xfd4a34[_0x572eb0(0x2c7)](_0x450d76['onCreate']),delete _0x450d76[_0x572eb0(0x232)]);await _0xd83f5a(_0x145816,_0x450d76);const _0x42e92a=_0x450d76[_0x572eb0(0x1d6)];let _0x4a36f9,_0x529564;try{_0x4a36f9=await _0x1d3f95(_0x145816,_0x572eb0(0x1d6),_0x42e92a);}catch(_0x5e9089){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x1ef)+_0x5e9089['message']),_0x1c6ff4['logger']['debug'](_0x216019+_0x572eb0(0x27c)+_0x29f29d);const _0xa89f64=[_0x572eb0(0x23f),_0x572eb0(0x246),_0x572eb0(0x290),_0x572eb0(0x294),_0x572eb0(0x212),_0x572eb0(0x271)];for(const _0x1cd5b7 in _0xa89f64){if(_0x5e9089[_0x572eb0(0x2a9)][_0x572eb0(0x23d)](_0x1cd5b7))return!![];}return;}if(!_0x1dd1fa['skipConvertRolesToGroups']){let _0x9fa9a8=![];if(_0x225deb[_0x572eb0(0x2a0)]&&Array[_0x572eb0(0x1b6)](_0x225deb['Operations']))for(let _0x52e939=0x0;_0x52e939<_0x225deb['Operations'][_0x572eb0(0x283)];_0x52e939++){const _0x4671bf=_0x225deb[_0x572eb0(0x2a0)][_0x52e939];_0x4671bf[_0x572eb0(0x25e)][_0x572eb0(0x262)](_0x572eb0(0x281))&&(_0x4671bf[_0x572eb0(0x25e)]=_0x572eb0(0x2d2),Array['isArray'](_0x4671bf[_0x572eb0(0x1dd)])?(_0x4671bf[_0x572eb0(0x1dd)][0x0]['id']=_0x4671bf['value'][0x0][_0x572eb0(0x1dd)],_0x4671bf[_0x572eb0(0x1dd)][0x0][_0x572eb0(0x1db)]=_0x4671bf['value'][0x0][_0x572eb0(0x249)]+_0x572eb0(0x235)+_0x4671bf['value'][0x0][_0x572eb0(0x1dd)],delete _0x4671bf[_0x572eb0(0x1dd)][0x0][_0x572eb0(0x1dd)],delete _0x4671bf[_0x572eb0(0x1dd)][0x0][_0x572eb0(0x249)]):_0x4671bf['value']=[{'id':_0x4671bf[_0x572eb0(0x1dd)],'display':_0x4671bf[_0x572eb0(0x1dd)]}],delete _0x4671bf[_0x572eb0(0x211)],_0x9fa9a8=!![]);}if(_0x450d76[_0x572eb0(0x281)]&&Array[_0x572eb0(0x1b6)](_0x450d76[_0x572eb0(0x281)])&&_0x450d76[_0x572eb0(0x281)][_0x572eb0(0x283)]>0x0){if(!_0x450d76['groups'])_0x450d76[_0x572eb0(0x2d2)]=[];if(!Array['isArray'](_0x450d76[_0x572eb0(0x2d2)]))_0x450d76[_0x572eb0(0x2d2)]=[];for(let _0x342050=0x0;_0x342050<_0x450d76[_0x572eb0(0x281)][_0x572eb0(0x283)];_0x342050++){const _0x298751={},_0x3b4297=_0x450d76[_0x572eb0(0x281)][_0x342050];_0x298751['value']=_0x3b4297[_0x572eb0(0x1dd)],_0x298751[_0x572eb0(0x1db)]=_0x3b4297[_0x572eb0(0x249)]+_0x572eb0(0x235)+_0x3b4297[_0x572eb0(0x1db)],_0x450d76[_0x572eb0(0x2d2)]['push'](_0x298751);}delete _0x450d76[_0x572eb0(0x281)],_0x9fa9a8=!![];}if(_0x9fa9a8)_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x1e7)+JSON[_0x572eb0(0x23b)](_0x225deb));}if(!_0x4a36f9){if(_0x225deb[_0x572eb0(0x2bb)]===_0x572eb0(0x1da)){_0x1c6ff4['logger'][_0x572eb0(0x24f)](_0x216019+'\x20Delete\x20User\x20userName='+_0x42e92a+'\x20message:\x20user\x20does\x20not\x20exist'),_0x1c6ff4['logger'][_0x572eb0(0x24f)](_0x216019+'\x20done'+_0x29f29d);return;}if(_0x1dd1fa[_0x572eb0(0x248)]&&_0x1dd1fa[_0x572eb0(0x248)]===!![]){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x2d6)+_0x42e92a+'\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true'),_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}if(Object[_0x572eb0(0x227)]['hasOwnProperty'][_0x572eb0(0x2b3)](_0x450d76,_0x572eb0(0x233))){if(typeof _0x450d76['active']===_0x572eb0(0x298)){const _0x2b384a=_0x450d76[_0x572eb0(0x233)]['toLowerCase']();if(_0x2b384a===_0x572eb0(0x280))_0x450d76[_0x572eb0(0x233)]=!![];else{if(_0x2b384a===_0x572eb0(0x1e0))_0x450d76[_0x572eb0(0x233)]=![];}}if(_0x450d76[_0x572eb0(0x233)]===![]){_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x2d6)+_0x42e92a+_0x572eb0(0x247)),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}}_0x1c6ff4['logger']['debug'](_0x216019+_0x572eb0(0x26a)+_0x42e92a);const _0x3531f7=a0_0xfd4a34[_0x572eb0(0x2c7)](_0x450d76);try{delete _0x3531f7['groups'];!_0x3531f7['password']&&_0x1dd1fa['generateUserPassword']&&_0x1dd1fa[_0x572eb0(0x2c5)]===!![]&&(_0x3531f7['password']=a0_0xfd4a34[_0x572eb0(0x285)](0xf));if(_0x31bca4||_0x19f06f){if(_0x31bca4)for(const _0x5f2f09 in _0x31bca4){_0x3531f7[_0x5f2f09]=_0x31bca4[_0x5f2f09];}if(_0x19f06f)_0x3531f7['id']=_0x19f06f;await _0xd83f5a(_0x145816,_0x3531f7);}await _0x1283d0(_0x145816,_0x3531f7),_0x450d76[_0x572eb0(0x2d2)]&&Array[_0x572eb0(0x1b6)](_0x450d76[_0x572eb0(0x2d2)])&&_0x450d76[_0x572eb0(0x2d2)][_0x572eb0(0x283)]>0x0&&(_0x529564=await _0x1d3f95(_0x145816,_0x572eb0(0x1d6),_0x42e92a));}catch(_0x520628){_0x1c6ff4['logger'][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x215)+JSON[_0x572eb0(0x23b)](_0x3531f7)+'\x20error:\x20'+_0x520628[_0x572eb0(0x2a9)]+'}'),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}}if(_0x4a36f9||_0x529564){if(_0x225deb[_0x572eb0(0x2bb)]==='deleteUser'){if(_0x1dd1fa[_0x572eb0(0x248)]&&_0x1dd1fa[_0x572eb0(0x248)]===!![]){_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x1d4)+_0x4a36f9+_0x572eb0(0x273)),_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+'\x20done'+_0x29f29d);return;}_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+'\x20Delete\x20User\x20id='+_0x4a36f9);try{await _0x50fce0(_0x145816,_0x4a36f9);}catch(_0x2d048a){_0x1c6ff4[_0x572eb0(0x209)]['error'](_0x216019+_0x572eb0(0x1d4)+_0x4a36f9+_0x572eb0(0x1dc)+_0x2d048a[_0x572eb0(0x2a9)]+'}'),_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}}else{if(_0x529564)_0x4a36f9=_0x529564;_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x1f9)+_0x4a36f9);try{await _0x52d6c3(_0x572eb0(0x2d9),_0x145816,_0x4a36f9,_0x450d76,_0x1dd1fa['usePutSoftSync']);}catch(_0xce6cf2){_0x1c6ff4['logger'][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x1f9)+_0x4a36f9+_0x572eb0(0x1dc)+_0xce6cf2[_0x572eb0(0x2a9)]),_0x1c6ff4[_0x572eb0(0x209)]['debug'](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}if(_0x1dd1fa[_0x572eb0(0x2af)]){const [_0xc9534,_0x3a3cb8]=a0_0x34c478[_0x572eb0(0x267)]({'Operations':_0x225deb[_0x572eb0(0x2a0)]});if(_0x3a3cb8){_0x1c6ff4['logger'][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x1f9)+_0x4a36f9+_0x572eb0(0x255)+_0x3a3cb8['message']),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+'\x20done'+_0x29f29d);return;}const _0x516dc8=[];if(_0xc9534[_0x572eb0(0x281)]&&Array['isArray'](_0xc9534[_0x572eb0(0x281)]))for(let _0x27a2b6=0x0;_0x27a2b6<_0xc9534[_0x572eb0(0x281)][_0x572eb0(0x283)];_0x27a2b6++){_0xc9534['roles'][_0x27a2b6][_0x572eb0(0x2ce)]&&_0xc9534[_0x572eb0(0x281)][_0x27a2b6]['operation']===_0x572eb0(0x242)&&_0x516dc8[_0x572eb0(0x296)](_0xc9534[_0x572eb0(0x281)][_0x27a2b6]);}if(_0x516dc8[_0x572eb0(0x283)]>0x0)try{await _0x1c6ff4[_0x572eb0(0x213)](_0x145816,_0x4a36f9,{'roles':_0x516dc8});}catch(_0x27cd15){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x1f9)+_0x4a36f9+_0x572eb0(0x20b)+_0x27cd15[_0x572eb0(0x2a9)]);}const _0x567531=[];if(_0xc9534[_0x572eb0(0x2d2)]&&Array[_0x572eb0(0x1b6)](_0xc9534[_0x572eb0(0x2d2)]))for(let _0x1fbe97=0x0;_0x1fbe97<_0xc9534[_0x572eb0(0x2d2)][_0x572eb0(0x283)];_0x1fbe97++){_0xc9534['groups'][_0x1fbe97][_0x572eb0(0x2ce)]&&_0xc9534[_0x572eb0(0x2d2)][_0x1fbe97][_0x572eb0(0x2ce)]===_0x572eb0(0x242)&&_0x567531['push'](_0xc9534['groups'][_0x1fbe97]);}if(_0x567531[_0x572eb0(0x283)]>0x0)for(let _0x2b407c=0x0;_0x2b407c<_0x567531[_0x572eb0(0x283)];_0x2b407c++){try{await _0x1c6ff4[_0x572eb0(0x28b)](_0x145816,_0x567531[_0x2b407c]['id'],{'members':[{'operation':_0x572eb0(0x242),'value':_0x4a36f9}]});}catch(_0x547890){_0x1c6ff4[_0x572eb0(0x209)]['error'](_0x216019+_0x572eb0(0x1f9)+_0x4a36f9+_0x572eb0(0x1ba)+_0x547890[_0x572eb0(0x2a9)]);}}}if(_0x1dd1fa[_0x572eb0(0x1c5)]&&_0x225deb[_0x572eb0(0x2bb)]===_0x572eb0(0x213)){if(_0x450d76[_0x572eb0(0x2d2)]&&Array[_0x572eb0(0x1b6)](_0x450d76[_0x572eb0(0x2d2)])&&_0x450d76[_0x572eb0(0x2d2)][_0x572eb0(0x283)]===0x0){if(_0x450d76[_0x572eb0(0x281)]&&Array[_0x572eb0(0x1b6)](_0x450d76['roles'])&&_0x450d76['roles'][_0x572eb0(0x283)]===0x0){if(_0x225deb[_0x572eb0(0x2a0)]&&Array['isArray'](_0x225deb[_0x572eb0(0x2a0)])&&_0x225deb['Operations'][_0x572eb0(0x283)]>0x0){let _0x40c423=![];for(let _0x47076d=0x0;_0x47076d<_0x225deb['Operations'][_0x572eb0(0x283)];_0x47076d++){const _0x47558a=_0x225deb[_0x572eb0(0x2a0)][_0x47076d];if(_0x47558a['op']===_0x572eb0(0x21f)){if(_0x47558a['path']){if(_0x47558a[_0x572eb0(0x25e)][_0x572eb0(0x262)](_0x572eb0(0x281))&&_0x47558a[_0x572eb0(0x211)]){_0x40c423=!![];break;}else{if(_0x47558a[_0x572eb0(0x25e)]===_0x572eb0(0x2d2)){_0x40c423=!![];break;}}}}}if(_0x40c423){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x1d4)+_0x4a36f9);try{await _0x50fce0(_0x145816,_0x4a36f9);}catch(_0x31b6df){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x216019+_0x572eb0(0x1d4)+_0x4a36f9+_0x572eb0(0x1dc)+_0x31b6df[_0x572eb0(0x2a9)]+'}'),_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);return;}}}}}}}}_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x24f)](_0x216019+_0x572eb0(0x27c)+_0x29f29d);}catch(_0x5daea0){_0x1c6ff4[_0x572eb0(0x209)][_0x572eb0(0x2d3)](_0x1c6ff4[_0x572eb0(0x2be)]+'['+_0x1c6ff4[_0x572eb0(0x292)]+']\x20subscriber['+_0x145816+']['+_0x21440c+_0x572eb0(0x1b9)+_0x5daea0[_0x572eb0(0x2a9)]+_0x572eb0(0x20c)+_0x29f29d);}},_0x188f34=jetstream(_0x24cb52),_0xbf3a46=(_0x2e6485(0x1d3)+_0x1c6ff4[_0x2e6485(0x292)]+'_'+_0x145816)[_0x2e6485(0x208)]('*','#')[_0x2e6485(0x208)]('>','##')[_0x2e6485(0x208)]('.','_'),_0x287f45=_0x21440c['split']('.')[0x0][_0x2e6485(0x1e1)]()==='GW',_0x103bd9=async()=>{const _0x55854f=_0x2e6485;try{let _0x4b8f18;const _0x47e399=''+_0x1dd1fa?.['nats']?.[_0x55854f(0x291)],_0x245d95=await jetstreamManager(_0x24cb52),_0x18bf16=async()=>{const _0x36ade5=_0x55854f;let _0x2e5581;try{_0x2e5581=await _0x188f34[_0x36ade5(0x288)][_0x36ade5(0x1d7)](_0x47e399,_0xbf3a46);}catch(_0x588d88){const _0x4437c4={'durable_name':_0xbf3a46,'deliver_policy':DeliverPolicy[_0x36ade5(0x2cd)],'ack_policy':AckPolicy[_0x36ade5(0x2a4)],'filter_subject':_0x21440c};await _0x245d95['consumers'][_0x36ade5(0x1b3)](_0x47e399,_0x4437c4),_0x2e5581=await _0x188f34[_0x36ade5(0x288)][_0x36ade5(0x1d7)](_0x47e399,_0xbf3a46);}if(_0x2e5581?.[_0x36ade5(0x2aa)]?.['config']?.['deliver_policy']!==_0x36ade5(0x228))throw new Error(_0x36ade5(0x221));_0x2e5581?.[_0x36ade5(0x2aa)]?.[_0x36ade5(0x27e)]?.[_0x36ade5(0x2c1)]!==_0x21440c&&(await _0x245d95[_0x36ade5(0x288)][_0x36ade5(0x205)](_0x47e399,_0xbf3a46,{'filter_subject':_0x21440c}),_0x2e5581=await _0x188f34[_0x36ade5(0x288)]['get'](_0x47e399,_0xbf3a46)),_0x4b8f18=await _0x2e5581[_0x36ade5(0x1eb)]({'max_messages':0x64}),_0x46aaac(_0x4b8f18);},_0x46aaac=async _0x161210=>{const _0xbb1a3e=_0x55854f;for await(const _0x6b3615 of await _0x161210[_0xbb1a3e(0x1d0)]()){switch(_0x6b3615[_0xbb1a3e(0x249)]){case _0xbb1a3e(0x1c2):_0x1c6ff4[_0xbb1a3e(0x209)][_0xbb1a3e(0x2d8)](_0x1c6ff4[_0xbb1a3e(0x2be)]+'['+_0x1c6ff4['pluginName']+_0xbb1a3e(0x2a8)+_0x145816+']['+_0x21440c+_0xbb1a3e(0x23c)+_0x6b3615[_0xbb1a3e(0x249)]),_0x18bf16();return;}}};await _0x18bf16();let _0x398517=-0x1;do{for await(const _0x3e1e92 of _0x4b8f18){if(!_0x3e1e92[_0x55854f(0x1e2)]||!_0x3e1e92[_0x55854f(0x1e2)][_0x55854f(0x1d7)](_0x55854f(0x26e))){_0x3e1e92[_0x55854f(0x237)]();continue;}_0x398517=_0x4b8f18[_0x55854f(0x2ab)]();const _0x25a7b2=_0x1c6ff4['gwName']+'['+_0x1c6ff4['pluginName']+_0x55854f(0x2a8)+_0x145816+']['+_0x3e1e92[_0x55854f(0x21b)]+']['+_0x398517+']['+(_0x3e1e92[_0x55854f(0x1e2)]?_0x3e1e92[_0x55854f(0x1e2)][_0x55854f(0x1d7)]('Msg-Id'):'')+']',_0x50108f=_0x3e1e92['string'](),_0x5780ba=await _0xb01e09(_0x25a7b2,_0x50108f);if(!_0x5780ba||_0x5780ba!==!![])_0x3e1e92[_0x55854f(0x237)]();else _0x1c6ff4[_0x55854f(0x209)][_0x55854f(0x2d3)](_0x25a7b2+'\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected');if(_0x398517<0x1)break;}}while(_0x398517===0x0);}catch(_0x4ffb40){_0x1c6ff4[_0x55854f(0x209)][_0x55854f(0x2d3)](_0x1c6ff4[_0x55854f(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x55854f(0x2a8)+_0x145816+']['+_0x21440c+_0x55854f(0x2cb)+_0x4ffb40['message']);}},_0x4ca244=async()=>{const _0x293742=_0x2e6485,_0x3df257=_0x24cb52[_0x293742(0x24a)](_0x21440c,{'max':0x64});for await(const _0xa8a8fc of _0x3df257){const _0x31464c=_0xa8a8fc[_0x293742(0x1e2)][_0x293742(0x1d7)](_0x293742(0x26e));if(!_0xa8a8fc[_0x293742(0x1e2)]||!_0x31464c)continue;const _0x55cb4f=_0x1c6ff4['gwName']+'['+_0x1c6ff4[_0x293742(0x292)]+_0x293742(0x2a8)+_0x145816+']['+_0xa8a8fc[_0x293742(0x21b)]+']['+(_0xa8a8fc['headers']?_0x31464c:'')+']';_0x1c6ff4['logger'][_0x293742(0x24f)](_0x55cb4f+_0x293742(0x1c3));const _0x1412c5={'func':'','id':'','obj':''};let _0x4fab57;try{try{_0x4fab57=JSON[_0x293742(0x279)](_0xa8a8fc['string']());}catch(_0x41628c){const _0xebfa63=_0x293742(0x29e);_0x1c6ff4[_0x293742(0x209)][_0x293742(0x2d3)](_0x1c6ff4['gwName']+'['+_0x1c6ff4['pluginName']+_0x293742(0x2a8)+_0x145816+']['+_0x21440c+']\x20'+_0xebfa63+':\x20'+_0xa8a8fc[_0x293742(0x298)]());throw new Error(_0xebfa63);}const _0x525a3a=_0x4fab57[_0x293742(0x25a)];if(_0x525a3a?.[_0x293742(0x268)]?.['id'])_0x1412c5['id']=_0x525a3a[_0x293742(0x268)]['id'];if(_0x525a3a?.[_0x293742(0x297)]?.[_0x293742(0x2b0)])_0x1412c5[_0x293742(0x1df)]=a0_0xfd4a34['copyObj'](_0x525a3a['request'][_0x293742(0x2b0)]);if(_0x525a3a?.[_0x293742(0x297)]?.[_0x293742(0x1e2)]?.['authorization']){const _0x3e9617=_0x525a3a[_0x293742(0x297)]['headers']['authorization'];if(_0x3e9617)_0x525a3a[_0x293742(0x297)][_0x293742(0x1e2)][_0x293742(0x1de)]=a0_0xfd4a34[_0x293742(0x2d7)](_0x3e9617,_0x31464c);}if(_0x525a3a?.[_0x293742(0x1ea)]?.[_0x293742(0x1e2)]?.[_0x293742(0x1de)]){const _0xac0c72=_0x525a3a[_0x293742(0x1ea)][_0x293742(0x1e2)]['authorization'];if(_0xac0c72)_0x525a3a[_0x293742(0x1ea)][_0x293742(0x1e2)][_0x293742(0x1de)]=a0_0xfd4a34['getEncrypted'](_0xac0c72,_0x31464c);}if(_0x1c6ff4[_0x293742(0x27e)][_0x293742(0x1f7)][_0x293742(0x286)])await _0x2739a3(_0x525a3a);else{const _0x5c3063=_0x525a3a?.['routeObj']?.[_0x293742(0x21a)]+'\x20'+_0x525a3a?.[_0x293742(0x268)]?.['handle'];_0x1412c5['func']=_0x5c3063;switch(_0x5c3063){case _0x293742(0x1e8):case _0x293742(0x1b8):case'GET\x20serviceplans':if(_0x525a3a[_0x293742(0x268)]['id'])await _0x5d1d0b[_0x293742(0x28f)](_0x525a3a);else await _0x5d1d0b['getHandler'](_0x525a3a);break;case _0x293742(0x22e):await _0x5d1d0b['getApiHandler'](_0x525a3a);break;case _0x293742(0x1fc):await _0x5d1d0b[_0x293742(0x20a)](_0x525a3a);break;case _0x293742(0x25b):case'GET\x20serviceproviderconfigs':await _0x5d1d0b[_0x293742(0x21c)](_0x525a3a);break;case'PATCH\x20users':case'PATCH\x20groups':await _0x5d1d0b[_0x293742(0x270)](_0x525a3a);break;case _0x293742(0x29c):await _0x5d1d0b[_0x293742(0x238)](_0x525a3a);break;case _0x293742(0x2c2):case _0x293742(0x2ac):await _0x5d1d0b[_0x293742(0x272)](_0x525a3a);break;case _0x293742(0x244):await _0x5d1d0b[_0x293742(0x1d8)](_0x525a3a);break;case _0x293742(0x231):case'POST\x20groups':await _0x5d1d0b['postHandler'](_0x525a3a);break;case _0x293742(0x28a):await _0x5d1d0b[_0x293742(0x253)](_0x525a3a);break;case _0x293742(0x222):case _0x293742(0x1d1):await _0x5d1d0b[_0x293742(0x1c8)](_0x525a3a);break;case _0x293742(0x1f2):await _0x5d1d0b['deleteApiHandler'](_0x525a3a);break;default:_0x525a3a['response']=new Response(_0x293742(0x1b7),{'status':0x194});}}if(!_0x525a3a[_0x293742(0x2a6)])_0x525a3a[_0x293742(0x2a6)]=null;const _0x9de961=JSON[_0x293742(0x23b)](_0x525a3a[_0x293742(0x2a6)]);_0xa8a8fc[_0x293742(0x2c4)](_0x9de961),_0x1c6ff4[_0x293742(0x209)][_0x293742(0x2d8)](_0x55cb4f+'\x20message\x20handled:\x20'+_0x1412c5[_0x293742(0x276)]+_0x293742(0x24b)+(_0x1412c5['obj']?JSON[_0x293742(0x23b)](_0x1412c5['obj']):'')+_0x293742(0x1ce)+(_0x1412c5['id']?_0x1412c5['id']:'')+'}\x20message\x20response:\x20'+_0x9de961+_0x29f29d);}catch(_0x60c984){const _0x45f8fc='{\x22error\x22:\x22'+_0x60c984['message']+_0x293742(0x230)+_0x60c984['name']+'\x22}';_0xa8a8fc[_0x293742(0x2c4)](_0x45f8fc),_0x1c6ff4['logger'][_0x293742(0x2d8)]((_0x55cb4f||'')+_0x293742(0x2a1)+_0x1412c5[_0x293742(0x276)]+',\x20obj='+(_0x1412c5[_0x293742(0x1df)]?JSON[_0x293742(0x23b)](_0x1412c5['obj']):'')+_0x293742(0x1ce)+(_0x1412c5['id']?_0x1412c5['id']:'')+_0x293742(0x206)+_0x45f8fc+_0x29f29d);}}};if(_0x287f45)_0x4ca244();else _0x103bd9();},_0x535678=async(_0x52cda9,_0x1c6dc0)=>{const _0x5f5232=_0x309557,_0x554994=_0x46b9da[_0x52cda9][_0x5f5232(0x27e)]?.['nats']?.[_0x5f5232(0x21b)];let _0x40f989=0x0;for await(const _0x14a8bb of _0x1c6dc0['status']()){switch(_0x14a8bb[_0x5f5232(0x249)]){case'disconnect':_0x1c6ff4[_0x5f5232(0x209)]['error'](_0x1c6ff4[_0x5f5232(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x5f5232(0x2a8)+_0x52cda9+']['+_0x554994+_0x5f5232(0x29d)+_0x14a8bb[_0x5f5232(0x21e)]+'\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available'),_0x40f989=0x0;break;case _0x5f5232(0x278):_0x1c6ff4[_0x5f5232(0x209)][_0x5f5232(0x2d8)](_0x1c6ff4[_0x5f5232(0x2be)]+'['+_0x1c6ff4[_0x5f5232(0x292)]+']\x20subscriber['+_0x52cda9+']['+_0x554994+_0x5f5232(0x261)+_0x14a8bb['data']);break;case _0x5f5232(0x2d3):_0x1c6ff4[_0x5f5232(0x209)][_0x5f5232(0x2d3)](_0x1c6ff4[_0x5f5232(0x2be)]+'['+_0x1c6ff4[_0x5f5232(0x292)]+_0x5f5232(0x2a8)+_0x52cda9+']['+_0x554994+_0x5f5232(0x204)+_0x14a8bb['data']);break;case _0x5f5232(0x2da):_0x40f989+=0x1;_0x40f989%0x1e===0x0&&_0x1c6ff4['logger']['debug'](_0x1c6ff4[_0x5f5232(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x5f5232(0x2a8)+_0x52cda9+']['+_0x554994+']\x20client\x20is\x20attempting\x20to\x20reconnect\x20'+_0x14a8bb['data']+_0x5f5232(0x2ca)+_0x40f989+')');break;case'staleConnection':_0x1c6ff4[_0x5f5232(0x209)][_0x5f5232(0x24f)](_0x1c6ff4[_0x5f5232(0x2be)]+'['+_0x1c6ff4[_0x5f5232(0x292)]+_0x5f5232(0x2a8)+_0x52cda9+']['+_0x554994+_0x5f5232(0x1d5)+_0x14a8bb[_0x5f5232(0x21e)]);break;}}};process['on'](_0x309557(0x2d0),async()=>{const _0x5d9be3=_0x309557;for(const _0x31abc0 in _0x46b9da){_0x46b9da[_0x31abc0]['nc']&&!_0x46b9da[_0x31abc0]['nc'][_0x5d9be3(0x219)]()&&await _0x46b9da[_0x31abc0]['nc'][_0x5d9be3(0x22f)]();}}),process['on'](_0x309557(0x243),async()=>{const _0x7bee27=_0x309557;for(const _0x4f162c in _0x46b9da){_0x46b9da[_0x4f162c]['nc']&&!_0x46b9da[_0x4f162c]['nc'][_0x7bee27(0x219)]()&&await _0x46b9da[_0x4f162c]['nc'][_0x7bee27(0x22f)]();}});const _0x1d3f95=async(_0x50a596,_0x9b92bd,_0x311e0e)=>{const _0x8c63f6=_0x309557,_0x7bc73b={'attribute':_0x9b92bd,'operator':'eq','value':_0x311e0e,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x90e6e8=[_0x9b92bd];if(_0x9b92bd!=='id')_0x90e6e8[_0x8c63f6(0x296)]('id');try{const _0x3b753f=await _0x2626fe(_0x50a596,_0x7bc73b,_0x90e6e8);if(!_0x3b753f||!_0x3b753f[_0x8c63f6(0x24e)]||!Array[_0x8c63f6(0x1b6)](_0x3b753f['Resources']))throw new Error('getUsers()\x20getObj='+JSON['stringify'](_0x7bc73b)+'\x20error:\x20missing\x20result');if(_0x3b753f['Resources']['length']===0x0)return null;else{if(_0x3b753f[_0x8c63f6(0x24e)][_0x8c63f6(0x283)]>0x2)throw new Error('getUsers()\x20getObj='+JSON[_0x8c63f6(0x23b)](_0x7bc73b)+'\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}');else{const _0x66a98f=_0x3b753f['Resources'][0x0];if(!_0x66a98f['id'])throw new Error(_0x8c63f6(0x239)+JSON[_0x8c63f6(0x23b)](_0x7bc73b)+_0x8c63f6(0x216)+JSON[_0x8c63f6(0x23b)](_0x66a98f)+_0x8c63f6(0x2c3));return decodeURIComponent(_0x66a98f['id']);}}}catch(_0x866159){throw new Error(_0x8c63f6(0x239)+JSON[_0x8c63f6(0x23b)](_0x7bc73b)+_0x8c63f6(0x1dc)+_0x866159[_0x8c63f6(0x2a9)]+'}');}},_0x2626fe=async(_0x4526de,_0x24b82d,_0x1b03e3)=>{const _0x5c0885=_0x309557;if(!_0x28d126)return await _0x1c6ff4[_0x5c0885(0x1f6)](_0x4526de,_0x24b82d,_0x1b03e3);if(!_0x24b82d?.[_0x5c0885(0x1ed)]||_0x24b82d['operator']!=='eq')throw new Error(_0x5c0885(0x20d)+JSON['stringify'](_0x24b82d));if(_0x4526de===_0x5c0885(0x1e4))_0x4526de=undefined;let _0x4e0955=_0x4526de?'/'+_0x4526de+'/Users':_0x5c0885(0x25f);if(_0x24b82d['attribute']==='id'){_0x4e0955+='/'+_0x24b82d[_0x5c0885(0x1dd)];if(_0x1b03e3&&_0x1b03e3[_0x5c0885(0x283)]>0x0)_0x4e0955+=_0x5c0885(0x1bc)+_0x1b03e3[_0x5c0885(0x265)](',');}else{if(_0x24b82d[_0x5c0885(0x218)]===_0x5c0885(0x1d6)){_0x4e0955+=_0x5c0885(0x2d1)+_0x24b82d[_0x5c0885(0x1dd)]+'\x22';if(_0x1b03e3&&_0x1b03e3['length']>0x0)_0x4e0955+='&attributes='+_0x1b03e3['join'](',');}else{if(_0x24b82d[_0x5c0885(0x218)]==='externalId'){_0x4e0955+=_0x5c0885(0x207)+_0x24b82d[_0x5c0885(0x1dd)]+'\x22';if(_0x1b03e3&&_0x1b03e3['length']>0x0)_0x4e0955+='&attributes='+_0x1b03e3['join'](',');}else throw new Error(_0x5c0885(0x20d)+JSON[_0x5c0885(0x23b)](_0x24b82d));}}return await _0x2afd4f(_0x4526de,_0x5c0885(0x1e3),_0x4e0955);},_0x1283d0=async(_0x1030f3,_0x93c34c)=>{const _0x1032e3=_0x309557;if(!_0x28d126)return await _0x1c6ff4[_0x1032e3(0x224)](_0x1030f3,_0x93c34c);if(_0x1030f3==='undefined')_0x1030f3=undefined;const _0x4f72f6=_0x1030f3?'/'+_0x1030f3+'/Users':_0x1032e3(0x25f);return await _0x2afd4f(_0x1030f3,'POST',_0x4f72f6,_0x93c34c);},_0x52d6c3=async(_0x230181,_0x4aa24c,_0x189173,_0x2309e6,_0x22a07e)=>{const _0x41d40a=_0x309557;if(!_0x230181||_0x230181['toLowerCase']()!==_0x41d40a(0x25d))throw new Error('replaceUsrGrp()\x20error:\x20stream\x20replaceUsrGrp\x20must\x20be\x20type\x20\x22Users\x22');if(!_0x28d126)return await _0x1c6ff4[_0x41d40a(0x220)](_0x41d40a(0x2d9),_0x4aa24c,_0x189173,_0x2309e6,_0x22a07e);if(_0x4aa24c===_0x41d40a(0x1e4))_0x4aa24c=undefined;const _0x3d1c7c=_0x4aa24c?'/'+_0x4aa24c+'/Users/'+_0x189173:_0x41d40a(0x2ba)+_0x189173;return await _0x2afd4f(_0x4aa24c,'PUT',_0x3d1c7c,_0x2309e6);},_0x50fce0=async(_0x31a4b1,_0x4bef1d)=>{const _0x4cb3f2=_0x309557;!_0x28d126&&await _0x1c6ff4['deleteUser'](_0x31a4b1,_0x4bef1d);if(_0x31a4b1===_0x4cb3f2(0x1e4))_0x31a4b1=undefined;const _0xb82286=_0x31a4b1?'/'+_0x31a4b1+_0x4cb3f2(0x2ba)+_0x4bef1d:_0x4cb3f2(0x2ba)+_0x4bef1d;return await _0x2afd4f(_0x31a4b1,'DELETE',_0xb82286);},_0x3167f6=_0x166fdf=>{const _0x677062=_0x309557;if(!_0x166fdf||typeof _0x166fdf!=='string')return[null,null];_0x166fdf=_0x166fdf[_0x677062(0x1ca)]();const _0x1c95d3=_0x166fdf['indexOf']('(');if(_0x1c95d3<0x1)return[null,null];if(_0x166fdf['substring'](_0x166fdf[_0x677062(0x283)]-0x1)!==')')return[null,null];if(_0x3f2ed6(_0x166fdf,'(')!==_0x3f2ed6(_0x166fdf,')'))return[null,null];const _0x300d05=_0x166fdf[_0x677062(0x287)](0x0,_0x1c95d3),_0x5a9504=_0x166fdf[_0x677062(0x287)](_0x1c95d3+0x1,_0x166fdf['length']-0x1);let _0x270315=[];const _0x13921a=_0x5a9504['split'](',');let _0x3551bb='';for(let _0x34e3b7=0x0;_0x34e3b7<_0x13921a[_0x677062(0x283)];_0x34e3b7++){const _0x4d7c59=_0x3551bb?_0x3551bb+','+_0x13921a[_0x34e3b7]:_0x13921a[_0x34e3b7],_0x4d057e=_0x3f2ed6(_0x4d7c59,'('),_0x175ad6=_0x3f2ed6(_0x4d7c59,')');if(_0x4d057e===_0x175ad6)_0x270315[_0x677062(0x296)](_0x5de116(_0x4d7c59,'\x22')),_0x3551bb='';else{if(_0x3551bb)_0x3551bb+=','+_0x13921a[_0x34e3b7];else _0x3551bb+=_0x13921a[_0x34e3b7];}}if(_0x270315['length']===0x0)_0x270315=null;return[_0x300d05,_0x270315];};function _0x3f2ed6(_0x3a8ddf,_0x5349da){const _0x4b0ffa=_0x309557;let _0x4e459f=0x0;for(let _0x5ad7c6=0x0;_0x5ad7c6<_0x3a8ddf[_0x4b0ffa(0x283)];_0x5ad7c6++){_0x3a8ddf[_0x4b0ffa(0x266)](_0x5ad7c6)===_0x5349da&&(_0x4e459f+=0x1);}return _0x4e459f;}const _0x5de116=(_0x1577d6,_0x4367fe)=>{const _0x291bd2=_0x309557;if(typeof _0x1577d6!==_0x291bd2(0x298)||typeof _0x4367fe!=='string')return _0x1577d6;if(_0x1577d6['length']===0x1)return _0x1577d6;if(_0x4367fe['length']!==0x1)return _0x1577d6;return _0x1577d6=_0x1577d6['trim'](),_0x1577d6[_0x291bd2(0x287)](0x0,0x1)===_0x4367fe&&(_0x1577d6=_0x1577d6['substring'](0x1)),_0x1577d6[_0x291bd2(0x287)](_0x1577d6[_0x291bd2(0x283)]-0x1)===_0x4367fe&&(_0x1577d6=_0x1577d6[_0x291bd2(0x287)](0x0,_0x1577d6[_0x291bd2(0x283)]-0x1)),_0x1577d6;},_0x25a17c=async(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0xd3b695)=>{const _0xe60199=_0x309557;if(!_0x102d9a||!_0x3d5d8c||!_0xd3b695)return null;const [_0x151e07,_0x48fd35]=_0x3167f6(_0xd3b695);if(!_0x151e07||!_0x48fd35){const _0x5dd31e=_0xd3b695[_0xe60199(0x26f)]('(');if(_0x5dd31e[_0xe60199(0x283)]>0x1){const _0x42df9a=[_0xe60199(0x23e),_0xe60199(0x2b6),'firstn','elementnumber','join','replace',_0xe60199(0x263),_0xe60199(0x22d),'getuniquevalue'],_0x4b5746=_0x5dd31e[0x0][_0xe60199(0x28d)]();if(_0x42df9a['includes'](_0x4b5746))return null;}return _0xd3b695;}for(let _0xbcfb99=0x0;_0xbcfb99<_0x48fd35[_0xe60199(0x283)];_0xbcfb99++){if(_0x48fd35[_0xbcfb99][_0xe60199(0x287)](0x0,0x1)==='['){const _0x23010b=_0x48fd35[_0xbcfb99][_0xe60199(0x24d)](']');if(_0x23010b<0x0)return null;const _0x27528d=_0x48fd35[_0xbcfb99][_0xe60199(0x287)](0x1,_0x23010b),_0xa40c16=_0x27528d['split']('.');let _0x38f44b;for(let _0x35a9a6=0x0;_0x35a9a6<_0xa40c16['length'];_0x35a9a6++){if(_0x35a9a6===0x0)_0x38f44b=_0x102d9a[_0xa40c16[_0x35a9a6]];else{if(!_0x38f44b)return null;_0x38f44b=_0x38f44b[_0xa40c16[_0x35a9a6]];}}if(!_0x38f44b)return null;_0x48fd35[_0xbcfb99]=_0x38f44b;}}for(let _0x5ce54d=0x0;_0x5ce54d<_0x48fd35[_0xe60199(0x283)];_0x5ce54d++){const [_0x968f96]=_0x3167f6(_0x48fd35[_0x5ce54d]);_0x968f96&&(_0x48fd35[_0x5ce54d]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x48fd35[_0x5ce54d]));}if(_0x48fd35[0x0]===null)return null;switch(_0x151e07['toLowerCase']()){case _0xe60199(0x23e):{if(_0x48fd35[_0xe60199(0x283)]!==0x1)return null;const [_0x3f9dfb]=_0x3167f6(_0x48fd35[0x0]);if(_0x3f9dfb)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x3f9dfb);if(_0x48fd35[0x0]===null)return null;return _0x48fd35[0x0][_0xe60199(0x28d)]();}case'uppercase':{if(_0x48fd35[_0xe60199(0x283)]!==0x1)return null;const [_0x32bce0]=_0x3167f6(_0x48fd35[0x0]);if(_0x32bce0)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x32bce0);if(_0x48fd35[0x0]===null)return null;return _0x48fd35[0x0][_0xe60199(0x1e1)]();}case'firstn':{if(_0x48fd35[_0xe60199(0x283)]!==0x2)return null;const [_0x28ca69]=_0x3167f6(_0x48fd35[0x0]);if(_0x28ca69)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x28ca69);if(_0x48fd35[0x0]===null)return null;if(isNaN(_0x48fd35[0x1]))return null;return _0x48fd35[0x0][_0xe60199(0x287)](0x0,_0x48fd35[0x1]);}case'elementnumber':{const [_0x278add]=_0x3167f6(_0x48fd35[0x0]);if(_0x48fd35[_0xe60199(0x283)]<0x2)return null;if(_0x278add)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x278add);if(_0x48fd35[0x0]===null)return null;const _0x59dfae=_0x48fd35[0x1];if(isNaN(_0x59dfae))return null;let _0x474b3a;if(_0x48fd35[_0xe60199(0x283)]===0x3)_0x474b3a=_0x48fd35[0x0][_0xe60199(0x26f)](_0x48fd35[0x2]);else _0x474b3a=_0x474b3a=_0x48fd35[0x0][_0xe60199(0x26f)]('\x20');if(_0x59dfae<=_0x474b3a[_0xe60199(0x283)])return _0x474b3a[_0x59dfae-0x1];else return'';}case _0xe60199(0x1b4):{const [_0x347de0]=_0x3167f6(_0x48fd35[0x0]);if(_0x347de0)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x347de0);if(_0x48fd35[0x0]===null)return null;if(_0x48fd35[_0xe60199(0x283)]!==0x3)return null;return _0x48fd35[0x0][_0xe60199(0x208)](_0x48fd35[0x1],_0x48fd35[0x2]);}case _0xe60199(0x263):{if(_0x48fd35[_0xe60199(0x283)]!==0x1)return null;const [_0xc080]=_0x3167f6(_0x48fd35[0x0]);if(_0xc080)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0xc080);if(_0x48fd35[0x0]===null)return null;return a0_0x442400[_0xe60199(0x245)](_0x48fd35[0x0]);}case _0xe60199(0x265):{let _0x53d86b='';for(let _0x21bbbe=0x0;_0x21bbbe<_0x48fd35['length'];_0x21bbbe++){const [_0x1d69fb]=_0x3167f6(_0x48fd35[_0x21bbbe]);if(_0x1d69fb)_0x48fd35[_0x21bbbe]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x1d69fb);if(_0x48fd35[_0x21bbbe]===null)return null;_0x53d86b+=_0x48fd35[_0x21bbbe];}return _0x53d86b;}case _0xe60199(0x22d):{if(_0x48fd35[_0xe60199(0x283)]>0x2)return null;const [_0x25d93f]=_0x3167f6(_0x48fd35[0x0]);if(_0x25d93f)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x25d93f);if(_0x48fd35[0x0]===null)return null;const _0x146ac9=parseInt(_0x48fd35[0x0]);if(isNaN(_0x146ac9))return null;let _0x16fc82=_0xe60199(0x269);_0x16fc82+=','+_0x48fd35[0x0];if(_0x48fd35[_0xe60199(0x283)]===0x2&&_0x48fd35[0x1][_0xe60199(0x28d)]()===_0xe60199(0x280))_0x16fc82+=_0xe60199(0x2a2);else _0x16fc82+=',false';return _0x16fc82+='##',_0x16fc82;}case _0xe60199(0x27b):{if(_0x48fd35['length']!==0x1)return null;const [_0x15e51d]=_0x3167f6(_0x48fd35[0x0]);if(_0x15e51d)_0x48fd35[0x0]=await _0x25a17c(_0x1d8a2e,_0x102d9a,_0x3d5d8c,_0x15e51d);if(_0x48fd35[0x0]===null)return null;let _0x52fea7,_0x880f4f=![],_0x31c95f='';const _0xd90a8d=_0x48fd35[0x0]['split']('##');if(_0xd90a8d[_0xe60199(0x283)]>0x2)for(let _0x1ea8a6=0x0;_0x1ea8a6<_0xd90a8d['length'];_0x1ea8a6++){if(_0xd90a8d[_0x1ea8a6][_0xe60199(0x262)](_0xe60199(0x1cd))){const _0x56d3ba=_0xd90a8d[_0x1ea8a6][_0xe60199(0x26f)](',');if(_0x56d3ba[_0xe60199(0x283)]<0x2)return null;const _0x4e4eb0=parseInt(_0x56d3ba[0x1]);if(isNaN(_0x4e4eb0))return null;_0x31c95f='##'+_0xd90a8d[_0x1ea8a6]+'##',_0x52fea7=_0x56d3ba[0x1],_0x56d3ba['length']>0x2&&(_0x880f4f=_0x56d3ba[0x2]['toLowerCase']()===_0xe60199(0x280));}}let _0x407121,_0x1c43b4=0x0,_0x3860d7=0x0;if(_0x52fea7){_0x3860d7=_0x52fea7[_0xe60199(0x283)],_0x1c43b4=0xa;for(let _0x5a9b85=0x1;_0x5a9b85<_0x3860d7;_0x5a9b85++){_0x1c43b4*=0xa;}_0x1c43b4-=0x1,_0x407121=parseInt(_0x52fea7);if(isNaN(_0x407121))return null;_0x407121-=0x1;}else _0x407121=0x0;do{_0x407121+=0x1;let _0x4f7685=_0x48fd35[0x0];if(_0x52fea7!==undefined&&_0x31c95f){let _0x584301=_0x407121['toString']();while(_0x584301[_0xe60199(0x283)]<_0x3860d7){_0x584301='0'+_0x584301;}_0x880f4f?_0x4f7685=_0x4f7685[_0xe60199(0x1b4)](_0x31c95f,_0x584301):(_0x4f7685=_0x4f7685[_0xe60199(0x1b4)](_0x31c95f,''),_0x880f4f=!![],_0x407121-=0x1);}try{const _0x7fb2c2=await _0x1d3f95(_0x1d8a2e,_0x3d5d8c,_0x4f7685);if(!_0x7fb2c2)return _0x4f7685;}catch(_0x1e7e48){return _0x1c6ff4['logger'][_0xe60199(0x2d3)](_0x1c6ff4[_0xe60199(0x2be)]+'['+_0x1c6ff4[_0xe60199(0x292)]+']\x20'+_0x151e07+_0xe60199(0x1ef)+_0x1e7e48[_0xe60199(0x2a9)]),null;}}while(_0x407121<_0x1c43b4);return null;}default:}return null;},_0xd83f5a=async(_0x5f3d20,_0x1e5851)=>{const _0x2f7771=_0x309557;for(const _0x36ce59 in _0x1e5851){const _0x4eb8d1=_0x1e5851[_0x36ce59],[_0x25b963,_0x5b8839]=_0x3167f6(_0x4eb8d1);if(_0x25b963){const _0x484b9e=''+_0x36ce59,_0x5ad4a7=_0x25b963+'('+_0x5b8839[_0x2f7771(0x265)](',')+')',_0x1b3ebd=await _0x25a17c(_0x5f3d20,_0x1e5851,_0x484b9e,_0x5ad4a7);if(_0x1b3ebd===null)delete _0x1e5851[_0x36ce59];else _0x1e5851[_0x36ce59]=_0x1b3ebd;}for(const _0x427961 in _0x4eb8d1){const _0x1696ad=_0x4eb8d1[_0x427961],[_0x4cb23c,_0x8c0b3f]=_0x3167f6(_0x1696ad);if(_0x4cb23c){const _0x4b06d1=_0x36ce59+'.'+_0x427961,_0x3aab26=_0x4cb23c+'('+_0x8c0b3f['join'](',')+')',_0x2ade5d=await _0x25a17c(_0x5f3d20,_0x1e5851,_0x4b06d1,_0x3aab26);if(_0x2ade5d===null)delete _0x4eb8d1[_0x427961];else _0x4eb8d1[_0x427961]=_0x2ade5d;}}}return _0x1e5851;},_0x2afd4f=async(_0x1571cc,_0xb63a55,_0xb90033,_0x29ba58)=>{const _0x59f453=_0x309557;if(!_0x28d126)throw new Error(_0x59f453(0x236));if(!_0x3184ae)throw new Error(_0x59f453(0x1c6));try{if(!_0x1c6ff4[_0x59f453(0x2b2)])_0x1c6ff4[_0x59f453(0x2b2)]=_0x1c6ff4[_0x59f453(0x2d4)]();const _0x4c55ae={'headers':{'Authorization':_0x3184ae}},_0x7f4dd7=await _0x1c6ff4['helperRest'][_0x59f453(0x264)](undefined,_0xb63a55,_0x28d126+_0xb90033,_0x29ba58,undefined,_0x4c55ae);return _0x7f4dd7[_0x59f453(0x2b0)];}catch(_0x2f27a3){try{const _0x4d8370=JSON[_0x59f453(0x279)](_0x2f27a3[_0x59f453(0x2a9)]);if(_0x4d8370[_0x59f453(0x2b0)])throw new Error(JSON['stringify'](_0x4d8370[_0x59f453(0x2b0)]));throw new Error(_0x2f27a3['message']);}catch(_0x17d9ae){throw new Error(_0x59f453(0x29f)+_0x17d9ae[_0x59f453(0x2a9)]);}}},_0x2739a3=async _0x54ae8a=>{const _0x331388=_0x309557,_0x517aaf=_0x1c6ff4[_0x331388(0x27e)][_0x331388(0x1f7)][_0x331388(0x286)];if(!_0x517aaf){_0x54ae8a[_0x331388(0x2a6)]['status']=0x1f4,_0x1c6ff4[_0x331388(0x209)][_0x331388(0x2d3)](_0x1c6ff4[_0x331388(0x2be)]+'['+_0x1c6ff4['pluginName']+']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20missing');return;}try{new URL(_0x517aaf);}catch(_0x2666d9){_0x54ae8a[_0x331388(0x2a6)][_0x331388(0x1d0)]=0x1f4,_0x1c6ff4['logger'][_0x331388(0x2d3)](_0x1c6ff4[_0x331388(0x2be)]+'['+_0x1c6ff4['pluginName']+_0x331388(0x274)+_0x2666d9[_0x331388(0x2a9)]);return;}try{if(!_0x1c6ff4[_0x331388(0x2b2)])_0x1c6ff4[_0x331388(0x2b2)]=_0x1c6ff4[_0x331388(0x2d4)]();const _0x237619=new URL(_0x54ae8a[_0x331388(0x297)][_0x331388(0x24c)]),_0x2f39df=_0x54ae8a['request']['method'],_0xd6abe=_0x54ae8a[_0x331388(0x297)][_0x331388(0x24c)][_0x331388(0x1b4)](_0x237619[_0x331388(0x234)],_0x517aaf),_0x2a8719=_0x54ae8a['request'][_0x331388(0x2b0)],_0x1fe70b={'headers':{'Authorization':_0x54ae8a[_0x331388(0x297)][_0x331388(0x1e2)][_0x331388(0x1de)]}},_0xf61b4a=await _0x1c6ff4['helperRest'][_0x331388(0x264)](_0x331388(0x1e4),_0x2f39df,_0xd6abe,_0x2a8719,undefined,_0x1fe70b);_0x54ae8a['response'][_0x331388(0x1d0)]=_0xf61b4a[_0x331388(0x258)];try{_0x54ae8a[_0x331388(0x2a6)][_0x331388(0x2b0)]=JSON[_0x331388(0x23b)](_0xf61b4a[_0x331388(0x2b0)]);}catch(_0x4a116c){_0x54ae8a['response'][_0x331388(0x2b0)]=_0xf61b4a['body'];}}catch(_0x8d355f){try{const _0x7b7cda=JSON[_0x331388(0x279)](_0x8d355f[_0x331388(0x2a9)]);_0x54ae8a[_0x331388(0x2a6)][_0x331388(0x1d0)]=_0x7b7cda?.[_0x331388(0x2b0)]?.['status']||_0x7b7cda?.[_0x331388(0x258)]||0x1f4,_0x54ae8a['response'][_0x331388(0x2b0)]=_0x7b7cda[_0x331388(0x2b0)]?JSON[_0x331388(0x23b)](_0x7b7cda[_0x331388(0x2b0)]):_0x8d355f['message'];}catch(_0xc7055b){_0x54ae8a[_0x331388(0x2a6)]['status']=0x1f4,_0x1c6ff4['logger'][_0x331388(0x2d3)](_0x1c6ff4['gwName']+'['+_0x1c6ff4[_0x331388(0x292)]+']\x20onChainingHandler\x20error:\x20'+_0x8d355f[_0x331388(0x2a9)]);}}};}}export class Publisher{constructor(_0x4e5468){const _0x58d45a=a0_0x24a2,_0x54d38d=_0x4e5468,_0x4b554e={},_0x5314dc=async(_0x15445e,_0x45a2bb)=>{const _0x297aeb=a0_0x24a2,_0x4d1f71=_0x4b554e[_0x15445e][_0x297aeb(0x27e)]?.[_0x297aeb(0x26c)]?.[_0x297aeb(0x21b)];let _0x22e001=0x0;for await(const _0x6cb0c5 of _0x45a2bb[_0x297aeb(0x1d0)]()){switch(_0x6cb0c5[_0x297aeb(0x249)]){case'disconnect':_0x54d38d['logger'][_0x297aeb(0x2d3)](_0x54d38d[_0x297aeb(0x2be)]+'['+_0x54d38d[_0x297aeb(0x292)]+_0x297aeb(0x2cf)+_0x15445e+']['+_0x4d1f71+_0x297aeb(0x29d)+_0x6cb0c5[_0x297aeb(0x21e)]+'\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available'),_0x22e001=0x0;break;case _0x297aeb(0x278):_0x54d38d[_0x297aeb(0x209)]['info'](_0x54d38d[_0x297aeb(0x2be)]+'['+_0x54d38d[_0x297aeb(0x292)]+_0x297aeb(0x2cf)+_0x15445e+']['+_0x4d1f71+_0x297aeb(0x261)+_0x6cb0c5[_0x297aeb(0x21e)]);break;case _0x297aeb(0x2d3):_0x54d38d['logger']['error'](_0x54d38d['gwName']+'['+_0x54d38d[_0x297aeb(0x292)]+_0x297aeb(0x2cf)+_0x15445e+']['+_0x4d1f71+']\x20client\x20error\x20'+_0x6cb0c5[_0x297aeb(0x21e)]);break;case _0x297aeb(0x2da):_0x22e001+=0x1;_0x22e001%0x1e===0x0&&_0x54d38d[_0x297aeb(0x209)][_0x297aeb(0x24f)](_0x54d38d[_0x297aeb(0x2be)]+'['+_0x54d38d[_0x297aeb(0x292)]+_0x297aeb(0x2cf)+_0x15445e+']['+_0x4d1f71+_0x297aeb(0x241)+_0x6cb0c5[_0x297aeb(0x21e)]+_0x297aeb(0x2ca)+_0x22e001+')');break;case _0x297aeb(0x1e5):_0x54d38d[_0x297aeb(0x209)][_0x297aeb(0x24f)](_0x54d38d[_0x297aeb(0x2be)]+'['+_0x54d38d[_0x297aeb(0x292)]+_0x297aeb(0x2cf)+_0x15445e+']['+_0x4d1f71+_0x297aeb(0x1d5)+_0x6cb0c5[_0x297aeb(0x21e)]);break;}}},_0x42ad67=async(_0x27d3b3,_0x509666)=>{const _0x1312ab=a0_0x24a2,_0x55837c=_0x4b554e[_0x27d3b3]['config']?.[_0x1312ab(0x26c)]?.['subject'];let _0x2b167d;try{_0x2b167d=await a0_0x2d222d(_0x509666);if(_0x2b167d['info']['server_name']!==_0x1312ab(0x1ff)){_0x2b167d[_0x1312ab(0x22a)]();return;}_0x4b554e[_0x27d3b3]['nc']=_0x2b167d,_0x5314dc(_0x27d3b3,_0x2b167d);}catch(_0x2d0464){_0x54d38d[_0x1312ab(0x209)][_0x1312ab(0x2d3)](_0x54d38d[_0x1312ab(0x2be)]+'['+_0x54d38d[_0x1312ab(0x292)]+']\x20publisher['+_0x27d3b3+']['+_0x55837c+_0x1312ab(0x254)+_0x2d0464[_0x1312ab(0x2a9)]+_0x1312ab(0x29b)),_0x509666[_0x1312ab(0x1cb)]=!![];try{_0x2b167d=await a0_0x2d222d(_0x509666);if(_0x2b167d[_0x1312ab(0x2d8)][_0x1312ab(0x201)]!=='SCIM\x20Stream'){_0x2b167d[_0x1312ab(0x22a)]();return;}_0x4b554e[_0x27d3b3]['nc']=_0x2b167d,_0x5314dc(_0x27d3b3,_0x2b167d);}catch(_0x381bea){_0x54d38d[_0x1312ab(0x209)][_0x1312ab(0x2d3)](_0x54d38d[_0x1312ab(0x2be)]+'['+_0x54d38d['pluginName']+_0x1312ab(0x2cf)+_0x27d3b3+']['+_0x55837c+_0x1312ab(0x254)+_0x381bea[_0x1312ab(0x2a9)]);return;}}_0x54d38d[_0x1312ab(0x209)][_0x1312ab(0x24f)](_0x54d38d[_0x1312ab(0x2be)]+'['+_0x54d38d['pluginName']+_0x1312ab(0x2cf)+_0x27d3b3+']['+_0x55837c+_0x1312ab(0x1cf)+(_0x509666['tls']['ca']?_0x1312ab(0x2a3):'')+'\x20'+_0x2b167d['getServer']()),_0x2b167d[_0x1312ab(0x2c0)]()[_0x1312ab(0x25c)](_0x34cb48=>{const _0x34cff2=_0x1312ab;_0x34cb48&&_0x54d38d['logger'][_0x34cff2(0x2d3)](_0x54d38d['gwName']+'['+_0x54d38d[_0x34cff2(0x292)]+']\x20publisher['+_0x27d3b3+']['+_0x55837c+_0x34cff2(0x293)+_0x34cb48[_0x34cff2(0x2a9)]);});};this[_0x58d45a(0x1b3)]=async(_0x377831,_0x41abe7)=>{const _0x467d74=_0x58d45a;if(!_0x41abe7?.[_0x467d74(0x26c)]){_0x54d38d[_0x467d74(0x209)][_0x467d74(0x2d3)](_0x54d38d[_0x467d74(0x2be)]+'['+_0x54d38d[_0x467d74(0x292)]+']\x20publisher['+_0x377831+']\x20initialization\x20error:\x20missing\x20configuration\x20nats');return;}if(!_0x41abe7?.['nats']?.[_0x467d74(0x291)]){_0x54d38d[_0x467d74(0x209)][_0x467d74(0x2d3)](_0x54d38d['gwName']+'['+_0x54d38d['pluginName']+_0x467d74(0x2cf)+_0x377831+_0x467d74(0x2bc));return;}if(!_0x41abe7?.[_0x467d74(0x26c)]?.[_0x467d74(0x21b)]){_0x54d38d[_0x467d74(0x209)]['error'](_0x54d38d['gwName']+'['+_0x54d38d[_0x467d74(0x292)]+']\x20publisher['+_0x377831+_0x467d74(0x200));return;}if(!_0x41abe7?.[_0x467d74(0x26c)]?.[_0x467d74(0x21b)][_0x467d74(0x262)](_0x467d74(0x1b5))){_0x54d38d['logger']['error'](_0x54d38d['gwName']+'['+_0x54d38d['pluginName']+_0x467d74(0x2cf)+_0x377831+_0x467d74(0x223));return;}if(!_0x41abe7['baseUrls']||!Array['isArray'](_0x41abe7[_0x467d74(0x1c4)])||_0x41abe7[_0x467d74(0x1c4)][_0x467d74(0x283)]<0x1){_0x54d38d[_0x467d74(0x209)][_0x467d74(0x2d3)](_0x54d38d[_0x467d74(0x2be)]+'['+_0x54d38d[_0x467d74(0x292)]+_0x467d74(0x2cf)+_0x377831+_0x467d74(0x29a));return;}if(!_0x41abe7?.[_0x467d74(0x284)]?.['ca']){_0x54d38d[_0x467d74(0x209)]['error'](_0x54d38d[_0x467d74(0x2be)]+'['+_0x54d38d['pluginName']+_0x467d74(0x2cf)+_0x377831+_0x467d74(0x27d));return;}const _0xfffed7={};try{let _0x3e4c12=a0_0x5d9708[_0x467d74(0x265)](_0x54d38d['configDir'],_0x467d74(0x282),_0x41abe7?.[_0x467d74(0x284)]?.['ca']||'file-not-configured');(_0x41abe7?.[_0x467d74(0x284)]?.['ca']?.[_0x467d74(0x262)]('/')||_0x41abe7?.[_0x467d74(0x284)]?.['ca']?.[_0x467d74(0x23d)]('\x5c'))&&(_0x3e4c12=_0x41abe7[_0x467d74(0x284)]['ca']),_0xfffed7['ca']=[a0_0x42a5b2[_0x467d74(0x21d)](_0x3e4c12)],_0xfffed7['rejectUnauthorized']=!![];}catch(_0x28ab6b){_0x54d38d[_0x467d74(0x209)][_0x467d74(0x2d3)](_0x54d38d[_0x467d74(0x2be)]+'['+_0x54d38d['pluginName']+_0x467d74(0x2cf)+_0x377831+_0x467d74(0x1fb)+_0x28ab6b[_0x467d74(0x2a9)]);return;}const _0x26e717={},_0x5d4ec1=new TextEncoder()[_0x467d74(0x2cc)](_0x41abe7?.[_0x467d74(0x26c)]?.[_0x467d74(0x22b)]),_0x2596c3=_0x41abe7?.[_0x467d74(0x26c)]?.[_0x467d74(0x2b4)];_0x26e717[_0x467d74(0x2ad)]=jwtAuthenticator(_0x2596c3,_0x5d4ec1),_0x26e717[_0x467d74(0x202)]=_0x41abe7[_0x467d74(0x1c4)],_0x26e717[_0x467d74(0x2a3)]=_0xfffed7,_0x26e717[_0x467d74(0x1cb)]=![],_0x26e717[_0x467d74(0x278)]=!![],_0x26e717['reconnectTimeWait']=0x3e8*0xa,_0x26e717[_0x467d74(0x2b5)]=-0x1,_0x26e717[_0x467d74(0x1cc)]=0x2*0x3c*0x3e8,_0x26e717['maxPingOut']=0x5,_0x26e717[_0x467d74(0x24f)]=![],_0x4b554e[_0x377831]={},_0x4b554e[_0x377831]['config']=_0x41abe7,_0x4b554e[_0x377831]['nc']=undefined,_0x42ad67(_0x377831,_0x26e717);},this[_0x58d45a(0x210)]=async _0x5ed809=>{const _0x5b10c3=_0x58d45a;let _0x4f4614;const _0x34f42e=a0_0x385c0f[_0x5b10c3(0x28e)]();try{if(_0x5ed809[_0x5b10c3(0x299)]===Object){_0x4f4614=_0x5ed809['baseEntity'];if(!_0x4f4614)_0x5ed809[_0x5b10c3(0x1e9)]='undefined';if(_0x5ed809?.[_0x5b10c3(0x25a)]?.[_0x5b10c3(0x297)]?.['headers']){const _0x395fdc=_0x5ed809['ctx'][_0x5b10c3(0x297)]['headers'][_0x5b10c3(0x1d7)](_0x5b10c3(0x1de));if(_0x395fdc)_0x5ed809[_0x5b10c3(0x25a)][_0x5b10c3(0x297)][_0x5b10c3(0x1e2)][_0x5b10c3(0x203)]('authorization',a0_0xfd4a34[_0x5b10c3(0x2d7)](_0x395fdc,_0x34f42e));}if(_0x5ed809?.[_0x5b10c3(0x25a)]?.['passThrough']?.[_0x5b10c3(0x1e2)]){const _0x51aa03=_0x5ed809['ctx']['passThrough'][_0x5b10c3(0x1e2)][_0x5b10c3(0x1d7)]('authorization');if(_0x51aa03)_0x5ed809[_0x5b10c3(0x25a)][_0x5b10c3(0x1ea)][_0x5b10c3(0x1e2)][_0x5b10c3(0x203)](_0x5b10c3(0x1de),a0_0xfd4a34[_0x5b10c3(0x2d7)](_0x51aa03,_0x34f42e));}_0x5ed809=JSON[_0x5b10c3(0x23b)](_0x5ed809);}else{const _0x5d8d6f=JSON[_0x5b10c3(0x279)](_0x5ed809);_0x4f4614=_0x5d8d6f[_0x5b10c3(0x1e9)];}}catch(_0x1cd4cd){throw new Error('publisher['+_0x4f4614+_0x5b10c3(0x20f));}if(!_0x4b554e[_0x4f4614])throw new Error(_0x5b10c3(0x2a5)+_0x4f4614+']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity='+_0x4f4614);const _0x2362b2=headers();_0x2362b2[_0x5b10c3(0x2d5)](_0x5b10c3(0x26e),_0x34f42e);let _0xd0a5c5;try{if(!_0x4b554e[_0x4f4614]['nc'])throw new Error(_0x5b10c3(0x2b9));_0xd0a5c5=await _0x4b554e[_0x4f4614]['nc'][_0x5b10c3(0x297)](_0x4b554e[_0x4f4614][_0x5b10c3(0x27e)]?.[_0x5b10c3(0x26c)]?.[_0x5b10c3(0x21b)],_0x5ed809,{'headers':_0x2362b2});}catch(_0x10524){if(_0x10524[_0x5b10c3(0x2a9)]==='503')throw new Error(_0x5b10c3(0x2a5)+_0x4f4614+_0x5b10c3(0x1f5)+_0x4b554e[_0x4f4614][_0x5b10c3(0x27e)]?.[_0x5b10c3(0x26c)]?.['subject']);else throw new Error(_0x5b10c3(0x2a5)+_0x4f4614+']\x20error:\x20'+_0x10524[_0x5b10c3(0x2a9)]);}let _0x1d8e4c;try{_0x1d8e4c=JSON[_0x5b10c3(0x279)](_0xd0a5c5[_0x5b10c3(0x298)]());try{JSON[_0x5b10c3(0x279)](_0x1d8e4c[_0x5b10c3(0x2b0)]);if(!_0x1d8e4c[_0x5b10c3(0x1e2)])_0x1d8e4c[_0x5b10c3(0x1e2)]={};if(!_0x1d8e4c[_0x5b10c3(0x1e2)]['content-type'])_0x1d8e4c[_0x5b10c3(0x1e2)][_0x5b10c3(0x251)]=_0x5b10c3(0x260);}catch(_0x487589){void 0x0;}}catch(_0xb87a18){throw new Error(_0x5b10c3(0x2b8)+_0xd0a5c5[_0x5b10c3(0x298)]());}if(_0x1d8e4c?.[_0x5b10c3(0x2d3)]){const _0xc61d6f=new Error(_0x5b10c3(0x1c1)+_0x1d8e4c[_0x5b10c3(0x2d3)]);_0xc61d6f[_0x5b10c3(0x250)]=_0x1d8e4c[_0x5b10c3(0x240)];throw _0xc61d6f;}return _0x1d8e4c;},process['on'](_0x58d45a(0x2d0),async()=>{const _0x47da45=_0x58d45a;for(const _0x1c2cdd in _0x4b554e){_0x4b554e[_0x1c2cdd]['nc']&&!_0x4b554e[_0x1c2cdd]['nc'][_0x47da45(0x219)]()&&await _0x4b554e[_0x1c2cdd]['nc'][_0x47da45(0x22f)]();}}),process['on'](_0x58d45a(0x243),async()=>{const _0x982600=_0x58d45a;for(const _0x1e34ff in _0x4b554e){_0x4b554e[_0x1e34ff]['nc']&&!_0x4b554e[_0x1e34ff]['nc'][_0x982600(0x219)]()&&await _0x4b554e[_0x1e34ff]['nc']['drain']();}});}}export const getAppRoles=async(_0x1be18a,_0x4abbf0)=>{const _0x422a22=a0_0x24a2,_0x2fd574=_0x422a22(0x1fe),_0x44d0d0=_0x1be18a;_0x44d0d0['logger']['debug'](_0x44d0d0[_0x422a22(0x2be)]+'['+_0x44d0d0[_0x422a22(0x292)]+_0x422a22(0x26d)+_0x2fd574+'\x22');try{if(!a0_0x42a5b2[_0x422a22(0x2c8)](_0x44d0d0['configDir']+_0x422a22(0x295)))a0_0x42a5b2[_0x422a22(0x1f3)](_0x44d0d0[_0x422a22(0x2b1)]+'/approles');}catch(_0x246189){void 0x0;}const _0xf5787=a0_0x5d9708[_0x422a22(0x265)](''+_0x44d0d0[_0x422a22(0x2b1)],_0x422a22(0x214),'approles_'+_0x44d0d0[_0x422a22(0x292)]+_0x422a22(0x1fa)),_0x362fb0={};a0_0xfd4a34['fsExistsSync'](_0xf5787)&&a0_0x42a5b2[_0x422a22(0x21d)](_0xf5787,_0x422a22(0x257))[_0x422a22(0x26f)](/\r?\n/)['forEach'](_0xebcbb7=>{const _0x1d3a5c=_0x422a22,_0x119c05=_0xebcbb7['split']('\x20');_0x119c05[_0x1d3a5c(0x283)]===0x2&&(_0x362fb0[_0x119c05[0x0]]=_0x119c05[0x1]);});const _0x4ed0c4=a0_0x42a5b2[_0x422a22(0x2ae)](_0xf5787,{'flags':'w','encoding':_0x422a22(0x1c0),'mode':0x1b6,'autoClose':!![]}),_0x451182=[],_0x2a6230=await _0x44d0d0[_0x422a22(0x1ee)](_0x4abbf0,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x422a22(0x1be)]);return _0x2a6230[_0x422a22(0x24e)][_0x422a22(0x1bb)](_0x438484=>{const _0x32810f=_0x422a22;if(_0x438484['id']){let _0x44464d=a0_0x385c0f[_0x32810f(0x28e)]();if(_0x362fb0[_0x438484['id']])_0x44464d=_0x362fb0[_0x438484['id']];const _0x3c7877={'allowedMemberTypes':['User'],'description':'SCIM\x20Stream\x20-\x20Autogenerated','displayName':_0x438484[_0x32810f(0x1be)]||_0x438484['id'],'id':_0x44464d,'isEnabled':!![],'lang':null,'origin':'Application','value':decodeURIComponent(_0x438484['id'])};_0x451182['push'](_0x3c7877),_0x4ed0c4[_0x32810f(0x1e6)](_0x438484['id']+'\x20'+_0x44464d+'\x0a');}}),_0x4ed0c4[_0x422a22(0x22a)](),_0x44d0d0[_0x422a22(0x209)]['debug'](_0x44d0d0[_0x422a22(0x2be)]+'['+_0x44d0d0[_0x422a22(0x292)]+_0x422a22(0x1d2)+_0xf5787),{'Resources':[{'appRoles':_0x451182}]};};