From a9662d263a277cdb188f1b1b1dc7a073d0d7bc86 Mon Sep 17 00:00:00 2001 From: Tyson Midboe Date: Thu, 10 Aug 2023 21:14:02 -0500 Subject: [PATCH] demo --- dist/829.js | 14 +++++--------- dist/829.js.map | 2 +- dist/main.js | 14 +++++--------- dist/main.js.map | 2 +- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/dist/829.js b/dist/829.js index 726365f..74f8f7c 100644 --- a/dist/829.js +++ b/dist/829.js @@ -1238,11 +1238,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input == // Models - -/** - * - * @param {ModelSpecification} spec - */ function validateSpec(spec) { var missing = ['endpoint', 'factory'].filter(function (key) { return !spec[key]; @@ -1256,11 +1251,12 @@ function validateSpec(spec) { * @param {ModelSpecification} spec * @param {*} dependencies - services injected */ -function makeModel(spec) { +function makeModel(spec, modelName) { validateSpec(spec); var mixins = spec.mixins || []; var dependencies = spec.dependencies || {}; return _objectSpread(_objectSpread({}, spec), {}, { + modelName: modelName.toUpperCase(), mixins: mixins.concat(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"]), dependencies: _objectSpread(_objectSpread({}, dependencies), (0,_util_bind_adapters__WEBPACK_IMPORTED_MODULE_1__["default"])(spec.ports, _adapters__WEBPACK_IMPORTED_MODULE_3__, _services__WEBPACK_IMPORTED_MODULE_2__)) }); @@ -1269,9 +1265,9 @@ var models = Object.entries(_config__WEBPACK_IMPORTED_MODULE_5__).map(function ( var _ref2 = _slicedToArray(_ref, 2), k = _ref2[0], v = _ref2[1]; - return makeModel(_objectSpread(_objectSpread({}, v), {}, { - modelName: k - })); + return _defineProperty({}, k.toUpperCase(), makeModel(v, k)); +}).reduce(function (a, b) { + return _objectSpread(_objectSpread({}, a), b); }); /***/ }), diff --git a/dist/829.js.map b/dist/829.js.map index 5e1df3b..5b9b65d 100644 --- a/dist/829.js.map +++ b/dist/829.js.map @@ -1 +1 @@ -{"version":3,"file":"829.js","mappings":";;;;;;;;;;;;;;;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;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAvH,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,GAAA,kBAAAA,GAAA,gBAAAA,GAAA,WAAAA,GAAA,yBAAAC,MAAA,IAAAD,GAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,GAAA,KAAAC,MAAA,CAAAT,SAAA,qBAAAQ,GAAA,KAAAD,OAAA,CAAAC,GAAA;AAAA,SAAAyY,eAAAC,GAAA,EAAAhY,C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,EAAE;EAC/D,IAAI,CAAC3T,KAAK,IAAI,CAAC4T,QAAQ,EAAE;IACvB;EACF;EACA,OAAO/Z,MAAM,CAAC+M,IAAI,CAAC5G,KAAK,CAAC,CACtBqU,GAAG,CAAC,UAAA2C,IAAI,EAAI;IACX,IAAI,CAACpD,QAAQ,CAACoD,IAAI,CAAC,EAAE;MACnB;IACF;IAEA,IAAI;MACF,OAAA1D,eAAA,KACG0D,IAAI,EAAGpD,QAAQ,CAACoD,IAAI,CAAC,CAACrD,QAAQ,CAAC3T,KAAK,CAACgX,IAAI,CAAC,CAAC9W,OAAO,CAAC,CAAC;IAEzD,CAAC,CAAC,OAAO5D,CAAC,EAAE;MACVU,OAAO,CAACsd,IAAI,CAAChe,CAAC,CAACwR,OAAO,CAAC;IACzB;EACF,CAAC,CAAC,CACDgO,MAAM,CAAC,UAAC7gB,CAAC,EAAE8gB,CAAC;IAAA,OAAA3I,aAAA,CAAAA,aAAA,KAAWnY,CAAC,GAAK8gB,CAAC;EAAA,CAAG,CAAC;AACvC","sources":["webpack://aegis-app/./src/adapters/datasources/datasource-adapter-customer.js","webpack://aegis-app/./src/adapters/datasources/datasource-adapter-file.js","webpack://aegis-app/./src/adapters/datasources/datasource-mongodb.js","webpack://aegis-app/./src/domain/config/customer.js","webpack://aegis-app/./src/domain/config/index.js","webpack://aegis-app/./src/domain/config/inventory.js","webpack://aegis-app/./src/domain/config/order.js","webpack://aegis-app/./src/domain/config/todo.js","webpack://aegis-app/./src/domain/config/webswitch.js","webpack://aegis-app/./src/domain/index.js","webpack://aegis-app/./src/domain/models/inventory.js","webpack://aegis-app/./src/domain/models/todo.js","webpack://aegis-app/./src/domain/models/webswitch.js","webpack://aegis-app/./src/domain/util/bind-adapters.js"],"sourcesContent":["export const DataSourceAdapterCustomer = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomer extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n }\n\n return DataSourceCustomer\n}\n","export const DataSourceAdapterCustomFile = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomFile extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n\n list (options) {\n return super.list(options)\n }\n\n serialize () {\n return false\n }\n }\n\n return DataSourceCustomFile\n}\n","'use strict'\n\nfunction getSecret () {\n return process.env.MONGODB_CREDS || { user: null, pass: null, token: null }\n}\n\nfunction archive (id) {\n console.debug('mock archive', id)\n}\n\n/**\n * Datasource adapter factory.\n * @param {string} url database url\n * @param {number} [cacheSize] number of models to keep in cache\n * @param {*} DataSource base class that enables caching\n * @returns {import(\"./datasource\").default}\n */\nexport const DataSourceAdapterMongoDb = function (\n url,\n cacheSize,\n DataSourceMongoDb\n) {\n /**\n * MongoDB adapter extends in-memory datasource to support caching.\n * The cache is always updated first, which allows the system to run\n * even when the database is offline.\n */\n class DataSourceMongoDbArchive extends DataSourceMongoDb {\n constructor (datasource, factory, name) {\n super(datasource, factory, name)\n this.url = url\n this.cacheSize = cacheSize\n this.creds = getSecret()\n }\n\n /**\n * @override\n */\n delete (id) {\n console.debug('archive', id)\n archive(id)\n }\n }\n\n return DataSourceMongoDbArchive\n}\n","'use strict'\n\nimport {\n validateModel,\n freezeProperties,\n validateProperties,\n requireProperties\n} from '../util/mixins'\nimport { makeCustomerFactory, okToDelete } from '../models/customer'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterCustomer } from '../../adapters/datasources/datasource-adapter-customer'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Customer = {\n modelName: 'customer',\n endpoint: 'customers',\n dependencies: { uuid: () => nanoid(8) },\n factory: makeCustomerFactory,\n validate: validateModel,\n onDelete: okToDelete,\n // datasource: {\n // factory: DataSourceAdapterCustomer,\n // cacheSize: 4000,\n // baseClass: 'DataSourceFile'\n // },\n mixins: [\n freezeProperties('customerId'),\n requireProperties(\n 'firstName',\n 'lastName',\n 'email',\n 'shippingAddress',\n 'billingAddress',\n 'creditCardNumber'\n ),\n validateProperties([\n {\n propKey: 'email',\n // unique: { encrypted: true },\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n }\n ])\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'customerId'\n }\n },\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n ports: {\n runFibonacciCust: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n },\n doesFieldExist: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n }\n },\n accessControlList: {\n customer: {\n allow: 'read',\n type: 'relation',\n desc: 'Allow orders to see customers.'\n }\n }\n}\n","export * from './webswitch' // always export this\nexport * from './order'\nexport * from './customer'\nexport * from './inventory'\nexport * from './todo'\n// export * from './user'\n// export * from './query-engine'\n// export * from './dam-api'\n// export * from './ticket-master'\n// export * from './access-controller'\n","'use strict'\n\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport {\n makeInventoryFactory,\n assetTypes,\n properties,\n categories\n} from '../models/inventory'\n\nimport {\n requireProperties,\n freezeProperties,\n validateProperties\n} from '../util/mixins'\n\n/**\n * @type {import(\"../domain/order\").ModelSpecification}\n */\nexport const Inventory = {\n modelName: 'inventory',\n endpoint: 'inventory',\n dependencies: {},\n factory: makeInventoryFactory,\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n mixins: [\n requireProperties('name', 'inStock', 'category', 'price', 'purchaseOrder'),\n validateProperties([\n {\n propKey: 'inStock',\n typeof: 'number',\n maxnum: 99999\n },\n {\n propKey: 'category',\n values: categories\n },\n {\n propKey: 'assetType',\n values: assetTypes\n },\n {\n propKey: 'properties',\n isValid: (_obj, prop) => prop.every(p => properties.includes(p))\n },\n {\n propKey: 'price',\n typeof: 'number',\n maxnum: 999.99\n }\n ]),\n freezeProperties('*')\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'itemId',\n desc: 'many items per order'\n }\n }\n}\n","'use strict'\n\nimport {\n makeOrderFactory,\n readyToDelete,\n handleOrderEvent,\n orderShipped,\n paymentCompleted,\n OrderStatus,\n recalcTotal,\n requiredForCompletion,\n statusChangeValid,\n freezeOnApproval,\n freezeOnCompletion,\n orderTotalValid,\n returnInventory,\n returnShipment,\n refundPayment,\n returnDelivery,\n cancelPayment,\n updateSignature,\n requiredForGuest,\n requiredForApproval,\n approve,\n cancel,\n OrderError,\n orderPicked\n} from '../models/order'\n\nimport {\n requireProperties,\n freezeProperties,\n updateProperties,\n validateProperties,\n validateModel\n} from '../util/mixins'\n\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Order = {\n endpoint: 'orders',\n factory: makeOrderFactory,\n domain: 'order',\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n dependencies: { uuid: () => nanoid(8) },\n mixins: [\n requireProperties(\n 'orderItems',\n requiredForGuest([\n 'lastName',\n 'firstName',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'email'\n ]),\n requiredForApproval('paymentStatus'),\n requiredForCompletion('proofOfDelivery')\n ),\n freezeProperties(\n 'orderNo',\n 'customerId',\n freezeOnApproval([\n 'email',\n 'lastName',\n 'firstName',\n 'orderItems',\n 'orderTotal',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'paymentStatus'\n ]),\n freezeOnCompletion('*')\n ),\n updateProperties([\n {\n propKey: 'orderItems',\n update: recalcTotal\n },\n {\n propKey: 'orderItems',\n update: updateSignature\n }\n ]),\n validateProperties([\n {\n propKey: 'orderStatus',\n values: Object.values(OrderStatus),\n isValid: statusChangeValid\n },\n {\n propKey: 'orderTotal',\n maxnum: 99999.99,\n isValid: orderTotalValid\n },\n {\n propKey: 'email',\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n },\n {\n propKey: 'phone',\n regex: 'phone'\n }\n ])\n // allowProperties([fibonacci, time, result])\n ],\n validate: validateModel,\n onDelete: readyToDelete,\n eventHandlers: [handleOrderEvent],\n ports: {\n listen: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n notify: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n validateAddress: {\n service: 'Address',\n type: 'outbound',\n keys: 'shippingAddress',\n producesEvent: 'addressValidated',\n disabled: true\n },\n authorizePayment: {\n service: 'Payment',\n type: 'outbound',\n keys: 'paymentStatus',\n consumesEvent: 'startWorkflow',\n producesEvent: 'paymentAuthorized',\n undo: cancelPayment,\n disabled: true\n },\n pickOrder: {\n service: 'Inventory',\n type: 'outbound',\n keys: 'pickupAddress',\n callback: orderPicked,\n consumesEvent: 'itemsAvailable',\n producesEvent: 'orderPicked',\n undo: returnInventory,\n circuitBreaker: {\n portTimeout_pickOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 5000\n }\n }\n },\n shipOrder: {\n service: 'Shipping',\n type: 'outbound',\n callback: orderShipped,\n consumesEvent: 'orderPicked',\n producesEvent: 'orderShipped',\n undo: returnShipment,\n circuitBreaker: {\n portTimeout_shipOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n },\n portRetryFailed_order: {\n callVolume: 3,\n errorRate: 2,\n intervalMs: 60000,\n fallbackFn: cancel\n },\n default: {\n callVolume: 3,\n errorRate: 3,\n intervalMs: 60000\n }\n }\n },\n trackShipment: {\n service: 'Shipping',\n type: 'outbound',\n keys: ['trackingStatus', 'trackingId'],\n consumesEvent: 'orderShipped',\n producesEvent: 'orderDelivered',\n circuitBreaker: {\n portRetryFailed_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n }\n }\n },\n verifyDelivery: {\n service: 'Shipping',\n type: 'outbound',\n keys: 'proofOfDelivery',\n consumesEvent: 'orderDelivered',\n producesEvent: 'deliveryVerified',\n undo: returnDelivery\n },\n completePayment: {\n service: 'Payment',\n type: 'outbound',\n callback: paymentCompleted,\n consumesEvent: 'deliveryVerified',\n producesEvent: 'orderComplete',\n undo: refundPayment\n },\n cancelShipment: {\n service: 'Shipping',\n type: 'outbound'\n },\n refundPayment: {\n service: 'Payment',\n type: 'outbound'\n },\n cancelOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['post']\n },\n approveOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['patch']\n },\n trackAsyncContext: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n customHttpStatus: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n testContainsMany: {\n service: 'Inventory',\n type: 'inbound',\n timeout: 0\n },\n runFibonacciJs: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n getFieldList: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n createModelEvent: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n }\n },\n relations: {\n customer: {\n modelName: 'customer',\n type: 'manyToOne',\n foreignKey: 'customerId',\n desc: 'Many orders per customer, just one customer per order'\n },\n inventory: {\n modelName: 'inventory',\n type: 'containsMany',\n foreignKey: 'itemId',\n arrayKey: 'orderItems',\n desc: 'An order contains a list of inventory items to ship.'\n }\n },\n routes: [\n {\n path: '/orders',\n get: async (req, res, ports) =>\n ports.listModels({\n writable: res,\n query: req.query\n }),\n\n post: async (req, res, ports) => {\n try {\n const result = await ports.createModel(req.body)\n res\n .status(200)\n .json({ message: 'ok', ctx: result.context, id: result.id })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n }\n },\n {\n path: '/orders/:id',\n get: async (req, res, ports) => ports.findModel(req.params.id),\n patch: async (req, res, ports) => {\n try {\n const result = await ports.editModel({\n id: req.params.id,\n changes: req.body\n })\n res.status(200).json({ message: 'ok', ctx: result.context })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n },\n delete: async (req, res, ports) => {\n ports.removeModel(req.params.id)\n res.status(200).json({ message: 'ok' })\n }\n }\n ],\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n approve: {\n command: approve,\n acl: ['write', 'approve']\n },\n cancel: {\n command: cancel,\n acl: ['write', 'cancel']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n serializers: [\n {\n on: 'deserialize',\n key: 'creditCardNumber',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n },\n {\n on: 'deserialize',\n key: 'shippingAddress',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n }\n // {\n // on: 'deserialize',\n // key: 'billingAddress',\n // type: 'string',\n // value: (key, value) => decrypt(value),\n // enabled: false\n // }\n ]\n}\n","'use strict'\n\nimport { DataSourceAdapterCustomFile } from '../../adapters/datasources/datasource-adapter-file'\nimport { makeToDoFactory } from '../models/todo'\nimport { nanoid } from 'nanoid'\n\n/**\n * @type {import('../index').ModelSpecification}\n */\nexport const ToDo = {\n modelName: 'todo',\n endpoint: 'todo',\n dependencies: { uuid: nanoid },\n factory: makeToDoFactory,\n datasource: {\n factory: DataSourceAdapterCustomFile,\n cacheSize: 4000,\n baseClass: 'DataSourceFile'\n }\n}\n","'use strict'\n\nimport { makeClient } from '../models/webswitch'\n\n/**\n * @type {import('../domain').ModelSpecification}\n */\nexport const WebSwitch = {\n modelName: 'webswitch',\n endpoint: 'appfabric',\n factory: makeClient,\n internal: true,\n ports: {\n serviceLocatorInit: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAsk: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAnswer: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n websocketConnect: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketPing: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketSend: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketStatus: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketTerminate: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnOpen: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnMessage: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnError: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnPong: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n }\n }\n}\n","'use strict'\n\n/**\n * @typedef {string} eventName\n */\n\n/**\n * @typedef Model\n * @property {string} _Symbol_id - immutable/private uuid\n * @property {string} _Symbol_modelName - immutable/private name\n * @property {string} _Symbol_createTime - immutable/private createTime\n * @property {onUpdate} _Symbol_onUpdate - immutable/private update function\n * @property {onDelete} _Symbol_onDelete\n * @property {function(Object)} update - use this function to update model\n * specify changes in an object\n * @property {function()} toJSON - de/serialization logic\n * @property {function(eventName,function(eventName,Model):void)} addListener listen for domain events\n * @property {function(eventName,Model):Promise} emit emit domain event\n * @property {function(function():Promise):Promise} [port] - when a\n * port is configured, the framework generates a function to invoke it. When data\n * arrives on the port, depending on the implementation, the port's adapter invokes\n * the callback specified in the port configuration, or as an argument to the port\n * function. The callback returns an updated Model, and control is returned to the\n * caller. Optionally, an event is fired to trigger the next port function to run\n * @property {function():Promise} [relation] - when you configure a relation,\n * the framework generates a function that your code can call to run the query\n * @property {function(*):*} [command] - the framework will call any model method\n * you specify when passed as a parameter or query in an API call.\n */\n\n/**\n * @callback onUpdate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onDelete\n * @param {Model} model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback validate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onLoad\n * @param {Model} savedModel rehydrated model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @typedef {string} service - name of the service object to inject in adapter\n * @typedef {number} timeout - call to adapter will timeout after `timeout` milliseconds\n *\n * @typedef {{\n * [x: string]: {\n * service: service,\n * timeout?: timeout,\n * callback?: function({model: Model})\n * errorCallback?: function({model: Model, port: string, error:Error}),\n * timeoutCallback?: function({model: Model, port: string}),\n * consumesEvent?:string,\n * producesEvent?:string,\n * type?:'inbound'|'outbound',\n * disabled?: boolean,\n * adapter?: string,\n * circuitBreaker?: thresholds\n * }\n * }} ports - input/output ports for the domain\n */\n\n/**\n * @typedef {{\n * [x:string]: {\n * errorRate:number\n * callVolume:number,\n * intervalMs:number,\n * fallbackFn:function()\n * },\n * }} thresholds - thresholds for different errors\n */\n\n/**\n * @typedef {{\n * [x: string]: {\n * modelName:string,\n * type:\"oneToMany\"|\"oneToOne\"|\"manyToOne\",\n * foreignKey:any,\n * }\n * }} relations - define related domain entities\n *\n * @typedef {Array>} eventHandler - callbacks invoked to handle domain and\n * application events\n */\n\n/**\n *\n * @typedef {string} key\n * @typedef {*} value\n */\n\n/**\n * @typedef {{\n * on: \"serialize\" | \"deserialize\",\n * key: string | RegExp | \"*\" | (function(key,value):boolean)\n * type: \"string\" | \"object\" | \"number\" | \"function\" | \"any\" | (function(key,value):boolean)\n * value(key, value):value\n * }} serializer\n */\n/**\n * @typedef {{\n * [x:string]: {\n * allow:string|function(*):boolean|Array\n * deny:string|function(*):boolean|Array\n * type:\"role\"|\"relation\"|\"command\"\n * desc?:string\n * }\n * }} accessControlList\n */\n/**\n * @typedef {{\n * [x: string]: {\n * command:string|function(Model):Promise,\n * acl:accessControlList[]\n * }\n * }} commands - configure functions to execute when specified in a\n * URL parameter or query of the auto-generate REST API\n */\n/**\n * @callback controller\n * @param {Request} req\n * @param {Response} res\n */\n\n/**\n * @typedef {{\n * [path: string]: {\n * get?: controller,\n * post?: controller,\n * patch?: controller,\n * delete?:controller\n * }\n * }} endpoints\n */\n\n/**\n * @callback modelSpecFactoryFn\n * @param {object} dependencies\n * @returns {function(...args):Readonly}\n */\n\n/**\n * @typedef {object} ModelSpecification Specify domain model properties and functions\n * @property {string} modelName name of model (case-insenstive)\n * @property {string} endpoint URI reference (e.g. plural of `modelName` noun)\n * @property {modelSpecFactoryFn} factory returns factory function that creates the model instance\n * @property {object} [dependencies] injected into the model for inverted dependency/control\n * @property {Array} [mixins] - use functional mixins\n * to compose the object from common domain logic, like input validation.\n * @property {onUpdate} [onUpdate] - Function called to handle update requests. Called\n * before save.\n * @property {onDelete} [onDelete] - Function called before deletion.\n * @property {validate} [validate] - called to validate model updates\n * @property {ports} [ports] - input/output ports for the domain\n * @property {eventHandler[]} [eventHandlers] - callbacks invoked to handle CRUD events\n * @property {serializer[]} [serializers] - use for custom de/serialization of the model\n * when reading or writing to storage or network\n * @property {relations} [relations] - create related models or query in aggregate\n * @property {commands} [commands] - define functions to execute when specified in a\n * URL parameter or query of the auto-generated REST API\n * @property {accessControlList} [accessControlList] - configure authorization\n * @property {endpoints} [routes] - additional custom API endpoints - specify inbound port\n * @property {{factory:import(\"../adapters/datasources/datasource-mongodb\"),url:string,credentials?:string}} [datasource] - custom datasource\n * for this model. If not set, the default set by the server is used.\n *\n */\n\n/**\n * @callback addModel\n * @param {{ searchTerm1, searchTerm2, searchTermN }} input\n * @returns {Promise}\n */\n\n/**\n * @callback editModel\n * @param {{ id:string, changes:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findModel\n * @param {{ id:string, query:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findRelatedModels\n * @param {{ query:object, relation:string }} input\n * @returns { Promise<{Model,[Model]}> }\n */\n\n/**\n * @callback listModels\n * @param {{ query:object }} input e.g. { searchTerm1 : 'val', ...etc }\n * @returns { [Promise] }\n */\n\n/**\n * @callback executeCommand\n * @param {{ id:string }} input\n * @returns { Model }\n */\n\n/**\n * @typedef DomainPortAPI\n * @property { addModel } addModel\n * @property { editModel } editModel\n * @property { listModels } listModels\n * @property { findModel } findModel\n * @property { findRelatedModels } findModel\n * @property { removeModel } removeModel\n * @property { executeCommand } executeCommand\n */\n\nimport GlobalMixins from './util/mixins'\nimport bindAdapters from './util/bind-adapters'\n\n// Service dependencies\nimport * as services from '../services'\nimport * as adapters from '../adapters'\nimport * as ports from './ports'\n// Models\nimport * as modelSpecs from './config'\n\n/**\n *\n * @param {ModelSpecification} spec\n */\nfunction validateSpec (spec) {\n const missing = ['endpoint', 'factory'].filter(key => !spec[key])\n if (missing?.length > 0) {\n throw new Error(\n `missing properties: ${missing}, spec: ${Object.entries(spec)}`\n )\n }\n}\n\n/**\n * @param {ModelSpecification} spec\n * @param {*} dependencies - services injected\n */\nfunction makeModel (spec) {\n validateSpec(spec)\n const mixins = spec.mixins || []\n const dependencies = spec.dependencies || {}\n return {\n ...spec,\n mixins: mixins.concat(GlobalMixins),\n dependencies: {\n ...dependencies,\n ...bindAdapters(spec.ports, adapters, services)\n }\n }\n}\n\nexport const models = Object.entries(modelSpecs).map(([k, v]) =>\n makeModel({ ...v, modelName: k })\n)\n","'use strict'\n\nexport const assetTypes = ['rotating-asset', 'spare-part']\nexport const properties = ['height', 'length', 'width', 'weight', 'color']\nexport const categories = ['home', 'auto', 'business']\n\nexport const makeInventoryFactory = dependencies => ({\n category,\n properties,\n price,\n discount,\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n}) =>\n Object.freeze({\n category,\n properties,\n price: price - (discount || 0.0),\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n })\n","'use strict'\n\nexport function makeToDoFactory (dependencies) {\n return function toDoFactory ({ text, isComplete }) {\n return Object.freeze({\n id: dependencies.uuid(),\n text,\n isComplete: isComplete || false\n })\n }\n} \n","/**\n * webswitch (c)\n *\n * Websocket clients connect to a common ws server,\n * called a webswitch. When a client sends a message,\n * webswitch broadcasts the message to all other\n * connected clients, including a special webswitch\n * server that acts as an uplink to another network,\n * if one is defined. A Webswitch server can also\n * receive messgages from an uplink and will broadcast\n * those messages to its clients as well.\n */\n\n'use strict'\n\nimport os from 'os'\nimport EventEmitter from 'events'\nimport { nanoid } from 'nanoid'\n\nconst HOSTNAME = 'webswitch.local'\nconst SERVICENAME = 'webswitch'\nconst HBEATTIMEOUT = 'heartBeatTimeout'\nconst WSOCKETERROR = 'webSocketError'\n\nconst isPrimary = /true/i.test(process.env.SWITCH)\nconst isBackup = /true/i.test(process.env.BACKUP)\nconst debug = /true/i.test(process.env.DEBUG)\nconst heartbeatMs = 10000\nconst sslEnabled = /true/i.test(process.env.SSL_ENABLED)\nconst clearPort = process.env.PORT || 80\nconst cipherPort = process.env.SSL_PORT || 443\nconst activePort = sslEnabled ? cipherPort : clearPort\nconst activeProto = sslEnabled ? 'wss' : 'ws'\nconst activeHost = process.env.DOMAIN || os.hostname()\nconst proto = isPrimary ? activeProto : process.env.SWITCH_PROTO\nconst port = isPrimary ? activePort : process.env.SWITCH_PORT\nconst host = isPrimary ? activeHost : process.env.SWITCH_HOST\nconst override = /true/i.test(process.env.SWITCH_OVERRIDE)\nconst apiProto = sslEnabled ? 'https' : 'http'\nconst apiUrl = `${apiProto}://${activeHost}:${activePort}`\n\nfunction serviceUrl () {\n const url = `${proto}://${host}:${port}`\n if (proto && host && port) return url\n if (isPrimary) throw new Error(`invalid url ${url}`)\n return null\n}\n\n/**\n * Service mesh client impl. Uses websocket and service-locator\n * adapters through ports injected into the {@link mesh} model.\n * Cf. modelSpec by the same name, i.e. `webswitch`.\n */\nexport class ServiceMeshClient extends EventEmitter {\n /**\n * The model is passed as the only arg.\n *\n * @param {import('../../domain').Model} mesh the domain model\n */\n constructor (mesh) {\n super('webswitch')\n this.url\n this.mesh = mesh\n this.name = SERVICENAME\n this.isPrimary = isPrimary\n this.isBackup = isBackup\n this.pong = true\n this.heartbeatTimer = 3000\n this.headers = {\n 'x-webswitch-host': os.hostname(),\n 'x-webswitch-role': 'node',\n 'x-webswitch-pid': process.pid\n }\n }\n\n /**\n *\n * @param {number} asyncId id's instance to kill\n * @returns {{telemetry:{mem:number,cpu:number}}}\n */\n telemetry () {\n return {\n eventName: 'telemetry',\n proto: this.name,\n apiUrl,\n heartbeatMs,\n hostname: os.hostname(),\n role: 'node',\n pid: process.pid,\n telemetry: {\n ...process.memoryUsage(),\n ...process.cpuUsage(),\n ...performance.nodeTiming\n },\n services: this.mesh.listServices(),\n events: this.mesh.listEvents(),\n socketState: this.mesh.websocketStatus() || 'undefined'\n }\n }\n\n /**\n * Zero-config, self-forming mesh network:\n * Discover URL of broker to connect to, or\n * if this is the broker, cast the local url\n * @returns {Promise} url\n */\n async resolveUrl () {\n await this.mesh.serviceLocatorInit({\n serviceUrl: serviceUrl(),\n name: this.name,\n primary: this.isPrimary,\n backup: this.isBackup\n })\n if (this.isPrimary) {\n await this.mesh.serviceLocatorAnswer()\n return serviceUrl()\n }\n return override ? serviceUrl() : this.mesh.serviceLocatorAsk()\n }\n\n /**\n * Use multicast dns to resolve broker url. Connect to\n * service mesh broker. Allow listeners to subscribe to\n * indivdual or all events. Send binary messages with\n * protocol and idempotentency headers. Periodically send\n * telemetry data.\n *\n * @param {*} options\n * @returns\n */\n async connect (options = { binary: true }) {\n this.options = options\n this.url = await this.resolveUrl()\n\n this.mesh.websocketConnect(this.url, {\n agent: false,\n headers: this.headers,\n protocol: SERVICENAME,\n useBinary: options.binary\n })\n\n this.mesh.websocketOnOpen(() => {\n console.log('connection open')\n this.send(this.telemetry())\n this.heartbeat()\n setTimeout(() => this.sendQueuedMsgs(), 3000)\n })\n\n this.mesh.websocketOnMessage(message => {\n if (!message.eventName) {\n debug && console.debug({ missingEventName: message })\n this.emit('missingEventName', message)\n return\n }\n try {\n this.emit(message.eventName, message)\n this.listeners('*').forEach(listener => listener(message))\n } catch (error) {\n console.error({ fn: this.connect.name, error })\n }\n })\n\n this.mesh.websocketOnError(error => {\n this.emit(WSOCKETERROR, error)\n console.error({ fn: this.connect.name, error })\n })\n\n this.mesh.websocketOnClose((code, reason) => {\n console.log({\n msg: 'received close frame',\n code,\n reason: reason?.toString()\n })\n clearTimeout(this.heartbeatTimer)\n setTimeout(() => {\n console.debug('reconnect due to socket close')\n this.connect()\n }, 5000)\n })\n\n this.mesh.websocketOnPong(() => (this.pong = true))\n this.once('timeout', this.timeout)\n }\n\n timeout () {\n console.warn('timeout')\n this.emit(HBEATTIMEOUT, this.telemetry())\n this.mesh.websocketTerminate()\n setTimeout(() => {\n console.debug('reconnect due to timeout')\n this.connect()\n }, 5000)\n }\n\n heartbeat () {\n if (this.pong) {\n this.pong = false\n this.mesh.websocketPing()\n this.heartbeatTimer = setTimeout(() => this.heartbeat(), heartbeatMs)\n } else {\n clearTimeout(this.heartbeatTimer)\n this.emit('timeout')\n }\n }\n\n /**\n * Convert message to binary and send with protocol and idempotency headers.\n * If message cannot be sent because of connection state or buffering queue\n * message in domain object for retry later. Using a domain object ensures\n * persistence of the queue across boots.\n *\n * @param {object} msg\n * @returns {Promise} true if sent, false if not\n */\n send (msg) {\n const sent = this.mesh.websocketSend(msg, {\n headers: {\n ...this.headers,\n 'idempotency-key': nanoid()\n }\n })\n if (sent) return true\n this.mesh.enqueue(msg)\n return false\n }\n\n /**\n * Send any messages buffered in `sendQueue`.\n */\n sendQueuedMsgs () {\n let sent = true\n while (this.mesh.queueDepth() > 0 && sent)\n sent = this.send(this.mesh.dequeue())\n }\n\n /**\n * Sends message to mesh broker service.\n * @param {*} msg\n */\n publish (msg) {\n return this.send(msg)\n }\n\n /**\n * Register handler to fire on event\n * @param {string} eventName\n * @param {function()} callback\n */\n subscribe (eventName, callback) {\n this.on(eventName, callback)\n }\n\n /**\n * A new object will be created on system reload.\n * Dispose of the old one. Run in context to\n * distinguish between the new and old instance.\n *\n * @param {*} code\n * @param {*} reason\n */\n async close (code, reason) {\n console.debug('closing socket')\n await this.mesh.save() // save queued messages\n this.removeAllListeners()\n this.mesh.websocketClose(code, reason)\n }\n}\n\n/**\n * @typedef {{\n * senderQueue:string[],\n * queueDepth:function():number,\n * connect:function(),\n * close:function(),\n * publish(object),\n * enqueue:function(string),\n * dequeue:function(),\n * subscribe:function(string,function())\n * }} serviceMeshIface\n */\n\n/**\n * Domain model factory function. This model is\n * used internally by the Aegis framework as a\n * pluggable service mesh client. Implement the\n * the methods below to create a new plugin.\n *\n * @param {*} dependencies injected depedencies\n * @returns {function({function():string[],function():string[]}):serviceMeshIface}\n */\nexport function makeClient (dependencies) {\n let client\n return function ({ listServices, listEvents }) {\n return {\n /**@type {function():string[]} */\n listServices,\n /**@type {function():string[]} */\n listEvents,\n /**@type {string[]} */\n sendQueue: [],\n /**@type {number} */\n sendQueueMax: 1000,\n\n queueDepth () {\n return this.sendQueue.length\n },\n\n enqueue (msg) {\n this.sendQueue.push(msg)\n },\n\n dequeue () {\n return this.sendQueue.shift()\n },\n\n /**\n *\n * @returns {ServiceMeshClient}\n */\n getClient () {\n if (client) return client\n client = new ServiceMeshClient(this)\n return client\n },\n\n async connect (options) {\n this.getClient().connect(options)\n },\n\n async publish (event) {\n this.getClient().publish(event)\n },\n\n subscribe (eventName, handler) {\n this.getClient().subscribe(eventName, handler)\n },\n\n async close (code, reason) {\n this.getClient().close(code, reason)\n }\n }\n }\n}\n","'use strict'\n\nexport default function makeAdapters (ports, adapters, services) {\n if (!ports || !adapters) {\n return\n }\n return Object.keys(ports)\n .map(port => {\n if (!adapters[port]) {\n return\n }\n\n try {\n return {\n [port]: adapters[port](services[ports[port].service])\n }\n } catch (e) {\n console.warn(e.message)\n }\n })\n .reduce((p, c) => ({ ...p, ...c }))\n}\n"],"names":["DataSourceAdapterCustomer","url","cacheSize","DataSourceFile","DataSourceCustomer","_DataSourceFile","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","save","id","data","_get","_getPrototypeOf","prototype","call","DataSourceAdapterCustomFile","DataSourceCustomFile","list","options","serialize","_typeof","obj","Symbol","iterator","constructor","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","protoProps","staticProps","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","Number","subClass","superClass","create","_setPrototypeOf","o","p","setPrototypeOf","bind","__proto__","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","result","NewTarget","Reflect","construct","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","sham","Proxy","Boolean","valueOf","e","getPrototypeOf","getSecret","process","env","MONGODB_CREDS","user","pass","token","archive","console","debug","DataSourceAdapterMongoDb","DataSourceMongoDb","DataSourceMongoDbArchive","_DataSourceMongoDb","datasource","factory","name","_this","creds","_delete","validateModel","freezeProperties","validateProperties","requireProperties","makeCustomerFactory","okToDelete","nanoid","Customer","modelName","endpoint","dependencies","uuid","validate","onDelete","mixins","propKey","regex","relations","orders","type","foreignKey","commands","decrypt","command","acl","runFibonacci","model","start","Date","now","fibonacci","x","param","parseFloat","isNaN","time","ports","runFibonacciCust","service","timeout","doesFieldExist","accessControlList","customer","allow","desc","makeInventoryFactory","assetTypes","properties","categories","Inventory","maxnum","values","isValid","_obj","prop","every","includes","_regeneratorRuntime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","fn","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","makeOrderFactory","readyToDelete","handleOrderEvent","orderShipped","paymentCompleted","OrderStatus","recalcTotal","requiredForCompletion","statusChangeValid","freezeOnApproval","freezeOnCompletion","orderTotalValid","returnInventory","returnShipment","refundPayment","returnDelivery","cancelPayment","updateSignature","requiredForGuest","requiredForApproval","approve","cancel","OrderError","orderPicked","updateProperties","Order","domain","update","eventHandlers","listen","notify","validateAddress","producesEvent","disabled","authorizePayment","consumesEvent","undo","pickOrder","callback","circuitBreaker","portTimeout_pickOrder_order","callVolume","errorRate","intervalMs","shipOrder","portTimeout_shipOrder_order","portRetryFailed_order","fallbackFn","trackShipment","verifyDelivery","completePayment","cancelShipment","cancelOrders","methods","approveOrders","trackAsyncContext","customHttpStatus","testContainsMany","runFibonacciJs","getFieldList","createModelEvent","inventory","arrayKey","routes","path","get","_callee","req","_callee$","_context","listModels","query","_x","_x2","_x3","post","_post","_callee2","_callee2$","_context2","createModel","body","status","json","message","ctx","t0","_x4","_x5","_x6","_get2","_callee3","_callee3$","_context3","findModel","params","_x7","_x8","_x9","patch","_patch","_callee4","_callee4$","_context4","editModel","changes","_x10","_x11","_x12","_delete2","_callee5","_callee5$","_context5","removeModel","_x13","_x14","_x15","serializers","on","enabled","makeToDoFactory","ToDo","baseClass","makeClient","WebSwitch","internal","serviceLocatorInit","serviceLocatorAsk","serviceLocatorAnswer","websocketConnect","websocketPing","websocketSend","websocketClose","websocketStatus","websocketTerminate","websocketOnClose","websocketOnOpen","websocketOnMessage","websocketOnError","websocketOnPong","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","minLen","_arrayLikeToArray","n","toString","Array","from","test","len","arr2","_i","_s","_e","_r","_arr","_n","_d","isArray","ownKeys","enumerableOnly","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","_objectSpread","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","GlobalMixins","bindAdapters","services","adapters","modelSpecs","validateSpec","spec","missing","concat","entries","makeModel","models","map","_ref","_ref2","k","v","category","price","discount","sku","purchaseOrder","vendor","inStock","assetType","quantity","freeze","toDoFactory","text","isComplete","os","EventEmitter","HOSTNAME","SERVICENAME","HBEATTIMEOUT","WSOCKETERROR","isPrimary","SWITCH","isBackup","BACKUP","DEBUG","heartbeatMs","sslEnabled","SSL_ENABLED","clearPort","PORT","cipherPort","SSL_PORT","activePort","activeProto","activeHost","DOMAIN","hostname","proto","SWITCH_PROTO","port","SWITCH_PORT","host","SWITCH_HOST","override","SWITCH_OVERRIDE","apiProto","apiUrl","serviceUrl","ServiceMeshClient","_EventEmitter","mesh","pong","heartbeatTimer","headers","pid","telemetry","eventName","role","memoryUsage","cpuUsage","performance","nodeTiming","listServices","events","listEvents","socketState","_resolveUrl","primary","backup","resolveUrl","_connect","_this2","_args2","binary","agent","protocol","useBinary","log","send","heartbeat","setTimeout","sendQueuedMsgs","missingEventName","emit","listeners","listener","connect","code","reason","msg","clearTimeout","once","_this3","warn","_this4","enqueue","queueDepth","dequeue","publish","subscribe","_close","removeAllListeners","close","client","sendQueue","sendQueueMax","shift","getClient","_this5","event","_this6","handler","_this7","_callee6","_callee6$","_context6","makeAdapters","reduce","c"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"829.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CACpCC,GAAG,EACHC,SAAS,EACTC,cAAc,EACd;EACA;AACF;AACA;EAFE,IAGMC,kBAAkB,0BAAAC,eAAA;IAAAC,SAAA,CAAAF,kBAAA,EAAAC,eAAA;IAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,kBAAA;IAAA,SAAAA,mBAAA;MAAAK,eAAA,OAAAL,kBAAA;MAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;IAAA;IAAAC,YAAA,CAAAR,kBAAA;MAAAS,GAAA;MAAAC,KAAA,EACtB,SAAAC,KAAMC,EAAE,EAAEC,IAAI,EAAE;QACdC,IAAA,CAAAC,eAAA,CAAAf,kBAAA,CAAAgB,SAAA,iBAAAC,IAAA,OAAWL,EAAE,EAAEC,IAAI;MACrB;IAAC;IAAA,OAAAb,kBAAA;EAAA,EAH8BD,cAAc;EAM/C,OAAOC,kBAAkB;AAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACfM,IAAMkB,2BAA2B,GAAG,SAA9BA,2BAA2BA,CACtCrB,GAAG,EACHC,SAAS,EACTC,cAAc,EACd;EACA;AACF;AACA;EAFE,IAGMoB,oBAAoB,0BAAAlB,eAAA;IAAAC,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AE;IACX,CAAC;IACDiR,gBAAgB,EAAE;MAChBlR,OAAO,EAAE,WAAW;MACpBnB,IAAI,EAAE,UAAU;MAChBoB,OAAO,EAAE;IACX,CAAC;IACDkR,eAAe,EAAE;MACfnR,OAAO,EAAE,WAAW;MACpBnB,IAAI,EAAE,UAAU;MAChBoB,OAAO,EAAE;IACX;EACF;AACF,CAAC;;;;;;;;;;;;;;;;;;;;ACpFW;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;A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C;EAAA,CAAG,CAAC;AACvC","sources":["webpack://aegis-app/./src/adapters/datasources/datasource-adapter-customer.js","webpack://aegis-app/./src/adapters/datasources/datasource-adapter-file.js","webpack://aegis-app/./src/adapters/datasources/datasource-mongodb.js","webpack://aegis-app/./src/domain/config/customer.js","webpack://aegis-app/./src/domain/config/index.js","webpack://aegis-app/./src/domain/config/inventory.js","webpack://aegis-app/./src/domain/config/order.js","webpack://aegis-app/./src/domain/config/todo.js","webpack://aegis-app/./src/domain/config/webswitch.js","webpack://aegis-app/./src/domain/index.js","webpack://aegis-app/./src/domain/models/inventory.js","webpack://aegis-app/./src/domain/models/todo.js","webpack://aegis-app/./src/domain/models/webswitch.js","webpack://aegis-app/./src/domain/util/bind-adapters.js"],"sourcesContent":["export const DataSourceAdapterCustomer = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomer extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n }\n\n return DataSourceCustomer\n}\n","export const DataSourceAdapterCustomFile = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomFile extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n\n list (options) {\n return super.list(options)\n }\n\n serialize () {\n return false\n }\n }\n\n return DataSourceCustomFile\n}\n","'use strict'\n\nfunction getSecret () {\n return process.env.MONGODB_CREDS || { user: null, pass: null, token: null }\n}\n\nfunction archive (id) {\n console.debug('mock archive', id)\n}\n\n/**\n * Datasource adapter factory.\n * @param {string} url database url\n * @param {number} [cacheSize] number of models to keep in cache\n * @param {*} DataSource base class that enables caching\n * @returns {import(\"./datasource\").default}\n */\nexport const DataSourceAdapterMongoDb = function (\n url,\n cacheSize,\n DataSourceMongoDb\n) {\n /**\n * MongoDB adapter extends in-memory datasource to support caching.\n * The cache is always updated first, which allows the system to run\n * even when the database is offline.\n */\n class DataSourceMongoDbArchive extends DataSourceMongoDb {\n constructor (datasource, factory, name) {\n super(datasource, factory, name)\n this.url = url\n this.cacheSize = cacheSize\n this.creds = getSecret()\n }\n\n /**\n * @override\n */\n delete (id) {\n console.debug('archive', id)\n archive(id)\n }\n }\n\n return DataSourceMongoDbArchive\n}\n","'use strict'\n\nimport {\n validateModel,\n freezeProperties,\n validateProperties,\n requireProperties\n} from '../util/mixins'\nimport { makeCustomerFactory, okToDelete } from '../models/customer'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterCustomer } from '../../adapters/datasources/datasource-adapter-customer'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Customer = {\n modelName: 'customer',\n endpoint: 'customers',\n dependencies: { uuid: () => nanoid(8) },\n factory: makeCustomerFactory,\n validate: validateModel,\n onDelete: okToDelete,\n // datasource: {\n // factory: DataSourceAdapterCustomer,\n // cacheSize: 4000,\n // baseClass: 'DataSourceFile'\n // },\n mixins: [\n freezeProperties('customerId'),\n requireProperties(\n 'firstName',\n 'lastName',\n 'email',\n 'shippingAddress',\n 'billingAddress',\n 'creditCardNumber'\n ),\n validateProperties([\n {\n propKey: 'email',\n // unique: { encrypted: true },\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n }\n ])\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'customerId'\n }\n },\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n ports: {\n runFibonacciCust: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n },\n doesFieldExist: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n }\n },\n accessControlList: {\n customer: {\n allow: 'read',\n type: 'relation',\n desc: 'Allow orders to see customers.'\n }\n }\n}\n","export * from './webswitch' // always export this\nexport * from './order'\nexport * from './customer'\nexport * from './inventory'\nexport * from './todo'\n// export * from './user'\n// export * from './query-engine'\n// export * from './dam-api'\n// export * from './ticket-master'\n// export * from './access-controller'\n","'use strict'\n\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport {\n makeInventoryFactory,\n assetTypes,\n properties,\n categories\n} from '../models/inventory'\n\nimport {\n requireProperties,\n freezeProperties,\n validateProperties\n} from '../util/mixins'\n\n/**\n * @type {import(\"../domain/order\").ModelSpecification}\n */\nexport const Inventory = {\n modelName: 'inventory',\n endpoint: 'inventory',\n dependencies: {},\n factory: makeInventoryFactory,\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n mixins: [\n requireProperties('name', 'inStock', 'category', 'price', 'purchaseOrder'),\n validateProperties([\n {\n propKey: 'inStock',\n typeof: 'number',\n maxnum: 99999\n },\n {\n propKey: 'category',\n values: categories\n },\n {\n propKey: 'assetType',\n values: assetTypes\n },\n {\n propKey: 'properties',\n isValid: (_obj, prop) => prop.every(p => properties.includes(p))\n },\n {\n propKey: 'price',\n typeof: 'number',\n maxnum: 999.99\n }\n ]),\n freezeProperties('*')\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'itemId',\n desc: 'many items per order'\n }\n }\n}\n","'use strict'\n\nimport {\n makeOrderFactory,\n readyToDelete,\n handleOrderEvent,\n orderShipped,\n paymentCompleted,\n OrderStatus,\n recalcTotal,\n requiredForCompletion,\n statusChangeValid,\n freezeOnApproval,\n freezeOnCompletion,\n orderTotalValid,\n returnInventory,\n returnShipment,\n refundPayment,\n returnDelivery,\n cancelPayment,\n updateSignature,\n requiredForGuest,\n requiredForApproval,\n approve,\n cancel,\n OrderError,\n orderPicked\n} from '../models/order'\n\nimport {\n requireProperties,\n freezeProperties,\n updateProperties,\n validateProperties,\n validateModel\n} from '../util/mixins'\n\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Order = {\n endpoint: 'orders',\n factory: makeOrderFactory,\n domain: 'order',\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n dependencies: { uuid: () => nanoid(8) },\n mixins: [\n requireProperties(\n 'orderItems',\n requiredForGuest([\n 'lastName',\n 'firstName',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'email'\n ]),\n requiredForApproval('paymentStatus'),\n requiredForCompletion('proofOfDelivery')\n ),\n freezeProperties(\n 'orderNo',\n 'customerId',\n freezeOnApproval([\n 'email',\n 'lastName',\n 'firstName',\n 'orderItems',\n 'orderTotal',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'paymentStatus'\n ]),\n freezeOnCompletion('*')\n ),\n updateProperties([\n {\n propKey: 'orderItems',\n update: recalcTotal\n },\n {\n propKey: 'orderItems',\n update: updateSignature\n }\n ]),\n validateProperties([\n {\n propKey: 'orderStatus',\n values: Object.values(OrderStatus),\n isValid: statusChangeValid\n },\n {\n propKey: 'orderTotal',\n maxnum: 99999.99,\n isValid: orderTotalValid\n },\n {\n propKey: 'email',\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n },\n {\n propKey: 'phone',\n regex: 'phone'\n }\n ])\n // allowProperties([fibonacci, time, result])\n ],\n validate: validateModel,\n onDelete: readyToDelete,\n eventHandlers: [handleOrderEvent],\n ports: {\n listen: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n notify: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n validateAddress: {\n service: 'Address',\n type: 'outbound',\n keys: 'shippingAddress',\n producesEvent: 'addressValidated',\n disabled: true\n },\n authorizePayment: {\n service: 'Payment',\n type: 'outbound',\n keys: 'paymentStatus',\n consumesEvent: 'startWorkflow',\n producesEvent: 'paymentAuthorized',\n undo: cancelPayment,\n disabled: true\n },\n pickOrder: {\n service: 'Inventory',\n type: 'outbound',\n keys: 'pickupAddress',\n callback: orderPicked,\n consumesEvent: 'itemsAvailable',\n producesEvent: 'orderPicked',\n undo: returnInventory,\n circuitBreaker: {\n portTimeout_pickOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 5000\n }\n }\n },\n shipOrder: {\n service: 'Shipping',\n type: 'outbound',\n callback: orderShipped,\n consumesEvent: 'orderPicked',\n producesEvent: 'orderShipped',\n undo: returnShipment,\n circuitBreaker: {\n portTimeout_shipOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n },\n portRetryFailed_order: {\n callVolume: 3,\n errorRate: 2,\n intervalMs: 60000,\n fallbackFn: cancel\n },\n default: {\n callVolume: 3,\n errorRate: 3,\n intervalMs: 60000\n }\n }\n },\n trackShipment: {\n service: 'Shipping',\n type: 'outbound',\n keys: ['trackingStatus', 'trackingId'],\n consumesEvent: 'orderShipped',\n producesEvent: 'orderDelivered',\n circuitBreaker: {\n portRetryFailed_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n }\n }\n },\n verifyDelivery: {\n service: 'Shipping',\n type: 'outbound',\n keys: 'proofOfDelivery',\n consumesEvent: 'orderDelivered',\n producesEvent: 'deliveryVerified',\n undo: returnDelivery\n },\n completePayment: {\n service: 'Payment',\n type: 'outbound',\n callback: paymentCompleted,\n consumesEvent: 'deliveryVerified',\n producesEvent: 'orderComplete',\n undo: refundPayment\n },\n cancelShipment: {\n service: 'Shipping',\n type: 'outbound'\n },\n refundPayment: {\n service: 'Payment',\n type: 'outbound'\n },\n cancelOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['post']\n },\n approveOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['patch']\n },\n trackAsyncContext: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n customHttpStatus: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n testContainsMany: {\n service: 'Inventory',\n type: 'inbound',\n timeout: 0\n },\n runFibonacciJs: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n getFieldList: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n createModelEvent: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n }\n },\n relations: {\n customer: {\n modelName: 'customer',\n type: 'manyToOne',\n foreignKey: 'customerId',\n desc: 'Many orders per customer, just one customer per order'\n },\n inventory: {\n modelName: 'inventory',\n type: 'containsMany',\n foreignKey: 'itemId',\n arrayKey: 'orderItems',\n desc: 'An order contains a list of inventory items to ship.'\n }\n },\n routes: [\n {\n path: '/orders',\n get: async (req, res, ports) =>\n ports.listModels({\n writable: res,\n query: req.query\n }),\n\n post: async (req, res, ports) => {\n try {\n const result = await ports.createModel(req.body)\n res\n .status(200)\n .json({ message: 'ok', ctx: result.context, id: result.id })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n }\n },\n {\n path: '/orders/:id',\n get: async (req, res, ports) => ports.findModel(req.params.id),\n patch: async (req, res, ports) => {\n try {\n const result = await ports.editModel({\n id: req.params.id,\n changes: req.body\n })\n res.status(200).json({ message: 'ok', ctx: result.context })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n },\n delete: async (req, res, ports) => {\n ports.removeModel(req.params.id)\n res.status(200).json({ message: 'ok' })\n }\n }\n ],\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n approve: {\n command: approve,\n acl: ['write', 'approve']\n },\n cancel: {\n command: cancel,\n acl: ['write', 'cancel']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n serializers: [\n {\n on: 'deserialize',\n key: 'creditCardNumber',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n },\n {\n on: 'deserialize',\n key: 'shippingAddress',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n }\n // {\n // on: 'deserialize',\n // key: 'billingAddress',\n // type: 'string',\n // value: (key, value) => decrypt(value),\n // enabled: false\n // }\n ]\n}\n","'use strict'\n\nimport { DataSourceAdapterCustomFile } from '../../adapters/datasources/datasource-adapter-file'\nimport { makeToDoFactory } from '../models/todo'\nimport { nanoid } from 'nanoid'\n\n/**\n * @type {import('../index').ModelSpecification}\n */\nexport const ToDo = {\n modelName: 'todo',\n endpoint: 'todo',\n dependencies: { uuid: nanoid },\n factory: makeToDoFactory,\n datasource: {\n factory: DataSourceAdapterCustomFile,\n cacheSize: 4000,\n baseClass: 'DataSourceFile'\n }\n}\n","'use strict'\n\nimport { makeClient } from '../models/webswitch'\n\n/**\n * @type {import('../domain').ModelSpecification}\n */\nexport const WebSwitch = {\n modelName: 'webswitch',\n endpoint: 'appfabric',\n factory: makeClient,\n internal: true,\n ports: {\n serviceLocatorInit: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAsk: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAnswer: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n websocketConnect: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketPing: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketSend: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketStatus: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketTerminate: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnOpen: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnMessage: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnError: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnPong: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n }\n }\n}\n","'use strict'\n\n/**\n * @typedef {string} eventName\n */\n\n/**\n * @typedef Model\n * @property {string} _Symbol_id - immutable/private uuid\n * @property {string} _Symbol_modelName - immutable/private name\n * @property {string} _Symbol_createTime - immutable/private createTime\n * @property {onUpdate} _Symbol_onUpdate - immutable/private update function\n * @property {onDelete} _Symbol_onDelete\n * @property {function(Object)} update - use this function to update model\n * specify changes in an object\n * @property {function()} toJSON - de/serialization logic\n * @property {function(eventName,function(eventName,Model):void)} addListener listen for domain events\n * @property {function(eventName,Model):Promise} emit emit domain event\n * @property {function(function():Promise):Promise} [port] - when a\n * port is configured, the framework generates a function to invoke it. When data\n * arrives on the port, depending on the implementation, the port's adapter invokes\n * the callback specified in the port configuration, or as an argument to the port\n * function. The callback returns an updated Model, and control is returned to the\n * caller. Optionally, an event is fired to trigger the next port function to run\n * @property {function():Promise} [relation] - when you configure a relation,\n * the framework generates a function that your code can call to run the query\n * @property {function(*):*} [command] - the framework will call any model method\n * you specify when passed as a parameter or query in an API call.\n */\n\n/**\n * @callback onUpdate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onDelete\n * @param {Model} model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback validate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onLoad\n * @param {Model} savedModel rehydrated model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @typedef {string} service - name of the service object to inject in adapter\n * @typedef {number} timeout - call to adapter will timeout after `timeout` milliseconds\n *\n * @typedef {{\n * [x: string]: {\n * service: service,\n * timeout?: timeout,\n * callback?: function({model: Model})\n * errorCallback?: function({model: Model, port: string, error:Error}),\n * timeoutCallback?: function({model: Model, port: string}),\n * consumesEvent?:string,\n * producesEvent?:string,\n * type?:'inbound'|'outbound',\n * disabled?: boolean,\n * adapter?: string,\n * circuitBreaker?: thresholds\n * }\n * }} ports - input/output ports for the domain\n */\n\n/**\n * @typedef {{\n * [x:string]: {\n * errorRate:number\n * callVolume:number,\n * intervalMs:number,\n * fallbackFn:function()\n * },\n * }} thresholds - thresholds for different errors\n */\n\n/**\n * @typedef {{\n * [x: string]: {\n * modelName:string,\n * type:\"oneToMany\"|\"oneToOne\"|\"manyToOne\",\n * foreignKey:any,\n * }\n * }} relations - define related domain entities\n *\n * @typedef {Array>} eventHandler - callbacks invoked to handle domain and\n * application events\n */\n\n/**\n *\n * @typedef {string} key\n * @typedef {*} value\n */\n\n/**\n * @typedef {{\n * on: \"serialize\" | \"deserialize\",\n * key: string | RegExp | \"*\" | (function(key,value):boolean)\n * type: \"string\" | \"object\" | \"number\" | \"function\" | \"any\" | (function(key,value):boolean)\n * value(key, value):value\n * }} serializer\n */\n/**\n * @typedef {{\n * [x:string]: {\n * allow:string|function(*):boolean|Array\n * deny:string|function(*):boolean|Array\n * type:\"role\"|\"relation\"|\"command\"\n * desc?:string\n * }\n * }} accessControlList\n */\n/**\n * @typedef {{\n * [x: string]: {\n * command:string|function(Model):Promise,\n * acl:accessControlList[]\n * }\n * }} commands - configure functions to execute when specified in a\n * URL parameter or query of the auto-generate REST API\n */\n/**\n * @callback controller\n * @param {Request} req\n * @param {Response} res\n */\n\n/**\n * @typedef {{\n * [path: string]: {\n * get?: controller,\n * post?: controller,\n * patch?: controller,\n * delete?:controller\n * }\n * }} endpoints\n */\n\n/**\n * @callback modelSpecFactoryFn\n * @param {object} dependencies\n * @returns {function(...args):Readonly}\n */\n\n/**\n * @typedef {object} ModelSpecification Specify domain model properties and functions\n * @property {string} modelName name of model (case-insenstive)\n * @property {string} endpoint URI reference (e.g. plural of `modelName` noun)\n * @property {modelSpecFactoryFn} factory returns factory function that creates the model instance\n * @property {object} [dependencies] injected into the model for inverted dependency/control\n * @property {Array} [mixins] - use functional mixins\n * to compose the object from common domain logic, like input validation.\n * @property {onUpdate} [onUpdate] - Function called to handle update requests. Called\n * before save.\n * @property {onDelete} [onDelete] - Function called before deletion.\n * @property {validate} [validate] - called to validate model updates\n * @property {ports} [ports] - input/output ports for the domain\n * @property {eventHandler[]} [eventHandlers] - callbacks invoked to handle CRUD events\n * @property {serializer[]} [serializers] - use for custom de/serialization of the model\n * when reading or writing to storage or network\n * @property {relations} [relations] - create related models or query in aggregate\n * @property {commands} [commands] - define functions to execute when specified in a\n * URL parameter or query of the auto-generated REST API\n * @property {accessControlList} [accessControlList] - configure authorization\n * @property {endpoints} [routes] - additional custom API endpoints - specify inbound port\n * @property {{factory:import(\"../adapters/datasources/datasource-mongodb\"),url:string,credentials?:string}} [datasource] - custom datasource\n * for this model. If not set, the default set by the server is used.\n *\n */\n\n/**\n * @callback addModel\n * @param {{ searchTerm1, searchTerm2, searchTermN }} input\n * @returns {Promise}\n */\n\n/**\n * @callback editModel\n * @param {{ id:string, changes:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findModel\n * @param {{ id:string, query:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findRelatedModels\n * @param {{ query:object, relation:string }} input\n * @returns { Promise<{Model,[Model]}> }\n */\n\n/**\n * @callback listModels\n * @param {{ query:object }} input e.g. { searchTerm1 : 'val', ...etc }\n * @returns { [Promise] }\n */\n\n/**\n * @callback executeCommand\n * @param {{ id:string }} input\n * @returns { Model }\n */\n\n/**\n * @typedef DomainPortAPI\n * @property { addModel } addModel\n * @property { editModel } editModel\n * @property { listModels } listModels\n * @property { findModel } findModel\n * @property { findRelatedModels } findModel\n * @property { removeModel } removeModel\n * @property { executeCommand } executeCommand\n */\n\nimport GlobalMixins from './util/mixins'\nimport bindAdapters from './util/bind-adapters'\n\n// Service dependencies\nimport * as services from '../services'\nimport * as adapters from '../adapters'\nimport * as ports from './ports'\n// Models\nimport * as modelSpecs from './config'\n\nfunction validateSpec (spec) {\n const missing = ['endpoint', 'factory'].filter(key => !spec[key])\n if (missing?.length > 0) {\n throw new Error(\n `missing properties: ${missing}, spec: ${Object.entries(spec)}`\n )\n }\n}\n\n/**\n * @param {ModelSpecification} spec\n * @param {*} dependencies - services injected\n */\nfunction makeModel (spec, modelName) {\n validateSpec(spec)\n const mixins = spec.mixins || []\n const dependencies = spec.dependencies || {}\n return {\n ...spec,\n modelName: modelName.toUpperCase(),\n mixins: mixins.concat(GlobalMixins),\n dependencies: {\n ...dependencies,\n ...bindAdapters(spec.ports, adapters, services)\n }\n }\n}\n\nexport const models = Object.entries(modelSpecs)\n .map(([k, v]) => ({ [k.toUpperCase()]: makeModel(v, k) }))\n .reduce((a, b) => ({ ...a, ...b }))\n\n","'use strict'\n\nexport const assetTypes = ['rotating-asset', 'spare-part']\nexport const properties = ['height', 'length', 'width', 'weight', 'color']\nexport const categories = ['home', 'auto', 'business']\n\nexport const makeInventoryFactory = dependencies => ({\n category,\n properties,\n price,\n discount,\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n}) =>\n Object.freeze({\n category,\n properties,\n price: price - (discount || 0.0),\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n })\n","'use strict'\n\nexport function makeToDoFactory (dependencies) {\n return function toDoFactory ({ text, isComplete }) {\n return Object.freeze({\n id: dependencies.uuid(),\n text,\n isComplete: isComplete || false\n })\n }\n} \n","/**\n * webswitch (c)\n *\n * Websocket clients connect to a common ws server,\n * called a webswitch. When a client sends a message,\n * webswitch broadcasts the message to all other\n * connected clients, including a special webswitch\n * server that acts as an uplink to another network,\n * if one is defined. A Webswitch server can also\n * receive messgages from an uplink and will broadcast\n * those messages to its clients as well.\n */\n\n'use strict'\n\nimport os from 'os'\nimport EventEmitter from 'events'\nimport { nanoid } from 'nanoid'\n\nconst HOSTNAME = 'webswitch.local'\nconst SERVICENAME = 'webswitch'\nconst HBEATTIMEOUT = 'heartBeatTimeout'\nconst WSOCKETERROR = 'webSocketError'\n\nconst isPrimary = /true/i.test(process.env.SWITCH)\nconst isBackup = /true/i.test(process.env.BACKUP)\nconst debug = /true/i.test(process.env.DEBUG)\nconst heartbeatMs = 10000\nconst sslEnabled = /true/i.test(process.env.SSL_ENABLED)\nconst clearPort = process.env.PORT || 80\nconst cipherPort = process.env.SSL_PORT || 443\nconst activePort = sslEnabled ? cipherPort : clearPort\nconst activeProto = sslEnabled ? 'wss' : 'ws'\nconst activeHost = process.env.DOMAIN || os.hostname()\nconst proto = isPrimary ? activeProto : process.env.SWITCH_PROTO\nconst port = isPrimary ? activePort : process.env.SWITCH_PORT\nconst host = isPrimary ? activeHost : process.env.SWITCH_HOST\nconst override = /true/i.test(process.env.SWITCH_OVERRIDE)\nconst apiProto = sslEnabled ? 'https' : 'http'\nconst apiUrl = `${apiProto}://${activeHost}:${activePort}`\n\nfunction serviceUrl () {\n const url = `${proto}://${host}:${port}`\n if (proto && host && port) return url\n if (isPrimary) throw new Error(`invalid url ${url}`)\n return null\n}\n\n/**\n * Service mesh client impl. Uses websocket and service-locator\n * adapters through ports injected into the {@link mesh} model.\n * Cf. modelSpec by the same name, i.e. `webswitch`.\n */\nexport class ServiceMeshClient extends EventEmitter {\n /**\n * The model is passed as the only arg.\n *\n * @param {import('../../domain').Model} mesh the domain model\n */\n constructor (mesh) {\n super('webswitch')\n this.url\n this.mesh = mesh\n this.name = SERVICENAME\n this.isPrimary = isPrimary\n this.isBackup = isBackup\n this.pong = true\n this.heartbeatTimer = 3000\n this.headers = {\n 'x-webswitch-host': os.hostname(),\n 'x-webswitch-role': 'node',\n 'x-webswitch-pid': process.pid\n }\n }\n\n /**\n *\n * @param {number} asyncId id's instance to kill\n * @returns {{telemetry:{mem:number,cpu:number}}}\n */\n telemetry () {\n return {\n eventName: 'telemetry',\n proto: this.name,\n apiUrl,\n heartbeatMs,\n hostname: os.hostname(),\n role: 'node',\n pid: process.pid,\n telemetry: {\n ...process.memoryUsage(),\n ...process.cpuUsage(),\n ...performance.nodeTiming\n },\n services: this.mesh.listServices(),\n events: this.mesh.listEvents(),\n socketState: this.mesh.websocketStatus() || 'undefined'\n }\n }\n\n /**\n * Zero-config, self-forming mesh network:\n * Discover URL of broker to connect to, or\n * if this is the broker, cast the local url\n * @returns {Promise} url\n */\n async resolveUrl () {\n await this.mesh.serviceLocatorInit({\n serviceUrl: serviceUrl(),\n name: this.name,\n primary: this.isPrimary,\n backup: this.isBackup\n })\n if (this.isPrimary) {\n await this.mesh.serviceLocatorAnswer()\n return serviceUrl()\n }\n return override ? serviceUrl() : this.mesh.serviceLocatorAsk()\n }\n\n /**\n * Use multicast dns to resolve broker url. Connect to\n * service mesh broker. Allow listeners to subscribe to\n * indivdual or all events. Send binary messages with\n * protocol and idempotentency headers. Periodically send\n * telemetry data.\n *\n * @param {*} options\n * @returns\n */\n async connect (options = { binary: true }) {\n this.options = options\n this.url = await this.resolveUrl()\n\n this.mesh.websocketConnect(this.url, {\n agent: false,\n headers: this.headers,\n protocol: SERVICENAME,\n useBinary: options.binary\n })\n\n this.mesh.websocketOnOpen(() => {\n console.log('connection open')\n this.send(this.telemetry())\n this.heartbeat()\n setTimeout(() => this.sendQueuedMsgs(), 3000)\n })\n\n this.mesh.websocketOnMessage(message => {\n if (!message.eventName) {\n debug && console.debug({ missingEventName: message })\n this.emit('missingEventName', message)\n return\n }\n try {\n this.emit(message.eventName, message)\n this.listeners('*').forEach(listener => listener(message))\n } catch (error) {\n console.error({ fn: this.connect.name, error })\n }\n })\n\n this.mesh.websocketOnError(error => {\n this.emit(WSOCKETERROR, error)\n console.error({ fn: this.connect.name, error })\n })\n\n this.mesh.websocketOnClose((code, reason) => {\n console.log({\n msg: 'received close frame',\n code,\n reason: reason?.toString()\n })\n clearTimeout(this.heartbeatTimer)\n setTimeout(() => {\n console.debug('reconnect due to socket close')\n this.connect()\n }, 5000)\n })\n\n this.mesh.websocketOnPong(() => (this.pong = true))\n this.once('timeout', this.timeout)\n }\n\n timeout () {\n console.warn('timeout')\n this.emit(HBEATTIMEOUT, this.telemetry())\n this.mesh.websocketTerminate()\n setTimeout(() => {\n console.debug('reconnect due to timeout')\n this.connect()\n }, 5000)\n }\n\n heartbeat () {\n if (this.pong) {\n this.pong = false\n this.mesh.websocketPing()\n this.heartbeatTimer = setTimeout(() => this.heartbeat(), heartbeatMs)\n } else {\n clearTimeout(this.heartbeatTimer)\n this.emit('timeout')\n }\n }\n\n /**\n * Convert message to binary and send with protocol and idempotency headers.\n * If message cannot be sent because of connection state or buffering queue\n * message in domain object for retry later. Using a domain object ensures\n * persistence of the queue across boots.\n *\n * @param {object} msg\n * @returns {Promise} true if sent, false if not\n */\n send (msg) {\n const sent = this.mesh.websocketSend(msg, {\n headers: {\n ...this.headers,\n 'idempotency-key': nanoid()\n }\n })\n if (sent) return true\n this.mesh.enqueue(msg)\n return false\n }\n\n /**\n * Send any messages buffered in `sendQueue`.\n */\n sendQueuedMsgs () {\n let sent = true\n while (this.mesh.queueDepth() > 0 && sent)\n sent = this.send(this.mesh.dequeue())\n }\n\n /**\n * Sends message to mesh broker service.\n * @param {*} msg\n */\n publish (msg) {\n return this.send(msg)\n }\n\n /**\n * Register handler to fire on event\n * @param {string} eventName\n * @param {function()} callback\n */\n subscribe (eventName, callback) {\n this.on(eventName, callback)\n }\n\n /**\n * A new object will be created on system reload.\n * Dispose of the old one. Run in context to\n * distinguish between the new and old instance.\n *\n * @param {*} code\n * @param {*} reason\n */\n async close (code, reason) {\n console.debug('closing socket')\n await this.mesh.save() // save queued messages\n this.removeAllListeners()\n this.mesh.websocketClose(code, reason)\n }\n}\n\n/**\n * @typedef {{\n * senderQueue:string[],\n * queueDepth:function():number,\n * connect:function(),\n * close:function(),\n * publish(object),\n * enqueue:function(string),\n * dequeue:function(),\n * subscribe:function(string,function())\n * }} serviceMeshIface\n */\n\n/**\n * Domain model factory function. This model is\n * used internally by the Aegis framework as a\n * pluggable service mesh client. Implement the\n * the methods below to create a new plugin.\n *\n * @param {*} dependencies injected depedencies\n * @returns {function({function():string[],function():string[]}):serviceMeshIface}\n */\nexport function makeClient (dependencies) {\n let client\n return function ({ listServices, listEvents }) {\n return {\n /**@type {function():string[]} */\n listServices,\n /**@type {function():string[]} */\n listEvents,\n /**@type {string[]} */\n sendQueue: [],\n /**@type {number} */\n sendQueueMax: 1000,\n\n queueDepth () {\n return this.sendQueue.length\n },\n\n enqueue (msg) {\n this.sendQueue.push(msg)\n },\n\n dequeue () {\n return this.sendQueue.shift()\n },\n\n /**\n *\n * @returns {ServiceMeshClient}\n */\n getClient () {\n if (client) return client\n client = new ServiceMeshClient(this)\n return client\n },\n\n async connect (options) {\n this.getClient().connect(options)\n },\n\n async publish (event) {\n this.getClient().publish(event)\n },\n\n subscribe (eventName, handler) {\n this.getClient().subscribe(eventName, handler)\n },\n\n async close (code, reason) {\n this.getClient().close(code, reason)\n }\n }\n }\n}\n","'use strict'\n\nexport default function makeAdapters (ports, adapters, services) {\n if (!ports || !adapters) {\n return\n }\n return Object.keys(ports)\n .map(port => {\n if (!adapters[port]) {\n return\n }\n\n try {\n return {\n [port]: adapters[port](services[ports[port].service])\n }\n } catch (e) {\n console.warn(e.message)\n }\n })\n .reduce((p, c) => ({ ...p, ...c }))\n}\n"],"names":["DataSourceAdapterCustomer","url","cacheSize","DataSourceFile","DataSourceCustomer","_DataSourceFile","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","save","id","data","_get","_getPrototypeOf","prototype","call","DataSourceAdapterCustomFile","DataSourceCustomFile","list","options","serialize","_typeof","obj","Symbol","iterator","constructor","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","protoProps","staticProps","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","Number","subClass","superClass","create","_setPrototypeOf","o","p","setPrototypeOf","bind","__proto__","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","result","NewTarget","Reflect","construct","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","sham","Proxy","Boolean","valueOf","e","getPrototypeOf","getSecret","process","env","MONGODB_CREDS","user","pass","token","archive","console","debug","DataSourceAdapterMongoDb","DataSourceMongoDb","DataSourceMongoDbArchive","_DataSourceMongoDb","datasource","factory","name","_this","creds","_delete","validateModel","freezeProperties","validateProperties","requireProperties","makeCustomerFactory","okToDelete","nanoid","Customer","modelName","endpoint","dependencies","uuid","validate","onDelete","mixins","propKey","regex","relations","orders","type","foreignKey","commands","decrypt","command","acl","runFibonacci","model","start","Date","now","fibonacci","x","param","parseFloat","isNaN","time","ports","runFibonacciCust","service","timeout","doesFieldExist","accessControlList","customer","allow","desc","makeInventoryFactory","assetTypes","properties","categories","Inventory","maxnum","values","isValid","_obj","prop","every","includes","_regeneratorRuntime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","fn","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","makeOrderFactory","readyToDelete","handleOrderEvent","orderShipped","paymentCompleted","OrderStatus","recalcTotal","requiredForCompletion","statusChangeValid","freezeOnApproval","freezeOnCompletion","orderTotalValid","returnInventory","returnShipment","refundPayment","returnDelivery","cancelPayment","updateSignature","requiredForGuest","requiredForApproval","approve","cancel","OrderError","orderPicked","updateProperties","Order","domain","update","eventHandlers","listen","notify","validateAddress","producesEvent","disabled","authorizePayment","consumesEvent","undo","pickOrder","callback","circuitBreaker","portTimeout_pickOrder_order","callVolume","errorRate","intervalMs","shipOrder","portTimeout_shipOrder_order","portRetryFailed_order","fallbackFn","trackShipment","verifyDelivery","completePayment","cancelShipment","cancelOrders","methods","approveOrders","trackAsyncContext","customHttpStatus","testContainsMany","runFibonacciJs","getFieldList","createModelEvent","inventory","arrayKey","routes","path","get","_callee","req","_callee$","_context","listModels","query","_x","_x2","_x3","post","_post","_callee2","_callee2$","_context2","createModel","body","status","json","message","ctx","t0","_x4","_x5","_x6","_get2","_callee3","_callee3$","_context3","findModel","params","_x7","_x8","_x9","patch","_patch","_callee4","_callee4$","_context4","editModel","changes","_x10","_x11","_x12","_delete2","_callee5","_callee5$","_context5","removeModel","_x13","_x14","_x15","serializers","on","enabled","makeToDoFactory","ToDo","baseClass","makeClient","WebSwitch","internal","serviceLocatorInit","serviceLocatorAsk","serviceLocatorAnswer","websocketConnect","websocketPing","websocketSend","websocketClose","websocketStatus","websocketTerminate","websocketOnClose","websocketOnOpen","websocketOnMessage","websocketOnError","websocketOnPong","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","minLen","_arrayLikeToArray","n","toString","Array","from","test","len","arr2","_i","_s","_e","_r","_arr","_n","_d","isArray","ownKeys","enumerableOnly","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","_objectSpread","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","GlobalMixins","bindAdapters","services","adapters","modelSpecs","validateSpec","spec","missing","concat","entries","makeModel","toUpperCase","models","map","_ref","_ref2","k","v","reduce","a","b","category","price","discount","sku","purchaseOrder","vendor","inStock","assetType","quantity","freeze","toDoFactory","text","isComplete","os","EventEmitter","HOSTNAME","SERVICENAME","HBEATTIMEOUT","WSOCKETERROR","isPrimary","SWITCH","isBackup","BACKUP","DEBUG","heartbeatMs","sslEnabled","SSL_ENABLED","clearPort","PORT","cipherPort","SSL_PORT","activePort","activeProto","activeHost","DOMAIN","hostname","proto","SWITCH_PROTO","port","SWITCH_PORT","host","SWITCH_HOST","override","SWITCH_OVERRIDE","apiProto","apiUrl","serviceUrl","ServiceMeshClient","_EventEmitter","mesh","pong","heartbeatTimer","headers","pid","telemetry","eventName","role","memoryUsage","cpuUsage","performance","nodeTiming","listServices","events","listEvents","socketState","_resolveUrl","primary","backup","resolveUrl","_connect","_this2","_args2","binary","agent","protocol","useBinary","log","send","heartbeat","setTimeout","sendQueuedMsgs","missingEventName","emit","listeners","listener","connect","code","reason","msg","clearTimeout","once","_this3","warn","_this4","enqueue","queueDepth","dequeue","publish","subscribe","_close","removeAllListeners","close","client","sendQueue","sendQueueMax","shift","getClient","_this5","event","_this6","handler","_this7","_callee6","_callee6$","_context6","makeAdapters","c"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index 275c240..cc7d555 100644 --- a/dist/main.js +++ b/dist/main.js @@ -6396,11 +6396,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input == // Models - -/** - * - * @param {ModelSpecification} spec - */ function validateSpec(spec) { var missing = ['endpoint', 'factory'].filter(function (key) { return !spec[key]; @@ -6414,11 +6409,12 @@ function validateSpec(spec) { * @param {ModelSpecification} spec * @param {*} dependencies - services injected */ -function makeModel(spec) { +function makeModel(spec, modelName) { validateSpec(spec); var mixins = spec.mixins || []; var dependencies = spec.dependencies || {}; return _objectSpread(_objectSpread({}, spec), {}, { + modelName: modelName.toUpperCase(), mixins: mixins.concat(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"]), dependencies: _objectSpread(_objectSpread({}, dependencies), (0,_util_bind_adapters__WEBPACK_IMPORTED_MODULE_1__["default"])(spec.ports, _adapters__WEBPACK_IMPORTED_MODULE_3__, _services__WEBPACK_IMPORTED_MODULE_2__)) }); @@ -6427,9 +6423,9 @@ var models = Object.entries(_config__WEBPACK_IMPORTED_MODULE_5__).map(function ( var _ref2 = _slicedToArray(_ref, 2), k = _ref2[0], v = _ref2[1]; - return makeModel(_objectSpread(_objectSpread({}, v), {}, { - modelName: k - })); + return _defineProperty({}, k.toUpperCase(), makeModel(v, k)); +}).reduce(function (a, b) { + return _objectSpread(_objectSpread({}, a), b); }); /***/ }), diff --git a/dist/main.js.map b/dist/main.js.map index 50cd59e..a8c3b4e 100644 --- a/dist/main.js.map +++ b/dist/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","mappings":";;;;;;;;;;AAAa;;AAEb,mBAAO,CAAC,sEAAc;;AAEtB,qCAAqC,mBAAO,CAAC,8EAA2B;;AAExE,uCAAuC,uCAAuC;;AAE9E;AACA;AACA;;AAEA;;;;;;;;;;;ACZa;;AAEb,mBAAO,CAAC,wDAAa;;AAErB,mBAAO,CAAC,8EAA2B;;AAEnC,mBAAO,CAAC,8EAA2B;;AAEnC,mBAAO,CAAC,kFAA6B;;AAErC,mBAAO,CAAC,8EAA2B;;AAEnC,mBAAO,CAAC,oFAA8B;;AAEtC,mBAAO,CAAC,gFAA4B;;AAEpC,mBAAO,CAAC,4FAAkC;;AAE1C,mBAAO,CAAC,wHAAgD;;AAExD,mBAAO,CAAC,4EAA0B;;AAElC,mBAAO,CAAC,8EAA2B;;AAEnC,mBAAO,CAAC,gFAA4B;;AAEpC,mBAAO,CAAC,wDAAa;;AAErB,mBAAO,CAAC,kFAA6B;;;;;;;;;;;AC5BrC;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,sDAAY;AACrC,WAAW,mBAAO,CAAC,sDAAY;;AAE/B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,aAAa;AACzD;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY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ACpB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA,+CAA+C;AAC/C;AACA;;AAEA;AACA;AACA,YAAY,oBAAoB;AAChC,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,oBAAoB;AAChC,YAAY,kBAAkB;AAC9B,YAAY;AACZ;AACA;AACA,yBAAyB;AACzB;;AAEA;AACA,YAAY,OAAO;AACnB,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA,oBAAoB;AACpB,MAAM;AACN;AACA;AACA,uBAAuB,yCAAyC;AAChE;AACA;AACA,uBAAuB;AACvB;AACA,KAAK;AACL;AACA;AACA,iCAAiC,+BAA+B;AAChE,wBAAwB,YAAY;AACpC;AACA;AACA;AACA,oBAAoB;AACpB,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,uBAAuB;AACvB;AACA,MAAM;AACN;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA,WAAW,UAAU;AACrB;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AClRA,4FAAuC;;;;;;;;;;;ACA1B;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,aAAa,mBAAO,CAAC,iEAAkB;AACvC,oBAAoB,mBAAO,CAAC,6EAAuB;AACnD,eAAe,mBAAO,CAAC,2EAAuB;AAC9C,WAAW,mBAAO,CAAC,kBAAM;AACzB,YAAY,mBAAO,CAAC,oBAAO;AAC3B,iBAAiB,8FAAgC;AACjD,kBAAkB,+FAAiC;AACnD,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;AACzB,UAAU,mBAAO,CAAC,+DAAsB;AACxC,kBAAkB,mBAAO,CAAC,yEAAqB;AAC/C,mBAAmB,mBAAO,CAAC,2EAAsB;;AAEjD;;AAEA;AACA;AACA,WAAW,wBAAwB;AACnC,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAkD;AAClE;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA,GAAG;AACH;;;;;;;;;;;;AC1Ua;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,aAAa,mBAAO,CAAC,iEAAkB;AACvC,cAAc,mBAAO,CAAC,yEAAsB;AAC5C,eAAe,mBAAO,CAAC,2EAAuB;AAC9C,oBAAoB,mBAAO,CAAC,6EAAuB;AACnD,mBAAmB,mBAAO,CAAC,mFAA2B;AACtD,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,kBAAkB,mBAAO,CAAC,yEAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,kDAAS;AAC7B,WAAW,mBAAO,CAAC,gEAAgB;AACnC,YAAY,mBAAO,CAAC,4DAAc;AAClC,kBAAkB,mBAAO,CAAC,w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ACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,mFAA0B;AACtD,kBAAkB,mBAAO,CAAC,+EAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;A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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN,2BAA2B;AAC3B,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,mEAAe;;AAEzC;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,eAAe,mBAAO,CAAC,2DAAe;;AAEtC;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,gBAAgB;AAC3B,aAAa,GAAG;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,kDAAS;AAC7B,0BAA0B,mBAAO,CAAC,8FAA+B;AACjE,mBAAmB,mBAAO,CAAC,0EAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,gEAAgB;AACtC,IAAI;AACJ;AACA,cAAc,mBAAO,CAAC,kEAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA2C;AAC3C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,gCAAgC,cAAc;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,mDAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,UAAU;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,+DAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,gEAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAC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,OAAO,EAAE;IACX;EACF;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;ACpFW;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAjmB,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF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KAAK;YAEVhxB,OAAO,GAAG;cACdmxB,eAAe,EAAE3iC,EAAE;cACnB4iC,YAAY,EAAE;gBACZP,MAAM,EAANA,MAAM;gBACNK,QAAQ,EAARA;cACF,CAAC;cACDJ,SAAS,EAATA,SAAS;cACTG,YAAY,EAAZA,YAAY;cACZF,WAAW,EAAXA,WAAW;cACXM,WAAW,EAAE,eAAe;cAC5BC,YAAY,EAAE,QAAQ;cACtBC,IAAI,EAAE,mBAAmB;cACzBC,aAAa,EAAE;gBACbX,MAAM,EAAE,EAAE;gBACVK,QAAQ,EAAE;cACZ;YACF,CAAC;YACD;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;YArCI,OAAAxkC,QAAA,CAAA1G,MAAA,WA2CO,MAAM;UAAA;UAAA;YAAA,OAAA0G,QAAA,CAAA3D,IAAA;QAAA;MAAA,GAAAmD,OAAA;IAAA;EACf,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAEQyP,eAAe,WAAAA,gBAAChP,KAAK,EAAE;IAAA,OAAAhB,iBAAA,eAAApK,mBAAA,GAAAwG,IAAA,UAAA2N,SAAA;MAAA,OAAAnU,mBAAA,GAAAqB,IAAA,UAAA+S,UAAAC,SAAA;QAAA,kBAAAA,SAAA,CAAAhN,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,KAAK,CAACG,SAAS,CAACjV,GAAG,CAAC;EAC7B;AACF,CAAC;;;;;;;;;;;AChLD;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAO,CAAC,0CAAM;;AAE9B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,UAAU;AACV,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB;;AAEA;AACA;AACA,UAAU;AACV;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,wCAAuC;AACvC;AACA;AACA;AACA,CAAC,EAAC;;AAEF;AACA;AACA;AACA;;AAEA,uCAAsC;AACtC;AACA;AACA;AACA,CAAC,EAAC;;AAEF;AACA;AACA;AACA;;AAEA,wCAAuC;AACvC;AACA;AACA;AACA,CAAC,EAAC;;AAEF;AACA;AACA;AACA;;AAEA,8CAA6C;AAC7C;AACA;AACA;AACA,CAAC,EAAC;;AAEF;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,sEAAkB;AACzC;AACA;AACA,eAAe,mBAAO,CAAC,oEAAiB;AACxC;AACA;AACA,eAAe,mBAAO,CAAC,sEAAkB;AACzC;AACA;AACA,eAAe,mBAAO,CAAC,kFAAwB;AAC/C;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AC3JA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,wDAAa;AACvC,cAAc,mBAAO,CAAC,gDAAS;AAC/B,cAAc,mBAAO,CAAC,kDAAU;AAChC,YAAY,mBAAO,CAAC,0DAAY;AAChC,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,aAAa,mBAAO,CAAC,8CAAQ;AAC7B,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;;;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,4CAAO;AAC3B,kBAAkB,mBAAO,CAAC,0DAAc;AACxC,kBAAkB,mBAAO,CAAC,wDAAa;AACvC,YAAY,mBAAO,CAAC,yEAAO;AAC3B,WAAW,mBAAO,CAAC,uDAAS;AAC5B,aAAa,mBAAO,CAAC,gDAAS;;AAE9B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AACpC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,4CAAO;AAC3B,kBAAkB,mBAAO,CAAC,0DAAc;AACxC,kBAAkB,mBAAO,CAAC,wDAAa;AACvC,YAAY,mBAAO,CAAC,yEAAO;AAC3B,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,WAAW,mBAAO,CAAC,uDAAS;AAC5B,aAAa,mBAAO,CAAC,gDAAS;;AAE9B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,mBAAO,CAAC,0CAAI;AACxB;AACA;AACA,YAAY,mBAAO,CAAC,gCAAa;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,+CAA+C,yBAAyB;AACxE;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3RA;AACA;AACA;AACA;AACA;;AAEA,UAAU,iHAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,uGAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;;AAEA;AACA,EAAE,wHAAwC;AAC1C,EAAE;AACF,EAAE,kHAAqC;AACvC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,iHAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,cAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,gBAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvJa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA,mBAAmB;;;;;;;;;;;;;ACjCN;;AAEb;AACA,mBAAmB,mBAAO,CAAC,8DAAgB,EAAE,SAAS;AACtD,EAAE;AACF,EAAE,+FAAsC;AACxC;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA,sCAAsC,EAAE;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACzKa;;AAEb,mBAAmB,mBAAO,CAAC,4DAAe;;AAE1C,eAAe,mBAAO,CAAC,6CAAI;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACda;;AAEb,WAAW,mBAAO,CAAC,4DAAe;AAClC,mBAAmB,mBAAO,CAAC,4DAAe;;AAE1C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,SAAS,UAAU;AACvC,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4CAA4C,kBAAkB;AAC9D,EAAE;AACF,CAAC,oBAAoB;AACrB;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA,eAAe,kDAAwB;AACvC,aAAa,sFAA6B;;AAE1C;AACA;AACA;AACA;;AAEA,sDAAsD,YAAY;;AAElE;AACA;AACA;AACA;;AAEA,sCAAsC,EAAE;AACxC,+CAA+C,EAAE;;AAEjD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,qBAAqB,MAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,iBAAiB,IAAI,aAAa,EAAE,EAAE,IAAI,UAAU,IAAI,oBAAoB,EAAE;;AAE/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8EAA8E;;AAE9E;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,gBAAgB;AAC3B,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,gBAAgB;AAC3B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6DAA6D;AAC7D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACzcA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc;AACd,aAAa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChOA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sBAAQ;;AAE7B;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,aAAa;AACb,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+BAA+B;;AAE/B;AACA;AACA,MAAM;AACN;AACA,gCAAgC;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gBAAgB;AAC7C,kBAAkB;AAClB;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA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;AACA;;;;;;;;;;;ACtBA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;ACJa;AACb,SAAS,2FAAyB;AAClC,aAAa,mBAAO,CAAC,0EAAkB;AACvC,kBAAkB,mBAAO,CAAC,wEAAiB;AAC3C,UAAU,mBAAO,CAAC,sDAAQ;AAC1B,iBAAiB,mBAAO,CAAC,sEAAgB;AACzC,YAAY,mBAAO,CAAC,4DAAW;AAC/B,kBAAkB,mBAAO,CAAC,sEAAgB;AAC1C,WAAW,mBAAO,CAAC,kEAAc;AACjC,iBAAiB,mBAAO,CAAC,sEAAgB;AACzC,kBAAkB,mBAAO,CAAC,sEAAgB;AAC1C,cAAc,uFAA0B;AACxC,eAAe,mBAAO,CAAC,sFAAwB;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,+EAA+E,OAAO;AACtF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,0CAA0C;AAC1C,0CAA0C;AAC1C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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B,mBAAO,CAAC,sFAAwB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ,mCAAmC,gCAAgC;AAC3E,+BAA+B,mCAAmC;AAClE;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,sDAAsD;AACtD;AACA,mDAAmD,kBAAkB;AACrE;AACA,yDAAyD,cAAc,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;ACpFA,8BAA8B;AAC9B,wCAAwC;;;;;;;;;;;;ACD3B;AACb,sBAAsB,mBAAO,CAAC,kEAAc;AAC5C,iBAAiB,mBAAO,CAAC,0EAAkB;;AAE3C;AACA;AACA;AACA;;;;;;;;;;;ACPA;AACA,gBAAgB,mBAAO,CAAC,oEAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBa;AACb;AACA,YAAY,mBAAO,CAAC,0DAAU;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;;;;;;;;;;ACzBW;AACb,eAAe,mBAAO,CAAC,kEAAc;AACrC,kBAAkB,mBAAO,CAAC,wEAAiB;AAC3C;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA;AACA,kBAAkB,mBAAO,CAAC,0DAAU;AACpC,iCAAiC,SAAS,mBAAmB,aAAa;AAC1E,CAAC;;;;;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;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,mBAAmB;AACnB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;;;;;;;;;;;;AC/Fa;AACb;AACA,eAAe,mBAAO,CAAC,kEAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZa;AACb;AACA,cAAc,mBAAO,CAAC,gEAAa;AACnC,eAAe,mBAAO,CAAC,kEAAc;AACrC,eAAe,mBAAO,CAAC,kEAAc;AACrC,UAAU,mBAAO,CAAC,sDAAQ;AAC1B,2BAA2B,mBAAO,CAAC,sDAAQ;;AAE3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACtCA,UAAU,mBAAO,CAAC,sDAAQ;AAC1B,WAAW,mBAAO,CAAC,kEAAc;AACjC,kBAAkB,mBAAO,CAAC,0EAAkB;AAC5C,eAAe,mBAAO,CAAC,kEAAc;AACrC,eAAe,mBAAO,CAAC,kEAAc;AACrC,gBAAgB,mBAAO,CAAC,8FAA4B;AACpD;AACA;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA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ACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS;AACvC,kCAAkC;AAClC;AACA,IAAI,YAAY;AAChB;AACA;;;;;;;;;;;ACrBA;AACA,WAAW;AACX;;;;;;;;;;;ACFA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;;;;;;;;;;ACTF;AACA,WAAW,mBAAO,CAAC,kEAAc;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtBA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA,WAAW,mBAAO,CAAC,sDAAQ;AAC3B,eAAe,mBAAO,CAAC,kEAAc;AACrC,UAAU,mBAAO,CAAC,sDAAQ;AAC1B,cAAc,2FAAyB;AACvC;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,0DAAU;AAChC,iDAAiD;AACjD,CAAC;AACD;AACA,sBAAsB;AACtB;AACA,mBAAmB;AACnB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpDA,aAAa,mBAAO,CAAC,4DAAW;AAChC,gBAAgB,mFAAsB;AACtC;AACA;AACA;AACA,aAAa,mBAAO,CAAC,sDAAQ;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,wCAAwC,qBAAqB,GAAG;AAChE;AACA;AACA;AACA;AACA,IAAI;A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AY,mBAAO,CAAC,0DAAU;AAC9B,cAAc,mBAAO,CAAC,8DAAY;AAClC;AACA;AACA;AACA;AACA;AACA,0FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;AClBA;AACA,eAAe,mBAAO,CAAC,kEAAc;AACrC,aAAa,mBAAO,CAAC,0EAAkB;AACvC,cAAc,mBAAO,CAAC,8DAAY;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfa;AACb,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,cAAc,mBAAO,CAAC,8DAAY;;AAElC;AACA;AACA;AACA;AACA;AACA,QAAQ,OAAO;AACf;AACA;;;;;;;;;;;ACXA,cAAc,mBAAO,CAAC,4DAAW;AACjC,cAAc,mBAAO,CAAC,8DAAY;AAClC,YAAY,mBAAO,CAAC,0DAAU;AAC9B,aAAa,mBAAO,CAAC,kEAAc;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC7BA;AACA;;;;;;;;;;;ACDA,UAAU,mBAAO,CAAC,sDAAQ;AAC1B,aAAa,mBAAO,CAAC,4DAAW;AAChC,WAAW,mBAAO,CAAC,wDAAS;AAC5B,UAAU,mBAAO,CAAC,oEAAe;AACjC,aAAa,mBAAO,CAAC,4DAAW;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAO,CAAC,sDAAQ;AACtB;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA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;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,mBAAmB,6BAA6B;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gCAAgC;AAC1F;AACA,QAAQ;AACR;AACA;AACA,8EAA8E,YAAY;AAC1F;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0DAA0D,8CAA8C;;AAExG;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,oDAAoD;AACpD;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,qCAAqC;AACrC;AACA,KAAK;AACL,yEAAyE;AACzE;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,+DAA+D;AAC/D;AACA,KAAK;AACL,yEAAyE;AACzE;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH,0BAA0B,qBAAqB,IAAI;AACnD;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA,KAAK;AACL,0BAA0B;AAC1B,KAAK;AACL,wBAAwB;AACxB,4BAA4B;AAC5B,2BAA2B;AAC3B,4BAA4B;AAC5B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B,OAAO;AACP;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL,wDAAwD,8BAA8B;AACtF;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA,wDAAwD,WAAW;;AAEnE;;AAEA;;AAEA;AACA;AACA,KAAK,WAAW,eAAe;;AAE/B;AACA;AACA,KAAK;AACL;AACA,KAAK,YAAY,iCAAiC;;AAElD;AACA;AACA;AACA,EAAE,oCAAoC;;;;;;;;;;;;AC/dzB;AACb,aAAa,mBAAO,CAAC,4DAAW;AAChC,kBAAkB,mBAAO,CAAC,sEAAgB;AAC1C,cAAc,mBAAO,CAAC,8DAAY;AAClC,aAAa,mBAAO,CAAC,0DAAU;AAC/B,WAAW,mBAAO,CAAC,wDAAS;AAC5B,kBAAkB,mBAAO,CAAC,wEAAiB;AAC3C,YAAY,mBAAO,CAAC,0DAAU;AAC9B,iBAAiB,mBAAO,CAAC,sEAAgB;AACzC,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,eAAe,mBAAO,CAAC,kEAAc;AACrC,cAAc,mBAAO,CAAC,gEAAa;AACnC,WAAW,+FAA2B;AACtC,SAAS,2FAAyB;AAClC,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,qBAAqB,mBAAO,CAAC,kFAAsB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS,WAAW;AACpB;AACA;AACA,SAAS,UAAU;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW;AACpB;AACA;AACA;AACA,SAAS,WAAW;AACpB;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,mBAAmB,0BAA0B;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,WAAW;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA,GAAG;AACH,0BAA0B;AAC1B,GAAG;AACH,wBAAwB;AACxB,2BAA2B;AAC3B,2BAA2B;AAC3B;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnRA,aAAa,mBAAO,CAAC,4DAAW;AAChC,WAAW,mBAAO,CAAC,wDAAS;AAC5B,UAAU,mBAAO,CAAC,sDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACJA,aAAa,mBAAO,CAAC,4DAAW;AAChC;;AAEA;;;;;;;;;;;ACHA,eAAe,mBAAO,CAAC,kEAAc;AACrC;AACA;AACA;AACA;;;;;;;;;;;ACJA,aAAa,mBAAO,CAAC,4DAAW;AAChC,WAAW,mBAAO,CAAC,wDAAS;AAC5B,cAAc,mBAAO,CAAC,8DAAY;AAClC,aAAa,mBAAO,C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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAO,CAAC,0DAAU;AACxB;AACA,kBAAkB;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,CAAC;;;;;;;;;;;;ACjHY;AACb,cAAc,mBAAO,CAAC,4DAAW;AACjC,aAAa,mBAAO,CAAC,0DAAU;AAC/B,mBAAmB,mBAAO,CAAC,4EAAmB;AAC9C;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA,sBAAsB;AACtB,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;ACjBD;AACA,cAAc,mBAAO,CAAC,4DAAW;;AAEjC,2CAA2C,QAAQ,mBAAO,CAAC,0EAAkB,GAAG;;;;;;;;;;;ACHhF,cAAc,mBAAO,CAAC,4DAAW;AACjC;AACA,+BAA+B,QAAQ,mBAAO,CAAC,0EAAkB,GAAG;;;;;;;;;;;ACFpE,cAAc,mBAAO,CAAC,4DAAW;AACjC;AACA,iCAAiC,mBAAO,CAAC,sEAAgB,eAAe,kBAAkB,mBAAO,CAAC,oEAAe,GAAG;;;;;;;;;;;ACFpH,cAAc,mBAAO,CAAC,4DAAW;AACjC;AACA,iCAAiC,mBAAO,CAAC,sEAAgB,eAAe,gBAAgB,2FAAyB,EAAE;;;;;;;;;;;ACFnH;AACA,eA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,oBAAoB,iCAAiC;AACrD,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,gBAAgB,sCAAsC;AACtD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ,mBAAmB,wBAAwB,MAAM;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA,uBAAuB,mBAAO,CAAC,wEAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2DAA2D,mBAAmB;AAC9E,mBAAO,CAAC,kFAAsB;AAC9B,mBAAO,CAAC,sEAAgB;AACxB,UAAU,mBAAO,CAAC,wDAAS;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gDAAgD,mBAAO,CAAC,sEAAgB;AACxE;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;AC7RD;AACA,cAAc,mBAAO,CAAC,4DAAW;AACjC,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,eAAe,mBAAO,CAAC,kEAAc;AACrC,cAAc,2FAA4B,MAAM;AAChD;AACA;AACA,iCAAiC,mBAAO,CAAC,0DAAU;AACnD,uBAAuB,aAAa;AACpC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;ACfD;AACA,cAAc,mBAAO,CAAC,4DAAW;AACjC,aAAa,mBAAO,CAAC,0EAAkB;AACvC,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,eAAe,mBAAO,CAAC,kEAAc;AACrC,eAAe,mBAAO,CAAC,kEAAc;AACrC,YAAY,mBAAO,CAAC,0DAAU;AAC9B,WAAW,mBAAO,CAAC,wDAAS;AAC5B,kBAAkB,2FAA4B,MAAM;;AAEpD;AACA;AACA;AACA,iBAAiB;AACjB,oCAAoC,aAAa;AACjD,CAAC;AACD;AACA,2BAA2B,aAAa;AACxC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;AC9CD;AACA,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iBAAiB,mBAAO,CAAC,wFAAyB;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mBAAO,CAAC,oEAAe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;ACrHY;;AAEb,eAAe,mBAAO,CAAC,kEAAc;AACrC,gBAAgB,mBAAO,CAAC,oEAAe;AACvC,iBAAiB,mBAAO,CAAC,wFAAyB;;AAElD;AACA,mBAAO,CAAC,oEAAe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AC9BY;;AAEb,eAAe,mBAAO,CAAC,kEAAc;AACrC,eAAe,mBAAO,CAAC,kEAAc;AACrC,yBAAyB,mBAAO,CAAC,sFAAwB;AACzD,yBAAyB,mBAAO,CAAC,wFAAyB;AAC1D,eAAe,mBAAO,CAAC,kEAAc;AACrC,qBAAqB,mBAAO,CAAC,wFAAyB;AACtD,iBAAiB,mBAAO,CAAC,sEAAgB;AACzC,YAAY,mBAAO,CAAC,0DAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,0BAA0B;;AAEhE;AACA,mBAAO,CAAC,oEAAe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACrIY;AACb,mBAAO,CAAC,8EAAoB;AAC5B,eAAe,mBAAO,CAAC,kEAAc;AACrC,aAAa,mBAAO,CAAC,0DAAU;AAC/B,kBAAkB,mBAAO,CAAC,sEAAgB;AAC1C;AACA;;AAEA;AACA,EAAE,mBAAO,CAAC,gEAAa;AACvB;;AAEA;AACA,IAAI,mBAAO,CAAC,0DAAU,gBAAgB,wBAAwB,yBAAyB,cAAc;AACrG;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE;AACF;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACxBa;AACb,aAAa,mBAAO,CAAC,kFAAsB;AAC3C,eAAe,mBAAO,CAAC,sFAAwB;AAC/C;;AAEA;AACA,iBAAiB,mBAAO,CAAC,oEAAe;AACxC,0BAA0B;AAC1B,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;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;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,MAAM;AACN;AACA,uBAAuB,kCAAkC;AACzD,MAAM;AACN,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,+BAA+B;AAChG;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,EAAE,+FAA2B;AAC7B,EAAE,6FAA0B;AAC5B;;AAEA,sBAAsB,mBAAO,CAAC,8DAAY;AAC1C;AACA;;AAEA;AACA;AACA;AACA;;AAEA,2DAA2D,iBAAiB;;AAE5E;AACA;AACA;AACA,qBAAqB,sBAAsB;;AAE3C,qDAAqD,4BAA4B;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,2BAA2B,gBAAgB;AAC3C,2BAA2B;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,+CAA+C,aAAa;;AAE5D;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,MAAM,QAAQ,iCAAiC;AACpG,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,oCAAoC,mBAAO,CAAC,wDAAS;AACrD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrPa;AACb,cAAc,mBAAO,CAAC,4DAAW;AACjC,aAAa,mBAAO,CAAC,0D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ACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjKA;;AAEA;AACA;AACA;;AAEA,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4CAA4C;;AAEvD;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,oDAAU;;AAEnC,OAAO,YAAY;;AAEnB;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;AC3QA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAO,CAAC,yDAAI;AACpC;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA,cAAc;AACd;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;;AAEA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;ACjRA;AACA;AACA;AACA;;AAEA;AACA,CAAC,+FAAwC;AACzC,EAAE;AACF,CAAC,yFAAqC;AACtC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,gBAAK;AACzB,aAAa,mBAAO,CAAC,kBAAM;;AAE3B;AACA;AACA;;AAEA,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA,uBAAuB,mBAAO,CAAC,8DAAgB;;AAE/C;AACA,EAAE,cAAc;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,6DAA6D;AAC7D;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,4BAA4B;;AAEpC;AACA;AACA,iDAAiD,EAAE;AACnD,sBAAsB,WAAW,IAAI,MAAM;;AAE3C;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,oDAAU;;AAEnC,OAAO,YAAY;;AAEnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,eAAe,kDAAwB;;AAEvC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC;;AAExC;AACA,6CAA6C;AAC7C;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,WAAW;AAC7B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS,kBAAkB;AAC3B;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B,iCAAiC;AAC5D,cAAc,oBAAoB;AAClC;;AAEA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;ACzhBA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,mBAAmB,0DAA8B;AACjD,iBAAiB,gDAAwB;AACzC,aAAa,mBAAO,CAAC,sBAAQ;AAC7B,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChNY;;AAEZ,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBY;;AAEZ,eAAe,oDAAwB;AACvC,cAAc,mBAAO,CAAC,mDAAS;AAC/B,eAAe,mBAAO,CAAC,qDAAU;AACjC,gBAAgB,mBAAO,CAAC,uDAAW;AACnC,gBAAgB,mBAAO,CAAC,uDAAW;AACnC,oBAAoB,mBAAO,CAAC,+DAAe;AAC3C,WAAW,mBAAO,CAAC,iFAAyB;;AAE5C;AACA;AACA;AACA;AACA;AACA;;AAEA,aAAa,YAAY;;AAEzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,YAAY,UAAU;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;;AAExB;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;;AAEA,cAAc,eAAY;;AAE1B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,eAAe,aAAa;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;AACxB,eAAe,aAAa;AAC5B,eAAe,aAAa;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,WAAW;;AAExB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,YAAY,UAAU;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,WAAW,SAAS;;AAEpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,cAAc,YAAY;;AAE1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,gBAAgB,cAAc;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,YAAY;AAC7D;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD;;AAEA,aAAa,WAAW;;AAExB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,gBAAgB,cAAc;;AAE9B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,eAAe,aAAa;;AAE5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,YAAY,UAAU;;AAEtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,YAAY;;AAE1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,eAAe,aAAa;;AAE5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,UAAU;;AAEtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,eAAe,aAAa;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,eAAe,aAAa;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,YAAY;;AAE1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,aAAa,cAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,cAAc;;AAE7B;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,gBAAgB;;AAEjC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,4BAA4B;AAC5B,0BAA0B;AAC1B,yBAAyB;AACzB,2BAA2B;AAC3B,sBAAsB;AACtB,yBAAyB;AACzB,iBAAiB;;AAEjB,cAAc;AACd;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,oBAAoB;;AAEtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB;;AAEpB,cAAc;AACd;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,oBAAoB;;AAEtB;AACA;;AAEA,oBAAoB;;AAEpB,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,EAAE,0BAA0B;AAC5B;AACA;;AAEA,0BAA0B;;AAE1B,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,0BAA0B;AAC5B;AACA;;AAEA,0BAA0B;;AAE1B;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5sDY;;AAEZ;AACA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjDY;;AAEZ,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,KAAK;AACxB;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1DY;;AAEZ;AACA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjDY;;AAEZ,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtGA,WAAW,mBAAO,CAAC,cAAI;AACvB,aAAa,mBAAO,CAAC,kBAAM;AAC3B,WAAW,mBAAO,CAAC,cAAI;AACvB,eAAe,mBAAO,CAAC,sBAAQ;AAC/B,oBAAoB,mBAAO,CAAC,2DAAiB;;AAE7C;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,6CAA6C,iBAAiB;AAC9D;AACA,kDAAkD,WAAW;AAC7D;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAyB,QAAQ,UAAU,QAAQ;AACnD;;AAEA;AACA,yBAAyB,QAAQ,UAAU,QAAQ;AACnD;;AAEA;AACA,yBAAyB,QAAQ,WAAW,QAAQ;AACpD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,0BAA0B;AACnE;AACA;AACA,+EAA+E,gBAAgB;AAC/F;;AAEA,WAAW;AACX;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yDAAyD,WAAW;AACpE;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,WAAW;AACX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oEAAoE,UAAU;;AAE9E;AACA;AACA;AACA;;AAEA;;AAEA,aAAa;AACb,IAAI;AACJ;AACA,+BAA+B,YAAY,EAAE,UAAU;AACvD;;AAEA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,yEAAyE,UAAU;;AAEnF;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,0BAA0B,EAAE,eAAe;AACzD,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,IAAI;AACzB,UAAU;AACV,qBAAqB,IAAI;AACzB;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B;AAC3B,2BAA2B;AAC3B,0BAA0B;AAC1B,qBAAqB;AACrB,sBAAsB;AACtB,oBAAoB;AACpB,uBAAuB;;AAEvB;;;;;;;;;;;;ACzTA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,kBAAkB;AACpC;;AAEA;AACA;;AAEA;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AC9FA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;AACA,wBAAwB;AACxB;AACA;AACA,uBAAuB;AACvB;AACA;AACA,uBAAuB;AACvB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sBAAQ;AAC7B,YAAY,2CAAmB;;AAE/B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,qBAAqB;AAChC,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AA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AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC5qBA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,aAAa;AACb,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B;AAC1B;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gBAAgB;AAC7C,kBAAkB;AAClB;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA,cAAc;AACd;;AAEA;AACA,cAAc;AACd;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;;AAEA,UAAU,qHAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,2GAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;;AAEA;AACA,EAAE,4HAAwC;AAC1C,EAAE;AACF,EAAE,sHAAqC;AACvC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,qHAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,cAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,gBAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,2EAAQ;AAC7B,gBAAgB,mBAAO,CAAC,0CAAM;;AAE9B;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,gEAAS;AAC7B,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC1LA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA,uCAAuC,YAAY;AACnD,sCAAsC,sBAAsB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY,SAAS;AACrB;AACA;;AAEA;AACA,6DAA6D;AAC7D;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY,SAAS;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY,SAAS;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY,SAAS;AACrB;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ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D,mBAAmB,wFAA+B;AAClD,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,cAAc,mBAAO,CAAC,oEAAe;AACrC,YAAY,mBAAO,CAAC,wDAAa;AACjC,cAAc,iDAAuB;AACrC,qBAAqB,mBAAO,CAAC,8DAAgB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,YAAY,aAAoB,IAAI,CAAa;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,UAAU;AACrB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,GAAG;AACd,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,kBAAkB,oBAAoB;AACtC;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA,OAAO;AACP;AACA,WAAW,QAAQ;AACnB,WAAW,iBAAiB;AAC5B,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,KAAK;AAChC;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;;ACppBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,mBAAmB,0DAA8B;AACjD,YAAY,mBAAO,CAAC,oEAAmB;AACvC,YAAY,mBAAO,CAAC,gEAAe;AACnC,YAAY,mBAAO,CAAC,kEAAgB;AACpC,aAAa,mBAAO,CAAC,4DAAU;AAC/B,UAAU,mBAAO,CAAC,wDAAW;AAC7B,UAAU,mBAAO,CAAC,0DAAY;;AAE9B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW;AACX,GAAG;;AAEH;AACA;AACA,WAAW;AACX,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB,eAAe;AACf,gBAAgB;;AAEhB;AACA;AACA;;AAEA,aAAa;AACb,cAAc;;AAEd;AACA;AACA;;AAEA,YAAY;AACZ,+GAA6C;AAC7C,WAAW;AACX,mGAAwC;AACxC,YAAY;AACZ,kBAAkB;;AAElB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACnHD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,qBAAqB,mBAAO,CAAC,8DAAgB;;AAE7C;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY;AACZ;AACA;;AAEA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,wDAAa;AACjC,eAAe,mBAAO,CAAC,kDAAU;AACjC,SAAS,mBAAO,CAAC,0CAAI;;AAErB;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,cAAc,mBAAO,CAAC,gDAAS;AAC/B,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,WAAW,4CAAmB;AAC9B,aAAa,mBAAO,CAAC,gDAAS;AAC9B,WAAW,mBAAO,CAAC,kBAAM;AACzB,YAAY,mBAAO,CAAC,4CAAO;AAC3B,iBAAiB,mBAAO,CAAC,0DAAc;AACvC,YAAY,mBAAO,CAAC,kDAAU;AAC9B,gBAAgB,mBAAO,CAAC,sDAAY;;AAEpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,CA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zB;AACA;AACA;AACA,WAAW,mBAAO,CAAC,0CAAM;;AAEzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB;;AAEtB;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA,WAAW,qCAAqC;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA,WAAW,8BAA8B;AACzC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA,WAAW,8BAA8B;AACzC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4FAA4F;AAC5F;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B,wBAAwB;;AAEnD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,qDAAqD,gBAAgB;AACrE,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,cAAc;AACzB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAA2C;AAC3D;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,cAAc;AACzB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,iCAAiC;AACjC;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA,qBAAqB,iCAAiC;;AAEtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wDAAwD;AAC9F;AACA;AACA,sCAAsC,gCAAgC;AACtE;AACA,WAAW,QAAQ;AACnB,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;;;;;;;;;;;AChpCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,2DAAS;AAC7B,YAAY,mBAAO,CAAC,2DAAS;AAC7B,cAAc,mBAAO,CAAC,gDAAS;AAC/B,YAAY,mBAAO,CAAC,wDAAa;AACjC,YAAY,mBAAO,CAAC,qEAAO;AAC3B,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,cAAc,mBAAO,CAAC,oEAAe;AACrC,eAAe,mBAAO,CAAC,kDAAU;AACjC,qBAAqB,mBAAO,CAAC,8DAAgB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY,KAAK;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,kBAAkB,qBAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C,SAAS;AACrD;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AChqBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAgB;AACzC,YAAY,mBAAO,CAAC,qEAAO;;AAE3B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,qEAAO;AAC3B,cAAc,mBAAO,CAAC,oEAAe;AACrC,YAAY,mBAAO,CAAC,2DAAS;AAC7B,cAAc,mBAAO,CAAC,gDAAS;;AAE/B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,OAAO;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,oBAAoB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,WAAW,UAAU;AACrB,YAAY,OAAO;AACnB;AACA;;AAEA;AACA;;AAEA,kBAAkB,oBAAoB;AACtC;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,oBAAoB;AACxC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,+BAA+B;AAC/B;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;AChOD;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,aAAa,sFAA6B;AAC1C,yBAAyB,mBAAO,CAAC,wEAAqB;AACtD,kBAAkB,mBAAO,CAAC,0DAAc;AACxC,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,cAAc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;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B,YAAY;AACZ;AACA;;AAEA,0BAA0B;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAY,sCAAsC;AAClD,YAAY;AACZ;AACA;;AAEA,oBAAoB;AACpB;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;AACA,0BAA0B,iBAAiB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AC/SA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,qEAAO;AAC3B,WAAW,mBAAO,CAAC,kBAAM;AACzB,SAAS,mBAAO,CAAC,cAAI;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,iEAAQ,GAAG,CAAC;;AAEzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,kBAAkB,2BAA2B;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;ACrLA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;AAEA,UAAU,6GAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,mGAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;;AAEA;AACA,EAAE,oHAAwC;AAC1C,EAAE;AACF,EAAE,8GAAqC;AACvC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,6GAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,cAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,gBAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,0EAAO;AAC3B,gBAAgB,mBAAO,CAAC,oDAAW;AACnC,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,eAAe,mBAAO,CAAC,kDAAU;AACjC,eAAe,mBAAO,CAAC,kDAAU;AACjC,aAAa,mBAAO,CAAC,8CAAQ;;AAE7B;AACA;AACA;AACA;;AAEA,gCAAgC,EAAE;AAClC;;AAEA;AACA;AACA;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA,wBAAwB,aAAoB,IAAI,CAAa;;AAE7D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,iBAAiB;AAC5B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;;;;;;;;;;;AC/UA;AACA;AACA;AACA;AACA;;AAEA,UAAU,kHAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,wGAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;;AAEA;AACA,EAAE,yHAAwC;AAC1C,EAAE;AACF,EAAE,mHAAqC;AACvC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,kHAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,cAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,gBAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACvJA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B;AACA,oBAAoB;AACpB;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;;;;;;;;;;;ACdA,UAAU,mBAAO,CAAC,gBAAK;AACvB;AACA,WAAW,mBAAO,CAAC,kBAAM;AACzB,YAAY,mBAAO,CAAC,oBAAO;AAC3B,eAAe,sDAA0B;AACzC,aAAa,mBAAO,CAAC,sBAAQ;AAC7B,YAAY,mBAAO,CAAC,yDAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,gCAAgC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,uBAAuB,wCAAwC;AAC/D,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD,mBAAmB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sEAAsE;AACvF,aAAa,kEAAkE;AAC/E,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB,0BAA0B;AAClD,mBAAmB;;;;;;;;;;;;AC5mBnB;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;ACxIa;;AAEb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA,+EAA+E,sCAAsC;;AAErH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACnDa;;AAEb,qBAAqB,mBAAO,CAAC,wEAAkB;;AAE/C;;;;;;;;;;;;ACJa;;AAEb;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC,8CAA8C;AAChF,GAAG;AACH;;AAEA;AACA;AACA;AACA,UAAU;AACV,GAAG;AACH,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,EAAE;AACF;;AAEA,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,eAAe,mBAAO,CAAC,oDAAW;;AAElC;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD,GAAG;AACH,gDAAgD;AAChD,GAAG;AACH,sDAAsD;AACtD,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,4DAAe;AAClC,aAAa,mBAAO,CAAC,4CAAK;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9Va;;AAEb;AACA;AACA;;AAEA;;AAEA;AACA,UAAU,iBAAiB,yBAAyB,kBAAkB;AACtE;;;;;;;;;;;;ACVa;;AAEb;AACA,oBAAoB,mBAAO,CAAC,oDAAS;;AAErC;AACA,yCAAyC;AACzC,qCAAqC;AACrC,8CAA8C;AAC9C,0CAA0C;;AAE1C;AACA;;;;;;;;;;;;ACZa;;AAEb;AACA;AACA,2FAA2F;AAC3F,4CAA4C;;AAE5C;AACA;AACA;AACA,gCAAgC;;AAEhC,kEAAkE;AAClE,qEAAqE;;AAErE;AACA,iCAAiC;AACjC;AACA,uCAAuC;;AAEvC,2DAA2D;AAC3D,+DAA+D;;AAE/D;AACA;AACA,oBAAoB,gBAAgB;AACpC,2EAA2E;;AAE3E,yGAAyG;;AAEzG;AACA,6CAA6C;;AAE7C,8DAA8D;;AAE9D;AACA;AACA,uEAAuE;AACvE;;AAEA;AACA;;;;;;;;;;;;ACzCa;;AAEb,WAAW,mBAAO,CAAC,4DAAe;;AAElC;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,qBAAqB,mBAAO,CAAC,8DAAgB;AAC7C,eAAe,mBAAO,CAAC,kDAAU;AACjC,eAAe,mBAAO,CAAC,qDAAU;AACjC,mBAAmB,mBAAO,CAAC,0DAAc;;AAEzC;AACA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB,0BAA0B;;AAE1B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,sCAAsC;AACtC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChSa;AACb,aAAa,wFAA8B;;AAE3C;AACA;AACA;;AAEA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,WAAW;AAC3B;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;AACA;;AAEA;AACA,oBAAoB,yBAAyB;AAC7C;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,wCAAwC;AAChE;AACA;AACA;AACA;AACA,uCAAuC,aAAa;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA,+CAA+C;;AAE/C;AACA;AACA;;AAEA;AACA;;AAEA,2BAA2B,WAAW;AACtC;AACA;AACA,+BAA+B,WAAW;AAC1C;AACA;AACA,2BAA2B,WAAW;AACtC;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;;AAEA;AACA,iCAAiC,OAAO,OAAO;AAC/C;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,kBAAkB;AACtC;AACA,wCAAwC;AACxC,4BAA4B,gBAAgB;AAC5C;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA,oCAAoC,SAAS;AAC7C,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA,6CAA6C;AAC7C;AACA,4BAA4B,UAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B;AACA,2DAA2D;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA;;AAEA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD,kCAAkC;AAClC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oBAAoB;AAClD;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA,+CAA+C;AAC/C;AACA;;AAEA,cAAc,uCAAuC;AACrD;;AAEA,cAAc,iCAAiC;;AAE/C;AACA;AACA;AACA,wCAAwC;AACxC,sCAAsC;;AAEtC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE,sEAAsE;AACtE,oEAAoE;AACpE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;;AAEhB;;AAEA,uBAAuB;AACvB;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,+CAA+C;AAC/C;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,uCAAuC;AACvC;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACziBa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,OAAO,mBAAO,CAAC,wFAAwB,GAA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O;AACjB,iCAAiC;AACjC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA,oBAAoB,4BAA4B;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3La;AACb,aAAa,wFAA8B;;AAE3C;AACA;;AAEA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,+BAA+B;AACnD;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACvEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,uNAAuN,iEAAiE,EAAE;AAC1R,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,2JAA2J,iEAAiE,EAAE;AAC9N,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,yLAAyL,iEAAiE,EAAE;AAC5P,GAAG;AACH;AACA;AACA,uNAAuN,iEAAiE,EAAE;AAC1R,GAAG;AACH;AACA;AACA,uNAAuN,gEAAgE,EAAE;AACzR,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;AClca;;AAEb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC5Ka;AACb,aAAa,wFAA8B;;AAE3C;;AAEA;;AAEA,eAAe;AACf;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA,oBAAoB,gBAAgB;AACpC,0BAA0B,mBAAmB;AAC7C;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;;AAEA,WAAW,kBAAkB;AAC7B;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,+DAA+D,4BAA4B;;AAE3F;;AAEA,aAAa;AACb;AACA;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;;AAEpE,4BAA4B,UAAU;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;AC9Ka;AACb,aAAa,wFAA8B;;AAE3C;AACA;;AAEA,YAAY;AACZ,qBAAqB,WAAW;AAChC;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,SAAS;AACzB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB,gBAAgB;AACpC,yBAAyB;AACzB;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,UAAU,OAAO;AACjB,wCAAwC;AACxC,wDAAwD;AACxD;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6DAA6D;AAC7D,MAAM;AACN;;AAEA,gEAAgE;AAChE,kDAAkD;AAClD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;;AAEA,2CAA2C;AAC3C;AACA;;AAEA;AACA,uCAAuC;;AAEvC;AACA;AACA;;AAEA,UAAU,OAAO;AACjB;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC,yBAAyB;AACzB;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,UAAU,OAAO;AACjB,4CAA4C;AAC5C,yDAAyD;AACzD;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6DAA6D;AAC7D,MAAM;AACN;;AAEA,gEAAgE;AAChE,kDAAkD;AAClD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;AC/Ra;;AAEb;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AClDa;AACb,aAAa,oDAAwB;AACrC;;AAEA;;AAEA;AACA,8BAA8B;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAyB,wDAA4B;;AAErD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA,2BAA2B,sDAA0B;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,+FAA+F;;AAE/F;;AAEA,yBAAyB,wDAA4B;;AAErD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,sDAA0B;;AAErD;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACxNa;;AAEb;AACA;AACA,aAAa,wFAA8B;;AAE3C,kBAAkB,mBAAO,CAAC,qEAAgB;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;;AAE5B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,kEAAc,GAAG;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0EAA0E;AAC1E;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oDAAoD,EAAE;AACtD;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ,mBAAO,CAAC,2DAAW;AAC3B;;AAEA;AACA,IAAI,mBAAO,CAAC,mEAAe;AAC3B;;AAEA,IAAI,KAAe,EAAE,EAEpB;;;;;;;;;;;;ACxJY;;AAEb,aAAa,oDAAwB;AACrC,gBAAgB,uDAA2B;;;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;;AAEA;AACA,mBAAmB;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,qBAAqB;AAC3D;AACA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;;AAEA;AACA,mBAAmB;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,eAAe;AACrD;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;ACvHA;AACA,aAAa,mBAAO,CAAC,kBAAM;AAC3B;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE,gHAAiD;AACnD;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1BA;AACA;;AAEA;;AAEA;;AAEA,OAAO,KAA6B;AACpC;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,GAAG;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;;AAEA,GAAG;;AAEH;;AAEA,yBAAyB,GAAG;;AAE5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,mFAAmF,EAAE;AACrF;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;;AChqBY;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AAC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A;AACA;AACA,WAAW;AACX;;AAEA;AACA,QAAQ;AACR;AACA,mDAAmD,yCAAyC;AAC5F;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB,cAAc;AACd;AACA,oCAAoC,wCAAwC;AAC5E;AACA,2EAA2E,gBAAgB;AAC3F;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;;AAEA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,wCAAwC,wCAAwC;AAChF,QAAQ;AACR;AACA,mDAAmD,yCAAyC;AAC5F;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB,cAAc;AACd;AACA,gCAAgC,iBAAiB;AACjD;AACA,iEAAiE,OAAO;AACxE;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;;AAErD;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA,mDAAmD,yCAAyC;AAC5F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA,0DAA0D,MAAM;AAChE;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0BAA0B;AACvE,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,6CAA6C,0BAA0B;AACvE,WAAW;AACX;;AAEA,gBAAgB,6BAA6B;AAC7C,gBAAgB,4BAA4B;AAC5C,qCAAqC,mBAAmB;AACxD;AACA;AACA;AACA,qCAAqC,yBAAyB;AAC9D;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA,0DAA0D,MAAM;AAChE;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,0BAA0B;;AAE1E;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,gBAAgB,6BAA6B;;AAE7C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,gBAAgB,4BAA4B;;AAE5C,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B;AACjE;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,aAAa,SAAS;AACtB,cAAc;AACd;AACA,gCAAgC,gDAAgD;AAChF;AACA,4DAA4D,QAAQ;AACpE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA,iEAAiE,WAAW;AAC5E,iBAAiB;AACjB,OAAO;AACP;AACA,UAAU,6BAA6B;AACvC;AACA;AACA,KAAK;;AAEL;AACA;AACA,qCAAqC,mBAAmB;AACxD;AACA,2DAA2D,6BAA6B;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX,6BAA6B,oDAAoD;;AAEjF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,0CAA0C,mBAAmB;AAC7D,mDAAmD,6BAA6B;AAChF;AACA;AACA;AACA,OAAO;;AAEP,eAAe;AACf,KAAK;;AAEL;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,cAAc;AACd;AACA,gCAAgC,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AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,kBAAkB;AAC/B,cAAc;AACd;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA,sCAAsC,mBAAmB;AACzD;AACA,2DAA2D,MAAM;AACjE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iDAAiD,yCAAyC;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC,sDAAsD,QAAQ;AAC9D,yCAAyC,WAAW,mBAAmB,GAAG;AAC1E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,QAAQ;AACR;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,iBAAiB;AAC9B,cAAc;AACd;AACA,eAAe,QAAQ;AACvB;AACA,8BAA8B,KAAK;AACnC;AACA,8DAA8D,IAAI;AAClE;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,MAAM;AAC1B;AACA;;AAEA;AACA,oBAAoB,cAAc;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,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A,8BAA8B,SAAS;AACvC;AACA,qEAAqE,QAAQ;AAC7E;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,MAAM;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,sBAAsB,IAAI,4BAA4B;AACxF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,yCAAyC,gCAAgC,IAAI;AAC7E;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,2BAA2B,IAAI,4BAA4B;AAC9F;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC,yBAAyB,IAAI,4BAA4B;AAC1F;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,kBAAkB,4BAA4B,SAAS;AACvE,iBAAiB;AACjB,QAAQ;AACR;AACA,gDAAgD,yCAAyC;AACzF;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA,aAAa,mCAAmC;AAChD;AACA;AACA,wEAAwE,UAAU;AAClF;;AAEA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;;AAEA;AACA,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACr+CA,mBAAmB,mBAAO,CAAC,2EAAqB;AAChD,sBAAsB,mBAAO,CAAC,qGAAkC;AAChE,iCAAiC,mBAAO,CAAC,6FAA8B;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;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AAkB;AAC9B;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4DAA4D,2BAA2B;AACvF;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6EAA6E;AAC9F;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sBAAsB;AAChE,0CAA0C,sBAAsB;AAChE;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,0CAA0C,sBAAsB;AAChE;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,uBAAuB;AACjE;AACA,qCAAqC;AACrC;AACA,iCAAiC;AACjC;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,wCAAwC;AACrD,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,aAAa,QAAQ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AACA;AACA,sCAAsC,wBAAwB;AAC9D,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gDAAgD;AACvF,uCAAuC,gDAAgD;AACvF;AACA,kCAAkC;AAClC;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,mBAAmB;AACnC;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA,wBAAwB,QAAQ;AAChC;AACA,4DAA4D,QAAQ;AACpE;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,qBAAqB,KAAK;AAC1B;AACA,yDAAyD,gBAAgB;AACzE;;AAEA;AACA;AACA,aAAa,gCAAgC;AAC7C,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,kCAAkC;AAC/C,eAAe;AACf;AACA,qBAAqB,SAAS;AAC9B;AACA,yDAAyD,SAAS;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC37BA,eAAe,mBAAO,CAAC,4FAA4B;AACnD,QAAQ,iCAAiC,EAAE,mBAAO,CAAC,0DAAc;;AAEjE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AEA,YAAY,sBAAsB;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY,aAAa;AACzB,sBAAsB,KAAK,GAAG,KAAK;;AAEnC;AACA,gEAAgE,QAAQ;AACxE,oCAAoC,mBAAmB;AACvD,wEAAwE,QAAQ;AAChF,MAAM;AACN;AACA,mDAAmD,UAAU;AAC7D;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;;;;;;;;;;;ACvDA,cAAc,mBAAO,CAAC,0FAA2B;AACjD,QAAQ,iCAAiC,EAAE,mBAAO,CAAC,0DAAc;;AAEjE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA,YAAY,aAAa;AACzB,sBAAsB,KAAK,GAAG,KAAK;;AAEnC;AACA,0DAA0D,QAAQ;AAClE,oCAAoC,mBAAmB;AACvD,kEAAkE,QAAQ;AAC1E,MAAM;AACN;AACA,6CAA6C,UAAU;AACvD;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;;;;;;;;;;;ACjCA,eAAe,mBAAO,CAAC,sBAAQ;AAC/B,cAAc,mBAAO,CAAC,0FAA2B;AACjD,QAAQ,2DAA2D,EAAE,mBAAO,CAAC,0DAAc;;AAE3F;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;A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;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,sFAAsF,UAAU;AAChG,cAAc;AACd;AACA,UAAU;AACV,yCAAyC,uBAAuB;AAChE;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,eAAe;AACf;AACA;AACA;AACA,YAAY,iCAAiC;;AAE7C;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kCAAkC,0BAA0B;AAC5D;;AAEA;AACA,2DAA2D,kBAAkB;AAC7E;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA,iEAAiE,kBAAkB;AACnF;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;;AAEA,4DAA4D,QAAQ,QAAQ,OAAO;AACnF;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;;AAET;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,aAAa,eAAe;AAC5B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA,qBAAqB,QAAQ;AAC7B;;AAEA;AACA,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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,iBAAiB,YAAY;AAC7B,mCAAmC,YAAY;AAC/C;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA,mBAAmB,cAAc,IAAI;AACrC;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,UAAU;AACvB,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA,qBAAqB,QAAQ;AAC7B;AACA,gDAAgD,QAAQ;AACxD,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,YAAY,WAAW;;AAEvB;AACA;AACA;;AAEA,2CAA2C,+BAA+B;;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A,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,iDAAiD;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,oCAAoC,mBAAmB;AACvD,2BAA2B,qBAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA,gFAAgF;AAChF;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACrFA,mBAAmB,mBAAO,CAAC,uGAAsB;;AAEjD;AACA;AACA;;;;;;;;;;;ACJA,QAAQ,mCAAmC,EAAE,mBAAO,CAAC,uFAAwB;AAC7E,gBAAgB,mBAAO,CAAC,2EAAwB;;AAEhD;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA,oBAAoB,SAAS;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,iCAAiC,mDAAmD;AACpF,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,yCAAyC,UAAU;AACnD;;AAEA;AACA;AACA,2CAA2C,0CAA0C;AACrF,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;;AAEH,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AAC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,mBAAO,CAAC,mFAAoB;AACzD;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,uDAAW;;AAEvB,QAAQ,OAAO;;AAEf;AACA;AACA;AACA;AACA,0BAA0B,eAAe;AACzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB,sBAAsB;AAC3D;AACA;AACA;AACA;;AAEA;;AAEA,6DAA6D,UAAU;AACvE,cAAc,kCAAkC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,4CAA4C;;AAExD,iEAAiE,SAAS;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,oBAAoB;AAChC;AACA,0CAA0C,mBAAmB;AAC7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA,oDAAoD,yCAAyC;AAC7F,8CAA8C,MAAM;;AAEpD;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA;;AAEA;AACA,2CAA2C,mCAAmC;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,YAAY,mBAAmB;AAC/B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,cAAc,wCAAwC;AACtD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAmB,QAAQ,gCAAgC;AAChF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,sCAAsC;AACnD;AACA,gBAAgB,kBAAkB;AAClC,qCAAqC,kBAAkB;AACvD;;AAEA;AACA,aAAa,4CAA4C;AACzD;AACA,kBAAkB,0BAA0B;AAC5C,uCAAuC,0BAA0B;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,4CAA4C;AACzD;AACA,SAAS,0BAA0B;AACnC;AACA;;AAEA;AACA,8CAA8C,wBAAwB;AACtE;AACA,KAAK;AACL;AACA;;AAEA;AACA,+CAA+C,wBAAwB;AACvE;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,UAAU;AAC9B,2CAA2C,UAAU;AACrD;;AAEA;AACA;AACA,cAAc,gEAAgE;AAC9E,kBAAkB,mBAAmB,6BAA6B,mBAAmB,qBAAqB,kBAAkB,GAAG,KAAK;AACpI;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA,oEAAoE,YAAY;AAChF;AACA,mBAAmB,YAAY;AAC/B,gBAAgB,OAAO;;AAEvB;AACA,sEAAsE,iBAAiB;AACvF;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,yBAAyB,iBAAiB,qBAAqB,SAAS,eAAe;AAChH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA,yCAAyC,yCAAyC;AAClF;AACA;;AAEA;AACA,uDAAuD,QAAQ;AAC/D,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,qDAAqD,uBAAuB;AAC5E,mEAAmE,OAAO;AAC1E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kCAAkC;AACxD;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,oEAAoE,qBAAqB;AACzF;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;;AAEA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,4BAA4B;AAC9D;;AAEA;AACA,2BAA2B,UAAU;AACrC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,gBAAgB,6BAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+DAA+D,8BAA8B;AAC7F;;AAEA;AACA;AACA;AACA,gBAAgB,yCAAyC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,KAAK,IAAI;AACT;AACA;;;;;;;;;;;AC5tBA,aAAa,mBAAO,CAAC,+DAAe;AACpC;;AAEA,yBAAyB,KAAK;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,eAAe;AAC1B,aAAa,WAAW;AACxB;AACA,aAAa,QAAQ;AACrB,WAAW,QAAQ;AACnB,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB;AACA,aAAa,QAAQ;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,a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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qCAAqC,kBAAkB,uCAAuC,eAAe;AAC7G;AACA;;AAEA,iCAAiC,qDAAqD;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,aAAa,2CAA2C;AACxD;AACA;AACA;AACA;;AAEA,aAAa,8CAA8C;AAC3D;AACA;AACA;AACA,4DAA4D,SAAS;AACrE;AACA;AACA,MAAM;AACN,oEAAoE,UAAU;AAC9E;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,aAAa,wCAAwC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,SAAS;AACxC,MAAM;AACN,+DAA+D,UAAU;AACzE;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA,aAAa,6CAA6C;AAC1D,6BAA6B,8BAA8B;AAC3D;AACA;AACA;;AAEA;AACA,0DAA0D,MAAM;AAChE;;AAEA;AACA;AACA;AACA,yBAAyB,OAAO,GAAG,aAAa;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kBAAkB;AAClC;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;AACA;;AAEA;AACA,oBAAoB;AACpB;;AAEA;AACA;;AAEA,aAAa,uCAAuC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA,oFAAoF,SAAS;AAC7F;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA,6BAA6B,OAAO,IAAI,UAAU;AAClD;AACA;AACA;AACA,OAAO;;AAEP;AACA,+BAA+B,4BAA4B;AAC3D;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,mDAAmD,UAAU;AAC7D;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,aAAa,sCAAsC;AACnD;AACA;AACA,wEAAwE,UAAU;AAClF;;AAEA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;;AAEA;AACA,YAAY;AACZ;AACA,mBAAmB,wEAAwE;AAC3F;AACA;AACA;AACA,kBAAkB,2CAA2C;AAC7D;AACA,8DAA8D,MAAM;AACpE;;AAEA;AACA;AACA,6DAA6D,UAAU;AACvE;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV,yFAAyF,OAAO;AAChG;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0EAA0E,SAAS;AACnF;AACA;;AAEA;;AAEA,4BAA4B,2CAA2C;;AAEvE,iBAAiB;AACjB,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA,aAAa,wCAAwC;AACrD,kBAAkB,0BAA0B;AAC5C;AACA,0DAA0D,MAAM;AAChE;;AAEA;AACA;AACA,yDAAyD,UAAU;AACnE;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN,qFAAqF,OAAO;AAC5F;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB,iDAAiD;AAC1E;;AAEA,aAAa,iDAAiD;AAC9D;AACA,6DAA6D,SAAS;AACtE;AACA;AACA,cAAc,SAAS,qCAAqC,qBAAqB;AACjF;AACA,KAAK;AACL;;AAEA;AACA,YAAY;AACZ;AACA,mBAAmB,yCAAyC;AAC5D;AACA;AACA;AACA;AACA;AACA,2BAA2B,2DAA2D;AACtF;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,wFAAwF,0BAA0B;AAClH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA,kBAAkB,yCAAyC;AAC3D;AACA;AACA;AACA;AACA;AACA,2BAA2B,2DAA2D;AACtF;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,yFAAyF,0BAA0B;AACnH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjhBA,mBAAmB,mBAAO,CAAC,2EAAqB;AAChD,iCAAiC,mBAAO,CAAC,6FAA8B;AACvE,sBAAsB,mBAAO,CAAC,qGAAkC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtCA,aAAa,mBAAO,CAAC,kEAAkB;AACvC,gBAAgB,mBAAO,CAAC,wEAAqB;AAC7C,wBAAwB,mBAAO,CAAC,+FAAmB;AACnD,kCAAkC,mBAAO,CAAC,mHAA6B;AACvE;AACA,YAAY,gBAAgB;AAC5B,EAAE,EAA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ACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,YAAY,kCAAkC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C,SAAS;AACT;AACA,KAAK;;AAEL,wBAAwB,kBAAkB;AAC1C;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA,eAAe,QAAQ;AACvB,gBAAgB,mBAAmB;AACnC;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA;AACA;AACA,KAAK;AACL,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,aAAa;AACb;;AAEA,kCAAkC;AAClC,YAAY,kCAAkC;AAC9C,YAAY,4CAA4C;;AAExD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,mBAAmB;AAC3C;AACA,kBAAkB,mBAAmB,mBAAmB,qBAAqB;AAC7E;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY,UAAU;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,+BAA+B,WAAW;AAC1C,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA,YAAY,6BAA6B;AACzC;AACA;AACA,KAAK;;AAEL,wDAAwD,mBAAmB;AAC3E;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B,oBAAoB,WAAW,cAAc,WAAW;AACx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AACjF,aAAa,sEAAsE;AACnF,aAAa,QAAQ;AACrB,aAAa,yBAAyB;AACtC,aAAa,oCAAoC;AACjD,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;;AAEA;AACA,YAAY,mBAAmB;;AAE/B;AACA,8DAA8D,kBAAkB;AAChF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kCAAkC;AACnF,WAAW;AACX,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;;AAEA,yCAAyC,0CAA0C;AACnF,2CAA2C,kCAAkC;AAC7E;AACA;AACA;;AAEA;AACA,YAAY,mBAAmB;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6CAA6C,2CAA2C;AACxF,SAAS;AACT;AACA,+CAA+C,kCAAkC;AACjF,SAAS;AACT;AACA;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,0DAA0D,kBAAkB;AAC5E,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,8CAA8C;AACvF;AACA;;AAEA;AACA;;AAEA,oDAAoD;;AAEpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP,2CAA2C,kCAAkC;AAC7E;;AAEA,YAAY,gCAAgC;AAC5C,4CAA4C,4CAA4C;;AAExF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,kCAAkC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;ACrkBA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,wBAAwB,4BAA4B,yCAAyC;AAC1G;AACA;AACA;AACA,mBAAmB,wBAAwB;AAC3C,iBAAiB,wBAAwB;AACzC,OAAO;AACP;AACA;AACA;;AAEA;AACA,aAAa,wBAAwB,4BAA4B,yCAAyC;AAC1G;AACA;AACA,+BAA+B,mBAAmB;AAClD;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA,aAAa,wBAAwB,4BAA4B,yCAAyC;AAC1G;AACA;AACA,+BAA+B,mBAAmB;A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A4D,IAAI;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B,IAAI;AAClD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB,IAAI;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,gBAAgB,OAAO;;AAEvB,4CAA4C,WAAW;AACvD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;;AAEA;AACA,oEAAoE,QAAQ;AAC5E,wBAAwB,SAAS,0DAA0D,WAAW;AACtG;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChRA;AACA;AACA,YAAY,MAAM;AAClB,EAAE,EAAE,mBAAO,CAAC,8DAAW;;AAEvB,oCAAoC,mBAAO,CAAC,wFAA2B;AACvE,sBAAsB,mBAAO,CAAC,wEAAmB;AACjD,gBAAgB,mBAAO,CAAC,8DAAW;AACnC,uBAAuB,mBAAO,CAAC,gEAAY;AAC3C,uBAAuB,mBAAO,CAAC,gEAAY;AAC3C,oBAAoB,mBAAO,CAAC,0DAAS;AACrC,wBAAwB,mBAAO,CAAC,wFAA2B;AAC3D,6BAA6B,mBAAO,CAAC,oFAAyB;;AAE9D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,iCAAiC;AAC9C,aAAa,mCAAmC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,0CAA0C,6BAA6B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,eAAe,0CAA0C;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,eAAe,0CAA0C;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,sEAAsE,UAAU;AAChF,qBAAqB,UAAU,GAAG,UAAU;AAC5C;AACA,SAAS;;AAET,uCAAuC,gBAAgB;AACvD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB,UAAU,GAAG,UAAU;AAC5C,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA,2DAA2D,UAAU;AACrE,uBAAuB,UAAU,GAAG,UAAU;AAC9C,WAAW;AACX;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA,iBAAiB,+CAA+C;AAChE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,UAAU,GAAG,UAAU;AAChD,aAAa;AACb;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,eAAe;AAC9B;AACA,eAAe,mEAAmE;AAClF;;AAEA;AACA;AACA,cAAc,WAAW;AACzB;;AAEA,mDAAmD,kCAAkC;AACrF,cAAc,8BAA8B;AAC5C,+BAA+B,qBAAqB;AACpD;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,UAAU;AACV;AACA;AACA,OAAO;AACP;;AAEA,YAAY,sCAAsC;;AAElD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM;AACN;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA,iDAAiD,qCAAqC;AACtF,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU,GAAG,UAAU;AAC1C,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1bA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACXA,iCAAiC,mBAAO,CAAC,6FAA8B;AACvE;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPA,QAAQ,eAAe,EAAE,mBAAO,CAAC,sBAAQ;AACzC,sBAAsB,mBAAO,CAAC,yFAAiB;AAC/C,eAAe,mBAAO,CAAC,6FAA0B;AACjD,QAAQ,4BAA4B,EAAE,mBAAO,CAAC,0DAAc;;AAE5D;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,iCAAiC;AAC9C,aAAa,yCAAyC;AACtD,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,QAAQ;AACvB,gBAAgB,wCAAwC;AACxD,gBAAgB,SAAS;AACzB,gBAAgB,UAAU;AAC1B,gBAAgB,QAAQ;AACxB;AACA;AACA,aAAa,eAAe;AAC5B;AACA;AACA,YAAY,gBAAgB;AAC5B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,aAAa,eAAe;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,gCAAgC,wBAAwB;AACxD;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,mBAAmB,8BAA8B;AACjD;AACA;AACA;;AAEA;AACA,gCAAgC,eAAe;AAC/C,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;;;;;ACtTA,QAAQ,uDAAuD,EAAE,mBAAO,CAAC,0DAAc;AACvF,eAAe,mBAAO,CAAC,6FAA0B;;AAEjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,cAAc;AAC3B,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB,aAAa,YAAY;AACzB,aAAa,yCAAyC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,8BAA8B;AAC1C,2BAA2B,QAAQ,QAAQ,OAAO,aAAa,WAAW;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D,aAAa;AACzE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,cAAc,eAAe;AAC7B;AACA;AACA;AACA,KAAK;;AAEL,YAAY,6EAA6E;;AAEzF;AACA;AACA,oBAAoB,qCAAqC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;;AAEA;;AAEA;AACA,8CAA8C,SAAS,KAAK,gBAAgB;AAC5E;AACA;AACA;;;;;;;;;;;ACvKA;AACA,WAAW,QAAQ;AACnB,WAAW,sCAAsC;AACjD,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,YAAY;AACvB,WAAW,wBAAwB;AACnC,WAAW,YAAY;AACvB,WAAW,sBAAsB;AACjC,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iCAAiC,4BAA4B;;AAE7D;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;AC/BA;;AAEA;AACA,aAAa;AACb;AACA;AACA,cAAc,mBAAO,CAAC,gBAAK;AAC3B,cAAc,mBAAO,CAAC,gBAAK;;AAE3B,YAAY,4BAA4B;AACxC;AACA,oCAAoC,8BAA8B;AAClE,sBAAsB,YAAY;;AAElC;;AAEA;AACA;AACA;;;;;;;;;;;AClBA;AACA;AACA,OAAO,+DAA+D;AACtE;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;;;;;;;;;;ACXA,oBAAoB,mBAAO,CAAC,8DAAa;AACzC,QAAQ,2BAA2B,EAAE,mBAAO,CAAC,0DAAc;AAC3D,0BAA0B,mBAAO,CAAC,gGAAiC;AACnE,2BAA2B,mBAAO,CAAC,4GAA2B;AAC9D,eAAe,mBAAO,CAAC,sBAAQ;;AAE/B,eAAe,mBAAO,CAAC,gGAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4CAA4C,QAAQ;AACpD,mCAAmC,IAAI;AACvC;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;;AAEA,8DAA8D,2BAA2B;AACzF,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB,iBAAiB,QAAQ;AACzB,mBAAmB;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB,iBAAiB,QAAQ;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B,OAAO,EAAE,WAAW,qBAAqB,SAAS;AAC9E;AACA;AACA;;AAEA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA,mBAAmB,QAAQ;AAC3B,oBAAoB,QAAQ;AAC5B,oBAAoB,UAAU;AAC9B,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;;AAEA,6BAA6B,mBAAmB;AAChD;;AAEA,gCAAgC,WAAW;AAC3C;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,4CAA4C,oDAAoD;AAChG;;AAEA,0BAA0B,mBAAmB;AAC7C;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA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;;AAEA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA,aAAa,sCAAsC;AACnD;AACA;AACA,wEAAwE,UAAU;AAClF;;AAEA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe,QAAQ;AACvB,gBAAgB,UAAU;AAC1B,gBAAgB,UAAU;AAC1B,gBAAgB,UAAU;AAC1B,gBAAgB,UAAU;AAC1B,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,YAAY,yCAAyC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA,6CAA6C,yBAAyB;AACtE,oDAAoD,yBAAyB;;AAE7E;AACA,kBAAkB,oBAAoB;AACtC,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA,eAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB;AAChB;AACA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;AACvE,kBAAkB,2CAA2C;AAC7D,eAAe,0CAA0C;AACzD;;AAEA,gBAAgB,0CAA0C;AAC1D;AACA;;AAEA;;AAEA,mBAAmB,kBAAkB;AACrC;;AAEA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS,IAAI;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,oDAAoD,QAAQ;AAC5D;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C,0BAA0B,iEAAiE;AAC3F;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;;AAEA,uCAAuC,sBAAsB;AAC7D;;AAEA;AACA,WAAW;;AAEX;AACA,UAAU;AACV;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,0CAA0C,OAAO;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,iCAAiC,4BAA4B;AAC7D;;AAEA;AACA,kEAAkE,UAAU;AAC5E;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,UAAU,KAAK,uBAAuB;AACzF;AACA;AACA;;AAEA,wBAAwB,UAAU,KAAK,uBAAuB;AAC9D;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;ACpKA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChEA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5BA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACXA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;;;;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,SAAS;AACnB;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;;;;;;;;;;;AC7QA,QAAQ,qDAAqD,EAAE,mBAAO,CAAC,uDAAW;AAClF,aAAa,mBAAO,CAAC,+DAAe;;AAEpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,YAAY;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,YAAY;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,gBAAgB;AACpC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,YAAY;AAChC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC/RA,aAAa,mBAAO,CAAC,+DAAe;;AAEpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,aAAa,OAAO;AACpB,aAAa,oCAAoC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,OAAO;AACpB,aAAa,oCAAoC;AACjD,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AClZA,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,uDAAW;AACpD,mBAAmB,mBAAO,CAAC,2EAAqB;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,iCAAiC,UAAU;AAC3C,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxlBA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACdA,QAAQ,YAAY,EAAE,mBAAO,CAAC,kBAAM;AACpC,aAAa,mBAAO,CAAC,kBAAM;;AAE3B;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA,GAAG;;AAEH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;ACtBA,QAAQ,wBAAwB,EAAE,mBAAO,CAAC,6DAAiB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAO,CAAC,+EAAQ;AACtC;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrCA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,0DAAc;;AAE1B,kBAAkB,mBAAO,CAAC,+EAAc;AACxC,kBAAkB,mBAAO,CAAC,+EAAc;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,UAAU;AACzE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D,eAAe,kBAA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;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;AC1FA,gBAAgB,mBAAO,CAAC,kEAAY;AACpC,wBAAwB,mBAAO,CAAC,wEAAY;AAC5C,QAAQ,QAAQ,EAAE,mBAAO,CAAC,gGAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO,kCAAkC;AACzC,OAAO,kCAAkC;AACzC;AACA;AACA,oBAAoB,0CAA0C;AAC9D;AACA,oCAAoC,yBAAyB;AAC7D;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpFA,eAAe,mBAAO,CAAC,kFAAU;AACjC;;AAEA;;;;;;;;;;;ACHA;AACA;AACA;AACA,CAAC;;;;;;;;;;;ACHD,gBAAgB,mBAAO,CAAC,wEAAkB;;AAE1C;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,YAAY;AAChC;AACA;;;;;;;;;;;ACXA,aAAa,mBAAO,CAAC,wEAAwB;AAC7C,sBAAsB,mBAAO,CAAC,qGAAyB;AACvD,uBAAuB,mBAAO,CAAC,sFAAyB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,YAAY,QAAQ,sBAAsB,KAAK;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3DA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,eAAe,mBAAO,CAAC,2FAAiB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B,8BAA8B;AAC9B,eAAe;AACf,iBAAiB;AACjB,qBAAqB,GAAG;AACxB;AACA,oBAAoB,+DAA+D;AACnF;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACjEA,gBAAgB,mBAAO,CAAC,qEAAe;AACvC,QAAQ,6BAA6B,EAAE,mBAAO,CAAC,6DAAiB;AAChE,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,mGAA2B;AACvE,sBAAsB,mBAAO,CAAC,kGAAsB;AACpD,uBAAuB,mBAAO,CAAC,mFAAsB;;AAErD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,gEAAgE,eAAe,wBAAwB,OAAO;AAC9G;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wDAAwD,6BAA6B;;AAErF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACrHA,aAAa,mBAAO,CAAC,qEAAqB;AAC1C,gBAAgB,mBAAO,CAAC,qEAAe;AACvC,eAAe,mBAAO,CAAC,kFAAW;AAClC;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,mGAA2B;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC5FA,gBAAgB,mBAAO,CAAC,iEAAW;;AAEnC,0BAA0B,oCAAoC,8BAA8B;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACZA;AACA,QAAQ,qDAAqD;AAC7D,oBAAoB,mBAAO,CAAC,gGAAc;AAC1C,qBAAqB,mBAAO,CAAC,kGAAe;AAC5C,aAAa,mBAAmB,qDAAqD;AACrF,GAAG;AACH,QAAQ,qDAAq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GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;AChBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,6BAA6B,EAAE,mBAAO,CAAC,8EAAe;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,oDAAoD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA;AACA;AACA;;;;;;;;;;;AChCA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,YAAY,iBAAiB;AAC7B,sDAAsD,WAAW;AACjE,KAAK;AACL,eAAe,sBAAsB;;AAErC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AClDA,kBAAkB,mBAAO,CAAC,oGAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,oDAAoD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACrBA,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,sGAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC3BA;AACA,QAAQ,yBAAyB;AACjC,oBAAoB,mBAAO,CAAC,6FAAc;AAC1C,qBAAqB,mBAAO,CAAC,+FAAe;AAC5C,aAAa,mBAAmB,yBAAyB;AACzD,GAAG;AACH,QA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AAC,+FAAe;AAC5C,aAAa,mBAAmB,+BAA+B;AAC/D,GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;AC1BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,qBAAqB;AACxD;AACA;;AAEA,+BAA+B,aAAa;AAC5C;AACA;;;;;;;;;;;AChDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,QAAQ,iDAAiD,EAAE,mBAAO,CAAC,gEAAoB;;AAEvF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD,WAAW;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC1CA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,8CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,qBAAqB;AACxD;AACA;;AAEA,+BAA+B,aAAa;AAC5C;AACA;;;;;;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AAO,CAAC,6FAAe;AAC5C,aAAa,mBAAmB,SAAS;AACzC,GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;AChBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,qBAAqB,EAAE,mBAAO,CAAC,8EAAe;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;ACtCD,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kEAAkE,WAAW;AAC7E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,yDAAyD,WAAW;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC1EA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,qBAAqB,EAAE,mBAAO,CAAC,8EAAe;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;ACzCD,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,8FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC3DA;AACA;AACA,oBAAoB,mBAAO,CAAC,6FAAc;AAC1C,qBAAqB,mBAAO,CAAC,+FAAe;AAC5C,aAAa;AACb,GAAG;AACH;AACA,oBAAoB,mBAAO,CAAC,6FAAc;AAC1C,qBAAqB,mBAAO,CAAC,+FAAe;AAC5C,aAAa;AACb,GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;AChBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;;;;;;;;;;;ACrBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACtCA,kBAAkB,mBAAO,CAAC,8FAAe;;AAEzC;AACA;AACA;;AAEA,kEAAkE,eAAe;;;;;;;;;;;ACNjF,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,gGAAgB;;AAE5D;AACA;AACA;AACA;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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;ACpCD,QAAQ,QAAQ,EAAE,mBAAO,CAAC,gGAAgB;AAC1C,gBAAgB,mBAAO,CAAC,wEAAkB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACxDA;AACA,QAAQ,WAAW;AACnB,oBAAoB,mBAAO,CAAC,gGAAc;AAC1C,qBAAqB,mBAAO,CAAC,kGAAe;AAC5C,aAAa,mBAAmB,WAAW;AAC3C,GAAG;AACH,QAAQ,4BAA4B;AACpC,oBAAoB,mBAAO,CAAC,gGAAc;AAC1C,qBAAqB,mBAAO,CAAC,kGAAe;AAC5C,aAAa,mBAAmB,4BAA4B;AAC5D,GAAG;AACH,QAAQ,4BAA4B;AACpC,oBAAoB,mBAAO,CAAC,gGAAc;AAC1C,qBAAqB,mBAAO,CAAC,kGAAe;AAC5C,aAAa,mBAAmB,4BAA4B;AAC5D,GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;ACrBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,8EAAe;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,OAAO;AAClB;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,0BAA0B,8BAA8B;AACxD;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,qBAAqB,mBAAO,CAAC,kFAAuB;AACpD,4BAA4B,mBAAO,CAAC,gGAA8B;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sDAAsD,WAAW;AACjE;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjGA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,8EAAe;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,OAAO;AAClB;AACA;AACA,oBAAoB,oCAAoC;AACxD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,0BAA0B,8BAA8B;AACxD;AACA;AACA;AACA;AACA;;;;;;;;;;;AC9BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,mGAAgB;AACnD,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,kFAAuB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACvEA,kBAAkB,mBAAO,CAAC,iGAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,OAAO;AAClB;AACA;AACA,oBAAoB,4BAA4B;AAChD,4BAA4B,4BAA4B,KAAK,eAAe;;;;;;;;;;;AChB5E,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,mGAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACtCA;AACA,QAAQ,UAAU;AAClB,oBAAoB,mBAAO,CAAC,+FAAc;AAC1C,qBAAqB,mBAAO,CAAC,iGAAe;AAC5C,aAAa,mBAAmB,UAAU;AAC1C,GAAG;AACH,QAAQ,UAAU;AAClB,oBAAoB,mBAAO,CAAC,+FAAc;AAC1C,qBAAqB,mBAAO,CAAC,iGAAe;AAC5C,aAAa,mBAAmB,UAAU;AAC1C,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AAoE;AAC7F;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,sFAAc;AAC1C,qBAAqB,mBAAO,CAAC,wFAAe;AAC5C;AACA,yBAAyB,oEAAoE;AAC7F;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,sFAAc;AAC1C,qBAAqB,mBAAO,CAAC,wFAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,sFAAc;AAC1C,qBAAqB,mBAAO,CAAC,wFAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,sFAAc;AAC1C,qBAAqB,mBAAO,CAAC,wFAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,wFAAe;AAC3C,qBAAqB,mBAAO,CAAC,0FAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,oBAAoB,mBAAO,CAAC,wFAAe;AAC3C,qBAAqB,mBAAO,CAAC,0FAAgB;AAC7C;AACA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kBAAkB,mBAAO,CAAC,uFAAe;;AAEzC,oBAAoB,0CAA0C;AAC9D,mCAAmC,0CAA0C,KAAK,eAAe;AACjG;;;;;;;;;;;ACJA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,0BAA0B,mBAAO,CAAC,8FAA6B;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC3CA,wBAAwB,mBAAO,CAAC,sFAAyB;AACzD,kBAAkB,mBAAO,CAAC,uFAAe;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACtDA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,yFAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;AACjD,wBAAwB,mBAAO,CAAC,sFAAyB;;AAEzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,iCAAiC,mBAAmB;AACpD;AACA;;AAEA,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnFA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,uBAAuB,mBAAO,CAAC,qGAAsB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACpEA,kBAAkB,mBAAO,CAAC,uFAAe;;AAEzC,oBAAoB,0CAA0C;AAC9D,mCAAmC,0CAA0C,KAAK,eAAe;AACjG;;;;;;;;;;;ACJA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,yFAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AClBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oDAAoD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,kCAAkC;AAC7D;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7DA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,yFAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AClBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,0BAA0B,mBAAO,CAAC,8FAA6B;AAC/D,2BAA2B,mBAAO,CAAC,sGAAiC;AACpE,QAAQ,aAAa,EAAE,mBAAO,CAAC,4FAAyB;;AAExD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC7CA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;AACjD,wBAAwB,mBAAO,CAAC,sFAAyB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,kCAAkC;AAC7D;AACA;AACA;AACA;AACA;;;;;;;;;;;AClDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,uBAAuB,mBAAO,CAAC,iGAAkB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACtDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;AACjD,wBAAwB,mBAAO,CAAC,sFAAyB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,uDAAuD;AAClF;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,uBAAuB,mBAAO,CAAC,qGAAsB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACxDA,wBAAwB,mBAAO,CAAC,sFAAyB;AACzD,kBAAkB,mBAAO,CAAC,uFAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACrCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,yFAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACvBA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;AACjD,wBAAwB,mBAAO,CAAC,sFAAyB;;AAEzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,iCAAiC,mBAAmB;AACpD;AACA;;AAEA,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,uDAAuD;AAClF;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxEA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,uBAAuB,mBAAO,CAAC,qGAAsB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC9DA,wBAAwB,mBAAO,CAAC,sFAAyB;AACzD,kBAAkB,mBAAO,CAAC,uFAAe;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACrDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,yFAAgB;AACnD,uBAAuB,mBAAO,CAAC,qGAAsB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AClEA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,8EAAe;AACjD,wBAAwB,mBAAO,CAAC,sFAAyB;;AAEzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA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AAClE;AACA;;;;;;;;;;;AC9BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,0DAA0D,EAAE,mBAAO,CAAC,oEAAgB;;AAE5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC7CA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,oBAAoB,EAAE,mBAAO,CAAC,8EAAe;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,gCAAgC,kCAAkC;AAClE;AACA;;;;;;;;;;;ACvCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,6FAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjBA,kBAAkB,mBAAO,CAAC,2FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;AChCA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,4BAA4B,EAAE,mBAAO,CAAC,oEAAgB;AAC9D,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,6FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzCA,kBAAkB,mBAAO,CAAC,2FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;AChCA,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,6FAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC/BA,kBAAkB,mBAAO,CAAC,2FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACnCA,QAAQ,SAAS,EAAE,mBAAO,CAAC,6FAAgB;AAC3C,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,gEAAoB;AAChE,QAAQ,2CAA2C,EAAE,mBAAO,CAAC,oEAAgB;;AAE7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,sCAAsC;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACtCA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,oBAAoB,EAAE,mBAAO,CAAC,8EAAe;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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O,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,sBAAsB,EAAE,mBAAO,CAAC,8EAAe;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mCAAmC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,2BAA2B;AACtD;AACA;;;;;;;;;;;AC/BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACnDA,kBAAkB,mBAAO,CAAC,6FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mCAAmC;AACvD,4BAA4B,mCAAmC,KAAK,eAAe;;;;;;;;;;;ACbnF,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,+FAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,CAAC;;;;;;;;;;;ACfD,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,YAAY,qBAAqB;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC1EA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,mBAAmB,EAAE,mBAAO,CAAC,8EAAe;;AAEpD;AACA;AACA;AACA;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;ACfD,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,4FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzDA,kBAAkB,mBAAO,CAAC,0FAAe;;AAEzC;AACA;AACA;AACA;;AAEA,oBAAoB,QAAQ,+BAA+B,QAAQ,KAAK,eAAe;;;;;;;;;;;ACPvF,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,4FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC3DA,kBAAkB,mBAAO,CAAC,0FAAe;;AAEzC;AACA;AACA;AACA;;AAEA,oBAAoB,QAAQ,+BAA+B,QAAQ,KAAK,eAAe;;;;;;;;;;;ACPvF,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,4FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC7DA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,mBAAmB,EAAE,mBAAO,CAAC,8EAAe;;AAEpD;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,uCAAuC;AAC3D;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;AChBD,QAAQ,mCAAmC,EAAE,mBAAO,CAAC,4FAAgB;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC7CA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,8CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,4DAA4D;AACvF;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,gGAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACdA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,6DAA6D;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,gGAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACdA,kBAAkB,mBAAO,CAAC,8FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,6DAA6D;AACjF,4BAA4B,6DAA6D;AACzF;AACA,GAAG;;;;;;;;;;;ACnBH,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,gGAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;;;;;;;;;;AClCA,kBAAkB,mBAAO,CAAC,8FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,6DAA6D;AACjF,4BAA4B,6DAA6D;AACzF;AACA,GAAG;;;;;;;;;;;ACnBH,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,gGAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC5BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,uBAAuB,EAAE,mBAAO,CAAC,8EAAe;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,8CAA8C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,gGAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACdA;AACA,QAAQ,iBAAiB;AACzB,oBAAoB,mBAAO,CAAC,4FAAc;AAC1C,qBAAqB,mBAAO,CAAC,8FAAe;AAC5C,aAAa,mBAAmB,iBAAiB;AACjD,GAAG;AACH,QAAQ,iBAAiB;AACzB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O,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACvDA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,sBAAsB,EAAE,mBAAO,CAAC,8EAAe;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,2BAA2B,WAAW;AACtC;AACA;;;;;;;;;;;AC3BA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,+FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;;;;;;;;;;ACxCA,kBAAkB,mBAAO,CAAC,6FAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC,4BAA4B,iBAAiB,KAAK,eAAe;;;;;;;;;;;ACZjE,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,+FAAgB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;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AC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,eAAe,SAAS;AACxB;;;;;;;;;;;ACrGA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,kBAAkB,EAAE,mBAAO,CAAC,8EAAe;AACnD,mBAAmB,mBAAO,CAAC,oFAAqB;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,kCAAkC;AACzC,OAAO,kCAAkC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA,4BAA4B,qBAAqB;AACjD,kCAAkC,sCAAsC;AACxE;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrFA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,YAAY,YAAY;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AChDA,kBAAkB,mBAAO,CAAC,yFAAe;;AAEzC;AACA;;AAE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BAAO,CAAC,wEAAkB;AAC1C,QAAQ,kBAAkB,EAAE,mBAAO,CAAC,8EAAe;AACnD,QAAQ,QAAQ,EAAE,mBAAO,CAAC,sGAA8B;AACxD,eAAe,mBAAO,CAAC,0GAAgC;AACvD,QAAQ,cAAc,EAAE,mBAAO,CAAC,4FAAyB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,QAAQ;AAC1C,gBAAgB,SAAS;AACzB,mBAAmB,SAAS;AAC5B,+CAA+C;AAC/C,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,qDAAqD;AACjF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA,+BAA+B,qDAAqD;AACpF;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;;;;;;;;;;ACtHA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,+BAA+B,EAAE,mBAAO,CAAC,oEAAgB;AACjE,gBAAgB,mBAAO,CAAC,8EAA2B;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,YAAY,YAAY;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACvDA,kBAAkB,mBAAO,CAAC,yFAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;AClCA,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,2FAAgB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjBA,kBAAkB,mBAAO,CAAC,yFAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;AClCA,gBAAgB,mBAAO,CAAC,wEAAkB;AAC1C,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,2FAAgB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;AC1CA,kBAAkB,mBAAO,CAAC,yFAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM;AACN;;;;;;;;;;;ACrCA,QAAQ,0BAA0B,EAAE,mBAAO,CAAC,2FAAgB;;AAE5D;AACA;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ACA,WAAW,cAAc;AACzB,WAAW,qBAAqB;AAChC,aAAa;AACb;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;;AAEA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,8BAA8B,gDAAgD;;AAE9E,0DAA0D,gBAAgB;AAC1E;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA,OAAO;AACP;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC1DA,QAAQ,2BAA2B,EAAE,mBAAO,CAAC,uDAAW;;AAExD;AACA;AACA;AACA;;AAEA,uBAAuB,yBAAyB,IAAI;AACpD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC9DA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACXA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACTA,QAAQ,SAAS,EAAE,mBAAO,CAAC,kBAAM;AACjC,QAAQ,qBAAqB,EAAE,mBAAO,CAAC,uDAAW;;AAElD;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gBAAgB,8BAA8B,IAAI;AAClD;AACA,kEAAkE,eAAe;AACjF;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B,eAAe,KAAK,YAAY;AAC9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC9DA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,GAAG;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa,2BAA2B;AACxC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,eAAe;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qBAAqB;AAClC,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;;;;;;;;;;;ACtVA;AACA;AACA,YAAY,+BAA+B;AAC3C;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACjBA;AACA,WAAW,KAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACxBA;AACA;AACA;AACA,GAAG;;;;;;;;;;;ACHH,QAAQ,OAAO;AACf;AACA,0CAA0C,+BAA+B,KAAK;;;;;;;;;;;ACF9E,cAAc,mBAAO,CAAC,0DAAS;AAC/B,QAAQ,iBAAiB,EAAE,mBAAO,CAAC,uDAAW;;AAE9C;AACA;AACA,IAAI,iFAAiF;AACrF;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;;;;;;;;;;AC5CA;;AAEA,oCAAoC,SAAS,GAAG,KAAK,EAAE,uBAAuB;;;;;;;;;;;ACF9E;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,qBAAqB,MAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC;AACA,yDAAyD,MAAM;AAC/D,qDAAqD,MAAM;AAC3D,oDAAoD,MAAM,oCAAoC,MAAM;;AAEpG;AACA;AACA;;AAEA,cAAc;AACd,aAAa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC7QA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uFAAqC;;;;;;;;;;;;ACXrC;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,SAAS,mBAAO,CAAC,gDAAS;AAC1B,cAAc,iDAAuB;;AAErC;AACA;AACA;AACA;;AAEA,mCAAmC,SAAS;AAC5C;;AAEA;AACA;AACA;AACA;;AAEA,eAAe;AACf,gBAAgB,KAAK;AACrB,mBAAmB;AACnB,iBAAiB;AACjB,kBAAkB;AAClB,cAAc;AACd,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;AC3LA,WAAW,mBAAO,CAAC,kBAAM;AACzB,SAAS,mBAAO,CAAC,cAAI;;AAErB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mCAAmC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;;AAEA;AACA;;AAEA;AACA,YAAY,mBAAO,CAAC,oDAAc;;AAElC;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC3GA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACjKA,aAAa,mBAAO,CAAC,sDAAY;AACjC,YAAY,mBAAO,CAAC,oBAAO;AAC3B,aAAa,mBAAO,CAAC,8CAAQ;AAC7B,aAAa,mBAAO,CAAC,sBAAQ;AAC7B,SAAS,mBAAO,CAAC,cAAI;;AAErB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC,6BAA6B;AAClE,+BAA+B;;AAE/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,mBAAmB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,2BAA2B;AAC3B;AACA;;;;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,wBAAwB,mBAAO,CAAC,+DAAe;AAC/C,yBAAyB,mBAAO,CAAC,iEAAgB;AACjD,yBAAyB,mBAAO,CAAC,iEAAgB;AACjD,0BAA0B,mBAAO,CAAC,mEAAiB;;AAEnD;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;;AAEzB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA,qCAAqC,UAAU;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;;AAElB,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;;AAEA,sCAAsC,UAAU;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;;AAElB,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;;AAEA,wCAAwC,aAAa,YAAY;;AAEjE;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,kCAAkC;AAClC,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;;AAElB,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS,YAAY;;AAE9D;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;;AAElB,kBAAkB,qBAAqB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;;AAE/B,yBAAyB,uBAAuB;AAChD;AACA;AACA,MAAM;AACN,yBAAyB;AACzB;AACA;;AAEA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;;;;;;;;;;;ACrSA,2CAA2C;AAC3C;AACA,EAAE,OAAO;AACT,EAAE,kHAA+C;AACjD;;;;;;;;;;;ACJA,SAAS,mBAAO,CAAC,cAAI;AACrB,WAAW,mBAAO,CAAC,kBAAM;AACzB,SAAS,mBAAO,CAAC,cAAI;;AAErB;AACA,qBAAqB,KAAyC,GAAG,OAAuB,GAAG,CAAO;;AAElG;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAyC,oBAAoB,CAAE;AACnE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;;AAEf;;AAEA,kBAAkB,gBAAgB;AAClC;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,EAAE;AACvC;AACA,yDAAyD;AACzD;AACA;AACA;AACA,2GAA2G,EAAE;AAC7G;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,qEAAgB;AAC1C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAAuD;AACvD;AACA;AACA,kGAAkG,gCAAgC;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uGAAuG;AAC7H;AACA,kCAAkC;AAClC,kBAAkB,uDAAuD;AACzE;AACA;AACA;AACA,sCAAsC,yBAAyB;AAC/D,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2BAA2B,iCAAiC;AAC5D;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD;;AAEA,wBAAwB;AACxB,uBAAuB;AACvB,yBAAyB;AACzB,wBAAwB;AACxB,yBAAyB;AACzB,yBAAyB;AACzB,0BAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA,iEAAiE;AACjE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA,aAAa;AACb;AACA;;AAEA;AACA,sBAAsB;AACtB,mCAAmC,OAAO;AAC1C,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,iCAAiC;AACjC,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,qCAAqC;AACrC,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,iCAAiC;AACjC,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,qCAAqC;AACrC,MAAM;AACN;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,GAAG;AACzB;;AAEA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;;AAEA;AACA,oBAAoB,eAAe;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA,2BAA2B;AAC3B,8BAA8B,YAAY;AAC1C,wEAAwE,YAAY;AACpF;AACA;AACA,sBAAsB;AACtB,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACngBA,gEAAwC;;;;;;;;;;;;ACAxC;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;;AAEA;AACA,YAAY,mBAAO,CAAC,kDAAU;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,kBAAkB;AACtC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,mBAAO,CAAC,gCAAa;AAChC,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACzOA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,UAAU;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;;AAEA;AACA;;;;;;;;;;;;ACnIA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7JA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qBAAqB;AACjC,YAAY,OAAO;AACnB,YAAY,QAAQ;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA,+BAA+B;AAC/B;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;AChIA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB,sBAAsB;;AAEtB;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAO,CAAC,oDAAW;AACnC,aAAa,mBAAO,CAAC,yDAAW;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,uBAAuB;AAClC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA,kBAAkB,kBAAkB;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;;AAEA,kBAAkB,gBAAgB;AAClC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,uBAAuB;AAClC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACtUa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;ACtBa;;AAEb,gBAAgB,mBAAO,CAAC,uDAAa;AACrC,YAAY,mBAAO,CAAC,+CAAS;AAC7B,cAAc,mBAAO,CAAC,mDAAW;;AAEjC;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,+CAAS;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;AAChC;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+BAA+B;;AAExE;AACA,wCAAwC;;AAExC;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;;AAEA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,mCAAmC,QAAQ;AAC3C;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,wBAAwB;AACxB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACtQa;;AAEb,qBAAqB,mBAAO,CAAC,0DAAc;AAC3C,YAAY,mBAAO,CAAC,+CAAS;AAC7B,cAAc,mBAAO,CAAC,mDAAW;AACjC;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,gEAAgE;AACrF,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA,oBAAoB,oBAAoB;AACxC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACrUa;;AAEb,cAAc,mBAAO,CAAC,mDAAW;;AAEjC;AACA;;AAEA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,cAAc;AACd;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,kDAAkD,EAAE;AACpD;AACA,SAAS;AACT;;AAEA;AACA,oBAAoB,mBAAmB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,OAAO,UAAU,aAAa;AACjD;;AAEA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA,6BAA6B,qBAAqB;AAClD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3PA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,sBAAQ;;AAE7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,qBAAM;AAC1B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB,oBAAoB;AAC7C;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;AACA,YAAY,mBAAO,CAAC,4CAAO;AAC3B,kBAAkB,mBAAO,CAAC,wDAAa;AACvC,YAAY,mBAAO,CAAC,0DAAY;AAChC,aAAa,mBAAO,CAAC,8CAAQ;;AAE7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,wBAAwB;AACnC,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,qBAAM;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,mBAAO,CAAC,gCAAa;AAChC,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACxUA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4EAA4E;AAC5E,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,iDAAiD;;AAE5F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,MAAM;AACN,eAAe;AACf;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,uDAAuD;AAC7F;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,gBAAgB;AACtD;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,mBAAmB;AACpD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,kBAAkB;;AAElB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+CAA+C,QAAQ;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA,YAAY;AACZ;AACA;AACA;;AAEA,YAAY;AACZ;AACA;AACA;;AAEA,YAAY;AACZ;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE,KAA0B,oBAAoB,CAAE;AAClD;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;ACxvBA;AACA;AACA,aAAa,mBAAO,CAAC,sBAAQ;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE,cAAc;AAChB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChEA;;AAEY;;AAEZ,aAAa,mBAAO,CAAC,sBAAQ;AAC7B;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,wDAAa;AACvC,YAAY,mBAAO,CAAC,kEAAO;AAC3B,gBAAgB,mBAAO,CAAC,0CAAM;AAC9B,cAAc,mBAAO,CAAC,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,CAAC;;AAED;AACA;AACA;AACA,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wDAAwD,IAAI;AAC5D;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,kBAAkB,oBAAoB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,cAAc;AACzB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC,eAAe;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;;;;;;;;;;;ACtnCA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;;AAEA,UAAU,0GAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,mHAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;ACzMA;AACA;AACA;AACA;;AAEA;AACA,EAAE,iHAAwC;AAC1C,EAAE;AACF,EAAE,2GAAqC;AACvC;;;;;;;;;;;ACTA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,gBAAK;AACvB,WAAW,mBAAO,CAAC,kBAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,0GAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,cAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,gBAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAO,CAAC,oDAAW;AACnC,iBAAiB,mBAAO,CAAC,wDAAa;AACtC,eAAe,mBAAO,CAAC,kDAAU;AACjC,cAAc,iDAAuB;AACrC,WAAW,mBAAO,CAAC,0CAAM;AACzB,UAAU,mBAAO,CAAC,gBAAK;;AAEvB;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;;AAEnB;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjNY;AACZ;AACA,6CAA6C,gBAAgB;;AAE7D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBa;;AAEb,mBAAmB,mBAAO,CAAC,4DAAe;AAC1C,gBAAgB,mBAAO,CAAC,kEAAqB;AAC7C,cAAc,mBAAO,CAAC,8DAAgB;;AAEtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,6BAA6B,6BAA6B;AAC1D;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,wBAAwB;AACxB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3HA;AACA;AACA,SAAS,mBAAO,CAAC,6EAAa;AAC9B,iBAAiB,mBAAO,CAAC,6FAAqB;AAC9C,eAAe,mBAAO,CAAC,qGAAyB;AAChD,qBAAqB,mBAAO,CAAC,qGAAyB;AACtD,qBAAqB,mBAAO,CAAC,qGAAyB;AACtD,UAAU,mBAAO,CAAC,+EAAc;AAChC,EAAE;AACF;AACA,UAAU,mBAAO,CAAC,mGAAwB;AAC1C,aAAa,mBAAO,CAAC,yGAA2B;AAChD,EAAE;AACF;AACA,UAAU,mBAAO,CAAC,qGAAyB;AAC3C,UAAU,mBAAO,CAAC,qGAAyB;AAC3C,EAAE;AACF;AACA,UAAU,mBAAO,CAAC,+GAA8B;AAChD,cAAc,m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;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAkD;AAClE;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACnZa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;AAChC,aAAa,mBAAO,CAAC,2GAAkB;AACvC,cAAc,mBAAO,CAAC,mHAAsB;AAC5C,eAAe,mBAAO,CAAC,qHAAuB;AAC9C,oBAAoB,mBAAO,CAAC,uHAAuB;AACnD,mBAAmB,mBAAO,CAAC,6HAA2B;AACtD,sBAAsB,mBAAO,CAAC,mIAA8B;AAC5D,kBAAkB,mBAAO,CAAC,mHAAqB;AAC/C,2BAA2B,mBAAO,CAAC,6HAA0B;AAC7D,aAAa,mBAAO,CAAC,6GAAkB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACnNa;;AAEb,YAAY,mBAAO,CAAC,4FAAS;AAC7B,WAAW,mBAAO,CAAC,0GAAgB;AACnC,YAAY,mBAAO,CAAC,sGAAc;AAClC,kBAAkB,mBAAO,CAAC,kHAAoB;AAC9C,eAAe,mBAAO,CAAC,wGAAY;;AAEnC;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,4GAAiB;AACxC,oBAAoB,mBAAO,CAAC,sHAAsB;AAClD,iBAAiB,mBAAO,CAAC,gHAAmB;AAC5C,gBAAgB,iIAA6B;;AAE7C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,8GAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,0HAAwB;;AAErD;;AAEA;AACA,yBAAsB;;;;;;;;;;;;ACxDT;;AAEb;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,qGAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtHa;;AAEb;AACA;AACA;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;AAChC,eAAe,mBAAO,CAAC,mHAAqB;AAC5C,yBAAyB,mBAAO,CAAC,2HAAsB;AACvD,sBAAsB,mBAAO,CAAC,qHAAmB;AACjD,kBAAkB,mBAAO,CAAC,6GAAe;AACzC,gBAAgB,mBAAO,CAAC,qHAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,6HAA0B;AACtD,kBAAkB,mBAAO,CAAC,yHAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,+GAAgB;;AAE3C;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;AAChC,oBAAoB,mBAAO,CAAC,iHAAiB;AAC7C,eAAe,mBAAO,CAAC,iHAAoB;AAC3C,eAAe,mBAAO,CAAC,yGAAa;AACpC,aAAa,mBAAO,CAAC,6GAAkB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;ACtFa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1Ca;;AAEb,YAAY,mBAAO,CAAC,6FAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN,2BAA2B;AAC3B,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;AClGa;;AAEb,kBAAkB,mBAAO,CAAC,6GAAe;;AAEzC;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;AAChC,eAAe,mBAAO,CAAC,yGAAa;;AAEpC;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,gBAAgB;AAC3B,aAAa,GAAG;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,6FAAU;AAC9B,0BAA0B,mBAAO,CAAC,yIAAgC;AAClE,mBAAmB,mBAAO,CAAC,qHAAsB;AACjD,2BAA2B,mBAAO,CAAC,mHAAgB;;AAEnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,2GAAiB;AACvC,IAAI;AACJ;AACA,cAAc,mBAAO,CAAC,6GAAkB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;AClIa;;AAEb;AACA;AACA;AACA;AACA;;;;;;;;;;;ACNA;AACA;AACA;;;;;;;;;;;ACFa;;AAEb;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA2C;AAC3C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,gCAAgC,cAAc;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;;;;;;;;;;;;ACZa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,6FAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,+FAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,UAAU;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1Ba;;AAEb,cAAc,kIAA8B;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACjFa;;AAEb,WAAW,mBAAO,CAAC,0GAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA4B;AAC5B;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,4BAA4B;AAC5B,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5VA;AACA;AACA;AACA;;AAEA;AACA,yDAAyD,gHAAkC;AAC3F;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACjBA,uBAAuB,iHAAkC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AChDA,mBAAmB,mBAAO,CAAC,mFAAc;AACzC,sBAAsB,mBAAO,CAAC,yFAAiB;AAC/C,sBAAsB,mBAAO,CAAC,yFAAiB;AAC/C,oBAAoB,mBAAO,CAAC,qFAAe;AAC3C,0BAA0B,mBAAO,CAAC,iGAAqB;AACvD,0BAA0B,mBAAO,CAAC,iGAAqB;AACvD,2BAA2B,mBAAO,CAAC,mGAAsB;AACzD,yBAAyB,mBAAO,CAAC,+FAAoB;AACrD,sBAAsB,mBAAO,CAAC,yFAAiB;AAC/C,4BAA4B,sHAAuC;;AAEnE;AACA,uBAAuB,mBAAO,CAAC,+FAAoB;AACnD,wBAAwB,mBAAO,CAAC,iGAAqB;AACrD,6BAA6B,mBAAO,CAAC,2GAA0B;AAC/D,gCAAgC,mBAAO,CAAC,mHAA8B;AACtE,wBAAwB,mBAAO,CAAC,iGAAqB;AACrD,kCAAkC,mBAAO,CAAC,qHAA+B;AACzE,2BAA2B,mBAAO,CAAC,yGAAyB;AAC5D,+CAA+C,mBAAO,CAAC,iJAA6C;;AAEpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AC7MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC3FA,iBAAiB,mBAAO,CAAC,+EAAY;AACrC,cAAc,mBAAO,CAAC,+DAAO;AAC7B,mBAAmB,mBAAO,CAAC,wDAAa;;AAExC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,qBAAqB,sCAAsC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACZA,iCAAiC,2HAA4C;AAC7E,0BAA0B,mBAAO,CAAC,iGAAqB;;AAEvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACZA,eAAe,mBAAO,CAAC,2EAAU;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;;;;;;;;;;ACxDA,eAAe,mBAAO,CAAC,4EAAW;AAClC,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,mBAAmB,mBAAO,CAAC,sHAAc;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACzCA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AChJA,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,eAAe,mBAAO,CAAC,4EAAW;AAClC,kBAAkB,mBAAO,CAAC,sGAAa;AACvC,uBAAuB,mBAAO,CAAC,sGAAwB;AACvD,6BAA6B,iJAAqD;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACzCA,iCAAiC,4HAA6C;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;ACpFA,eAAe,mBAAO,CAAC,4EAAW;AAClC,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,mBAAmB,mBAAO,CAAC,mGAAc;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACZA,eAAe,mBAAO,CAAC,4EAAW;AAClC,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,mBAAmB,mBAAO,CAAC,uGAAc;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE,mEAAmE;AACnE,wEAAwE;AACxE,0DAA0D;AAC1D,wDAAwD;AACxD,wDAAwD;AACxD,6DAA6D;AAC7D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACdA,kBAAkB,mBAAO,CAAC,sGAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AChBA,eAAe,mBAAO,CAAC,4EAAW;AAClC,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,eAAe,mBAAO,CAAC,sFAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACvBA,gBAAgB,mBAAO,CAAC,wFAAW;;AAEnC;AACA;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;ACpBA,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,iBAAiB,mBAAO,CAAC,8FAAY;AACrC,uBAAuB,mBAAO,CAAC,sGAAwB;AACvD,6BAA6B,0IAA8C;AAC3E,OAAO,sBAAsB,EAAE,mBAAO,CAAC,+EAAc;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACvCA,iBAAiB,mBAAO,CAAC,8FAAY;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACfA,eAAe,mBAAO,CAAC,0FAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACvFA,kBAAkB,mBAAO,CAAC,2FAAa;AACvC,eAAe,mBAAO,CAAC,qFAAU;AACjC,cAAc,mBAAO,CAAC,0EAAU;AAChC,6BAA6B,wHAAyC;AACtE,kBAAkB,mBAAO,CAAC,4FAAmB;AAC7C,6BAA6B,sIAA0C;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACvBA,eAAe,mBAAO,CAAC,sFAAU;AACjC,eAAe,mBAAO,CAAC,sFAAU;AACjC,cAAc,mBAAO,CAAC,0EAAU;AAChC,6BAA6B,wHAAyC;AACtE,kBAAkB,mBAAO,CAAC,4FAAmB;AAC7C,6BAA6B,uIAA2C;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;AAEA;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;;AAEA;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;;;;;;;;;ACrCA,sBAAsB,mBAAO,CAAC,0FAAkB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AC/CA,kBAAkB,mBAAO,CAAC,kFAAc;;AAExC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACVA,gBAAgB,mBAAO,CAAC,8EAAY;AACpC,eAAe,mBAAO,CAAC,4EAAW;AAClC,uBAAuB,mBAAO,CAAC,sGAAwB;;AAEvD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA,EAAE;;AAEF;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,wDAAc;;AAElC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACjJa;AACb,WAAW,mBAAO,CAAC,cAAI;AACvB,gBAAgB,mBAAO,CAAC,8EAAU;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iCAAiC,GAAG;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClIa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPY;;AAEZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,YAAY,mBAAO,CAAC,wDAAa;AACjC,WAAW,mBAAO,CAAC,sDAAY;;AAE/B;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,sBAAsB;AACtB,wBAAwB;AACxB,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,wBAAwB;AACxB,6BAA6B;AAC7B,8CAA8C;AAC9C;AACA;AACA,sCAAsC;AACtC,oCAAoC;AACpC,yCAAyC;AACzC;AACA,wBAAwB;AACxB;AACA,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;;ACzQA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAO,CAAC,0DAAc;;AAExC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,qBAAM;AAC1B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpEa;;AAEb;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA,MAAM,sCAAsC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM,sCAAsC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM,sCAAsC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;AC7Da;;AAEb;AACA,mBAAmB,mBAAO,CAAC,8DAAgB,EAAE,SAAS;AACtD,EAAE;AACF,EAAE,mGAAsC;AACxC;;;;;;;;;;;ACNA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA;AACA,eAAe;AACf;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,cAAc;AACzB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA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IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,sDAAY;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChIa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACTa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sCAAsC;AACnD,aAAa,WAAW;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,WAAW;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,WAAW;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvLa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,mBAAmB;AAC5B;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ,4BAA4B;AACpC;AACA,iEAAiE,EAAE;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR,+DAA+D,EAAE;AACjE;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,iEAAiE,EAAE;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR,+DAA+D,EAAE;AACjE;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,EAAE;AACnE;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,iEAAiE,EAAE;AACnE;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,iEAAiE,EAAE;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR,+DAA+D,EAAE;AACjE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,EAAE,GAAG,EAAE;AAC1D,2BAA2B;AAC3B,eAAe;AACf;AACA,qBAAqB;AACrB,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA,mBAAmB;;;;;;;;;;;;AC9NN;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtDa;;AAEb,aAAa,mBAAO,CAAC,kBAAM;;AAE3B,mBAAmB,mBAAO,CAAC,2DAAe;AAC1C,gBAAgB,mBAAO,CAAC,mDAAW;AACnC,QAAQ,oBAAoB,EAAE,mBAAO,CAAC,uDAAa;;AAEnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,kBAAkB;AAC/B;AACA,aAAa,kBAAkB;AAC/B;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC,IAAI;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,gDAAgD,IAAI,KAAK,MAAM;AAC/D;AACA;AACA;AACA,YAAY;AACZ;AACA,8CAA8C,IAAI,KAAK,MAAM;AAC7D;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,8CAA8C,IAAI,KAAK,MAAM;AAC7D;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,8CAA8C,IAAI,KAAK,MAAM;AAC7D;AACA;AACA,UAAU;AACV,gDAAgD,IAAI;AACpD;;AAEA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA,kCAAkC,SAAS;AAC3C;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gCAAgC,SAAS;AACzC;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrgBa;;AAEb,QAAQ,WAAW,EAAE,mBAAO,CAAC,sBAAQ;;AAErC,0BAA0B,mBAAO,CAAC,yEAAsB;AACxD;AACA;AACA;AACA;AACA;AACA,EAAE,EAAE,mBAAO,CAAC,uDAAa;AACzB,QAAQ,gCAAgC,EAAE,mBAAO,CAAC,2DAAe;AACjE,QAAQ,iCAAiC,EAAE,mBAAO,CAAC,yDAAc;;AAEjE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;;AAEA;AACA;AACA;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,4BAA4B,aAAa;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,0BAA0B,aAAa;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,wBAAwB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,mCAAmC,KAAK;AACxC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA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M;AACN;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB,wBAAwB;AAChD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxZa;;AAEb,QAAQ,SAAS,EAAE,mBAAO,CAAC,sBAAQ;;AAEnC;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnLa;;AAEb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,mBAAO,CAAC,8DAAgB;;AAE5C;AACA;AACA,sDAAsD;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvGA,sCAAsC,wCAAwC;;AAEjE;;AAEb,qBAAqB,mBAAO,CAAC,sBAAQ;AACrC,aAAa,mBAAO,CAAC,kBAAM;AAC3B,cAAc,mBAAO,CAAC,oBAAO;AAC7B,YAAY,mBAAO,CAAC,gBAAK;AACzB,YAAY,mBAAO,CAAC,gBAAK;AACzB,QAAQ,aAAa,EAAE,mBAAO,CAAC,sBAAQ;;AAEvC,0BAA0B,mBAAO,CAAC,yEAAsB;AACxD,kBAAkB,mBAAO,CAAC,uDAAa;AACvC,QAAQ,gBAAgB,EAAE,mBAAO,CAAC,uDAAa;AAC/C,QAAQ,mBAAmB,EAAE,mBAAO,CAAC,uDAAa;;AAElD,iCAAiC,GAAG;;AAEpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB,aAAa,kBAAkB;AAC/B;AACA,aAAa,QAAQ;AACrB,aAAa,4BAA4B;AACzC;AACA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,sBAAsB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,aAAa,yBAAyB;AACtC;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAkD;AAC3E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC,aAAa,yBAAyB;AACtC;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,gDAAgD,MAAM;AACtD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,2BAA2B;AACtC,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA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ACA;AACA,aAAa,cAAc;AAC3B,aAAa,mBAAmB;AAChC,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,yBAAyB;AACtC;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB;AACA,aAAa,SAAS;AACtB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,kBAAkB;AAC3E,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;AAED;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,cAAc;AACzB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,kBAAkB;AAC7B;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,SAAS;AACpB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC,sBAAsB;AAC7D,gCAAgC,4BAA4B;AAC5D;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;;AAEA;AACA,0CAA0C,cAAc;;AAExD;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB,GAAG,mBAAmB;AAC5D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA,uCAAuC,eAAe;AACtD;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,4CAA4C;AACvD;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,GAAG;AACd,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C,sBAAsB;AACjE,YAAY,kCAAkC;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1qCA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,IAAI,IAAI,IAAI,GAAG,IAAI;AAC3C;AACA,+BAA+B,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,aAAa,IAAI,EAAE,IAAI,EAAE,IAAI;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,aAAa;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,qBAAqB;AACrB,YAAY;AACZ,qBAAqB;AACrB,YAAY;AACZ,qBAAqB;AACrB;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,sBAAsB,YAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,IAAI;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,GAAG;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS,YAAY,SAAS;AACjF;AACA;AACA,CAAC,IAAI;AACL,IAAI,IAA0C,EAAE,iCAAO,EAAE,mCAAE,aAAa,iBAAiB;AAAA,kGAAC;AAC1F,KAAK,EAAsF;;;;;;;;;;;;;;;;;;;;;;ACzPhE;AAC0B;AACrD;AACA;AACA;AACA;AACA;AACA,IAAI,kDAAqB;AACzB;AACA,IAAI;AACJ,IAAI,kDAAqB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD,UAAU,+DAAW;AACrB;AACA;AACA;AACoE;;;;;;;;;;;;;;;;AC5CpE;AACA;AACsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCFtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;;;;WC/BA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;WCJA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,oJAAoJ;WACpJ;WACA;WACA,oCAAoC;WACpC;WACA;WACA;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CAAC;WACD;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA,CAAC;WACD;WACA;WACA,+DAA+D,oFAAoF,oBAAoB,gFAAgF,IAAI;WAC3P,iEAAiE,qFAAqF,oBAAoB,kFAAkF,IAAI;WAChQ,2GAA2G,yGAAyG,oBAAoB,4HAA4H,IAAI;WACxW,kEAAkE,mFAAmF,oBAAoB,wHAAwH,IAAI;WACrS,6EAA6E,0FAA0F,oBAAoB,8FAA8F,IAAI;WAC7R,kEAAkE,mFAAmF,oBAAoB,8EAA8E;WACvP;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,CAAC;WACD;;;;;UE1JA;UACA;UACA;UACA;UACA","sources":["webpack://aegis-app/./node_modules/@babel/polyfill/lib/index.js","webpack://aegis-app/./node_modules/@babel/polyfill/lib/noConflict.js","webpack://aegis-app/./node_modules/accepts/index.js","webpack://aegis-app/./node_modules/array-flatten/array-flatten.js","webpack://aegis-app/./node_modules/axios-retry/index.js","webpack://aegis-app/./node_modules/axios-retry/lib/index.js","webpack://aegis-app/./node_modules/axios/index.js","webpack://aegis-app/./node_modules/axios/lib/adapters/http.js","webpack://aegis-app/./node_modules/axios/lib/adapters/xhr.js","webpack://aegis-app/./node_modules/axios/lib/axios.js","webpack://aegis-app/./node_modules/axios/lib/cancel/Cancel.js","webpack://aegis-app/./node_modules/axios/lib/cancel/CancelToken.js","webpack://aegis-app/./node_modules/axios/lib/cancel/isCancel.js","webpack://aegis-app/./node_modules/axios/lib/core/Axios.js","webpack://aegis-app/./node_modules/axios/lib/core/InterceptorManager.js","webpack://aegis-app/./node_modules/axios/lib/core/buildFullPath.js","webpack://aegis-app/./node_modules/axios/lib/core/createError.js","webpack://aegis-app/./node_modules/axios/lib/core/dispatchRequest.js","webpack://aegis-app/./node_modules/axios/lib/core/enhanceError.js","webpack://aegis-app/./node_modules/axios/lib/core/mergeConfig.js","webpack://aegis-app/./node_modules/axios/lib/core/settle.js","webpack://aegis-app/./node_modules/axios/lib/core/transformData.js","webpack://aegis-app/./node_modules/axios/lib/defaults.js","webpack://aegis-app/./node_modules/axios/lib/helpers/bind.js","webpack://aegis-app/./node_modules/axios/lib/helpers/buildURL.js","webpack://aegis-app/./node_modules/axios/lib/helpers/combineURLs.js","webpack://aegis-app/./node_modules/axios/lib/helpers/cookies.js","webpack://aegis-app/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://aegis-app/./node_modules/axios/lib/helpers/isAxiosError.js","webpack://aegis-app/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://aegis-app/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://aegis-app/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://aegis-app/./node_modules/axios/lib/helpers/spread.js","webpack://aegis-app/./node_modules/axios/lib/helpers/validator.js","webpack://aegis-app/./node_modules/axios/lib/utils.js","webpack://aegis-app/./src/adapters/address-adapter.js","webpack://aegis-app/./src/adapters/dam-api.js","webpack://aegis-app/./src/adapters/datasources/datasource-adapter-customer.js","webpack://aegis-app/./src/adapters/datasources/datasource-adapter-file.js","webpack://aegis-app/./src/adapters/datasources/datasource-mongodb.js","webpack://aegis-app/./src/adapters/event-adapter.js","webpack://aegis-app/./src/adapters/index.js","webpack://aegis-app/./src/adapters/inventory-adapter.js","webpack://aegis-app/./src/adapters/order-adapter.js","webpack://aegis-app/./src/adapters/payment-adapter.js","webpack://aegis-app/./src/adapters/qe-public-ipaddr.js","webpack://aegis-app/./src/adapters/service-locator.js","webpack://aegis-app/./src/adapters/shipping-adapter.js","webpack://aegis-app/./src/adapters/ticket-master.js","webpack://aegis-app/./src/adapters/wasm-public-ipaddr.js","webpack://aegis-app/./src/adapters/websocket-adapter.js","webpack://aegis-app/./src/domain/config/customer.js","webpack://aegis-app/./src/domain/config/index.js","webpack://aegis-app/./src/domain/config/inventory.js","webpack://aegis-app/./src/domain/config/order.js","webpack://aegis-app/./src/domain/config/todo.js","webpack://aegis-app/./src/domain/config/webswitch.js","webpack://aegis-app/./src/domain/index.js","webpack://aegis-app/./src/domain/models/customer.js","webpack://aegis-app/./src/domain/models/inventory.js","webpack://aegis-app/./src/domain/models/order.js","webpack://aegis-app/./src/domain/models/todo.js","webpack://aegis-app/./src/domain/models/webswitch.js","webpack://aegis-app/./src/domain/ports.js","webpack://aegis-app/./src/domain/util/bind-adapters.js","webpack://aegis-app/./src/domain/util/check-payload.js","webpack://aegis-app/./src/domain/util/mixins.js","webpack://aegis-app/./src/domain/util/utils.js","webpack://aegis-app/./src/event-dispatcher.js","webpack://aegis-app/./src/index.js","webpack://aegis-app/./src/service-registry.js","webpack://aegis-app/./src/services/address-service.js","webpack://aegis-app/./src/services/event-bus.js","webpack://aegis-app/./src/services/event-service.js","webpack://aegis-app/./src/services/index.js","webpack://aegis-app/./src/services/inventory-service.js","webpack://aegis-app/./src/services/payment-service.js","webpack://aegis-app/./src/services/shipping-service.js","webpack://aegis-app/./node_modules/body-parser/index.js","webpack://aegis-app/./node_modules/body-parser/lib/read.js","webpack://aegis-app/./node_modules/body-parser/lib/types/json.js","webpack://aegis-app/./node_modules/body-parser/lib/types/raw.js","webpack://aegis-app/./node_modules/body-parser/lib/types/text.js","webpack://aegis-app/./node_modules/body-parser/lib/types/urlencoded.js","webpack://aegis-app/./node_modules/body-parser/node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/body-parser/node_modules/debug/src/debug.js","webpack://aegis-app/./node_modules/body-parser/node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/body-parser/node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/body-parser/node_modules/ms/index.js","webpack://aegis-app/./node_modules/bufferutil/fallback.js","webpack://aegis-app/./node_modules/bufferutil/index.js","webpack://aegis-app/./node_modules/bytes/index.js","webpack://aegis-app/./node_modules/call-bind/callBound.js","webpack://aegis-app/./node_modules/call-bind/index.js","webpack://aegis-app/./node_modules/content-disposition/index.js","webpack://aegis-app/./node_modules/content-type/index.js","webpack://aegis-app/./node_modules/cookie-signature/index.js","webpack://aegis-app/./node_modules/cookie/index.js","webpack://aegis-app/./node_modules/core-js/es6/index.js","webpack://aegis-app/./node_modules/core-js/fn/array/flat-map.js","webpack://aegis-app/./node_modules/core-js/fn/array/includes.js","webpack://aegis-app/./node_modules/core-js/fn/object/entries.js","webpack://aegis-app/./node_modules/core-js/fn/object/get-own-property-descriptors.js","webpack://aegis-app/./node_modules/core-js/fn/object/values.js","webpack://aegis-app/./node_modules/core-js/fn/promise/finally.js","webpack://aegis-app/./node_modules/core-js/fn/string/pad-end.js","webpack://aegis-app/./node_modules/core-js/fn/string/pad-start.js","webpack://aegis-app/./node_modules/core-js/fn/string/trim-end.js","webpack://aegis-app/./node_modules/core-js/fn/string/trim-start.js","webpack://aegis-app/./node_modules/core-js/fn/symbol/async-iterator.js","webpack://aegis-app/./node_modules/core-js/library/fn/global.js","webpack://aegis-app/./node_modules/core-js/library/modules/_a-function.js","webpack://aegis-app/./node_modules/core-js/library/modules/_an-object.js","webpack://aegis-app/./node_modules/core-js/library/modules/_core.js","webpack://aegis-app/./node_modules/core-js/library/modules/_ctx.js","webpack://aegis-app/./node_modules/core-js/library/modules/_descriptors.js","webpack://aegis-app/./node_modules/core-js/library/modules/_dom-create.js","webpack://aegis-app/./node_modules/core-js/library/modules/_export.js","webpack://aegis-app/./node_modules/core-js/library/modules/_fails.js","webpack://aegis-app/./node_modules/core-js/library/modules/_global.js","webpack://aegis-app/./node_modules/core-js/library/modules/_has.js","webpack://aegis-app/./node_modules/core-js/library/modules/_hide.js","webpack://aegis-app/./node_modules/core-js/library/modules/_ie8-dom-define.js","webpack://aegis-app/./node_modules/core-js/library/modules/_is-object.js","webpack://aegis-app/./node_modules/core-js/library/modules/_object-dp.js","webpack://aegis-app/./node_modules/core-js/library/modules/_property-desc.js","webpack://aegis-app/./node_modules/core-js/library/modules/_to-primitive.js","webpack://aegis-app/./node_modules/core-js/library/modules/es7.global.js","webpack://aegis-app/./node_modules/core-js/modules/_a-function.js","webpack://aegis-app/./node_modules/core-js/modules/_a-number-value.js","webpack://aegis-app/./node_modules/core-js/modules/_add-to-unscopables.js","webpack://aegis-app/./node_modules/core-js/modules/_advance-string-index.js","webpack://aegis-app/./node_modules/core-js/modules/_an-instance.js","webpack://aegis-app/./node_modules/core-js/modules/_an-object.js","webpack://aegis-app/./node_modules/core-js/modules/_array-copy-within.js","webpack://aegis-app/./node_modules/core-js/modules/_array-fill.js","webpack://aegis-app/./node_modules/core-js/modules/_array-includes.js","webpack://aegis-app/./node_modules/core-js/modules/_array-methods.js","webpack://aegis-app/./node_modules/core-js/modules/_array-reduce.js","webpack://aegis-app/./node_modules/core-js/modules/_array-species-constructor.js","webpack://aegis-app/./node_modules/core-js/modules/_array-species-create.js","webpack://aegis-app/./node_modules/core-js/modules/_bind.js","webpack://aegis-app/./node_modules/core-js/modules/_classof.js","webpack://aegis-app/./node_modules/core-js/modules/_cof.js","webpack://aegis-app/./node_modules/core-js/modules/_collection-strong.js","webpack://aegis-app/./node_modules/core-js/modules/_collection-weak.js","webpack://aegis-app/./node_modules/core-js/modules/_collection.js","webpack://aegis-app/./node_modules/core-js/modules/_core.js","webpack://aegis-app/./node_modules/core-js/modules/_create-property.js","webpack://aegis-app/./node_modules/core-js/modules/_ctx.js","webpack://aegis-app/./node_modules/core-js/modules/_date-to-iso-string.js","webpack://aegis-app/./node_modules/core-js/modules/_date-to-primitive.js","webpack://aegis-app/./node_modules/core-js/modules/_defined.js","webpack://aegis-app/./node_modules/core-js/modules/_descriptors.js","webpack://aegis-app/./node_modules/core-js/modules/_dom-create.js","webpack://aegis-app/./node_modules/core-js/modules/_enum-bug-keys.js","webpack://aegis-app/./node_modules/core-js/modules/_enum-keys.js","webpack://aegis-app/./node_modules/core-js/modules/_export.js","webpack://aegis-app/./node_modules/core-js/modules/_fails-is-regexp.js","webpack://aegis-app/./node_modules/core-js/modules/_fails.js","webpack://aegis-app/./node_modules/core-js/modules/_fix-re-wks.js","webpack://aegis-app/./node_modules/core-js/modules/_flags.js","webpack://aegis-app/./node_modules/core-js/modules/_flatten-into-array.js","webpack://aegis-app/./node_modules/core-js/modules/_for-of.js","webpack://aegis-app/./node_modules/core-js/modules/_function-to-string.js","webpack://aegis-app/./node_modules/core-js/modules/_global.js","webpack://aegis-app/./node_modules/core-js/modules/_has.js","webpack://aegis-app/./node_modules/core-js/modules/_hide.js","webpack://aegis-app/./node_modules/core-js/modules/_html.js","webpack://aegis-app/./node_modules/core-js/modules/_ie8-dom-define.js","webpack://aegis-app/./node_modules/core-js/modules/_inherit-if-required.js","webpack://aegis-app/./node_modules/core-js/modules/_invoke.js","webpack://aegis-app/./node_modules/core-js/modules/_iobject.js","webpack://aegis-app/./node_modules/core-js/modules/_is-array-iter.js","webpack://aegis-app/./node_modules/core-js/modules/_is-array.js","webpack://aegis-app/./node_modules/core-js/modules/_is-integer.js","webpack://aegis-app/./node_modules/core-js/modules/_is-object.js","webpack://aegis-app/./node_modules/core-js/modules/_is-regexp.js","webpack://aegis-app/./node_modules/core-js/modules/_iter-call.js","webpack://aegis-app/./node_modules/core-js/modules/_iter-create.js","webpack://aegis-app/./node_modules/core-js/modules/_iter-define.js","webpack://aegis-app/./node_modules/core-js/modules/_iter-detect.js","webpack://aegis-app/./node_modules/core-js/modules/_iter-step.js","webpack://aegis-app/./node_modules/core-js/modules/_iterators.js","webpack://aegis-app/./node_modules/core-js/modules/_library.js","webpack://aegis-app/./node_modules/core-js/modules/_math-expm1.js","webpack://aegis-app/./node_modules/core-js/modules/_math-fround.js","webpack://aegis-app/./node_modules/core-js/modules/_math-log1p.js","webpack://aegis-app/./node_modules/core-js/modules/_math-sign.js","webpack://aegis-app/./node_modules/core-js/modules/_meta.js","webpack://aegis-app/./node_modules/core-js/modules/_microtask.js","webpack://aegis-app/./node_modules/core-js/modules/_new-promise-capability.js","webpack://aegis-app/./node_modules/core-js/modules/_object-assign.js","webpack://aegis-app/./node_modules/core-js/modules/_object-create.js","webpack://aegis-app/./node_modules/core-js/modules/_object-dp.js","webpack://aegis-app/./node_modules/core-js/modules/_object-dps.js","webpack://aegis-app/./node_modules/core-js/modules/_object-gopd.js","webpack://aegis-app/./node_modules/core-js/modules/_object-gopn-ext.js","webpack://aegis-app/./node_modules/core-js/modules/_object-gopn.js","webpack://aegis-app/./node_modules/core-js/modules/_object-gops.js","webpack://aegis-app/./node_modules/core-js/modules/_object-gpo.js","webpack://aegis-app/./node_modules/core-js/modules/_object-keys-internal.js","webpack://aegis-app/./node_modules/core-js/modules/_object-keys.js","webpack://aegis-app/./node_modules/core-js/modules/_object-pie.js","webpack://aegis-app/./node_modules/core-js/modules/_object-sap.js","webpack://aegis-app/./node_modules/core-js/modules/_object-to-array.js","webpack://aegis-app/./node_modules/core-js/modules/_own-keys.js","webpack://aegis-app/./node_modules/core-js/modules/_parse-float.js","webpack://aegis-app/./node_modules/core-js/modules/_parse-int.js","webpack://aegis-app/./node_modules/core-js/modules/_perform.js","webpack://aegis-app/./node_modules/core-js/modules/_promise-resolve.js","webpack://aegis-app/./node_modules/core-js/modules/_property-desc.js","webpack://aegis-app/./node_modules/core-js/modules/_redefine-all.js","webpack://aegis-app/./node_modules/core-js/modules/_redefine.js","webpack://aegis-app/./node_modules/core-js/modules/_regexp-exec-abstract.js","webpack://aegis-app/./node_modules/core-js/modules/_regexp-exec.js","webpack://aegis-app/./node_modules/core-js/modules/_same-value.js","webpack://aegis-app/./node_modules/core-js/modules/_set-proto.js","webpack://aegis-app/./node_modules/core-js/modules/_set-species.js","webpack://aegis-app/./node_modules/core-js/modules/_set-to-string-tag.js","webpack://aegis-app/./node_modules/core-js/modules/_shared-key.js","webpack://aegis-app/./node_modules/core-js/modules/_shared.js","webpack://aegis-app/./node_modules/core-js/modules/_species-constructor.js","webpack://aegis-app/./node_modules/core-js/modules/_strict-method.js","webpack://aegis-app/./node_modules/core-js/modules/_string-at.js","webpack://aegis-app/./node_modules/core-js/modules/_string-context.js","webpack://aegis-app/./node_modules/core-js/modules/_string-html.js","webpack://aegis-app/./node_modules/core-js/modules/_string-pad.js","webpack://aegis-app/./node_modules/core-js/modules/_string-repeat.js","webpack://aegis-app/./node_modules/core-js/modules/_string-trim.js","webpack://aegis-app/./node_modules/core-js/modules/_string-ws.js","webpack://aegis-app/./node_modules/core-js/modules/_task.js","webpack://aegis-app/./node_modules/core-js/modules/_to-absolute-index.js","webpack://aegis-app/./node_modules/core-js/modules/_to-index.js","webpack://aegis-app/./node_modules/core-js/modules/_to-integer.js","webpack://aegis-app/./node_modules/core-js/modules/_to-iobject.js","webpack://aegis-app/./node_modules/core-js/modules/_to-length.js","webpack://aegis-app/./node_modules/core-js/modules/_to-object.js","webpack://aegis-app/./node_modules/core-js/modules/_to-primitive.js","webpack://aegis-app/./node_modules/core-js/modules/_typed-array.js","webpack://aegis-app/./node_modules/core-js/modules/_typed-buffer.js","webpack://aegis-app/./node_modules/core-js/modules/_typed.js","webpack://aegis-app/./node_modules/core-js/modules/_uid.js","webpack://aegis-app/./node_modules/core-js/modules/_user-agent.js","webpack://aegis-app/./node_modules/core-js/modules/_validate-collection.js","webpack://aegis-app/./node_modules/core-js/modules/_wks-define.js","webpack://aegis-app/./node_modules/core-js/modules/_wks-ext.js","webpack://aegis-app/./node_modules/core-js/modules/_wks.js","webpack://aegis-app/./node_modules/core-js/modules/core.get-iterator-method.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.copy-within.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.every.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.fill.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.filter.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.find-index.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.find.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.for-each.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.from.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.index-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.is-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.iterator.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.join.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.last-index-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.map.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.reduce-right.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.reduce.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.slice.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.some.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.sort.js","webpack://aegis-app/./node_modules/core-js/modules/es6.array.species.js","webpack://aegis-app/./node_modules/core-js/modules/es6.date.now.js","webpack://aegis-app/./node_modules/core-js/modules/es6.date.to-iso-string.js","webpack://aegis-app/./node_modules/core-js/modules/es6.date.to-json.js","webpack://aegis-app/./node_modules/core-js/modules/es6.date.to-primitive.js","webpack://aegis-app/./node_modules/core-js/modules/es6.date.to-string.js","webpack://aegis-app/./node_modules/core-js/modules/es6.function.bind.js","webpack://aegis-app/./node_modules/core-js/modules/es6.function.has-instance.js","webpack://aegis-app/./node_modules/core-js/modules/es6.function.name.js","webpack://aegis-app/./node_modules/core-js/modules/es6.map.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.acosh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.asinh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.atanh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.cbrt.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.clz32.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.cosh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.expm1.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.fround.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.hypot.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.imul.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.log10.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.log1p.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.log2.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.sign.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.sinh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.tanh.js","webpack://aegis-app/./node_modules/core-js/modules/es6.math.trunc.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.constructor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.epsilon.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.is-finite.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.is-integer.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.is-nan.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.is-safe-integer.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.max-safe-integer.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.min-safe-integer.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.parse-float.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.parse-int.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.to-fixed.js","webpack://aegis-app/./node_modules/core-js/modules/es6.number.to-precision.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.assign.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.create.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.define-properties.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.define-property.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.freeze.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.get-own-property-names.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.get-prototype-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.is-extensible.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.is-frozen.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.is-sealed.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.is.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.keys.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.prevent-extensions.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.seal.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.set-prototype-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.object.to-string.js","webpack://aegis-app/./node_modules/core-js/modules/es6.parse-float.js","webpack://aegis-app/./node_modules/core-js/modules/es6.parse-int.js","webpack://aegis-app/./node_modules/core-js/modules/es6.promise.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.apply.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.construct.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.define-property.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.delete-property.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.enumerate.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.get-prototype-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.get.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.has.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.is-extensible.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.own-keys.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.prevent-extensions.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.set-prototype-of.js","webpack://aegis-app/./node_modules/core-js/modules/es6.reflect.set.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.constructor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.exec.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.flags.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.match.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.replace.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.search.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.split.js","webpack://aegis-app/./node_modules/core-js/modules/es6.regexp.to-string.js","webpack://aegis-app/./node_modules/core-js/modules/es6.set.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.anchor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.big.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.blink.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.bold.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.code-point-at.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.ends-with.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.fixed.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.fontcolor.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.fontsize.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.from-code-point.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.includes.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.italics.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.iterator.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.link.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.raw.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.repeat.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.small.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.starts-with.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.strike.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.sub.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.sup.js","webpack://aegis-app/./node_modules/core-js/modules/es6.string.trim.js","webpack://aegis-app/./node_modules/core-js/modules/es6.symbol.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.array-buffer.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.data-view.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.float32-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.float64-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.int16-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.int32-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.int8-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.uint16-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.uint32-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.uint8-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js","webpack://aegis-app/./node_modules/core-js/modules/es6.weak-map.js","webpack://aegis-app/./node_modules/core-js/modules/es6.weak-set.js","webpack://aegis-app/./node_modules/core-js/modules/es7.array.flat-map.js","webpack://aegis-app/./node_modules/core-js/modules/es7.array.includes.js","webpack://aegis-app/./node_modules/core-js/modules/es7.object.entries.js","webpack://aegis-app/./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js","webpack://aegis-app/./node_modules/core-js/modules/es7.object.values.js","webpack://aegis-app/./node_modules/core-js/modules/es7.promise.finally.js","webpack://aegis-app/./node_modules/core-js/modules/es7.string.pad-end.js","webpack://aegis-app/./node_modules/core-js/modules/es7.string.pad-start.js","webpack://aegis-app/./node_modules/core-js/modules/es7.string.trim-left.js","webpack://aegis-app/./node_modules/core-js/modules/es7.string.trim-right.js","webpack://aegis-app/./node_modules/core-js/modules/es7.symbol.async-iterator.js","webpack://aegis-app/./node_modules/core-js/modules/web.dom.iterable.js","webpack://aegis-app/./node_modules/core-js/modules/web.immediate.js","webpack://aegis-app/./node_modules/core-js/modules/web.timers.js","webpack://aegis-app/./node_modules/core-js/web/index.js","webpack://aegis-app/./node_modules/debug/node_modules/ms/index.js","webpack://aegis-app/./node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/debug/src/common.js","webpack://aegis-app/./node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/depd/index.js","webpack://aegis-app/./node_modules/destroy/index.js","webpack://aegis-app/./node_modules/dns-packet/classes.js","webpack://aegis-app/./node_modules/dns-packet/index.js","webpack://aegis-app/./node_modules/dns-packet/opcodes.js","webpack://aegis-app/./node_modules/dns-packet/optioncodes.js","webpack://aegis-app/./node_modules/dns-packet/rcodes.js","webpack://aegis-app/./node_modules/dns-packet/types.js","webpack://aegis-app/./node_modules/dotenv/lib/main.js","webpack://aegis-app/./node_modules/ee-first/index.js","webpack://aegis-app/./node_modules/encodeurl/index.js","webpack://aegis-app/./node_modules/escape-html/index.js","webpack://aegis-app/./node_modules/etag/index.js","webpack://aegis-app/./node_modules/express-session/index.js","webpack://aegis-app/./node_modules/express-session/node_modules/cookie/index.js","webpack://aegis-app/./node_modules/express-session/node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/express-session/node_modules/debug/src/debug.js","webpack://aegis-app/./node_modules/express-session/node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/express-session/node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/express-session/node_modules/ms/index.js","webpack://aegis-app/./node_modules/express-session/session/cookie.js","webpack://aegis-app/./node_modules/express-session/session/memory.js","webpack://aegis-app/./node_modules/express-session/session/session.js","webpack://aegis-app/./node_modules/express-session/session/store.js","webpack://aegis-app/./node_modules/express/index.js","webpack://aegis-app/./node_modules/express/lib/application.js","webpack://aegis-app/./node_modules/express/lib/express.js","webpack://aegis-app/./node_modules/express/lib/middleware/init.js","webpack://aegis-app/./node_modules/express/lib/middleware/query.js","webpack://aegis-app/./node_modules/express/lib/request.js","webpack://aegis-app/./node_modules/express/lib/response.js","webpack://aegis-app/./node_modules/express/lib/router/index.js","webpack://aegis-app/./node_modules/express/lib/router/layer.js","webpack://aegis-app/./node_modules/express/lib/router/route.js","webpack://aegis-app/./node_modules/express/lib/utils.js","webpack://aegis-app/./node_modules/express/lib/view.js","webpack://aegis-app/./node_modules/express/lib/ sync","webpack://aegis-app/./node_modules/express/node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/express/node_modules/debug/src/debug.js","webpack://aegis-app/./node_modules/express/node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/express/node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/express/node_modules/ms/index.js","webpack://aegis-app/./node_modules/finalhandler/index.js","webpack://aegis-app/./node_modules/finalhandler/node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/finalhandler/node_modules/debug/src/debug.js","webpack://aegis-app/./node_modules/finalhandler/node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/finalhandler/node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/finalhandler/node_modules/ms/index.js","webpack://aegis-app/./node_modules/follow-redirects/debug.js","webpack://aegis-app/./node_modules/follow-redirects/index.js","webpack://aegis-app/./node_modules/forwarded/index.js","webpack://aegis-app/./node_modules/fresh/index.js","webpack://aegis-app/./node_modules/function-bind/implementation.js","webpack://aegis-app/./node_modules/function-bind/index.js","webpack://aegis-app/./node_modules/get-intrinsic/index.js","webpack://aegis-app/./node_modules/has-proto/index.js","webpack://aegis-app/./node_modules/has-symbols/index.js","webpack://aegis-app/./node_modules/has-symbols/shams.js","webpack://aegis-app/./node_modules/has/src/index.js","webpack://aegis-app/./node_modules/http-errors/index.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/dbcs-codec.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/dbcs-data.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/index.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/internal.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/sbcs-codec.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/sbcs-data-generated.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/sbcs-data.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/utf16.js","webpack://aegis-app/./node_modules/iconv-lite/encodings/utf7.js","webpack://aegis-app/./node_modules/iconv-lite/lib/bom-handling.js","webpack://aegis-app/./node_modules/iconv-lite/lib/extend-node.js","webpack://aegis-app/./node_modules/iconv-lite/lib/index.js","webpack://aegis-app/./node_modules/iconv-lite/lib/streams.js","webpack://aegis-app/./node_modules/inherits/inherits.js","webpack://aegis-app/./node_modules/inherits/inherits_browser.js","webpack://aegis-app/./node_modules/ipaddr.js/lib/ipaddr.js","webpack://aegis-app/./node_modules/is-retry-allowed/index.js","webpack://aegis-app/./node_modules/kafkajs/index.js","webpack://aegis-app/./node_modules/kafkajs/src/admin/index.js","webpack://aegis-app/./node_modules/kafkajs/src/admin/instrumentationEvents.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/index.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/awsIam.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/index.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/oauthBearer.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/plain.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/scram.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/scram256.js","webpack://aegis-app/./node_modules/kafkajs/src/broker/saslAuthenticator/scram512.js","webpack://aegis-app/./node_modules/kafkajs/src/cluster/brokerPool.js","webpack://aegis-app/./node_modules/kafkajs/src/cluster/connectionBuilder.js","webpack://aegis-app/./node_modules/kafkajs/src/cluster/index.js","webpack://aegis-app/./node_modules/kafkajs/src/constants.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/assignerProtocol.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/assigners/index.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/assigners/roundRobinAssigner/index.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/barrier.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/batch.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/consumerGroup.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/filterAbortedMessages.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/index.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/instrumentationEvents.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/offsetManager/index.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/offsetManager/initializeConsumerOffsets.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/offsetManager/isInvalidOffset.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/runner.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/seekOffsets.js","webpack://aegis-app/./node_modules/kafkajs/src/consumer/subscriptionState.js","webpack://aegis-app/./node_modules/kafkajs/src/env.js","webpack://aegis-app/./node_modules/kafkajs/src/errors.js","webpack://aegis-app/./node_modules/kafkajs/src/index.js","webpack://aegis-app/./node_modules/kafkajs/src/instrumentation/emitter.js","webpack://aegis-app/./node_modules/kafkajs/src/instrumentation/event.js","webpack://aegis-app/./node_modules/kafkajs/src/instrumentation/eventType.js","webpack://aegis-app/./node_modules/kafkajs/src/loggers/console.js","webpack://aegis-app/./node_modules/kafkajs/src/loggers/index.js","webpack://aegis-app/./node_modules/kafkajs/src/network/connection.js","webpack://aegis-app/./node_modules/kafkajs/src/network/connectionStatus.js","webpack://aegis-app/./node_modules/kafkajs/src/network/instrumentationEvents.js","webpack://aegis-app/./node_modules/kafkajs/src/network/requestQueue/index.js","webpack://aegis-app/./node_modules/kafkajs/src/network/requestQueue/socketRequest.js","webpack://aegis-app/./node_modules/kafkajs/src/network/socket.js","webpack://aegis-app/./node_modules/kafkajs/src/network/socketFactory.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/createTopicData.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/eosManager/index.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/eosManager/transactionStateMachine.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/eosManager/transactionStates.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/groupMessagesPerPartition.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/index.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/instrumentationEvents.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/messageProducer.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/default/index.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/default/murmur2.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/default/partitioner.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/default/randomBytes.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/defaultJava/index.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/defaultJava/murmur2.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/partitioners/index.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/responseSerializer.js","webpack://aegis-app/./node_modules/kafkajs/src/producer/sendMessages.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/aclOperationTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/aclPermissionTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/aclResourceTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/configResourceTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/configSource.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/coordinatorTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/crc32.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/encoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/error.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/isolationLevel.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/compression/gzip.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/compression/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/v0/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/v0/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/v1/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/message/v1/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/messageSet/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/messageSet/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/crc32C/crc32C.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/crc32C/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/header/v0/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/header/v0/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/record/v0/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/record/v0/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/v0/decoder.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/recordBatch/v0/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addOffsetsToTxn/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addOffsetsToTxn/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addOffsetsToTxn/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addOffsetsToTxn/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addOffsetsToTxn/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addPartitionsToTxn/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addPartitionsToTxn/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addPartitionsToTxn/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addPartitionsToTxn/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/addPartitionsToTxn/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/alterConfigs/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/alterConfigs/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/alterConfigs/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/alterConfigs/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/alterConfigs/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiKeys.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/apiVersions/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createAcls/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createAcls/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createAcls/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createAcls/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createAcls/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createPartitions/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createPartitions/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createPartitions/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createPartitions/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createPartitions/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/createTopics/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteAcls/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteAcls/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteAcls/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteAcls/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteAcls/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteGroups/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteGroups/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteGroups/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteGroups/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteGroups/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteRecords/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteRecords/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteRecords/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteRecords/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteRecords/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteTopics/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteTopics/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteTopics/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteTopics/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/deleteTopics/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeAcls/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeAcls/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeAcls/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeAcls/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeAcls/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeConfigs/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/describeGroups/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/endTxn/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/endTxn/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/endTxn/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/endTxn/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/endTxn/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v10/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v10/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v11/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v11/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v4/decodeMessages.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v5/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v5/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v6/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v6/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v7/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v7/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v8/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v8/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v9/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/fetch/v9/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/findCoordinator/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/heartbeat/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/initProducerId/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/initProducerId/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/initProducerId/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/initProducerId/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/initProducerId/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v5/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/joinGroup/v5/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/leaveGroup/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listGroups/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/listOffsets/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v5/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v5/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v6/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/metadata/v6/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v5/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetCommit/v5/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/offsetFetch/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v4/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v4/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v5/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v5/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v6/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v6/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v7/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/produce/v7/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslAuthenticate/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslAuthenticate/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslAuthenticate/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslAuthenticate/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslAuthenticate/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslHandshake/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslHandshake/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslHandshake/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslHandshake/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/saslHandshake/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v2/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v2/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v3/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/syncGroup/v3/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/txnOffsetCommit/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/txnOffsetCommit/v0/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/txnOffsetCommit/v0/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/txnOffsetCommit/v1/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/requests/txnOffsetCommit/v1/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/resourcePatternTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/resourceTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/awsIam/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/awsIam/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/awsIam/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/oauthBearer/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/oauthBearer/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/oauthBearer/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/plain/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/plain/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/plain/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/scram/finalMessage/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/scram/finalMessage/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/scram/firstMessage/request.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/scram/firstMessage/response.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/sasl/scram/index.js","webpack://aegis-app/./node_modules/kafkajs/src/protocol/timestampTypes.js","webpack://aegis-app/./node_modules/kafkajs/src/retry/defaults.js","webpack://aegis-app/./node_modules/kafkajs/src/retry/defaults.test.js","webpack://aegis-app/./node_modules/kafkajs/src/retry/index.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/arrayDiff.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/bufferedAsyncIterator.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/concurrency.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/flatten.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/groupBy.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/lock.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/long.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/sharedPromiseTo.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/shuffle.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/sleep.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/swapObject.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/waitFor.js","webpack://aegis-app/./node_modules/kafkajs/src/utils/websiteUrl.js","webpack://aegis-app/./node_modules/media-typer/index.js","webpack://aegis-app/./node_modules/merge-descriptors/index.js","webpack://aegis-app/./node_modules/methods/index.js","webpack://aegis-app/./node_modules/mime-db/index.js","webpack://aegis-app/./node_modules/mime-types/index.js","webpack://aegis-app/./node_modules/mime/mime.js","webpack://aegis-app/./node_modules/ms/index.js","webpack://aegis-app/./node_modules/multicast-dns/index.js","webpack://aegis-app/./node_modules/negotiator/index.js","webpack://aegis-app/./node_modules/negotiator/lib/charset.js","webpack://aegis-app/./node_modules/negotiator/lib/encoding.js","webpack://aegis-app/./node_modules/negotiator/lib/language.js","webpack://aegis-app/./node_modules/negotiator/lib/mediaType.js","webpack://aegis-app/./node_modules/node-gyp-build/index.js","webpack://aegis-app/./node_modules/node-gyp-build/node-gyp-build.js","webpack://aegis-app/./node_modules/object-inspect/index.js","webpack://aegis-app/./node_modules/object-inspect/util.inspect.js","webpack://aegis-app/./node_modules/on-finished/index.js","webpack://aegis-app/./node_modules/on-headers/index.js","webpack://aegis-app/./node_modules/parseurl/index.js","webpack://aegis-app/./node_modules/path-to-regexp/index.js","webpack://aegis-app/./node_modules/proxy-addr/index.js","webpack://aegis-app/./node_modules/qs/lib/formats.js","webpack://aegis-app/./node_modules/qs/lib/index.js","webpack://aegis-app/./node_modules/qs/lib/parse.js","webpack://aegis-app/./node_modules/qs/lib/stringify.js","webpack://aegis-app/./node_modules/qs/lib/utils.js","webpack://aegis-app/./node_modules/random-bytes/index.js","webpack://aegis-app/./node_modules/range-parser/index.js","webpack://aegis-app/./node_modules/raw-body/index.js","webpack://aegis-app/./node_modules/regenerator-runtime/runtime.js","webpack://aegis-app/./node_modules/safe-buffer/index.js","webpack://aegis-app/./node_modules/safer-buffer/safer.js","webpack://aegis-app/./node_modules/send/index.js","webpack://aegis-app/./node_modules/send/node_modules/debug/node_modules/ms/index.js","webpack://aegis-app/./node_modules/send/node_modules/debug/src/browser.js","webpack://aegis-app/./node_modules/send/node_modules/debug/src/debug.js","webpack://aegis-app/./node_modules/send/node_modules/debug/src/index.js","webpack://aegis-app/./node_modules/send/node_modules/debug/src/node.js","webpack://aegis-app/./node_modules/serve-static/index.js","webpack://aegis-app/./node_modules/setprototypeof/index.js","webpack://aegis-app/./node_modules/side-channel/index.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/index.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/index.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/adapters/http.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/adapters/xhr.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/axios.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/cancel/Cancel.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/cancel/CancelToken.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/cancel/isCancel.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/Axios.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/InterceptorManager.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/buildFullPath.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/createError.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/dispatchRequest.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/enhanceError.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/mergeConfig.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/settle.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/core/transformData.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/defaults/index.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/defaults/transitional.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/env/data.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/bind.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/buildURL.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/combineURLs.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/cookies.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/isAxiosError.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/parseHeaders.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/spread.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/helpers/validator.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/node_modules/axios/lib/utils.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/AgentSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/BaseUrlSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/Batch.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/ClientBuilder.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/CustomHeaderSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/Errors.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/HttpSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/InputData.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/LicenseSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/Request.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/Response.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/SharedCredentials.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/SigningSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/StaticCredentials.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/StatusCodeSender.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_address_autocomplete/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_address_autocomplete/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_address_autocomplete/Suggestion.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_street/Candidate.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_street/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/international_street/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete/Suggestion.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete_pro/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete_pro/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_autocomplete_pro/Suggestion.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_extract/Address.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_extract/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_extract/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_extract/Result.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_reverse_geo/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_reverse_geo/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_reverse_geo/Response.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_reverse_geo/Result.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_street/Candidate.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_street/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_street/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_zipcode/Client.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_zipcode/Lookup.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/us_zipcode/Result.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/util/apiToSDKKeyMap.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/util/buildClients.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/util/buildInputData.js","webpack://aegis-app/./node_modules/smartystreets-javascript-sdk/src/util/sendBatch.js","webpack://aegis-app/./node_modules/statuses/index.js","webpack://aegis-app/./node_modules/supports-color/index.js","webpack://aegis-app/./node_modules/supports-color/node_modules/has-flag/index.js","webpack://aegis-app/./node_modules/thunky/index.js","webpack://aegis-app/./node_modules/toidentifier/index.js","webpack://aegis-app/./node_modules/type-is/index.js","webpack://aegis-app/./node_modules/uid-safe/index.js","webpack://aegis-app/./node_modules/unpipe/index.js","webpack://aegis-app/./node_modules/utf-8-validate/fallback.js","webpack://aegis-app/./node_modules/utf-8-validate/index.js","webpack://aegis-app/./node_modules/utils-merge/index.js","webpack://aegis-app/./node_modules/vary/index.js","webpack://aegis-app/./node_modules/ws/index.js","webpack://aegis-app/./node_modules/ws/lib/buffer-util.js","webpack://aegis-app/./node_modules/ws/lib/constants.js","webpack://aegis-app/./node_modules/ws/lib/event-target.js","webpack://aegis-app/./node_modules/ws/lib/extension.js","webpack://aegis-app/./node_modules/ws/lib/limiter.js","webpack://aegis-app/./node_modules/ws/lib/permessage-deflate.js","webpack://aegis-app/./node_modules/ws/lib/receiver.js","webpack://aegis-app/./node_modules/ws/lib/sender.js","webpack://aegis-app/./node_modules/ws/lib/stream.js","webpack://aegis-app/./node_modules/ws/lib/validation.js","webpack://aegis-app/./node_modules/ws/lib/websocket-server.js","webpack://aegis-app/./node_modules/ws/lib/websocket.js","webpack://aegis-app/external node-commonjs \"assert\"","webpack://aegis-app/external node-commonjs \"async_hooks\"","webpack://aegis-app/external node-commonjs \"buffer\"","webpack://aegis-app/external node-commonjs \"cluster\"","webpack://aegis-app/external node-commonjs \"crypto\"","webpack://aegis-app/external node-commonjs \"dgram\"","webpack://aegis-app/external node-commonjs \"events\"","webpack://aegis-app/external node-commonjs \"fs\"","webpack://aegis-app/external node-commonjs \"http\"","webpack://aegis-app/external node-commonjs \"https\"","webpack://aegis-app/external node-commonjs \"net\"","webpack://aegis-app/external node-commonjs \"os\"","webpack://aegis-app/external node-commonjs \"path\"","webpack://aegis-app/external node-commonjs \"querystring\"","webpack://aegis-app/external node-commonjs \"stream\"","webpack://aegis-app/external node-commonjs \"string_decoder\"","webpack://aegis-app/external node-commonjs \"tls\"","webpack://aegis-app/external node-commonjs \"tty\"","webpack://aegis-app/external node-commonjs \"url\"","webpack://aegis-app/external node-commonjs \"util\"","webpack://aegis-app/external node-commonjs \"zlib\"","webpack://aegis-app/./node_modules/@leichtgewicht/ip-codec/index.cjs","webpack://aegis-app/./node_modules/nanoid/index.js","webpack://aegis-app/./node_modules/nanoid/url-alphabet/index.js","webpack://aegis-app/webpack/bootstrap","webpack://aegis-app/webpack/runtime/compat get default export","webpack://aegis-app/webpack/runtime/define property getters","webpack://aegis-app/webpack/runtime/global","webpack://aegis-app/webpack/runtime/hasOwnProperty shorthand","webpack://aegis-app/webpack/runtime/make namespace object","webpack://aegis-app/webpack/runtime/node module decorator","webpack://aegis-app/webpack/runtime/sharing","webpack://aegis-app/webpack/runtime/consumes","webpack://aegis-app/webpack/before-startup","webpack://aegis-app/webpack/startup","webpack://aegis-app/webpack/after-startup"],"sourcesContent":["\"use strict\";\n\nrequire(\"./noConflict\");\n\nvar _global = _interopRequireDefault(require(\"core-js/library/fn/global\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nif (_global[\"default\"]._babelPolyfill && typeof console !== \"undefined\" && console.warn) {\n console.warn(\"@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended \" + \"and may have consequences if different versions of the polyfills are applied sequentially. \" + \"If you do need to load the polyfill more than once, use @babel/polyfill/noConflict \" + \"instead to bypass the warning.\");\n}\n\n_global[\"default\"]._babelPolyfill = true;","\"use strict\";\n\nrequire(\"core-js/es6\");\n\nrequire(\"core-js/fn/array/includes\");\n\nrequire(\"core-js/fn/array/flat-map\");\n\nrequire(\"core-js/fn/string/pad-start\");\n\nrequire(\"core-js/fn/string/pad-end\");\n\nrequire(\"core-js/fn/string/trim-start\");\n\nrequire(\"core-js/fn/string/trim-end\");\n\nrequire(\"core-js/fn/symbol/async-iterator\");\n\nrequire(\"core-js/fn/object/get-own-property-descriptors\");\n\nrequire(\"core-js/fn/object/values\");\n\nrequire(\"core-js/fn/object/entries\");\n\nrequire(\"core-js/fn/promise/finally\");\n\nrequire(\"core-js/web\");\n\nrequire(\"regenerator-runtime/runtime\");","/*!\n * accepts\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Negotiator = require('negotiator')\nvar mime = require('mime-types')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Accepts\n\n/**\n * Create a new Accepts object for the given req.\n *\n * @param {object} req\n * @public\n */\n\nfunction Accepts (req) {\n if (!(this instanceof Accepts)) {\n return new Accepts(req)\n }\n\n this.headers = req.headers\n this.negotiator = new Negotiator(req)\n}\n\n/**\n * Check if the given `type(s)` is acceptable, returning\n * the best match when true, otherwise `undefined`, in which\n * case you should respond with 406 \"Not Acceptable\".\n *\n * The `type` value may be a single mime type string\n * such as \"application/json\", the extension name\n * such as \"json\" or an array `[\"json\", \"html\", \"text/plain\"]`. When a list\n * or array is given the _best_ match, if any is returned.\n *\n * Examples:\n *\n * // Accept: text/html\n * this.types('html');\n * // => \"html\"\n *\n * // Accept: text/*, application/json\n * this.types('html');\n * // => \"html\"\n * this.types('text/html');\n * // => \"text/html\"\n * this.types('json', 'text');\n * // => \"json\"\n * this.types('application/json');\n * // => \"application/json\"\n *\n * // Accept: text/*, application/json\n * this.types('image/png');\n * this.types('png');\n * // => undefined\n *\n * // Accept: text/*;q=.5, application/json\n * this.types(['html', 'json']);\n * this.types('html', 'json');\n * // => \"json\"\n *\n * @param {String|Array} types...\n * @return {String|Array|Boolean}\n * @public\n */\n\nAccepts.prototype.type =\nAccepts.prototype.types = function (types_) {\n var types = types_\n\n // support flattened arguments\n if (types && !Array.isArray(types)) {\n types = new Array(arguments.length)\n for (var i = 0; i < types.length; i++) {\n types[i] = arguments[i]\n }\n }\n\n // no types, return all requested types\n if (!types || types.length === 0) {\n return this.negotiator.mediaTypes()\n }\n\n // no accept header, return first given type\n if (!this.headers.accept) {\n return types[0]\n }\n\n var mimes = types.map(extToMime)\n var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))\n var first = accepts[0]\n\n return first\n ? types[mimes.indexOf(first)]\n : false\n}\n\n/**\n * Return accepted encodings or best fit based on `encodings`.\n *\n * Given `Accept-Encoding: gzip, deflate`\n * an array sorted by quality is returned:\n *\n * ['gzip', 'deflate']\n *\n * @param {String|Array} encodings...\n * @return {String|Array}\n * @public\n */\n\nAccepts.prototype.encoding =\nAccepts.prototype.encodings = function (encodings_) {\n var encodings = encodings_\n\n // support flattened arguments\n if (encodings && !Array.isArray(encodings)) {\n encodings = new Array(arguments.length)\n for (var i = 0; i < encodings.length; i++) {\n encodings[i] = arguments[i]\n }\n }\n\n // no encodings, return all requested encodings\n if (!encodings || encodings.length === 0) {\n return this.negotiator.encodings()\n }\n\n return this.negotiator.encodings(encodings)[0] || false\n}\n\n/**\n * Return accepted charsets or best fit based on `charsets`.\n *\n * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`\n * an array sorted by quality is returned:\n *\n * ['utf-8', 'utf-7', 'iso-8859-1']\n *\n * @param {String|Array} charsets...\n * @return {String|Array}\n * @public\n */\n\nAccepts.prototype.charset =\nAccepts.prototype.charsets = function (charsets_) {\n var charsets = charsets_\n\n // support flattened arguments\n if (charsets && !Array.isArray(charsets)) {\n charsets = new Array(arguments.length)\n for (var i = 0; i < charsets.length; i++) {\n charsets[i] = arguments[i]\n }\n }\n\n // no charsets, return all requested charsets\n if (!charsets || charsets.length === 0) {\n return this.negotiator.charsets()\n }\n\n return this.negotiator.charsets(charsets)[0] || false\n}\n\n/**\n * Return accepted languages or best fit based on `langs`.\n *\n * Given `Accept-Language: en;q=0.8, es, pt`\n * an array sorted by quality is returned:\n *\n * ['es', 'pt', 'en']\n *\n * @param {String|Array} langs...\n * @return {Array|String}\n * @public\n */\n\nAccepts.prototype.lang =\nAccepts.prototype.langs =\nAccepts.prototype.language =\nAccepts.prototype.languages = function (languages_) {\n var languages = languages_\n\n // support flattened arguments\n if (languages && !Array.isArray(languages)) {\n languages = new Array(arguments.length)\n for (var i = 0; i < languages.length; i++) {\n languages[i] = arguments[i]\n }\n }\n\n // no languages, return all requested languages\n if (!languages || languages.length === 0) {\n return this.negotiator.languages()\n }\n\n return this.negotiator.languages(languages)[0] || false\n}\n\n/**\n * Convert extnames to mime.\n *\n * @param {String} type\n * @return {String}\n * @private\n */\n\nfunction extToMime (type) {\n return type.indexOf('/') === -1\n ? mime.lookup(type)\n : type\n}\n\n/**\n * Check if mime is valid.\n *\n * @param {String} type\n * @return {String}\n * @private\n */\n\nfunction validMime (type) {\n return typeof type === 'string'\n}\n","'use strict'\n\n/**\n * Expose `arrayFlatten`.\n */\nmodule.exports = arrayFlatten\n\n/**\n * Recursive flatten function with depth.\n *\n * @param {Array} array\n * @param {Array} result\n * @param {Number} depth\n * @return {Array}\n */\nfunction flattenWithDepth (array, result, depth) {\n for (var i = 0; i < array.length; i++) {\n var value = array[i]\n\n if (depth > 0 && Array.isArray(value)) {\n flattenWithDepth(value, result, depth - 1)\n } else {\n result.push(value)\n }\n }\n\n return result\n}\n\n/**\n * Recursive flatten function. Omitting depth is slightly faster.\n *\n * @param {Array} array\n * @param {Array} result\n * @return {Array}\n */\nfunction flattenForever (array, result) {\n for (var i = 0; i < array.length; i++) {\n var value = array[i]\n\n if (Array.isArray(value)) {\n flattenForever(value, result)\n } else {\n result.push(value)\n }\n }\n\n return result\n}\n\n/**\n * Flatten an array, with the ability to define a depth.\n *\n * @param {Array} array\n * @param {Number} depth\n * @return {Array}\n */\nfunction arrayFlatten (array, depth) {\n if (depth == null) {\n return flattenForever(array, [])\n }\n\n return flattenWithDepth(array, [], depth)\n}\n","module.exports = require('./lib/index').default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isNetworkError = isNetworkError;\nexports.isRetryableError = isRetryableError;\nexports.isSafeRequestError = isSafeRequestError;\nexports.isIdempotentRequestError = isIdempotentRequestError;\nexports.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;\nexports.exponentialDelay = exponentialDelay;\nexports.default = axiosRetry;\n\nvar _isRetryAllowed = require('is-retry-allowed');\n\nvar _isRetryAllowed2 = _interopRequireDefault(_isRetryAllowed);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar namespace = 'axios-retry';\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isNetworkError(error) {\n return !error.response && Boolean(error.code) && // Prevents retrying cancelled requests\n error.code !== 'ECONNABORTED' && // Prevents retrying timed out requests\n (0, _isRetryAllowed2.default)(error); // Prevents retrying unsafe errors\n}\n\nvar SAFE_HTTP_METHODS = ['get', 'head', 'options'];\nvar IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isRetryableError(error) {\n return error.code !== 'ECONNABORTED' && (!error.response || error.response.status >= 500 && error.response.status <= 599);\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isSafeRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isIdempotentRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean | Promise}\n */\nfunction isNetworkOrIdempotentRequestError(error) {\n return isNetworkError(error) || isIdempotentRequestError(error);\n}\n\n/**\n * @return {number} - delay in milliseconds, always 0\n */\nfunction noDelay() {\n return 0;\n}\n\n/**\n * @param {number} [retryNumber=0]\n * @return {number} - delay in milliseconds\n */\nfunction exponentialDelay() {\n var retryNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n var delay = Math.pow(2, retryNumber) * 100;\n var randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay\n return delay + randomSum;\n}\n\n/**\n * Initializes and returns the retry state for the given request/config\n * @param {AxiosRequestConfig} config\n * @return {Object}\n */\nfunction getCurrentState(config) {\n var currentState = config[namespace] || {};\n currentState.retryCount = currentState.retryCount || 0;\n config[namespace] = currentState;\n return currentState;\n}\n\n/**\n * Returns the axios-retry options for the current request\n * @param {AxiosRequestConfig} config\n * @param {AxiosRetryConfig} defaultOptions\n * @return {AxiosRetryConfig}\n */\nfunction getRequestOptions(config, defaultOptions) {\n return Object.assign({}, defaultOptions, config[namespace]);\n}\n\n/**\n * @param {Axios} axios\n * @param {AxiosRequestConfig} config\n */\nfunction fixConfig(axios, config) {\n if (axios.defaults.agent === config.agent) {\n delete config.agent;\n }\n if (axios.defaults.httpAgent === config.httpAgent) {\n delete config.httpAgent;\n }\n if (axios.defaults.httpsAgent === config.httpsAgent) {\n delete config.httpsAgent;\n }\n}\n\n/**\n * Checks retryCondition if request can be retried. Handles it's retruning value or Promise.\n * @param {number} retries\n * @param {Function} retryCondition\n * @param {Object} currentState\n * @param {Error} error\n * @return {boolean}\n */\nasync function shouldRetry(retries, retryCondition, currentState, error) {\n var shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error);\n\n // This could be a promise\n if ((typeof shouldRetryOrPromise === 'undefined' ? 'undefined' : _typeof(shouldRetryOrPromise)) === 'object') {\n try {\n await shouldRetryOrPromise;\n return true;\n } catch (_err) {\n return false;\n }\n }\n return shouldRetryOrPromise;\n}\n\n/**\n * Adds response interceptors to an axios instance to retry requests failed due to network issues\n *\n * @example\n *\n * import axios from 'axios';\n *\n * axiosRetry(axios, { retries: 3 });\n *\n * axios.get('http://example.com/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Exponential back-off retry delay between requests\n * axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});\n *\n * // Custom retry delay\n * axiosRetry(axios, { retryDelay : (retryCount) => {\n * return retryCount * 1000;\n * }});\n *\n * // Also works with custom axios instances\n * const client = axios.create({ baseURL: 'http://example.com' });\n * axiosRetry(client, { retries: 3 });\n *\n * client.get('/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Allows request-specific configuration\n * client\n * .get('/test', {\n * 'axios-retry': {\n * retries: 0\n * }\n * })\n * .catch(error => { // The first request fails\n * error !== undefined\n * });\n *\n * @param {Axios} axios An axios instance (the axios object or one created from axios.create)\n * @param {Object} [defaultOptions]\n * @param {number} [defaultOptions.retries=3] Number of retries\n * @param {boolean} [defaultOptions.shouldResetTimeout=false]\n * Defines if the timeout should be reset between retries\n * @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]\n * A function to determine if the error can be retried\n * @param {Function} [defaultOptions.retryDelay=noDelay]\n * A function to determine the delay between retry requests\n */\nfunction axiosRetry(axios, defaultOptions) {\n axios.interceptors.request.use(function (config) {\n var currentState = getCurrentState(config);\n currentState.lastRequestTime = Date.now();\n return config;\n });\n\n axios.interceptors.response.use(null, async function (error) {\n var config = error.config;\n\n // If we have no information to retry the request\n if (!config) {\n return Promise.reject(error);\n }\n\n var _getRequestOptions = getRequestOptions(config, defaultOptions),\n _getRequestOptions$re = _getRequestOptions.retries,\n retries = _getRequestOptions$re === undefined ? 3 : _getRequestOptions$re,\n _getRequestOptions$re2 = _getRequestOptions.retryCondition,\n retryCondition = _getRequestOptions$re2 === undefined ? isNetworkOrIdempotentRequestError : _getRequestOptions$re2,\n _getRequestOptions$re3 = _getRequestOptions.retryDelay,\n retryDelay = _getRequestOptions$re3 === undefined ? noDelay : _getRequestOptions$re3,\n _getRequestOptions$sh = _getRequestOptions.shouldResetTimeout,\n shouldResetTimeout = _getRequestOptions$sh === undefined ? false : _getRequestOptions$sh;\n\n var currentState = getCurrentState(config);\n\n if (await shouldRetry(retries, retryCondition, currentState, error)) {\n currentState.retryCount += 1;\n var delay = retryDelay(currentState.retryCount, error);\n\n // Axios fails merging this configuration to the default configuration because it has an issue\n // with circular structures: https://github.com/mzabriskie/axios/issues/370\n fixConfig(axios, config);\n\n if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {\n var lastRequestDuration = Date.now() - currentState.lastRequestTime;\n // Minimum 1ms timeout (passing 0 or less to XHR means no timeout)\n config.timeout = Math.max(config.timeout - lastRequestDuration - delay, 1);\n }\n\n config.transformRequest = [function (data) {\n return data;\n }];\n\n return new Promise(function (resolve) {\n return setTimeout(function () {\n return resolve(axios(config));\n }, delay);\n });\n }\n\n return Promise.reject(error);\n });\n}\n\n// Compatibility with CommonJS\naxiosRetry.isNetworkError = isNetworkError;\naxiosRetry.isSafeRequestError = isSafeRequestError;\naxiosRetry.isIdempotentRequestError = isIdempotentRequestError;\naxiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;\naxiosRetry.exponentialDelay = exponentialDelay;\naxiosRetry.isRetryableError = isRetryableError;\n//# sourceMappingURL=index.js.map","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('User-Agent' in headers || 'user-agent' in headers) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers['User-Agent'] && !headers['user-agent']) {\n delete headers['User-Agent'];\n delete headers['user-agent'];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError(\n 'timeout of ' + timeout + 'ms exceeded',\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","\"use strict\";\n\n/**\n * @typedef {import('../domain/order').Order} Order\n * @typedef {string} address\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order})} - verified/corrected address\n */\n\n/**\n *\n * @type {adapterFactory}\n * @param {import(\"../services/address-service\").Address} service\n */\nexport function validateAddress(service) {\n return async function (options) {\n const {\n model: order,\n args: [callback],\n } = options;\n\n try {\n const shippingAddress = await service.validateAddress(\n order.decrypt().shippingAddress\n );\n const update = await callback(options, { shippingAddress });\n return update;\n } catch (error) {\n console.error({ func: validateAddress.name, error, options });\n }\n };\n}\n","// export function upload (filename, catalog, storagePath, readableStream) {}\n\n// export function search (filename, catalog, tags, limit, writableStream) {}\n\n// export function browse (catalog, tags, limit, writableStream) {}\n\n// export function download (fileId, writableStream) {}\n\nexport function damUploadOut (service) {\n return function (data) {\n console.log({ data })\n return {\n filename: data.args[0].filename,\n status: 'UPLOADING'\n }\n }\n}\n\nexport function damSearchOut (service) {\n return function (data) {\n return {\n tags: data.args[0].tags,\n matches: 361,\n status: 'COMPLETE'\n }\n }\n}\n\nexport function damBrowseOut (service) {\n return function (data) {\n return {\n catalog: data.args[0].catalog,\n status: 'COMPLETE'\n }\n }\n}\n\nexport function damDownloadOut (service) {\n return function (data) {\n return {\n fileId: data.args[0],\n status: 'DOWNLOADING'\n }\n }\n}\n","export const DataSourceAdapterCustomer = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomer extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n }\n\n return DataSourceCustomer\n}\n","export const DataSourceAdapterCustomFile = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomFile extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n\n list (options) {\n return super.list(options)\n }\n\n serialize () {\n return false\n }\n }\n\n return DataSourceCustomFile\n}\n","'use strict'\n\nfunction getSecret () {\n return process.env.MONGODB_CREDS || { user: null, pass: null, token: null }\n}\n\nfunction archive (id) {\n console.debug('mock archive', id)\n}\n\n/**\n * Datasource adapter factory.\n * @param {string} url database url\n * @param {number} [cacheSize] number of models to keep in cache\n * @param {*} DataSource base class that enables caching\n * @returns {import(\"./datasource\").default}\n */\nexport const DataSourceAdapterMongoDb = function (\n url,\n cacheSize,\n DataSourceMongoDb\n) {\n /**\n * MongoDB adapter extends in-memory datasource to support caching.\n * The cache is always updated first, which allows the system to run\n * even when the database is offline.\n */\n class DataSourceMongoDbArchive extends DataSourceMongoDb {\n constructor (datasource, factory, name) {\n super(datasource, factory, name)\n this.url = url\n this.cacheSize = cacheSize\n this.creds = getSecret()\n }\n\n /**\n * @override\n */\n delete (id) {\n console.debug('archive', id)\n archive(id)\n }\n }\n\n return DataSourceMongoDbArchive\n}\n","\"use strict\";\n\n/**\n * @typedef {import('../domain').Model} Model\n * @typedef {string} serviceName\n *\n * @typedef {Object} EventMessage\n * @property {serviceName} eventSource\n * @property {serviceName|\"broadcast\"} eventTarget\n * @property {\"command\"|\"commandResponse\"|\"notification\"|\"import\"} eventType\n * @property {string} eventName\n * @property {string} eventTime\n * @property {string} eventUuid\n * @property {NotificationEvent|ImportEvent|CommandEvent} eventData\n *\n * @typedef {object} ImportEvent\n * @property {\"service\"|\"model\"|\"adapter\"} type\n * @property {string} url\n * @property {string} path\n * @property {string} importRemote\n *\n * @typedef {object} NotificationEvent\n * @property {string|} message\n * @property {\"utf8\"|Uint32Array} encoding\n *\n * @typedef {Object} CommandEvent\n * @property {string} commandName\n * @property {string} commandResp\n * @property {*} commandArgs\n */\n\n/**\n * @typedef {{\n * filter:function(message):Promise,\n * unsubscribe:function()\n * }} Subscription\n * @typedef {string|RegExp} topic\n * @callback eventHandler\n * @param {string} eventData\n * @typedef {eventHandler} notifyType\n * @typedef {{\n * listen:function(topic, x),\n * notify:notifyType\n * }} EventService\n * @callback adapterFactory\n * @param {EventService} service\n * @returns {function(topic, eventHandler)}\n */\nimport { Event } from \"../services/event-service\";\n\n/**\n * @type {Map>}\n */\nconst subscriptions = new Map();\n\n/**\n * Test the filter.\n * @param {string} message\n * @returns {function(string|RegExp):boolean} did the filter match?\n */\nfunction filterMatches(message) {\n return function (filter) {\n const regex = new RegExp(filter);\n const result = regex.test(message);\n if (result)\n console.debug({\n func: filterMatches.name,\n filter,\n result,\n message: message.substring(0, 100).concat(\"...\"),\n });\n return result;\n };\n}\n\n/**\n * @typedef {string} message\n * @typedef {string|RegExp} topic\n * @param {{\n * id:string,\n * callback:function(message,Subscription),\n * topic:topic,\n * filter:string|RegExp,\n * once:boolean,\n * model:import(\"../domain\").Model\n * }} options\n */\nconst Subscription = function ({ id, callback, topic, filters, once, model }) {\n return {\n /**\n * unsubscribe from topic\n */\n unsubscribe() {\n subscriptions.get(topic).delete(id);\n },\n\n getId() {\n return id;\n },\n\n getModel() {\n return model;\n },\n\n getSubscriptions() {\n return [...subscriptions.entries()];\n },\n\n /**\n * Filter message and invoke callback\n * @param {string} message\n */\n async filter(message) {\n if (filters) {\n // Every filter must match.\n if (filters.every(filterMatches(message))) {\n if (once) {\n // Only looking for 1 msg, got it.\n this.unsubscribe();\n }\n await callback({ message, subscription: this });\n return;\n }\n // no match\n return;\n }\n // no filters defined, just invoke the callback.\n await callback({ message, subscription: this });\n },\n };\n};\n\n/**\n * Listen for external events with default event service if none specified.\n * @type {adapterFactory}\n * @param {import('../services/event-service').Event} [service] - has default service\n */\nexport function listen(service = Event) {\n return async function (options) {\n const {\n model,\n args: [arg],\n } = options;\n\n const subscription = Subscription({ model, ...arg });\n\n if (subscriptions.has(arg.topic)) {\n subscriptions.get(arg.topic).set(arg.id, subscription);\n return subscription;\n }\n\n subscriptions.set(arg.topic, new Map().set(arg.id, subscription));\n\n if (!service.listening) {\n service.listen(/Channel/, async function ({ topic, message }) {\n if (subscriptions.has(topic)) {\n subscriptions.get(topic).forEach(async subscription => {\n await subscription.filter(message);\n });\n }\n });\n }\n return subscription;\n };\n}\n\n/**\n * @type {adapterFactory}\n * @returns {function(topic, eventData)}\n */\nexport function notify(service = Event) {\n return async function ({ model, args: [topic, message] }) {\n console.debug(\"sending...\", { topic, message: JSON.parse(message) });\n await service.notify(topic, message);\n return model;\n };\n}\n","'use strict'\n\nexport * from './service-locator'\nexport * from './websocket-adapter'\nexport * from './address-adapter'\nexport * from './event-adapter'\nexport * from './inventory-adapter'\nexport * from './order-adapter'\nexport * from './payment-adapter'\nexport * from './shipping-adapter'\nexport * from './qe-public-ipaddr'\nexport * from './wasm-public-ipaddr'\nexport * from './dam-api'\nexport * from './ticket-master'\n\n/**\n * @typedef {import('../domain').Model} Model\n * @typedef {function(function(eventCallback):Promise)} adapterFunction\n */\n","'use strict'\n\n/**\n * @typedef {string|RegExp} topic\n * @callback eventCallback\n * @param {string} message\n * @param {{\n * getModel:function():object,\n * unsubscribe:function()\n * }} subscription\n * @typedef {eventCallback} shipOrderType\n * @param topic,\n * @param eventCallback\n * @typedef {{\n * shipOrder:shipOrderType,\n * trackShipment:function(),\n * verifyDelivery:function()\n * }} InventoryAdapter\n * @typedef {import('../domain/order').Order} Order\n * @typedef {InventoryAdapter} service \n * @typedef {{\n * listen:function(topic,RegExp,eventCallback)\n * notify:function(topic,eventCallback)\n * }} event\n * @callback adapterFactory\n * @param {service} service\n * @param {event} event\n * @returns {function({\n * model:Order,\n * resolve:function()\n * ,args:[\n * eventCallback, \n * options:{}]\n * })}\n \n }]})} \n *\n */\n\n/**\n * @type {adapterFactory}\n */\nexport function pickOrder (service) {\n return function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n return new Promise(function (resolve, reject) {\n // start listening first then send the event\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: 'orderChannel',\n filters: [order.orderNo, 'orderPicked', 'warehouse_addr'],\n callback: async ({ message }) => {\n try {\n const event = JSON.parse(message)\n console.log('recieved event: ', event)\n const pickupAddress = event.eventData.warehouse_addr\n const newOrder = await callback(options, { pickupAddress })\n resolve(newOrder) // hold promise until we get an answer\n } catch (error) {\n reject(error)\n }\n }\n })\n .then(() => {\n return order.notify(\n 'inventoryChannel',\n JSON.stringify({\n eventType: 'Command',\n eventTime: new Date().toISOString(),\n eventSource: 'orderService',\n eventData: {\n respChannel: 'orderChannel',\n commandName: 'pickOrder',\n commandArgs: {\n lineItems: order.orderItems,\n externalId: order.orderNo\n }\n }\n })\n )\n })\n .catch(reason => {\n throw new Error(reason)\n })\n })\n }\n}\n","\"use strict\";\n\nconst axios = require(\"axios\");\n\nexport class OrderAdapter {\n constructor() {}\n\n addOrder({\n customerId,\n orderItems = [],\n creditCardNumber,\n shippingAddress,\n billingAddress,\n firstName,\n lastName,\n email,\n } = {}) {\n this.orderInfo = {\n customerId,\n orderItems,\n creditCardNumber,\n shippingAddress,\n billingAddress,\n firstName,\n lastName,\n email,\n };\n return this;\n }\n\n addOrderItem(itemId, price, qty = 1) {\n if (![typeof price, typeof qty].indexOf(\"number\") === 0) {\n throw new Error(\"qty and price must be numbers\");\n }\n if (!itemId || typeof itemId !== \"string\") {\n throw new Error(\"itemId must be a non-null string\");\n }\n this.orderInfo.orderItems.push({ itemId, price, qty });\n return this;\n }\n\n async createOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n\n async submitOrder(orderId = this.orderId) {\n throw new Error(\"unimplemented abstract method\");\n }\n\n async getOrder(orderId = this.orderId) {\n throw new Error(\"unimplememnted abstract method\");\n }\n\n completeOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n\n cancelOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n}\n\nexport class RestOrderAdapter extends OrderAdapter {\n constructor(url) {\n super();\n this.url = url;\n }\n\n /**\n * @override\n */\n async createOrder() {\n if (!this.orderInfo) {\n throw new Error(\"there is no order data\");\n }\n return axios\n .post(this.url, this.orderInfo)\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n }\n )\n .catch(e => console.log(e));\n }\n\n /**\n * @override\n * @param {*} orderId\n */\n async submitOrder(orderId = this.orderId) {\n if (!this.orderInfo) {\n throw new Error(\"there is no order data\");\n }\n return axios.patch(this.url + orderId, { orderStatus: \"APPROVED\" }).then(\n () => this,\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n async getOrder(orderId = this.orderId) {\n return axios.get(this.url + orderId).then(\n response => {\n console.log(response.data);\n this.order = response.data;\n return this.order;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n completeOrder() {\n return axios\n .patch(this.url + orderId, {\n orderStatus: \"COMPLETE\",\n proofOfDelivery: pod,\n })\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n cancelOrder() {\n return axios\n .patch(this.url + orderId, {\n orderStatus: \"CANCELED\",\n cancelReason: reason,\n })\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n}\n\nexport class GraphQlOrderAdapter extends OrderAdapter {\n /**\n * @override\n */\n createOrder() {}\n submitOrder() {}\n fillOrder() {}\n shipOrder() {}\n trackShipment() {}\n verifyDelivery() {}\n completeOrder() {}\n cancelOrder() {}\n}\n","'use strict'\n\n/**\n * @typedef {import('../domain/order').Order} Order\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order,parms:any[]})}\n */\n\n/**\n * @type {adapterFactory}\n * @param {import(\"../services/payment-service\").PaymentService} service\n */\nexport function authorizePayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n const paymentAuthorization = await service.authorizePayment(\n order.orderNo,\n 12.0,\n 'src',\n 'ibm',\n false\n )\n const paymentStatus = 'APPROVED'\n return callback(options, { paymentStatus })\n }\n}\n\n/**\n * @type {adapterFactory}\n */\nexport function completePayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n const confirmationCode = await service.completePayment(order)\n const newOrder = await callback(options, { confirmationCode })\n return newOrder\n }\n}\n/**\n * @type {adapterFactory}\n */\nexport function refundPayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n await service.refundPayment(order)\n const newOrder = await callback(options)\n return newOrder\n }\n}\n","import http from 'http'\n\n/**\n *\n * @returns\n */\nexport function qeGetPublicIpAddressOut () {\n return async function () {\n const buffer = []\n return new Promise(resolve => {\n http.get(\n {\n hostname: 'checkip.amazonaws.com',\n method: 'get'\n },\n response => {\n response.on('data', chunk => buffer.push(chunk))\n response.on('end', () => {\n resolve({ address: buffer.join('') })\n })\n }\n )\n })\n }\n}\n","'use strict'\n\nimport Dns from 'multicast-dns'\n\nconst debug = /true/i.test(process.env.DEBUG)\n\nexport class ServiceLocator {\n constructor ({\n name,\n serviceUrl,\n primary = false,\n backup = false,\n maxRetries = 20,\n retryInterval = 8000\n } = {}) {\n this.url = serviceUrl\n this.name = name\n this.dns = Dns()\n this.isPrimary = primary\n this.isBackup = backup\n this.maxRetries = maxRetries\n this.retryInterval = retryInterval\n }\n\n runningAsService () {\n return this.isPrimary || (this.isBackup && this.activateBackup)\n }\n\n /**\n * Query DNS for the webswitch service.\n * Recursively retry by incrementing a\n * counter we pass to ourselves on the\n * stack. Once the URL is populated, exit.\n *\n * @param {number} retries number of query attempts\n * @returns\n */\n ask (retries = 0) {\n // have we found the url?\n if (this.url) {\n console.log('url found')\n return\n }\n\n // if designated as backup, takeover for primary after maxRetries\n if (retries > this.maxRetries && this.isBackup) {\n this.activateBackup = true\n this.answer()\n return\n }\n debug && console.debug('looking for srv %s retries: %d', this.name, retries)\n // then query the service name\n this.dns.query({\n questions: [\n {\n name: this.name,\n type: 'SRV'\n }\n ]\n })\n\n // keep asking\n setTimeout(() => this.ask(++retries), this.retryInterval)\n }\n\n answer () {\n this.dns.on('query', query => {\n debug && console.debug('got a query packet:', query)\n\n const fromClient = query.questions.find(\n question => question.name === this.name\n )\n\n if (fromClient && this.runningAsService()) {\n const url = new URL(this.url)\n const answer = {\n answers: [\n {\n name: this.name,\n type: 'SRV',\n data: {\n port: url.port,\n target: url.hostname\n }\n }\n ]\n }\n console.info('advertising this location', url)\n this.dns.respond(answer)\n }\n })\n }\n\n listen () {\n console.log('resolving service url')\n return new Promise(resolve => {\n const buildUrl = response => {\n debug && console.debug({ answers: response.answers })\n\n const fromServer = response.answers.find(\n answer => answer.name === this.name && answer.type === 'SRV'\n )\n\n if (fromServer) {\n const { target, port } = fromServer.data\n const protocol = port === 443 ? 'wss' : 'ws'\n this.url = `${protocol}://${target}:${port}`\n\n console.info({\n msg: 'found dns service record for',\n service: this.name,\n url: this.url\n })\n\n this.dns.off('response', buildUrl)\n resolve(this.url)\n }\n }\n console.log('looking for service', this.name)\n this.dns.on('response', buildUrl)\n this.ask()\n })\n }\n}\n\nlet locator\nexport function serviceLocatorInit () {\n return async function ({ args: [options] }) {\n console.debug('serviceLocatorInit called')\n locator = new ServiceLocator(options)\n }\n}\n\nexport function serviceLocatorAsk () {\n return async function () {\n return locator.listen()\n }\n}\n\nexport function serviceLocatorAnswer () {\n return async function () {\n return locator.answer()\n }\n}\n","'use strict'\n\n/**\n * @callback portCallback\n * @param {{options:{}}}\n * @param {{payload:{[key]:string}}}\n */\n\n/**\n * @typedef {string} message\n * @callback eventCallback\n * @param {string} message\n * @param {{\n * unsubscribe:function(),\n * filter:function(message):boolean\n * }} subscription\n */\n\n/**\n * @typedef {import('../domain/order').Order} Order\n */\n\n/**\n * @typedef {import(\"../services/shipping-service\").shippingService} shippingService\n */\n\n/**\n * @typedef {{\n * listen:function(topic,RegExp,portCallback)\n * notify:function(topic,eventCallback)\n * }} event\n */\n\n/**\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order,args:[portCallback]}):Order}\n */\n\nconst ORDER_SERVICE = 'orderService'\nconst ORDER_TOPIC = 'orderChannel'\n\nconst handleError = (error, reject = null, func = null) => {\n console.error({ file: __filename, func, error })\n if (reject) reject(error)\n}\n\n/**\n * Call `shipOrder` to request shipment of the order items.\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n * @returns {function(options):Promise}\n * Return a promise that is resolved once we receive\n * a response message from the shipping service. Start\n * listening for the response first and then send the\n * request message.\n *\n */\nexport function shipOrder (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n * Called by the event listener when the shipOrder\n * response message arrives. Resolve the promise\n * the caller has been waiting on since we sent\n * the request message.\n * @param {function(Order)} resolve\n * @param {function(Error)} reject\n * @returns {function(message):Promise}\n */\n function shipOrderCallback (resolve, reject) {\n return async function ({ message }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event... ', event)\n const payload = service.getPayload(shipOrder.name, event)\n const updated = await callback(options, payload)\n resolve(updated)\n } catch (error) {\n handleError(error, reject, shipOrderCallback.name)\n }\n }\n }\n\n /**\n * Send the shipOrder event to the shipping service.\n */\n function callShipOrder () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.shipOrder({\n shipTo: order.decrypt().shippingAddress,\n shipFrom: order.pickupAddress,\n lineItems: order.orderItems,\n signature: order.signatureRequired,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(function (resolve, reject) {\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: ORDER_TOPIC,\n filters: [order.orderNo, 'orderShipped', 'shipmentId'],\n callback: shipOrderCallback(resolve, reject)\n })\n .then(callShipOrder)\n .catch(handleError)\n })\n }\n}\n\n/**\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n */\nexport function trackShipment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n *\n * @param {function(Order)} resolve resolve the promise\n * @param {function(Error)} reject reject promise\n */\n function trackShipmentCallback (resolve, reject) {\n return async function ({ message, subscription }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event...', event)\n const payload = service.getPayload(trackShipment.name, event)\n const updated = await callback(options, payload)\n if (updated.trackingStatus === 'orderDelivered') {\n subscription.unsubscribe()\n resolve(updated)\n }\n } catch (error) {\n handleError(error, reject, trackShipment.name)\n }\n }\n }\n\n function callTrackShipment () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.trackShipment({\n shipmentId: order.shipmentId,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(async function (resolve, reject) {\n return order\n .listen({\n once: false,\n model: order,\n id: order.orderNo,\n topic: ORDER_TOPIC,\n filters: [order.orderNo, 'trackingId', 'trackingStatus'],\n callback: trackShipmentCallback(resolve, reject)\n })\n .then(callTrackShipment)\n .catch(handleError)\n })\n }\n}\n\n/**\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n */\nexport function verifyDelivery (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n *\n * @param {function(Order)} resolve\n * @param {function(Error)} reject\n * @returns\n */\n function verifyDeliveryCallback (resolve, reject) {\n return async function ({ message }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event...', event)\n const payload = service.getPayload(verifyDelivery.name, event)\n const updated = await callback(options, payload)\n resolve(updated)\n } catch (e) {\n handleError(e, reject, verifyDeliveryCallback.name)\n }\n }\n }\n\n function callVerifyDelivery () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.verifyDelivery({\n trackingId: order.trackingId,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(async function (resolve, reject) {\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: 'orderChannel',\n filters: [order.orderNo, 'deliveryVerified', 'proofOfDelivery'],\n callback: verifyDeliveryCallback(resolve, reject)\n })\n .then(callVerifyDelivery)\n .catch(handleError)\n })\n }\n}\n","export function tmListEventsOut (service) {\n return async function (data) {\n try {\n const key = data.args[0].apiKey\n const url = `https://app.ticketmaster.com/discovery/v2/events.json?apikey=${key}`\n return await (await fetch(url)).json()\n } catch (error) {\n console.error({ fn: tmListEventsOut.name, error })\n throw error\n }\n }\n}\n","import http from 'http'\n\nexport function wasmGetPublicIpAddress () {\n return async function () {\n const chunks = []\n return new Promise(resolve => {\n http.get(\n {\n hostname: 'checkip.amazonaws.com',\n method: 'get'\n },\n res => {\n res.on('data', chunk => chunks.push(chunk))\n res.on('end', function () {\n resolve({ address: chunks.join('').trim() })\n })\n }\n )\n })\n }\n}\n","'use strict'\n\nimport WebSocket from 'ws'\n/** @type {WebSocket} */\nlet socket\nconst useBinary = () => socket.binaryType === 'arraybuffer'\n\n/**\n * use binary messages\n */\nconst primitives = {\n encode: {\n object: msg => Buffer.from(JSON.stringify(msg)),\n string: msg => Buffer.from(JSON.stringify(msg)),\n number: msg => Buffer.from(JSON.stringify(msg)),\n symbol: msg => console.error('unsupported', msg),\n undefined: msg => console.error('undefined', msg)\n },\n decode: {\n object: msg => JSON.parse(Buffer.from(msg).toString()),\n string: msg => JSON.parse(Buffer.from(msg).toString()),\n number: msg => JSON.parse(Buffer.from(msg).toString()),\n symbol: msg => console.error('unsupported', msg),\n undefined: msg => console.error('undefined', msg)\n }\n}\n\nexport function websocketConnect () {\n return function ({ args: [url, options] }) {\n if (socket) return socket\n if (url) {\n socket = new WebSocket(url, options)\n console.debug('connected', url)\n if (options.useBinary) socket.binaryType = 'arraybuffer'\n return socket\n }\n throw new Error('missing url', url)\n }\n}\n\nfunction encode (msg) {\n if (useBinary()) return primitives.encode[typeof msg](msg)\n return msg\n}\n\nfunction decode (msg) {\n if (useBinary()) return primitives.decode[typeof msg](msg)\n return msg\n}\n\nexport function websocketSend () {\n return function ({ args: [msg, options = {}] }) {\n if (socket?.readyState === socket?.OPEN && socket?.bufferedAmount < 1) {\n socket.send(\n encode(msg),\n useBinary() ? { ...options, binary: true } : options\n )\n return true\n }\n return false\n }\n}\n\nexport function websocketClose () {\n return function ({ args: [code, reason] }) {\n if (socket) return socket.close(code, reason)\n }\n}\n\nexport function websocketPing () {\n return function ({ args: [options] }) {\n if (socket) return socket.ping(options)\n }\n}\n\nexport function websocketOnMessage () {\n return function ({ args: [callback] }) {\n if (socket) return socket.on('message', msg => callback(decode(msg)))\n }\n}\n\nexport function websocketOnClose () {\n return function ({ args: [callback] }) {\n if (socket) socket.onclose = callback\n }\n}\n\nexport function websocketOnOpen () {\n return async function ({ args: [callback] }) {\n if (socket) socket.onopen = callback\n }\n}\n\nexport function websocketOnPong () {\n return function ({ args: [callback] }) {\n if (socket) socket.on('pong', callback)\n }\n}\n\nexport function websocketStatus () {\n return function ({ args: [callback] }) {\n if (socket) return socket.readyState\n }\n}\n\nexport function websocketOnError () {\n return function ({ args: [callback] }) {\n if (socket) return socket.on('error', err => callback(err))\n }\n}\n\nexport function websocketTerminate () {\n return function () {\n if (socket) return socket.terminate()\n }\n}\n","'use strict'\n\nimport {\n validateModel,\n freezeProperties,\n validateProperties,\n requireProperties\n} from '../util/mixins'\nimport { makeCustomerFactory, okToDelete } from '../models/customer'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterCustomer } from '../../adapters/datasources/datasource-adapter-customer'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Customer = {\n modelName: 'customer',\n endpoint: 'customers',\n dependencies: { uuid: () => nanoid(8) },\n factory: makeCustomerFactory,\n validate: validateModel,\n onDelete: okToDelete,\n // datasource: {\n // factory: DataSourceAdapterCustomer,\n // cacheSize: 4000,\n // baseClass: 'DataSourceFile'\n // },\n mixins: [\n freezeProperties('customerId'),\n requireProperties(\n 'firstName',\n 'lastName',\n 'email',\n 'shippingAddress',\n 'billingAddress',\n 'creditCardNumber'\n ),\n validateProperties([\n {\n propKey: 'email',\n // unique: { encrypted: true },\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n }\n ])\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'customerId'\n }\n },\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n ports: {\n runFibonacciCust: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n },\n doesFieldExist: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n }\n },\n accessControlList: {\n customer: {\n allow: 'read',\n type: 'relation',\n desc: 'Allow orders to see customers.'\n }\n }\n}\n","export * from './webswitch' // always export this\nexport * from './order'\nexport * from './customer'\nexport * from './inventory'\nexport * from './todo'\n// export * from './user'\n// export * from './query-engine'\n// export * from './dam-api'\n// export * from './ticket-master'\n// export * from './access-controller'\n","'use strict'\n\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport {\n makeInventoryFactory,\n assetTypes,\n properties,\n categories\n} from '../models/inventory'\n\nimport {\n requireProperties,\n freezeProperties,\n validateProperties\n} from '../util/mixins'\n\n/**\n * @type {import(\"../domain/order\").ModelSpecification}\n */\nexport const Inventory = {\n modelName: 'inventory',\n endpoint: 'inventory',\n dependencies: {},\n factory: makeInventoryFactory,\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n mixins: [\n requireProperties('name', 'inStock', 'category', 'price', 'purchaseOrder'),\n validateProperties([\n {\n propKey: 'inStock',\n typeof: 'number',\n maxnum: 99999\n },\n {\n propKey: 'category',\n values: categories\n },\n {\n propKey: 'assetType',\n values: assetTypes\n },\n {\n propKey: 'properties',\n isValid: (_obj, prop) => prop.every(p => properties.includes(p))\n },\n {\n propKey: 'price',\n typeof: 'number',\n maxnum: 999.99\n }\n ]),\n freezeProperties('*')\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'itemId',\n desc: 'many items per order'\n }\n }\n}\n","'use strict'\n\nimport {\n makeOrderFactory,\n readyToDelete,\n handleOrderEvent,\n orderShipped,\n paymentCompleted,\n OrderStatus,\n recalcTotal,\n requiredForCompletion,\n statusChangeValid,\n freezeOnApproval,\n freezeOnCompletion,\n orderTotalValid,\n returnInventory,\n returnShipment,\n refundPayment,\n returnDelivery,\n cancelPayment,\n updateSignature,\n requiredForGuest,\n requiredForApproval,\n approve,\n cancel,\n OrderError,\n orderPicked\n} from '../models/order'\n\nimport {\n requireProperties,\n freezeProperties,\n updateProperties,\n validateProperties,\n validateModel\n} from '../util/mixins'\n\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Order = {\n endpoint: 'orders',\n factory: makeOrderFactory,\n domain: 'order',\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n dependencies: { uuid: () => nanoid(8) },\n mixins: [\n requireProperties(\n 'orderItems',\n requiredForGuest([\n 'lastName',\n 'firstName',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'email'\n ]),\n requiredForApproval('paymentStatus'),\n requiredForCompletion('proofOfDelivery')\n ),\n freezeProperties(\n 'orderNo',\n 'customerId',\n freezeOnApproval([\n 'email',\n 'lastName',\n 'firstName',\n 'orderItems',\n 'orderTotal',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'paymentStatus'\n ]),\n freezeOnCompletion('*')\n ),\n updateProperties([\n {\n propKey: 'orderItems',\n update: recalcTotal\n },\n {\n propKey: 'orderItems',\n update: updateSignature\n }\n ]),\n validateProperties([\n {\n propKey: 'orderStatus',\n values: Object.values(OrderStatus),\n isValid: statusChangeValid\n },\n {\n propKey: 'orderTotal',\n maxnum: 99999.99,\n isValid: orderTotalValid\n },\n {\n propKey: 'email',\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n },\n {\n propKey: 'phone',\n regex: 'phone'\n }\n ])\n // allowProperties([fibonacci, time, result])\n ],\n validate: validateModel,\n onDelete: readyToDelete,\n eventHandlers: [handleOrderEvent],\n ports: {\n listen: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n notify: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n validateAddress: {\n service: 'Address',\n type: 'outbound',\n keys: 'shippingAddress',\n producesEvent: 'addressValidated',\n disabled: true\n },\n authorizePayment: {\n service: 'Payment',\n type: 'outbound',\n keys: 'paymentStatus',\n consumesEvent: 'startWorkflow',\n producesEvent: 'paymentAuthorized',\n undo: cancelPayment,\n disabled: true\n },\n pickOrder: {\n service: 'Inventory',\n type: 'outbound',\n keys: 'pickupAddress',\n callback: orderPicked,\n consumesEvent: 'itemsAvailable',\n producesEvent: 'orderPicked',\n undo: returnInventory,\n circuitBreaker: {\n portTimeout_pickOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 5000\n }\n }\n },\n shipOrder: {\n service: 'Shipping',\n type: 'outbound',\n callback: orderShipped,\n consumesEvent: 'orderPicked',\n producesEvent: 'orderShipped',\n undo: returnShipment,\n circuitBreaker: {\n portTimeout_shipOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n },\n portRetryFailed_order: {\n callVolume: 3,\n errorRate: 2,\n intervalMs: 60000,\n fallbackFn: cancel\n },\n default: {\n callVolume: 3,\n errorRate: 3,\n intervalMs: 60000\n }\n }\n },\n trackShipment: {\n service: 'Shipping',\n type: 'outbound',\n keys: ['trackingStatus', 'trackingId'],\n consumesEvent: 'orderShipped',\n producesEvent: 'orderDelivered',\n circuitBreaker: {\n portRetryFailed_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n }\n }\n },\n verifyDelivery: {\n service: 'Shipping',\n type: 'outbound',\n keys: 'proofOfDelivery',\n consumesEvent: 'orderDelivered',\n producesEvent: 'deliveryVerified',\n undo: returnDelivery\n },\n completePayment: {\n service: 'Payment',\n type: 'outbound',\n callback: paymentCompleted,\n consumesEvent: 'deliveryVerified',\n producesEvent: 'orderComplete',\n undo: refundPayment\n },\n cancelShipment: {\n service: 'Shipping',\n type: 'outbound'\n },\n refundPayment: {\n service: 'Payment',\n type: 'outbound'\n },\n cancelOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['post']\n },\n approveOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['patch']\n },\n trackAsyncContext: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n customHttpStatus: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n testContainsMany: {\n service: 'Inventory',\n type: 'inbound',\n timeout: 0\n },\n runFibonacciJs: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n getFieldList: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n createModelEvent: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n }\n },\n relations: {\n customer: {\n modelName: 'customer',\n type: 'manyToOne',\n foreignKey: 'customerId',\n desc: 'Many orders per customer, just one customer per order'\n },\n inventory: {\n modelName: 'inventory',\n type: 'containsMany',\n foreignKey: 'itemId',\n arrayKey: 'orderItems',\n desc: 'An order contains a list of inventory items to ship.'\n }\n },\n routes: [\n {\n path: '/orders',\n get: async (req, res, ports) =>\n ports.listModels({\n writable: res,\n query: req.query\n }),\n\n post: async (req, res, ports) => {\n try {\n const result = await ports.createModel(req.body)\n res\n .status(200)\n .json({ message: 'ok', ctx: result.context, id: result.id })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n }\n },\n {\n path: '/orders/:id',\n get: async (req, res, ports) => ports.findModel(req.params.id),\n patch: async (req, res, ports) => {\n try {\n const result = await ports.editModel({\n id: req.params.id,\n changes: req.body\n })\n res.status(200).json({ message: 'ok', ctx: result.context })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n },\n delete: async (req, res, ports) => {\n ports.removeModel(req.params.id)\n res.status(200).json({ message: 'ok' })\n }\n }\n ],\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n approve: {\n command: approve,\n acl: ['write', 'approve']\n },\n cancel: {\n command: cancel,\n acl: ['write', 'cancel']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n serializers: [\n {\n on: 'deserialize',\n key: 'creditCardNumber',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n },\n {\n on: 'deserialize',\n key: 'shippingAddress',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n }\n // {\n // on: 'deserialize',\n // key: 'billingAddress',\n // type: 'string',\n // value: (key, value) => decrypt(value),\n // enabled: false\n // }\n ]\n}\n","'use strict'\n\nimport { DataSourceAdapterCustomFile } from '../../adapters/datasources/datasource-adapter-file'\nimport { makeToDoFactory } from '../models/todo'\nimport { nanoid } from 'nanoid'\n\n/**\n * @type {import('../index').ModelSpecification}\n */\nexport const ToDo = {\n modelName: 'todo',\n endpoint: 'todo',\n dependencies: { uuid: nanoid },\n factory: makeToDoFactory,\n datasource: {\n factory: DataSourceAdapterCustomFile,\n cacheSize: 4000,\n baseClass: 'DataSourceFile'\n }\n}\n","'use strict'\n\nimport { makeClient } from '../models/webswitch'\n\n/**\n * @type {import('../domain').ModelSpecification}\n */\nexport const WebSwitch = {\n modelName: 'webswitch',\n endpoint: 'appfabric',\n factory: makeClient,\n internal: true,\n ports: {\n serviceLocatorInit: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAsk: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAnswer: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n websocketConnect: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketPing: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketSend: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketStatus: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketTerminate: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnOpen: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnMessage: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnError: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnPong: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n }\n }\n}\n","'use strict'\n\n/**\n * @typedef {string} eventName\n */\n\n/**\n * @typedef Model\n * @property {string} _Symbol_id - immutable/private uuid\n * @property {string} _Symbol_modelName - immutable/private name\n * @property {string} _Symbol_createTime - immutable/private createTime\n * @property {onUpdate} _Symbol_onUpdate - immutable/private update function\n * @property {onDelete} _Symbol_onDelete\n * @property {function(Object)} update - use this function to update model\n * specify changes in an object\n * @property {function()} toJSON - de/serialization logic\n * @property {function(eventName,function(eventName,Model):void)} addListener listen for domain events\n * @property {function(eventName,Model):Promise} emit emit domain event\n * @property {function(function():Promise):Promise} [port] - when a\n * port is configured, the framework generates a function to invoke it. When data\n * arrives on the port, depending on the implementation, the port's adapter invokes\n * the callback specified in the port configuration, or as an argument to the port\n * function. The callback returns an updated Model, and control is returned to the\n * caller. Optionally, an event is fired to trigger the next port function to run\n * @property {function():Promise} [relation] - when you configure a relation,\n * the framework generates a function that your code can call to run the query\n * @property {function(*):*} [command] - the framework will call any model method\n * you specify when passed as a parameter or query in an API call.\n */\n\n/**\n * @callback onUpdate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onDelete\n * @param {Model} model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback validate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onLoad\n * @param {Model} savedModel rehydrated model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @typedef {string} service - name of the service object to inject in adapter\n * @typedef {number} timeout - call to adapter will timeout after `timeout` milliseconds\n *\n * @typedef {{\n * [x: string]: {\n * service: service,\n * timeout?: timeout,\n * callback?: function({model: Model})\n * errorCallback?: function({model: Model, port: string, error:Error}),\n * timeoutCallback?: function({model: Model, port: string}),\n * consumesEvent?:string,\n * producesEvent?:string,\n * type?:'inbound'|'outbound',\n * disabled?: boolean,\n * adapter?: string,\n * circuitBreaker?: thresholds\n * }\n * }} ports - input/output ports for the domain\n */\n\n/**\n * @typedef {{\n * [x:string]: {\n * errorRate:number\n * callVolume:number,\n * intervalMs:number,\n * fallbackFn:function()\n * },\n * }} thresholds - thresholds for different errors\n */\n\n/**\n * @typedef {{\n * [x: string]: {\n * modelName:string,\n * type:\"oneToMany\"|\"oneToOne\"|\"manyToOne\",\n * foreignKey:any,\n * }\n * }} relations - define related domain entities\n *\n * @typedef {Array>} eventHandler - callbacks invoked to handle domain and\n * application events\n */\n\n/**\n *\n * @typedef {string} key\n * @typedef {*} value\n */\n\n/**\n * @typedef {{\n * on: \"serialize\" | \"deserialize\",\n * key: string | RegExp | \"*\" | (function(key,value):boolean)\n * type: \"string\" | \"object\" | \"number\" | \"function\" | \"any\" | (function(key,value):boolean)\n * value(key, value):value\n * }} serializer\n */\n/**\n * @typedef {{\n * [x:string]: {\n * allow:string|function(*):boolean|Array\n * deny:string|function(*):boolean|Array\n * type:\"role\"|\"relation\"|\"command\"\n * desc?:string\n * }\n * }} accessControlList\n */\n/**\n * @typedef {{\n * [x: string]: {\n * command:string|function(Model):Promise,\n * acl:accessControlList[]\n * }\n * }} commands - configure functions to execute when specified in a\n * URL parameter or query of the auto-generate REST API\n */\n/**\n * @callback controller\n * @param {Request} req\n * @param {Response} res\n */\n\n/**\n * @typedef {{\n * [path: string]: {\n * get?: controller,\n * post?: controller,\n * patch?: controller,\n * delete?:controller\n * }\n * }} endpoints\n */\n\n/**\n * @callback modelSpecFactoryFn\n * @param {object} dependencies\n * @returns {function(...args):Readonly}\n */\n\n/**\n * @typedef {object} ModelSpecification Specify domain model properties and functions\n * @property {string} modelName name of model (case-insenstive)\n * @property {string} endpoint URI reference (e.g. plural of `modelName` noun)\n * @property {modelSpecFactoryFn} factory returns factory function that creates the model instance\n * @property {object} [dependencies] injected into the model for inverted dependency/control\n * @property {Array} [mixins] - use functional mixins\n * to compose the object from common domain logic, like input validation.\n * @property {onUpdate} [onUpdate] - Function called to handle update requests. Called\n * before save.\n * @property {onDelete} [onDelete] - Function called before deletion.\n * @property {validate} [validate] - called to validate model updates\n * @property {ports} [ports] - input/output ports for the domain\n * @property {eventHandler[]} [eventHandlers] - callbacks invoked to handle CRUD events\n * @property {serializer[]} [serializers] - use for custom de/serialization of the model\n * when reading or writing to storage or network\n * @property {relations} [relations] - create related models or query in aggregate\n * @property {commands} [commands] - define functions to execute when specified in a\n * URL parameter or query of the auto-generated REST API\n * @property {accessControlList} [accessControlList] - configure authorization\n * @property {endpoints} [routes] - additional custom API endpoints - specify inbound port\n * @property {{factory:import(\"../adapters/datasources/datasource-mongodb\"),url:string,credentials?:string}} [datasource] - custom datasource\n * for this model. If not set, the default set by the server is used.\n *\n */\n\n/**\n * @callback addModel\n * @param {{ searchTerm1, searchTerm2, searchTermN }} input\n * @returns {Promise}\n */\n\n/**\n * @callback editModel\n * @param {{ id:string, changes:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findModel\n * @param {{ id:string, query:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findRelatedModels\n * @param {{ query:object, relation:string }} input\n * @returns { Promise<{Model,[Model]}> }\n */\n\n/**\n * @callback listModels\n * @param {{ query:object }} input e.g. { searchTerm1 : 'val', ...etc }\n * @returns { [Promise] }\n */\n\n/**\n * @callback executeCommand\n * @param {{ id:string }} input\n * @returns { Model }\n */\n\n/**\n * @typedef DomainPortAPI\n * @property { addModel } addModel\n * @property { editModel } editModel\n * @property { listModels } listModels\n * @property { findModel } findModel\n * @property { findRelatedModels } findModel\n * @property { removeModel } removeModel\n * @property { executeCommand } executeCommand\n */\n\nimport GlobalMixins from './util/mixins'\nimport bindAdapters from './util/bind-adapters'\n\n// Service dependencies\nimport * as services from '../services'\nimport * as adapters from '../adapters'\nimport * as ports from './ports'\n// Models\nimport * as modelSpecs from './config'\n\n/**\n *\n * @param {ModelSpecification} spec\n */\nfunction validateSpec (spec) {\n const missing = ['endpoint', 'factory'].filter(key => !spec[key])\n if (missing?.length > 0) {\n throw new Error(\n `missing properties: ${missing}, spec: ${Object.entries(spec)}`\n )\n }\n}\n\n/**\n * @param {ModelSpecification} spec\n * @param {*} dependencies - services injected\n */\nfunction makeModel (spec) {\n validateSpec(spec)\n const mixins = spec.mixins || []\n const dependencies = spec.dependencies || {}\n return {\n ...spec,\n mixins: mixins.concat(GlobalMixins),\n dependencies: {\n ...dependencies,\n ...bindAdapters(spec.ports, adapters, services)\n }\n }\n}\n\nexport const models = Object.entries(modelSpecs).map(([k, v]) =>\n makeModel({ ...v, modelName: k })\n)\n","'use strict'\n\nexport function makeCustomerFactory (dependencies) {\n return function createCustomer ({\n firstName,\n lastName,\n shippingAddress,\n creditCardNumber,\n billingAddress = shippingAddress,\n phone,\n email,\n userId\n } = {}) {\n return Object.freeze({\n customerId: dependencies.uuid(),\n firstName,\n lastName,\n creditCardNumber,\n shippingAddress,\n billingAddress,\n phone,\n email,\n userId\n })\n }\n}\n\nexport async function okToDelete (customer) {\n const orders = await customer.orders()\n if (orders?.length > 0)\n throw new Error('cant delete customer with open orders')\n return customer\n}\n\nfunction fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n}\n\nexport async function runFibonacciCust (data) {\n console.log({ data })\n const param = parseInt(data.args.fibonacci || 20)\n const start = Date.now()\n return {\n fibonacci: param,\n result: fibonacci(param),\n time: Date.now() - start\n }\n}\n\nexport async function doesFieldExist (data) {\n console.log({ name: data.args?.name })\n return {\n field: data.args?.name,\n exists: (\n await (await this.fetchRelatedService('ORDER')).getFieldList()\n ).includes(data.args?.name)\n }\n}\n","'use strict'\n\nexport const assetTypes = ['rotating-asset', 'spare-part']\nexport const properties = ['height', 'length', 'width', 'weight', 'color']\nexport const categories = ['home', 'auto', 'business']\n\nexport const makeInventoryFactory = dependencies => ({\n category,\n properties,\n price,\n discount,\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n}) =>\n Object.freeze({\n category,\n properties,\n price: price - (discount || 0.0),\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n })\n","'use strict'\n\nimport { prevmodel } from '../util/mixins'\nimport { asyncPipe } from '../util/utils'\nimport checkPayload from '../util/check-payload'\nimport { Transform } from 'stream'\n\n/** @typedef { import('../domain/index.js').ModelSpecification} ModelSpecification */\n/** @typedef {string|RegExp} topic*/\n/** @typedef {function(string)} eventCallback*/\n/** @typedef {import('../adapters/index').adapterFunction} adapterFunction*/\n/** @typedef {string} id */\n/** @typedef {import(\"./customer\").Customer} Customer */\n/** @typedef {function(Order)} undoFunction */\n/**\n * @callback logMessageFn\n * @param {object|string} message\n * @param {logType} [type]\n *\n */\n\n/** @typedef {'first'|'last'|'lastStateChange'|'stateChange'|'error'|'undo'} logType */\n\n/**\n * @typedef readLogType\n * @property {number} index\n * @property {logType} type\n */\n\n/**\n * @typedef {{\n * itemId: string,\n * price: number,\n * qty?: number\n * }} orderItemType\n */\n\n/**\n * @callback relationFunction\n * @property {...args}\n * @returns {Promise}\n * } relationFunction\n */\n\n/**\n * @typedef {Object} Order The Order Service\n * @property {function(topic,eventCallback)} listen - listen for events\n * @property {import('../adapters/event-adapter').notifyType} notify\n * @property {adapterFunction} validateAddress - returns valid address or throws exception\n * @property {adapterFunction} completePayment - completes payment for an authorized charge\n * @property {adapterFunction} verifyDelivery - verify the order was received by the customer\n * @property {adapterFunction} trackShipment\n * @property {adapterFunction} refundPayment\n * @property {relationFunction} inventory - reserve inventory items\n * @property {adapterFunction} undo - undo all transactions up to this point\n * @property {function():Promise} pickOrder - pick items from warehouse and prepare for shipment\n * @property {adapterFunction} authorizePayment - verify payment, i.e. reserve the balance due\n * @property {import('../adapters/shipping-adapter').shipOrder} shipOrder -\n * calls shipping service to print label and request delivery\n * @property {function(Order):Promise} save - saves order\n * @property {function():Promise} find - finds order\n * @property {string} shippingAddress\n * @property {string} orderNo = the order number\n * @property {string} trackingId - id given by tracking status for this `orderNo`\n * @property {function():Order} decrypt - decrypts sensitive properties\n * @property {function({key1:any,keyN:any}, boolean):Promise} update - update the order,\n * set the second arg to false to turn off validation.\n * @property {'PENDING'|'APPROVED'|'SHIPPING'|'CANCELED'|'COMPLETED'} orderStatus\n * @property {function(...args):Promise} customer - retrieves related customer object,\n * or if args are provided, creates a new customer object, using the provided args as the input.\n * @property {function(string,Order):Promise} emit - broadcast domain event\n * @property {function():boolean} paymentAccepted - payment approved and funds reserved\n * @property {function():boolean} autoCheckout - whether or not to immediately submit the order\n * @property {boolean} saveShippingDetails save shipping and payment details in a new customer record\n * @property {{itemId:string,price:number,qty:number}[]} orderItems\n * @property {Symbol} customerId {@link Customer}\n * @property {logMessageFn} logEvent\n * @property {logMessageFn} logError\n * @property {logMessageFn} logUndo\n * @property {logMessageFn} logStateChange\n * @property {readMessageFn} readLog\n */\n\nconst orderStatus = 'orderStatus'\nconst orderTotal = 'orderTotal'\nconst orderNo = 'orderNo'\n\nexport const OrderStatus = {\n PENDING: 'PENDING',\n APPROVED: 'APPROVED',\n SHIPPING: 'SHIPPING',\n COMPLETE: 'COMPLETE',\n CANCELED: 'CANCELED'\n}\n\n/**\n *\n * @param {orderItemType} orderItem\n * @returns {boolean} true if item is valid\n */\nexport const checkItem = function (orderItem) {\n return (\n typeof orderItem.itemId === 'string' && typeof orderItem.price === 'number'\n )\n}\n\n/**\n * @param {orderItemType[]} orderItems\n */\nexport const checkItems = function (orderItems) {\n if (!orderItems || orderItems.length < 1) {\n throw new Error('order contains no items')\n }\n const items = Array.isArray(orderItems) ? orderItems : [orderItems]\n\n if (items.length > 0 && items.every(checkItem)) {\n return items\n }\n throw new Error('order items invalid', { items })\n}\n\n/**\n * Calculate order total\n * @param {orderItemType[]} orderItems\n */\nexport const calcTotal = function (orderItems) {\n const items = checkItems(orderItems)\n\n return items.reduce((total, item) => {\n const qty = item.qty || 1\n return (total += item.price * qty)\n }, 0)\n}\n\n/**\n * @param {orderItemType[]} orderItems\n * @returns {number} number of items\n */\nexport const itemCount = function (orderItems) {\n return orderItems.reduce((total, item) => (total += item.qty || 1))\n}\n\n/**\n * No changes to `propKey` properties once the order is approved\n * @param {*} o - the order\n * @param {*} propKey\n * @returns {string | null} the key or `null`\n */\nexport const freezeOnApproval = propKey => o =>\n o.orderStatus && o.orderStatus !== OrderStatus.PENDING ? propKey : null\n\nconst finalStatus = status =>\n [OrderStatus.COMPLETE, OrderStatus.CANCELED].includes(status)\n\n/**\n * No changes to `propKey` once order is complete or canceled\n * @param {*} o - the order\n * @param {*} propKey\n * @returns {string | null} the key or `null`\n */\nexport const freezeOnCompletion = propKey => o =>\n finalStatus(o.orderStatus) ? null : propKey\n\n/**\n * If not a registered customer, provide shipping & payment details.\n * @param {*} o\n * @param {*} propKey\n * @returns {string | void} the key or `void`\n */\nexport const requiredForGuest = propKey => o => o.customerId ? null : propKey\n\n/**\n * Value required to approve order.\n * @param {*} propKey\n */\nexport const requiredForApproval = propKey => o =>\n o.orderStatus === OrderStatus.APPROVED ? propKey : null\n\n/**\n * Value required to complete order\n * @param {object} o\n * @param {string | string[]} propKey these props are required to comlete the order\n * @returns {string | void} the key or `void`\n */\nexport const requiredForCompletion = propKey => o =>\n o.orderStatus === OrderStatus.COMPLETE ? propKey : null\n\n/**\n *\n * @param {enum} from\n * @param {enum} to\n * @returns\n */\nconst invalidStatusChange = (from, to) => (o, propVal) =>\n propVal === to && o[prevmodel].orderStatus === from\n\nconst invalidStatusChanges = [\n // Can't change back to pending once approved\n invalidStatusChange(OrderStatus.APPROVED, OrderStatus.PENDING),\n // Can't change back to pending once shipped\n invalidStatusChange(OrderStatus.SHIPPING, OrderStatus.PENDING),\n // Can't change back to approved once shipped\n invalidStatusChange(OrderStatus.SHIPPING, OrderStatus.APPROVED),\n // Can't change directly to shipping from pending\n invalidStatusChange(OrderStatus.PENDING, OrderStatus.SHIPPING),\n // Can't change directly to complete from pending\n invalidStatusChange(OrderStatus.PENDING, OrderStatus.COMPLETE),\n // Can't change final status\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.PENDING),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.SHIPPING),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.APPROVED),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.CANCELED),\n // Can't change final status\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.PENDING),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.SHIPPING),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.APPROVED),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.COMPLETE)\n]\n\n/**\n * Check that status changes are valid\n */\nexport const statusChangeValid = (o, propVal) => {\n if (invalidStatusChanges.some(i => i(o, propVal))) {\n throw new Error('invalid status change')\n }\n return true\n}\n\n/**\n *\n * @param {*} o\n * @param {*} propVal\n */\nexport const orderTotalValid = (o, propVal) =>\n calcTotal(o.orderItems) === propVal\n\n/**\n * Recalculate order total\n * @param {object} o - the object (order)\n * @param {number} propVal - the property value\n */\nexport const recalcTotal = (o, propVal) => ({\n orderTotal: calcTotal(propVal)\n})\n\n/**\n * Updated signature requirement if `orderTotal` above certain value\n * @param {object} o - the object (order)\n * @param {number} propVal - the property value\n */\nexport const updateSignature = (o, propVal) => ({\n signatureRequired: calcTotal(propVal) > 999.99 || o.signatureRequired\n})\n\n/**\n * Don't delete orders before they're complete.\n */\nexport function readyToDelete (model) {\n if (\n ![OrderStatus.COMPLETE, OrderStatus.CANCELED].includes(model.orderStatus)\n ) {\n throw new Error('order must be canceled or completed')\n }\n return model\n}\n\n/**\n *\n * @param {Error} error\n * @param {Order} order\n * @param {*} func\n */\nfunction handleError (error, order, func) {\n const errMsg = { func, orderNo: order.orderNo, error }\n if (order) order.emit('orderError', errMsg)\n\n throw new Error(JSON.stringify(errMsg))\n}\n\n/**\n * Callback invoked by adapter when payment is complete\n * @param {{model:Order}} options\n */\nexport async function paymentCompleted (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'confirmationCode',\n options,\n payload,\n paymentCompleted.name\n )\n return order.update({ ...changes, orderStatus: OrderStatus.COMPLETE })\n}\n\n/**\n * Callback invoked by shipping adapter when order is picked up.\n * @param {{model:Order}} options\n * @param {string} shipmentId\n */\nexport async function orderShipped (options = {}, payload = {}) {\n const { model: order } = options\n const shipmentPayload = checkPayload(\n 'shipmentId',\n options,\n payload,\n orderShipped.name\n )\n return order.update({\n shipmentId: shipmentPayload.shipmentId,\n orderStatus: OrderStatus.SHIPPING\n })\n}\n\n/**\n * Callback invoked when order is ready for pickup\n * @param {{ model:Order }} options\n */\nexport async function orderPicked (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'pickupAddress',\n options,\n payload,\n addressValidated.name\n )\n return order.update(changes)\n}\n\n/**\n * Callback invoked when shippingAddress is verified (and possibly corrected)\n * @param {{ model:Order }} options\n * @param {string} shippingAddress\n */\nexport async function addressValidated (options = {}, payload = {}) {\n const { model: order } = options\n const addressPayload = checkPayload(\n 'shippingAddress',\n options,\n payload,\n addressValidated.name\n )\n return order.update({ shippingAddress: addressPayload.shippingAddress })\n}\n\n/**\n * Called by adapter when port recevies response from payment service.\n * @param {{ model:Order }} options\n * @param {*} paymentAuthorization\n */\nexport async function paymentAuthorized (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'paymentStatus',\n options,\n payload,\n paymentAuthorized.name\n )\n return order.update({ ...changes, paymentStatus }, false)\n}\n\n/**\n * Called to refund payment when order is canceled.\n * @param {*} options\n * @param {*} payload\n * @returns\n */\nexport async function refundPayment (order) {\n // call port by same name.\n order.refundPayment((options, payload) => {\n const changes = checkPayload(\n 'refundReceipt',\n options,\n payload,\n refundPayment.name\n )\n return order.update({ ...changes, orderStatus: OrderStatus.CANCELED })\n })\n}\n\n/**\n *\n * @param {Order} order\n * @returns {Promise}\n */\nasync function verifyAddress (order) {\n console.debug({\n fn: verifyAddress.name,\n validateAddress: order.validateAddress\n })\n return order.validateAddress(addressValidated)\n}\n\n/**\n * Request the bank or lender to place a hold on\n * the customer account in the amount of the payment\n * due, to be withdrawn once the shipment is safely\n * in our customer's hands, or credited back if things\n * don't work out.\n *\n * @param {Order} order\n * @returns {Promise}\n */\nasync function verifyPayment (order) {\n try {\n /**\n * @type {Order}\n */\n const authorizeOrder = await order.authorizePayment(paymentAuthorized)\n\n if (!authorizeOrder.paymentDeclined) {\n throw new Error('payment declined')\n }\n\n return authorizeOrder\n } catch (e) {\n handleError(e, order, verifyPayment.name)\n }\n return order\n}\n\n/**\n *\n * @param {Order} order\n * @returns {Promise}\n * @throws {'oInventory'}\n */\nasync function verifyInventory (order) {\n const inventory = await order.inventory()\n if (inventory.length < 1) throw new Error('bad inventory ID')\n\n const insufficient = order.orderItems.filter(item => {\n const inv = inventory.find(i => i.id === item.itemId)\n if (!inv) return true\n if (inv.quantity < item.qty) return true\n return false\n })\n\n if (insufficient.length > 0) {\n order.emit('lowOrOutOfStock', insufficient)\n throw new Error(`low or out of stock: ${insufficient.map(i => i.itemId)}`)\n }\n}\n/**\n * Copy existing customer data into the order\n * or create new customer from order details.\n *\n * @param {Order} order\n * @throws {'InvalidCustomerId'}\n */\nasync function getCustomerOrder (order) {\n // If an id is given, try fetching the model\n if (order.customerId) {\n if (!order.customer) {\n console.log({ order })\n }\n // Use the relation defined in the spec\n const customer = await order.customer()\n\n if (!customer) {\n throw new Error('invalid customer id', order.customerId)\n }\n\n // Add customer data to the order\n const custInfo = { ...customer.decrypt(), firstName: customer.firstName }\n const update = await order.update(custInfo)\n\n console.info('update order with data from existing customer', custInfo)\n return update\n }\n\n // Create a new customer from the shipping details\n if (order.saveShippingDetails) {\n const custInfo = { ...order.decrypt(), firstName: order.firstName }\n const customer = await order.customer(custInfo)\n\n console.info('create new customer with data from order', customer)\n return order\n }\n\n return order\n}\n\n/**\n * Handle a new order:\n * - fetch or save customer info\n * - check item availability\n * - authorize payment\n * - verify shipping address\n */\nconst processPendingOrder = asyncPipe(\n getCustomerOrder,\n verifyInventory,\n verifyPayment,\n verifyAddress\n)\n\n/**\n * Implements the beginging of the order service workflow.\n * The rest is implemented by the {@link ModelSpecification}.\n * See the port configuration section of {@link Order}.\n */\nconst OrderActions = {\n /**\n * Verifies the shipping address and authorizes payment\n * for the order total when the order is first created,\n * or when it is updated while still in pending status.\n *\n * @param {Order} order - the order\n * @returns {Promise>}\n */\n [OrderStatus.PENDING]: order => {\n // return processPendingOrder(order)\n\n if (order.autoCheckout)\n /**@type {Order} */\n getCustomerOrder(order).then(order =>\n runOrderWorkflow(\n order.updateSync({ orderStatus: OrderStatus.APPROVED })\n )\n )\n },\n\n /**\n * If payment is authorized, check inventory.\n * This kicks off the rest of the workflow,\n * which is controlled by port event flow.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.APPROVED]: order => {\n try {\n //if (/approved/i.test(order.paymentStatus))\n return order.pickOrder(orderPicked)\n\n // order.emit('PayAuthFail', 'Payment authorization problem')\n // return order\n } catch (error) {\n console.log({ error })\n handleError(error, order, OrderStatus.APPROVED)\n }\n return order\n },\n\n /**\n * Useful if we need to restart tracking.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.SHIPPING]: async order => {\n try {\n order.trackShipment(trackingUpdate)\n console.debug({ func: OrderStatus.SHIPPING, order })\n await (\n await order.update({ orderStatus: OrderStatus.SHIPPING })\n ).emit('orderPicked')\n } catch (error) {\n handleError(error, order, OrderStatus.SHIPPING)\n }\n return order\n },\n\n /**\n * Start cancellation process.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.CANCELED]: async order => {\n try {\n console.debug({\n func: OrderStatus.CANCELED,\n desc: 'order canceled, calling undo',\n orderNo: order.orderNo\n })\n return order.undo()\n } catch (error) {\n handleError(error, order, OrderStatus.CANCELED)\n }\n return order\n },\n /**\n *\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.COMPLETE]: async order => {\n // send route to questionnaire, perform analysis, schedule follow-up\n console.log('customer sentiment analysis, customer care, sales analysis')\n return order\n }\n}\n\n/**\n * Call order service workflow - controlled by status\n * @param {Order} order\n * @returns {Promise>}\n */\nexport function runOrderWorkflow (order) {\n console.log({ orderStatus: order.orderStatus })\n OrderActions[order.orderStatus](order)\n}\n\n/**\n * Called on create, update, delete of model instance.\n * @param {{model:Promise>}}\n */\nexport function handleOrderEvent ({ model: order, eventType, changes }) {\n if (changes?.orderStatus || eventType === 'CREATE') {\n // console.debug({ fn: handleOrderEvent.name, order })\n runOrderWorkflow(order)\n }\n}\n\n/**\n * Require a signature for orders $1000 and up\n * @param {*} input\n * @param {*} orderTotal\n */\nfunction needsSignature (input, orderTotal) {\n return typeof input === 'boolean' ? input : orderTotal > 999.99\n}\n\n/** format and classify log entries */\nfunction logMessage (message, type) {\n const msg = typeof message === 'string' ? message : JSON.stringify(message)\n\n return {\n desc: msg.substring(0, 140),\n type,\n time: Date.now(),\n toJSON () {\n return {\n desc: this.desc,\n type,\n time: new Date(this.time).toISOString()\n }\n }\n }\n}\n\n/**\n * Returns factory function for the Order model.\n * @type {import('../domain/index.js').modelSpecFactoryFn}\n * @param {*} dependencies - inject dependencies\n */\nexport function makeOrderFactory (dependencies) {\n return function createOrder ({\n orderItems,\n email = null,\n lastName = null,\n firstName = null,\n customerId = null,\n billingAddress = null,\n shippingAddress = null,\n creditCardNumber = null,\n shippingPriority = null,\n autoCheckout = false,\n saveShippingDetails = false,\n requireSignature,\n fibonacci = 10\n }) {\n //const signatureRequired = needsSignature(requireSignature, total)\n const order = {\n email,\n lastName,\n firstName,\n customerId,\n orderItems,\n creditCardNumber,\n billingAddress,\n shippingAddress,\n signatureRequired: false,\n saveShippingDetails,\n shippingPriority,\n fibonacci,\n result: 0,\n time: 0,\n estimatedArrival: null,\n log: [logMessage('order created')],\n [orderTotal]: 0,\n [orderStatus]: OrderStatus.PENDING,\n [orderNo]: dependencies.uuid(),\n desc: 'new order 25',\n itemId: null,\n /**\n * Has payment for the order been authorized?\n */\n paymentAccepted () {\n return true\n },\n /**\n * Proceed to checkout automatically or wait for approval?\n */\n autoCheckout () {\n return autoCheckout\n },\n totalItems () {\n return itemCount(this.orderItems)\n },\n total () {\n return calcTotal(this.orderItems)\n },\n addItem (item) {\n if (checkItem(item)) {\n this.orderItems.push(item)\n return true\n }\n return false\n },\n logEvent (message, type = 'info') {\n this.log.push(logMessage(message, type))\n },\n logError (message) {\n this.logEvent(message, 'error')\n },\n logUndo (message) {\n this.logEvent(message, 'undo')\n },\n logStateChange (message) {\n this.logEvent(message, 'stateChange')\n },\n\n /**\n *\n * @param {viewLog} options\n * @returns {logMessageFn[]|logMessageFn}\n */\n readLog ({ index = null, type = null }) {\n const indx = parseInt(index)\n if (indx < this.log.length && indx !== NaN) return this.log[indx]\n if (type === 'first') return this.log[0]\n if (type === 'last') return this.log[this.log.length - 1]\n if (type === 'lastStateChange')\n return this.log[this.log.lastIndexOf({ type: 'stateChange' })]\n if (type === 'stateChanges')\n return this.log.filter(l => l.type === 'stateChange')\n if (type === 'error') return this.log.filter(l => l.type === 'error')\n if (type === 'undo') return this.log.filter(l => l.type === 'undo')\n return this.log\n }\n }\n\n return Object.freeze(order)\n }\n}\n\n/**\n * Called as command to approve/submit order.\n * @param {Order} order\n */\nexport async function approve (order) {\n console.debug({ msg: 'got order', order })\n const approvedOrder = order.updateSync(\n {\n orderStatus: OrderStatus.APPROVED\n },\n false\n )\n console.debug({ approvedOrder })\n approvedOrder.logStateChange(OrderStatus.APPROVED)\n return runOrderWorkflow(approvedOrder)\n}\n\n/**\n * Called as command to cancel order.\n * @param {Order} order\n */\nexport async function cancel (order) {\n const canceledOrder = await order.update({\n orderStatus: OrderStatus.CANCELED\n })\n canceledOrder.logStateChange(OrderStatus.CANCELED)\n return runOrderWorkflow(canceledOrder)\n}\n\n/**\n * Alias of `approve`\n * @param {Order} order\n * @returns\n */\nexport async function checkout (order) {\n return approve(order)\n}\n\n/**\n *\n * @param {{model:Order}} param0\n */\nexport function errorCallback ({ port, model: order, error }) {\n const errMsg = { error, port, error }\n console.error(errorCallback.name, errMsg)\n order.logEvent(errMsg)\n order.emit(errorCallback.name, errMsg)\n return order.undo()\n}\n\n/**\n *\n * @param {{model:Order}} param0\n */\nexport function timeoutCallback ({ port, ports, adapterFn, model: order }) {\n console.error('timeout...', port)\n //order.logError(timeoutCallback.name, 'timeout')\n order.emit(timeoutCallback.name, errMsg)\n}\n\n/**\n * @type {undoFunction}\n * Start process to return canceled order items to inventory.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnInventory (order) {\n console.log(returnInventory.name)\n order.logEvent(returnInventory.name, 'timeout')\n order.emit(returnInventory.name, errMsg)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\n/**\n * @type {undoFunction}\n * Start process for the shipper to pick the items to return.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnShipment (order) {\n console.log(returnShipment.name)\n order.logUndo(returnShipment.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\nexport function accountOrder (req, res) {}\n\n/**\n * @type {undoFunction}\n * Start process to return canceled order items to inventory.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnDelivery (order) {\n console.log(returnDelivery.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\n/**\n * @type {undoFunction}\n */\nexport async function cancelPayment (order) {\n console.log(cancelPayment.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\nexport class OrderError extends Error {\n constructor (error, code) {\n super(error)\n this.code = code\n }\n}\n\n/**\n *\n * @param {Date.now} data\n * @returns\n */\nexport async function cancelOrders (data) {\n const cancelOrdersTransform = new Transform({\n objectMode: true,\n transform: (chunk, _encoding, done) => {\n done(\n null,\n JSON.stringify({ ...chunk, orderStatus: OrderStatus.CANCELED })\n )\n }\n })\n\n await this.list({\n writable: this.createWriteStream(),\n transform: cancelOrdersTransform,\n serialize: false\n })\n\n return { status: '🏆' }\n}\n\n/**\n *\n * @param {Date.now} data\n * @returns\n */\n\nexport async function approveOrders (data) {\n const approveOrdersTransform = new Transform({\n objectMode: true,\n transform: (chunk, encoding, done) => {\n if (chunk._id) delete chunk._id\n this.push(JSON.stringify({ ...chunk, orderStatus: OrderStatus.APPROVED }))\n done()\n }\n })\n\n await this.list({\n writable: this.createWriteStream(),\n transform: approveOrdersTransform\n })\n\n return { status: '🏆' }\n}\n\n/**\n *\n * @returns\n */\nexport async function trackAsyncContext () {\n const ctx = this.getContext()\n const dur = 'test-duration'\n const startTime = Date.now()\n\n await new Promise(resolve => setTimeout(resolve, 100))\n\n // require('fs')\n // .stream('/etc/hosts')\n // .pipe(ctx.get('res'))\n\n ctx.set(dur, Date.now() - startTime)\n\n const metric = {\n requestId: ctx.get('id'),\n fn: trackAsyncContext.name,\n duration: ctx.get(dur),\n context: [...ctx]\n }\n\n this.emit('metric', metric)\n console.log(metric.ctx)\n\n return metric\n}\n\nexport async function customHttpStatus (data) {\n if (data.args.code)\n throw new OrderError(data.args.message || 'custom status', data.args.code)\n try {\n console.log(x)\n } catch (error) {\n throw new OrderError(error, 500)\n }\n}\n\nexport async function testContainsMany (data) {\n console.log({ fn: testContainsMany.name, data })\n return { status: '👍', inventory: await this.inventory() }\n}\n\nfunction fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n}\n\nexport async function runFibonacciJs (data) {\n console.log({ data })\n const param = parseInt(data.args.fibonacci || 20)\n const start = Date.now()\n return {\n fibonacci: param,\n result: fibonacci(param),\n time: Date.now() - start\n }\n}\n\nexport async function getFieldList () {\n const model = await this.list({ query: { __limit: 1 }, stream: false })\n if (model && model.length) console.log({ model: model[0] })\n return Object.keys(model[0])\n}\n\nexport async function createModelEvent () {\n s\n return new Promise(resolve => {\n this.emit('createModel_ORDER', {\n cb: model => resolve(model),\n args: {\n a: 1,\n b: 2\n }\n })\n })\n}\n","'use strict'\n\nexport function makeToDoFactory (dependencies) {\n return function toDoFactory ({ text, isComplete }) {\n return Object.freeze({\n id: dependencies.uuid(),\n text,\n isComplete: isComplete || false\n })\n }\n} \n","/**\n * webswitch (c)\n *\n * Websocket clients connect to a common ws server,\n * called a webswitch. When a client sends a message,\n * webswitch broadcasts the message to all other\n * connected clients, including a special webswitch\n * server that acts as an uplink to another network,\n * if one is defined. A Webswitch server can also\n * receive messgages from an uplink and will broadcast\n * those messages to its clients as well.\n */\n\n'use strict'\n\nimport os from 'os'\nimport EventEmitter from 'events'\nimport { nanoid } from 'nanoid'\n\nconst HOSTNAME = 'webswitch.local'\nconst SERVICENAME = 'webswitch'\nconst HBEATTIMEOUT = 'heartBeatTimeout'\nconst WSOCKETERROR = 'webSocketError'\n\nconst isPrimary = /true/i.test(process.env.SWITCH)\nconst isBackup = /true/i.test(process.env.BACKUP)\nconst debug = /true/i.test(process.env.DEBUG)\nconst heartbeatMs = 10000\nconst sslEnabled = /true/i.test(process.env.SSL_ENABLED)\nconst clearPort = process.env.PORT || 80\nconst cipherPort = process.env.SSL_PORT || 443\nconst activePort = sslEnabled ? cipherPort : clearPort\nconst activeProto = sslEnabled ? 'wss' : 'ws'\nconst activeHost = process.env.DOMAIN || os.hostname()\nconst proto = isPrimary ? activeProto : process.env.SWITCH_PROTO\nconst port = isPrimary ? activePort : process.env.SWITCH_PORT\nconst host = isPrimary ? activeHost : process.env.SWITCH_HOST\nconst override = /true/i.test(process.env.SWITCH_OVERRIDE)\nconst apiProto = sslEnabled ? 'https' : 'http'\nconst apiUrl = `${apiProto}://${activeHost}:${activePort}`\n\nfunction serviceUrl () {\n const url = `${proto}://${host}:${port}`\n if (proto && host && port) return url\n if (isPrimary) throw new Error(`invalid url ${url}`)\n return null\n}\n\n/**\n * Service mesh client impl. Uses websocket and service-locator\n * adapters through ports injected into the {@link mesh} model.\n * Cf. modelSpec by the same name, i.e. `webswitch`.\n */\nexport class ServiceMeshClient extends EventEmitter {\n /**\n * The model is passed as the only arg.\n *\n * @param {import('../../domain').Model} mesh the domain model\n */\n constructor (mesh) {\n super('webswitch')\n this.url\n this.mesh = mesh\n this.name = SERVICENAME\n this.isPrimary = isPrimary\n this.isBackup = isBackup\n this.pong = true\n this.heartbeatTimer = 3000\n this.headers = {\n 'x-webswitch-host': os.hostname(),\n 'x-webswitch-role': 'node',\n 'x-webswitch-pid': process.pid\n }\n }\n\n /**\n *\n * @param {number} asyncId id's instance to kill\n * @returns {{telemetry:{mem:number,cpu:number}}}\n */\n telemetry () {\n return {\n eventName: 'telemetry',\n proto: this.name,\n apiUrl,\n heartbeatMs,\n hostname: os.hostname(),\n role: 'node',\n pid: process.pid,\n telemetry: {\n ...process.memoryUsage(),\n ...process.cpuUsage(),\n ...performance.nodeTiming\n },\n services: this.mesh.listServices(),\n events: this.mesh.listEvents(),\n socketState: this.mesh.websocketStatus() || 'undefined'\n }\n }\n\n /**\n * Zero-config, self-forming mesh network:\n * Discover URL of broker to connect to, or\n * if this is the broker, cast the local url\n * @returns {Promise} url\n */\n async resolveUrl () {\n await this.mesh.serviceLocatorInit({\n serviceUrl: serviceUrl(),\n name: this.name,\n primary: this.isPrimary,\n backup: this.isBackup\n })\n if (this.isPrimary) {\n await this.mesh.serviceLocatorAnswer()\n return serviceUrl()\n }\n return override ? serviceUrl() : this.mesh.serviceLocatorAsk()\n }\n\n /**\n * Use multicast dns to resolve broker url. Connect to\n * service mesh broker. Allow listeners to subscribe to\n * indivdual or all events. Send binary messages with\n * protocol and idempotentency headers. Periodically send\n * telemetry data.\n *\n * @param {*} options\n * @returns\n */\n async connect (options = { binary: true }) {\n this.options = options\n this.url = await this.resolveUrl()\n\n this.mesh.websocketConnect(this.url, {\n agent: false,\n headers: this.headers,\n protocol: SERVICENAME,\n useBinary: options.binary\n })\n\n this.mesh.websocketOnOpen(() => {\n console.log('connection open')\n this.send(this.telemetry())\n this.heartbeat()\n setTimeout(() => this.sendQueuedMsgs(), 3000)\n })\n\n this.mesh.websocketOnMessage(message => {\n if (!message.eventName) {\n debug && console.debug({ missingEventName: message })\n this.emit('missingEventName', message)\n return\n }\n try {\n this.emit(message.eventName, message)\n this.listeners('*').forEach(listener => listener(message))\n } catch (error) {\n console.error({ fn: this.connect.name, error })\n }\n })\n\n this.mesh.websocketOnError(error => {\n this.emit(WSOCKETERROR, error)\n console.error({ fn: this.connect.name, error })\n })\n\n this.mesh.websocketOnClose((code, reason) => {\n console.log({\n msg: 'received close frame',\n code,\n reason: reason?.toString()\n })\n clearTimeout(this.heartbeatTimer)\n setTimeout(() => {\n console.debug('reconnect due to socket close')\n this.connect()\n }, 5000)\n })\n\n this.mesh.websocketOnPong(() => (this.pong = true))\n this.once('timeout', this.timeout)\n }\n\n timeout () {\n console.warn('timeout')\n this.emit(HBEATTIMEOUT, this.telemetry())\n this.mesh.websocketTerminate()\n setTimeout(() => {\n console.debug('reconnect due to timeout')\n this.connect()\n }, 5000)\n }\n\n heartbeat () {\n if (this.pong) {\n this.pong = false\n this.mesh.websocketPing()\n this.heartbeatTimer = setTimeout(() => this.heartbeat(), heartbeatMs)\n } else {\n clearTimeout(this.heartbeatTimer)\n this.emit('timeout')\n }\n }\n\n /**\n * Convert message to binary and send with protocol and idempotency headers.\n * If message cannot be sent because of connection state or buffering queue\n * message in domain object for retry later. Using a domain object ensures\n * persistence of the queue across boots.\n *\n * @param {object} msg\n * @returns {Promise} true if sent, false if not\n */\n send (msg) {\n const sent = this.mesh.websocketSend(msg, {\n headers: {\n ...this.headers,\n 'idempotency-key': nanoid()\n }\n })\n if (sent) return true\n this.mesh.enqueue(msg)\n return false\n }\n\n /**\n * Send any messages buffered in `sendQueue`.\n */\n sendQueuedMsgs () {\n let sent = true\n while (this.mesh.queueDepth() > 0 && sent)\n sent = this.send(this.mesh.dequeue())\n }\n\n /**\n * Sends message to mesh broker service.\n * @param {*} msg\n */\n publish (msg) {\n return this.send(msg)\n }\n\n /**\n * Register handler to fire on event\n * @param {string} eventName\n * @param {function()} callback\n */\n subscribe (eventName, callback) {\n this.on(eventName, callback)\n }\n\n /**\n * A new object will be created on system reload.\n * Dispose of the old one. Run in context to\n * distinguish between the new and old instance.\n *\n * @param {*} code\n * @param {*} reason\n */\n async close (code, reason) {\n console.debug('closing socket')\n await this.mesh.save() // save queued messages\n this.removeAllListeners()\n this.mesh.websocketClose(code, reason)\n }\n}\n\n/**\n * @typedef {{\n * senderQueue:string[],\n * queueDepth:function():number,\n * connect:function(),\n * close:function(),\n * publish(object),\n * enqueue:function(string),\n * dequeue:function(),\n * subscribe:function(string,function())\n * }} serviceMeshIface\n */\n\n/**\n * Domain model factory function. This model is\n * used internally by the Aegis framework as a\n * pluggable service mesh client. Implement the\n * the methods below to create a new plugin.\n *\n * @param {*} dependencies injected depedencies\n * @returns {function({function():string[],function():string[]}):serviceMeshIface}\n */\nexport function makeClient (dependencies) {\n let client\n return function ({ listServices, listEvents }) {\n return {\n /**@type {function():string[]} */\n listServices,\n /**@type {function():string[]} */\n listEvents,\n /**@type {string[]} */\n sendQueue: [],\n /**@type {number} */\n sendQueueMax: 1000,\n\n queueDepth () {\n return this.sendQueue.length\n },\n\n enqueue (msg) {\n this.sendQueue.push(msg)\n },\n\n dequeue () {\n return this.sendQueue.shift()\n },\n\n /**\n *\n * @returns {ServiceMeshClient}\n */\n getClient () {\n if (client) return client\n client = new ServiceMeshClient(this)\n return client\n },\n\n async connect (options) {\n this.getClient().connect(options)\n },\n\n async publish (event) {\n this.getClient().publish(event)\n },\n\n subscribe (eventName, handler) {\n this.getClient().subscribe(eventName, handler)\n },\n\n async close (code, reason) {\n this.getClient().close(code, reason)\n }\n }\n }\n}\n","// import { systemsInGalaxy } from './SolarSystem'\n\nexport {\n cancelOrders,\n approveOrders,\n trackAsyncContext,\n customHttpStatus,\n testContainsMany,\n runFibonacciJs,\n getFieldList,\n createModelEvent\n} from './models/order'\n\nexport { runFibonacciCust, doesFieldExist } from './models/customer'\n// export { listSolarSystems, sendGalaticSignal } from './Galaxy'\n// export {\n// systemsInGalaxy,\n// sendSolarSignal,\n// receiveGalacticSignal\n// } from './SolarSystem'\n// export { receiveSolarSignal, planetsInSolarSystem } from './Planet'\n// export {\n// qeRunFibonacci,\n// qeCustomHttpStatus,\n// qeGetPublicIpAddressIn\n// } from './query-engine'\n// export { damBrowseIn, damDownloadIn, damSearchIn, damUploadIn } from './dam-api'\n// export { tmListEventsIn } from './ticket-master'\n// export { callFetchService } from './access-controller'\n","'use strict'\n\nexport default function makeAdapters (ports, adapters, services) {\n if (!ports || !adapters) {\n return\n }\n return Object.keys(ports)\n .map(port => {\n if (!adapters[port]) {\n return\n }\n\n try {\n return {\n [port]: adapters[port](services[ports[port].service])\n }\n } catch (e) {\n console.warn(e.message)\n }\n })\n .reduce((p, c) => ({ ...p, ...c }))\n}\n","'use strict'\n\n/**\n * Check the payload for expected properties.\n * @param {string|string[]} key name of property or properties\n * @param {*} options\n * @param {*} payload\n * @param {*} port\n */\nexport default function checkPayload (\n key,\n options = {},\n payload = {},\n port = checkPayload.name\n) {\n const { model } = options\n\n if (!model || Object.keys(payload) < 1 || !key) {\n throw new Error({\n desc: 'model, payload, or key is missing',\n model,\n port,\n error,\n payload,\n key\n })\n }\n\n if (Array.isArray(key)) {\n const keys = key.map(k => checkPayload(k, options, payload, port))\n\n return keys.reduce((p, c) => ({ ...p, ...c }))\n }\n\n if (payload[key]) {\n return { [key]: payload[key] }\n }\n\n if (model[key]) {\n return { [key]: model[key] }\n }\n\n return model\n .find()\n .then(latest => ({ [key]: latest[key] }))\n .catch(error => {\n throw new Error('property is missing' + key, port, error, payload, model)\n })\n}\n","'use strict'\n\nimport { hash, encrypt, decrypt, compose } from './utils'\nimport util from 'util'\n\n/**\n * Functional mixin created by `functionalMixinFactory`\n * @callback functionalMixin\n * @param {Object} o Object to compose\n * @returns {Object} Composed object\n */\n\n/**\n * Functional mixin factory - partial application - returns mixin function\n * @callback functionalMixinFactory\n * @param {*} mixinParams params for mixin function\n * @returns {functionalMixin}\n */\n\n/**\n * @typedef {import(\"../index\").Model} Model\n */\n\n/**\n * Private key to access previous version of the model\n */\nexport const prevmodel = Symbol('prevModel')\n/**\n * private key to access validation config\n */\nexport const validations = Symbol('validations')\n/**\n * Process mixin pre or post update\n */\nexport const mixinType = {\n pre: Symbol('pre'),\n post: Symbol('post')\n}\n\n/**\n * Stored mixins - use private symbol as key to prevent overwrite\n */\nexport const mixinSets = {\n [mixinType.pre]: Symbol('preUpdateMixins'),\n [mixinType.post]: Symbol('postUpdateMixins')\n}\n\n/**\n * Set of pre mixins\n */\nconst premixins = mixinSets[mixinType.pre]\n/**\n * Set of post mixins\n */\nconst postmixins = mixinSets[mixinType.post]\n\n/**\n * Apply any pre and post mixins and return the result.\n * @deprecated\n * @param {*} model - current model\n * @param {*} changes - object containing changes\n * @returns {import('..').Model} updated model\n */\nexport function processUpdate (model, changes) {\n changes[prevmodel] = JSON.parse(JSON.stringify(model)) // keep history\n\n const updates = model[premixins]\n ? compose(...model[premixins].values())(changes)\n : changes\n\n const updated = { ...model, ...updates }\n\n return model[postmixins]\n ? compose(...model[postmixins].values())(updated)\n : updated\n}\n\n/**\n * @deprecated\n * Store mixins for execution on update\n * @param {mixinType} type\n * run before changes are applied or afterward\n * @param {*} o Object containing changes to apply (pre)\n * or new object after changes have been applied (post)\n * @param {string} name `Function.name`\n * @param {functionalMixin} cb mixin function\n */\nexport function updateMixins (type, o, name, cb) {\n if (!mixinSets[type]) {\n throw new Error('invalid mixin type')\n }\n\n const mixinSet = o[mixinSets[type]] || new Map()\n\n if (!mixinSet.has(name)) {\n mixinSet.set(name, cb())\n\n return {\n ...o,\n [mixinSets[type]]: mixinSet\n }\n }\n return o\n}\n\n/**\n * bitmask for identifying events\n */\nconst eventMask = {\n update: 1, // 0001 Update\n create: 1 << 1, // 0010 Create\n onload: 1 << 2 // 0100 Load\n}\n\nfunction handleUpdateEvent (model, updates, event) {\n const isUpdate = eventMask.update & event\n const decrypted = isUpdate ? model.decrypt() : {}\n return {\n ...model,\n ...updates,\n ...decrypted\n }\n}\n\nfunction isObject (p) {\n return p != null && typeof p === 'object'\n}\n\nfunction containsUpdates (model, changes, event) {\n try {\n if (!changes) return false\n if (eventMask.update & event) {\n const changeList = Object.keys(changes)\n if (changeList.length < 1) return false\n\n if (\n changeList.every(\n k => model[k] && util.isDeepStrictEqual(changes[k], model[k])\n )\n ) {\n return false\n }\n }\n return true\n } catch (error) {\n console.error({ fn: containsUpdates.name, error })\n }\n return false\n}\n\n/**\n * Run validation functions enabled for a given event.\n * @param {Model} model - the composed object\n * @param {*} changes - object containing changes\n * @param {Number} event - Indicates what event is occuring:\n * 1st bit turned on means update, 2nd bit create, 3rd load,\n * see {@link eventMask}.\n */\nexport function validateModel (model, changes, event) {\n if (!model || !changes || !event) return {}\n // if there are no changes, and the event is an update, return\n if (!containsUpdates(model, changes, event)) {\n return model\n }\n\n // keep a history of the last saved model\n const input = {\n ...changes,\n [prevmodel]: JSON.parse(JSON.stringify(model || {}))\n }\n\n // Validate just the input data\n const updates = model[validations]\n .filter(v => v.input & event)\n .sort((a, b) => a.order - b.order)\n .map(v => model[v.name].apply(input))\n .reduce((p, c) => ({ ...p, ...c }), input)\n\n const updated = { ...model, ...updates }\n\n // Validate the updated model\n return updated[validations]\n .filter(v => v.output & event)\n .sort((a, b) => a.order - b.order)\n .map(v => updated[v.name]())\n .reduce((p, c) => ({ ...p, ...c }), updated)\n}\n\n/**\n * Enable validation to run on specific events.\n * @param {boolean} onUpdate - whether or not to run the validation on update.\n * Defaults to `true`.\n * @param {boolean} onCreate - whether or not to run the validation on create.\n * Defaults to `true`.\n * @param {boolean} onLoad - whether or not to run the validation when\n * the object is being loaded into memory after being deserialized.\n * Defaults to `false`.\n */\nfunction enableEvent ({ onUpdate = true, onCreate = true, onLoad = false }) {\n let enabled = 0\n\n if (onUpdate) {\n enabled |= eventMask.update\n }\n if (onCreate) {\n enabled |= eventMask.create\n }\n if (onLoad) {\n enabled |= eventMask.onload\n }\n return enabled\n}\n\n/**\n * Specify when validations run.\n */\nconst enableValidation = (() => {\n return {\n /**\n * Validation runs on update.\n */\n onUpdate: enableEvent({\n onUpdate: true,\n onCreate: false,\n onLoad: false\n }),\n /**\n * Validation runs on create.\n */\n onCreate: enableEvent({\n onUpdate: false,\n onCreate: true,\n onLoad: false\n }),\n /**\n * Validation runs on both create and update.\n */\n onCreateAndUpdate: enableEvent({\n onUpdate: true,\n onCreate: true,\n onLoad: false\n }),\n /**\n * Validation runs on load.\n */\n onLoad: enableEvent({\n onUpdate: false,\n onCreate: false,\n onLoad: true\n }),\n /**\n * Validation runs on load and create.\n */\n onLoadAndCreate: enableEvent({\n onUpdate: false,\n onCreate: true,\n onLoad: true\n }),\n /**\n * Validation runs on load and create.\n */\n onLoadAndUpdate: enableEvent({\n onUpdate: true,\n onCreate: false,\n onLoad: true\n }),\n /**\n * Validation runs on all events.\n */\n onAll: enableEvent({\n onUpdate: true,\n onCreate: true,\n onLoad: true\n })\n }\n})()\n\n/**\n * Add a validation function to be called for a given event.\n * @typedef {object} validationConfig\n * @property {*} o - the composed object\n * @property {string} name - name of function to run\n * @property {number} input - \"input\" validations run against\n * the data passed by the caller in the request. Use `enableValidation`\n * to provide a value for this param.\n * @property {number} output - \"output\" functions run against the\n * model after the changes have been applied.\n * @property {number} order - order in which validation runs\n * @param {validationConfig} param0\n */\nfunction addValidation ({ model, name, input = 0, output = 0, order = 50 }) {\n const config = model[validations] || []\n\n if (config.some(v => v.name === name)) {\n console.warn('duplicate validation name', name)\n return model\n }\n\n return {\n ...model,\n validateModel,\n [validations]: [...config, { name, input, output, order }]\n }\n}\n\n/**\n * Resolve keys:\n * If the value includes an array, flatten it, then for each element:\n * If the value is \"*\", return all keys of the object.\n * If the value is a function, execute it to get a dynamic key or key list.\n * If the value is a RegExp, test it to get dynamic key list.\n * If any of the above produce an array of keys, flatten it.\n * @param {*} o - Object to compose\n * @param {Array} propKeys -\n * Names (or functions that return names) of properties\n * @returns {string[]} list of (resolved) property keys\n */\nfunction parseKeys (o, ...propKeys) {\n if (!propKeys || !o) return null\n const keys = propKeys.flat().map(function (k) {\n if (typeof k === 'function') return k(o)\n if (k instanceof RegExp) return Object.keys(o).filter(key => k.test(key))\n if (k === '*') return Object.keys(o)\n return k\n })\n return keys.flat()\n}\n\n/**\n * Encrypt properties. Properties remain encrypted indefinitely, and\n * must be explicitly decrypted as needed, e.g. reading values in memory,\n * from storage, serializing and sending to an external system.\n * @param {Array} propKeys -\n * Names (or functions that return names) of properties to encrypt\n * @returns {functionalMixin} mixin function\n */\nexport const encryptProperties =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n const encryptProps = obj => {\n return keys\n .map(key => (obj[key] ? { [key]: encrypt(obj[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n\n return {\n encryptProperties () {\n return encryptProps(this)\n },\n\n ...addValidation({\n model: o,\n name: encryptProperties.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 100\n }),\n\n decrypt () {\n return keys\n .map(key => (this[key] ? { [key]: decrypt(this[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }), {})\n }\n }\n }\n\n/**\n * Prevent properties from being modified.\n * Accepts a property name or a function that returns a property name.\n * @param {Array} propKeys - names of properties to freeze\n */\nexport const freezeProperties =\n (...propKeys) =>\n o => {\n const preventUpdates = obj => {\n const keys = parseKeys(obj, ...propKeys)\n\n const mutations = Object.keys(obj).filter(key => keys.includes(key))\n if (mutations?.length > 0) {\n throw new Error(`cannot update readonly properties: ${mutations}`)\n }\n }\n\n return {\n freezeProperties () {\n preventUpdates(this)\n },\n\n ...addValidation({\n model: o,\n name: freezeProperties.name,\n input: enableValidation.onUpdate,\n order: 20\n })\n }\n }\n\n/**\n * Enforce required fields.\n * @param {Array} propKeys -\n * required property key names - can be a function or regex\n * that returns the property key names\n */\nexport const requireProperties =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n function requireProps (obj) {\n const missing = keys.filter(key => key && !obj[key])\n if (missing?.length > 0) {\n throw new Error(`missing required properties: ${missing}`)\n }\n }\n return {\n requireProperties () {\n requireProps(this)\n },\n\n ...addValidation({\n model: o,\n name: requireProperties.name,\n output: enableValidation.onCreateAndUpdate,\n order: 90\n })\n }\n }\n\n/**\n * Hash passwords.\n * @param {*} hash hash algorithm\n * @param {Array} propKeys name of password props\n */\nexport const hashPasswords =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n function hashPwds (obj) {\n return keys\n .map(key => (obj[key] ? { [key]: hash(obj[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n\n return {\n hashPasswords () {\n return hashPwds(this)\n },\n\n ...addValidation({\n model: o,\n name: hashPasswords.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 100\n })\n }\n }\n\nconst internalPropList = []\n\n/**\n * Reject unknown properties in user input. Allow only approved keys.\n * @param {...any} propKeys\n */\nexport const allowProperties =\n (...propKeys) =>\n o => {\n function rejectUnknownProps () {\n const keys = parseKeys(o, ...propKeys)\n const allowList = keys.concat(internalPropList)\n\n const unknownProps = Object.keys(o).filter(\n key => !allowList.includes(key)\n )\n\n if (unknownProps?.length > 0) {\n throw new Error(`invalid properties: ${unknownProps}`)\n }\n }\n\n return {\n rejectUnknownProperties () {\n return rejectUnknownProps(this)\n },\n\n ...addValidation({\n model: o,\n name: rejectUnknownProps.name,\n input: enableValidation.onUpdate,\n order: 10\n })\n }\n }\n\n/**\n * Test regular expressions\n */\nexport const RegEx = {\n email: /^(.+)@(.+){2,}\\.(.+){2,}$/,\n ipv4Address:\n /^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/,\n ipv6Address:\n /^((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}$/,\n phone: /^[1-9]\\d{2}-\\d{3}-\\d{4}/,\n creditCard:\n /^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/,\n ssn: /^(?!666|000|9\\\\d{2})\\\\d{3}-(?!00)\\\\d{2}-(?!0{4})\\\\d{4}$/,\n /**\n * Allow caller to pass a keyword that refers to one of the regex above\n * @param {regexType} expr\n * @param {*} val\n */\n test (expr, val) {\n const _expr =\n Object.keys(this).includes(expr) && this[expr] instanceof RegExp\n ? this[expr]\n : expr\n return _expr.test(val)\n }\n}\n\n/**\n * @callback isValid\n * @param {Object} o - the property owner\n * @param {*} propVal - the property value\n * @returns {boolean} - true if valid\n *\n * @typedef {'email'|'phone'|'ipv4Address'|'ipv6Address'|'creditCard'|'ssn'|RegExp} regexType\n *\n * @typedef {{\n * propKey:string,\n * isValid?:isValid,\n * values?:any[],\n * regex?:regexType,\n * maxlen?:number\n * maxnum?:numbertp\n * typeof?:string\n * unique?:{ encrypted:boolean }\n * }} validation\n */\n\nfunction evaluateUniqueness (v, o, propVal) {\n const compareVal = v.unique.encrypted ? encrypt(propVal) : propVal\n return o.listSync({ [v.propKey]: compareVal }).length < 1\n}\n\n/**\n * Run validation tests\n */\nconst Validator = {\n tests: {\n isValid: (v, o, propVal) => v.isValid(o, propVal),\n values: (v, o, propVal) => v.values.includes(propVal),\n regex: (v, o, propVal) => RegEx.test(v.regex, propVal),\n typeof: (v, o, propVal) => v.typeof === typeof propVal,\n maxnum: (v, o, propVal) => v.maxnum + 1 > propVal,\n maxlen: (v, o, propVal) => v.maxlen + 1 > propVal.length,\n unique: (v, o, propVal) => evaluateUniqueness(v, o, propVal)\n },\n /**\n * Returns true if tests pass.\n * @param {validation} v validation config\n * @param {Object} o object to compose\n * @param {*} propVal value of property to validate\n * @returns {boolean} true if tests pass\n */\n isValid (v, o, propVal) {\n return Object.keys(this.tests).every(key => {\n if (v[key]) {\n // the test `key` is specified, run it\n return this.tests[key](v, o, propVal)\n }\n return true\n })\n }\n}\n\n/**\n * Verify a property value is a member of a list,\n * is unique within a set of model instances,\n * is of a certain length, size or type,\n * matches a regular expression,\n * or satisfies a custom validation function.\n * @param {validation[]} validations\n */\nexport const validateProperties = validations => o => {\n function validate (obj) {\n const invalid = validations.filter(v => {\n const propVal = obj[v.propKey]\n\n if (!propVal) {\n return false\n }\n return !Validator.isValid(v, obj, propVal)\n })\n\n if (invalid?.length > 0) {\n throw new Error(`invalid value for ${[...invalid.map(v => v.propKey)]}`)\n }\n }\n\n return {\n validateProperties () {\n validate(this)\n },\n\n ...addValidation({\n model: o,\n name: validateProperties.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 50\n })\n }\n}\n\n/**\n * @callback updaterFn\n * @param {Object} o\n * @param {*} propVal\n * @returns {Object} object with updated properties\n *\n * @typedef {{\n * propKey: string,\n * update: updaterFn\n * }} updater\n */\n\n/**\n * Respond to property updates by updating addtional (dependent) properties as needed.\n * @param {updater[]} updaters\n */\nexport const updateProperties = updaters => o => {\n function updateProps (obj) {\n const updates = updaters.filter(u => obj[u.propKey])\n\n if (updates?.length > 0) {\n return updates\n .map(u => u.update(o, obj[u.propKey]))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n }\n\n return {\n updateProperties () {\n return updateProps(this)\n },\n\n ...addValidation({\n model: o,\n name: updateProperties.name,\n output: enableValidation.onUpdate,\n order: 30\n })\n }\n}\n\n/**\n * Set a validation that invokes a port. The port must be configured\n * in the `ModelSpecification`.\n * @param {string} fn - name of port (as it appears in the ModelSpec)\n * @param {boolean} onCreate - invoke on create\n * @param {boolean} onUpdate - invoke on update\n * @param {...any} args - pass arguments\n */\nexport const invokePort =\n (fn, onCreate, onUpdate, ...args) =>\n async o => {\n return {\n ...o,\n invokePort () {\n console.log({ func: 'invokePort', fn, args })\n return this[fn](...args).then(o => o)\n },\n\n ...addValidation({\n model: o,\n name: 'invokePort',\n output: enableValidation.onUpdate,\n order: 85\n })\n }\n }\n\n/**\n * Set a validation that calls a model method or provided function.\n * @param {string|function(Model, ...any):Promise} fn - callback function\n * or name of method to executee\n * @param {boolean} onCreate - invoke on create\n * @param {boolean} onUpdate - invoke on update\n * @param {...any} args - pass arguments to the method/function\n * @return {Model}\n */\nexport const execMethod =\n (fn, onCreate, onUpdate, ...args) =>\n async o => {\n const functionType = {\n function: (fn, obj, ...args) => fn(obj, ...args).then(o => o),\n string: (fn, obj, ...args) => obj[fn](...args).then(o => o)\n }\n\n return {\n ...o,\n async execMethod () {\n const model = await functionType[typeof fn](fn, this, ...args)\n return model\n },\n\n ...addValidation({\n model: o,\n name: 'execMethod',\n output: enableValidation.onUpdate,\n order: 40\n })\n }\n }\n\n/**\n * Create a method on a model.\n * @param {*} fn\n * @param {...any} args\n */\nexport const createMethod =\n (fn, ...args) =>\n o => {\n return {\n ...o,\n [fn.name]: () => fn(...args)\n }\n }\n\n/**\n * Check the value of the property before returning its key.\n * @param {*} propKey\n * @param {regexType} expr\n * @returns {function(any):any} dynamic property func\n */\nexport const withValidFormat = (propKey, expr) => o => {\n if (o[propKey] && !RegEx.test(expr, o[propKey])) {\n throw new Error(`invalid ${propKey}`)\n }\n return propKey\n}\n\n/**\n *\n * @param {string} value\n * @param {regexType} expr\n */\nexport const checkFormat = (value, expr) => {\n if (value && !RegEx.test(expr, value)) {\n const x = expr instanceof RegExp ? value : expr\n throw new Error(`${x} invalid`)\n }\n}\n\n/**\n * Implement GDPR encryption requirement across models\n */\nexport const encryptPersonalInfo = encryptProperties(\n /^last.*Name$|^surname$|^family.*Name$/i,\n /^shipping.*Address$/i,\n /^billing.*Address$/i,\n /^home.*Address$/i,\n /email|e-mail/i,\n /^phone$|^home.*phone$/i,\n /^mobile$|^mobile.*number$|^cell.*number$/i,\n /^credit.*Card/i,\n /^cvv$/i,\n /^ssn$|^socialSecurity/i,\n /^encrypted/i\n)\n\n/**\n * Global mixins\n */\nconst GlobalMixins = [encryptPersonalInfo]\n\nexport default GlobalMixins\n","'use strict'\n\nimport crypto from 'crypto'\nimport { nanoid } from 'nanoid'\n\nexport function compose (...funcs) {\n return function (initVal) {\n return funcs.reduceRight((val, func) => func(val), initVal)\n }\n}\n\nexport function composeAsync (...funcs) {\n return function (initVal) {\n return funcs.reduceRight(\n (val, func) => val.then(func),\n Promise.resolve(initVal)\n )\n }\n}\n\n/**\n * @callback pipeFn\n * @param {object} obj - the object to compose\n * @returns {object} - the composed object\n */\n\n/**\n * @param {pipeFn} func\n */\nexport const asyncPipe = (...func) => obj =>\n func.reduce((o, f) => o.then(f), Promise.resolve(obj))\n\nconst passwd = process.env.ENCRYPTION_PWD\nconst algo = 'aes-192-cbc'\nconst key = crypto.scryptSync(String(passwd), 'salt', 24)\nconst iv = Buffer.alloc(16, 0)\n\nexport function encrypt (text) {\n const cipher = crypto.createCipheriv(algo, key, iv)\n let encrypted = cipher.update(text, 'utf8', 'hex')\n encrypted += cipher.final('hex')\n return encrypted\n}\n\nexport function decrypt (cipherText) {\n console.log('decrypt(%s)', cipherText)\n const decipher = crypto.createDecipheriv(algo, key, iv)\n let decrypted = decipher.update(cipherText, 'hex', 'utf8')\n decrypted += decipher.final('utf8')\n return decrypted\n}\n\nexport function hash (data) {\n return crypto\n .createHash('sha1')\n .update(data)\n .digest('hex')\n}\n\nexport function uuid () {\n // return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n // (c ^ (crypto.randomBytes(16)[0] & (15 >> (c / 4)))).toString(16)\n // );\n return nanoid()\n}\n\nexport function makeArray (v) {\n return Array.isArray(v) ? v : [v]\n}\n\nexport function makeObject (prop) {\n if (Array.isArray(prop)) {\n return prop.reduce((p, c) => ({ ...p, ...c }))\n }\n return prop\n}\n\n/**\n *\n * @param {Promise<{\n * ok:()=>any,\n *\n * }} promise\n * @returns\n */\nexport function async (promise) {\n return promise\n .then(result => ({\n ok: true,\n object: result,\n asObject: () => makeObject(result),\n asArray: () => makeArray(result)\n }))\n .catch(error => {\n console.error(error)\n return Promise.resolve({ ok: false, error })\n })\n}\n","'use strict'\n\nimport { Event } from './services/event-service'\n\nexport class EventDispatcher {\n constructor (adapter = Event) {\n this.adapter = adapter\n this.subscriptions = new Map()\n }\n\n registerCallback (topic, callback) {\n if (this.subscriptions.has(topic)) {\n this.subscriptions.get(topic).push(callback)\n return\n }\n this.subscriptions.set(topic, [callback])\n }\n\n async emitEvent (topic, message, method = 'notify') {\n await this.adapter[method](topic, message)\n }\n\n async init (method = 'listen') {\n function emitEvent (topic, message) {\n this.emitEvent(topic, message)\n }\n\n await this.adapter[method](\n /Channel/,\n function ({ topic, message }) {\n if (this.subscriptions.has(topic)) {\n this.subscriptions\n .get(topic)\n .forEach(callback =>\n callback({ message, emitEvent: emitEvent.bind(this) })\n )\n }\n }.bind(this)\n )\n }\n}\n","'use strict'\n\nconst session = require('express-session')\nconst express = require('express')\nconst http = require('http')\nconst WebSocket = require('ws')\nconst { uuid } = require('./domain/util/utils')\nrequire('dotenv').config()\nconst services = require('./service-registry').default\nconst cluster = require('cluster')\nconst fs = require('fs')\nconst _srv_ = require('./services')\n\nconst app = express()\nconst map = new Map()\nconst API_ROOT = '/api'\nconst PORT = 8060\n\nimport axios from 'axios'\n// list the models we expose to host through module federation\nimport { models } from './domain'\nconsole.log(models)\n\n// Run test service endpoints\nservices.init()\n\n// We need the same instance of the session parser in express and\n// WebSocket server.\nconst sessionParser = session({\n saveUninitialized: false,\n secret: '$eCuRiTy',\n resave: false\n})\n\n// Serve static files from the 'public' folder.\napp.use(express.static('public'))\napp.use(express.static('dist')) // remoteEntry.js\napp.use(sessionParser)\napp.use(express.json())\n\napp.post('/login', function (req, res) {\n // \"Log in\" user and set userId to session.\n const id = uuid()\n console.log(`Updating session for user ${id}`)\n req.session.userId = id\n res.send({ result: 'OK', message: 'Session updated' })\n})\n\napp.delete('/logout', function (request, response) {\n const ws = map.get(request.session.userId)\n console.log('Destroying session')\n request.session.destroy(function () {\n if (ws) ws.close()\n response.send({ result: 'OK', message: 'Session destroyed' })\n })\n})\n\napp.get(`${API_ROOT}/fedmonserv`, (req, res) =>\n res.send('Federated Monolith Service')\n)\n\napp.get(`${API_ROOT}/service1`, (req, res) => {\n console.log({ from: req.ip, url: req.originalUrl })\n res.status(200).send({\n from: 'fedmonserv',\n ip: req.ip,\n port: PORT,\n url: req.originalUrl,\n date: new Date().toISOString()\n })\n})\n\n// Create HTTP server\nconst server = http.createServer(app)\nconst wss = new WebSocket.Server({ clientTracking: true, noServer: true })\n\n// Send events emitted from host to any WS clients\napp.post(`${API_ROOT}/publish`, (req, res) => {\n console.log({ event: req.body })\n //handleEvents(req, res);\n wss.clients.forEach(function each (client) {\n if (client.url === req.url) return\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify({ event: req.body }))\n }\n })\n})\n\n// Handle request to upgrade to websocket protocol\nserver.on('upgrade', function (request, socket, head) {\n console.log('Parsing session from request...')\n\n sessionParser(request, {}, () => {\n if (!request.session.userId) {\n socket.destroy()\n return\n }\n console.log('Session is parsed')\n wss.handleUpgrade(request, socket, head, function (ws) {\n wss.emit('connection', ws, request)\n })\n })\n})\n\nwss.on('connection', function (ws, request) {\n const userId = request.session.userId\n map.set(userId, ws)\n\n ws.on('message', function (message) {\n console.log(`Received message ${message} from user ${userId}`)\n })\n\n ws.on('close', function () {\n map.delete(userId)\n })\n})\n\nfunction startServer () {\n server.listen(PORT, function () {\n console.log(`Listening on http://localhost:${PORT}\\n`)\n })\n}\n\nfunction hotReload () {\n const url = process.env.RELOAD_URL || 'http://localhost:8070'\n const auth = /true/i.test(process.env.AUTH_ENABLED)\n const ssl = url.startsWith('https')\n if (auth) {\n const text = fs.readFileSync('./public/token.json', 'utf-8')\n const token = JSON.parse(text)\n axios.defaults.headers.common[\n 'Authorization'\n ] = `bearer ${token.access_token}`\n }\n // setTimeout(() => {\n try {\n if (ssl) {\n const https = require('https')\n const httpsAgent = new https.Agent({\n rejectUnauthorized: false\n })\n axios\n .get(url, { httpsAgent })\n .then(response => console.log(response.data))\n } else {\n axios.get(url).then(response => console.log(response.data))\n }\n } catch (e) {\n console.log(e.message)\n }\n //}, 10000);\n}\n\nstartServer()\n\n// function startHotLoadWorker() {\n// const worker = cluster.fork();\n// const timerId = setTimeout(function (params) {\n// startHotLoadWorker();\n// }, 10000);\n// worker.on(\"message\", msg => {\n// if (msg?.status === \"done\") {\n// clearTimeout(timerId);\n// }\n// });\n//\n\n// if (cluster.isMaster) {\n// cluster.fork();\n// startServer();\n// } else {\n// hotReload();\n// }\n\n// let reloaded = false;\n// let serverRunning = false;\n\n// (async () => {\n// while (!reloaded) {\n// const worker = cluster.fork();\n\n// if (cluster.master) {\n// if (!serverRunning) {\n// startServer();\n// serverRunning = true;\n// }\n// function waitOnHotLoad() {\n// return new Promise(function (resolve) {\n// worker.on(\"message\", msg => {\n// if (msg === \"all good\") {\n// reloading = true;\n// resolve(true);\n// }\n// });\n// });\n// }\n// await waitOnHotLoad();\n\n// await new Promise(r => setTimeout(r, 2000));\n// }\n// }\n// })();\n\n// if (cluster.worker) {\n// hotReload();\n// process.send(\"all good\");\n// }\n","'use strict'\n\nimport { EventDispatcher } from './event-dispatcher'\nimport { uuid } from './domain/util/utils'\n\nexport const Registry = {\n eventNames: {\n shipOrder: 'orderShipped',\n trackShipment: 'outForDelivery',\n verifyDelivery: 'deliveryVerified'\n },\n\n sendEvent ({ emitEvent, topic, eventData, eventSource, eventName }) {\n console.log('Sending event...')\n console.log({ emitEvent, topic, eventData, eventSource, eventName })\n setTimeout(async () => {\n await emitEvent(\n topic,\n JSON.stringify({\n eventData,\n eventName,\n eventTime: new Date().toISOString(),\n eventType: 'commandResponse',\n eventSource: eventSource\n })\n )\n }, 5000)\n },\n\n generateShippingEventData (event, externalId) {\n const trackingId = uuid()\n const shipmentId = trackingId\n const proofOfDelivery = `http://shipping.service.com?proof=${trackingId}`\n const eventData = { externalId }\n if (event.eventName === 'shipOrder') {\n return { ...eventData, shipmentId }\n }\n if (event.eventName === 'trackShipment') {\n return { ...eventData, trackingId, trackingStatus: 'outForDelivery' }\n }\n if (event.eventName === 'verifyDelivery') {\n return { ...eventData, proofOfDelivery }\n }\n },\n\n generateShippingMessage (emitEvent, event, externalId) {\n return {\n emitEvent,\n topic: event.eventData.commandResp,\n eventData: this.generateShippingEventData(event, externalId),\n eventName: this.eventNames[event.eventName],\n eventSource: 'shippingService'\n }\n },\n\n inventoryCallbackFactory () {\n function inventoryCallback ({ message, emitEvent }) {\n const event = JSON.parse(message)\n const warehouseAddress = /*null;*/ '1234 warehouse dr, dock 2'\n const externalId = event.eventData.commandArgs.externalId\n const eventName = /*'outOfStock';*/ 'orderPicked'\n this.sendEvent({\n emitEvent,\n topic: event.eventData.respChannel,\n eventName,\n eventData: { warehouse_addr: warehouseAddress, externalId },\n eventSource: 'inventoryService'\n })\n }\n return inventoryCallback.bind(this)\n },\n\n shippingCallbackFactory () {\n function shippingCallback ({ message, emitEvent }) {\n const event = JSON.parse(message)\n const externalId = event.eventData.commandArgs.externalId\n const _message = this.generateShippingMessage(\n emitEvent,\n event,\n externalId\n )\n this.sendEvent(_message)\n\n if (event.eventName === 'trackShipment') {\n const eventData = {\n ..._message.eventData,\n trackingStatus: 'orderDelivered'\n }\n setTimeout(\n () =>\n this.sendEvent({\n ..._message,\n eventData,\n eventName: 'orderDelivered'\n }),\n 7000\n )\n }\n }\n return shippingCallback.bind(this)\n }\n}\n\nconst dispatcher = new EventDispatcher()\n\ndispatcher.registerCallback(\n 'inventoryChannel',\n Registry.inventoryCallbackFactory()\n)\n\ndispatcher.registerCallback(\n 'shippingChannel',\n Registry.shippingCallbackFactory()\n)\n\nexport default dispatcher\n","'use strict'\n\nconst uuid = require('../domain/util/utils').uuid\nconst SmartyStreetsSDK = require('smartystreets-javascript-sdk')\n\nconst SmartyStreetsCore = SmartyStreetsSDK.core\nconst Lookup = SmartyStreetsSDK.usStreet.Lookup\n\n// for Server-to-server requests, use this code:\nconst disabled = process.env.SMARTY_DISABLED || false\nconst authId = process.env.SMARTY_AUTH_ID\nconst authToken = process.env.SMARTY_AUTH_TOKEN\nconst credentials = new SmartyStreetsCore.StaticCredentials(authId, authToken)\n\nconst client = SmartyStreetsCore.buildClient.usStreet(credentials)\n\n/**\n * @typedef {{function(address):Promise}} Address\n */\nexport const Address = {\n // Documentation for input fields can be found at:\n // https://smartystreets.com/docs/us-street-api#input-fields\n\n async validateAddress (address) {\n console.log(`REAL validating address...${address}`)\n\n if (!address) {\n console.log('no address')\n return\n }\n\n if (disabled) {\n console.log('address service disabled')\n return address\n }\n\n try {\n let lookup = new Lookup()\n lookup.inputId = uuid()\n lookup.street = address\n lookup.maxCandidates = 1\n\n let response\n try {\n response = await client.send(lookup)\n } catch (error) {\n throw new Error(error)\n }\n\n const candidate = response.lookups[0].result[0]\n if (!candidate) {\n throw new Error('invalid address')\n }\n\n const validatedAddress = [\n candidate.deliveryLine1,\n candidate.deliveryLine2,\n candidate.lastLine\n ].join(' ')\n\n console.log(`address: ${validatedAddress}`)\n\n if (!validatedAddress) {\n throw new Error('invalid address')\n }\n return validatedAddress\n } catch (error) {\n console.error(error)\n throw new Error('Address service error', error.message)\n }\n }\n}\n","\"use strict\";\n\n// Build EventBus client for host\nimport { listen, notify } from \"../adapters\";\nimport { Event } from \"./event-service\";\n\nconst _notify = notify(Event);\nconst _listen = listen(Event);\nconst model = { listen: _listen };\n\nexport const EventBus = {\n notify(topic, message) {\n return _notify({ model, args: [topic, message] });\n },\n listen(options) {\n return _listen({ model, args: [options] });\n },\n};\n","\"use strict\";\n\nimport { Kafka } from \"kafkajs\";\n\nconst brokers = process.env.KAFKA_BROKERS || \"localhost:9092\";\nconst topics = new RegExp(process.env.KAFKA_TOPICS) || /Channel/;\nconst groupId = (process.env.KAFKA_GROUP_ID || \"MicroLib\") + process.pid;\n\nconst kafka = new Kafka({\n clientId: \"MicroLib\",\n brokers: brokers.split(\",\"),\n});\n\nconst consumer = kafka.consumer({ groupId });\nconst producer = kafka.producer();\n\n/**\n * @type {import('../adapters/event-adapter')}\n */\nexport const Event = {\n listening: false,\n topics,\n\n /**\n * Implements event consumer service.\n * @param {string|RegExp} topic\n * @param {function({message, topic})} callback\n */\n async listen(topic, callback) {\n try {\n await consumer.connect();\n await consumer.subscribe({ topic, fromBeginning: true });\n this.listening = true;\n await consumer.run({\n eachMessage: async ({ topic, message }) => {\n try {\n callback({\n topic,\n message: message.value.toString(),\n });\n } catch (error) {\n console.error(error);\n }\n },\n });\n } catch (error) {\n console.error(error);\n }\n },\n\n /**\n * Implemements event producer service.\n * @param {string|RegExp} topic\n * @param {string} message\n */\n async notify(topic, message) {\n try {\n await producer.connect();\n await producer.send({\n topic: topic,\n messages: [{ value: message }],\n });\n await producer.disconnect();\n } catch (error) {\n console.error({ func: this.notify.name, error });\n }\n },\n};\n","export * from \"./address-service\";\nexport * from \"./event-service\";\nexport * from \"./inventory-service\";\nexport * from \"./payment-service\";\nexport * from \"./shipping-service\";\nexport * from \"./event-bus\";","'use strict'\n\n// JSON.stringify({\n// eventType: \"Command\",\n// eventTime: new Date().toISOString(),\n// eventSource: \"orderService\",\n// eventData: {\n// replyChannel: \"orderChannel\",\n// commandName: \"pickOrder\",\n// commandArgs: {\n// }\n\n","\"use strict\";\n\n/**\n * @callback authorizePaymentType\n * @param {string} id\n * @param {number} amount\n * @param {string} source_id\n * @param {string} customer_id\n * @param {boolean} [autocomplete]\n * @returns {Promise}\n */\n\n/**\n * @typedef PaymentService\n * @property {authorizePaymentType} authorizePayment\n * @property {function()} completePayment\n * @property {function()} refundPayment\n */\n\n// import { Client, Environment, ApiError } from \"square\";\n\n// const client = new Client({\n// environment: Environment.Sandbox,\n// accessToken: process.env.SQUARE_ACCESS_TOKEN,\n// });\n\nexport const Payment = {\n /**\n * @type {authorizePaymentType}\n * @param {*} id\n * @param {*} amount\n * @param {*} source_id\n * @param {*} customer_id\n * @param {*} autocomplete\n * @param {*} currency\n */\n async authorizePayment(\n id,\n amount,\n source_id,\n customer_id,\n autocomplete = false,\n currency = \"USD\"\n ) {\n const payload = {\n idempotency_key: id,\n amount_money: {\n amount,\n currency,\n },\n source_id,\n autocomplete,\n customer_id,\n location_id: \"XK3DBG77NJBFX\",\n reference_id: \"123456\",\n note: \"Brief description\",\n app_fee_money: {\n amount: 10,\n currency: \"USD\",\n },\n };\n /*\n const bodyAmountMoney = {};\n bodyAmountMoney.amount = 200;\n bodyAmountMoney.currency = \"USD\";\n\n const bodyTipMoney = {};\n bodyTipMoney.amount = 198;\n bodyTipMoney.currency = \"CHF\";\n\n const bodyAppFeeMoney = {};\n bodyAppFeeMoney.amount = 10;\n bodyAppFeeMoney.currency = \"USD\";\n\n const body = {\n sourceId: \"ccof:uIbfJXhXETSP197M3GB\",\n idempotencyKey: \"4935a656-a929-4792-b97c-8848be85c27c\",\n amountMoney: bodyAmountMoney,\n };\n\n body.tipMoney = bodyTipMoney;\n body.appFeeMoney = bodyAppFeeMoney;\n body.delayDuration = \"delay_duration6\";\n body.autocomplete = true;\n body.orderId = \"order_id0\";\n body.customerId = \"VDKXEEKPJN48QDG3BGGFAK05P8\";\n body.locationId = \"XK3DBG77NJBFX\";\n body.referenceId = \"123456\";\n body.note = \"Brief description\";\n\n // try {\n // const {\n // result,\n // ...httpResponse\n // } = await client.paymentsApi.createPayment(body);\n // // Get more response info...\n // // const { statusCode, headers } = httpResponse;\n // } catch (error) {\n // if (error instanceof ApiError) {\n // const errors = error.result;\n // // const { statusCode, headers } = error;\n // }\n // }\n */\n return \"1234\";\n },\n\n /*\n const response ={\n \"payment\": {\n \"id\": \"GQTFp1ZlXdpoW4o6eGiZhbjosiDFf\",\n \"created_at\": \"2019-07-10T13:23:49.154Z\",\n \"updated_at\": \"2019-07-10T13:23:49.446Z\",\n \"amount_money\": {\n \"amount\": 200,\n \"currency\": \"USD\"\n },\n \"app_fee_money\": {\n \"amount\": 10,\n \"currency\": \"USD\"\n },\n \"total_money\": {\n \"amount\": 200,\n \"currency\": \"USD\"\n },\n \"status\": \"COMPLETED\",\n \"source_type\": \"CARD\",\n \"card_details\": {\n \"status\": \"CAPTURED\",\n \"card\": {\n \"card_brand\": \"VISA\",\n \"last_4\": \"1111\",\n \"exp_month\": 7,\n \"exp_year\": 2026,\n \"fingerprint\": \"sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw\",\n \"card_type\": \"DEBIT\",\n \"prepaid_type\": \"PREPAID\",\n \"bin\": \"411111\"\n },\n \"entry_method\": \"ON_FILE\",\n \"cvv_status\": \"CVV_ACCEPTED\",\n \"avs_status\": \"AVS_ACCEPTED\",\n \"auth_result_code\": \"nsAyY2\",\n \"statement_description\": \"SQ *MY MERCHANT\"\n },\n \"location_id\": \"XTI0H92143A39\",\n \"order_id\": \"m2Hr8Hk8A3CTyQQ1k4ynExg92tO3\",\n \"reference_id\": \"123456\",\n \"note\": \"Brief description\",\n \"customer_id\": \"RDX9Z4XTIZR7MRZJUXNY9HUK6I\",\n \"receipt_number\": \"GQTF\",\n \"receipt_url\": \"https://squareup.com/receipt/preview/GQTFp1ZlXdpoW4o6eGiZhbjosiDFf\"\n }\n}\n /*\n{\n \"errors\": [\n {\n \"code\": \"VALUE_EMPTY\",\n \"detail\": \"Field must not be blank\",\n \"field\": \"source_id\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n },\n {\n \"code\": \"VALUE_EMPTY\",\n \"detail\": \"Field must not be blank\",\n \"field\": \"idempotency_key\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n },\n {\n \"code\": \"MISSING_REQUIRED_PARAMETER\",\n \"detail\": \"Field must be set\",\n \"field\": \"amount_money\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n }\n ]\n}\n */\n\n async completePayment(model) {\n console.log(\"REAL completing payment: %s\", model.orderNo);\n return \"1234\";\n },\n\n async refundPayment(model) {\n console.log(\"REAL refunding payment: %s\", model.orderNo);\n },\n};\n","\"use strict\";\n\n/**\n * @typedef {import('../adapters/event-adapter').EventMessage} EventMessage\n */\n\n/**\n * @typedef {import('../adapters/event-adapter').CommandEvent} CommandEvent\n */\n\n/**\n * @callback shipOrder\n * @param {string} shipTo\n * @param {string} shipFrom\n * @param {string} lineItems\n * @param {string} signature\n * @param {string} externalId\n * @param {string} requester\n * @param {string} respondOn\n * @returns {EventMessage}\n */\n\n/**\n * @callback trackShipment\n * @param {string} shipmentId\n * @param {string} externalId\n * @param {string} requester\n * @param {string} respondOn\n * @returns {EventMessage}\n */\n\n/**\n * @typedef {string} functionName\n */\n\n/**\n * @typedef {Object} shippingService formats and parses shipping event messages\n * @property {string} serviceName - programmatic service name in eventSource/Target\n * @property {string} topic - event topic \"shippingChannel\" when sending messasges\n * @property {shipOrder} shipOrder - format event message requesting shipping label and pickup of order\n * @property {trackShipment} trackShipment - report on location/status of parcel\n * @property {function():EventMessage} verifyDelivery - ensure customer recieved parcel\n * @property {function():EventMessage} returnShipment - return to sender if refunding\n * @property {function(functionName,EventMessage):{[key]:string}} getPayload - extract payload\n */\n\nfunction createEventMessage({ requester, service, type, name, id, data }) {\n return {\n eventSource: requester,\n eventTarget: service,\n eventType: type,\n eventName: name,\n eventTime: new Date().getTime(),\n eventUuid: id,\n eventData: data,\n };\n}\n\nfunction createCommandEvent(name, topic, args) {\n return {\n commandName: name,\n commandResp: topic,\n commandArgs: { ...args },\n };\n}\n\n/**\n * Shipping service events\n * @type {shippingService}\n */\nexport const Shipping = {\n serviceName: \"shippingService\",\n topic: \"shippingChannel\",\n\n /**\n *\n * @param {*} param0\n * @returns {shipMessage}\n */\n shipOrder({\n shipTo,\n shipFrom,\n lineItems,\n signature,\n externalId,\n requester,\n respondOn,\n }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.shipOrder.name,\n id: externalId,\n data: createCommandEvent(this.shipOrder.name, respondOn, {\n shipTo,\n shipFrom,\n lineItems,\n signature,\n externalId,\n }),\n });\n },\n\n /**\n *\n * @param {*} param0\n * @returns {EventMessage}\n */\n trackShipment({ externalId, shipmentId, trackingId, requester, respondOn }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.trackShipment.name,\n id: externalId,\n data: createCommandEvent(this.trackShipment.name, respondOn, {\n externalId,\n shipmentId,\n trackingId,\n }),\n });\n },\n\n /**\n *\n * @param {*} param0\n * @returns {EventMessage}\n */\n verifyDelivery({ requester, respondOn, trackingId, externalId }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.verifyDelivery.name,\n id: externalId,\n data: createCommandEvent(this.verifyDelivery.name, respondOn, {\n externalId,\n trackingId,\n }),\n });\n },\n\n returnShipment({ requester, respondOn, shipmentId, externalId }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n id: externalId,\n name: this.returnShipment.name,\n data: createCommandEvent(this.returnShipment, respondOn, {\n shipmentId,\n externalId,\n }),\n });\n },\n\n getPayload(func, event) {\n const payloads = {\n [this.shipOrder.name]: {\n shipmentId: event.eventData.shipmentId,\n },\n [this.trackShipment.name]: {\n trackingId: event.eventData.trackingId,\n trackingStatus: event.eventData.trackingStatus,\n },\n [this.verifyDelivery.name]: {\n proofOfDelivery: event.eventData.proofOfDelivery,\n },\n };\n return payloads[func];\n },\n\n getProperty(event, key) {\n return event.eventData[key];\n },\n};\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar deprecate = require('depd')('body-parser')\n\n/**\n * Cache of loaded parsers.\n * @private\n */\n\nvar parsers = Object.create(null)\n\n/**\n * @typedef Parsers\n * @type {function}\n * @property {function} json\n * @property {function} raw\n * @property {function} text\n * @property {function} urlencoded\n */\n\n/**\n * Module exports.\n * @type {Parsers}\n */\n\nexports = module.exports = deprecate.function(bodyParser,\n 'bodyParser: use individual json/urlencoded middlewares')\n\n/**\n * JSON parser.\n * @public\n */\n\nObject.defineProperty(exports, 'json', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('json')\n})\n\n/**\n * Raw parser.\n * @public\n */\n\nObject.defineProperty(exports, 'raw', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('raw')\n})\n\n/**\n * Text parser.\n * @public\n */\n\nObject.defineProperty(exports, 'text', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('text')\n})\n\n/**\n * URL-encoded parser.\n * @public\n */\n\nObject.defineProperty(exports, 'urlencoded', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('urlencoded')\n})\n\n/**\n * Create a middleware to parse json and urlencoded bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @deprecated\n * @public\n */\n\nfunction bodyParser (options) {\n // use default type for parsers\n var opts = Object.create(options || null, {\n type: {\n configurable: true,\n enumerable: true,\n value: undefined,\n writable: true\n }\n })\n\n var _urlencoded = exports.urlencoded(opts)\n var _json = exports.json(opts)\n\n return function bodyParser (req, res, next) {\n _json(req, res, function (err) {\n if (err) return next(err)\n _urlencoded(req, res, next)\n })\n }\n}\n\n/**\n * Create a getter for loading a parser.\n * @private\n */\n\nfunction createParserGetter (name) {\n return function get () {\n return loadParser(name)\n }\n}\n\n/**\n * Load a parser module.\n * @private\n */\n\nfunction loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = require('http-errors')\nvar destroy = require('destroy')\nvar getBody = require('raw-body')\nvar iconv = require('iconv-lite')\nvar onFinished = require('on-finished')\nvar unpipe = require('unpipe')\nvar zlib = require('zlib')\n\n/**\n * Module exports.\n */\n\nmodule.exports = read\n\n/**\n * Read a request into a buffer and parse.\n *\n * @param {object} req\n * @param {object} res\n * @param {function} next\n * @param {function} parse\n * @param {function} debug\n * @param {object} options\n * @private\n */\n\nfunction read (req, res, next, parse, debug, options) {\n var length\n var opts = options\n var stream\n\n // flag as parsed\n req._body = true\n\n // read options\n var encoding = opts.encoding !== null\n ? opts.encoding\n : null\n var verify = opts.verify\n\n try {\n // get the content stream\n stream = contentstream(req, debug, opts.inflate)\n length = stream.length\n stream.length = undefined\n } catch (err) {\n return next(err)\n }\n\n // set raw-body options\n opts.length = length\n opts.encoding = verify\n ? null\n : encoding\n\n // assert charset is supported\n if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {\n return next(createError(415, 'unsupported charset \"' + encoding.toUpperCase() + '\"', {\n charset: encoding.toLowerCase(),\n type: 'charset.unsupported'\n }))\n }\n\n // read body\n debug('read body')\n getBody(stream, opts, function (error, body) {\n if (error) {\n var _error\n\n if (error.type === 'encoding.unsupported') {\n // echo back charset\n _error = createError(415, 'unsupported charset \"' + encoding.toUpperCase() + '\"', {\n charset: encoding.toLowerCase(),\n type: 'charset.unsupported'\n })\n } else {\n // set status code on error\n _error = createError(400, error)\n }\n\n // unpipe from stream and destroy\n if (stream !== req) {\n unpipe(req)\n destroy(stream, true)\n }\n\n // read off entire request\n dump(req, function onfinished () {\n next(createError(400, _error))\n })\n return\n }\n\n // verify\n if (verify) {\n try {\n debug('verify body')\n verify(req, res, body, encoding)\n } catch (err) {\n next(createError(403, err, {\n body: body,\n type: err.type || 'entity.verify.failed'\n }))\n return\n }\n }\n\n // parse\n var str = body\n try {\n debug('parse body')\n str = typeof body !== 'string' && encoding !== null\n ? iconv.decode(body, encoding)\n : body\n req.body = parse(str)\n } catch (err) {\n next(createError(400, err, {\n body: str,\n type: err.type || 'entity.parse.failed'\n }))\n return\n }\n\n next()\n })\n}\n\n/**\n * Get the content stream of the request.\n *\n * @param {object} req\n * @param {function} debug\n * @param {boolean} [inflate=true]\n * @return {object}\n * @api private\n */\n\nfunction contentstream (req, debug, inflate) {\n var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()\n var length = req.headers['content-length']\n var stream\n\n debug('content-encoding \"%s\"', encoding)\n\n if (inflate === false && encoding !== 'identity') {\n throw createError(415, 'content encoding unsupported', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n\n switch (encoding) {\n case 'deflate':\n stream = zlib.createInflate()\n debug('inflate body')\n req.pipe(stream)\n break\n case 'gzip':\n stream = zlib.createGunzip()\n debug('gunzip body')\n req.pipe(stream)\n break\n case 'identity':\n stream = req\n stream.length = length\n break\n default:\n throw createError(415, 'unsupported content encoding \"' + encoding + '\"', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n\n return stream\n}\n\n/**\n * Dump the contents of a request.\n *\n * @param {object} req\n * @param {function} callback\n * @api private\n */\n\nfunction dump (req, callback) {\n if (onFinished.isFinished(req)) {\n callback(null)\n } else {\n onFinished(req, callback)\n req.resume()\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar createError = require('http-errors')\nvar debug = require('debug')('body-parser:json')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = json\n\n/**\n * RegExp to match the first non-space in a string.\n *\n * Allowed whitespace is defined in RFC 7159:\n *\n * ws = *(\n * %x20 / ; Space\n * %x09 / ; Horizontal tab\n * %x0A / ; Line feed or New line\n * %x0D ) ; Carriage return\n */\n\nvar FIRST_CHAR_REGEXP = /^[\\x20\\x09\\x0a\\x0d]*([^\\x20\\x09\\x0a\\x0d])/ // eslint-disable-line no-control-regex\n\n/**\n * Create a middleware to parse JSON bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction json (options) {\n var opts = options || {}\n\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var inflate = opts.inflate !== false\n var reviver = opts.reviver\n var strict = opts.strict !== false\n var type = opts.type || 'application/json'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (body) {\n if (body.length === 0) {\n // special-case empty json body, as it's a common client-side mistake\n // TODO: maybe make this configurable or part of \"strict\" option\n return {}\n }\n\n if (strict) {\n var first = firstchar(body)\n\n if (first !== '{' && first !== '[') {\n debug('strict violation')\n throw createStrictSyntaxError(body, first)\n }\n }\n\n try {\n debug('parse json')\n return JSON.parse(body, reviver)\n } catch (e) {\n throw normalizeJsonSyntaxError(e, {\n message: e.message,\n stack: e.stack\n })\n }\n }\n\n return function jsonParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // assert charset per RFC 7159 sec 8.1\n var charset = getCharset(req) || 'utf-8'\n if (charset.slice(0, 4) !== 'utf-') {\n debug('invalid charset')\n next(createError(415, 'unsupported charset \"' + charset.toUpperCase() + '\"', {\n charset: charset,\n type: 'charset.unsupported'\n }))\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Create strict violation syntax error matching native error.\n *\n * @param {string} str\n * @param {string} char\n * @return {Error}\n * @private\n */\n\nfunction createStrictSyntaxError (str, char) {\n var index = str.indexOf(char)\n var partial = index !== -1\n ? str.substring(0, index) + '#'\n : ''\n\n try {\n JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')\n } catch (e) {\n return normalizeJsonSyntaxError(e, {\n message: e.message.replace('#', char),\n stack: e.stack\n })\n }\n}\n\n/**\n * Get the first non-whitespace character in a string.\n *\n * @param {string} str\n * @return {function}\n * @private\n */\n\nfunction firstchar (str) {\n var match = FIRST_CHAR_REGEXP.exec(str)\n\n return match\n ? match[1]\n : undefined\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Normalize a SyntaxError for JSON.parse.\n *\n * @param {SyntaxError} error\n * @param {object} obj\n * @return {SyntaxError}\n */\n\nfunction normalizeJsonSyntaxError (error, obj) {\n var keys = Object.getOwnPropertyNames(error)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key !== 'stack' && key !== 'message') {\n delete error[key]\n }\n }\n\n // replace stack before message for Node.js 0.10 and below\n error.stack = obj.stack.replace(error.message, obj.message)\n error.message = obj.message\n\n return error\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n */\n\nvar bytes = require('bytes')\nvar debug = require('debug')('body-parser:raw')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = raw\n\n/**\n * Create a middleware to parse raw bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @api public\n */\n\nfunction raw (options) {\n var opts = options || {}\n\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'application/octet-stream'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (buf) {\n return buf\n }\n\n return function rawParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n encoding: null,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar debug = require('debug')('body-parser:text')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = text\n\n/**\n * Create a middleware to parse text bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @api public\n */\n\nfunction text (options) {\n var opts = options || {}\n\n var defaultCharset = opts.defaultCharset || 'utf-8'\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'text/plain'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (buf) {\n return buf\n }\n\n return function textParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // get charset\n var charset = getCharset(req) || defaultCharset\n\n // read\n read(req, res, next, parse, debug, {\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar createError = require('http-errors')\nvar debug = require('debug')('body-parser:urlencoded')\nvar deprecate = require('depd')('body-parser')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = urlencoded\n\n/**\n * Cache of parser modules.\n */\n\nvar parsers = Object.create(null)\n\n/**\n * Create a middleware to parse urlencoded bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction urlencoded (options) {\n var opts = options || {}\n\n // notice because option default will flip in next major\n if (opts.extended === undefined) {\n deprecate('undefined extended: provide extended option')\n }\n\n var extended = opts.extended !== false\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'application/x-www-form-urlencoded'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate query parser\n var queryparse = extended\n ? extendedparser(opts)\n : simpleparser(opts)\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (body) {\n return body.length\n ? queryparse(body)\n : {}\n }\n\n return function urlencodedParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // assert charset\n var charset = getCharset(req) || 'utf-8'\n if (charset !== 'utf-8') {\n debug('invalid charset')\n next(createError(415, 'unsupported charset \"' + charset.toUpperCase() + '\"', {\n charset: charset,\n type: 'charset.unsupported'\n }))\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n debug: debug,\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the extended query parser.\n *\n * @param {object} options\n */\n\nfunction extendedparser (options) {\n var parameterLimit = options.parameterLimit !== undefined\n ? options.parameterLimit\n : 1000\n var parse = parser('qs')\n\n if (isNaN(parameterLimit) || parameterLimit < 1) {\n throw new TypeError('option parameterLimit must be a positive number')\n }\n\n if (isFinite(parameterLimit)) {\n parameterLimit = parameterLimit | 0\n }\n\n return function queryparse (body) {\n var paramCount = parameterCount(body, parameterLimit)\n\n if (paramCount === undefined) {\n debug('too many parameters')\n throw createError(413, 'too many parameters', {\n type: 'parameters.too.many'\n })\n }\n\n var arrayLimit = Math.max(100, paramCount)\n\n debug('parse extended urlencoding')\n return parse(body, {\n allowPrototypes: true,\n arrayLimit: arrayLimit,\n depth: Infinity,\n parameterLimit: parameterLimit\n })\n }\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Count the number of parameters, stopping once limit reached\n *\n * @param {string} body\n * @param {number} limit\n * @api private\n */\n\nfunction parameterCount (body, limit) {\n var count = 0\n var index = 0\n\n while ((index = body.indexOf('&', index)) !== -1) {\n count++\n index++\n\n if (count === limit) {\n return undefined\n }\n }\n\n return count\n}\n\n/**\n * Get parser for module name dynamically.\n *\n * @param {string} name\n * @return {function}\n * @api private\n */\n\nfunction parser (name) {\n var mod = parsers[name]\n\n if (mod !== undefined) {\n return mod.parse\n }\n\n // this uses a switch for static require analysis\n switch (name) {\n case 'qs':\n mod = require('qs')\n break\n case 'querystring':\n mod = require('querystring')\n break\n }\n\n // store to prevent invoking require()\n parsers[name] = mod\n\n return mod.parse\n}\n\n/**\n * Get the simple query parser.\n *\n * @param {object} options\n */\n\nfunction simpleparser (options) {\n var parameterLimit = options.parameterLimit !== undefined\n ? options.parameterLimit\n : 1000\n var parse = parser('querystring')\n\n if (isNaN(parameterLimit) || parameterLimit < 1) {\n throw new TypeError('option parameterLimit must be a positive number')\n }\n\n if (isFinite(parameterLimit)) {\n parameterLimit = parameterLimit | 0\n }\n\n return function queryparse (body) {\n var paramCount = parameterCount(body, parameterLimit)\n\n if (paramCount === undefined) {\n debug('too many parameters')\n throw createError(413, 'too many parameters', {\n type: 'parameters.too.many'\n })\n }\n\n debug('parse urlencoding')\n return parse(body, undefined, undefined, { maxKeys: parameterLimit })\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","'use strict';\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nconst mask = (source, mask, output, offset, length) => {\n for (var i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n};\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nconst unmask = (buffer, mask) => {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (var i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n};\n\nmodule.exports = { mask, unmask };\n","'use strict';\n\ntry {\n module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n module.exports = require('./fallback');\n}\n","/*!\n * bytes\n * Copyright(c) 2012-2014 TJ Holowaychuk\n * Copyright(c) 2015 Jed Watson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = bytes;\nmodule.exports.format = format;\nmodule.exports.parse = parse;\n\n/**\n * Module variables.\n * @private\n */\n\nvar formatThousandsRegExp = /\\B(?=(\\d{3})+(?!\\d))/g;\n\nvar formatDecimalsRegExp = /(?:\\.0*|(\\.[^0]+)0+)$/;\n\nvar map = {\n b: 1,\n kb: 1 << 10,\n mb: 1 << 20,\n gb: 1 << 30,\n tb: Math.pow(1024, 4),\n pb: Math.pow(1024, 5),\n};\n\nvar parseRegExp = /^((-|\\+)?(\\d+(?:\\.\\d+)?)) *(kb|mb|gb|tb|pb)$/i;\n\n/**\n * Convert the given value in bytes into a string or parse to string to an integer in bytes.\n *\n * @param {string|number} value\n * @param {{\n * case: [string],\n * decimalPlaces: [number]\n * fixedDecimals: [boolean]\n * thousandsSeparator: [string]\n * unitSeparator: [string]\n * }} [options] bytes options.\n *\n * @returns {string|number|null}\n */\n\nfunction bytes(value, options) {\n if (typeof value === 'string') {\n return parse(value);\n }\n\n if (typeof value === 'number') {\n return format(value, options);\n }\n\n return null;\n}\n\n/**\n * Format the given value in bytes into a string.\n *\n * If the value is negative, it is kept as such. If it is a float,\n * it is rounded.\n *\n * @param {number} value\n * @param {object} [options]\n * @param {number} [options.decimalPlaces=2]\n * @param {number} [options.fixedDecimals=false]\n * @param {string} [options.thousandsSeparator=]\n * @param {string} [options.unit=]\n * @param {string} [options.unitSeparator=]\n *\n * @returns {string|null}\n * @public\n */\n\nfunction format(value, options) {\n if (!Number.isFinite(value)) {\n return null;\n }\n\n var mag = Math.abs(value);\n var thousandsSeparator = (options && options.thousandsSeparator) || '';\n var unitSeparator = (options && options.unitSeparator) || '';\n var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;\n var fixedDecimals = Boolean(options && options.fixedDecimals);\n var unit = (options && options.unit) || '';\n\n if (!unit || !map[unit.toLowerCase()]) {\n if (mag >= map.pb) {\n unit = 'PB';\n } else if (mag >= map.tb) {\n unit = 'TB';\n } else if (mag >= map.gb) {\n unit = 'GB';\n } else if (mag >= map.mb) {\n unit = 'MB';\n } else if (mag >= map.kb) {\n unit = 'KB';\n } else {\n unit = 'B';\n }\n }\n\n var val = value / map[unit.toLowerCase()];\n var str = val.toFixed(decimalPlaces);\n\n if (!fixedDecimals) {\n str = str.replace(formatDecimalsRegExp, '$1');\n }\n\n if (thousandsSeparator) {\n str = str.split('.').map(function (s, i) {\n return i === 0\n ? s.replace(formatThousandsRegExp, thousandsSeparator)\n : s\n }).join('.');\n }\n\n return str + unitSeparator + unit;\n}\n\n/**\n * Parse the string value into an integer in bytes.\n *\n * If no unit is given, it is assumed the value is in bytes.\n *\n * @param {number|string} val\n *\n * @returns {number|null}\n * @public\n */\n\nfunction parse(val) {\n if (typeof val === 'number' && !isNaN(val)) {\n return val;\n }\n\n if (typeof val !== 'string') {\n return null;\n }\n\n // Test if the string passed is valid\n var results = parseRegExp.exec(val);\n var floatValue;\n var unit = 'b';\n\n if (!results) {\n // Nothing could be extracted from the given string\n floatValue = parseInt(val, 10);\n unit = 'b'\n } else {\n // Retrieve the value and the unit\n floatValue = parseFloat(results[1]);\n unit = results[4].toLowerCase();\n }\n\n if (isNaN(floatValue)) {\n return null;\n }\n\n return Math.floor(map[unit] * floatValue);\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","/*!\n * content-disposition\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = contentDisposition\nmodule.exports.parse = parse\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar basename = require('path').basename\nvar Buffer = require('safe-buffer').Buffer\n\n/**\n * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including \"%\")\n * @private\n */\n\nvar ENCODE_URL_ATTR_CHAR_REGEXP = /[\\x00-\\x20\"'()*,/:;<=>?@[\\\\\\]{}\\x7f]/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match percent encoding escape.\n * @private\n */\n\nvar HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/\nvar HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g\n\n/**\n * RegExp to match non-latin1 characters.\n * @private\n */\n\nvar NON_LATIN1_REGEXP = /[^\\x20-\\x7e\\xa0-\\xff]/g\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * @private\n */\n\nvar QESC_REGEXP = /\\\\([\\u0000-\\u007f])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n * @private\n */\n\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp for various RFC 2616 grammar\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = >\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * TEXT = \n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = \n * LF = \n * SP = \n * HT = \n * CTL = \n * OCTET = \n * @private\n */\n\nvar PARAM_REGEXP = /;[\\x09\\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*=[\\x09\\x20]*(\"(?:[\\x20!\\x23-\\x5b\\x5d-\\x7e\\x80-\\xff]|\\\\[\\x20-\\x7e])*\"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*/g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\x20-\\x7e\\x80-\\xff]+$/\nvar TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/\n\n/**\n * RegExp for various RFC 5987 grammar\n *\n * ext-value = charset \"'\" [ language ] \"'\" value-chars\n * charset = \"UTF-8\" / \"ISO-8859-1\" / mime-charset\n * mime-charset = 1*mime-charsetc\n * mime-charsetc = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"%\" / \"&\"\n * / \"+\" / \"-\" / \"^\" / \"_\" / \"`\"\n * / \"{\" / \"}\" / \"~\"\n * language = ( 2*3ALPHA [ extlang ] )\n * / 4ALPHA\n * / 5*8ALPHA\n * extlang = *3( \"-\" 3ALPHA )\n * value-chars = *( pct-encoded / attr-char )\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * attr-char = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"&\" / \"+\" / \"-\" / \".\"\n * / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * @private\n */\n\nvar EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/\n\n/**\n * RegExp for various RFC 6266 grammar\n *\n * disposition-type = \"inline\" | \"attachment\" | disp-ext-type\n * disp-ext-type = token\n * disposition-parm = filename-parm | disp-ext-parm\n * filename-parm = \"filename\" \"=\" value\n * | \"filename*\" \"=\" ext-value\n * disp-ext-parm = token \"=\" value\n * | ext-token \"=\" ext-value\n * ext-token = \n * @private\n */\n\nvar DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*(?:$|;)/ // eslint-disable-line no-control-regex\n\n/**\n * Create an attachment Content-Disposition header.\n *\n * @param {string} [filename]\n * @param {object} [options]\n * @param {string} [options.type=attachment]\n * @param {string|boolean} [options.fallback=true]\n * @return {string}\n * @public\n */\n\nfunction contentDisposition (filename, options) {\n var opts = options || {}\n\n // get type\n var type = opts.type || 'attachment'\n\n // get parameters\n var params = createparams(filename, opts.fallback)\n\n // format into string\n return format(new ContentDisposition(type, params))\n}\n\n/**\n * Create parameters object from filename and fallback.\n *\n * @param {string} [filename]\n * @param {string|boolean} [fallback=true]\n * @return {object}\n * @private\n */\n\nfunction createparams (filename, fallback) {\n if (filename === undefined) {\n return\n }\n\n var params = {}\n\n if (typeof filename !== 'string') {\n throw new TypeError('filename must be a string')\n }\n\n // fallback defaults to true\n if (fallback === undefined) {\n fallback = true\n }\n\n if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {\n throw new TypeError('fallback must be a string or boolean')\n }\n\n if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {\n throw new TypeError('fallback must be ISO-8859-1 string')\n }\n\n // restrict to file base name\n var name = basename(filename)\n\n // determine if name is suitable for quoted string\n var isQuotedString = TEXT_REGEXP.test(name)\n\n // generate fallback name\n var fallbackName = typeof fallback !== 'string'\n ? fallback && getlatin1(name)\n : basename(fallback)\n var hasFallback = typeof fallbackName === 'string' && fallbackName !== name\n\n // set extended filename parameter\n if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {\n params['filename*'] = name\n }\n\n // set filename parameter\n if (isQuotedString || hasFallback) {\n params.filename = hasFallback\n ? fallbackName\n : name\n }\n\n return params\n}\n\n/**\n * Format object to Content-Disposition header.\n *\n * @param {object} obj\n * @param {string} obj.type\n * @param {object} [obj.parameters]\n * @return {string}\n * @private\n */\n\nfunction format (obj) {\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n // start with normalized type\n var string = String(type).toLowerCase()\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n var val = param.substr(-1) === '*'\n ? ustring(parameters[param])\n : qstring(parameters[param])\n\n string += '; ' + param + '=' + val\n }\n }\n\n return string\n}\n\n/**\n * Decode a RFC 5987 field value (gracefully).\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction decodefield (str) {\n var match = EXT_VALUE_REGEXP.exec(str)\n\n if (!match) {\n throw new TypeError('invalid extended field value')\n }\n\n var charset = match[1].toLowerCase()\n var encoded = match[2]\n var value\n\n // to binary string\n var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode)\n\n switch (charset) {\n case 'iso-8859-1':\n value = getlatin1(binary)\n break\n case 'utf-8':\n value = Buffer.from(binary, 'binary').toString('utf8')\n break\n default:\n throw new TypeError('unsupported charset in extended field')\n }\n\n return value\n}\n\n/**\n * Get ISO-8859-1 version of string.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction getlatin1 (val) {\n // simple Unicode -> ISO-8859-1 transformation\n return String(val).replace(NON_LATIN1_REGEXP, '?')\n}\n\n/**\n * Parse Content-Disposition header string.\n *\n * @param {string} string\n * @return {object}\n * @public\n */\n\nfunction parse (string) {\n if (!string || typeof string !== 'string') {\n throw new TypeError('argument string is required')\n }\n\n var match = DISPOSITION_TYPE_REGEXP.exec(string)\n\n if (!match) {\n throw new TypeError('invalid type format')\n }\n\n // normalize type\n var index = match[0].length\n var type = match[1].toLowerCase()\n\n var key\n var names = []\n var params = {}\n var value\n\n // calculate index to start at\n index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';'\n ? index - 1\n : index\n\n // match parameters\n while ((match = PARAM_REGEXP.exec(string))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (names.indexOf(key) !== -1) {\n throw new TypeError('invalid duplicate parameter')\n }\n\n names.push(key)\n\n if (key.indexOf('*') + 1 === key.length) {\n // decode extended value\n key = key.slice(0, -1)\n value = decodefield(value)\n\n // overwrite existing value\n params[key] = value\n continue\n }\n\n if (typeof params[key] === 'string') {\n continue\n }\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .substr(1, value.length - 2)\n .replace(QESC_REGEXP, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n return new ContentDisposition(type, params)\n}\n\n/**\n * Percent decode a single character.\n *\n * @param {string} str\n * @param {string} hex\n * @return {string}\n * @private\n */\n\nfunction pdecode (str, hex) {\n return String.fromCharCode(parseInt(hex, 16))\n}\n\n/**\n * Percent encode a single character.\n *\n * @param {string} char\n * @return {string}\n * @private\n */\n\nfunction pencode (char) {\n return '%' + String(char)\n .charCodeAt(0)\n .toString(16)\n .toUpperCase()\n}\n\n/**\n * Quote a string for HTTP.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Encode a Unicode string for HTTP (RFC 5987).\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction ustring (val) {\n var str = String(val)\n\n // percent encode as UTF-8\n var encoded = encodeURIComponent(str)\n .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)\n\n return 'UTF-8\\'\\'' + encoded\n}\n\n/**\n * Class for parsed Content-Disposition header for v8 optimization\n *\n * @public\n * @param {string} type\n * @param {object} parameters\n * @constructor\n */\n\nfunction ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}\n","/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * RegExp to match *( \";\" parameter ) in RFC 7231 sec 3.1.1.1\n *\n * parameter = token \"=\" ( token / quoted-string )\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n * / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * / DIGIT / ALPHA\n * ; any VCHAR, except delimiters\n * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE\n * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text\n * obs-text = %x80-FF\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n */\nvar PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *(\"(?:[\\u000b\\u0020\\u0021\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u000b\\u0020-\\u00ff])*\"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\u000b\\u0020-\\u007e\\u0080-\\u00ff]+$/ // eslint-disable-line no-control-regex\nvar TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/\n\n/**\n * RegExp to match quoted-pair in RFC 7230 sec 3.2.6\n *\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n * obs-text = %x80-FF\n */\nvar QESC_REGEXP = /\\\\([\\u000b\\u0020-\\u00ff])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6\n */\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp to match type in RFC 7231 sec 3.1.1.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nvar TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/\n\n/**\n * Module exports.\n * @public\n */\n\nexports.format = format\nexports.parse = parse\n\n/**\n * Format object to media type.\n *\n * @param {object} obj\n * @return {string}\n * @public\n */\n\nfunction format (obj) {\n if (!obj || typeof obj !== 'object') {\n throw new TypeError('argument obj is required')\n }\n\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n var string = type\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError('invalid parameter name')\n }\n\n string += '; ' + param + '=' + qstring(parameters[param])\n }\n }\n\n return string\n}\n\n/**\n * Parse media type to object.\n *\n * @param {string|object} string\n * @return {Object}\n * @public\n */\n\nfunction parse (string) {\n if (!string) {\n throw new TypeError('argument string is required')\n }\n\n // support req/res-like objects as argument\n var header = typeof string === 'object'\n ? getcontenttype(string)\n : string\n\n if (typeof header !== 'string') {\n throw new TypeError('argument string is required to be a string')\n }\n\n var index = header.indexOf(';')\n var type = index !== -1\n ? header.slice(0, index).trim()\n : header.trim()\n\n if (!TYPE_REGEXP.test(type)) {\n throw new TypeError('invalid media type')\n }\n\n var obj = new ContentType(type.toLowerCase())\n\n // parse parameters\n if (index !== -1) {\n var key\n var match\n var value\n\n PARAM_REGEXP.lastIndex = index\n\n while ((match = PARAM_REGEXP.exec(header))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value.charCodeAt(0) === 0x22 /* \" */) {\n // remove quotes\n value = value.slice(1, -1)\n\n // remove escapes\n if (value.indexOf('\\\\') !== -1) {\n value = value.replace(QESC_REGEXP, '$1')\n }\n }\n\n obj.parameters[key] = value\n }\n\n if (index !== header.length) {\n throw new TypeError('invalid parameter format')\n }\n }\n\n return obj\n}\n\n/**\n * Get content-type from req/res objects.\n *\n * @param {object}\n * @return {Object}\n * @private\n */\n\nfunction getcontenttype (obj) {\n var header\n\n if (typeof obj.getHeader === 'function') {\n // res-like\n header = obj.getHeader('content-type')\n } else if (typeof obj.headers === 'object') {\n // req-like\n header = obj.headers && obj.headers['content-type']\n }\n\n if (typeof header !== 'string') {\n throw new TypeError('content-type header is missing from object')\n }\n\n return header\n}\n\n/**\n * Quote a string if necessary.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n // no need to quote tokens\n if (TOKEN_REGEXP.test(str)) {\n return str\n }\n\n if (str.length > 0 && !TEXT_REGEXP.test(str)) {\n throw new TypeError('invalid parameter value')\n }\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Class to represent a content type.\n * @private\n */\nfunction ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}\n","/**\n * Module dependencies.\n */\n\nvar crypto = require('crypto');\n\n/**\n * Sign the given `val` with `secret`.\n *\n * @param {String} val\n * @param {String} secret\n * @return {String}\n * @api private\n */\n\nexports.sign = function(val, secret){\n if ('string' != typeof val) throw new TypeError(\"Cookie value must be provided as a string.\");\n if ('string' != typeof secret) throw new TypeError(\"Secret string must be provided.\");\n return val + '.' + crypto\n .createHmac('sha256', secret)\n .update(val)\n .digest('base64')\n .replace(/\\=+$/, '');\n};\n\n/**\n * Unsign and decode the given `val` with `secret`,\n * returning `false` if the signature is invalid.\n *\n * @param {String} val\n * @param {String} secret\n * @return {String|Boolean}\n * @api private\n */\n\nexports.unsign = function(val, secret){\n if ('string' != typeof val) throw new TypeError(\"Signed cookie string must be provided.\");\n if ('string' != typeof secret) throw new TypeError(\"Secret string must be provided.\");\n var str = val.slice(0, val.lastIndexOf('.'))\n , mac = exports.sign(str, secret);\n \n return sha1(mac) == sha1(val) ? str : false;\n};\n\n/**\n * Private\n */\n\nfunction sha1(str){\n return crypto.createHash('sha1').update(str).digest('hex');\n}\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar __toString = Object.prototype.toString\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var dec = opt.decode || decode;\n\n var index = 0\n while (index < str.length) {\n var eqIdx = str.indexOf('=', index)\n\n // no more cookie pairs\n if (eqIdx === -1) {\n break\n }\n\n var endIdx = str.indexOf(';', index)\n\n if (endIdx === -1) {\n endIdx = str.length\n } else if (endIdx < eqIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(';', eqIdx - 1) + 1\n continue\n }\n\n var key = str.slice(index, eqIdx).trim()\n\n // only assign once\n if (undefined === obj[key]) {\n var val = str.slice(eqIdx + 1, endIdx).trim()\n\n // quoted values\n if (val.charCodeAt(0) === 0x22) {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n\n index = endIdx + 1\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n var expires = opt.expires\n\n if (!isDate(expires) || isNaN(expires.valueOf())) {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + expires.toUTCString()\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.priority) {\n var priority = typeof opt.priority === 'string'\n ? opt.priority.toLowerCase()\n : opt.priority\n\n switch (priority) {\n case 'low':\n str += '; Priority=Low'\n break\n case 'medium':\n str += '; Priority=Medium'\n break\n case 'high':\n str += '; Priority=High'\n break\n default:\n throw new TypeError('option priority is invalid')\n }\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n *\n * @param {string} str\n * @returns {string}\n */\n\nfunction decode (str) {\n return str.indexOf('%') !== -1\n ? decodeURIComponent(str)\n : str\n}\n\n/**\n * URL-encode value.\n *\n * @param {string} str\n * @returns {string}\n */\n\nfunction encode (val) {\n return encodeURIComponent(val)\n}\n\n/**\n * Determine if value is a Date.\n *\n * @param {*} val\n * @private\n */\n\nfunction isDate (val) {\n return __toString.call(val) === '[object Date]' ||\n val instanceof Date\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","require('../modules/es6.symbol');\nrequire('../modules/es6.object.create');\nrequire('../modules/es6.object.define-property');\nrequire('../modules/es6.object.define-properties');\nrequire('../modules/es6.object.get-own-property-descriptor');\nrequire('../modules/es6.object.get-prototype-of');\nrequire('../modules/es6.object.keys');\nrequire('../modules/es6.object.get-own-property-names');\nrequire('../modules/es6.object.freeze');\nrequire('../modules/es6.object.seal');\nrequire('../modules/es6.object.prevent-extensions');\nrequire('../modules/es6.object.is-frozen');\nrequire('../modules/es6.object.is-sealed');\nrequire('../modules/es6.object.is-extensible');\nrequire('../modules/es6.object.assign');\nrequire('../modules/es6.object.is');\nrequire('../modules/es6.object.set-prototype-of');\nrequire('../modules/es6.object.to-string');\nrequire('../modules/es6.function.bind');\nrequire('../modules/es6.function.name');\nrequire('../modules/es6.function.has-instance');\nrequire('../modules/es6.parse-int');\nrequire('../modules/es6.parse-float');\nrequire('../modules/es6.number.constructor');\nrequire('../modules/es6.number.to-fixed');\nrequire('../modules/es6.number.to-precision');\nrequire('../modules/es6.number.epsilon');\nrequire('../modules/es6.number.is-finite');\nrequire('../modules/es6.number.is-integer');\nrequire('../modules/es6.number.is-nan');\nrequire('../modules/es6.number.is-safe-integer');\nrequire('../modules/es6.number.max-safe-integer');\nrequire('../modules/es6.number.min-safe-integer');\nrequire('../modules/es6.number.parse-float');\nrequire('../modules/es6.number.parse-int');\nrequire('../modules/es6.math.acosh');\nrequire('../modules/es6.math.asinh');\nrequire('../modules/es6.math.atanh');\nrequire('../modules/es6.math.cbrt');\nrequire('../modules/es6.math.clz32');\nrequire('../modules/es6.math.cosh');\nrequire('../modules/es6.math.expm1');\nrequire('../modules/es6.math.fround');\nrequire('../modules/es6.math.hypot');\nrequire('../modules/es6.math.imul');\nrequire('../modules/es6.math.log10');\nrequire('../modules/es6.math.log1p');\nrequire('../modules/es6.math.log2');\nrequire('../modules/es6.math.sign');\nrequire('../modules/es6.math.sinh');\nrequire('../modules/es6.math.tanh');\nrequire('../modules/es6.math.trunc');\nrequire('../modules/es6.string.from-code-point');\nrequire('../modules/es6.string.raw');\nrequire('../modules/es6.string.trim');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/es6.string.code-point-at');\nrequire('../modules/es6.string.ends-with');\nrequire('../modules/es6.string.includes');\nrequire('../modules/es6.string.repeat');\nrequire('../modules/es6.string.starts-with');\nrequire('../modules/es6.string.anchor');\nrequire('../modules/es6.string.big');\nrequire('../modules/es6.string.blink');\nrequire('../modules/es6.string.bold');\nrequire('../modules/es6.string.fixed');\nrequire('../modules/es6.string.fontcolor');\nrequire('../modules/es6.string.fontsize');\nrequire('../modules/es6.string.italics');\nrequire('../modules/es6.string.link');\nrequire('../modules/es6.string.small');\nrequire('../modules/es6.string.strike');\nrequire('../modules/es6.string.sub');\nrequire('../modules/es6.string.sup');\nrequire('../modules/es6.date.now');\nrequire('../modules/es6.date.to-json');\nrequire('../modules/es6.date.to-iso-string');\nrequire('../modules/es6.date.to-string');\nrequire('../modules/es6.date.to-primitive');\nrequire('../modules/es6.array.is-array');\nrequire('../modules/es6.array.from');\nrequire('../modules/es6.array.of');\nrequire('../modules/es6.array.join');\nrequire('../modules/es6.array.slice');\nrequire('../modules/es6.array.sort');\nrequire('../modules/es6.array.for-each');\nrequire('../modules/es6.array.map');\nrequire('../modules/es6.array.filter');\nrequire('../modules/es6.array.some');\nrequire('../modules/es6.array.every');\nrequire('../modules/es6.array.reduce');\nrequire('../modules/es6.array.reduce-right');\nrequire('../modules/es6.array.index-of');\nrequire('../modules/es6.array.last-index-of');\nrequire('../modules/es6.array.copy-within');\nrequire('../modules/es6.array.fill');\nrequire('../modules/es6.array.find');\nrequire('../modules/es6.array.find-index');\nrequire('../modules/es6.array.species');\nrequire('../modules/es6.array.iterator');\nrequire('../modules/es6.regexp.constructor');\nrequire('../modules/es6.regexp.exec');\nrequire('../modules/es6.regexp.to-string');\nrequire('../modules/es6.regexp.flags');\nrequire('../modules/es6.regexp.match');\nrequire('../modules/es6.regexp.replace');\nrequire('../modules/es6.regexp.search');\nrequire('../modules/es6.regexp.split');\nrequire('../modules/es6.promise');\nrequire('../modules/es6.map');\nrequire('../modules/es6.set');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es6.weak-set');\nrequire('../modules/es6.typed.array-buffer');\nrequire('../modules/es6.typed.data-view');\nrequire('../modules/es6.typed.int8-array');\nrequire('../modules/es6.typed.uint8-array');\nrequire('../modules/es6.typed.uint8-clamped-array');\nrequire('../modules/es6.typed.int16-array');\nrequire('../modules/es6.typed.uint16-array');\nrequire('../modules/es6.typed.int32-array');\nrequire('../modules/es6.typed.uint32-array');\nrequire('../modules/es6.typed.float32-array');\nrequire('../modules/es6.typed.float64-array');\nrequire('../modules/es6.reflect.apply');\nrequire('../modules/es6.reflect.construct');\nrequire('../modules/es6.reflect.define-property');\nrequire('../modules/es6.reflect.delete-property');\nrequire('../modules/es6.reflect.enumerate');\nrequire('../modules/es6.reflect.get');\nrequire('../modules/es6.reflect.get-own-property-descriptor');\nrequire('../modules/es6.reflect.get-prototype-of');\nrequire('../modules/es6.reflect.has');\nrequire('../modules/es6.reflect.is-extensible');\nrequire('../modules/es6.reflect.own-keys');\nrequire('../modules/es6.reflect.prevent-extensions');\nrequire('../modules/es6.reflect.set');\nrequire('../modules/es6.reflect.set-prototype-of');\nmodule.exports = require('../modules/_core');\n","require('../../modules/es7.array.flat-map');\nmodule.exports = require('../../modules/_core').Array.flatMap;\n","require('../../modules/es7.array.includes');\nmodule.exports = require('../../modules/_core').Array.includes;\n","require('../../modules/es7.object.entries');\nmodule.exports = require('../../modules/_core').Object.entries;\n","require('../../modules/es7.object.get-own-property-descriptors');\nmodule.exports = require('../../modules/_core').Object.getOwnPropertyDescriptors;\n","require('../../modules/es7.object.values');\nmodule.exports = require('../../modules/_core').Object.values;\n","'use strict';\nrequire('../../modules/es6.promise');\nrequire('../../modules/es7.promise.finally');\nmodule.exports = require('../../modules/_core').Promise['finally'];\n","require('../../modules/es7.string.pad-end');\nmodule.exports = require('../../modules/_core').String.padEnd;\n","require('../../modules/es7.string.pad-start');\nmodule.exports = require('../../modules/_core').String.padStart;\n","require('../../modules/es7.string.trim-right');\nmodule.exports = require('../../modules/_core').String.trimRight;\n","require('../../modules/es7.string.trim-left');\nmodule.exports = require('../../modules/_core').String.trimLeft;\n","require('../../modules/es7.symbol.async-iterator');\nmodule.exports = require('../../modules/_wks-ext').f('asyncIterator');\n","require('../modules/es7.global');\nmodule.exports = require('../modules/_core').global;\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.G, { global: require('./_global') });\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar at = require('./_string-at')(true);\n\n // `AdvanceStringIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? at(S, index).length : 1);\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n","'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nrequire('./es6.regexp.exec');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\nvar regexpExec = require('./_regexp-exec');\n\nvar SPECIES = wks('species');\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n // #replace needs built-in support for named groups.\n // #match works fine because it just return the exec results, even if it has\n // a \"grops\" property.\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$') !== '7';\n});\n\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {\n // Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length === 2 && result[0] === 'a' && result[1] === 'b';\n})();\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n re.exec = function () { execCalled = true; return null; };\n if (KEY === 'split') {\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n }\n re[SYMBOL]('');\n return !execCalled;\n }) : undefined;\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||\n (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var fns = exec(\n defined,\n SYMBOL,\n ''[KEY],\n function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {\n if (regexp.exec === regexpExec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n }\n );\n var strfn = fns[0];\n var rxfn = fns[1];\n\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","module.exports = require('./_shared')('native-function-to-string', Function.toString);\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = false;\n","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","var DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n","var $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar $toString = require('./_function-to-string');\nvar TO_STRING = 'toString';\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","'use strict';\n\nvar classof = require('./_classof');\nvar builtinExec = RegExp.prototype.exec;\n\n // `RegExpExec` abstract operation\n// https://tc39.github.io/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw new TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n if (classof(R) !== 'RegExp') {\n throw new TypeError('RegExp#exec called on incompatible receiver');\n }\n return builtinExec.call(R, S);\n};\n","'use strict';\n\nvar regexpFlags = require('./_flags');\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar LAST_INDEX = 'lastIndex';\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/,\n re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;\n})();\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + re.source + '$(?!\\\\s)', regexpFlags.call(re));\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];\n\n match = nativeExec.call(re, str);\n\n if (UPDATES_LAST_INDEX_WRONG && match) {\n re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n // eslint-disable-next-line no-loop-func\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","var $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n","module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n","'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n","'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n","// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('./_set-species')('Array');\n","// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n","// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n","var TO_PRIMITIVE = require('./_wks')('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));\n","var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n require('./_redefine')(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n","// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n","'use strict';\nvar isObject = require('./_is-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar HAS_INSTANCE = require('./_wks')('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n","// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n","// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n","// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n","// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n","// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n","// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n","// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n","// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n","// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n","// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n","// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n","'use strict';\nvar global = require('./_global');\nvar has = require('./_has');\nvar cof = require('./_cof');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar toPrimitive = require('./_to-primitive');\nvar fails = require('./_fails');\nvar gOPN = require('./_object-gopn').f;\nvar gOPD = require('./_object-gopd').f;\nvar dP = require('./_object-dp').f;\nvar $trim = require('./_string-trim').trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = require('./_descriptors') ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n require('./_redefine')(global, NUMBER, $Number);\n}\n","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n","'use strict';\nvar $export = require('./_export');\nvar toInteger = require('./_to-integer');\nvar aNumberValue = require('./_a-number-value');\nvar repeat = require('./_string-repeat');\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !require('./_fails')(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $fails = require('./_fails');\nvar aNumberValue = require('./_a-number-value');\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar userAgent = require('./_user-agent');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n","'use strict';\n// 26.1.5 Reflect.enumerate(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\nrequire('./_iter-create')(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n","// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n","// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n","// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n","// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n","var global = require('./_global');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar dP = require('./_object-dp').f;\nvar gOPN = require('./_object-gopn').f;\nvar isRegExp = require('./_is-regexp');\nvar $flags = require('./_flags');\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () {\n re2[require('./_wks')('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n require('./_redefine')(global, 'RegExp', $RegExp);\n}\n\nrequire('./_set-species')('RegExp');\n","'use strict';\nvar regexpExec = require('./_regexp-exec');\nrequire('./_export')({\n target: 'RegExp',\n proto: true,\n forced: regexpExec !== /./.exec\n}, {\n exec: regexpExec\n});\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar advanceStringIndex = require('./_advance-string-index');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match\n function (regexp) {\n var res = maybeCallNative($match, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n if (!rx.global) return regExpExec(rx, S);\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = String(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar toInteger = require('./_to-integer');\nvar advanceStringIndex = require('./_advance-string-index');\nvar regExpExec = require('./_regexp-exec-abstract');\nvar max = Math.max;\nvar min = Math.min;\nvar floor = Math.floor;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&`']|\\d\\d?|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&`']|\\d\\d?)/g;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {\n return [\n // `String.prototype.replace` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace\n function (regexp, replaceValue) {\n var res = maybeCallNative($replace, regexp, this, replaceValue);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = String(replaceValue);\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n results.push(result);\n if (!global) break;\n var matchStr = String(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n var matched = String(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = String(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n\n // https://tc39.github.io/ecma262/#sec-getsubstitution\n function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return $replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n }\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar sameValue = require('./_same-value');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative($search, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","'use strict';\n\nvar isRegExp = require('./_is-regexp');\nvar anObject = require('./_an-object');\nvar speciesConstructor = require('./_species-constructor');\nvar advanceStringIndex = require('./_advance-string-index');\nvar toLength = require('./_to-length');\nvar callRegExpExec = require('./_regexp-exec-abstract');\nvar regexpExec = require('./_regexp-exec');\nvar fails = require('./_fails');\nvar $min = Math.min;\nvar $push = [].push;\nvar $SPLIT = 'split';\nvar LENGTH = 'length';\nvar LAST_INDEX = 'lastIndex';\nvar MAX_UINT32 = 0xffffffff;\n\n// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError\nvar SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });\n\n// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return $split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy[LAST_INDEX];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);\n };\n } else {\n internalSplit = $split;\n }\n\n return [\n // `String.prototype.split` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = defined(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(String(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (regexp, limit) {\n var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (SUPPORTS_Y ? 'y' : 'g');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = SUPPORTS_Y ? q : 0;\n var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));\n var e;\n if (\n z === null ||\n (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","'use strict';\n// B.2.3.2 String.prototype.anchor(name)\nrequire('./_string-html')('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n","'use strict';\n// B.2.3.3 String.prototype.big()\nrequire('./_string-html')('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n","'use strict';\n// B.2.3.4 String.prototype.blink()\nrequire('./_string-html')('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n","'use strict';\n// B.2.3.5 String.prototype.bold()\nrequire('./_string-html')('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","'use strict';\n// B.2.3.6 String.prototype.fixed()\nrequire('./_string-html')('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n","'use strict';\n// B.2.3.7 String.prototype.fontcolor(color)\nrequire('./_string-html')('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n","'use strict';\n// B.2.3.8 String.prototype.fontsize(size)\nrequire('./_string-html')('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\n// B.2.3.9 String.prototype.italics()\nrequire('./_string-html')('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// B.2.3.10 String.prototype.link(url)\nrequire('./_string-html')('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n","'use strict';\n// B.2.3.11 String.prototype.small()\nrequire('./_string-html')('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","'use strict';\n// B.2.3.12 String.prototype.strike()\nrequire('./_string-html')('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n","'use strict';\n// B.2.3.13 String.prototype.sub()\nrequire('./_string-html')('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n","'use strict';\n// B.2.3.14 String.prototype.sup()\nrequire('./_string-html')('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n","'use strict';\n// 21.1.3.25 String.prototype.trim()\nrequire('./_string-trim')('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toObject = require('./_to-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $GOPS = require('./_object-gops');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n","var $export = require('./_export');\n$export($export.G + $export.W + $export.F * !require('./_typed').ABV, {\n DataView: require('./_typed-buffer').DataView\n});\n","require('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","'use strict';\nvar global = require('./_global');\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar validate = require('./_validate-collection');\nvar NATIVE_WEAK_MAP = require('./_validate-collection');\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar aFunction = require('./_a-function');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatMap');\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n","require('./_wks-define')('asyncIterator');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n","// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar userAgent = require('./_user-agent');\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n","require('../modules/web.timers');\nrequire('../modules/web.immediate');\nrequire('../modules/web.dom.iterable');\nmodule.exports = require('../modules/_core');\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/*!\n * depd\n * Copyright(c) 2014-2018 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar relative = require('path').relative\n\n/**\n * Module exports.\n */\n\nmodule.exports = depd\n\n/**\n * Get the path to base files on.\n */\n\nvar basePath = process.cwd()\n\n/**\n * Determine if namespace is contained in the string.\n */\n\nfunction containsNamespace (str, namespace) {\n var vals = str.split(/[ ,]+/)\n var ns = String(namespace).toLowerCase()\n\n for (var i = 0; i < vals.length; i++) {\n var val = vals[i]\n\n // namespace contained\n if (val && (val === '*' || val.toLowerCase() === ns)) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Convert a data descriptor to accessor descriptor.\n */\n\nfunction convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}\n\n/**\n * Create arguments string to keep arity.\n */\n\nfunction createArgumentsString (arity) {\n var str = ''\n\n for (var i = 0; i < arity; i++) {\n str += ', arg' + i\n }\n\n return str.substr(2)\n}\n\n/**\n * Create stack string from stack.\n */\n\nfunction createStackString (stack) {\n var str = this.name + ': ' + this.namespace\n\n if (this.message) {\n str += ' deprecated ' + this.message\n }\n\n for (var i = 0; i < stack.length; i++) {\n str += '\\n at ' + stack[i].toString()\n }\n\n return str\n}\n\n/**\n * Create deprecate for namespace in caller.\n */\n\nfunction depd (namespace) {\n if (!namespace) {\n throw new TypeError('argument namespace is required')\n }\n\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n var file = site[0]\n\n function deprecate (message) {\n // call to self as log\n log.call(deprecate, message)\n }\n\n deprecate._file = file\n deprecate._ignored = isignored(namespace)\n deprecate._namespace = namespace\n deprecate._traced = istraced(namespace)\n deprecate._warned = Object.create(null)\n\n deprecate.function = wrapfunction\n deprecate.property = wrapproperty\n\n return deprecate\n}\n\n/**\n * Determine if event emitter has listeners of a given type.\n *\n * The way to do this check is done three different ways in Node.js >= 0.8\n * so this consolidates them into a minimal set using instance methods.\n *\n * @param {EventEmitter} emitter\n * @param {string} type\n * @returns {boolean}\n * @private\n */\n\nfunction eehaslisteners (emitter, type) {\n var count = typeof emitter.listenerCount !== 'function'\n ? emitter.listeners(type).length\n : emitter.listenerCount(type)\n\n return count > 0\n}\n\n/**\n * Determine if namespace is ignored.\n */\n\nfunction isignored (namespace) {\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}\n\n/**\n * Determine if namespace is traced.\n */\n\nfunction istraced (namespace) {\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = process.env.TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}\n\n/**\n * Display deprecation message.\n */\n\nfunction log (message, site) {\n var haslisteners = eehaslisteners(process, 'deprecation')\n\n // abort early if no destination\n if (!haslisteners && this._ignored) {\n return\n }\n\n var caller\n var callFile\n var callSite\n var depSite\n var i = 0\n var seen = false\n var stack = getStack()\n var file = this._file\n\n if (site) {\n // provided site\n depSite = site\n callSite = callSiteLocation(stack[1])\n callSite.name = depSite.name\n file = callSite[0]\n } else {\n // get call site\n i = 2\n depSite = callSiteLocation(stack[i])\n callSite = depSite\n }\n\n // get caller of deprecated thing in relation to file\n for (; i < stack.length; i++) {\n caller = callSiteLocation(stack[i])\n callFile = caller[0]\n\n if (callFile === file) {\n seen = true\n } else if (callFile === this._file) {\n file = this._file\n } else if (seen) {\n break\n }\n }\n\n var key = caller\n ? depSite.join(':') + '__' + caller.join(':')\n : undefined\n\n if (key !== undefined && key in this._warned) {\n // already warned\n return\n }\n\n this._warned[key] = true\n\n // generate automatic message from call site\n var msg = message\n if (!msg) {\n msg = callSite === depSite || !callSite.name\n ? defaultMessage(depSite)\n : defaultMessage(callSite)\n }\n\n // emit deprecation if listeners exist\n if (haslisteners) {\n var err = DeprecationError(this._namespace, msg, stack.slice(i))\n process.emit('deprecation', err)\n return\n }\n\n // format and write message\n var format = process.stderr.isTTY\n ? formatColor\n : formatPlain\n var output = format.call(this, msg, caller, stack.slice(i))\n process.stderr.write(output + '\\n', 'utf8')\n}\n\n/**\n * Get call site location as array.\n */\n\nfunction callSiteLocation (callSite) {\n var file = callSite.getFileName() || ''\n var line = callSite.getLineNumber()\n var colm = callSite.getColumnNumber()\n\n if (callSite.isEval()) {\n file = callSite.getEvalOrigin() + ', ' + file\n }\n\n var site = [file, line, colm]\n\n site.callSite = callSite\n site.name = callSite.getFunctionName()\n\n return site\n}\n\n/**\n * Generate a default message from the site.\n */\n\nfunction defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = ''\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}\n\n/**\n * Format deprecation message without color.\n */\n\nfunction formatPlain (msg, caller, stack) {\n var timestamp = new Date().toUTCString()\n\n var formatted = timestamp +\n ' ' + this._namespace +\n ' deprecated ' + msg\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n at ' + stack[i].toString()\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' at ' + formatLocation(caller)\n }\n\n return formatted\n}\n\n/**\n * Format deprecation message with color.\n */\n\nfunction formatColor (msg, caller, stack) {\n var formatted = '\\x1b[36;1m' + this._namespace + '\\x1b[22;39m' + // bold cyan\n ' \\x1b[33;1mdeprecated\\x1b[22;39m' + // bold yellow\n ' \\x1b[0m' + msg + '\\x1b[39m' // reset\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n \\x1b[36mat ' + stack[i].toString() + '\\x1b[39m' // cyan\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' \\x1b[36m' + formatLocation(caller) + '\\x1b[39m' // cyan\n }\n\n return formatted\n}\n\n/**\n * Format call site location.\n */\n\nfunction formatLocation (callSite) {\n return relative(basePath, callSite[0]) +\n ':' + callSite[1] +\n ':' + callSite[2]\n}\n\n/**\n * Get the stack as array of call sites.\n */\n\nfunction getStack () {\n var limit = Error.stackTraceLimit\n var obj = {}\n var prep = Error.prepareStackTrace\n\n Error.prepareStackTrace = prepareObjectStackTrace\n Error.stackTraceLimit = Math.max(10, limit)\n\n // capture the stack\n Error.captureStackTrace(obj)\n\n // slice this function off the top\n var stack = obj.stack.slice(1)\n\n Error.prepareStackTrace = prep\n Error.stackTraceLimit = limit\n\n return stack\n}\n\n/**\n * Capture call site stack from v8.\n */\n\nfunction prepareObjectStackTrace (obj, stack) {\n return stack\n}\n\n/**\n * Return a wrapped function in a deprecation message.\n */\n\nfunction wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n var args = createArgumentsString(fn.length)\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n site.name = fn.name\n\n // eslint-disable-next-line no-new-func\n var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',\n '\"use strict\"\\n' +\n 'return function (' + args + ') {' +\n 'log.call(deprecate, message, site)\\n' +\n 'return fn.apply(this, arguments)\\n' +\n '}')(fn, log, this, message, site)\n\n return deprecatedfn\n}\n\n/**\n * Wrap property in a deprecation message.\n */\n\nfunction wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n\n var deprecate = this\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n // set site name\n site.name = prop\n\n // convert data descriptor\n if ('value' in descriptor) {\n descriptor = convertDataDescriptorToAccessor(obj, prop, message)\n }\n\n var get = descriptor.get\n var set = descriptor.set\n\n // wrap getter\n if (typeof get === 'function') {\n descriptor.get = function getter () {\n log.call(deprecate, message, site)\n return get.apply(this, arguments)\n }\n }\n\n // wrap setter\n if (typeof set === 'function') {\n descriptor.set = function setter () {\n log.call(deprecate, message, site)\n return set.apply(this, arguments)\n }\n }\n\n Object.defineProperty(obj, prop, descriptor)\n}\n\n/**\n * Create DeprecationError for deprecation\n */\n\nfunction DeprecationError (namespace, message, stack) {\n var error = new Error()\n var stackString\n\n Object.defineProperty(error, 'constructor', {\n value: DeprecationError\n })\n\n Object.defineProperty(error, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true\n })\n\n Object.defineProperty(error, 'name', {\n enumerable: false,\n configurable: true,\n value: 'DeprecationError',\n writable: true\n })\n\n Object.defineProperty(error, 'namespace', {\n configurable: true,\n enumerable: false,\n value: namespace,\n writable: true\n })\n\n Object.defineProperty(error, 'stack', {\n configurable: true,\n enumerable: false,\n get: function () {\n if (stackString !== undefined) {\n return stackString\n }\n\n // prepare stack trace\n return (stackString = createStackString.call(this, stack))\n },\n set: function setter (val) {\n stackString = val\n }\n })\n\n return error\n}\n","/*!\n * destroy\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar EventEmitter = require('events').EventEmitter\nvar ReadStream = require('fs').ReadStream\nvar Stream = require('stream')\nvar Zlib = require('zlib')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = destroy\n\n/**\n * Destroy the given stream, and optionally suppress any future `error` events.\n *\n * @param {object} stream\n * @param {boolean} suppress\n * @public\n */\n\nfunction destroy (stream, suppress) {\n if (isFsReadStream(stream)) {\n destroyReadStream(stream)\n } else if (isZlibStream(stream)) {\n destroyZlibStream(stream)\n } else if (hasDestroy(stream)) {\n stream.destroy()\n }\n\n if (isEventEmitter(stream) && suppress) {\n stream.removeAllListeners('error')\n stream.addListener('error', noop)\n }\n\n return stream\n}\n\n/**\n * Destroy a ReadStream.\n *\n * @param {object} stream\n * @private\n */\n\nfunction destroyReadStream (stream) {\n stream.destroy()\n\n if (typeof stream.close === 'function') {\n // node.js core bug work-around\n stream.on('open', onOpenClose)\n }\n}\n\n/**\n * Close a Zlib stream.\n *\n * Zlib streams below Node.js 4.5.5 have a buggy implementation\n * of .close() when zlib encountered an error.\n *\n * @param {object} stream\n * @private\n */\n\nfunction closeZlibStream (stream) {\n if (stream._hadError === true) {\n var prop = stream._binding === null\n ? '_binding'\n : '_handle'\n\n stream[prop] = {\n close: function () { this[prop] = null }\n }\n }\n\n stream.close()\n}\n\n/**\n * Destroy a Zlib stream.\n *\n * Zlib streams don't have a destroy function in Node.js 6. On top of that\n * simply calling destroy on a zlib stream in Node.js 8+ will result in a\n * memory leak. So until that is fixed, we need to call both close AND destroy.\n *\n * PR to fix memory leak: https://github.com/nodejs/node/pull/23734\n *\n * In Node.js 6+8, it's important that destroy is called before close as the\n * stream would otherwise emit the error 'zlib binding closed'.\n *\n * @param {object} stream\n * @private\n */\n\nfunction destroyZlibStream (stream) {\n if (typeof stream.destroy === 'function') {\n // node.js core bug work-around\n // istanbul ignore if: node.js 0.8\n if (stream._binding) {\n // node.js < 0.10.0\n stream.destroy()\n if (stream._processing) {\n stream._needDrain = true\n stream.once('drain', onDrainClearBinding)\n } else {\n stream._binding.clear()\n }\n } else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) {\n // node.js >= 12, ^11.1.0, ^10.15.1\n stream.destroy()\n } else if (stream._destroy && typeof stream.close === 'function') {\n // node.js 7, 8\n stream.destroyed = true\n stream.close()\n } else {\n // fallback\n // istanbul ignore next\n stream.destroy()\n }\n } else if (typeof stream.close === 'function') {\n // node.js < 8 fallback\n closeZlibStream(stream)\n }\n}\n\n/**\n * Determine if stream has destroy.\n * @private\n */\n\nfunction hasDestroy (stream) {\n return stream instanceof Stream &&\n typeof stream.destroy === 'function'\n}\n\n/**\n * Determine if val is EventEmitter.\n * @private\n */\n\nfunction isEventEmitter (val) {\n return val instanceof EventEmitter\n}\n\n/**\n * Determine if stream is fs.ReadStream stream.\n * @private\n */\n\nfunction isFsReadStream (stream) {\n return stream instanceof ReadStream\n}\n\n/**\n * Determine if stream is Zlib stream.\n * @private\n */\n\nfunction isZlibStream (stream) {\n return stream instanceof Zlib.Gzip ||\n stream instanceof Zlib.Gunzip ||\n stream instanceof Zlib.Deflate ||\n stream instanceof Zlib.DeflateRaw ||\n stream instanceof Zlib.Inflate ||\n stream instanceof Zlib.InflateRaw ||\n stream instanceof Zlib.Unzip\n}\n\n/**\n * No-op function.\n * @private\n */\n\nfunction noop () {}\n\n/**\n * On drain handler to clear binding.\n * @private\n */\n\n// istanbul ignore next: node.js 0.8\nfunction onDrainClearBinding () {\n this._binding.clear()\n}\n\n/**\n * On open handler to close stream.\n * @private\n */\n\nfunction onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}\n","'use strict'\n\nexports.toString = function (klass) {\n switch (klass) {\n case 1: return 'IN'\n case 2: return 'CS'\n case 3: return 'CH'\n case 4: return 'HS'\n case 255: return 'ANY'\n }\n return 'UNKNOWN_' + klass\n}\n\nexports.toClass = function (name) {\n switch (name.toUpperCase()) {\n case 'IN': return 1\n case 'CS': return 2\n case 'CH': return 3\n case 'HS': return 4\n case 'ANY': return 255\n }\n return 0\n}\n","'use strict'\n\nconst Buffer = require('buffer').Buffer\nconst types = require('./types')\nconst rcodes = require('./rcodes')\nconst opcodes = require('./opcodes')\nconst classes = require('./classes')\nconst optioncodes = require('./optioncodes')\nconst ip = require('@leichtgewicht/ip-codec')\n\nconst QUERY_FLAG = 0\nconst RESPONSE_FLAG = 1 << 15\nconst FLUSH_MASK = 1 << 15\nconst NOT_FLUSH_MASK = ~FLUSH_MASK\nconst QU_MASK = 1 << 15\nconst NOT_QU_MASK = ~QU_MASK\n\nconst name = exports.name = {}\n\nname.encode = function (str, buf, offset) {\n if (!buf) buf = Buffer.alloc(name.encodingLength(str))\n if (!offset) offset = 0\n const oldOffset = offset\n\n // strip leading and trailing .\n const n = str.replace(/^\\.|\\.$/gm, '')\n if (n.length) {\n const list = n.split('.')\n\n for (let i = 0; i < list.length; i++) {\n const len = buf.write(list[i], offset + 1)\n buf[offset] = len\n offset += len + 1\n }\n }\n\n buf[offset++] = 0\n\n name.encode.bytes = offset - oldOffset\n return buf\n}\n\nname.encode.bytes = 0\n\nname.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const list = []\n let oldOffset = offset\n let totalLength = 0\n let consumedBytes = 0\n let jumped = false\n\n while (true) {\n if (offset >= buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n const len = buf[offset++]\n consumedBytes += jumped ? 0 : 1\n\n if (len === 0) {\n break\n } else if ((len & 0xc0) === 0) {\n if (offset + len > buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n totalLength += len + 1\n if (totalLength > 254) {\n throw new Error('Cannot decode name (name too long)')\n }\n list.push(buf.toString('utf-8', offset, offset + len))\n offset += len\n consumedBytes += jumped ? 0 : len\n } else if ((len & 0xc0) === 0xc0) {\n if (offset + 1 > buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n const jumpOffset = buf.readUInt16BE(offset - 1) - 0xc000\n if (jumpOffset >= oldOffset) {\n // Allow only pointers to prior data. RFC 1035, section 4.1.4 states:\n // \"[...] an entire domain name or a list of labels at the end of a domain name\n // is replaced with a pointer to a prior occurance (sic) of the same name.\"\n throw new Error('Cannot decode name (bad pointer)')\n }\n offset = jumpOffset\n oldOffset = jumpOffset\n consumedBytes += jumped ? 0 : 1\n jumped = true\n } else {\n throw new Error('Cannot decode name (bad label)')\n }\n }\n\n name.decode.bytes = consumedBytes\n return list.length === 0 ? '.' : list.join('.')\n}\n\nname.decode.bytes = 0\n\nname.encodingLength = function (n) {\n if (n === '.' || n === '..') return 1\n return Buffer.byteLength(n.replace(/^\\.|\\.$/gm, '')) + 2\n}\n\nconst string = {}\n\nstring.encode = function (s, buf, offset) {\n if (!buf) buf = Buffer.alloc(string.encodingLength(s))\n if (!offset) offset = 0\n\n const len = buf.write(s, offset + 1)\n buf[offset] = len\n string.encode.bytes = len + 1\n return buf\n}\n\nstring.encode.bytes = 0\n\nstring.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf[offset]\n const s = buf.toString('utf-8', offset + 1, offset + 1 + len)\n string.decode.bytes = len + 1\n return s\n}\n\nstring.decode.bytes = 0\n\nstring.encodingLength = function (s) {\n return Buffer.byteLength(s) + 1\n}\n\nconst header = {}\n\nheader.encode = function (h, buf, offset) {\n if (!buf) buf = header.encodingLength(h)\n if (!offset) offset = 0\n\n const flags = (h.flags || 0) & 32767\n const type = h.type === 'response' ? RESPONSE_FLAG : QUERY_FLAG\n\n buf.writeUInt16BE(h.id || 0, offset)\n buf.writeUInt16BE(flags | type, offset + 2)\n buf.writeUInt16BE(h.questions.length, offset + 4)\n buf.writeUInt16BE(h.answers.length, offset + 6)\n buf.writeUInt16BE(h.authorities.length, offset + 8)\n buf.writeUInt16BE(h.additionals.length, offset + 10)\n\n return buf\n}\n\nheader.encode.bytes = 12\n\nheader.decode = function (buf, offset) {\n if (!offset) offset = 0\n if (buf.length < 12) throw new Error('Header must be 12 bytes')\n const flags = buf.readUInt16BE(offset + 2)\n\n return {\n id: buf.readUInt16BE(offset),\n type: flags & RESPONSE_FLAG ? 'response' : 'query',\n flags: flags & 32767,\n flag_qr: ((flags >> 15) & 0x1) === 1,\n opcode: opcodes.toString((flags >> 11) & 0xf),\n flag_aa: ((flags >> 10) & 0x1) === 1,\n flag_tc: ((flags >> 9) & 0x1) === 1,\n flag_rd: ((flags >> 8) & 0x1) === 1,\n flag_ra: ((flags >> 7) & 0x1) === 1,\n flag_z: ((flags >> 6) & 0x1) === 1,\n flag_ad: ((flags >> 5) & 0x1) === 1,\n flag_cd: ((flags >> 4) & 0x1) === 1,\n rcode: rcodes.toString(flags & 0xf),\n questions: new Array(buf.readUInt16BE(offset + 4)),\n answers: new Array(buf.readUInt16BE(offset + 6)),\n authorities: new Array(buf.readUInt16BE(offset + 8)),\n additionals: new Array(buf.readUInt16BE(offset + 10))\n }\n}\n\nheader.decode.bytes = 12\n\nheader.encodingLength = function () {\n return 12\n}\n\nconst runknown = exports.unknown = {}\n\nrunknown.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(runknown.encodingLength(data))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(data.length, offset)\n data.copy(buf, offset + 2)\n\n runknown.encode.bytes = data.length + 2\n return buf\n}\n\nrunknown.encode.bytes = 0\n\nrunknown.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n const data = buf.slice(offset + 2, offset + 2 + len)\n runknown.decode.bytes = len + 2\n return data\n}\n\nrunknown.decode.bytes = 0\n\nrunknown.encodingLength = function (data) {\n return data.length + 2\n}\n\nconst rns = exports.ns = {}\n\nrns.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rns.encodingLength(data))\n if (!offset) offset = 0\n\n name.encode(data, buf, offset + 2)\n buf.writeUInt16BE(name.encode.bytes, offset)\n rns.encode.bytes = name.encode.bytes + 2\n return buf\n}\n\nrns.encode.bytes = 0\n\nrns.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n const dd = name.decode(buf, offset + 2)\n\n rns.decode.bytes = len + 2\n return dd\n}\n\nrns.decode.bytes = 0\n\nrns.encodingLength = function (data) {\n return name.encodingLength(data) + 2\n}\n\nconst rsoa = exports.soa = {}\n\nrsoa.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsoa.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n name.encode(data.mname, buf, offset)\n offset += name.encode.bytes\n name.encode(data.rname, buf, offset)\n offset += name.encode.bytes\n buf.writeUInt32BE(data.serial || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.refresh || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.retry || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.expire || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.minimum || 0, offset)\n offset += 4\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rsoa.encode.bytes = offset - oldOffset\n return buf\n}\n\nrsoa.encode.bytes = 0\n\nrsoa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.mname = name.decode(buf, offset)\n offset += name.decode.bytes\n data.rname = name.decode(buf, offset)\n offset += name.decode.bytes\n data.serial = buf.readUInt32BE(offset)\n offset += 4\n data.refresh = buf.readUInt32BE(offset)\n offset += 4\n data.retry = buf.readUInt32BE(offset)\n offset += 4\n data.expire = buf.readUInt32BE(offset)\n offset += 4\n data.minimum = buf.readUInt32BE(offset)\n offset += 4\n\n rsoa.decode.bytes = offset - oldOffset\n return data\n}\n\nrsoa.decode.bytes = 0\n\nrsoa.encodingLength = function (data) {\n return 22 + name.encodingLength(data.mname) + name.encodingLength(data.rname)\n}\n\nconst rtxt = exports.txt = {}\n\nrtxt.encode = function (data, buf, offset) {\n if (!Array.isArray(data)) data = [data]\n for (let i = 0; i < data.length; i++) {\n if (typeof data[i] === 'string') {\n data[i] = Buffer.from(data[i])\n }\n if (!Buffer.isBuffer(data[i])) {\n throw new Error('Must be a Buffer')\n }\n }\n\n if (!buf) buf = Buffer.alloc(rtxt.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n\n data.forEach(function (d) {\n buf[offset++] = d.length\n d.copy(buf, offset, 0, d.length)\n offset += d.length\n })\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rtxt.encode.bytes = offset - oldOffset\n return buf\n}\n\nrtxt.encode.bytes = 0\n\nrtxt.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n let remaining = buf.readUInt16BE(offset)\n offset += 2\n\n let data = []\n while (remaining > 0) {\n const len = buf[offset++]\n --remaining\n if (remaining < len) {\n throw new Error('Buffer overflow')\n }\n data.push(buf.slice(offset, offset + len))\n offset += len\n remaining -= len\n }\n\n rtxt.decode.bytes = offset - oldOffset\n return data\n}\n\nrtxt.decode.bytes = 0\n\nrtxt.encodingLength = function (data) {\n if (!Array.isArray(data)) data = [data]\n let length = 2\n data.forEach(function (buf) {\n if (typeof buf === 'string') {\n length += Buffer.byteLength(buf) + 1\n } else {\n length += buf.length + 1\n }\n })\n return length\n}\n\nconst rnull = exports.null = {}\n\nrnull.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnull.encodingLength(data))\n if (!offset) offset = 0\n\n if (typeof data === 'string') data = Buffer.from(data)\n if (!data) data = Buffer.alloc(0)\n\n const oldOffset = offset\n offset += 2\n\n const len = data.length\n data.copy(buf, offset, 0, len)\n offset += len\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rnull.encode.bytes = offset - oldOffset\n return buf\n}\n\nrnull.encode.bytes = 0\n\nrnull.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n const len = buf.readUInt16BE(offset)\n\n offset += 2\n\n const data = buf.slice(offset, offset + len)\n offset += len\n\n rnull.decode.bytes = offset - oldOffset\n return data\n}\n\nrnull.decode.bytes = 0\n\nrnull.encodingLength = function (data) {\n if (!data) return 2\n return (Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)) + 2\n}\n\nconst rhinfo = exports.hinfo = {}\n\nrhinfo.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rhinfo.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n string.encode(data.cpu, buf, offset)\n offset += string.encode.bytes\n string.encode(data.os, buf, offset)\n offset += string.encode.bytes\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rhinfo.encode.bytes = offset - oldOffset\n return buf\n}\n\nrhinfo.encode.bytes = 0\n\nrhinfo.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.cpu = string.decode(buf, offset)\n offset += string.decode.bytes\n data.os = string.decode(buf, offset)\n offset += string.decode.bytes\n rhinfo.decode.bytes = offset - oldOffset\n return data\n}\n\nrhinfo.decode.bytes = 0\n\nrhinfo.encodingLength = function (data) {\n return string.encodingLength(data.cpu) + string.encodingLength(data.os) + 2\n}\n\nconst rptr = exports.ptr = {}\nconst rcname = exports.cname = rptr\nconst rdname = exports.dname = rptr\n\nrptr.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rptr.encodingLength(data))\n if (!offset) offset = 0\n\n name.encode(data, buf, offset + 2)\n buf.writeUInt16BE(name.encode.bytes, offset)\n rptr.encode.bytes = name.encode.bytes + 2\n return buf\n}\n\nrptr.encode.bytes = 0\n\nrptr.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const data = name.decode(buf, offset + 2)\n rptr.decode.bytes = name.decode.bytes + 2\n return data\n}\n\nrptr.decode.bytes = 0\n\nrptr.encodingLength = function (data) {\n return name.encodingLength(data) + 2\n}\n\nconst rsrv = exports.srv = {}\n\nrsrv.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsrv.encodingLength(data))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(data.priority || 0, offset + 2)\n buf.writeUInt16BE(data.weight || 0, offset + 4)\n buf.writeUInt16BE(data.port || 0, offset + 6)\n name.encode(data.target, buf, offset + 8)\n\n const len = name.encode.bytes + 6\n buf.writeUInt16BE(len, offset)\n\n rsrv.encode.bytes = len + 2\n return buf\n}\n\nrsrv.encode.bytes = 0\n\nrsrv.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n\n const data = {}\n data.priority = buf.readUInt16BE(offset + 2)\n data.weight = buf.readUInt16BE(offset + 4)\n data.port = buf.readUInt16BE(offset + 6)\n data.target = name.decode(buf, offset + 8)\n\n rsrv.decode.bytes = len + 2\n return data\n}\n\nrsrv.decode.bytes = 0\n\nrsrv.encodingLength = function (data) {\n return 8 + name.encodingLength(data.target)\n}\n\nconst rcaa = exports.caa = {}\n\nrcaa.ISSUER_CRITICAL = 1 << 7\n\nrcaa.encode = function (data, buf, offset) {\n const len = rcaa.encodingLength(data)\n\n if (!buf) buf = Buffer.alloc(rcaa.encodingLength(data))\n if (!offset) offset = 0\n\n if (data.issuerCritical) {\n data.flags = rcaa.ISSUER_CRITICAL\n }\n\n buf.writeUInt16BE(len - 2, offset)\n offset += 2\n buf.writeUInt8(data.flags || 0, offset)\n offset += 1\n string.encode(data.tag, buf, offset)\n offset += string.encode.bytes\n buf.write(data.value, offset)\n offset += Buffer.byteLength(data.value)\n\n rcaa.encode.bytes = len\n return buf\n}\n\nrcaa.encode.bytes = 0\n\nrcaa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n offset += 2\n\n const oldOffset = offset\n const data = {}\n data.flags = buf.readUInt8(offset)\n offset += 1\n data.tag = string.decode(buf, offset)\n offset += string.decode.bytes\n data.value = buf.toString('utf-8', offset, oldOffset + len)\n\n data.issuerCritical = !!(data.flags & rcaa.ISSUER_CRITICAL)\n\n rcaa.decode.bytes = len + 2\n\n return data\n}\n\nrcaa.decode.bytes = 0\n\nrcaa.encodingLength = function (data) {\n return string.encodingLength(data.tag) + string.encodingLength(data.value) + 2\n}\n\nconst rmx = exports.mx = {}\n\nrmx.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rmx.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n buf.writeUInt16BE(data.preference || 0, offset)\n offset += 2\n name.encode(data.exchange, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rmx.encode.bytes = offset - oldOffset\n return buf\n}\n\nrmx.encode.bytes = 0\n\nrmx.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.preference = buf.readUInt16BE(offset)\n offset += 2\n data.exchange = name.decode(buf, offset)\n offset += name.decode.bytes\n\n rmx.decode.bytes = offset - oldOffset\n return data\n}\n\nrmx.encodingLength = function (data) {\n return 4 + name.encodingLength(data.exchange)\n}\n\nconst ra = exports.a = {}\n\nra.encode = function (host, buf, offset) {\n if (!buf) buf = Buffer.alloc(ra.encodingLength(host))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(4, offset)\n offset += 2\n ip.v4.encode(host, buf, offset)\n ra.encode.bytes = 6\n return buf\n}\n\nra.encode.bytes = 0\n\nra.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n offset += 2\n const host = ip.v4.decode(buf, offset)\n ra.decode.bytes = 6\n return host\n}\n\nra.decode.bytes = 0\n\nra.encodingLength = function () {\n return 6\n}\n\nconst raaaa = exports.aaaa = {}\n\nraaaa.encode = function (host, buf, offset) {\n if (!buf) buf = Buffer.alloc(raaaa.encodingLength(host))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(16, offset)\n offset += 2\n ip.v6.encode(host, buf, offset)\n raaaa.encode.bytes = 18\n return buf\n}\n\nraaaa.encode.bytes = 0\n\nraaaa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n offset += 2\n const host = ip.v6.decode(buf, offset)\n raaaa.decode.bytes = 18\n return host\n}\n\nraaaa.decode.bytes = 0\n\nraaaa.encodingLength = function () {\n return 18\n}\n\nconst roption = exports.option = {}\n\nroption.encode = function (option, buf, offset) {\n if (!buf) buf = Buffer.alloc(roption.encodingLength(option))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const code = optioncodes.toCode(option.code)\n buf.writeUInt16BE(code, offset)\n offset += 2\n if (option.data) {\n buf.writeUInt16BE(option.data.length, offset)\n offset += 2\n option.data.copy(buf, offset)\n offset += option.data.length\n } else {\n switch (code) {\n // case 3: NSID. No encode makes sense.\n // case 5,6,7: Not implementable\n case 8: // ECS\n // note: do IP math before calling\n const spl = option.sourcePrefixLength || 0\n const fam = option.family || ip.familyOf(option.ip)\n const ipBuf = ip.encode(option.ip, Buffer.alloc)\n const ipLen = Math.ceil(spl / 8)\n buf.writeUInt16BE(ipLen + 4, offset)\n offset += 2\n buf.writeUInt16BE(fam, offset)\n offset += 2\n buf.writeUInt8(spl, offset++)\n buf.writeUInt8(option.scopePrefixLength || 0, offset++)\n\n ipBuf.copy(buf, offset, 0, ipLen)\n offset += ipLen\n break\n // case 9: EXPIRE (experimental)\n // case 10: COOKIE. No encode makes sense.\n case 11: // KEEP-ALIVE\n if (option.timeout) {\n buf.writeUInt16BE(2, offset)\n offset += 2\n buf.writeUInt16BE(option.timeout, offset)\n offset += 2\n } else {\n buf.writeUInt16BE(0, offset)\n offset += 2\n }\n break\n case 12: // PADDING\n const len = option.length || 0\n buf.writeUInt16BE(len, offset)\n offset += 2\n buf.fill(0, offset, offset + len)\n offset += len\n break\n // case 13: CHAIN. Experimental.\n case 14: // KEY-TAG\n const tagsLen = option.tags.length * 2\n buf.writeUInt16BE(tagsLen, offset)\n offset += 2\n for (const tag of option.tags) {\n buf.writeUInt16BE(tag, offset)\n offset += 2\n }\n break\n default:\n throw new Error(`Unknown roption code: ${option.code}`)\n }\n }\n\n roption.encode.bytes = offset - oldOffset\n return buf\n}\n\nroption.encode.bytes = 0\n\nroption.decode = function (buf, offset) {\n if (!offset) offset = 0\n const option = {}\n option.code = buf.readUInt16BE(offset)\n option.type = optioncodes.toString(option.code)\n offset += 2\n const len = buf.readUInt16BE(offset)\n offset += 2\n option.data = buf.slice(offset, offset + len)\n switch (option.code) {\n // case 3: NSID. No decode makes sense.\n case 8: // ECS\n option.family = buf.readUInt16BE(offset)\n offset += 2\n option.sourcePrefixLength = buf.readUInt8(offset++)\n option.scopePrefixLength = buf.readUInt8(offset++)\n const padded = Buffer.alloc((option.family === 1) ? 4 : 16)\n buf.copy(padded, 0, offset, offset + len - 4)\n option.ip = ip.decode(padded)\n break\n // case 12: Padding. No decode makes sense.\n case 11: // KEEP-ALIVE\n if (len > 0) {\n option.timeout = buf.readUInt16BE(offset)\n offset += 2\n }\n break\n case 14:\n option.tags = []\n for (let i = 0; i < len; i += 2) {\n option.tags.push(buf.readUInt16BE(offset))\n offset += 2\n }\n // don't worry about default. caller will use data if desired\n }\n\n roption.decode.bytes = len + 4\n return option\n}\n\nroption.decode.bytes = 0\n\nroption.encodingLength = function (option) {\n if (option.data) {\n return option.data.length + 4\n }\n const code = optioncodes.toCode(option.code)\n switch (code) {\n case 8: // ECS\n const spl = option.sourcePrefixLength || 0\n return Math.ceil(spl / 8) + 8\n case 11: // KEEP-ALIVE\n return (typeof option.timeout === 'number') ? 6 : 4\n case 12: // PADDING\n return option.length + 4\n case 14: // KEY-TAG\n return 4 + (option.tags.length * 2)\n }\n throw new Error(`Unknown roption code: ${option.code}`)\n}\n\nconst ropt = exports.opt = {}\n\nropt.encode = function (options, buf, offset) {\n if (!buf) buf = Buffer.alloc(ropt.encodingLength(options))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const rdlen = encodingLengthList(options, roption)\n buf.writeUInt16BE(rdlen, offset)\n offset = encodeList(options, roption, buf, offset + 2)\n\n ropt.encode.bytes = offset - oldOffset\n return buf\n}\n\nropt.encode.bytes = 0\n\nropt.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const options = []\n let rdlen = buf.readUInt16BE(offset)\n offset += 2\n let o = 0\n while (rdlen > 0) {\n options[o++] = roption.decode(buf, offset)\n offset += roption.decode.bytes\n rdlen -= roption.decode.bytes\n }\n ropt.decode.bytes = offset - oldOffset\n return options\n}\n\nropt.decode.bytes = 0\n\nropt.encodingLength = function (options) {\n return 2 + encodingLengthList(options || [], roption)\n}\n\nconst rdnskey = exports.dnskey = {}\n\nrdnskey.PROTOCOL_DNSSEC = 3\nrdnskey.ZONE_KEY = 0x80\nrdnskey.SECURE_ENTRYPOINT = 0x8000\n\nrdnskey.encode = function (key, buf, offset) {\n if (!buf) buf = Buffer.alloc(rdnskey.encodingLength(key))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const keydata = key.key\n if (!Buffer.isBuffer(keydata)) {\n throw new Error('Key must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(key.flags, offset)\n offset += 2\n buf.writeUInt8(rdnskey.PROTOCOL_DNSSEC, offset)\n offset += 1\n buf.writeUInt8(key.algorithm, offset)\n offset += 1\n keydata.copy(buf, offset, 0, keydata.length)\n offset += keydata.length\n\n rdnskey.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rdnskey.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrdnskey.encode.bytes = 0\n\nrdnskey.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var key = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n key.flags = buf.readUInt16BE(offset)\n offset += 2\n if (buf.readUInt8(offset) !== rdnskey.PROTOCOL_DNSSEC) {\n throw new Error('Protocol must be 3')\n }\n offset += 1\n key.algorithm = buf.readUInt8(offset)\n offset += 1\n key.key = buf.slice(offset, oldOffset + length + 2)\n offset += key.key.length\n rdnskey.decode.bytes = offset - oldOffset\n return key\n}\n\nrdnskey.decode.bytes = 0\n\nrdnskey.encodingLength = function (key) {\n return 6 + Buffer.byteLength(key.key)\n}\n\nconst rrrsig = exports.rrsig = {}\n\nrrrsig.encode = function (sig, buf, offset) {\n if (!buf) buf = Buffer.alloc(rrrsig.encodingLength(sig))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const signature = sig.signature\n if (!Buffer.isBuffer(signature)) {\n throw new Error('Signature must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(types.toType(sig.typeCovered), offset)\n offset += 2\n buf.writeUInt8(sig.algorithm, offset)\n offset += 1\n buf.writeUInt8(sig.labels, offset)\n offset += 1\n buf.writeUInt32BE(sig.originalTTL, offset)\n offset += 4\n buf.writeUInt32BE(sig.expiration, offset)\n offset += 4\n buf.writeUInt32BE(sig.inception, offset)\n offset += 4\n buf.writeUInt16BE(sig.keyTag, offset)\n offset += 2\n name.encode(sig.signersName, buf, offset)\n offset += name.encode.bytes\n signature.copy(buf, offset, 0, signature.length)\n offset += signature.length\n\n rrrsig.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rrrsig.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrrrsig.encode.bytes = 0\n\nrrrsig.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var sig = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n sig.typeCovered = types.toString(buf.readUInt16BE(offset))\n offset += 2\n sig.algorithm = buf.readUInt8(offset)\n offset += 1\n sig.labels = buf.readUInt8(offset)\n offset += 1\n sig.originalTTL = buf.readUInt32BE(offset)\n offset += 4\n sig.expiration = buf.readUInt32BE(offset)\n offset += 4\n sig.inception = buf.readUInt32BE(offset)\n offset += 4\n sig.keyTag = buf.readUInt16BE(offset)\n offset += 2\n sig.signersName = name.decode(buf, offset)\n offset += name.decode.bytes\n sig.signature = buf.slice(offset, oldOffset + length + 2)\n offset += sig.signature.length\n rrrsig.decode.bytes = offset - oldOffset\n return sig\n}\n\nrrrsig.decode.bytes = 0\n\nrrrsig.encodingLength = function (sig) {\n return 20 +\n name.encodingLength(sig.signersName) +\n Buffer.byteLength(sig.signature)\n}\n\nconst rrp = exports.rp = {}\n\nrrp.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rrp.encodingLength(data))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // Leave space for length\n name.encode(data.mbox || '.', buf, offset)\n offset += name.encode.bytes\n name.encode(data.txt || '.', buf, offset)\n offset += name.encode.bytes\n rrp.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rrp.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrrp.encode.bytes = 0\n\nrrp.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.mbox = name.decode(buf, offset) || '.'\n offset += name.decode.bytes\n data.txt = name.decode(buf, offset) || '.'\n offset += name.decode.bytes\n rrp.decode.bytes = offset - oldOffset\n return data\n}\n\nrrp.decode.bytes = 0\n\nrrp.encodingLength = function (data) {\n return 2 + name.encodingLength(data.mbox || '.') + name.encodingLength(data.txt || '.')\n}\n\nconst typebitmap = {}\n\ntypebitmap.encode = function (typelist, buf, offset) {\n if (!buf) buf = Buffer.alloc(typebitmap.encodingLength(typelist))\n if (!offset) offset = 0\n const oldOffset = offset\n\n var typesByWindow = []\n for (var i = 0; i < typelist.length; i++) {\n var typeid = types.toType(typelist[i])\n if (typesByWindow[typeid >> 8] === undefined) {\n typesByWindow[typeid >> 8] = []\n }\n typesByWindow[typeid >> 8][(typeid >> 3) & 0x1F] |= 1 << (7 - (typeid & 0x7))\n }\n\n for (i = 0; i < typesByWindow.length; i++) {\n if (typesByWindow[i] !== undefined) {\n var windowBuf = Buffer.from(typesByWindow[i])\n buf.writeUInt8(i, offset)\n offset += 1\n buf.writeUInt8(windowBuf.length, offset)\n offset += 1\n windowBuf.copy(buf, offset)\n offset += windowBuf.length\n }\n }\n\n typebitmap.encode.bytes = offset - oldOffset\n return buf\n}\n\ntypebitmap.encode.bytes = 0\n\ntypebitmap.decode = function (buf, offset, length) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var typelist = []\n while (offset - oldOffset < length) {\n var window = buf.readUInt8(offset)\n offset += 1\n var windowLength = buf.readUInt8(offset)\n offset += 1\n for (var i = 0; i < windowLength; i++) {\n var b = buf.readUInt8(offset + i)\n for (var j = 0; j < 8; j++) {\n if (b & (1 << (7 - j))) {\n var typeid = types.toString((window << 8) | (i << 3) | j)\n typelist.push(typeid)\n }\n }\n }\n offset += windowLength\n }\n\n typebitmap.decode.bytes = offset - oldOffset\n return typelist\n}\n\ntypebitmap.decode.bytes = 0\n\ntypebitmap.encodingLength = function (typelist) {\n var extents = []\n for (var i = 0; i < typelist.length; i++) {\n var typeid = types.toType(typelist[i])\n extents[typeid >> 8] = Math.max(extents[typeid >> 8] || 0, typeid & 0xFF)\n }\n\n var len = 0\n for (i = 0; i < extents.length; i++) {\n if (extents[i] !== undefined) {\n len += 2 + Math.ceil((extents[i] + 1) / 8)\n }\n }\n\n return len\n}\n\nconst rnsec = exports.nsec = {}\n\nrnsec.encode = function (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnsec.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // Leave space for length\n name.encode(record.nextDomain, buf, offset)\n offset += name.encode.bytes\n typebitmap.encode(record.rrtypes, buf, offset)\n offset += typebitmap.encode.bytes\n\n rnsec.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnsec.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnsec.encode.bytes = 0\n\nrnsec.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var record = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n record.nextDomain = name.decode(buf, offset)\n offset += name.decode.bytes\n record.rrtypes = typebitmap.decode(buf, offset, length - (offset - oldOffset))\n offset += typebitmap.decode.bytes\n\n rnsec.decode.bytes = offset - oldOffset\n return record\n}\n\nrnsec.decode.bytes = 0\n\nrnsec.encodingLength = function (record) {\n return 2 +\n name.encodingLength(record.nextDomain) +\n typebitmap.encodingLength(record.rrtypes)\n}\n\nconst rnsec3 = exports.nsec3 = {}\n\nrnsec3.encode = function (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnsec3.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const salt = record.salt\n if (!Buffer.isBuffer(salt)) {\n throw new Error('salt must be a Buffer')\n }\n\n const nextDomain = record.nextDomain\n if (!Buffer.isBuffer(nextDomain)) {\n throw new Error('nextDomain must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt8(record.algorithm, offset)\n offset += 1\n buf.writeUInt8(record.flags, offset)\n offset += 1\n buf.writeUInt16BE(record.iterations, offset)\n offset += 2\n buf.writeUInt8(salt.length, offset)\n offset += 1\n salt.copy(buf, offset, 0, salt.length)\n offset += salt.length\n buf.writeUInt8(nextDomain.length, offset)\n offset += 1\n nextDomain.copy(buf, offset, 0, nextDomain.length)\n offset += nextDomain.length\n typebitmap.encode(record.rrtypes, buf, offset)\n offset += typebitmap.encode.bytes\n\n rnsec3.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnsec3.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnsec3.encode.bytes = 0\n\nrnsec3.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var record = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n record.algorithm = buf.readUInt8(offset)\n offset += 1\n record.flags = buf.readUInt8(offset)\n offset += 1\n record.iterations = buf.readUInt16BE(offset)\n offset += 2\n const saltLength = buf.readUInt8(offset)\n offset += 1\n record.salt = buf.slice(offset, offset + saltLength)\n offset += saltLength\n const hashLength = buf.readUInt8(offset)\n offset += 1\n record.nextDomain = buf.slice(offset, offset + hashLength)\n offset += hashLength\n record.rrtypes = typebitmap.decode(buf, offset, length - (offset - oldOffset))\n offset += typebitmap.decode.bytes\n\n rnsec3.decode.bytes = offset - oldOffset\n return record\n}\n\nrnsec3.decode.bytes = 0\n\nrnsec3.encodingLength = function (record) {\n return 8 +\n record.salt.length +\n record.nextDomain.length +\n typebitmap.encodingLength(record.rrtypes)\n}\n\nconst rds = exports.ds = {}\n\nrds.encode = function (digest, buf, offset) {\n if (!buf) buf = Buffer.alloc(rds.encodingLength(digest))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const digestdata = digest.digest\n if (!Buffer.isBuffer(digestdata)) {\n throw new Error('Digest must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(digest.keyTag, offset)\n offset += 2\n buf.writeUInt8(digest.algorithm, offset)\n offset += 1\n buf.writeUInt8(digest.digestType, offset)\n offset += 1\n digestdata.copy(buf, offset, 0, digestdata.length)\n offset += digestdata.length\n\n rds.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rds.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrds.encode.bytes = 0\n\nrds.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var digest = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n digest.keyTag = buf.readUInt16BE(offset)\n offset += 2\n digest.algorithm = buf.readUInt8(offset)\n offset += 1\n digest.digestType = buf.readUInt8(offset)\n offset += 1\n digest.digest = buf.slice(offset, oldOffset + length + 2)\n offset += digest.digest.length\n rds.decode.bytes = offset - oldOffset\n return digest\n}\n\nrds.decode.bytes = 0\n\nrds.encodingLength = function (digest) {\n return 6 + Buffer.byteLength(digest.digest)\n}\n\nconst rsshfp = exports.sshfp = {}\n\nrsshfp.getFingerprintLengthForHashType = function getFingerprintLengthForHashType (hashType) {\n switch (hashType) {\n case 1: return 20\n case 2: return 32\n }\n}\n\nrsshfp.encode = function encode (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsshfp.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // The function call starts with the offset pointer at the RDLENGTH field, not the RDATA one\n buf[offset] = record.algorithm\n offset += 1\n buf[offset] = record.hash\n offset += 1\n\n const fingerprintBuf = Buffer.from(record.fingerprint.toUpperCase(), 'hex')\n if (fingerprintBuf.length !== rsshfp.getFingerprintLengthForHashType(record.hash)) {\n throw new Error('Invalid fingerprint length')\n }\n fingerprintBuf.copy(buf, offset)\n offset += fingerprintBuf.byteLength\n\n rsshfp.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rsshfp.encode.bytes - 2, oldOffset)\n\n return buf\n}\n\nrsshfp.encode.bytes = 0\n\nrsshfp.decode = function decode (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const record = {}\n offset += 2 // Account for the RDLENGTH field\n record.algorithm = buf[offset]\n offset += 1\n record.hash = buf[offset]\n offset += 1\n\n const fingerprintLength = rsshfp.getFingerprintLengthForHashType(record.hash)\n record.fingerprint = buf.slice(offset, offset + fingerprintLength).toString('hex').toUpperCase()\n offset += fingerprintLength\n rsshfp.decode.bytes = offset - oldOffset\n return record\n}\n\nrsshfp.decode.bytes = 0\n\nrsshfp.encodingLength = function (record) {\n return 4 + Buffer.from(record.fingerprint, 'hex').byteLength\n}\n\nconst rnaptr = exports.naptr = {}\n\nrnaptr.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnaptr.encodingLength(data))\n if (!offset) offset = 0\n const oldOffset = offset\n offset += 2\n buf.writeUInt16BE(data.order || 0, offset)\n offset += 2\n buf.writeUInt16BE(data.preference || 0, offset)\n offset += 2\n string.encode(data.flags, buf, offset)\n offset += string.encode.bytes\n string.encode(data.services, buf, offset)\n offset += string.encode.bytes\n string.encode(data.regexp, buf, offset)\n offset += string.encode.bytes\n name.encode(data.replacement, buf, offset)\n offset += name.encode.bytes\n rnaptr.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnaptr.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnaptr.encode.bytes = 0\n\nrnaptr.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n const data = {}\n offset += 2\n data.order = buf.readUInt16BE(offset)\n offset += 2\n data.preference = buf.readUInt16BE(offset)\n offset += 2\n data.flags = string.decode(buf, offset)\n offset += string.decode.bytes\n data.services = string.decode(buf, offset)\n offset += string.decode.bytes\n data.regexp = string.decode(buf, offset)\n offset += string.decode.bytes\n data.replacement = name.decode(buf, offset)\n offset += name.decode.bytes\n rnaptr.decode.bytes = offset - oldOffset\n return data\n}\n\nrnaptr.decode.bytes = 0\n\nrnaptr.encodingLength = function (data) {\n return string.encodingLength(data.flags) +\n string.encodingLength(data.services) +\n string.encodingLength(data.regexp) +\n name.encodingLength(data.replacement) + 6\n}\n\nconst rtlsa = exports.tlsa = {}\n\nrtlsa.encode = function (cert, buf, offset) {\n if (!buf) buf = Buffer.alloc(rtlsa.encodingLength(cert))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const certdata = cert.certificate\n if (!Buffer.isBuffer(certdata)) {\n throw new Error('Certificate must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt8(cert.usage, offset)\n offset += 1\n buf.writeUInt8(cert.selector, offset)\n offset += 1\n buf.writeUInt8(cert.matchingType, offset)\n offset += 1\n certdata.copy(buf, offset, 0, certdata.length)\n offset += certdata.length\n\n rtlsa.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rtlsa.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrtlsa.encode.bytes = 0\n\nrtlsa.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const cert = {}\n const length = buf.readUInt16BE(offset)\n offset += 2\n cert.usage = buf.readUInt8(offset)\n offset += 1\n cert.selector = buf.readUInt8(offset)\n offset += 1\n cert.matchingType = buf.readUInt8(offset)\n offset += 1\n cert.certificate = buf.slice(offset, oldOffset + length + 2)\n offset += cert.certificate.length\n rtlsa.decode.bytes = offset - oldOffset\n return cert\n}\n\nrtlsa.decode.bytes = 0\n\nrtlsa.encodingLength = function (cert) {\n return 5 + Buffer.byteLength(cert.certificate)\n}\n\nconst renc = exports.record = function (type) {\n switch (type.toUpperCase()) {\n case 'A': return ra\n case 'PTR': return rptr\n case 'CNAME': return rcname\n case 'DNAME': return rdname\n case 'TXT': return rtxt\n case 'NULL': return rnull\n case 'AAAA': return raaaa\n case 'SRV': return rsrv\n case 'HINFO': return rhinfo\n case 'CAA': return rcaa\n case 'NS': return rns\n case 'SOA': return rsoa\n case 'MX': return rmx\n case 'OPT': return ropt\n case 'DNSKEY': return rdnskey\n case 'RRSIG': return rrrsig\n case 'RP': return rrp\n case 'NSEC': return rnsec\n case 'NSEC3': return rnsec3\n case 'SSHFP': return rsshfp\n case 'DS': return rds\n case 'NAPTR': return rnaptr\n case 'TLSA': return rtlsa\n }\n return runknown\n}\n\nconst answer = exports.answer = {}\n\nanswer.encode = function (a, buf, offset) {\n if (!buf) buf = Buffer.alloc(answer.encodingLength(a))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n name.encode(a.name, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(types.toType(a.type), offset)\n\n if (a.type.toUpperCase() === 'OPT') {\n if (a.name !== '.') {\n throw new Error('OPT name must be root.')\n }\n buf.writeUInt16BE(a.udpPayloadSize || 4096, offset + 2)\n buf.writeUInt8(a.extendedRcode || 0, offset + 4)\n buf.writeUInt8(a.ednsVersion || 0, offset + 5)\n buf.writeUInt16BE(a.flags || 0, offset + 6)\n\n offset += 8\n ropt.encode(a.options || [], buf, offset)\n offset += ropt.encode.bytes\n } else {\n let klass = classes.toClass(a.class === undefined ? 'IN' : a.class)\n if (a.flush) klass |= FLUSH_MASK // the 1st bit of the class is the flush bit\n buf.writeUInt16BE(klass, offset + 2)\n buf.writeUInt32BE(a.ttl || 0, offset + 4)\n\n offset += 8\n const enc = renc(a.type)\n enc.encode(a.data, buf, offset)\n offset += enc.encode.bytes\n }\n\n answer.encode.bytes = offset - oldOffset\n return buf\n}\n\nanswer.encode.bytes = 0\n\nanswer.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const a = {}\n const oldOffset = offset\n\n a.name = name.decode(buf, offset)\n offset += name.decode.bytes\n a.type = types.toString(buf.readUInt16BE(offset))\n if (a.type === 'OPT') {\n a.udpPayloadSize = buf.readUInt16BE(offset + 2)\n a.extendedRcode = buf.readUInt8(offset + 4)\n a.ednsVersion = buf.readUInt8(offset + 5)\n a.flags = buf.readUInt16BE(offset + 6)\n a.flag_do = ((a.flags >> 15) & 0x1) === 1\n a.options = ropt.decode(buf, offset + 8)\n offset += 8 + ropt.decode.bytes\n } else {\n const klass = buf.readUInt16BE(offset + 2)\n a.ttl = buf.readUInt32BE(offset + 4)\n\n a.class = classes.toString(klass & NOT_FLUSH_MASK)\n a.flush = !!(klass & FLUSH_MASK)\n\n const enc = renc(a.type)\n a.data = enc.decode(buf, offset + 8)\n offset += 8 + enc.decode.bytes\n }\n\n answer.decode.bytes = offset - oldOffset\n return a\n}\n\nanswer.decode.bytes = 0\n\nanswer.encodingLength = function (a) {\n const data = (a.data !== null && a.data !== undefined) ? a.data : a.options\n return name.encodingLength(a.name) + 8 + renc(a.type).encodingLength(data)\n}\n\nconst question = exports.question = {}\n\nquestion.encode = function (q, buf, offset) {\n if (!buf) buf = Buffer.alloc(question.encodingLength(q))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n name.encode(q.name, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(types.toType(q.type), offset)\n offset += 2\n\n buf.writeUInt16BE(classes.toClass(q.class === undefined ? 'IN' : q.class), offset)\n offset += 2\n\n question.encode.bytes = offset - oldOffset\n return q\n}\n\nquestion.encode.bytes = 0\n\nquestion.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n const q = {}\n\n q.name = name.decode(buf, offset)\n offset += name.decode.bytes\n\n q.type = types.toString(buf.readUInt16BE(offset))\n offset += 2\n\n q.class = classes.toString(buf.readUInt16BE(offset))\n offset += 2\n\n const qu = !!(q.class & QU_MASK)\n if (qu) q.class &= NOT_QU_MASK\n\n question.decode.bytes = offset - oldOffset\n return q\n}\n\nquestion.decode.bytes = 0\n\nquestion.encodingLength = function (q) {\n return name.encodingLength(q.name) + 4\n}\n\nexports.AUTHORITATIVE_ANSWER = 1 << 10\nexports.TRUNCATED_RESPONSE = 1 << 9\nexports.RECURSION_DESIRED = 1 << 8\nexports.RECURSION_AVAILABLE = 1 << 7\nexports.AUTHENTIC_DATA = 1 << 5\nexports.CHECKING_DISABLED = 1 << 4\nexports.DNSSEC_OK = 1 << 15\n\nexports.encode = function (result, buf, offset) {\n const allocing = !buf\n\n if (allocing) buf = Buffer.alloc(exports.encodingLength(result))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n if (!result.questions) result.questions = []\n if (!result.answers) result.answers = []\n if (!result.authorities) result.authorities = []\n if (!result.additionals) result.additionals = []\n\n header.encode(result, buf, offset)\n offset += header.encode.bytes\n\n offset = encodeList(result.questions, question, buf, offset)\n offset = encodeList(result.answers, answer, buf, offset)\n offset = encodeList(result.authorities, answer, buf, offset)\n offset = encodeList(result.additionals, answer, buf, offset)\n\n exports.encode.bytes = offset - oldOffset\n\n // just a quick sanity check\n if (allocing && exports.encode.bytes !== buf.length) {\n return buf.slice(0, exports.encode.bytes)\n }\n\n return buf\n}\n\nexports.encode.bytes = 0\n\nexports.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n const result = header.decode(buf, offset)\n offset += header.decode.bytes\n\n offset = decodeList(result.questions, question, buf, offset)\n offset = decodeList(result.answers, answer, buf, offset)\n offset = decodeList(result.authorities, answer, buf, offset)\n offset = decodeList(result.additionals, answer, buf, offset)\n\n exports.decode.bytes = offset - oldOffset\n\n return result\n}\n\nexports.decode.bytes = 0\n\nexports.encodingLength = function (result) {\n return header.encodingLength(result) +\n encodingLengthList(result.questions || [], question) +\n encodingLengthList(result.answers || [], answer) +\n encodingLengthList(result.authorities || [], answer) +\n encodingLengthList(result.additionals || [], answer)\n}\n\nexports.streamEncode = function (result) {\n const buf = exports.encode(result)\n const sbuf = Buffer.alloc(2)\n sbuf.writeUInt16BE(buf.byteLength)\n const combine = Buffer.concat([sbuf, buf])\n exports.streamEncode.bytes = combine.byteLength\n return combine\n}\n\nexports.streamEncode.bytes = 0\n\nexports.streamDecode = function (sbuf) {\n const len = sbuf.readUInt16BE(0)\n if (sbuf.byteLength < len + 2) {\n // not enough data\n return null\n }\n const result = exports.decode(sbuf.slice(2))\n exports.streamDecode.bytes = exports.decode.bytes\n return result\n}\n\nexports.streamDecode.bytes = 0\n\nfunction encodingLengthList (list, enc) {\n let len = 0\n for (let i = 0; i < list.length; i++) len += enc.encodingLength(list[i])\n return len\n}\n\nfunction encodeList (list, enc, buf, offset) {\n for (let i = 0; i < list.length; i++) {\n enc.encode(list[i], buf, offset)\n offset += enc.encode.bytes\n }\n return offset\n}\n\nfunction decodeList (list, enc, buf, offset) {\n for (let i = 0; i < list.length; i++) {\n list[i] = enc.decode(buf, offset)\n offset += enc.decode.bytes\n }\n return offset\n}\n","'use strict'\n\n/*\n * Traditional DNS header OPCODEs (4-bits) defined by IANA in\n * https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-5\n */\n\nexports.toString = function (opcode) {\n switch (opcode) {\n case 0: return 'QUERY'\n case 1: return 'IQUERY'\n case 2: return 'STATUS'\n case 3: return 'OPCODE_3'\n case 4: return 'NOTIFY'\n case 5: return 'UPDATE'\n case 6: return 'OPCODE_6'\n case 7: return 'OPCODE_7'\n case 8: return 'OPCODE_8'\n case 9: return 'OPCODE_9'\n case 10: return 'OPCODE_10'\n case 11: return 'OPCODE_11'\n case 12: return 'OPCODE_12'\n case 13: return 'OPCODE_13'\n case 14: return 'OPCODE_14'\n case 15: return 'OPCODE_15'\n }\n return 'OPCODE_' + opcode\n}\n\nexports.toOpcode = function (code) {\n switch (code.toUpperCase()) {\n case 'QUERY': return 0\n case 'IQUERY': return 1\n case 'STATUS': return 2\n case 'OPCODE_3': return 3\n case 'NOTIFY': return 4\n case 'UPDATE': return 5\n case 'OPCODE_6': return 6\n case 'OPCODE_7': return 7\n case 'OPCODE_8': return 8\n case 'OPCODE_9': return 9\n case 'OPCODE_10': return 10\n case 'OPCODE_11': return 11\n case 'OPCODE_12': return 12\n case 'OPCODE_13': return 13\n case 'OPCODE_14': return 14\n case 'OPCODE_15': return 15\n }\n return 0\n}\n","'use strict'\n\nexports.toString = function (type) {\n switch (type) {\n // list at\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-11\n case 1: return 'LLQ'\n case 2: return 'UL'\n case 3: return 'NSID'\n case 5: return 'DAU'\n case 6: return 'DHU'\n case 7: return 'N3U'\n case 8: return 'CLIENT_SUBNET'\n case 9: return 'EXPIRE'\n case 10: return 'COOKIE'\n case 11: return 'TCP_KEEPALIVE'\n case 12: return 'PADDING'\n case 13: return 'CHAIN'\n case 14: return 'KEY_TAG'\n case 26946: return 'DEVICEID'\n }\n if (type < 0) {\n return null\n }\n return `OPTION_${type}`\n}\n\nexports.toCode = function (name) {\n if (typeof name === 'number') {\n return name\n }\n if (!name) {\n return -1\n }\n switch (name.toUpperCase()) {\n case 'OPTION_0': return 0\n case 'LLQ': return 1\n case 'UL': return 2\n case 'NSID': return 3\n case 'OPTION_4': return 4\n case 'DAU': return 5\n case 'DHU': return 6\n case 'N3U': return 7\n case 'CLIENT_SUBNET': return 8\n case 'EXPIRE': return 9\n case 'COOKIE': return 10\n case 'TCP_KEEPALIVE': return 11\n case 'PADDING': return 12\n case 'CHAIN': return 13\n case 'KEY_TAG': return 14\n case 'DEVICEID': return 26946\n case 'OPTION_65535': return 65535\n }\n const m = name.match(/_(\\d+)$/)\n if (m) {\n return parseInt(m[1], 10)\n }\n return -1\n}\n","'use strict'\n\n/*\n * Traditional DNS header RCODEs (4-bits) defined by IANA in\n * https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml\n */\n\nexports.toString = function (rcode) {\n switch (rcode) {\n case 0: return 'NOERROR'\n case 1: return 'FORMERR'\n case 2: return 'SERVFAIL'\n case 3: return 'NXDOMAIN'\n case 4: return 'NOTIMP'\n case 5: return 'REFUSED'\n case 6: return 'YXDOMAIN'\n case 7: return 'YXRRSET'\n case 8: return 'NXRRSET'\n case 9: return 'NOTAUTH'\n case 10: return 'NOTZONE'\n case 11: return 'RCODE_11'\n case 12: return 'RCODE_12'\n case 13: return 'RCODE_13'\n case 14: return 'RCODE_14'\n case 15: return 'RCODE_15'\n }\n return 'RCODE_' + rcode\n}\n\nexports.toRcode = function (code) {\n switch (code.toUpperCase()) {\n case 'NOERROR': return 0\n case 'FORMERR': return 1\n case 'SERVFAIL': return 2\n case 'NXDOMAIN': return 3\n case 'NOTIMP': return 4\n case 'REFUSED': return 5\n case 'YXDOMAIN': return 6\n case 'YXRRSET': return 7\n case 'NXRRSET': return 8\n case 'NOTAUTH': return 9\n case 'NOTZONE': return 10\n case 'RCODE_11': return 11\n case 'RCODE_12': return 12\n case 'RCODE_13': return 13\n case 'RCODE_14': return 14\n case 'RCODE_15': return 15\n }\n return 0\n}\n","'use strict'\n\nexports.toString = function (type) {\n switch (type) {\n case 1: return 'A'\n case 10: return 'NULL'\n case 28: return 'AAAA'\n case 18: return 'AFSDB'\n case 42: return 'APL'\n case 257: return 'CAA'\n case 60: return 'CDNSKEY'\n case 59: return 'CDS'\n case 37: return 'CERT'\n case 5: return 'CNAME'\n case 49: return 'DHCID'\n case 32769: return 'DLV'\n case 39: return 'DNAME'\n case 48: return 'DNSKEY'\n case 43: return 'DS'\n case 55: return 'HIP'\n case 13: return 'HINFO'\n case 45: return 'IPSECKEY'\n case 25: return 'KEY'\n case 36: return 'KX'\n case 29: return 'LOC'\n case 15: return 'MX'\n case 35: return 'NAPTR'\n case 2: return 'NS'\n case 47: return 'NSEC'\n case 50: return 'NSEC3'\n case 51: return 'NSEC3PARAM'\n case 12: return 'PTR'\n case 46: return 'RRSIG'\n case 17: return 'RP'\n case 24: return 'SIG'\n case 6: return 'SOA'\n case 99: return 'SPF'\n case 33: return 'SRV'\n case 44: return 'SSHFP'\n case 32768: return 'TA'\n case 249: return 'TKEY'\n case 52: return 'TLSA'\n case 250: return 'TSIG'\n case 16: return 'TXT'\n case 252: return 'AXFR'\n case 251: return 'IXFR'\n case 41: return 'OPT'\n case 255: return 'ANY'\n }\n return 'UNKNOWN_' + type\n}\n\nexports.toType = function (name) {\n switch (name.toUpperCase()) {\n case 'A': return 1\n case 'NULL': return 10\n case 'AAAA': return 28\n case 'AFSDB': return 18\n case 'APL': return 42\n case 'CAA': return 257\n case 'CDNSKEY': return 60\n case 'CDS': return 59\n case 'CERT': return 37\n case 'CNAME': return 5\n case 'DHCID': return 49\n case 'DLV': return 32769\n case 'DNAME': return 39\n case 'DNSKEY': return 48\n case 'DS': return 43\n case 'HIP': return 55\n case 'HINFO': return 13\n case 'IPSECKEY': return 45\n case 'KEY': return 25\n case 'KX': return 36\n case 'LOC': return 29\n case 'MX': return 15\n case 'NAPTR': return 35\n case 'NS': return 2\n case 'NSEC': return 47\n case 'NSEC3': return 50\n case 'NSEC3PARAM': return 51\n case 'PTR': return 12\n case 'RRSIG': return 46\n case 'RP': return 17\n case 'SIG': return 24\n case 'SOA': return 6\n case 'SPF': return 99\n case 'SRV': return 33\n case 'SSHFP': return 44\n case 'TA': return 32768\n case 'TKEY': return 249\n case 'TLSA': return 52\n case 'TSIG': return 250\n case 'TXT': return 16\n case 'AXFR': return 252\n case 'IXFR': return 251\n case 'OPT': return 41\n case 'ANY': return 255\n case '*': return 255\n }\n if (name.toUpperCase().startsWith('UNKNOWN_')) return parseInt(name.slice(8))\n return 0\n}\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n const vaultPath = _vaultPath(options)\n\n // Parse .env.vault\n const result = DotenvModule.configDotenv({ path: vaultPath })\n if (!result.parsed) {\n throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}][INFO] ${message}`)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n throw new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development')\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n throw new Error('INVALID_DOTENV_KEY: Missing key part')\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n throw new Error('INVALID_DOTENV_KEY: Missing environment part')\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n\n if (options && options.path && options.path.length > 0) {\n dotenvPath = options.path\n }\n\n // Locate .env.vault\n return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n _log('Loading env from encrypted .env.vault')\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n\n if (options) {\n if (options.path != null) {\n dotenvPath = _resolveHome(options.path)\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n }\n\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${dotenvPath} ${e.message}`)\n }\n\n return { error: e }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n const vaultPath = _vaultPath(options)\n\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n // dotenvKey exists but .env.vault file does not exist\n if (!fs.existsSync(vaultPath)) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.slice(0, 12)\n const authTag = ciphertext.slice(-16)\n ciphertext = ciphertext.slice(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const msg = 'INVALID_DOTENV_KEY: It must be 64 characters long (or more)'\n throw new Error(msg)\n } else if (decryptionFailed) {\n const msg = 'DECRYPTION_FAILED: Please check your DOTENV_KEY'\n throw new Error(msg)\n } else {\n console.error('Error: ', error.code)\n console.error('Error: ', error.message)\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n throw new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n","/*!\n * ee-first\n * Copyright(c) 2014 Jonathan Ong\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = first\n\n/**\n * Get the first event in a set of event emitters and event pairs.\n *\n * @param {array} stuff\n * @param {function} done\n * @public\n */\n\nfunction first(stuff, done) {\n if (!Array.isArray(stuff))\n throw new TypeError('arg must be an array of [ee, events...] arrays')\n\n var cleanups = []\n\n for (var i = 0; i < stuff.length; i++) {\n var arr = stuff[i]\n\n if (!Array.isArray(arr) || arr.length < 2)\n throw new TypeError('each array member must be [ee, events...]')\n\n var ee = arr[0]\n\n for (var j = 1; j < arr.length; j++) {\n var event = arr[j]\n var fn = listener(event, callback)\n\n // listen to the event\n ee.on(event, fn)\n // push this listener to the list of cleanups\n cleanups.push({\n ee: ee,\n event: event,\n fn: fn,\n })\n }\n }\n\n function callback() {\n cleanup()\n done.apply(null, arguments)\n }\n\n function cleanup() {\n var x\n for (var i = 0; i < cleanups.length; i++) {\n x = cleanups[i]\n x.ee.removeListener(x.event, x.fn)\n }\n }\n\n function thunk(fn) {\n done = fn\n }\n\n thunk.cancel = cleanup\n\n return thunk\n}\n\n/**\n * Create the event listener.\n * @private\n */\n\nfunction listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}\n","/*!\n * encodeurl\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = encodeUrl\n\n/**\n * RegExp to match non-URL code points, *after* encoding (i.e. not including \"%\")\n * and including invalid escape sequences.\n * @private\n */\n\nvar ENCODE_CHARS_REGEXP = /(?:[^\\x21\\x25\\x26-\\x3B\\x3D\\x3F-\\x5B\\x5D\\x5F\\x61-\\x7A\\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g\n\n/**\n * RegExp to match unmatched surrogate pair.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]([^\\uDC00-\\uDFFF]|$)/g\n\n/**\n * String to replace unmatched surrogate pair with.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\\uFFFD$2'\n\n/**\n * Encode a URL to a percent-encoded form, excluding already-encoded sequences.\n *\n * This function will take an already-encoded URL and encode all the non-URL\n * code points. This function will not encode the \"%\" character unless it is\n * not part of a valid sequence (`%20` will be left as-is, but `%foo` will\n * be encoded as `%25foo`).\n *\n * This encode is meant to be \"safe\" and does not throw errors. It will try as\n * hard as it can to properly encode the given URL, including replacing any raw,\n * unpaired surrogate pairs with the Unicode replacement character prior to\n * encoding.\n *\n * @param {string} url\n * @return {string}\n * @public\n */\n\nfunction encodeUrl (url) {\n return String(url)\n .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)\n .replace(ENCODE_CHARS_REGEXP, encodeURI)\n}\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","/*!\n * etag\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = etag\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar crypto = require('crypto')\nvar Stats = require('fs').Stats\n\n/**\n * Module variables.\n * @private\n */\n\nvar toString = Object.prototype.toString\n\n/**\n * Generate an entity tag.\n *\n * @param {Buffer|string} entity\n * @return {string}\n * @private\n */\n\nfunction entitytag (entity) {\n if (entity.length === 0) {\n // fast-path empty\n return '\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"'\n }\n\n // compute hash of entity\n var hash = crypto\n .createHash('sha1')\n .update(entity, 'utf8')\n .digest('base64')\n .substring(0, 27)\n\n // compute length of entity\n var len = typeof entity === 'string'\n ? Buffer.byteLength(entity, 'utf8')\n : entity.length\n\n return '\"' + len.toString(16) + '-' + hash + '\"'\n}\n\n/**\n * Create a simple ETag.\n *\n * @param {string|Buffer|Stats} entity\n * @param {object} [options]\n * @param {boolean} [options.weak]\n * @return {String}\n * @public\n */\n\nfunction etag (entity, options) {\n if (entity == null) {\n throw new TypeError('argument entity is required')\n }\n\n // support fs.Stats object\n var isStats = isstats(entity)\n var weak = options && typeof options.weak === 'boolean'\n ? options.weak\n : isStats\n\n // validate argument\n if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) {\n throw new TypeError('argument entity must be string, Buffer, or fs.Stats')\n }\n\n // generate entity tag\n var tag = isStats\n ? stattag(entity)\n : entitytag(entity)\n\n return weak\n ? 'W/' + tag\n : tag\n}\n\n/**\n * Determine if object is a Stats object.\n *\n * @param {object} obj\n * @return {boolean}\n * @api private\n */\n\nfunction isstats (obj) {\n // genuine fs.Stats\n if (typeof Stats === 'function' && obj instanceof Stats) {\n return true\n }\n\n // quack quack\n return obj && typeof obj === 'object' &&\n 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' &&\n 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' &&\n 'ino' in obj && typeof obj.ino === 'number' &&\n 'size' in obj && typeof obj.size === 'number'\n}\n\n/**\n * Generate a tag for a stat.\n *\n * @param {object} stat\n * @return {string}\n * @private\n */\n\nfunction stattag (stat) {\n var mtime = stat.mtime.getTime().toString(16)\n var size = stat.size.toString(16)\n\n return '\"' + size + '-' + mtime + '\"'\n}\n","/*!\n * express-session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar cookie = require('cookie');\nvar crypto = require('crypto')\nvar debug = require('debug')('express-session');\nvar deprecate = require('depd')('express-session');\nvar onHeaders = require('on-headers')\nvar parseUrl = require('parseurl');\nvar signature = require('cookie-signature')\nvar uid = require('uid-safe').sync\n\nvar Cookie = require('./session/cookie')\nvar MemoryStore = require('./session/memory')\nvar Session = require('./session/session')\nvar Store = require('./session/store')\n\n// environment\n\nvar env = process.env.NODE_ENV;\n\n/**\n * Expose the middleware.\n */\n\nexports = module.exports = session;\n\n/**\n * Expose constructors.\n */\n\nexports.Store = Store;\nexports.Cookie = Cookie;\nexports.Session = Session;\nexports.MemoryStore = MemoryStore;\n\n/**\n * Warning message for `MemoryStore` usage in production.\n * @private\n */\n\nvar warning = 'Warning: connect.session() MemoryStore is not\\n'\n + 'designed for a production environment, as it will leak\\n'\n + 'memory, and will not scale past a single process.';\n\n/**\n * Node.js 0.8+ async implementation.\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Setup session store with the given `options`.\n *\n * @param {Object} [options]\n * @param {Object} [options.cookie] Options for cookie\n * @param {Function} [options.genid]\n * @param {String} [options.name=connect.sid] Session ID cookie name\n * @param {Boolean} [options.proxy]\n * @param {Boolean} [options.resave] Resave unmodified sessions back to the store\n * @param {Boolean} [options.rolling] Enable/disable rolling session expiration\n * @param {Boolean} [options.saveUninitialized] Save uninitialized sessions to the store\n * @param {String|Array} [options.secret] Secret for signing session ID\n * @param {Object} [options.store=MemoryStore] Session store\n * @param {String} [options.unset]\n * @return {Function} middleware\n * @public\n */\n\nfunction session(options) {\n var opts = options || {}\n\n // get the cookie options\n var cookieOptions = opts.cookie || {}\n\n // get the session id generate function\n var generateId = opts.genid || generateSessionId\n\n // get the session cookie name\n var name = opts.name || opts.key || 'connect.sid'\n\n // get the session store\n var store = opts.store || new MemoryStore()\n\n // get the trust proxy setting\n var trustProxy = opts.proxy\n\n // get the resave session option\n var resaveSession = opts.resave;\n\n // get the rolling session option\n var rollingSessions = Boolean(opts.rolling)\n\n // get the save uninitialized session option\n var saveUninitializedSession = opts.saveUninitialized\n\n // get the cookie signing secret\n var secret = opts.secret\n\n if (typeof generateId !== 'function') {\n throw new TypeError('genid option must be a function');\n }\n\n if (resaveSession === undefined) {\n deprecate('undefined resave option; provide resave option');\n resaveSession = true;\n }\n\n if (saveUninitializedSession === undefined) {\n deprecate('undefined saveUninitialized option; provide saveUninitialized option');\n saveUninitializedSession = true;\n }\n\n if (opts.unset && opts.unset !== 'destroy' && opts.unset !== 'keep') {\n throw new TypeError('unset option must be \"destroy\" or \"keep\"');\n }\n\n // TODO: switch to \"destroy\" on next major\n var unsetDestroy = opts.unset === 'destroy'\n\n if (Array.isArray(secret) && secret.length === 0) {\n throw new TypeError('secret option array must contain one or more strings');\n }\n\n if (secret && !Array.isArray(secret)) {\n secret = [secret];\n }\n\n if (!secret) {\n deprecate('req.secret; provide secret option');\n }\n\n // notify user that this store is not\n // meant for a production environment\n /* istanbul ignore next: not tested */\n if (env === 'production' && store instanceof MemoryStore) {\n console.warn(warning);\n }\n\n // generates the new session\n store.generate = function(req){\n req.sessionID = generateId(req);\n req.session = new Session(req);\n req.session.cookie = new Cookie(cookieOptions);\n\n if (cookieOptions.secure === 'auto') {\n req.session.cookie.secure = issecure(req, trustProxy);\n }\n };\n\n var storeImplementsTouch = typeof store.touch === 'function';\n\n // register event listeners for the store to track readiness\n var storeReady = true\n store.on('disconnect', function ondisconnect() {\n storeReady = false\n })\n store.on('connect', function onconnect() {\n storeReady = true\n })\n\n return function session(req, res, next) {\n // self-awareness\n if (req.session) {\n next()\n return\n }\n\n // Handle connection as if there is no session if\n // the store has temporarily disconnected etc\n if (!storeReady) {\n debug('store is disconnected')\n next()\n return\n }\n\n // pathname mismatch\n var originalPath = parseUrl.original(req).pathname || '/'\n if (originalPath.indexOf(cookieOptions.path || '/') !== 0) return next();\n\n // ensure a secret is available or bail\n if (!secret && !req.secret) {\n next(new Error('secret option required for sessions'));\n return;\n }\n\n // backwards compatibility for signed cookies\n // req.secret is passed from the cookie parser middleware\n var secrets = secret || [req.secret];\n\n var originalHash;\n var originalId;\n var savedHash;\n var touched = false\n\n // expose store\n req.sessionStore = store;\n\n // get the session ID from the cookie\n var cookieId = req.sessionID = getcookie(req, name, secrets);\n\n // set-cookie\n onHeaders(res, function(){\n if (!req.session) {\n debug('no session');\n return;\n }\n\n if (!shouldSetCookie(req)) {\n return;\n }\n\n // only send secure cookies via https\n if (req.session.cookie.secure && !issecure(req, trustProxy)) {\n debug('not secured');\n return;\n }\n\n if (!touched) {\n // touch session\n req.session.touch()\n touched = true\n }\n\n // set cookie\n setcookie(res, name, req.sessionID, secrets[0], req.session.cookie.data);\n });\n\n // proxy end() to commit the session\n var _end = res.end;\n var _write = res.write;\n var ended = false;\n res.end = function end(chunk, encoding) {\n if (ended) {\n return false;\n }\n\n ended = true;\n\n var ret;\n var sync = true;\n\n function writeend() {\n if (sync) {\n ret = _end.call(res, chunk, encoding);\n sync = false;\n return;\n }\n\n _end.call(res);\n }\n\n function writetop() {\n if (!sync) {\n return ret;\n }\n\n if (!res._header) {\n res._implicitHeader()\n }\n\n if (chunk == null) {\n ret = true;\n return ret;\n }\n\n var contentLength = Number(res.getHeader('Content-Length'));\n\n if (!isNaN(contentLength) && contentLength > 0) {\n // measure chunk\n chunk = !Buffer.isBuffer(chunk)\n ? Buffer.from(chunk, encoding)\n : chunk;\n encoding = undefined;\n\n if (chunk.length !== 0) {\n debug('split response');\n ret = _write.call(res, chunk.slice(0, chunk.length - 1));\n chunk = chunk.slice(chunk.length - 1, chunk.length);\n return ret;\n }\n }\n\n ret = _write.call(res, chunk, encoding);\n sync = false;\n\n return ret;\n }\n\n if (shouldDestroy(req)) {\n // destroy session\n debug('destroying');\n store.destroy(req.sessionID, function ondestroy(err) {\n if (err) {\n defer(next, err);\n }\n\n debug('destroyed');\n writeend();\n });\n\n return writetop();\n }\n\n // no session to save\n if (!req.session) {\n debug('no session');\n return _end.call(res, chunk, encoding);\n }\n\n if (!touched) {\n // touch session\n req.session.touch()\n touched = true\n }\n\n if (shouldSave(req)) {\n req.session.save(function onsave(err) {\n if (err) {\n defer(next, err);\n }\n\n writeend();\n });\n\n return writetop();\n } else if (storeImplementsTouch && shouldTouch(req)) {\n // store implements touch method\n debug('touching');\n store.touch(req.sessionID, req.session, function ontouch(err) {\n if (err) {\n defer(next, err);\n }\n\n debug('touched');\n writeend();\n });\n\n return writetop();\n }\n\n return _end.call(res, chunk, encoding);\n };\n\n // generate the session\n function generate() {\n store.generate(req);\n originalId = req.sessionID;\n originalHash = hash(req.session);\n wrapmethods(req.session);\n }\n\n // inflate the session\n function inflate (req, sess) {\n store.createSession(req, sess)\n originalId = req.sessionID\n originalHash = hash(sess)\n\n if (!resaveSession) {\n savedHash = originalHash\n }\n\n wrapmethods(req.session)\n }\n\n function rewrapmethods (sess, callback) {\n return function () {\n if (req.session !== sess) {\n wrapmethods(req.session)\n }\n\n callback.apply(this, arguments)\n }\n }\n\n // wrap session methods\n function wrapmethods(sess) {\n var _reload = sess.reload\n var _save = sess.save;\n\n function reload(callback) {\n debug('reloading %s', this.id)\n _reload.call(this, rewrapmethods(this, callback))\n }\n\n function save() {\n debug('saving %s', this.id);\n savedHash = hash(this);\n _save.apply(this, arguments);\n }\n\n Object.defineProperty(sess, 'reload', {\n configurable: true,\n enumerable: false,\n value: reload,\n writable: true\n })\n\n Object.defineProperty(sess, 'save', {\n configurable: true,\n enumerable: false,\n value: save,\n writable: true\n });\n }\n\n // check if session has been modified\n function isModified(sess) {\n return originalId !== sess.id || originalHash !== hash(sess);\n }\n\n // check if session has been saved\n function isSaved(sess) {\n return originalId === sess.id && savedHash === hash(sess);\n }\n\n // determine if session should be destroyed\n function shouldDestroy(req) {\n return req.sessionID && unsetDestroy && req.session == null;\n }\n\n // determine if session should be saved to store\n function shouldSave(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n debug('session ignored because of bogus req.sessionID %o', req.sessionID);\n return false;\n }\n\n return !saveUninitializedSession && !savedHash && cookieId !== req.sessionID\n ? isModified(req.session)\n : !isSaved(req.session)\n }\n\n // determine if session should be touched\n function shouldTouch(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n debug('session ignored because of bogus req.sessionID %o', req.sessionID);\n return false;\n }\n\n return cookieId === req.sessionID && !shouldSave(req);\n }\n\n // determine if cookie should be set on response\n function shouldSetCookie(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n return false;\n }\n\n return cookieId !== req.sessionID\n ? saveUninitializedSession || isModified(req.session)\n : rollingSessions || req.session.cookie.expires != null && isModified(req.session);\n }\n\n // generate a session if the browser doesn't send a sessionID\n if (!req.sessionID) {\n debug('no SID sent, generating session');\n generate();\n next();\n return;\n }\n\n // generate the session object\n debug('fetching %s', req.sessionID);\n store.get(req.sessionID, function(err, sess){\n // error handling\n if (err && err.code !== 'ENOENT') {\n debug('error %j', err);\n next(err)\n return\n }\n\n try {\n if (err || !sess) {\n debug('no session found')\n generate()\n } else {\n debug('session found')\n inflate(req, sess)\n }\n } catch (e) {\n next(e)\n return\n }\n\n next()\n });\n };\n};\n\n/**\n * Generate a session ID for a new session.\n *\n * @return {String}\n * @private\n */\n\nfunction generateSessionId(sess) {\n return uid(24);\n}\n\n/**\n * Get the session ID cookie from request.\n *\n * @return {string}\n * @private\n */\n\nfunction getcookie(req, name, secrets) {\n var header = req.headers.cookie;\n var raw;\n var val;\n\n // read from cookie header\n if (header) {\n var cookies = cookie.parse(header);\n\n raw = cookies[name];\n\n if (raw) {\n if (raw.substr(0, 2) === 's:') {\n val = unsigncookie(raw.slice(2), secrets);\n\n if (val === false) {\n debug('cookie signature invalid');\n val = undefined;\n }\n } else {\n debug('cookie unsigned')\n }\n }\n }\n\n // back-compat read from cookieParser() signedCookies data\n if (!val && req.signedCookies) {\n val = req.signedCookies[name];\n\n if (val) {\n deprecate('cookie should be available in req.headers.cookie');\n }\n }\n\n // back-compat read from cookieParser() cookies data\n if (!val && req.cookies) {\n raw = req.cookies[name];\n\n if (raw) {\n if (raw.substr(0, 2) === 's:') {\n val = unsigncookie(raw.slice(2), secrets);\n\n if (val) {\n deprecate('cookie should be available in req.headers.cookie');\n }\n\n if (val === false) {\n debug('cookie signature invalid');\n val = undefined;\n }\n } else {\n debug('cookie unsigned')\n }\n }\n }\n\n return val;\n}\n\n/**\n * Hash the given `sess` object omitting changes to `.cookie`.\n *\n * @param {Object} sess\n * @return {String}\n * @private\n */\n\nfunction hash(sess) {\n // serialize\n var str = JSON.stringify(sess, function (key, val) {\n // ignore sess.cookie property\n if (this === sess && key === 'cookie') {\n return\n }\n\n return val\n })\n\n // hash\n return crypto\n .createHash('sha1')\n .update(str, 'utf8')\n .digest('hex')\n}\n\n/**\n * Determine if request is secure.\n *\n * @param {Object} req\n * @param {Boolean} [trustProxy]\n * @return {Boolean}\n * @private\n */\n\nfunction issecure(req, trustProxy) {\n // socket is https server\n if (req.connection && req.connection.encrypted) {\n return true;\n }\n\n // do not trust proxy\n if (trustProxy === false) {\n return false;\n }\n\n // no explicit trust; try req.secure from express\n if (trustProxy !== true) {\n return req.secure === true\n }\n\n // read the proto from x-forwarded-proto header\n var header = req.headers['x-forwarded-proto'] || '';\n var index = header.indexOf(',');\n var proto = index !== -1\n ? header.substr(0, index).toLowerCase().trim()\n : header.toLowerCase().trim()\n\n return proto === 'https';\n}\n\n/**\n * Set cookie on response.\n *\n * @private\n */\n\nfunction setcookie(res, name, val, secret, options) {\n var signed = 's:' + signature.sign(val, secret);\n var data = cookie.serialize(name, signed, options);\n\n debug('set-cookie %s', data);\n\n var prev = res.getHeader('Set-Cookie') || []\n var header = Array.isArray(prev) ? prev.concat(data) : [prev, data];\n\n res.setHeader('Set-Cookie', header)\n}\n\n/**\n * Verify and decode the given `val` with `secrets`.\n *\n * @param {String} val\n * @param {Array} secrets\n * @returns {String|Boolean}\n * @private\n */\nfunction unsigncookie(val, secrets) {\n for (var i = 0; i < secrets.length; i++) {\n var result = signature.unsign(val, secrets[i]);\n\n if (result !== false) {\n return result;\n }\n }\n\n return false;\n}\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/*!\n * Connect - session - Cookie\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar cookie = require('cookie')\nvar deprecate = require('depd')('express-session')\n\n/**\n * Initialize a new `Cookie` with the given `options`.\n *\n * @param {IncomingMessage} req\n * @param {Object} options\n * @api private\n */\n\nvar Cookie = module.exports = function Cookie(options) {\n this.path = '/';\n this.maxAge = null;\n this.httpOnly = true;\n\n if (options) {\n if (typeof options !== 'object') {\n throw new TypeError('argument options must be a object')\n }\n\n for (var key in options) {\n if (key !== 'data') {\n this[key] = options[key]\n }\n }\n }\n\n if (this.originalMaxAge === undefined || this.originalMaxAge === null) {\n this.originalMaxAge = this.maxAge\n }\n};\n\n/*!\n * Prototype.\n */\n\nCookie.prototype = {\n\n /**\n * Set expires `date`.\n *\n * @param {Date} date\n * @api public\n */\n\n set expires(date) {\n this._expires = date;\n this.originalMaxAge = this.maxAge;\n },\n\n /**\n * Get expires `date`.\n *\n * @return {Date}\n * @api public\n */\n\n get expires() {\n return this._expires;\n },\n\n /**\n * Set expires via max-age in `ms`.\n *\n * @param {Number} ms\n * @api public\n */\n\n set maxAge(ms) {\n if (ms && typeof ms !== 'number' && !(ms instanceof Date)) {\n throw new TypeError('maxAge must be a number or Date')\n }\n\n if (ms instanceof Date) {\n deprecate('maxAge as Date; pass number of milliseconds instead')\n }\n\n this.expires = typeof ms === 'number'\n ? new Date(Date.now() + ms)\n : ms;\n },\n\n /**\n * Get expires max-age in `ms`.\n *\n * @return {Number}\n * @api public\n */\n\n get maxAge() {\n return this.expires instanceof Date\n ? this.expires.valueOf() - Date.now()\n : this.expires;\n },\n\n /**\n * Return cookie data object.\n *\n * @return {Object}\n * @api private\n */\n\n get data() {\n return {\n originalMaxAge: this.originalMaxAge\n , expires: this._expires\n , secure: this.secure\n , httpOnly: this.httpOnly\n , domain: this.domain\n , path: this.path\n , sameSite: this.sameSite\n }\n },\n\n /**\n * Return a serialized cookie string.\n *\n * @return {String}\n * @api public\n */\n\n serialize: function(name, val){\n return cookie.serialize(name, val, this.data);\n },\n\n /**\n * Return JSON representation of this cookie.\n *\n * @return {Object}\n * @api private\n */\n\n toJSON: function(){\n return this.data;\n }\n};\n","/*!\n * express-session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Store = require('./store')\nvar util = require('util')\n\n/**\n * Shim setImmediate for node.js < 0.10\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Module exports.\n */\n\nmodule.exports = MemoryStore\n\n/**\n * A session store in memory.\n * @public\n */\n\nfunction MemoryStore() {\n Store.call(this)\n this.sessions = Object.create(null)\n}\n\n/**\n * Inherit from Store.\n */\n\nutil.inherits(MemoryStore, Store)\n\n/**\n * Get all active sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.all = function all(callback) {\n var sessionIds = Object.keys(this.sessions)\n var sessions = Object.create(null)\n\n for (var i = 0; i < sessionIds.length; i++) {\n var sessionId = sessionIds[i]\n var session = getSession.call(this, sessionId)\n\n if (session) {\n sessions[sessionId] = session;\n }\n }\n\n callback && defer(callback, null, sessions)\n}\n\n/**\n * Clear all sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.clear = function clear(callback) {\n this.sessions = Object.create(null)\n callback && defer(callback)\n}\n\n/**\n * Destroy the session associated with the given session ID.\n *\n * @param {string} sessionId\n * @public\n */\n\nMemoryStore.prototype.destroy = function destroy(sessionId, callback) {\n delete this.sessions[sessionId]\n callback && defer(callback)\n}\n\n/**\n * Fetch session by the given session ID.\n *\n * @param {string} sessionId\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.get = function get(sessionId, callback) {\n defer(callback, null, getSession.call(this, sessionId))\n}\n\n/**\n * Commit the given session associated with the given sessionId to the store.\n *\n * @param {string} sessionId\n * @param {object} session\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.set = function set(sessionId, session, callback) {\n this.sessions[sessionId] = JSON.stringify(session)\n callback && defer(callback)\n}\n\n/**\n * Get number of active sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.length = function length(callback) {\n this.all(function (err, sessions) {\n if (err) return callback(err)\n callback(null, Object.keys(sessions).length)\n })\n}\n\n/**\n * Touch the given session object associated with the given session ID.\n *\n * @param {string} sessionId\n * @param {object} session\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.touch = function touch(sessionId, session, callback) {\n var currentSession = getSession.call(this, sessionId)\n\n if (currentSession) {\n // update expiration\n currentSession.cookie = session.cookie\n this.sessions[sessionId] = JSON.stringify(currentSession)\n }\n\n callback && defer(callback)\n}\n\n/**\n * Get session from the store.\n * @private\n */\n\nfunction getSession(sessionId) {\n var sess = this.sessions[sessionId]\n\n if (!sess) {\n return\n }\n\n // parse\n sess = JSON.parse(sess)\n\n if (sess.cookie) {\n var expires = typeof sess.cookie.expires === 'string'\n ? new Date(sess.cookie.expires)\n : sess.cookie.expires\n\n // destroy expired session\n if (expires && expires <= Date.now()) {\n delete this.sessions[sessionId]\n return\n }\n }\n\n return sess\n}\n","/*!\n * Connect - session - Session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Expose Session.\n */\n\nmodule.exports = Session;\n\n/**\n * Create a new `Session` with the given request and `data`.\n *\n * @param {IncomingRequest} req\n * @param {Object} data\n * @api private\n */\n\nfunction Session(req, data) {\n Object.defineProperty(this, 'req', { value: req });\n Object.defineProperty(this, 'id', { value: req.sessionID });\n\n if (typeof data === 'object' && data !== null) {\n // merge data into this, ignoring prototype properties\n for (var prop in data) {\n if (!(prop in this)) {\n this[prop] = data[prop]\n }\n }\n }\n}\n\n/**\n * Update reset `.cookie.maxAge` to prevent\n * the cookie from expiring when the\n * session is still active.\n *\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'touch', function touch() {\n return this.resetMaxAge();\n});\n\n/**\n * Reset `.maxAge` to `.originalMaxAge`.\n *\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'resetMaxAge', function resetMaxAge() {\n this.cookie.maxAge = this.cookie.originalMaxAge;\n return this;\n});\n\n/**\n * Save the session data with optional callback `fn(err)`.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'save', function save(fn) {\n this.req.sessionStore.set(this.id, this, fn || function(){});\n return this;\n});\n\n/**\n * Re-loads the session data _without_ altering\n * the maxAge properties. Invokes the callback `fn(err)`,\n * after which time if no exception has occurred the\n * `req.session` property will be a new `Session` object,\n * although representing the same session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'reload', function reload(fn) {\n var req = this.req\n var store = this.req.sessionStore\n\n store.get(this.id, function(err, sess){\n if (err) return fn(err);\n if (!sess) return fn(new Error('failed to load session'));\n store.createSession(req, sess);\n fn();\n });\n return this;\n});\n\n/**\n * Destroy `this` session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'destroy', function destroy(fn) {\n delete this.req.session;\n this.req.sessionStore.destroy(this.id, fn);\n return this;\n});\n\n/**\n * Regenerate this request's session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'regenerate', function regenerate(fn) {\n this.req.sessionStore.regenerate(this.req, fn);\n return this;\n});\n\n/**\n * Helper function for creating a method on a prototype.\n *\n * @param {Object} obj\n * @param {String} name\n * @param {Function} fn\n * @private\n */\nfunction defineMethod(obj, name, fn) {\n Object.defineProperty(obj, name, {\n configurable: true,\n enumerable: false,\n value: fn,\n writable: true\n });\n};\n","/*!\n * Connect - session - Store\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Cookie = require('./cookie')\nvar EventEmitter = require('events').EventEmitter\nvar Session = require('./session')\nvar util = require('util')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Store\n\n/**\n * Abstract base class for session stores.\n * @public\n */\n\nfunction Store () {\n EventEmitter.call(this)\n}\n\n/**\n * Inherit from EventEmitter.\n */\n\nutil.inherits(Store, EventEmitter)\n\n/**\n * Re-generate the given requests's session.\n *\n * @param {IncomingRequest} req\n * @return {Function} fn\n * @api public\n */\n\nStore.prototype.regenerate = function(req, fn){\n var self = this;\n this.destroy(req.sessionID, function(err){\n self.generate(req);\n fn(err);\n });\n};\n\n/**\n * Load a `Session` instance via the given `sid`\n * and invoke the callback `fn(err, sess)`.\n *\n * @param {String} sid\n * @param {Function} fn\n * @api public\n */\n\nStore.prototype.load = function(sid, fn){\n var self = this;\n this.get(sid, function(err, sess){\n if (err) return fn(err);\n if (!sess) return fn();\n var req = { sessionID: sid, sessionStore: self };\n fn(null, self.createSession(req, sess))\n });\n};\n\n/**\n * Create session from JSON `sess` data.\n *\n * @param {IncomingRequest} req\n * @param {Object} sess\n * @return {Session}\n * @api private\n */\n\nStore.prototype.createSession = function(req, sess){\n var expires = sess.cookie.expires\n var originalMaxAge = sess.cookie.originalMaxAge\n\n sess.cookie = new Cookie(sess.cookie);\n\n if (typeof expires === 'string') {\n // convert expires to a Date object\n sess.cookie.expires = new Date(expires)\n }\n\n // keep originalMaxAge intact\n sess.cookie.originalMaxAge = originalMaxAge\n\n req.session = new Session(req, sess);\n return req.session;\n};\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\nmodule.exports = require('./lib/express');\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar finalhandler = require('finalhandler');\nvar Router = require('./router');\nvar methods = require('methods');\nvar middleware = require('./middleware/init');\nvar query = require('./middleware/query');\nvar debug = require('debug')('express:application');\nvar View = require('./view');\nvar http = require('http');\nvar compileETag = require('./utils').compileETag;\nvar compileQueryParser = require('./utils').compileQueryParser;\nvar compileTrust = require('./utils').compileTrust;\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar merge = require('utils-merge');\nvar resolve = require('path').resolve;\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty\nvar slice = Array.prototype.slice;\n\n/**\n * Application prototype.\n */\n\nvar app = exports = module.exports = {};\n\n/**\n * Variable for trust proxy inheritance back-compat\n * @private\n */\n\nvar trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';\n\n/**\n * Initialize the server.\n *\n * - setup default configuration\n * - setup default middleware\n * - setup route reflection methods\n *\n * @private\n */\n\napp.init = function init() {\n this.cache = {};\n this.engines = {};\n this.settings = {};\n\n this.defaultConfiguration();\n};\n\n/**\n * Initialize application configuration.\n * @private\n */\n\napp.defaultConfiguration = function defaultConfiguration() {\n var env = process.env.NODE_ENV || 'development';\n\n // default settings\n this.enable('x-powered-by');\n this.set('etag', 'weak');\n this.set('env', env);\n this.set('query parser', 'extended');\n this.set('subdomain offset', 2);\n this.set('trust proxy', false);\n\n // trust proxy inherit back-compat\n Object.defineProperty(this.settings, trustProxyDefaultSymbol, {\n configurable: true,\n value: true\n });\n\n debug('booting in %s mode', env);\n\n this.on('mount', function onmount(parent) {\n // inherit trust proxy\n if (this.settings[trustProxyDefaultSymbol] === true\n && typeof parent.settings['trust proxy fn'] === 'function') {\n delete this.settings['trust proxy'];\n delete this.settings['trust proxy fn'];\n }\n\n // inherit protos\n setPrototypeOf(this.request, parent.request)\n setPrototypeOf(this.response, parent.response)\n setPrototypeOf(this.engines, parent.engines)\n setPrototypeOf(this.settings, parent.settings)\n });\n\n // setup locals\n this.locals = Object.create(null);\n\n // top-most app is mounted at /\n this.mountpath = '/';\n\n // default locals\n this.locals.settings = this.settings;\n\n // default configuration\n this.set('view', View);\n this.set('views', resolve('views'));\n this.set('jsonp callback name', 'callback');\n\n if (env === 'production') {\n this.enable('view cache');\n }\n\n Object.defineProperty(this, 'router', {\n get: function() {\n throw new Error('\\'app.router\\' is deprecated!\\nPlease see the 3.x to 4.x migration guide for details on how to update your app.');\n }\n });\n};\n\n/**\n * lazily adds the base router if it has not yet been added.\n *\n * We cannot add the base router in the defaultConfiguration because\n * it reads app settings which might be set after that has run.\n *\n * @private\n */\napp.lazyrouter = function lazyrouter() {\n if (!this._router) {\n this._router = new Router({\n caseSensitive: this.enabled('case sensitive routing'),\n strict: this.enabled('strict routing')\n });\n\n this._router.use(query(this.get('query parser fn')));\n this._router.use(middleware.init(this));\n }\n};\n\n/**\n * Dispatch a req, res pair into the application. Starts pipeline processing.\n *\n * If no callback is provided, then default error handlers will respond\n * in the event of an error bubbling through the stack.\n *\n * @private\n */\n\napp.handle = function handle(req, res, callback) {\n var router = this._router;\n\n // final handler\n var done = callback || finalhandler(req, res, {\n env: this.get('env'),\n onerror: logerror.bind(this)\n });\n\n // no routes\n if (!router) {\n debug('no routes defined on app');\n done();\n return;\n }\n\n router.handle(req, res, done);\n};\n\n/**\n * Proxy `Router#use()` to add middleware to the app router.\n * See Router#use() documentation for details.\n *\n * If the _fn_ parameter is an express app, then it will be\n * mounted at the _route_ specified.\n *\n * @public\n */\n\napp.use = function use(fn) {\n var offset = 0;\n var path = '/';\n\n // default path to '/'\n // disambiguate app.use([fn])\n if (typeof fn !== 'function') {\n var arg = fn;\n\n while (Array.isArray(arg) && arg.length !== 0) {\n arg = arg[0];\n }\n\n // first arg is the path\n if (typeof arg !== 'function') {\n offset = 1;\n path = fn;\n }\n }\n\n var fns = flatten(slice.call(arguments, offset));\n\n if (fns.length === 0) {\n throw new TypeError('app.use() requires a middleware function')\n }\n\n // setup router\n this.lazyrouter();\n var router = this._router;\n\n fns.forEach(function (fn) {\n // non-express app\n if (!fn || !fn.handle || !fn.set) {\n return router.use(path, fn);\n }\n\n debug('.use app under %s', path);\n fn.mountpath = path;\n fn.parent = this;\n\n // restore .app property on req and res\n router.use(path, function mounted_app(req, res, next) {\n var orig = req.app;\n fn.handle(req, res, function (err) {\n setPrototypeOf(req, orig.request)\n setPrototypeOf(res, orig.response)\n next(err);\n });\n });\n\n // mounted an app\n fn.emit('mount', this);\n }, this);\n\n return this;\n};\n\n/**\n * Proxy to the app `Router#route()`\n * Returns a new `Route` instance for the _path_.\n *\n * Routes are isolated middleware stacks for specific paths.\n * See the Route api docs for details.\n *\n * @public\n */\n\napp.route = function route(path) {\n this.lazyrouter();\n return this._router.route(path);\n};\n\n/**\n * Register the given template engine callback `fn`\n * as `ext`.\n *\n * By default will `require()` the engine based on the\n * file extension. For example if you try to render\n * a \"foo.ejs\" file Express will invoke the following internally:\n *\n * app.engine('ejs', require('ejs').__express);\n *\n * For engines that do not provide `.__express` out of the box,\n * or if you wish to \"map\" a different extension to the template engine\n * you may use this method. For example mapping the EJS template engine to\n * \".html\" files:\n *\n * app.engine('html', require('ejs').renderFile);\n *\n * In this case EJS provides a `.renderFile()` method with\n * the same signature that Express expects: `(path, options, callback)`,\n * though note that it aliases this method as `ejs.__express` internally\n * so if you're using \".ejs\" extensions you don't need to do anything.\n *\n * Some template engines do not follow this convention, the\n * [Consolidate.js](https://github.com/tj/consolidate.js)\n * library was created to map all of node's popular template\n * engines to follow this convention, thus allowing them to\n * work seamlessly within Express.\n *\n * @param {String} ext\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\napp.engine = function engine(ext, fn) {\n if (typeof fn !== 'function') {\n throw new Error('callback function required');\n }\n\n // get file extension\n var extension = ext[0] !== '.'\n ? '.' + ext\n : ext;\n\n // store engine\n this.engines[extension] = fn;\n\n return this;\n};\n\n/**\n * Proxy to `Router#param()` with one added api feature. The _name_ parameter\n * can be an array of names.\n *\n * See the Router#param() docs for more details.\n *\n * @param {String|Array} name\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\napp.param = function param(name, fn) {\n this.lazyrouter();\n\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; i++) {\n this.param(name[i], fn);\n }\n\n return this;\n }\n\n this._router.param(name, fn);\n\n return this;\n};\n\n/**\n * Assign `setting` to `val`, or return `setting`'s value.\n *\n * app.set('foo', 'bar');\n * app.set('foo');\n * // => \"bar\"\n *\n * Mounted servers inherit their parent server's settings.\n *\n * @param {String} setting\n * @param {*} [val]\n * @return {Server} for chaining\n * @public\n */\n\napp.set = function set(setting, val) {\n if (arguments.length === 1) {\n // app.get(setting)\n var settings = this.settings\n\n while (settings && settings !== Object.prototype) {\n if (hasOwnProperty.call(settings, setting)) {\n return settings[setting]\n }\n\n settings = Object.getPrototypeOf(settings)\n }\n\n return undefined\n }\n\n debug('set \"%s\" to %o', setting, val);\n\n // set value\n this.settings[setting] = val;\n\n // trigger matched settings\n switch (setting) {\n case 'etag':\n this.set('etag fn', compileETag(val));\n break;\n case 'query parser':\n this.set('query parser fn', compileQueryParser(val));\n break;\n case 'trust proxy':\n this.set('trust proxy fn', compileTrust(val));\n\n // trust proxy inherit back-compat\n Object.defineProperty(this.settings, trustProxyDefaultSymbol, {\n configurable: true,\n value: false\n });\n\n break;\n }\n\n return this;\n};\n\n/**\n * Return the app's absolute pathname\n * based on the parent(s) that have\n * mounted it.\n *\n * For example if the application was\n * mounted as \"/admin\", which itself\n * was mounted as \"/blog\" then the\n * return value would be \"/blog/admin\".\n *\n * @return {String}\n * @private\n */\n\napp.path = function path() {\n return this.parent\n ? this.parent.path() + this.mountpath\n : '';\n};\n\n/**\n * Check if `setting` is enabled (truthy).\n *\n * app.enabled('foo')\n * // => false\n *\n * app.enable('foo')\n * app.enabled('foo')\n * // => true\n *\n * @param {String} setting\n * @return {Boolean}\n * @public\n */\n\napp.enabled = function enabled(setting) {\n return Boolean(this.set(setting));\n};\n\n/**\n * Check if `setting` is disabled.\n *\n * app.disabled('foo')\n * // => true\n *\n * app.enable('foo')\n * app.disabled('foo')\n * // => false\n *\n * @param {String} setting\n * @return {Boolean}\n * @public\n */\n\napp.disabled = function disabled(setting) {\n return !this.set(setting);\n};\n\n/**\n * Enable `setting`.\n *\n * @param {String} setting\n * @return {app} for chaining\n * @public\n */\n\napp.enable = function enable(setting) {\n return this.set(setting, true);\n};\n\n/**\n * Disable `setting`.\n *\n * @param {String} setting\n * @return {app} for chaining\n * @public\n */\n\napp.disable = function disable(setting) {\n return this.set(setting, false);\n};\n\n/**\n * Delegate `.VERB(...)` calls to `router.VERB(...)`.\n */\n\nmethods.forEach(function(method){\n app[method] = function(path){\n if (method === 'get' && arguments.length === 1) {\n // app.get(setting)\n return this.set(path);\n }\n\n this.lazyrouter();\n\n var route = this._router.route(path);\n route[method].apply(route, slice.call(arguments, 1));\n return this;\n };\n});\n\n/**\n * Special-cased \"all\" method, applying the given route `path`,\n * middleware, and callback to _every_ HTTP method.\n *\n * @param {String} path\n * @param {Function} ...\n * @return {app} for chaining\n * @public\n */\n\napp.all = function all(path) {\n this.lazyrouter();\n\n var route = this._router.route(path);\n var args = slice.call(arguments, 1);\n\n for (var i = 0; i < methods.length; i++) {\n route[methods[i]].apply(route, args);\n }\n\n return this;\n};\n\n// del -> delete alias\n\napp.del = deprecate.function(app.delete, 'app.del: Use app.delete instead');\n\n/**\n * Render the given view `name` name with `options`\n * and a callback accepting an error and the\n * rendered template string.\n *\n * Example:\n *\n * app.render('email', { name: 'Tobi' }, function(err, html){\n * // ...\n * })\n *\n * @param {String} name\n * @param {Object|Function} options or fn\n * @param {Function} callback\n * @public\n */\n\napp.render = function render(name, options, callback) {\n var cache = this.cache;\n var done = callback;\n var engines = this.engines;\n var opts = options;\n var renderOptions = {};\n var view;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge app.locals\n merge(renderOptions, this.locals);\n\n // merge options._locals\n if (opts._locals) {\n merge(renderOptions, opts._locals);\n }\n\n // merge options\n merge(renderOptions, opts);\n\n // set .cache unless explicitly provided\n if (renderOptions.cache == null) {\n renderOptions.cache = this.enabled('view cache');\n }\n\n // primed cache\n if (renderOptions.cache) {\n view = cache[name];\n }\n\n // view\n if (!view) {\n var View = this.get('view');\n\n view = new View(name, {\n defaultEngine: this.get('view engine'),\n root: this.get('views'),\n engines: engines\n });\n\n if (!view.path) {\n var dirs = Array.isArray(view.root) && view.root.length > 1\n ? 'directories \"' + view.root.slice(0, -1).join('\", \"') + '\" or \"' + view.root[view.root.length - 1] + '\"'\n : 'directory \"' + view.root + '\"'\n var err = new Error('Failed to lookup view \"' + name + '\" in views ' + dirs);\n err.view = view;\n return done(err);\n }\n\n // prime the cache\n if (renderOptions.cache) {\n cache[name] = view;\n }\n }\n\n // render\n tryRender(view, renderOptions, done);\n};\n\n/**\n * Listen for connections.\n *\n * A node `http.Server` is returned, with this\n * application (which is a `Function`) as its\n * callback. If you wish to create both an HTTP\n * and HTTPS server you may do so with the \"http\"\n * and \"https\" modules as shown here:\n *\n * var http = require('http')\n * , https = require('https')\n * , express = require('express')\n * , app = express();\n *\n * http.createServer(app).listen(80);\n * https.createServer({ ... }, app).listen(443);\n *\n * @return {http.Server}\n * @public\n */\n\napp.listen = function listen() {\n var server = http.createServer(this);\n return server.listen.apply(server, arguments);\n};\n\n/**\n * Log error using console.error.\n *\n * @param {Error} err\n * @private\n */\n\nfunction logerror(err) {\n /* istanbul ignore next */\n if (this.get('env') !== 'test') console.error(err.stack || err.toString());\n}\n\n/**\n * Try rendering a view.\n * @private\n */\n\nfunction tryRender(view, options, callback) {\n try {\n view.render(options, callback);\n } catch (err) {\n callback(err);\n }\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar bodyParser = require('body-parser')\nvar EventEmitter = require('events').EventEmitter;\nvar mixin = require('merge-descriptors');\nvar proto = require('./application');\nvar Route = require('./router/route');\nvar Router = require('./router');\nvar req = require('./request');\nvar res = require('./response');\n\n/**\n * Expose `createApplication()`.\n */\n\nexports = module.exports = createApplication;\n\n/**\n * Create an express application.\n *\n * @return {Function}\n * @api public\n */\n\nfunction createApplication() {\n var app = function(req, res, next) {\n app.handle(req, res, next);\n };\n\n mixin(app, EventEmitter.prototype, false);\n mixin(app, proto, false);\n\n // expose the prototype that will get set on requests\n app.request = Object.create(req, {\n app: { configurable: true, enumerable: true, writable: true, value: app }\n })\n\n // expose the prototype that will get set on responses\n app.response = Object.create(res, {\n app: { configurable: true, enumerable: true, writable: true, value: app }\n })\n\n app.init();\n return app;\n}\n\n/**\n * Expose the prototypes.\n */\n\nexports.application = proto;\nexports.request = req;\nexports.response = res;\n\n/**\n * Expose constructors.\n */\n\nexports.Route = Route;\nexports.Router = Router;\n\n/**\n * Expose middleware\n */\n\nexports.json = bodyParser.json\nexports.query = require('./middleware/query');\nexports.raw = bodyParser.raw\nexports.static = require('serve-static');\nexports.text = bodyParser.text\nexports.urlencoded = bodyParser.urlencoded\n\n/**\n * Replace removed middleware with an appropriate error message.\n */\n\nvar removedMiddlewares = [\n 'bodyParser',\n 'compress',\n 'cookieSession',\n 'session',\n 'logger',\n 'cookieParser',\n 'favicon',\n 'responseTime',\n 'errorHandler',\n 'timeout',\n 'methodOverride',\n 'vhost',\n 'csrf',\n 'directory',\n 'limit',\n 'multipart',\n 'staticCache'\n]\n\nremovedMiddlewares.forEach(function (name) {\n Object.defineProperty(exports, name, {\n get: function () {\n throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');\n },\n configurable: true\n });\n});\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Initialization middleware, exposing the\n * request and response to each other, as well\n * as defaulting the X-Powered-By header field.\n *\n * @param {Function} app\n * @return {Function}\n * @api private\n */\n\nexports.init = function(app){\n return function expressInit(req, res, next){\n if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');\n req.res = res;\n res.req = req;\n req.next = next;\n\n setPrototypeOf(req, app.request)\n setPrototypeOf(res, app.response)\n\n res.locals = res.locals || Object.create(null);\n\n next();\n };\n};\n\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar merge = require('utils-merge')\nvar parseUrl = require('parseurl');\nvar qs = require('qs');\n\n/**\n * @param {Object} options\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function query(options) {\n var opts = merge({}, options)\n var queryparse = qs.parse;\n\n if (typeof options === 'function') {\n queryparse = options;\n opts = undefined;\n }\n\n if (opts !== undefined && opts.allowPrototypes === undefined) {\n // back-compat for qs module\n opts.allowPrototypes = true;\n }\n\n return function query(req, res, next){\n if (!req.query) {\n var val = parseUrl(req).query;\n req.query = queryparse(val, opts);\n }\n\n next();\n };\n};\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar accepts = require('accepts');\nvar deprecate = require('depd')('express');\nvar isIP = require('net').isIP;\nvar typeis = require('type-is');\nvar http = require('http');\nvar fresh = require('fresh');\nvar parseRange = require('range-parser');\nvar parse = require('parseurl');\nvar proxyaddr = require('proxy-addr');\n\n/**\n * Request prototype.\n * @public\n */\n\nvar req = Object.create(http.IncomingMessage.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = req\n\n/**\n * Return request header.\n *\n * The `Referrer` header field is special-cased,\n * both `Referrer` and `Referer` are interchangeable.\n *\n * Examples:\n *\n * req.get('Content-Type');\n * // => \"text/plain\"\n *\n * req.get('content-type');\n * // => \"text/plain\"\n *\n * req.get('Something');\n * // => undefined\n *\n * Aliased as `req.header()`.\n *\n * @param {String} name\n * @return {String}\n * @public\n */\n\nreq.get =\nreq.header = function header(name) {\n if (!name) {\n throw new TypeError('name argument is required to req.get');\n }\n\n if (typeof name !== 'string') {\n throw new TypeError('name must be a string to req.get');\n }\n\n var lc = name.toLowerCase();\n\n switch (lc) {\n case 'referer':\n case 'referrer':\n return this.headers.referrer\n || this.headers.referer;\n default:\n return this.headers[lc];\n }\n};\n\n/**\n * To do: update docs.\n *\n * Check if the given `type(s)` is acceptable, returning\n * the best match when true, otherwise `undefined`, in which\n * case you should respond with 406 \"Not Acceptable\".\n *\n * The `type` value may be a single MIME type string\n * such as \"application/json\", an extension name\n * such as \"json\", a comma-delimited list such as \"json, html, text/plain\",\n * an argument list such as `\"json\", \"html\", \"text/plain\"`,\n * or an array `[\"json\", \"html\", \"text/plain\"]`. When a list\n * or array is given, the _best_ match, if any is returned.\n *\n * Examples:\n *\n * // Accept: text/html\n * req.accepts('html');\n * // => \"html\"\n *\n * // Accept: text/*, application/json\n * req.accepts('html');\n * // => \"html\"\n * req.accepts('text/html');\n * // => \"text/html\"\n * req.accepts('json, text');\n * // => \"json\"\n * req.accepts('application/json');\n * // => \"application/json\"\n *\n * // Accept: text/*, application/json\n * req.accepts('image/png');\n * req.accepts('png');\n * // => undefined\n *\n * // Accept: text/*;q=.5, application/json\n * req.accepts(['html', 'json']);\n * req.accepts('html', 'json');\n * req.accepts('html, json');\n * // => \"json\"\n *\n * @param {String|Array} type(s)\n * @return {String|Array|Boolean}\n * @public\n */\n\nreq.accepts = function(){\n var accept = accepts(this);\n return accept.types.apply(accept, arguments);\n};\n\n/**\n * Check if the given `encoding`s are accepted.\n *\n * @param {String} ...encoding\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsEncodings = function(){\n var accept = accepts(this);\n return accept.encodings.apply(accept, arguments);\n};\n\nreq.acceptsEncoding = deprecate.function(req.acceptsEncodings,\n 'req.acceptsEncoding: Use acceptsEncodings instead');\n\n/**\n * Check if the given `charset`s are acceptable,\n * otherwise you should respond with 406 \"Not Acceptable\".\n *\n * @param {String} ...charset\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsCharsets = function(){\n var accept = accepts(this);\n return accept.charsets.apply(accept, arguments);\n};\n\nreq.acceptsCharset = deprecate.function(req.acceptsCharsets,\n 'req.acceptsCharset: Use acceptsCharsets instead');\n\n/**\n * Check if the given `lang`s are acceptable,\n * otherwise you should respond with 406 \"Not Acceptable\".\n *\n * @param {String} ...lang\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsLanguages = function(){\n var accept = accepts(this);\n return accept.languages.apply(accept, arguments);\n};\n\nreq.acceptsLanguage = deprecate.function(req.acceptsLanguages,\n 'req.acceptsLanguage: Use acceptsLanguages instead');\n\n/**\n * Parse Range header field, capping to the given `size`.\n *\n * Unspecified ranges such as \"0-\" require knowledge of your resource length. In\n * the case of a byte range this is of course the total number of bytes. If the\n * Range header field is not given `undefined` is returned, `-1` when unsatisfiable,\n * and `-2` when syntactically invalid.\n *\n * When ranges are returned, the array has a \"type\" property which is the type of\n * range that is required (most commonly, \"bytes\"). Each array element is an object\n * with a \"start\" and \"end\" property for the portion of the range.\n *\n * The \"combine\" option can be set to `true` and overlapping & adjacent ranges\n * will be combined into a single range.\n *\n * NOTE: remember that ranges are inclusive, so for example \"Range: users=0-3\"\n * should respond with 4 users when available, not 3.\n *\n * @param {number} size\n * @param {object} [options]\n * @param {boolean} [options.combine=false]\n * @return {number|array}\n * @public\n */\n\nreq.range = function range(size, options) {\n var range = this.get('Range');\n if (!range) return;\n return parseRange(size, range, options);\n};\n\n/**\n * Return the value of param `name` when present or `defaultValue`.\n *\n * - Checks route placeholders, ex: _/user/:id_\n * - Checks body params, ex: id=12, {\"id\":12}\n * - Checks query string params, ex: ?id=12\n *\n * To utilize request bodies, `req.body`\n * should be an object. This can be done by using\n * the `bodyParser()` middleware.\n *\n * @param {String} name\n * @param {Mixed} [defaultValue]\n * @return {String}\n * @public\n */\n\nreq.param = function param(name, defaultValue) {\n var params = this.params || {};\n var body = this.body || {};\n var query = this.query || {};\n\n var args = arguments.length === 1\n ? 'name'\n : 'name, default';\n deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead');\n\n if (null != params[name] && params.hasOwnProperty(name)) return params[name];\n if (null != body[name]) return body[name];\n if (null != query[name]) return query[name];\n\n return defaultValue;\n};\n\n/**\n * Check if the incoming request contains the \"Content-Type\"\n * header field, and it contains the given mime `type`.\n *\n * Examples:\n *\n * // With Content-Type: text/html; charset=utf-8\n * req.is('html');\n * req.is('text/html');\n * req.is('text/*');\n * // => true\n *\n * // When Content-Type is application/json\n * req.is('json');\n * req.is('application/json');\n * req.is('application/*');\n * // => true\n *\n * req.is('html');\n * // => false\n *\n * @param {String|Array} types...\n * @return {String|false|null}\n * @public\n */\n\nreq.is = function is(types) {\n var arr = types;\n\n // support flattened arguments\n if (!Array.isArray(types)) {\n arr = new Array(arguments.length);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arguments[i];\n }\n }\n\n return typeis(this, arr);\n};\n\n/**\n * Return the protocol string \"http\" or \"https\"\n * when requested with TLS. When the \"trust proxy\"\n * setting trusts the socket address, the\n * \"X-Forwarded-Proto\" header field will be trusted\n * and used if present.\n *\n * If you're running behind a reverse proxy that\n * supplies https for you this may be enabled.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'protocol', function protocol(){\n var proto = this.connection.encrypted\n ? 'https'\n : 'http';\n var trust = this.app.get('trust proxy fn');\n\n if (!trust(this.connection.remoteAddress, 0)) {\n return proto;\n }\n\n // Note: X-Forwarded-Proto is normally only ever a\n // single value, but this is to be safe.\n var header = this.get('X-Forwarded-Proto') || proto\n var index = header.indexOf(',')\n\n return index !== -1\n ? header.substring(0, index).trim()\n : header.trim()\n});\n\n/**\n * Short-hand for:\n *\n * req.protocol === 'https'\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'secure', function secure(){\n return this.protocol === 'https';\n});\n\n/**\n * Return the remote address from the trusted proxy.\n *\n * The is the remote address on the socket unless\n * \"trust proxy\" is set.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'ip', function ip(){\n var trust = this.app.get('trust proxy fn');\n return proxyaddr(this, trust);\n});\n\n/**\n * When \"trust proxy\" is set, trusted proxy addresses + client.\n *\n * For example if the value were \"client, proxy1, proxy2\"\n * you would receive the array `[\"client\", \"proxy1\", \"proxy2\"]`\n * where \"proxy2\" is the furthest down-stream and \"proxy1\" and\n * \"proxy2\" were trusted.\n *\n * @return {Array}\n * @public\n */\n\ndefineGetter(req, 'ips', function ips() {\n var trust = this.app.get('trust proxy fn');\n var addrs = proxyaddr.all(this, trust);\n\n // reverse the order (to farthest -> closest)\n // and remove socket address\n addrs.reverse().pop()\n\n return addrs\n});\n\n/**\n * Return subdomains as an array.\n *\n * Subdomains are the dot-separated parts of the host before the main domain of\n * the app. By default, the domain of the app is assumed to be the last two\n * parts of the host. This can be changed by setting \"subdomain offset\".\n *\n * For example, if the domain is \"tobi.ferrets.example.com\":\n * If \"subdomain offset\" is not set, req.subdomains is `[\"ferrets\", \"tobi\"]`.\n * If \"subdomain offset\" is 3, req.subdomains is `[\"tobi\"]`.\n *\n * @return {Array}\n * @public\n */\n\ndefineGetter(req, 'subdomains', function subdomains() {\n var hostname = this.hostname;\n\n if (!hostname) return [];\n\n var offset = this.app.get('subdomain offset');\n var subdomains = !isIP(hostname)\n ? hostname.split('.').reverse()\n : [hostname];\n\n return subdomains.slice(offset);\n});\n\n/**\n * Short-hand for `url.parse(req.url).pathname`.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'path', function path() {\n return parse(this).pathname;\n});\n\n/**\n * Parse the \"Host\" header field to a hostname.\n *\n * When the \"trust proxy\" setting trusts the socket\n * address, the \"X-Forwarded-Host\" header field will\n * be trusted.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'hostname', function hostname(){\n var trust = this.app.get('trust proxy fn');\n var host = this.get('X-Forwarded-Host');\n\n if (!host || !trust(this.connection.remoteAddress, 0)) {\n host = this.get('Host');\n } else if (host.indexOf(',') !== -1) {\n // Note: X-Forwarded-Host is normally only ever a\n // single value, but this is to be safe.\n host = host.substring(0, host.indexOf(',')).trimRight()\n }\n\n if (!host) return;\n\n // IPv6 literal support\n var offset = host[0] === '['\n ? host.indexOf(']') + 1\n : 0;\n var index = host.indexOf(':', offset);\n\n return index !== -1\n ? host.substring(0, index)\n : host;\n});\n\n// TODO: change req.host to return host in next major\n\ndefineGetter(req, 'host', deprecate.function(function host(){\n return this.hostname;\n}, 'req.host: Use req.hostname instead'));\n\n/**\n * Check if the request is fresh, aka\n * Last-Modified and/or the ETag\n * still match.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'fresh', function(){\n var method = this.method;\n var res = this.res\n var status = res.statusCode\n\n // GET or HEAD for weak freshness validation only\n if ('GET' !== method && 'HEAD' !== method) return false;\n\n // 2xx or 304 as per rfc2616 14.26\n if ((status >= 200 && status < 300) || 304 === status) {\n return fresh(this.headers, {\n 'etag': res.get('ETag'),\n 'last-modified': res.get('Last-Modified')\n })\n }\n\n return false;\n});\n\n/**\n * Check if the request is stale, aka\n * \"Last-Modified\" and / or the \"ETag\" for the\n * resource has changed.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'stale', function stale(){\n return !this.fresh;\n});\n\n/**\n * Check if the request was an _XMLHttpRequest_.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'xhr', function xhr(){\n var val = this.get('X-Requested-With') || '';\n return val.toLowerCase() === 'xmlhttprequest';\n});\n\n/**\n * Helper function for creating a getter on an object.\n *\n * @param {Object} obj\n * @param {String} name\n * @param {Function} getter\n * @private\n */\nfunction defineGetter(obj, name, getter) {\n Object.defineProperty(obj, name, {\n configurable: true,\n enumerable: true,\n get: getter\n });\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar contentDisposition = require('content-disposition');\nvar createError = require('http-errors')\nvar deprecate = require('depd')('express');\nvar encodeUrl = require('encodeurl');\nvar escapeHtml = require('escape-html');\nvar http = require('http');\nvar isAbsolute = require('./utils').isAbsolute;\nvar onFinished = require('on-finished');\nvar path = require('path');\nvar statuses = require('statuses')\nvar merge = require('utils-merge');\nvar sign = require('cookie-signature').sign;\nvar normalizeType = require('./utils').normalizeType;\nvar normalizeTypes = require('./utils').normalizeTypes;\nvar setCharset = require('./utils').setCharset;\nvar cookie = require('cookie');\nvar send = require('send');\nvar extname = path.extname;\nvar mime = send.mime;\nvar resolve = path.resolve;\nvar vary = require('vary');\n\n/**\n * Response prototype.\n * @public\n */\n\nvar res = Object.create(http.ServerResponse.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = res\n\n/**\n * Module variables.\n * @private\n */\n\nvar charsetRegExp = /;\\s*charset\\s*=/;\n\n/**\n * Set status `code`.\n *\n * @param {Number} code\n * @return {ServerResponse}\n * @public\n */\n\nres.status = function status(code) {\n if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) {\n deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead')\n }\n this.statusCode = code;\n return this;\n};\n\n/**\n * Set Link header field with the given `links`.\n *\n * Examples:\n *\n * res.links({\n * next: 'http://api.example.com/users?page=2',\n * last: 'http://api.example.com/users?page=5'\n * });\n *\n * @param {Object} links\n * @return {ServerResponse}\n * @public\n */\n\nres.links = function(links){\n var link = this.get('Link') || '';\n if (link) link += ', ';\n return this.set('Link', link + Object.keys(links).map(function(rel){\n return '<' + links[rel] + '>; rel=\"' + rel + '\"';\n }).join(', '));\n};\n\n/**\n * Send a response.\n *\n * Examples:\n *\n * res.send(Buffer.from('wahoo'));\n * res.send({ some: 'json' });\n * res.send('

some html

');\n *\n * @param {string|number|boolean|object|Buffer} body\n * @public\n */\n\nres.send = function send(body) {\n var chunk = body;\n var encoding;\n var req = this.req;\n var type;\n\n // settings\n var app = this.app;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.send(body, status) backwards compat\n if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') {\n deprecate('res.send(body, status): Use res.status(status).send(body) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.send(status, body): Use res.status(status).send(body) instead');\n this.statusCode = arguments[0];\n chunk = arguments[1];\n }\n }\n\n // disambiguate res.send(status) and res.send(status, num)\n if (typeof chunk === 'number' && arguments.length === 1) {\n // res.send(status) will set status message as text string\n if (!this.get('Content-Type')) {\n this.type('txt');\n }\n\n deprecate('res.send(status): Use res.sendStatus(status) instead');\n this.statusCode = chunk;\n chunk = statuses.message[chunk]\n }\n\n switch (typeof chunk) {\n // string defaulting to html\n case 'string':\n if (!this.get('Content-Type')) {\n this.type('html');\n }\n break;\n case 'boolean':\n case 'number':\n case 'object':\n if (chunk === null) {\n chunk = '';\n } else if (Buffer.isBuffer(chunk)) {\n if (!this.get('Content-Type')) {\n this.type('bin');\n }\n } else {\n return this.json(chunk);\n }\n break;\n }\n\n // write strings in utf-8\n if (typeof chunk === 'string') {\n encoding = 'utf8';\n type = this.get('Content-Type');\n\n // reflect this in content-type\n if (typeof type === 'string') {\n this.set('Content-Type', setCharset(type, 'utf-8'));\n }\n }\n\n // determine if ETag should be generated\n var etagFn = app.get('etag fn')\n var generateETag = !this.get('ETag') && typeof etagFn === 'function'\n\n // populate Content-Length\n var len\n if (chunk !== undefined) {\n if (Buffer.isBuffer(chunk)) {\n // get length of Buffer\n len = chunk.length\n } else if (!generateETag && chunk.length < 1000) {\n // just calculate length when no ETag + small chunk\n len = Buffer.byteLength(chunk, encoding)\n } else {\n // convert chunk to Buffer and calculate\n chunk = Buffer.from(chunk, encoding)\n encoding = undefined;\n len = chunk.length\n }\n\n this.set('Content-Length', len);\n }\n\n // populate ETag\n var etag;\n if (generateETag && len !== undefined) {\n if ((etag = etagFn(chunk, encoding))) {\n this.set('ETag', etag);\n }\n }\n\n // freshness\n if (req.fresh) this.statusCode = 304;\n\n // strip irrelevant headers\n if (204 === this.statusCode || 304 === this.statusCode) {\n this.removeHeader('Content-Type');\n this.removeHeader('Content-Length');\n this.removeHeader('Transfer-Encoding');\n chunk = '';\n }\n\n // alter headers for 205\n if (this.statusCode === 205) {\n this.set('Content-Length', '0')\n this.removeHeader('Transfer-Encoding')\n chunk = ''\n }\n\n if (req.method === 'HEAD') {\n // skip body for HEAD\n this.end();\n } else {\n // respond\n this.end(chunk, encoding);\n }\n\n return this;\n};\n\n/**\n * Send JSON response.\n *\n * Examples:\n *\n * res.json(null);\n * res.json({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.json = function json(obj) {\n var val = obj;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.json(body, status) backwards compat\n if (typeof arguments[1] === 'number') {\n deprecate('res.json(obj, status): Use res.status(status).json(obj) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.json(status, obj): Use res.status(status).json(obj) instead');\n this.statusCode = arguments[0];\n val = arguments[1];\n }\n }\n\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(val, replacer, spaces, escape)\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('Content-Type', 'application/json');\n }\n\n return this.send(body);\n};\n\n/**\n * Send JSON response with JSONP callback support.\n *\n * Examples:\n *\n * res.jsonp(null);\n * res.jsonp({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.jsonp = function jsonp(obj) {\n var val = obj;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.jsonp(body, status) backwards compat\n if (typeof arguments[1] === 'number') {\n deprecate('res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead');\n this.statusCode = arguments[0];\n val = arguments[1];\n }\n }\n\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(val, replacer, spaces, escape)\n var callback = this.req.query[app.get('jsonp callback name')];\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'application/json');\n }\n\n // fixup callback\n if (Array.isArray(callback)) {\n callback = callback[0];\n }\n\n // jsonp\n if (typeof callback === 'string' && callback.length !== 0) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'text/javascript');\n\n // restrict callback charset\n callback = callback.replace(/[^\\[\\]\\w$.]/g, '');\n\n if (body === undefined) {\n // empty argument\n body = ''\n } else if (typeof body === 'string') {\n // replace chars not allowed in JavaScript that are in JSON\n body = body\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n }\n\n // the /**/ is a specific security mitigation for \"Rosetta Flash JSONP abuse\"\n // the typeof check is just to reduce client error noise\n body = '/**/ typeof ' + callback + ' === \\'function\\' && ' + callback + '(' + body + ');';\n }\n\n return this.send(body);\n};\n\n/**\n * Send given HTTP status code.\n *\n * Sets the response status to `statusCode` and the body of the\n * response to the standard description from node's http.STATUS_CODES\n * or the statusCode number if no description.\n *\n * Examples:\n *\n * res.sendStatus(200);\n *\n * @param {number} statusCode\n * @public\n */\n\nres.sendStatus = function sendStatus(statusCode) {\n var body = statuses.message[statusCode] || String(statusCode)\n\n this.statusCode = statusCode;\n this.type('txt');\n\n return this.send(body);\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendFile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendFile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendFile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendFile = function sendFile(path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n if (!path) {\n throw new TypeError('path argument is required to res.sendFile');\n }\n\n if (typeof path !== 'string') {\n throw new TypeError('path must be a string to res.sendFile')\n }\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n if (!opts.root && !isAbsolute(path)) {\n throw new TypeError('path must be absolute or specify root to res.sendFile');\n }\n\n // create file stream\n var pathname = encodeURI(path);\n var file = send(req, pathname, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendfile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendfile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendfile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendfile = function (path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // create file stream\n var file = send(req, path, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\nres.sendfile = deprecate.function(res.sendfile,\n 'res.sendfile: Use res.sendFile instead');\n\n/**\n * Transfer the file at the given `path` as an attachment.\n *\n * Optionally providing an alternate attachment `filename`,\n * and optional callback `callback(err)`. The callback is invoked\n * when the data transfer is complete, or when an error has\n * occurred. Be sure to check `res.headersSent` if you plan to respond.\n *\n * Optionally providing an `options` object to use with `res.sendFile()`.\n * This function will set the `Content-Disposition` header, overriding\n * any `Content-Disposition` header passed as header options in order\n * to set the attachment and filename.\n *\n * This method uses `res.sendFile()`.\n *\n * @public\n */\n\nres.download = function download (path, filename, options, callback) {\n var done = callback;\n var name = filename;\n var opts = options || null\n\n // support function as second or third arg\n if (typeof filename === 'function') {\n done = filename;\n name = null;\n opts = null\n } else if (typeof options === 'function') {\n done = options\n opts = null\n }\n\n // support optional filename, where options may be in it's place\n if (typeof filename === 'object' &&\n (typeof options === 'function' || options === undefined)) {\n name = null\n opts = filename\n }\n\n // set Content-Disposition when file is sent\n var headers = {\n 'Content-Disposition': contentDisposition(name || path)\n };\n\n // merge user-provided headers\n if (opts && opts.headers) {\n var keys = Object.keys(opts.headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key.toLowerCase() !== 'content-disposition') {\n headers[key] = opts.headers[key]\n }\n }\n }\n\n // merge user-provided options\n opts = Object.create(opts)\n opts.headers = headers\n\n // Resolve the full path for sendFile\n var fullPath = !opts.root\n ? resolve(path)\n : path\n\n // send file\n return this.sendFile(fullPath, opts, done)\n};\n\n/**\n * Set _Content-Type_ response header with `type` through `mime.lookup()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n *\n * @param {String} type\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.contentType =\nres.type = function contentType(type) {\n var ct = type.indexOf('/') === -1\n ? mime.lookup(type)\n : type;\n\n return this.set('Content-Type', ct);\n};\n\n/**\n * Respond to the Acceptable formats using an `obj`\n * of mime-type callbacks.\n *\n * This method uses `req.accepted`, an array of\n * acceptable types ordered by their quality values.\n * When \"Accept\" is not present the _first_ callback\n * is invoked, otherwise the first match is used. When\n * no match is performed the server responds with\n * 406 \"Not Acceptable\".\n *\n * Content-Type is set for you, however if you choose\n * you may alter this within the callback using `res.type()`\n * or `res.set('Content-Type', ...)`.\n *\n * res.format({\n * 'text/plain': function(){\n * res.send('hey');\n * },\n *\n * 'text/html': function(){\n * res.send('

hey

');\n * },\n *\n * 'application/json': function () {\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * In addition to canonicalized MIME types you may\n * also use extnames mapped to these types:\n *\n * res.format({\n * text: function(){\n * res.send('hey');\n * },\n *\n * html: function(){\n * res.send('

hey

');\n * },\n *\n * json: function(){\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * By default Express passes an `Error`\n * with a `.status` of 406 to `next(err)`\n * if a match is not made. If you provide\n * a `.default` callback it will be invoked\n * instead.\n *\n * @param {Object} obj\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.format = function(obj){\n var req = this.req;\n var next = req.next;\n\n var keys = Object.keys(obj)\n .filter(function (v) { return v !== 'default' })\n\n var key = keys.length > 0\n ? req.accepts(keys)\n : false;\n\n this.vary(\"Accept\");\n\n if (key) {\n this.set('Content-Type', normalizeType(key).value);\n obj[key](req, this, next);\n } else if (obj.default) {\n obj.default(req, this, next)\n } else {\n next(createError(406, {\n types: normalizeTypes(keys).map(function (o) { return o.value })\n }))\n }\n\n return this;\n};\n\n/**\n * Set _Content-Disposition_ header to _attachment_ with optional `filename`.\n *\n * @param {String} filename\n * @return {ServerResponse}\n * @public\n */\n\nres.attachment = function attachment(filename) {\n if (filename) {\n this.type(extname(filename));\n }\n\n this.set('Content-Disposition', contentDisposition(filename));\n\n return this;\n};\n\n/**\n * Append additional header `field` with value `val`.\n *\n * Example:\n *\n * res.append('Link', ['', '']);\n * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');\n * res.append('Warning', '199 Miscellaneous warning');\n *\n * @param {String} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.append = function append(field, val) {\n var prev = this.get(field);\n var value = val;\n\n if (prev) {\n // concat the new and prev vals\n value = Array.isArray(prev) ? prev.concat(val)\n : Array.isArray(val) ? [prev].concat(val)\n : [prev, val]\n }\n\n return this.set(field, value);\n};\n\n/**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n *\n * res.set('Foo', ['bar', 'baz']);\n * res.set('Accept', 'application/json');\n * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n *\n * Aliased as `res.header()`.\n *\n * @param {String|Object} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.set =\nres.header = function header(field, val) {\n if (arguments.length === 2) {\n var value = Array.isArray(val)\n ? val.map(String)\n : String(val);\n\n // add charset to content-type\n if (field.toLowerCase() === 'content-type') {\n if (Array.isArray(value)) {\n throw new TypeError('Content-Type cannot be set to an Array');\n }\n if (!charsetRegExp.test(value)) {\n var charset = mime.charsets.lookup(value.split(';')[0]);\n if (charset) value += '; charset=' + charset.toLowerCase();\n }\n }\n\n this.setHeader(field, value);\n } else {\n for (var key in field) {\n this.set(key, field[key]);\n }\n }\n return this;\n};\n\n/**\n * Get value for header `field`.\n *\n * @param {String} field\n * @return {String}\n * @public\n */\n\nres.get = function(field){\n return this.getHeader(field);\n};\n\n/**\n * Clear cookie `name`.\n *\n * @param {String} name\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.clearCookie = function clearCookie(name, options) {\n var opts = merge({ expires: new Date(1), path: '/' }, options);\n\n return this.cookie(name, '', opts);\n};\n\n/**\n * Set cookie `name` to `value`, with the given `options`.\n *\n * Options:\n *\n * - `maxAge` max-age in milliseconds, converted to `expires`\n * - `signed` sign the cookie\n * - `path` defaults to \"/\"\n *\n * Examples:\n *\n * // \"Remember Me\" for 15 minutes\n * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });\n *\n * // same as above\n * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })\n *\n * @param {String} name\n * @param {String|Object} value\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.cookie = function (name, value, options) {\n var opts = merge({}, options);\n var secret = this.req.secret;\n var signed = opts.signed;\n\n if (signed && !secret) {\n throw new Error('cookieParser(\"secret\") required for signed cookies');\n }\n\n var val = typeof value === 'object'\n ? 'j:' + JSON.stringify(value)\n : String(value);\n\n if (signed) {\n val = 's:' + sign(val, secret);\n }\n\n if (opts.maxAge != null) {\n var maxAge = opts.maxAge - 0\n\n if (!isNaN(maxAge)) {\n opts.expires = new Date(Date.now() + maxAge)\n opts.maxAge = Math.floor(maxAge / 1000)\n }\n }\n\n if (opts.path == null) {\n opts.path = '/';\n }\n\n this.append('Set-Cookie', cookie.serialize(name, String(val), opts));\n\n return this;\n};\n\n/**\n * Set the location header to `url`.\n *\n * The given `url` can also be \"back\", which redirects\n * to the _Referrer_ or _Referer_ headers or \"/\".\n *\n * Examples:\n *\n * res.location('/foo/bar').;\n * res.location('http://example.com');\n * res.location('../login');\n *\n * @param {String} url\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.location = function location(url) {\n var loc = url;\n\n // \"back\" is an alias for the referrer\n if (url === 'back') {\n loc = this.req.get('Referrer') || '/';\n }\n\n // set location\n return this.set('Location', encodeUrl(loc));\n};\n\n/**\n * Redirect to the given `url` with optional response `status`\n * defaulting to 302.\n *\n * The resulting `url` is determined by `res.location()`, so\n * it will play nicely with mounted apps, relative paths,\n * `\"back\"` etc.\n *\n * Examples:\n *\n * res.redirect('/foo/bar');\n * res.redirect('http://example.com');\n * res.redirect(301, 'http://example.com');\n * res.redirect('../login'); // /blog/post/1 -> /blog/login\n *\n * @public\n */\n\nres.redirect = function redirect(url) {\n var address = url;\n var body;\n var status = 302;\n\n // allow status / url\n if (arguments.length === 2) {\n if (typeof arguments[0] === 'number') {\n status = arguments[0];\n address = arguments[1];\n } else {\n deprecate('res.redirect(url, status): Use res.redirect(status, url) instead');\n status = arguments[1];\n }\n }\n\n // Set location header\n address = this.location(address).get('Location');\n\n // Support text/{plain,html} by default\n this.format({\n text: function(){\n body = statuses.message[status] + '. Redirecting to ' + address\n },\n\n html: function(){\n var u = escapeHtml(address);\n body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

'\n },\n\n default: function(){\n body = '';\n }\n });\n\n // Respond\n this.statusCode = status;\n this.set('Content-Length', Buffer.byteLength(body));\n\n if (this.req.method === 'HEAD') {\n this.end();\n } else {\n this.end(body);\n }\n};\n\n/**\n * Add `field` to Vary. If already present in the Vary set, then\n * this call is simply ignored.\n *\n * @param {Array|String} field\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.vary = function(field){\n // checks for back-compat\n if (!field || (Array.isArray(field) && !field.length)) {\n deprecate('res.vary(): Provide a field name');\n return this;\n }\n\n vary(this, field);\n\n return this;\n};\n\n/**\n * Render `view` with the given `options` and optional callback `fn`.\n * When a callback function is given a response will _not_ be made\n * automatically, otherwise a response of _200_ and _text/html_ is given.\n *\n * Options:\n *\n * - `cache` boolean hinting to the engine it should cache\n * - `filename` filename of the view being rendered\n *\n * @public\n */\n\nres.render = function render(view, options, callback) {\n var app = this.req.app;\n var done = callback;\n var opts = options || {};\n var req = this.req;\n var self = this;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge res.locals\n opts._locals = self.locals;\n\n // default callback to respond\n done = done || function (err, str) {\n if (err) return req.next(err);\n self.send(str);\n };\n\n // render\n app.render(view, opts, done);\n};\n\n// pipe the send file stream\nfunction sendfile(res, file, options, callback) {\n var done = false;\n var streaming;\n\n // request aborted\n function onaborted() {\n if (done) return;\n done = true;\n\n var err = new Error('Request aborted');\n err.code = 'ECONNABORTED';\n callback(err);\n }\n\n // directory\n function ondirectory() {\n if (done) return;\n done = true;\n\n var err = new Error('EISDIR, read');\n err.code = 'EISDIR';\n callback(err);\n }\n\n // errors\n function onerror(err) {\n if (done) return;\n done = true;\n callback(err);\n }\n\n // ended\n function onend() {\n if (done) return;\n done = true;\n callback();\n }\n\n // file\n function onfile() {\n streaming = false;\n }\n\n // finished\n function onfinish(err) {\n if (err && err.code === 'ECONNRESET') return onaborted();\n if (err) return onerror(err);\n if (done) return;\n\n setImmediate(function () {\n if (streaming !== false && !done) {\n onaborted();\n return;\n }\n\n if (done) return;\n done = true;\n callback();\n });\n }\n\n // streaming\n function onstream() {\n streaming = true;\n }\n\n file.on('directory', ondirectory);\n file.on('end', onend);\n file.on('error', onerror);\n file.on('file', onfile);\n file.on('stream', onstream);\n onFinished(res, onfinish);\n\n if (options.headers) {\n // set headers on successful transfer\n file.on('headers', function headers(res) {\n var obj = options.headers;\n var keys = Object.keys(obj);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n res.setHeader(k, obj[k]);\n }\n });\n }\n\n // pipe\n file.pipe(res);\n}\n\n/**\n * Stringify JSON, like JSON.stringify, but v8 optimized, with the\n * ability to escape characters that can trigger HTML sniffing.\n *\n * @param {*} value\n * @param {function} replacer\n * @param {number} spaces\n * @param {boolean} escape\n * @returns {string}\n * @private\n */\n\nfunction stringify (value, replacer, spaces, escape) {\n // v8 checks arguments.length for optimizing simple call\n // https://bugs.chromium.org/p/v8/issues/detail?id=4730\n var json = replacer || spaces\n ? JSON.stringify(value, replacer, spaces)\n : JSON.stringify(value);\n\n if (escape && typeof json === 'string') {\n json = json.replace(/[<>&]/g, function (c) {\n switch (c.charCodeAt(0)) {\n case 0x3c:\n return '\\\\u003c'\n case 0x3e:\n return '\\\\u003e'\n case 0x26:\n return '\\\\u0026'\n /* istanbul ignore next: unreachable default */\n default:\n return c\n }\n })\n }\n\n return json\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Route = require('./route');\nvar Layer = require('./layer');\nvar methods = require('methods');\nvar mixin = require('utils-merge');\nvar debug = require('debug')('express:router');\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar parseUrl = require('parseurl');\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Module variables.\n * @private\n */\n\nvar objectRegExp = /^\\[object (\\S+)\\]$/;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n/**\n * Initialize a new `Router` with the given `options`.\n *\n * @param {Object} [options]\n * @return {Router} which is an callable function\n * @public\n */\n\nvar proto = module.exports = function(options) {\n var opts = options || {};\n\n function router(req, res, next) {\n router.handle(req, res, next);\n }\n\n // mixin Router class functions\n setPrototypeOf(router, proto)\n\n router.params = {};\n router._params = [];\n router.caseSensitive = opts.caseSensitive;\n router.mergeParams = opts.mergeParams;\n router.strict = opts.strict;\n router.stack = [];\n\n return router;\n};\n\n/**\n * Map the given param placeholder `name`(s) to the given callback.\n *\n * Parameter mapping is used to provide pre-conditions to routes\n * which use normalized placeholders. For example a _:user_id_ parameter\n * could automatically load a user's information from the database without\n * any additional code,\n *\n * The callback uses the same signature as middleware, the only difference\n * being that the value of the placeholder is passed, in this case the _id_\n * of the user. Once the `next()` function is invoked, just like middleware\n * it will continue on to execute the route, or subsequent parameter functions.\n *\n * Just like in middleware, you must either respond to the request or call next\n * to avoid stalling the request.\n *\n * app.param('user_id', function(req, res, next, id){\n * User.find(id, function(err, user){\n * if (err) {\n * return next(err);\n * } else if (!user) {\n * return next(new Error('failed to load user'));\n * }\n * req.user = user;\n * next();\n * });\n * });\n *\n * @param {String} name\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\nproto.param = function param(name, fn) {\n // param logic\n if (typeof name === 'function') {\n deprecate('router.param(fn): Refactor to use path params');\n this._params.push(name);\n return;\n }\n\n // apply param functions\n var params = this._params;\n var len = params.length;\n var ret;\n\n if (name[0] === ':') {\n deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead')\n name = name.slice(1)\n }\n\n for (var i = 0; i < len; ++i) {\n if (ret = params[i](name, fn)) {\n fn = ret;\n }\n }\n\n // ensure we end up with a\n // middleware function\n if ('function' !== typeof fn) {\n throw new Error('invalid param() call for ' + name + ', got ' + fn);\n }\n\n (this.params[name] = this.params[name] || []).push(fn);\n return this;\n};\n\n/**\n * Dispatch a req, res into the router.\n * @private\n */\n\nproto.handle = function handle(req, res, out) {\n var self = this;\n\n debug('dispatching %s %s', req.method, req.url);\n\n var idx = 0;\n var protohost = getProtohost(req.url) || ''\n var removed = '';\n var slashAdded = false;\n var sync = 0\n var paramcalled = {};\n\n // store options for OPTIONS request\n // only used if OPTIONS request\n var options = [];\n\n // middleware and routes\n var stack = self.stack;\n\n // manage inter-router variables\n var parentParams = req.params;\n var parentUrl = req.baseUrl || '';\n var done = restore(out, req, 'baseUrl', 'next', 'params');\n\n // setup next layer\n req.next = next;\n\n // for options requests, respond with a default if nothing else responds\n if (req.method === 'OPTIONS') {\n done = wrap(done, function(old, err) {\n if (err || options.length === 0) return old(err);\n sendOptionsResponse(res, options, old);\n });\n }\n\n // setup basic req values\n req.baseUrl = parentUrl;\n req.originalUrl = req.originalUrl || req.url;\n\n next();\n\n function next(err) {\n var layerError = err === 'route'\n ? null\n : err;\n\n // remove added slash\n if (slashAdded) {\n req.url = req.url.slice(1)\n slashAdded = false;\n }\n\n // restore altered req.url\n if (removed.length !== 0) {\n req.baseUrl = parentUrl;\n req.url = protohost + removed + req.url.slice(protohost.length)\n removed = '';\n }\n\n // signal to exit router\n if (layerError === 'router') {\n setImmediate(done, null)\n return\n }\n\n // no more matching layers\n if (idx >= stack.length) {\n setImmediate(done, layerError);\n return;\n }\n\n // max sync stack\n if (++sync > 100) {\n return setImmediate(next, err)\n }\n\n // get pathname of request\n var path = getPathname(req);\n\n if (path == null) {\n return done(layerError);\n }\n\n // find next matching layer\n var layer;\n var match;\n var route;\n\n while (match !== true && idx < stack.length) {\n layer = stack[idx++];\n match = matchLayer(layer, path);\n route = layer.route;\n\n if (typeof match !== 'boolean') {\n // hold on to layerError\n layerError = layerError || match;\n }\n\n if (match !== true) {\n continue;\n }\n\n if (!route) {\n // process non-route handlers normally\n continue;\n }\n\n if (layerError) {\n // routes do not match with a pending error\n match = false;\n continue;\n }\n\n var method = req.method;\n var has_method = route._handles_method(method);\n\n // build up automatic options response\n if (!has_method && method === 'OPTIONS') {\n appendMethods(options, route._options());\n }\n\n // don't even bother matching route\n if (!has_method && method !== 'HEAD') {\n match = false;\n }\n }\n\n // no match\n if (match !== true) {\n return done(layerError);\n }\n\n // store route for dispatch on change\n if (route) {\n req.route = route;\n }\n\n // Capture one-time layer values\n req.params = self.mergeParams\n ? mergeParams(layer.params, parentParams)\n : layer.params;\n var layerPath = layer.path;\n\n // this should be done for the layer\n self.process_params(layer, paramcalled, req, res, function (err) {\n if (err) {\n next(layerError || err)\n } else if (route) {\n layer.handle_request(req, res, next)\n } else {\n trim_prefix(layer, layerError, layerPath, path)\n }\n\n sync = 0\n });\n }\n\n function trim_prefix(layer, layerError, layerPath, path) {\n if (layerPath.length !== 0) {\n // Validate path is a prefix match\n if (layerPath !== path.slice(0, layerPath.length)) {\n next(layerError)\n return\n }\n\n // Validate path breaks on a path separator\n var c = path[layerPath.length]\n if (c && c !== '/' && c !== '.') return next(layerError)\n\n // Trim off the part of the url that matches the route\n // middleware (.use stuff) needs to have the path stripped\n debug('trim prefix (%s) from url %s', layerPath, req.url);\n removed = layerPath;\n req.url = protohost + req.url.slice(protohost.length + removed.length)\n\n // Ensure leading slash\n if (!protohost && req.url[0] !== '/') {\n req.url = '/' + req.url;\n slashAdded = true;\n }\n\n // Setup base URL (no trailing slash)\n req.baseUrl = parentUrl + (removed[removed.length - 1] === '/'\n ? removed.substring(0, removed.length - 1)\n : removed);\n }\n\n debug('%s %s : %s', layer.name, layerPath, req.originalUrl);\n\n if (layerError) {\n layer.handle_error(layerError, req, res, next);\n } else {\n layer.handle_request(req, res, next);\n }\n }\n};\n\n/**\n * Process any parameters for the layer.\n * @private\n */\n\nproto.process_params = function process_params(layer, called, req, res, done) {\n var params = this.params;\n\n // captured parameters from the layer, keys and values\n var keys = layer.keys;\n\n // fast track\n if (!keys || keys.length === 0) {\n return done();\n }\n\n var i = 0;\n var name;\n var paramIndex = 0;\n var key;\n var paramVal;\n var paramCallbacks;\n var paramCalled;\n\n // process params in order\n // param callbacks can be async\n function param(err) {\n if (err) {\n return done(err);\n }\n\n if (i >= keys.length ) {\n return done();\n }\n\n paramIndex = 0;\n key = keys[i++];\n name = key.name;\n paramVal = req.params[name];\n paramCallbacks = params[name];\n paramCalled = called[name];\n\n if (paramVal === undefined || !paramCallbacks) {\n return param();\n }\n\n // param previously called with same value or error occurred\n if (paramCalled && (paramCalled.match === paramVal\n || (paramCalled.error && paramCalled.error !== 'route'))) {\n // restore value\n req.params[name] = paramCalled.value;\n\n // next param\n return param(paramCalled.error);\n }\n\n called[name] = paramCalled = {\n error: null,\n match: paramVal,\n value: paramVal\n };\n\n paramCallback();\n }\n\n // single param callbacks\n function paramCallback(err) {\n var fn = paramCallbacks[paramIndex++];\n\n // store updated value\n paramCalled.value = req.params[key.name];\n\n if (err) {\n // store error\n paramCalled.error = err;\n param(err);\n return;\n }\n\n if (!fn) return param();\n\n try {\n fn(req, res, paramCallback, paramVal, key.name);\n } catch (e) {\n paramCallback(e);\n }\n }\n\n param();\n};\n\n/**\n * Use the given middleware function, with optional path, defaulting to \"/\".\n *\n * Use (like `.all`) will run for any http METHOD, but it will not add\n * handlers for those methods so OPTIONS requests will not consider `.use`\n * functions even if they could respond.\n *\n * The other difference is that _route_ path is stripped and not visible\n * to the handler function. The main effect of this feature is that mounted\n * handlers can operate without any code changes regardless of the \"prefix\"\n * pathname.\n *\n * @public\n */\n\nproto.use = function use(fn) {\n var offset = 0;\n var path = '/';\n\n // default path to '/'\n // disambiguate router.use([fn])\n if (typeof fn !== 'function') {\n var arg = fn;\n\n while (Array.isArray(arg) && arg.length !== 0) {\n arg = arg[0];\n }\n\n // first arg is the path\n if (typeof arg !== 'function') {\n offset = 1;\n path = fn;\n }\n }\n\n var callbacks = flatten(slice.call(arguments, offset));\n\n if (callbacks.length === 0) {\n throw new TypeError('Router.use() requires a middleware function')\n }\n\n for (var i = 0; i < callbacks.length; i++) {\n var fn = callbacks[i];\n\n if (typeof fn !== 'function') {\n throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))\n }\n\n // add the middleware\n debug('use %o %s', path, fn.name || '')\n\n var layer = new Layer(path, {\n sensitive: this.caseSensitive,\n strict: false,\n end: false\n }, fn);\n\n layer.route = undefined;\n\n this.stack.push(layer);\n }\n\n return this;\n};\n\n/**\n * Create a new Route for the given path.\n *\n * Each route contains a separate middleware stack and VERB handlers.\n *\n * See the Route api documentation for details on adding handlers\n * and middleware to routes.\n *\n * @param {String} path\n * @return {Route}\n * @public\n */\n\nproto.route = function route(path) {\n var route = new Route(path);\n\n var layer = new Layer(path, {\n sensitive: this.caseSensitive,\n strict: this.strict,\n end: true\n }, route.dispatch.bind(route));\n\n layer.route = route;\n\n this.stack.push(layer);\n return route;\n};\n\n// create Router#VERB functions\nmethods.concat('all').forEach(function(method){\n proto[method] = function(path){\n var route = this.route(path)\n route[method].apply(route, slice.call(arguments, 1));\n return this;\n };\n});\n\n// append methods to a list of methods\nfunction appendMethods(list, addition) {\n for (var i = 0; i < addition.length; i++) {\n var method = addition[i];\n if (list.indexOf(method) === -1) {\n list.push(method);\n }\n }\n}\n\n// get pathname of request\nfunction getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}\n\n// Get get protocol + host for a URL\nfunction getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.slice(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substring(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}\n\n// get type for error message\nfunction gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}\n\n/**\n * Match path to a layer.\n *\n * @param {Layer} layer\n * @param {string} path\n * @private\n */\n\nfunction matchLayer(layer, path) {\n try {\n return layer.match(path);\n } catch (err) {\n return err;\n }\n}\n\n// merge params with parent params\nfunction mergeParams(params, parent) {\n if (typeof parent !== 'object' || !parent) {\n return params;\n }\n\n // make copy of parent for base\n var obj = mixin({}, parent);\n\n // simple non-numeric merging\n if (!(0 in params) || !(0 in parent)) {\n return mixin(obj, params);\n }\n\n var i = 0;\n var o = 0;\n\n // determine numeric gaps\n while (i in params) {\n i++;\n }\n\n while (o in parent) {\n o++;\n }\n\n // offset numeric indices in params before merge\n for (i--; i >= 0; i--) {\n params[i + o] = params[i];\n\n // create holes for the merge when necessary\n if (i < o) {\n delete params[i];\n }\n }\n\n return mixin(obj, params);\n}\n\n// restore obj props after function\nfunction restore(fn, obj) {\n var props = new Array(arguments.length - 2);\n var vals = new Array(arguments.length - 2);\n\n for (var i = 0; i < props.length; i++) {\n props[i] = arguments[i + 2];\n vals[i] = obj[props[i]];\n }\n\n return function () {\n // restore vals\n for (var i = 0; i < props.length; i++) {\n obj[props[i]] = vals[i];\n }\n\n return fn.apply(this, arguments);\n };\n}\n\n// send an OPTIONS response\nfunction sendOptionsResponse(res, options, next) {\n try {\n var body = options.join(',');\n res.set('Allow', body);\n res.send(body);\n } catch (err) {\n next(err);\n }\n}\n\n// wrap a function\nfunction wrap(old, fn) {\n return function proxy() {\n var args = new Array(arguments.length + 1);\n\n args[0] = old;\n for (var i = 0, len = arguments.length; i < len; i++) {\n args[i + 1] = arguments[i];\n }\n\n fn.apply(this, args);\n };\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar pathRegexp = require('path-to-regexp');\nvar debug = require('debug')('express:router:layer');\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Layer;\n\nfunction Layer(path, options, fn) {\n if (!(this instanceof Layer)) {\n return new Layer(path, options, fn);\n }\n\n debug('new %o', path)\n var opts = options || {};\n\n this.handle = fn;\n this.name = fn.name || '';\n this.params = undefined;\n this.path = undefined;\n this.regexp = pathRegexp(path, this.keys = [], opts);\n\n // set fast path flags\n this.regexp.fast_star = path === '*'\n this.regexp.fast_slash = path === '/' && opts.end === false\n}\n\n/**\n * Handle the error for the layer.\n *\n * @param {Error} error\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handle_error = function handle_error(error, req, res, next) {\n var fn = this.handle;\n\n if (fn.length !== 4) {\n // not a standard error handler\n return next(error);\n }\n\n try {\n fn(error, req, res, next);\n } catch (err) {\n next(err);\n }\n};\n\n/**\n * Handle the request for the layer.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handle_request = function handle(req, res, next) {\n var fn = this.handle;\n\n if (fn.length > 3) {\n // not a standard request handler\n return next();\n }\n\n try {\n fn(req, res, next);\n } catch (err) {\n next(err);\n }\n};\n\n/**\n * Check if this route matches `path`, if so\n * populate `.params`.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nLayer.prototype.match = function match(path) {\n var match\n\n if (path != null) {\n // fast path non-ending match for / (any path matches)\n if (this.regexp.fast_slash) {\n this.params = {}\n this.path = ''\n return true\n }\n\n // fast path for * (everything matched in a param)\n if (this.regexp.fast_star) {\n this.params = {'0': decode_param(path)}\n this.path = path\n return true\n }\n\n // match the path\n match = this.regexp.exec(path)\n }\n\n if (!match) {\n this.params = undefined;\n this.path = undefined;\n return false;\n }\n\n // store values\n this.params = {};\n this.path = match[0]\n\n var keys = this.keys;\n var params = this.params;\n\n for (var i = 1; i < match.length; i++) {\n var key = keys[i - 1];\n var prop = key.name;\n var val = decode_param(match[i])\n\n if (val !== undefined || !(hasOwnProperty.call(params, prop))) {\n params[prop] = val;\n }\n }\n\n return true;\n};\n\n/**\n * Decode param value.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction decode_param(val) {\n if (typeof val !== 'string' || val.length === 0) {\n return val;\n }\n\n try {\n return decodeURIComponent(val);\n } catch (err) {\n if (err instanceof URIError) {\n err.message = 'Failed to decode param \\'' + val + '\\'';\n err.status = err.statusCode = 400;\n }\n\n throw err;\n }\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('express:router:route');\nvar flatten = require('array-flatten');\nvar Layer = require('./layer');\nvar methods = require('methods');\n\n/**\n * Module variables.\n * @private\n */\n\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Route;\n\n/**\n * Initialize `Route` with the given `path`,\n *\n * @param {String} path\n * @public\n */\n\nfunction Route(path) {\n this.path = path;\n this.stack = [];\n\n debug('new %o', path)\n\n // route handlers for various http methods\n this.methods = {};\n}\n\n/**\n * Determine if the route handles a given method.\n * @private\n */\n\nRoute.prototype._handles_method = function _handles_method(method) {\n if (this.methods._all) {\n return true;\n }\n\n var name = method.toLowerCase();\n\n if (name === 'head' && !this.methods['head']) {\n name = 'get';\n }\n\n return Boolean(this.methods[name]);\n};\n\n/**\n * @return {Array} supported HTTP methods\n * @private\n */\n\nRoute.prototype._options = function _options() {\n var methods = Object.keys(this.methods);\n\n // append automatic head\n if (this.methods.get && !this.methods.head) {\n methods.push('head');\n }\n\n for (var i = 0; i < methods.length; i++) {\n // make upper case\n methods[i] = methods[i].toUpperCase();\n }\n\n return methods;\n};\n\n/**\n * dispatch req, res into this route\n * @private\n */\n\nRoute.prototype.dispatch = function dispatch(req, res, done) {\n var idx = 0;\n var stack = this.stack;\n var sync = 0\n\n if (stack.length === 0) {\n return done();\n }\n\n var method = req.method.toLowerCase();\n if (method === 'head' && !this.methods['head']) {\n method = 'get';\n }\n\n req.route = this;\n\n next();\n\n function next(err) {\n // signal to exit route\n if (err && err === 'route') {\n return done();\n }\n\n // signal to exit router\n if (err && err === 'router') {\n return done(err)\n }\n\n // max sync stack\n if (++sync > 100) {\n return setImmediate(next, err)\n }\n\n var layer = stack[idx++]\n\n // end of layers\n if (!layer) {\n return done(err)\n }\n\n if (layer.method && layer.method !== method) {\n next(err)\n } else if (err) {\n layer.handle_error(err, req, res, next);\n } else {\n layer.handle_request(req, res, next);\n }\n\n sync = 0\n }\n};\n\n/**\n * Add a handler for all HTTP verbs to this route.\n *\n * Behaves just like middleware and can respond or call `next`\n * to continue processing.\n *\n * You can use multiple `.all` call to add multiple handlers.\n *\n * function check_something(req, res, next){\n * next();\n * };\n *\n * function validate_user(req, res, next){\n * next();\n * };\n *\n * route\n * .all(validate_user)\n * .all(check_something)\n * .get(function(req, res, next){\n * res.send('hello world');\n * });\n *\n * @param {function} handler\n * @return {Route} for chaining\n * @api public\n */\n\nRoute.prototype.all = function all() {\n var handles = flatten(slice.call(arguments));\n\n for (var i = 0; i < handles.length; i++) {\n var handle = handles[i];\n\n if (typeof handle !== 'function') {\n var type = toString.call(handle);\n var msg = 'Route.all() requires a callback function but got a ' + type\n throw new TypeError(msg);\n }\n\n var layer = Layer('/', {}, handle);\n layer.method = undefined;\n\n this.methods._all = true;\n this.stack.push(layer);\n }\n\n return this;\n};\n\nmethods.forEach(function(method){\n Route.prototype[method] = function(){\n var handles = flatten(slice.call(arguments));\n\n for (var i = 0; i < handles.length; i++) {\n var handle = handles[i];\n\n if (typeof handle !== 'function') {\n var type = toString.call(handle);\n var msg = 'Route.' + method + '() requires a callback function but got a ' + type\n throw new Error(msg);\n }\n\n debug('%s %o', method, this.path)\n\n var layer = Layer('/', {}, handle);\n layer.method = method;\n\n this.methods[method] = true;\n this.stack.push(layer);\n }\n\n return this;\n };\n});\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @api private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar contentDisposition = require('content-disposition');\nvar contentType = require('content-type');\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar mime = require('send').mime;\nvar etag = require('etag');\nvar proxyaddr = require('proxy-addr');\nvar qs = require('qs');\nvar querystring = require('querystring');\n\n/**\n * Return strong ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.etag = createETagGenerator({ weak: false })\n\n/**\n * Return weak ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.wetag = createETagGenerator({ weak: true })\n\n/**\n * Check if `path` looks absolute.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nexports.isAbsolute = function(path){\n if ('/' === path[0]) return true;\n if (':' === path[1] && ('\\\\' === path[2] || '/' === path[2])) return true; // Windows device path\n if ('\\\\\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path\n};\n\n/**\n * Flatten the given `arr`.\n *\n * @param {Array} arr\n * @return {Array}\n * @api private\n */\n\nexports.flatten = deprecate.function(flatten,\n 'utils.flatten: use array-flatten npm module instead');\n\n/**\n * Normalize the given `type`, for example \"html\" becomes \"text/html\".\n *\n * @param {String} type\n * @return {Object}\n * @api private\n */\n\nexports.normalizeType = function(type){\n return ~type.indexOf('/')\n ? acceptParams(type)\n : { value: mime.lookup(type), params: {} };\n};\n\n/**\n * Normalize `types`, for example \"html\" becomes \"text/html\".\n *\n * @param {Array} types\n * @return {Array}\n * @api private\n */\n\nexports.normalizeTypes = function(types){\n var ret = [];\n\n for (var i = 0; i < types.length; ++i) {\n ret.push(exports.normalizeType(types[i]));\n }\n\n return ret;\n};\n\n/**\n * Generate Content-Disposition header appropriate for the filename.\n * non-ascii filenames are urlencoded and a filename* parameter is added\n *\n * @param {String} filename\n * @return {String}\n * @api private\n */\n\nexports.contentDisposition = deprecate.function(contentDisposition,\n 'utils.contentDisposition: use content-disposition npm module instead');\n\n/**\n * Parse accept params `str` returning an\n * object with `.value`, `.quality` and `.params`.\n * also includes `.originalIndex` for stable sorting\n *\n * @param {String} str\n * @param {Number} index\n * @return {Object}\n * @api private\n */\n\nfunction acceptParams(str, index) {\n var parts = str.split(/ *; */);\n var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index };\n\n for (var i = 1; i < parts.length; ++i) {\n var pms = parts[i].split(/ *= */);\n if ('q' === pms[0]) {\n ret.quality = parseFloat(pms[1]);\n } else {\n ret.params[pms[0]] = pms[1];\n }\n }\n\n return ret;\n}\n\n/**\n * Compile \"etag\" value to function.\n *\n * @param {Boolean|String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileETag = function(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'weak':\n fn = exports.wetag;\n break;\n case false:\n break;\n case 'strong':\n fn = exports.etag;\n break;\n default:\n throw new TypeError('unknown value for etag function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"query parser\" value to function.\n *\n * @param {String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileQueryParser = function compileQueryParser(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'simple':\n fn = querystring.parse;\n break;\n case false:\n fn = newObject;\n break;\n case 'extended':\n fn = parseExtendedQueryString;\n break;\n default:\n throw new TypeError('unknown value for query parser function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"proxy trust\" value to function.\n *\n * @param {Boolean|String|Number|Array|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileTrust = function(val) {\n if (typeof val === 'function') return val;\n\n if (val === true) {\n // Support plain true/false\n return function(){ return true };\n }\n\n if (typeof val === 'number') {\n // Support trusting hop count\n return function(a, i){ return i < val };\n }\n\n if (typeof val === 'string') {\n // Support comma-separated values\n val = val.split(',')\n .map(function (v) { return v.trim() })\n }\n\n return proxyaddr.compile(val || []);\n}\n\n/**\n * Set the charset in a given Content-Type string.\n *\n * @param {String} type\n * @param {String} charset\n * @return {String}\n * @api private\n */\n\nexports.setCharset = function setCharset(type, charset) {\n if (!type || !charset) {\n return type;\n }\n\n // parse type\n var parsed = contentType.parse(type);\n\n // set charset\n parsed.parameters.charset = charset;\n\n // format type\n return contentType.format(parsed);\n};\n\n/**\n * Create an ETag generator function, generating ETags with\n * the given options.\n *\n * @param {object} options\n * @return {function}\n * @private\n */\n\nfunction createETagGenerator (options) {\n return function generateETag (body, encoding) {\n var buf = !Buffer.isBuffer(body)\n ? Buffer.from(body, encoding)\n : body\n\n return etag(buf, options)\n }\n}\n\n/**\n * Parse an extended query string with qs.\n *\n * @return {Object}\n * @private\n */\n\nfunction parseExtendedQueryString(str) {\n return qs.parse(str, {\n allowPrototypes: true\n });\n}\n\n/**\n * Return new empty object.\n *\n * @return {Object}\n * @api private\n */\n\nfunction newObject() {\n return {};\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('express:view');\nvar path = require('path');\nvar fs = require('fs');\n\n/**\n * Module variables.\n * @private\n */\n\nvar dirname = path.dirname;\nvar basename = path.basename;\nvar extname = path.extname;\nvar join = path.join;\nvar resolve = path.resolve;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = View;\n\n/**\n * Initialize a new `View` with the given `name`.\n *\n * Options:\n *\n * - `defaultEngine` the default template engine name\n * - `engines` template engine require() cache\n * - `root` root path for view lookup\n *\n * @param {string} name\n * @param {object} options\n * @public\n */\n\nfunction View(name, options) {\n var opts = options || {};\n\n this.defaultEngine = opts.defaultEngine;\n this.ext = extname(name);\n this.name = name;\n this.root = opts.root;\n\n if (!this.ext && !this.defaultEngine) {\n throw new Error('No default engine was specified and no extension was provided.');\n }\n\n var fileName = name;\n\n if (!this.ext) {\n // get extension from default engine name\n this.ext = this.defaultEngine[0] !== '.'\n ? '.' + this.defaultEngine\n : this.defaultEngine;\n\n fileName += this.ext;\n }\n\n if (!opts.engines[this.ext]) {\n // load engine\n var mod = this.ext.slice(1)\n debug('require \"%s\"', mod)\n\n // default engine export\n var fn = require(mod).__express\n\n if (typeof fn !== 'function') {\n throw new Error('Module \"' + mod + '\" does not provide a view engine.')\n }\n\n opts.engines[this.ext] = fn\n }\n\n // store loaded engine\n this.engine = opts.engines[this.ext];\n\n // lookup path\n this.path = this.lookup(fileName);\n}\n\n/**\n * Lookup view by the given `name`\n *\n * @param {string} name\n * @private\n */\n\nView.prototype.lookup = function lookup(name) {\n var path;\n var roots = [].concat(this.root);\n\n debug('lookup \"%s\"', name);\n\n for (var i = 0; i < roots.length && !path; i++) {\n var root = roots[i];\n\n // resolve the path\n var loc = resolve(root, name);\n var dir = dirname(loc);\n var file = basename(loc);\n\n // resolve the file\n path = this.resolve(dir, file);\n }\n\n return path;\n};\n\n/**\n * Render with the given options.\n *\n * @param {object} options\n * @param {function} callback\n * @private\n */\n\nView.prototype.render = function render(options, callback) {\n debug('render \"%s\"', this.path);\n this.engine(this.path, options, callback);\n};\n\n/**\n * Resolve the file within the given directory.\n *\n * @param {string} dir\n * @param {string} file\n * @private\n */\n\nView.prototype.resolve = function resolve(dir, file) {\n var ext = this.ext;\n\n // .\n var path = join(dir, file);\n var stat = tryStat(path);\n\n if (stat && stat.isFile()) {\n return path;\n }\n\n // /index.\n path = join(dir, basename(file, ext), 'index' + ext);\n stat = tryStat(path);\n\n if (stat && stat.isFile()) {\n return path;\n }\n};\n\n/**\n * Return a stat, maybe.\n *\n * @param {string} path\n * @return {fs.Stats}\n * @private\n */\n\nfunction tryStat(path) {\n debug('stat \"%s\"', path);\n\n try {\n return fs.statSync(path);\n } catch (e) {\n return undefined;\n }\n}\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = \"./node_modules/express/lib sync recursive\";\nmodule.exports = webpackEmptyContext;","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/*!\n * finalhandler\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('finalhandler')\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar onFinished = require('on-finished')\nvar parseUrl = require('parseurl')\nvar statuses = require('statuses')\nvar unpipe = require('unpipe')\n\n/**\n * Module variables.\n * @private\n */\n\nvar DOUBLE_SPACE_REGEXP = /\\x20{2}/g\nvar NEWLINE_REGEXP = /\\n/g\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }\nvar isFinished = onFinished.isFinished\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} message\n * @private\n */\n\nfunction createHtmlDocument (message) {\n var body = escapeHtml(message)\n .replace(NEWLINE_REGEXP, '
')\n .replace(DOUBLE_SPACE_REGEXP, '  ')\n\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n 'Error\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = finalhandler\n\n/**\n * Create a function to handle the final response.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {Object} [options]\n * @return {Function}\n * @public\n */\n\nfunction finalhandler (req, res, options) {\n var opts = options || {}\n\n // get environment\n var env = opts.env || process.env.NODE_ENV || 'development'\n\n // get error callback\n var onerror = opts.onerror\n\n return function (err) {\n var headers\n var msg\n var status\n\n // ignore 404 on in-flight response\n if (!err && headersSent(res)) {\n debug('cannot 404 after headers sent')\n return\n }\n\n // unhandled error\n if (err) {\n // respect status code from error\n status = getErrorStatusCode(err)\n\n if (status === undefined) {\n // fallback to status code on response\n status = getResponseStatusCode(res)\n } else {\n // respect headers from error\n headers = getErrorHeaders(err)\n }\n\n // get error message\n msg = getErrorMessage(err, status, env)\n } else {\n // not found\n status = 404\n msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req))\n }\n\n debug('default %s', status)\n\n // schedule onerror callback\n if (err && onerror) {\n defer(onerror, err, req, res)\n }\n\n // cannot actually respond\n if (headersSent(res)) {\n debug('cannot %d after headers sent', status)\n req.socket.destroy()\n return\n }\n\n // send response\n send(req, res, status, headers, msg)\n }\n}\n\n/**\n * Get headers from Error object.\n *\n * @param {Error} err\n * @return {object}\n * @private\n */\n\nfunction getErrorHeaders (err) {\n if (!err.headers || typeof err.headers !== 'object') {\n return undefined\n }\n\n var headers = Object.create(null)\n var keys = Object.keys(err.headers)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n headers[key] = err.headers[key]\n }\n\n return headers\n}\n\n/**\n * Get message from Error object, fallback to status message.\n *\n * @param {Error} err\n * @param {number} status\n * @param {string} env\n * @return {string}\n * @private\n */\n\nfunction getErrorMessage (err, status, env) {\n var msg\n\n if (env !== 'production') {\n // use err.stack, which typically includes err.message\n msg = err.stack\n\n // fallback to err.toString() when possible\n if (!msg && typeof err.toString === 'function') {\n msg = err.toString()\n }\n }\n\n return msg || statuses.message[status]\n}\n\n/**\n * Get status code from Error object.\n *\n * @param {Error} err\n * @return {number}\n * @private\n */\n\nfunction getErrorStatusCode (err) {\n // check err.status\n if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {\n return err.status\n }\n\n // check err.statusCode\n if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {\n return err.statusCode\n }\n\n return undefined\n}\n\n/**\n * Get resource name for the request.\n *\n * This is typically just the original pathname of the request\n * but will fallback to \"resource\" is that cannot be determined.\n *\n * @param {IncomingMessage} req\n * @return {string}\n * @private\n */\n\nfunction getResourceName (req) {\n try {\n return parseUrl.original(req).pathname\n } catch (e) {\n return 'resource'\n }\n}\n\n/**\n * Get status code from response.\n *\n * @param {OutgoingMessage} res\n * @return {number}\n * @private\n */\n\nfunction getResponseStatusCode (res) {\n var status = res.statusCode\n\n // default status code to 500 if outside valid range\n if (typeof status !== 'number' || status < 400 || status > 599) {\n status = 500\n }\n\n return status\n}\n\n/**\n * Determine if the response headers have been sent.\n *\n * @param {object} res\n * @returns {boolean}\n * @private\n */\n\nfunction headersSent (res) {\n return typeof res.headersSent !== 'boolean'\n ? Boolean(res._header)\n : res.headersSent\n}\n\n/**\n * Send response.\n *\n * @param {IncomingMessage} req\n * @param {OutgoingMessage} res\n * @param {number} status\n * @param {object} headers\n * @param {string} message\n * @private\n */\n\nfunction send (req, res, status, headers, message) {\n function write () {\n // response body\n var body = createHtmlDocument(message)\n\n // response status\n res.statusCode = status\n res.statusMessage = statuses.message[status]\n\n // remove any content headers\n res.removeHeader('Content-Encoding')\n res.removeHeader('Content-Language')\n res.removeHeader('Content-Range')\n\n // response headers\n setHeaders(res, headers)\n\n // security headers\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n\n // standard headers\n res.setHeader('Content-Type', 'text/html; charset=utf-8')\n res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))\n\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n\n res.end(body, 'utf8')\n }\n\n if (isFinished(req)) {\n write()\n return\n }\n\n // unpipe everything from the request\n unpipe(req)\n\n // flush the request\n onFinished(req, write)\n req.resume()\n}\n\n/**\n * Set response headers from an object.\n *\n * @param {OutgoingMessage} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeaders (res, headers) {\n if (!headers) {\n return\n }\n\n var keys = Object.keys(headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n res.setHeader(key, headers[key])\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\nvar InvalidUrlError = createErrorType(\n \"ERR_INVALID_URL\",\n \"Invalid URL\",\n TypeError\n);\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!isString(data) && !isBuffer(data)) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (isFunction(data)) {\n callback = data;\n data = encoding = null;\n }\n else if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230§5.3.1: When making a request directly to an origin server, […]\n // a client MUST send only the absolute path […] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, […]\n // a client MUST send the target URI in absolute-form […].\n this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (isFunction(beforeRedirect)) {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (isString(input)) {\n var parsed;\n try {\n parsed = urlToOptions(new URL(input));\n }\n catch (err) {\n /* istanbul ignore next */\n parsed = url.parse(input);\n }\n if (!isString(parsed.protocol)) {\n throw new InvalidUrlError({ input });\n }\n input = parsed;\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (isFunction(options)) {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n if (!isString(options.host) && !isString(options.hostname)) {\n options.hostname = \"::1\";\n }\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, message, baseClass) {\n // Create constructor\n function CustomError(properties) {\n Error.captureStackTrace(this, this.constructor);\n Object.assign(this, properties || {});\n this.code = code;\n this.message = this.cause ? message + \": \" + this.cause.message : message;\n }\n\n // Attach constructor and set default properties\n CustomError.prototype = new (baseClass || Error)();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n assert(isString(subdomain) && isString(domain));\n var dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\nfunction isString(value) {\n return typeof value === \"string\" || value instanceof String;\n}\n\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\nfunction isBuffer(value) {\n return typeof value === \"object\" && (\"length\" in value);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","/*!\n * forwarded\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = forwarded\n\n/**\n * Get all addresses in the request, using the `X-Forwarded-For` header.\n *\n * @param {object} req\n * @return {array}\n * @public\n */\n\nfunction forwarded (req) {\n if (!req) {\n throw new TypeError('argument req is required')\n }\n\n // simple header parsing\n var proxyAddrs = parse(req.headers['x-forwarded-for'] || '')\n var socketAddr = getSocketAddr(req)\n var addrs = [socketAddr].concat(proxyAddrs)\n\n // return all addresses\n return addrs\n}\n\n/**\n * Get the socket address for a request.\n *\n * @param {object} req\n * @return {string}\n * @private\n */\n\nfunction getSocketAddr (req) {\n return req.socket\n ? req.socket.remoteAddress\n : req.connection.remoteAddress\n}\n\n/**\n * Parse the X-Forwarded-For header.\n *\n * @param {string} header\n * @private\n */\n\nfunction parse (header) {\n var end = header.length\n var list = []\n var start = header.length\n\n // gather addresses, backwards\n for (var i = header.length - 1; i >= 0; i--) {\n switch (header.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i\n }\n break\n case 0x2c: /* , */\n if (start !== end) {\n list.push(header.substring(start, end))\n }\n start = end = i\n break\n default:\n start = i\n break\n }\n }\n\n // final address\n if (start !== end) {\n list.push(header.substring(start, end))\n }\n\n return list\n}\n","/*!\n * fresh\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2016-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * RegExp to check for no-cache token in Cache-Control.\n * @private\n */\n\nvar CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\\s*?no-cache\\s*?(?:,|$)/\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = fresh\n\n/**\n * Check freshness of the response using request and response headers.\n *\n * @param {Object} reqHeaders\n * @param {Object} resHeaders\n * @return {Boolean}\n * @public\n */\n\nfunction fresh (reqHeaders, resHeaders) {\n // fields\n var modifiedSince = reqHeaders['if-modified-since']\n var noneMatch = reqHeaders['if-none-match']\n\n // unconditional request\n if (!modifiedSince && !noneMatch) {\n return false\n }\n\n // Always return stale when Cache-Control: no-cache\n // to support end-to-end reload requests\n // https://tools.ietf.org/html/rfc2616#section-14.9.4\n var cacheControl = reqHeaders['cache-control']\n if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) {\n return false\n }\n\n // if-none-match\n if (noneMatch && noneMatch !== '*') {\n var etag = resHeaders['etag']\n\n if (!etag) {\n return false\n }\n\n var etagStale = true\n var matches = parseTokenList(noneMatch)\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i]\n if (match === etag || match === 'W/' + etag || 'W/' + match === etag) {\n etagStale = false\n break\n }\n }\n\n if (etagStale) {\n return false\n }\n }\n\n // if-modified-since\n if (modifiedSince) {\n var lastModified = resHeaders['last-modified']\n var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince))\n\n if (modifiedStale) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Parse an HTTP Date into a number.\n *\n * @param {string} date\n * @private\n */\n\nfunction parseHttpDate (date) {\n var timestamp = date && Date.parse(date)\n\n // istanbul ignore next: guard against date.js Date.parse patching\n return typeof timestamp === 'number'\n ? timestamp\n : NaN\n}\n\n/**\n * Parse a HTTP token list.\n *\n * @param {string} str\n * @private\n */\n\nfunction parseTokenList (str) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = str.length; i < len; i++) {\n switch (str.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n list.push(str.substring(start, end))\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n list.push(str.substring(start, end))\n\n return list\n}\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","/*!\n * http-errors\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar deprecate = require('depd')('http-errors')\nvar setPrototypeOf = require('setprototypeof')\nvar statuses = require('statuses')\nvar inherits = require('inherits')\nvar toIdentifier = require('toidentifier')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = createError\nmodule.exports.HttpError = createHttpErrorConstructor()\nmodule.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError)\n\n// Populate exports for all constructors\npopulateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)\n\n/**\n * Get the code class of a status code.\n * @private\n */\n\nfunction codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}\n\n/**\n * Create a new HTTP Error.\n *\n * @returns {Error}\n * @public\n */\n\nfunction createError () {\n // so much arity going on ~_~\n var err\n var msg\n var status = 500\n var props = {}\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i]\n var type = typeof arg\n if (type === 'object' && arg instanceof Error) {\n err = arg\n status = err.status || err.statusCode || status\n } else if (type === 'number' && i === 0) {\n status = arg\n } else if (type === 'string') {\n msg = arg\n } else if (type === 'object') {\n props = arg\n } else {\n throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type)\n }\n }\n\n if (typeof status === 'number' && (status < 400 || status >= 600)) {\n deprecate('non-error status code; use only 4xx or 5xx status codes')\n }\n\n if (typeof status !== 'number' ||\n (!statuses.message[status] && (status < 400 || status >= 600))) {\n status = 500\n }\n\n // constructor\n var HttpError = createError[status] || createError[codeClass(status)]\n\n if (!err) {\n // create error\n err = HttpError\n ? new HttpError(msg)\n : new Error(msg || statuses.message[status])\n Error.captureStackTrace(err, createError)\n }\n\n if (!HttpError || !(err instanceof HttpError) || err.status !== status) {\n // add properties to generic error\n err.expose = status < 500\n err.status = err.statusCode = status\n }\n\n for (var key in props) {\n if (key !== 'status' && key !== 'statusCode') {\n err[key] = props[key]\n }\n }\n\n return err\n}\n\n/**\n * Create HTTP error abstract base class.\n * @private\n */\n\nfunction createHttpErrorConstructor () {\n function HttpError () {\n throw new TypeError('cannot construct abstract class')\n }\n\n inherits(HttpError, Error)\n\n return HttpError\n}\n\n/**\n * Create a constructor for a client error.\n * @private\n */\n\nfunction createClientErrorConstructor (HttpError, name, code) {\n var className = toClassName(name)\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses.message[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}\n\n/**\n * Create function to test is a value is a HttpError.\n * @private\n */\n\nfunction createIsHttpErrorFunction (HttpError) {\n return function isHttpError (val) {\n if (!val || typeof val !== 'object') {\n return false\n }\n\n if (val instanceof HttpError) {\n return true\n }\n\n return val instanceof Error &&\n typeof val.expose === 'boolean' &&\n typeof val.statusCode === 'number' && val.status === val.statusCode\n }\n}\n\n/**\n * Create a constructor for a server error.\n * @private\n */\n\nfunction createServerErrorConstructor (HttpError, name, code) {\n var className = toClassName(name)\n\n function ServerError (message) {\n // create the error object\n var msg = message != null ? message : statuses.message[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ServerError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ServerError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ServerError, HttpError)\n nameFunc(ServerError, className)\n\n ServerError.prototype.status = code\n ServerError.prototype.statusCode = code\n ServerError.prototype.expose = false\n\n return ServerError\n}\n\n/**\n * Set the name of a function, if possible.\n * @private\n */\n\nfunction nameFunc (func, name) {\n var desc = Object.getOwnPropertyDescriptor(func, 'name')\n\n if (desc && desc.configurable) {\n desc.value = name\n Object.defineProperty(func, 'name', desc)\n }\n}\n\n/**\n * Populate the exports object with constructors for every error class.\n * @private\n */\n\nfunction populateConstructorExports (exports, codes, HttpError) {\n codes.forEach(function forEachCode (code) {\n var CodeError\n var name = toIdentifier(statuses.message[code])\n\n switch (codeClass(code)) {\n case 400:\n CodeError = createClientErrorConstructor(HttpError, name, code)\n break\n case 500:\n CodeError = createServerErrorConstructor(HttpError, name, code)\n break\n }\n\n if (CodeError) {\n // export the constructor\n exports[code] = CodeError\n exports[name] = CodeError\n }\n })\n}\n\n/**\n * Get a class name from a name identifier.\n * @private\n */\n\nfunction toClassName (name) {\n return name.substr(-5) !== 'Error'\n ? name + 'Error'\n : name\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.\n// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.\n// To save memory and loading time, we read table files only when requested.\n\nexports._dbcs = DBCSCodec;\n\nvar UNASSIGNED = -1,\n GB18030_CODE = -2,\n SEQ_START = -10,\n NODE_START = -1000,\n UNASSIGNED_NODE = new Array(0x100),\n DEF_CHAR = -1;\n\nfor (var i = 0; i < 0x100; i++)\n UNASSIGNED_NODE[i] = UNASSIGNED;\n\n\n// Class DBCSCodec reads and initializes mapping tables.\nfunction DBCSCodec(codecOptions, iconv) {\n this.encodingName = codecOptions.encodingName;\n if (!codecOptions)\n throw new Error(\"DBCS codec is called without the data.\")\n if (!codecOptions.table)\n throw new Error(\"Encoding '\" + this.encodingName + \"' has no data.\");\n\n // Load tables.\n var mappingTable = codecOptions.table();\n\n\n // Decode tables: MBCS -> Unicode.\n\n // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.\n // Trie root is decodeTables[0].\n // Values: >= 0 -> unicode character code. can be > 0xFFFF\n // == UNASSIGNED -> unknown/unassigned sequence.\n // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.\n // <= NODE_START -> index of the next node in our trie to process next byte.\n // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.\n this.decodeTables = [];\n this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.\n\n // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. \n this.decodeTableSeq = [];\n\n // Actual mapping tables consist of chunks. Use them to fill up decode tables.\n for (var i = 0; i < mappingTable.length; i++)\n this._addDecodeChunk(mappingTable[i]);\n\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n\n \n // Encode tables: Unicode -> DBCS.\n\n // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.\n // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.\n // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).\n // == UNASSIGNED -> no conversion found. Output a default char.\n // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.\n this.encodeTable = [];\n \n // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of\n // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key\n // means end of sequence (needed when one sequence is a strict subsequence of another).\n // Objects are kept separately from encodeTable to increase performance.\n this.encodeTableSeq = [];\n\n // Some chars can be decoded, but need not be encoded.\n var skipEncodeChars = {};\n if (codecOptions.encodeSkipVals)\n for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {\n var val = codecOptions.encodeSkipVals[i];\n if (typeof val === 'number')\n skipEncodeChars[val] = true;\n else\n for (var j = val.from; j <= val.to; j++)\n skipEncodeChars[j] = true;\n }\n \n // Use decode trie to recursively fill out encode tables.\n this._fillEncodeTable(0, 0, skipEncodeChars);\n\n // Add more encoding pairs when needed.\n if (codecOptions.encodeAdd) {\n for (var uChar in codecOptions.encodeAdd)\n if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))\n this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);\n }\n\n this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = \"?\".charCodeAt(0);\n\n\n // Load & create GB18030 tables when needed.\n if (typeof codecOptions.gb18030 === 'function') {\n this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.\n\n // Add GB18030 decode tables.\n var thirdByteNodeIdx = this.decodeTables.length;\n var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n var fourthByteNodeIdx = this.decodeTables.length;\n var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n for (var i = 0x81; i <= 0xFE; i++) {\n var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];\n var secondByteNode = this.decodeTables[secondByteNodeIdx];\n for (var j = 0x30; j <= 0x39; j++)\n secondByteNode[j] = NODE_START - thirdByteNodeIdx;\n }\n for (var i = 0x81; i <= 0xFE; i++)\n thirdByteNode[i] = NODE_START - fourthByteNodeIdx;\n for (var i = 0x30; i <= 0x39; i++)\n fourthByteNode[i] = GB18030_CODE\n } \n}\n\nDBCSCodec.prototype.encoder = DBCSEncoder;\nDBCSCodec.prototype.decoder = DBCSDecoder;\n\n// Decoder helpers\nDBCSCodec.prototype._getDecodeTrieNode = function(addr) {\n var bytes = [];\n for (; addr > 0; addr >>= 8)\n bytes.push(addr & 0xFF);\n if (bytes.length == 0)\n bytes.push(0);\n\n var node = this.decodeTables[0];\n for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.\n var val = node[bytes[i]];\n\n if (val == UNASSIGNED) { // Create new node.\n node[bytes[i]] = NODE_START - this.decodeTables.length;\n this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));\n }\n else if (val <= NODE_START) { // Existing node.\n node = this.decodeTables[NODE_START - val];\n }\n else\n throw new Error(\"Overwrite byte in \" + this.encodingName + \", addr: \" + addr.toString(16));\n }\n return node;\n}\n\n\nDBCSCodec.prototype._addDecodeChunk = function(chunk) {\n // First element of chunk is the hex mbcs code where we start.\n var curAddr = parseInt(chunk[0], 16);\n\n // Choose the decoding node where we'll write our chars.\n var writeTable = this._getDecodeTrieNode(curAddr);\n curAddr = curAddr & 0xFF;\n\n // Write all other elements of the chunk to the table.\n for (var k = 1; k < chunk.length; k++) {\n var part = chunk[k];\n if (typeof part === \"string\") { // String, write as-is.\n for (var l = 0; l < part.length;) {\n var code = part.charCodeAt(l++);\n if (0xD800 <= code && code < 0xDC00) { // Decode surrogate\n var codeTrail = part.charCodeAt(l++);\n if (0xDC00 <= codeTrail && codeTrail < 0xE000)\n writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);\n else\n throw new Error(\"Incorrect surrogate pair in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)\n var len = 0xFFF - code + 2;\n var seq = [];\n for (var m = 0; m < len; m++)\n seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.\n\n writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;\n this.decodeTableSeq.push(seq);\n }\n else\n writeTable[curAddr++] = code; // Basic char\n }\n } \n else if (typeof part === \"number\") { // Integer, meaning increasing sequence starting with prev character.\n var charCode = writeTable[curAddr - 1] + 1;\n for (var l = 0; l < part; l++)\n writeTable[curAddr++] = charCode++;\n }\n else\n throw new Error(\"Incorrect type '\" + typeof part + \"' given in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n if (curAddr > 0xFF)\n throw new Error(\"Incorrect chunk in \" + this.encodingName + \" at addr \" + chunk[0] + \": too long\" + curAddr);\n}\n\n// Encoder helpers\nDBCSCodec.prototype._getEncodeBucket = function(uCode) {\n var high = uCode >> 8; // This could be > 0xFF because of astral characters.\n if (this.encodeTable[high] === undefined)\n this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.\n return this.encodeTable[high];\n}\n\nDBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n if (bucket[low] <= SEQ_START)\n this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.\n else if (bucket[low] == UNASSIGNED)\n bucket[low] = dbcsCode;\n}\n\nDBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {\n \n // Get the root of character tree according to first character of the sequence.\n var uCode = seq[0];\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n\n var node;\n if (bucket[low] <= SEQ_START) {\n // There's already a sequence with - use it.\n node = this.encodeTableSeq[SEQ_START-bucket[low]];\n }\n else {\n // There was no sequence object - allocate a new one.\n node = {};\n if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.\n bucket[low] = SEQ_START - this.encodeTableSeq.length;\n this.encodeTableSeq.push(node);\n }\n\n // Traverse the character tree, allocating new nodes as needed.\n for (var j = 1; j < seq.length-1; j++) {\n var oldVal = node[uCode];\n if (typeof oldVal === 'object')\n node = oldVal;\n else {\n node = node[uCode] = {}\n if (oldVal !== undefined)\n node[DEF_CHAR] = oldVal\n }\n }\n\n // Set the leaf to given dbcsCode.\n uCode = seq[seq.length-1];\n node[uCode] = dbcsCode;\n}\n\nDBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {\n var node = this.decodeTables[nodeIdx];\n for (var i = 0; i < 0x100; i++) {\n var uCode = node[i];\n var mbCode = prefix + i;\n if (skipEncodeChars[mbCode])\n continue;\n\n if (uCode >= 0)\n this._setEncodeChar(uCode, mbCode);\n else if (uCode <= NODE_START)\n this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);\n else if (uCode <= SEQ_START)\n this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);\n }\n}\n\n\n\n// == Encoder ==================================================================\n\nfunction DBCSEncoder(options, codec) {\n // Encoder state\n this.leadSurrogate = -1;\n this.seqObj = undefined;\n \n // Static data\n this.encodeTable = codec.encodeTable;\n this.encodeTableSeq = codec.encodeTableSeq;\n this.defaultCharSingleByte = codec.defCharSB;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSEncoder.prototype.write = function(str) {\n var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),\n leadSurrogate = this.leadSurrogate,\n seqObj = this.seqObj, nextChar = -1,\n i = 0, j = 0;\n\n while (true) {\n // 0. Get next character.\n if (nextChar === -1) {\n if (i == str.length) break;\n var uCode = str.charCodeAt(i++);\n }\n else {\n var uCode = nextChar;\n nextChar = -1; \n }\n\n // 1. Handle surrogates.\n if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.\n if (uCode < 0xDC00) { // We've got lead surrogate.\n if (leadSurrogate === -1) {\n leadSurrogate = uCode;\n continue;\n } else {\n leadSurrogate = uCode;\n // Double lead surrogate found.\n uCode = UNASSIGNED;\n }\n } else { // We've got trail surrogate.\n if (leadSurrogate !== -1) {\n uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);\n leadSurrogate = -1;\n } else {\n // Incomplete surrogate pair - only trail surrogate found.\n uCode = UNASSIGNED;\n }\n \n }\n }\n else if (leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.\n leadSurrogate = -1;\n }\n\n // 2. Convert uCode character.\n var dbcsCode = UNASSIGNED;\n if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence\n var resCode = seqObj[uCode];\n if (typeof resCode === 'object') { // Sequence continues.\n seqObj = resCode;\n continue;\n\n } else if (typeof resCode == 'number') { // Sequence finished. Write it.\n dbcsCode = resCode;\n\n } else if (resCode == undefined) { // Current character is not part of the sequence.\n\n // Try default character for this sequence\n resCode = seqObj[DEF_CHAR];\n if (resCode !== undefined) {\n dbcsCode = resCode; // Found. Write it.\n nextChar = uCode; // Current character will be written too in the next iteration.\n\n } else {\n // TODO: What if we have no default? (resCode == undefined)\n // Then, we should write first char of the sequence as-is and try the rest recursively.\n // Didn't do it for now because no encoding has this situation yet.\n // Currently, just skip the sequence and write current char.\n }\n }\n seqObj = undefined;\n }\n else if (uCode >= 0) { // Regular character\n var subtable = this.encodeTable[uCode >> 8];\n if (subtable !== undefined)\n dbcsCode = subtable[uCode & 0xFF];\n \n if (dbcsCode <= SEQ_START) { // Sequence start\n seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];\n continue;\n }\n\n if (dbcsCode == UNASSIGNED && this.gb18030) {\n // Use GB18030 algorithm to find character(s) to write.\n var idx = findIdx(this.gb18030.uChars, uCode);\n if (idx != -1) {\n var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;\n newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;\n newBuf[j++] = 0x30 + dbcsCode;\n continue;\n }\n }\n }\n\n // 3. Write dbcsCode character.\n if (dbcsCode === UNASSIGNED)\n dbcsCode = this.defaultCharSingleByte;\n \n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else if (dbcsCode < 0x10000) {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n else {\n newBuf[j++] = dbcsCode >> 16;\n newBuf[j++] = (dbcsCode >> 8) & 0xFF;\n newBuf[j++] = dbcsCode & 0xFF;\n }\n }\n\n this.seqObj = seqObj;\n this.leadSurrogate = leadSurrogate;\n return newBuf.slice(0, j);\n}\n\nDBCSEncoder.prototype.end = function() {\n if (this.leadSurrogate === -1 && this.seqObj === undefined)\n return; // All clean. Most often case.\n\n var newBuf = Buffer.alloc(10), j = 0;\n\n if (this.seqObj) { // We're in the sequence.\n var dbcsCode = this.seqObj[DEF_CHAR];\n if (dbcsCode !== undefined) { // Write beginning of the sequence.\n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n } else {\n // See todo above.\n }\n this.seqObj = undefined;\n }\n\n if (this.leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n newBuf[j++] = this.defaultCharSingleByte;\n this.leadSurrogate = -1;\n }\n \n return newBuf.slice(0, j);\n}\n\n// Export for testing\nDBCSEncoder.prototype.findIdx = findIdx;\n\n\n// == Decoder ==================================================================\n\nfunction DBCSDecoder(options, codec) {\n // Decoder state\n this.nodeIdx = 0;\n this.prevBuf = Buffer.alloc(0);\n\n // Static data\n this.decodeTables = codec.decodeTables;\n this.decodeTableSeq = codec.decodeTableSeq;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSDecoder.prototype.write = function(buf) {\n var newBuf = Buffer.alloc(buf.length*2),\n nodeIdx = this.nodeIdx, \n prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,\n seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.\n uCode;\n\n if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.\n prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);\n \n for (var i = 0, j = 0; i < buf.length; i++) {\n var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];\n\n // Lookup in current trie node.\n var uCode = this.decodeTables[nodeIdx][curByte];\n\n if (uCode >= 0) { \n // Normal character, just use it.\n }\n else if (uCode === UNASSIGNED) { // Unknown char.\n // TODO: Callback with seq.\n //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).\n uCode = this.defaultCharUnicode.charCodeAt(0);\n }\n else if (uCode === GB18030_CODE) {\n var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);\n var idx = findIdx(this.gb18030.gbChars, ptr);\n uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];\n }\n else if (uCode <= NODE_START) { // Go to next trie node.\n nodeIdx = NODE_START - uCode;\n continue;\n }\n else if (uCode <= SEQ_START) { // Output a sequence of chars.\n var seq = this.decodeTableSeq[SEQ_START - uCode];\n for (var k = 0; k < seq.length - 1; k++) {\n uCode = seq[k];\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n }\n uCode = seq[seq.length-1];\n }\n else\n throw new Error(\"iconv-lite internal error: invalid decoding table value \" + uCode + \" at \" + nodeIdx + \"/\" + curByte);\n\n // Write the character to buffer, handling higher planes using surrogate pair.\n if (uCode > 0xFFFF) { \n uCode -= 0x10000;\n var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);\n newBuf[j++] = uCodeLead & 0xFF;\n newBuf[j++] = uCodeLead >> 8;\n\n uCode = 0xDC00 + uCode % 0x400;\n }\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n\n // Reset trie node.\n nodeIdx = 0; seqStart = i+1;\n }\n\n this.nodeIdx = nodeIdx;\n this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);\n return newBuf.slice(0, j).toString('ucs2');\n}\n\nDBCSDecoder.prototype.end = function() {\n var ret = '';\n\n // Try to parse all remaining chars.\n while (this.prevBuf.length > 0) {\n // Skip 1 character in the buffer.\n ret += this.defaultCharUnicode;\n var buf = this.prevBuf.slice(1);\n\n // Parse remaining as usual.\n this.prevBuf = Buffer.alloc(0);\n this.nodeIdx = 0;\n if (buf.length > 0)\n ret += this.write(buf);\n }\n\n this.nodeIdx = 0;\n return ret;\n}\n\n// Binary search for GB18030. Returns largest i such that table[i] <= val.\nfunction findIdx(table, val) {\n if (table[0] > val)\n return -1;\n\n var l = 0, r = table.length;\n while (l < r-1) { // always table[l] <= val < table[r]\n var mid = l + Math.floor((r-l+1)/2);\n if (table[mid] <= val)\n l = mid;\n else\n r = mid;\n }\n return l;\n}\n\n","\"use strict\";\n\n// Description of supported double byte encodings and aliases.\n// Tables are not require()-d until they are needed to speed up library load.\n// require()-s are direct to support Browserify.\n\nmodule.exports = {\n \n // == Japanese/ShiftJIS ====================================================\n // All japanese encodings are based on JIS X set of standards:\n // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.\n // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. \n // Has several variations in 1978, 1983, 1990 and 1997.\n // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.\n // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.\n // 2 planes, first is superset of 0208, second - revised 0212.\n // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)\n\n // Byte encodings are:\n // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte\n // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.\n // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.\n // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.\n // 0x00-0x7F - lower part of 0201\n // 0x8E, 0xA1-0xDF - upper part of 0201\n // (0xA1-0xFE)x2 - 0208 plane (94x94).\n // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).\n // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.\n // Used as-is in ISO2022 family.\n // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, \n // 0201-1976 Roman, 0208-1978, 0208-1983.\n // * ISO2022-JP-1: Adds esc seq for 0212-1990.\n // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.\n // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.\n // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.\n //\n // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.\n //\n // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html\n\n 'shiftjis': {\n type: '_dbcs',\n table: function() { return require('./tables/shiftjis.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n encodeSkipVals: [{from: 0xED40, to: 0xF940}],\n },\n 'csshiftjis': 'shiftjis',\n 'mskanji': 'shiftjis',\n 'sjis': 'shiftjis',\n 'windows31j': 'shiftjis',\n 'ms31j': 'shiftjis',\n 'xsjis': 'shiftjis',\n 'windows932': 'shiftjis',\n 'ms932': 'shiftjis',\n '932': 'shiftjis',\n 'cp932': 'shiftjis',\n\n 'eucjp': {\n type: '_dbcs',\n table: function() { return require('./tables/eucjp.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n },\n\n // TODO: KDDI extension to Shift_JIS\n // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.\n // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.\n\n\n // == Chinese/GBK ==========================================================\n // http://en.wikipedia.org/wiki/GBK\n // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder\n\n // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936\n 'gb2312': 'cp936',\n 'gb231280': 'cp936',\n 'gb23121980': 'cp936',\n 'csgb2312': 'cp936',\n 'csiso58gb231280': 'cp936',\n 'euccn': 'cp936',\n\n // Microsoft's CP936 is a subset and approximation of GBK.\n 'windows936': 'cp936',\n 'ms936': 'cp936',\n '936': 'cp936',\n 'cp936': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json') },\n },\n\n // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.\n 'gbk': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n },\n 'xgbk': 'gbk',\n 'isoir58': 'gbk',\n\n // GB18030 is an algorithmic extension of GBK.\n // Main source: https://www.w3.org/TR/encoding/#gbk-encoder\n // http://icu-project.org/docs/papers/gb18030.html\n // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml\n // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0\n 'gb18030': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n gb18030: function() { return require('./tables/gb18030-ranges.json') },\n encodeSkipVals: [0x80],\n encodeAdd: {'€': 0xA2E3},\n },\n\n 'chinese': 'gb18030',\n\n\n // == Korean ===============================================================\n // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.\n 'windows949': 'cp949',\n 'ms949': 'cp949',\n '949': 'cp949',\n 'cp949': {\n type: '_dbcs',\n table: function() { return require('./tables/cp949.json') },\n },\n\n 'cseuckr': 'cp949',\n 'csksc56011987': 'cp949',\n 'euckr': 'cp949',\n 'isoir149': 'cp949',\n 'korean': 'cp949',\n 'ksc56011987': 'cp949',\n 'ksc56011989': 'cp949',\n 'ksc5601': 'cp949',\n\n\n // == Big5/Taiwan/Hong Kong ================================================\n // There are lots of tables for Big5 and cp950. Please see the following links for history:\n // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html\n // Variations, in roughly number of defined chars:\n // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT\n // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/\n // * Big5-2003 (Taiwan standard) almost superset of cp950.\n // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.\n // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. \n // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.\n // Plus, it has 4 combining sequences.\n // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299\n // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.\n // Implementations are not consistent within browsers; sometimes labeled as just big5.\n // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.\n // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31\n // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.\n // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt\n // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt\n // \n // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder\n // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.\n\n 'windows950': 'cp950',\n 'ms950': 'cp950',\n '950': 'cp950',\n 'cp950': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json') },\n },\n\n // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.\n 'big5': 'big5hkscs',\n 'big5hkscs': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },\n encodeSkipVals: [0xa2cc],\n },\n\n 'cnbig5': 'big5hkscs',\n 'csbig5': 'big5hkscs',\n 'xxbig5': 'big5hkscs',\n};\n","\"use strict\";\n\n// Update this array if you add/rename/remove files in this directory.\n// We support Browserify by skipping automatic module discovery and requiring modules directly.\nvar modules = [\n require(\"./internal\"),\n require(\"./utf16\"),\n require(\"./utf7\"),\n require(\"./sbcs-codec\"),\n require(\"./sbcs-data\"),\n require(\"./sbcs-data-generated\"),\n require(\"./dbcs-codec\"),\n require(\"./dbcs-data\"),\n];\n\n// Put all encoding/alias/codec definitions to single object and export it. \nfor (var i = 0; i < modules.length; i++) {\n var module = modules[i];\n for (var enc in module)\n if (Object.prototype.hasOwnProperty.call(module, enc))\n exports[enc] = module[enc];\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Export Node.js internal encodings.\n\nmodule.exports = {\n // Encodings\n utf8: { type: \"_internal\", bomAware: true},\n cesu8: { type: \"_internal\", bomAware: true},\n unicode11utf8: \"utf8\",\n\n ucs2: { type: \"_internal\", bomAware: true},\n utf16le: \"ucs2\",\n\n binary: { type: \"_internal\" },\n base64: { type: \"_internal\" },\n hex: { type: \"_internal\" },\n\n // Codec.\n _internal: InternalCodec,\n};\n\n//------------------------------------------------------------------------------\n\nfunction InternalCodec(codecOptions, iconv) {\n this.enc = codecOptions.encodingName;\n this.bomAware = codecOptions.bomAware;\n\n if (this.enc === \"base64\")\n this.encoder = InternalEncoderBase64;\n else if (this.enc === \"cesu8\") {\n this.enc = \"utf8\"; // Use utf8 for decoding.\n this.encoder = InternalEncoderCesu8;\n\n // Add decoder for versions of Node not supporting CESU-8\n if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {\n this.decoder = InternalDecoderCesu8;\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n }\n }\n}\n\nInternalCodec.prototype.encoder = InternalEncoder;\nInternalCodec.prototype.decoder = InternalDecoder;\n\n//------------------------------------------------------------------------------\n\n// We use node.js internal decoder. Its signature is the same as ours.\nvar StringDecoder = require('string_decoder').StringDecoder;\n\nif (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.\n StringDecoder.prototype.end = function() {};\n\n\nfunction InternalDecoder(options, codec) {\n StringDecoder.call(this, codec.enc);\n}\n\nInternalDecoder.prototype = StringDecoder.prototype;\n\n\n//------------------------------------------------------------------------------\n// Encoder is mostly trivial\n\nfunction InternalEncoder(options, codec) {\n this.enc = codec.enc;\n}\n\nInternalEncoder.prototype.write = function(str) {\n return Buffer.from(str, this.enc);\n}\n\nInternalEncoder.prototype.end = function() {\n}\n\n\n//------------------------------------------------------------------------------\n// Except base64 encoder, which must keep its state.\n\nfunction InternalEncoderBase64(options, codec) {\n this.prevStr = '';\n}\n\nInternalEncoderBase64.prototype.write = function(str) {\n str = this.prevStr + str;\n var completeQuads = str.length - (str.length % 4);\n this.prevStr = str.slice(completeQuads);\n str = str.slice(0, completeQuads);\n\n return Buffer.from(str, \"base64\");\n}\n\nInternalEncoderBase64.prototype.end = function() {\n return Buffer.from(this.prevStr, \"base64\");\n}\n\n\n//------------------------------------------------------------------------------\n// CESU-8 encoder is also special.\n\nfunction InternalEncoderCesu8(options, codec) {\n}\n\nInternalEncoderCesu8.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length * 3), bufIdx = 0;\n for (var i = 0; i < str.length; i++) {\n var charCode = str.charCodeAt(i);\n // Naive implementation, but it works because CESU-8 is especially easy\n // to convert from UTF-16 (which all JS strings are encoded in).\n if (charCode < 0x80)\n buf[bufIdx++] = charCode;\n else if (charCode < 0x800) {\n buf[bufIdx++] = 0xC0 + (charCode >>> 6);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n else { // charCode will always be < 0x10000 in javascript.\n buf[bufIdx++] = 0xE0 + (charCode >>> 12);\n buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n }\n return buf.slice(0, bufIdx);\n}\n\nInternalEncoderCesu8.prototype.end = function() {\n}\n\n//------------------------------------------------------------------------------\n// CESU-8 decoder is not implemented in Node v4.0+\n\nfunction InternalDecoderCesu8(options, codec) {\n this.acc = 0;\n this.contBytes = 0;\n this.accBytes = 0;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n}\n\nInternalDecoderCesu8.prototype.write = function(buf) {\n var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, \n res = '';\n for (var i = 0; i < buf.length; i++) {\n var curByte = buf[i];\n if ((curByte & 0xC0) !== 0x80) { // Leading byte\n if (contBytes > 0) { // Previous code is invalid\n res += this.defaultCharUnicode;\n contBytes = 0;\n }\n\n if (curByte < 0x80) { // Single-byte code\n res += String.fromCharCode(curByte);\n } else if (curByte < 0xE0) { // Two-byte code\n acc = curByte & 0x1F;\n contBytes = 1; accBytes = 1;\n } else if (curByte < 0xF0) { // Three-byte code\n acc = curByte & 0x0F;\n contBytes = 2; accBytes = 1;\n } else { // Four or more are not supported for CESU-8.\n res += this.defaultCharUnicode;\n }\n } else { // Continuation byte\n if (contBytes > 0) { // We're waiting for it.\n acc = (acc << 6) | (curByte & 0x3f);\n contBytes--; accBytes++;\n if (contBytes === 0) {\n // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)\n if (accBytes === 2 && acc < 0x80 && acc > 0)\n res += this.defaultCharUnicode;\n else if (accBytes === 3 && acc < 0x800)\n res += this.defaultCharUnicode;\n else\n // Actually add character.\n res += String.fromCharCode(acc);\n }\n } else { // Unexpected continuation byte\n res += this.defaultCharUnicode;\n }\n }\n }\n this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;\n return res;\n}\n\nInternalDecoderCesu8.prototype.end = function() {\n var res = 0;\n if (this.contBytes > 0)\n res += this.defaultCharUnicode;\n return res;\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that\n// correspond to encoded bytes (if 128 - then lower half is ASCII). \n\nexports._sbcs = SBCSCodec;\nfunction SBCSCodec(codecOptions, iconv) {\n if (!codecOptions)\n throw new Error(\"SBCS codec is called without the data.\")\n \n // Prepare char buffer for decoding.\n if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))\n throw new Error(\"Encoding '\"+codecOptions.type+\"' has incorrect 'chars' (must be of len 128 or 256)\");\n \n if (codecOptions.chars.length === 128) {\n var asciiString = \"\";\n for (var i = 0; i < 128; i++)\n asciiString += String.fromCharCode(i);\n codecOptions.chars = asciiString + codecOptions.chars;\n }\n\n this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');\n \n // Encoding buffer.\n var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));\n\n for (var i = 0; i < codecOptions.chars.length; i++)\n encodeBuf[codecOptions.chars.charCodeAt(i)] = i;\n\n this.encodeBuf = encodeBuf;\n}\n\nSBCSCodec.prototype.encoder = SBCSEncoder;\nSBCSCodec.prototype.decoder = SBCSDecoder;\n\n\nfunction SBCSEncoder(options, codec) {\n this.encodeBuf = codec.encodeBuf;\n}\n\nSBCSEncoder.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length);\n for (var i = 0; i < str.length; i++)\n buf[i] = this.encodeBuf[str.charCodeAt(i)];\n \n return buf;\n}\n\nSBCSEncoder.prototype.end = function() {\n}\n\n\nfunction SBCSDecoder(options, codec) {\n this.decodeBuf = codec.decodeBuf;\n}\n\nSBCSDecoder.prototype.write = function(buf) {\n // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.\n var decodeBuf = this.decodeBuf;\n var newBuf = Buffer.alloc(buf.length*2);\n var idx1 = 0, idx2 = 0;\n for (var i = 0; i < buf.length; i++) {\n idx1 = buf[i]*2; idx2 = i*2;\n newBuf[idx2] = decodeBuf[idx1];\n newBuf[idx2+1] = decodeBuf[idx1+1];\n }\n return newBuf.toString('ucs2');\n}\n\nSBCSDecoder.prototype.end = function() {\n}\n","\"use strict\";\n\n// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.\nmodule.exports = {\n \"437\": \"cp437\",\n \"737\": \"cp737\",\n \"775\": \"cp775\",\n \"850\": \"cp850\",\n \"852\": \"cp852\",\n \"855\": \"cp855\",\n \"856\": \"cp856\",\n \"857\": \"cp857\",\n \"858\": \"cp858\",\n \"860\": \"cp860\",\n \"861\": \"cp861\",\n \"862\": \"cp862\",\n \"863\": \"cp863\",\n \"864\": \"cp864\",\n \"865\": \"cp865\",\n \"866\": \"cp866\",\n \"869\": \"cp869\",\n \"874\": \"windows874\",\n \"922\": \"cp922\",\n \"1046\": \"cp1046\",\n \"1124\": \"cp1124\",\n \"1125\": \"cp1125\",\n \"1129\": \"cp1129\",\n \"1133\": \"cp1133\",\n \"1161\": \"cp1161\",\n \"1162\": \"cp1162\",\n \"1163\": \"cp1163\",\n \"1250\": \"windows1250\",\n \"1251\": \"windows1251\",\n \"1252\": \"windows1252\",\n \"1253\": \"windows1253\",\n \"1254\": \"windows1254\",\n \"1255\": \"windows1255\",\n \"1256\": \"windows1256\",\n \"1257\": \"windows1257\",\n \"1258\": \"windows1258\",\n \"28591\": \"iso88591\",\n \"28592\": \"iso88592\",\n \"28593\": \"iso88593\",\n \"28594\": \"iso88594\",\n \"28595\": \"iso88595\",\n \"28596\": \"iso88596\",\n \"28597\": \"iso88597\",\n \"28598\": \"iso88598\",\n \"28599\": \"iso88599\",\n \"28600\": \"iso885910\",\n \"28601\": \"iso885911\",\n \"28603\": \"iso885913\",\n \"28604\": \"iso885914\",\n \"28605\": \"iso885915\",\n \"28606\": \"iso885916\",\n \"windows874\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"win874\": \"windows874\",\n \"cp874\": \"windows874\",\n \"windows1250\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"win1250\": \"windows1250\",\n \"cp1250\": \"windows1250\",\n \"windows1251\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"win1251\": \"windows1251\",\n \"cp1251\": \"windows1251\",\n \"windows1252\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"win1252\": \"windows1252\",\n \"cp1252\": \"windows1252\",\n \"windows1253\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"win1253\": \"windows1253\",\n \"cp1253\": \"windows1253\",\n \"windows1254\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"win1254\": \"windows1254\",\n \"cp1254\": \"windows1254\",\n \"windows1255\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"win1255\": \"windows1255\",\n \"cp1255\": \"windows1255\",\n \"windows1256\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے\"\n },\n \"win1256\": \"windows1256\",\n \"cp1256\": \"windows1256\",\n \"windows1257\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙\"\n },\n \"win1257\": \"windows1257\",\n \"cp1257\": \"windows1257\",\n \"windows1258\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"win1258\": \"windows1258\",\n \"cp1258\": \"windows1258\",\n \"iso88591\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28591\": \"iso88591\",\n \"iso88592\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"cp28592\": \"iso88592\",\n \"iso88593\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙\"\n },\n \"cp28593\": \"iso88593\",\n \"iso88594\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙\"\n },\n \"cp28594\": \"iso88594\",\n \"iso88595\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ\"\n },\n \"cp28595\": \"iso88595\",\n \"iso88596\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������\"\n },\n \"cp28596\": \"iso88596\",\n \"iso88597\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"cp28597\": \"iso88597\",\n \"iso88598\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"cp28598\": \"iso88598\",\n \"iso88599\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"cp28599\": \"iso88599\",\n \"iso885910\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ\"\n },\n \"cp28600\": \"iso885910\",\n \"iso885911\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"cp28601\": \"iso885911\",\n \"iso885913\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’\"\n },\n \"cp28603\": \"iso885913\",\n \"iso885914\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ\"\n },\n \"cp28604\": \"iso885914\",\n \"iso885915\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28605\": \"iso885915\",\n \"iso885916\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ\"\n },\n \"cp28606\": \"iso885916\",\n \"cp437\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm437\": \"cp437\",\n \"csibm437\": \"cp437\",\n \"cp737\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ \"\n },\n \"ibm737\": \"cp737\",\n \"csibm737\": \"cp737\",\n \"cp775\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ \"\n },\n \"ibm775\": \"cp775\",\n \"csibm775\": \"cp775\",\n \"cp850\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm850\": \"cp850\",\n \"csibm850\": \"cp850\",\n \"cp852\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ \"\n },\n \"ibm852\": \"cp852\",\n \"csibm852\": \"cp852\",\n \"cp855\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ \"\n },\n \"ibm855\": \"cp855\",\n \"csibm855\": \"cp855\",\n \"cp856\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm856\": \"cp856\",\n \"csibm856\": \"cp856\",\n \"cp857\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm857\": \"cp857\",\n \"csibm857\": \"cp857\",\n \"cp858\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm858\": \"cp858\",\n \"csibm858\": \"cp858\",\n \"cp860\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm860\": \"cp860\",\n \"csibm860\": \"cp860\",\n \"cp861\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm861\": \"cp861\",\n \"csibm861\": \"cp861\",\n \"cp862\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm862\": \"cp862\",\n \"csibm862\": \"cp862\",\n \"cp863\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm863\": \"cp863\",\n \"csibm863\": \"cp863\",\n \"cp864\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�\"\n },\n \"ibm864\": \"cp864\",\n \"csibm864\": \"cp864\",\n \"cp865\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm865\": \"cp865\",\n \"csibm865\": \"cp865\",\n \"cp866\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ \"\n },\n \"ibm866\": \"cp866\",\n \"csibm866\": \"cp866\",\n \"cp869\": {\n \"type\": \"_sbcs\",\n \"chars\": \"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ \"\n },\n \"ibm869\": \"cp869\",\n \"csibm869\": \"cp869\",\n \"cp922\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ\"\n },\n \"ibm922\": \"cp922\",\n \"csibm922\": \"cp922\",\n \"cp1046\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�\"\n },\n \"ibm1046\": \"cp1046\",\n \"csibm1046\": \"cp1046\",\n \"cp1124\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ\"\n },\n \"ibm1124\": \"cp1124\",\n \"csibm1124\": \"cp1124\",\n \"cp1125\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ \"\n },\n \"ibm1125\": \"cp1125\",\n \"csibm1125\": \"cp1125\",\n \"cp1129\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1129\": \"cp1129\",\n \"csibm1129\": \"cp1129\",\n \"cp1133\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�\"\n },\n \"ibm1133\": \"cp1133\",\n \"csibm1133\": \"cp1133\",\n \"cp1161\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ \"\n },\n \"ibm1161\": \"cp1161\",\n \"csibm1161\": \"cp1161\",\n \"cp1162\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"ibm1162\": \"cp1162\",\n \"csibm1162\": \"cp1162\",\n \"cp1163\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1163\": \"cp1163\",\n \"csibm1163\": \"cp1163\",\n \"maccroatian\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ\"\n },\n \"maccyrillic\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"macgreek\": {\n \"type\": \"_sbcs\",\n \"chars\": \"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�\"\n },\n \"maciceland\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macroman\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macromania\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macthai\": {\n \"type\": \"_sbcs\",\n \"chars\": \"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����\"\n },\n \"macturkish\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macukraine\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"koi8r\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8u\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8ru\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8t\": {\n \"type\": \"_sbcs\",\n \"chars\": \"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"armscii8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�\"\n },\n \"rk1048\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"tcvn\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000ÚỤ\\u0003ỪỬỮ\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010ỨỰỲỶỸÝỴ\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ\"\n },\n \"georgianacademy\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"georgianps\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"pt154\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"viscii\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001Ẳ\\u0003\\u0004ẴẪ\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013Ỷ\\u0015\\u0016\\u0017\\u0018Ỹ\\u001a\\u001b\\u001c\\u001dỴ\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ\"\n },\n \"iso646cn\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"iso646jp\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"hproman8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�\"\n },\n \"macintosh\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"ascii\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"tis620\": {\n \"type\": \"_sbcs\",\n \"chars\": \"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n }\n}","\"use strict\";\n\n// Manually added data to be used by sbcs codec in addition to generated one.\n\nmodule.exports = {\n // Not supported by iconv, not sure why.\n \"10029\": \"maccenteuro\",\n \"maccenteuro\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ\"\n },\n\n \"808\": \"cp808\",\n \"ibm808\": \"cp808\",\n \"cp808\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ \"\n },\n\n \"mik\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n\n // Aliases of generated encodings.\n \"ascii8bit\": \"ascii\",\n \"usascii\": \"ascii\",\n \"ansix34\": \"ascii\",\n \"ansix341968\": \"ascii\",\n \"ansix341986\": \"ascii\",\n \"csascii\": \"ascii\",\n \"cp367\": \"ascii\",\n \"ibm367\": \"ascii\",\n \"isoir6\": \"ascii\",\n \"iso646us\": \"ascii\",\n \"iso646irv\": \"ascii\",\n \"us\": \"ascii\",\n\n \"latin1\": \"iso88591\",\n \"latin2\": \"iso88592\",\n \"latin3\": \"iso88593\",\n \"latin4\": \"iso88594\",\n \"latin5\": \"iso88599\",\n \"latin6\": \"iso885910\",\n \"latin7\": \"iso885913\",\n \"latin8\": \"iso885914\",\n \"latin9\": \"iso885915\",\n \"latin10\": \"iso885916\",\n\n \"csisolatin1\": \"iso88591\",\n \"csisolatin2\": \"iso88592\",\n \"csisolatin3\": \"iso88593\",\n \"csisolatin4\": \"iso88594\",\n \"csisolatincyrillic\": \"iso88595\",\n \"csisolatinarabic\": \"iso88596\",\n \"csisolatingreek\" : \"iso88597\",\n \"csisolatinhebrew\": \"iso88598\",\n \"csisolatin5\": \"iso88599\",\n \"csisolatin6\": \"iso885910\",\n\n \"l1\": \"iso88591\",\n \"l2\": \"iso88592\",\n \"l3\": \"iso88593\",\n \"l4\": \"iso88594\",\n \"l5\": \"iso88599\",\n \"l6\": \"iso885910\",\n \"l7\": \"iso885913\",\n \"l8\": \"iso885914\",\n \"l9\": \"iso885915\",\n \"l10\": \"iso885916\",\n\n \"isoir14\": \"iso646jp\",\n \"isoir57\": \"iso646cn\",\n \"isoir100\": \"iso88591\",\n \"isoir101\": \"iso88592\",\n \"isoir109\": \"iso88593\",\n \"isoir110\": \"iso88594\",\n \"isoir144\": \"iso88595\",\n \"isoir127\": \"iso88596\",\n \"isoir126\": \"iso88597\",\n \"isoir138\": \"iso88598\",\n \"isoir148\": \"iso88599\",\n \"isoir157\": \"iso885910\",\n \"isoir166\": \"tis620\",\n \"isoir179\": \"iso885913\",\n \"isoir199\": \"iso885914\",\n \"isoir203\": \"iso885915\",\n \"isoir226\": \"iso885916\",\n\n \"cp819\": \"iso88591\",\n \"ibm819\": \"iso88591\",\n\n \"cyrillic\": \"iso88595\",\n\n \"arabic\": \"iso88596\",\n \"arabic8\": \"iso88596\",\n \"ecma114\": \"iso88596\",\n \"asmo708\": \"iso88596\",\n\n \"greek\" : \"iso88597\",\n \"greek8\" : \"iso88597\",\n \"ecma118\" : \"iso88597\",\n \"elot928\" : \"iso88597\",\n\n \"hebrew\": \"iso88598\",\n \"hebrew8\": \"iso88598\",\n\n \"turkish\": \"iso88599\",\n \"turkish8\": \"iso88599\",\n\n \"thai\": \"iso885911\",\n \"thai8\": \"iso885911\",\n\n \"celtic\": \"iso885914\",\n \"celtic8\": \"iso885914\",\n \"isoceltic\": \"iso885914\",\n\n \"tis6200\": \"tis620\",\n \"tis62025291\": \"tis620\",\n \"tis62025330\": \"tis620\",\n\n \"10000\": \"macroman\",\n \"10006\": \"macgreek\",\n \"10007\": \"maccyrillic\",\n \"10079\": \"maciceland\",\n \"10081\": \"macturkish\",\n\n \"cspc8codepage437\": \"cp437\",\n \"cspc775baltic\": \"cp775\",\n \"cspc850multilingual\": \"cp850\",\n \"cspcp852\": \"cp852\",\n \"cspc862latinhebrew\": \"cp862\",\n \"cpgr\": \"cp869\",\n\n \"msee\": \"cp1250\",\n \"mscyrl\": \"cp1251\",\n \"msansi\": \"cp1252\",\n \"msgreek\": \"cp1253\",\n \"msturk\": \"cp1254\",\n \"mshebr\": \"cp1255\",\n \"msarab\": \"cp1256\",\n \"winbaltrim\": \"cp1257\",\n\n \"cp20866\": \"koi8r\",\n \"20866\": \"koi8r\",\n \"ibm878\": \"koi8r\",\n \"cskoi8r\": \"koi8r\",\n\n \"cp21866\": \"koi8u\",\n \"21866\": \"koi8u\",\n \"ibm1168\": \"koi8u\",\n\n \"strk10482002\": \"rk1048\",\n\n \"tcvn5712\": \"tcvn\",\n \"tcvn57121\": \"tcvn\",\n\n \"gb198880\": \"iso646cn\",\n \"cn\": \"iso646cn\",\n\n \"csiso14jisc6220ro\": \"iso646jp\",\n \"jisc62201969ro\": \"iso646jp\",\n \"jp\": \"iso646jp\",\n\n \"cshproman8\": \"hproman8\",\n \"r8\": \"hproman8\",\n \"roman8\": \"hproman8\",\n \"xroman8\": \"hproman8\",\n \"ibm1051\": \"hproman8\",\n\n \"mac\": \"macintosh\",\n \"csmacintosh\": \"macintosh\",\n};\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js\n\n// == UTF16-BE codec. ==========================================================\n\nexports.utf16be = Utf16BECodec;\nfunction Utf16BECodec() {\n}\n\nUtf16BECodec.prototype.encoder = Utf16BEEncoder;\nUtf16BECodec.prototype.decoder = Utf16BEDecoder;\nUtf16BECodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf16BEEncoder() {\n}\n\nUtf16BEEncoder.prototype.write = function(str) {\n var buf = Buffer.from(str, 'ucs2');\n for (var i = 0; i < buf.length; i += 2) {\n var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;\n }\n return buf;\n}\n\nUtf16BEEncoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf16BEDecoder() {\n this.overflowByte = -1;\n}\n\nUtf16BEDecoder.prototype.write = function(buf) {\n if (buf.length == 0)\n return '';\n\n var buf2 = Buffer.alloc(buf.length + 1),\n i = 0, j = 0;\n\n if (this.overflowByte !== -1) {\n buf2[0] = buf[0];\n buf2[1] = this.overflowByte;\n i = 1; j = 2;\n }\n\n for (; i < buf.length-1; i += 2, j+= 2) {\n buf2[j] = buf[i+1];\n buf2[j+1] = buf[i];\n }\n\n this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;\n\n return buf2.slice(0, j).toString('ucs2');\n}\n\nUtf16BEDecoder.prototype.end = function() {\n}\n\n\n// == UTF-16 codec =============================================================\n// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.\n// Defaults to UTF-16LE, as it's prevalent and default in Node.\n// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le\n// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});\n\n// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).\n\nexports.utf16 = Utf16Codec;\nfunction Utf16Codec(codecOptions, iconv) {\n this.iconv = iconv;\n}\n\nUtf16Codec.prototype.encoder = Utf16Encoder;\nUtf16Codec.prototype.decoder = Utf16Decoder;\n\n\n// -- Encoding (pass-through)\n\nfunction Utf16Encoder(options, codec) {\n options = options || {};\n if (options.addBOM === undefined)\n options.addBOM = true;\n this.encoder = codec.iconv.getEncoder('utf-16le', options);\n}\n\nUtf16Encoder.prototype.write = function(str) {\n return this.encoder.write(str);\n}\n\nUtf16Encoder.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n// -- Decoding\n\nfunction Utf16Decoder(options, codec) {\n this.decoder = null;\n this.initialBytes = [];\n this.initialBytesLen = 0;\n\n this.options = options || {};\n this.iconv = codec.iconv;\n}\n\nUtf16Decoder.prototype.write = function(buf) {\n if (!this.decoder) {\n // Codec is not chosen yet. Accumulate initial bytes.\n this.initialBytes.push(buf);\n this.initialBytesLen += buf.length;\n \n if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)\n return '';\n\n // We have enough bytes -> detect endianness.\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n this.initialBytes.length = this.initialBytesLen = 0;\n }\n\n return this.decoder.write(buf);\n}\n\nUtf16Decoder.prototype.end = function() {\n if (!this.decoder) {\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n\n var res = this.decoder.write(buf),\n trail = this.decoder.end();\n\n return trail ? (res + trail) : res;\n }\n return this.decoder.end();\n}\n\nfunction detectEncoding(buf, defaultEncoding) {\n var enc = defaultEncoding || 'utf-16le';\n\n if (buf.length >= 2) {\n // Check BOM.\n if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM\n enc = 'utf-16be';\n else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM\n enc = 'utf-16le';\n else {\n // No BOM found. Try to deduce encoding from initial content.\n // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.\n // So, we count ASCII as if it was LE or BE, and decide from that.\n var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions\n _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.\n\n for (var i = 0; i < _len; i += 2) {\n if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;\n if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;\n }\n\n if (asciiCharsBE > asciiCharsLE)\n enc = 'utf-16be';\n else if (asciiCharsBE < asciiCharsLE)\n enc = 'utf-16le';\n }\n }\n\n return enc;\n}\n\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152\n// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3\n\nexports.utf7 = Utf7Codec;\nexports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7\nfunction Utf7Codec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7Codec.prototype.encoder = Utf7Encoder;\nUtf7Codec.prototype.decoder = Utf7Decoder;\nUtf7Codec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nvar nonDirectChars = /[^A-Za-z0-9'\\(\\),-\\.\\/:\\? \\n\\r\\t]+/g;\n\nfunction Utf7Encoder(options, codec) {\n this.iconv = codec.iconv;\n}\n\nUtf7Encoder.prototype.write = function(str) {\n // Naive implementation.\n // Non-direct chars are encoded as \"+-\"; single \"+\" char is encoded as \"+-\".\n return Buffer.from(str.replace(nonDirectChars, function(chunk) {\n return \"+\" + (chunk === '+' ? '' : \n this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) \n + \"-\";\n }.bind(this)));\n}\n\nUtf7Encoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf7Decoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64Regex = /[A-Za-z0-9\\/+]/;\nvar base64Chars = [];\nfor (var i = 0; i < 256; i++)\n base64Chars[i] = base64Regex.test(String.fromCharCode(i));\n\nvar plusChar = '+'.charCodeAt(0), \n minusChar = '-'.charCodeAt(0),\n andChar = '&'.charCodeAt(0);\n\nUtf7Decoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '+'\n if (buf[i] == plusChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64Chars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) {// \"+-\" -> \"+\"\n res += \"+\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString();\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus is absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString();\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7Decoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n// UTF-7-IMAP codec.\n// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)\n// Differences:\n// * Base64 part is started by \"&\" instead of \"+\"\n// * Direct characters are 0x20-0x7E, except \"&\" (0x26)\n// * In Base64, \",\" is used instead of \"/\"\n// * Base64 must not be used to represent direct characters.\n// * No implicit shift back from Base64 (should always end with '-')\n// * String must end in non-shifted position.\n// * \"-&\" while in base64 is not allowed.\n\n\nexports.utf7imap = Utf7IMAPCodec;\nfunction Utf7IMAPCodec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;\nUtf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;\nUtf7IMAPCodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf7IMAPEncoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = Buffer.alloc(6);\n this.base64AccumIdx = 0;\n}\n\nUtf7IMAPEncoder.prototype.write = function(str) {\n var inBase64 = this.inBase64,\n base64Accum = this.base64Accum,\n base64AccumIdx = this.base64AccumIdx,\n buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;\n\n for (var i = 0; i < str.length; i++) {\n var uChar = str.charCodeAt(i);\n if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.\n if (inBase64) {\n if (base64AccumIdx > 0) {\n bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n inBase64 = false;\n }\n\n if (!inBase64) {\n buf[bufIdx++] = uChar; // Write direct character\n\n if (uChar === andChar) // Ampersand -> '&-'\n buf[bufIdx++] = minusChar;\n }\n\n } else { // Non-direct character\n if (!inBase64) {\n buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.\n inBase64 = true;\n }\n if (inBase64) {\n base64Accum[base64AccumIdx++] = uChar >> 8;\n base64Accum[base64AccumIdx++] = uChar & 0xFF;\n\n if (base64AccumIdx == base64Accum.length) {\n bufIdx += buf.write(base64Accum.toString('base64').replace(/\\//g, ','), bufIdx);\n base64AccumIdx = 0;\n }\n }\n }\n }\n\n this.inBase64 = inBase64;\n this.base64AccumIdx = base64AccumIdx;\n\n return buf.slice(0, bufIdx);\n}\n\nUtf7IMAPEncoder.prototype.end = function() {\n var buf = Buffer.alloc(10), bufIdx = 0;\n if (this.inBase64) {\n if (this.base64AccumIdx > 0) {\n bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n this.base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n this.inBase64 = false;\n }\n\n return buf.slice(0, bufIdx);\n}\n\n\n// -- Decoding\n\nfunction Utf7IMAPDecoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64IMAPChars = base64Chars.slice();\nbase64IMAPChars[','.charCodeAt(0)] = true;\n\nUtf7IMAPDecoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '&'\n if (buf[i] == andChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64IMAPChars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) { // \"&-\" -> \"&\"\n res += \"&\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus may be absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7IMAPDecoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n","\"use strict\";\n\nvar BOMChar = '\\uFEFF';\n\nexports.PrependBOM = PrependBOMWrapper\nfunction PrependBOMWrapper(encoder, options) {\n this.encoder = encoder;\n this.addBOM = true;\n}\n\nPrependBOMWrapper.prototype.write = function(str) {\n if (this.addBOM) {\n str = BOMChar + str;\n this.addBOM = false;\n }\n\n return this.encoder.write(str);\n}\n\nPrependBOMWrapper.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n//------------------------------------------------------------------------------\n\nexports.StripBOM = StripBOMWrapper;\nfunction StripBOMWrapper(decoder, options) {\n this.decoder = decoder;\n this.pass = false;\n this.options = options || {};\n}\n\nStripBOMWrapper.prototype.write = function(buf) {\n var res = this.decoder.write(buf);\n if (this.pass || !res)\n return res;\n\n if (res[0] === BOMChar) {\n res = res.slice(1);\n if (typeof this.options.stripBOM === 'function')\n this.options.stripBOM();\n }\n\n this.pass = true;\n return res;\n}\n\nStripBOMWrapper.prototype.end = function() {\n return this.decoder.end();\n}\n\n","\"use strict\";\nvar Buffer = require(\"buffer\").Buffer;\n// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer\n\n// == Extend Node primitives to use iconv-lite =================================\n\nmodule.exports = function (iconv) {\n var original = undefined; // Place to keep original methods.\n\n // Node authors rewrote Buffer internals to make it compatible with\n // Uint8Array and we cannot patch key functions since then.\n // Note: this does use older Buffer API on a purpose\n iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);\n\n iconv.extendNodeEncodings = function extendNodeEncodings() {\n if (original) return;\n original = {};\n\n if (!iconv.supportsNodeEncodingsExtension) {\n console.error(\"ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node\");\n console.error(\"See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility\");\n return;\n }\n\n var nodeNativeEncodings = {\n 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, \n 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,\n };\n\n Buffer.isNativeEncoding = function(enc) {\n return enc && nodeNativeEncodings[enc.toLowerCase()];\n }\n\n // -- SlowBuffer -----------------------------------------------------------\n var SlowBuffer = require('buffer').SlowBuffer;\n\n original.SlowBufferToString = SlowBuffer.prototype.toString;\n SlowBuffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.SlowBufferWrite = SlowBuffer.prototype.write;\n SlowBuffer.prototype.write = function(string, offset, length, encoding) {\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferWrite.call(this, string, offset, length, encoding);\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n }\n\n // -- Buffer ---------------------------------------------------------------\n\n original.BufferIsEncoding = Buffer.isEncoding;\n Buffer.isEncoding = function(encoding) {\n return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);\n }\n\n original.BufferByteLength = Buffer.byteLength;\n Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferByteLength.call(this, str, encoding);\n\n // Slow, I know, but we don't have a better way yet.\n return iconv.encode(str, encoding).length;\n }\n\n original.BufferToString = Buffer.prototype.toString;\n Buffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.BufferWrite = Buffer.prototype.write;\n Buffer.prototype.write = function(string, offset, length, encoding) {\n var _offset = offset, _length = length, _encoding = encoding;\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferWrite.call(this, string, _offset, _length, _encoding);\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n\n // TODO: Set _charsWritten.\n }\n\n\n // -- Readable -------------------------------------------------------------\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n original.ReadableSetEncoding = Readable.prototype.setEncoding;\n Readable.prototype.setEncoding = function setEncoding(enc, options) {\n // Use our own decoder, it has the same interface.\n // We cannot use original function as it doesn't handle BOM-s.\n this._readableState.decoder = iconv.getDecoder(enc, options);\n this._readableState.encoding = enc;\n }\n\n Readable.prototype.collect = iconv._collect;\n }\n }\n\n // Remove iconv-lite Node primitive extensions.\n iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {\n if (!iconv.supportsNodeEncodingsExtension)\n return;\n if (!original)\n throw new Error(\"require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.\")\n\n delete Buffer.isNativeEncoding;\n\n var SlowBuffer = require('buffer').SlowBuffer;\n\n SlowBuffer.prototype.toString = original.SlowBufferToString;\n SlowBuffer.prototype.write = original.SlowBufferWrite;\n\n Buffer.isEncoding = original.BufferIsEncoding;\n Buffer.byteLength = original.BufferByteLength;\n Buffer.prototype.toString = original.BufferToString;\n Buffer.prototype.write = original.BufferWrite;\n\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n Readable.prototype.setEncoding = original.ReadableSetEncoding;\n delete Readable.prototype.collect;\n }\n\n original = undefined;\n }\n}\n","\"use strict\";\n\n// Some environments don't have global Buffer (e.g. React Native).\n// Solution would be installing npm modules \"buffer\" and \"stream\" explicitly.\nvar Buffer = require(\"safer-buffer\").Buffer;\n\nvar bomHandling = require(\"./bom-handling\"),\n iconv = module.exports;\n\n// All codecs and aliases are kept here, keyed by encoding name/alias.\n// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.\niconv.encodings = null;\n\n// Characters emitted in case of error.\niconv.defaultCharUnicode = '�';\niconv.defaultCharSingleByte = '?';\n\n// Public API.\niconv.encode = function encode(str, encoding, options) {\n str = \"\" + (str || \"\"); // Ensure string.\n\n var encoder = iconv.getEncoder(encoding, options);\n\n var res = encoder.write(str);\n var trail = encoder.end();\n \n return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;\n}\n\niconv.decode = function decode(buf, encoding, options) {\n if (typeof buf === 'string') {\n if (!iconv.skipDecodeWarning) {\n console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');\n iconv.skipDecodeWarning = true;\n }\n\n buf = Buffer.from(\"\" + (buf || \"\"), \"binary\"); // Ensure buffer.\n }\n\n var decoder = iconv.getDecoder(encoding, options);\n\n var res = decoder.write(buf);\n var trail = decoder.end();\n\n return trail ? (res + trail) : res;\n}\n\niconv.encodingExists = function encodingExists(enc) {\n try {\n iconv.getCodec(enc);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n// Legacy aliases to convert functions\niconv.toEncoding = iconv.encode;\niconv.fromEncoding = iconv.decode;\n\n// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.\niconv._codecDataCache = {};\niconv.getCodec = function getCodec(encoding) {\n if (!iconv.encodings)\n iconv.encodings = require(\"../encodings\"); // Lazy load all encoding definitions.\n \n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n var enc = iconv._canonicalizeEncoding(encoding);\n\n // Traverse iconv.encodings to find actual codec.\n var codecOptions = {};\n while (true) {\n var codec = iconv._codecDataCache[enc];\n if (codec)\n return codec;\n\n var codecDef = iconv.encodings[enc];\n\n switch (typeof codecDef) {\n case \"string\": // Direct alias to other encoding.\n enc = codecDef;\n break;\n\n case \"object\": // Alias with options. Can be layered.\n for (var key in codecDef)\n codecOptions[key] = codecDef[key];\n\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n \n enc = codecDef.type;\n break;\n\n case \"function\": // Codec itself.\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n\n // The codec function must load all tables and return object with .encoder and .decoder methods.\n // It'll be called only once (for each different options object).\n codec = new codecDef(codecOptions, iconv);\n\n iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.\n return codec;\n\n default:\n throw new Error(\"Encoding not recognized: '\" + encoding + \"' (searched as: '\"+enc+\"')\");\n }\n }\n}\n\niconv._canonicalizeEncoding = function(encoding) {\n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n return (''+encoding).toLowerCase().replace(/:\\d{4}$|[^0-9a-z]/g, \"\");\n}\n\niconv.getEncoder = function getEncoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n encoder = new codec.encoder(options, codec);\n\n if (codec.bomAware && options && options.addBOM)\n encoder = new bomHandling.PrependBOM(encoder, options);\n\n return encoder;\n}\n\niconv.getDecoder = function getDecoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n decoder = new codec.decoder(options, codec);\n\n if (codec.bomAware && !(options && options.stripBOM === false))\n decoder = new bomHandling.StripBOM(decoder, options);\n\n return decoder;\n}\n\n\n// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.\nvar nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;\nif (nodeVer) {\n\n // Load streaming support in Node v0.10+\n var nodeVerArr = nodeVer.split(\".\").map(Number);\n if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {\n require(\"./streams\")(iconv);\n }\n\n // Load Node primitive extensions.\n require(\"./extend-node\")(iconv);\n}\n\nif (\"Ā\" != \"\\u0100\") {\n console.error(\"iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.\");\n}\n","\"use strict\";\n\nvar Buffer = require(\"buffer\").Buffer,\n Transform = require(\"stream\").Transform;\n\n\n// == Exports ==================================================================\nmodule.exports = function(iconv) {\n \n // Additional Public API.\n iconv.encodeStream = function encodeStream(encoding, options) {\n return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);\n }\n\n iconv.decodeStream = function decodeStream(encoding, options) {\n return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);\n }\n\n iconv.supportsStreams = true;\n\n\n // Not published yet.\n iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;\n iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;\n iconv._collect = IconvLiteDecoderStream.prototype.collect;\n};\n\n\n// == Encoder stream =======================================================\nfunction IconvLiteEncoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.decodeStrings = false; // We accept only strings, so we don't need to decode them.\n Transform.call(this, options);\n}\n\nIconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteEncoderStream }\n});\n\nIconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {\n if (typeof chunk != 'string')\n return done(new Error(\"Iconv encoding stream needs strings as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype.collect = function(cb) {\n var chunks = [];\n this.on('error', cb);\n this.on('data', function(chunk) { chunks.push(chunk); });\n this.on('end', function() {\n cb(null, Buffer.concat(chunks));\n });\n return this;\n}\n\n\n// == Decoder stream =======================================================\nfunction IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}\n\nIconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteDecoderStream }\n});\n\nIconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {\n if (!Buffer.isBuffer(chunk))\n return done(new Error(\"Iconv decoding stream needs buffers as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res, this.encoding);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res, this.encoding); \n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype.collect = function(cb) {\n var res = '';\n this.on('error', cb);\n this.on('data', function(chunk) { res += chunk; });\n this.on('end', function() {\n cb(null, res);\n });\n return this;\n}\n\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","(function() {\n var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;\n\n ipaddr = {};\n\n root = this;\n\n if ((typeof module !== \"undefined\" && module !== null) && module.exports) {\n module.exports = ipaddr;\n } else {\n root['ipaddr'] = ipaddr;\n }\n\n matchCIDR = function(first, second, partSize, cidrBits) {\n var part, shift;\n if (first.length !== second.length) {\n throw new Error(\"ipaddr: cannot match CIDR for objects with different lengths\");\n }\n part = 0;\n while (cidrBits > 0) {\n shift = partSize - cidrBits;\n if (shift < 0) {\n shift = 0;\n }\n if (first[part] >> shift !== second[part] >> shift) {\n return false;\n }\n cidrBits -= partSize;\n part += 1;\n }\n return true;\n };\n\n ipaddr.subnetMatch = function(address, rangeList, defaultName) {\n var k, len, rangeName, rangeSubnets, subnet;\n if (defaultName == null) {\n defaultName = 'unicast';\n }\n for (rangeName in rangeList) {\n rangeSubnets = rangeList[rangeName];\n if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) {\n rangeSubnets = [rangeSubnets];\n }\n for (k = 0, len = rangeSubnets.length; k < len; k++) {\n subnet = rangeSubnets[k];\n if (address.kind() === subnet[0].kind()) {\n if (address.match.apply(address, subnet)) {\n return rangeName;\n }\n }\n }\n }\n return defaultName;\n };\n\n ipaddr.IPv4 = (function() {\n function IPv4(octets) {\n var k, len, octet;\n if (octets.length !== 4) {\n throw new Error(\"ipaddr: ipv4 octet count should be 4\");\n }\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n throw new Error(\"ipaddr: ipv4 octet should fit in 8 bits\");\n }\n }\n this.octets = octets;\n }\n\n IPv4.prototype.kind = function() {\n return 'ipv4';\n };\n\n IPv4.prototype.toString = function() {\n return this.octets.join(\".\");\n };\n\n IPv4.prototype.toNormalizedString = function() {\n return this.toString();\n };\n\n IPv4.prototype.toByteArray = function() {\n return this.octets.slice(0);\n };\n\n IPv4.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv4') {\n throw new Error(\"ipaddr: cannot match ipv4 address with non-ipv4 one\");\n }\n return matchCIDR(this.octets, other.octets, 8, cidrRange);\n };\n\n IPv4.prototype.SpecialRanges = {\n unspecified: [[new IPv4([0, 0, 0, 0]), 8]],\n broadcast: [[new IPv4([255, 255, 255, 255]), 32]],\n multicast: [[new IPv4([224, 0, 0, 0]), 4]],\n linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],\n loopback: [[new IPv4([127, 0, 0, 0]), 8]],\n carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],\n \"private\": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],\n reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]\n };\n\n IPv4.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv4.prototype.toIPv4MappedAddress = function() {\n return ipaddr.IPv6.parse(\"::ffff:\" + (this.toString()));\n };\n\n IPv4.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, octet, stop, zeros, zerotable;\n zerotable = {\n 0: 8,\n 128: 7,\n 192: 6,\n 224: 5,\n 240: 4,\n 248: 3,\n 252: 2,\n 254: 1,\n 255: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 3; k >= 0; i = k += -1) {\n octet = this.octets[i];\n if (octet in zerotable) {\n zeros = zerotable[octet];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 8) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 32 - cidr;\n };\n\n return IPv4;\n\n })();\n\n ipv4Part = \"(0?\\\\d+|0x[a-f0-9]+)\";\n\n ipv4Regexes = {\n fourOctet: new RegExp(\"^\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"$\", 'i'),\n longValue: new RegExp(\"^\" + ipv4Part + \"$\", 'i')\n };\n\n ipaddr.IPv4.parser = function(string) {\n var match, parseIntAuto, part, shift, value;\n parseIntAuto = function(string) {\n if (string[0] === \"0\" && string[1] !== \"x\") {\n return parseInt(string, 8);\n } else {\n return parseInt(string);\n }\n };\n if (match = string.match(ipv4Regexes.fourOctet)) {\n return (function() {\n var k, len, ref, results;\n ref = match.slice(1, 6);\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseIntAuto(part));\n }\n return results;\n })();\n } else if (match = string.match(ipv4Regexes.longValue)) {\n value = parseIntAuto(match[1]);\n if (value > 0xffffffff || value < 0) {\n throw new Error(\"ipaddr: address outside defined range\");\n }\n return ((function() {\n var k, results;\n results = [];\n for (shift = k = 0; k <= 24; shift = k += 8) {\n results.push((value >> shift) & 0xff);\n }\n return results;\n })()).reverse();\n } else {\n return null;\n }\n };\n\n ipaddr.IPv6 = (function() {\n function IPv6(parts, zoneId) {\n var i, k, l, len, part, ref;\n if (parts.length === 16) {\n this.parts = [];\n for (i = k = 0; k <= 14; i = k += 2) {\n this.parts.push((parts[i] << 8) | parts[i + 1]);\n }\n } else if (parts.length === 8) {\n this.parts = parts;\n } else {\n throw new Error(\"ipaddr: ipv6 part count should be 8 or 16\");\n }\n ref = this.parts;\n for (l = 0, len = ref.length; l < len; l++) {\n part = ref[l];\n if (!((0 <= part && part <= 0xffff))) {\n throw new Error(\"ipaddr: ipv6 part should fit in 16 bits\");\n }\n }\n if (zoneId) {\n this.zoneId = zoneId;\n }\n }\n\n IPv6.prototype.kind = function() {\n return 'ipv6';\n };\n\n IPv6.prototype.toString = function() {\n return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::');\n };\n\n IPv6.prototype.toRFC5952String = function() {\n var bestMatchIndex, bestMatchLength, match, regex, string;\n regex = /((^|:)(0(:|$)){2,})/g;\n string = this.toNormalizedString();\n bestMatchIndex = 0;\n bestMatchLength = -1;\n while ((match = regex.exec(string))) {\n if (match[0].length > bestMatchLength) {\n bestMatchIndex = match.index;\n bestMatchLength = match[0].length;\n }\n }\n if (bestMatchLength < 0) {\n return string;\n }\n return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength);\n };\n\n IPv6.prototype.toByteArray = function() {\n var bytes, k, len, part, ref;\n bytes = [];\n ref = this.parts;\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n bytes.push(part >> 8);\n bytes.push(part & 0xff);\n }\n return bytes;\n };\n\n IPv6.prototype.toNormalizedString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.toFixedLengthString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16).padStart(4, '0'));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv6') {\n throw new Error(\"ipaddr: cannot match ipv6 address with non-ipv6 one\");\n }\n return matchCIDR(this.parts, other.parts, 16, cidrRange);\n };\n\n IPv6.prototype.SpecialRanges = {\n unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],\n linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],\n multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],\n loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],\n uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],\n ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],\n rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],\n rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],\n '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],\n teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],\n reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]\n };\n\n IPv6.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv6.prototype.isIPv4MappedAddress = function() {\n return this.range() === 'ipv4Mapped';\n };\n\n IPv6.prototype.toIPv4Address = function() {\n var high, low, ref;\n if (!this.isIPv4MappedAddress()) {\n throw new Error(\"ipaddr: trying to convert a generic ipv6 address to ipv4\");\n }\n ref = this.parts.slice(-2), high = ref[0], low = ref[1];\n return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);\n };\n\n IPv6.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, part, stop, zeros, zerotable;\n zerotable = {\n 0: 16,\n 32768: 15,\n 49152: 14,\n 57344: 13,\n 61440: 12,\n 63488: 11,\n 64512: 10,\n 65024: 9,\n 65280: 8,\n 65408: 7,\n 65472: 6,\n 65504: 5,\n 65520: 4,\n 65528: 3,\n 65532: 2,\n 65534: 1,\n 65535: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 7; k >= 0; i = k += -1) {\n part = this.parts[i];\n if (part in zerotable) {\n zeros = zerotable[part];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 16) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 128 - cidr;\n };\n\n return IPv6;\n\n })();\n\n ipv6Part = \"(?:[0-9a-f]+::?)+\";\n\n zoneIndex = \"%[0-9a-z]{1,}\";\n\n ipv6Regexes = {\n zoneIndex: new RegExp(zoneIndex, 'i'),\n \"native\": new RegExp(\"^(::)?(\" + ipv6Part + \")?([0-9a-f]+)?(::)?(\" + zoneIndex + \")?$\", 'i'),\n transitional: new RegExp((\"^((?:\" + ipv6Part + \")|(?:::)(?:\" + ipv6Part + \")?)\") + (ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part) + (\"(\" + zoneIndex + \")?$\"), 'i')\n };\n\n expandIPv6 = function(string, parts) {\n var colonCount, lastColon, part, replacement, replacementCount, zoneId;\n if (string.indexOf('::') !== string.lastIndexOf('::')) {\n return null;\n }\n zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0];\n if (zoneId) {\n zoneId = zoneId.substring(1);\n string = string.replace(/%.+$/, '');\n }\n colonCount = 0;\n lastColon = -1;\n while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {\n colonCount++;\n }\n if (string.substr(0, 2) === '::') {\n colonCount--;\n }\n if (string.substr(-2, 2) === '::') {\n colonCount--;\n }\n if (colonCount > parts) {\n return null;\n }\n replacementCount = parts - colonCount;\n replacement = ':';\n while (replacementCount--) {\n replacement += '0:';\n }\n string = string.replace('::', replacement);\n if (string[0] === ':') {\n string = string.slice(1);\n }\n if (string[string.length - 1] === ':') {\n string = string.slice(0, -1);\n }\n parts = (function() {\n var k, len, ref, results;\n ref = string.split(\":\");\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseInt(part, 16));\n }\n return results;\n })();\n return {\n parts: parts,\n zoneId: zoneId\n };\n };\n\n ipaddr.IPv6.parser = function(string) {\n var addr, k, len, match, octet, octets, zoneId;\n if (ipv6Regexes['native'].test(string)) {\n return expandIPv6(string, 8);\n } else if (match = string.match(ipv6Regexes['transitional'])) {\n zoneId = match[6] || '';\n addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6);\n if (addr.parts) {\n octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])];\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n return null;\n }\n }\n addr.parts.push(octets[0] << 8 | octets[1]);\n addr.parts.push(octets[2] << 8 | octets[3]);\n return {\n parts: addr.parts,\n zoneId: addr.zoneId\n };\n }\n }\n return null;\n };\n\n ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {\n return this.parser(string) !== null;\n };\n\n ipaddr.IPv4.isValid = function(string) {\n var e;\n try {\n new this(this.parser(string));\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.isValidFourPartDecimal = function(string) {\n if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){3}$/)) {\n return true;\n } else {\n return false;\n }\n };\n\n ipaddr.IPv6.isValid = function(string) {\n var addr, e;\n if (typeof string === \"string\" && string.indexOf(\":\") === -1) {\n return false;\n }\n try {\n addr = this.parser(string);\n new this(addr.parts, addr.zoneId);\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.parse = function(string) {\n var parts;\n parts = this.parser(string);\n if (parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(parts);\n };\n\n ipaddr.IPv6.parse = function(string) {\n var addr;\n addr = this.parser(string);\n if (addr.parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(addr.parts, addr.zoneId);\n };\n\n ipaddr.IPv4.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 32) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv4 CIDR range\");\n };\n\n ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {\n var filledOctetCount, j, octets;\n prefix = parseInt(prefix);\n if (prefix < 0 || prefix > 32) {\n throw new Error('ipaddr: invalid IPv4 prefix length');\n }\n octets = [0, 0, 0, 0];\n j = 0;\n filledOctetCount = Math.floor(prefix / 8);\n while (j < filledOctetCount) {\n octets[j] = 255;\n j++;\n }\n if (filledOctetCount < 4) {\n octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);\n }\n return new this(octets);\n };\n\n ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv4.networkAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv6.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 128) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv6 CIDR range\");\n };\n\n ipaddr.isValid = function(string) {\n return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);\n };\n\n ipaddr.parse = function(string) {\n if (ipaddr.IPv6.isValid(string)) {\n return ipaddr.IPv6.parse(string);\n } else if (ipaddr.IPv4.isValid(string)) {\n return ipaddr.IPv4.parse(string);\n } else {\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 format\");\n }\n };\n\n ipaddr.parseCIDR = function(string) {\n var e;\n try {\n return ipaddr.IPv6.parseCIDR(string);\n } catch (error1) {\n e = error1;\n try {\n return ipaddr.IPv4.parseCIDR(string);\n } catch (error1) {\n e = error1;\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 CIDR format\");\n }\n }\n };\n\n ipaddr.fromByteArray = function(bytes) {\n var length;\n length = bytes.length;\n if (length === 4) {\n return new ipaddr.IPv4(bytes);\n } else if (length === 16) {\n return new ipaddr.IPv6(bytes);\n } else {\n throw new Error(\"ipaddr: the binary input is neither an IPv6 nor IPv4 address\");\n }\n };\n\n ipaddr.process = function(string) {\n var addr;\n addr = this.parse(string);\n if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {\n return addr.toIPv4Address();\n } else {\n return addr;\n }\n };\n\n}).call(this);\n","'use strict';\n\nvar WHITELIST = [\n\t'ETIMEDOUT',\n\t'ECONNRESET',\n\t'EADDRINUSE',\n\t'ESOCKETTIMEDOUT',\n\t'ECONNREFUSED',\n\t'EPIPE',\n\t'EHOSTUNREACH',\n\t'EAI_AGAIN'\n];\n\nvar BLACKLIST = [\n\t'ENOTFOUND',\n\t'ENETUNREACH',\n\n\t// SSL errors from https://github.com/nodejs/node/blob/ed3d8b13ee9a705d89f9e0397d9e96519e7e47ac/src/node_crypto.cc#L1950\n\t'UNABLE_TO_GET_ISSUER_CERT',\n\t'UNABLE_TO_GET_CRL',\n\t'UNABLE_TO_DECRYPT_CERT_SIGNATURE',\n\t'UNABLE_TO_DECRYPT_CRL_SIGNATURE',\n\t'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',\n\t'CERT_SIGNATURE_FAILURE',\n\t'CRL_SIGNATURE_FAILURE',\n\t'CERT_NOT_YET_VALID',\n\t'CERT_HAS_EXPIRED',\n\t'CRL_NOT_YET_VALID',\n\t'CRL_HAS_EXPIRED',\n\t'ERROR_IN_CERT_NOT_BEFORE_FIELD',\n\t'ERROR_IN_CERT_NOT_AFTER_FIELD',\n\t'ERROR_IN_CRL_LAST_UPDATE_FIELD',\n\t'ERROR_IN_CRL_NEXT_UPDATE_FIELD',\n\t'OUT_OF_MEM',\n\t'DEPTH_ZERO_SELF_SIGNED_CERT',\n\t'SELF_SIGNED_CERT_IN_CHAIN',\n\t'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',\n\t'UNABLE_TO_VERIFY_LEAF_SIGNATURE',\n\t'CERT_CHAIN_TOO_LONG',\n\t'CERT_REVOKED',\n\t'INVALID_CA',\n\t'PATH_LENGTH_EXCEEDED',\n\t'INVALID_PURPOSE',\n\t'CERT_UNTRUSTED',\n\t'CERT_REJECTED'\n];\n\nmodule.exports = function (err) {\n\tif (!err || !err.code) {\n\t\treturn true;\n\t}\n\n\tif (WHITELIST.indexOf(err.code) !== -1) {\n\t\treturn true;\n\t}\n\n\tif (BLACKLIST.indexOf(err.code) !== -1) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","const Kafka = require('./src')\nconst PartitionAssigners = require('./src/consumer/assigners')\nconst AssignerProtocol = require('./src/consumer/assignerProtocol')\nconst Partitioners = require('./src/producer/partitioners')\nconst Compression = require('./src/protocol/message/compression')\nconst ResourceTypes = require('./src/protocol/resourceTypes')\nconst ConfigResourceTypes = require('./src/protocol/configResourceTypes')\nconst ConfigSource = require('./src/protocol/configSource')\nconst AclResourceTypes = require('./src/protocol/aclResourceTypes')\nconst AclOperationTypes = require('./src/protocol/aclOperationTypes')\nconst AclPermissionTypes = require('./src/protocol/aclPermissionTypes')\nconst ResourcePatternTypes = require('./src/protocol/resourcePatternTypes')\nconst Errors = require('./src/errors')\nconst { LEVELS } = require('./src/loggers')\n\nmodule.exports = {\n Kafka,\n PartitionAssigners,\n AssignerProtocol,\n Partitioners,\n logLevel: LEVELS,\n CompressionTypes: Compression.Types,\n CompressionCodecs: Compression.Codecs,\n /**\n * @deprecated\n * @see https://github.com/tulios/kafkajs/issues/649\n *\n * Use ConfigResourceTypes or AclResourceTypes instead.\n */\n ResourceTypes,\n ConfigResourceTypes,\n AclResourceTypes,\n AclOperationTypes,\n AclPermissionTypes,\n ResourcePatternTypes,\n ConfigSource,\n ...Errors,\n}\n","const createRetry = require('../retry')\nconst flatten = require('../utils/flatten')\nconst waitFor = require('../utils/waitFor')\nconst groupBy = require('../utils/groupBy')\nconst createConsumer = require('../consumer')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst { LEVELS } = require('../loggers')\nconst {\n KafkaJSNonRetriableError,\n KafkaJSDeleteGroupsError,\n KafkaJSBrokerNotFound,\n KafkaJSDeleteTopicRecordsError,\n KafkaJSAggregateError,\n} = require('../errors')\nconst { staleMetadata } = require('../protocol/error')\nconst CONFIG_RESOURCE_TYPES = require('../protocol/configResourceTypes')\nconst ACL_RESOURCE_TYPES = require('../protocol/aclResourceTypes')\nconst ACL_OPERATION_TYPES = require('../protocol/aclOperationTypes')\nconst ACL_PERMISSION_TYPES = require('../protocol/aclPermissionTypes')\nconst RESOURCE_PATTERN_TYPES = require('../protocol/resourcePatternTypes')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\n\nconst { CONNECT, DISCONNECT } = events\n\nconst NO_CONTROLLER_ID = -1\n\nconst { values, keys, entries } = Object\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `admin.events.${key}`)\n .join(', ')\n\nconst retryOnLeaderNotAvailable = (fn, opts = {}) => {\n const callback = async () => {\n try {\n return await fn()\n } catch (e) {\n if (e.type !== 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n return false\n }\n }\n\n return waitFor(callback, opts)\n}\n\nconst isConsumerGroupRunning = description => ['Empty', 'Dead'].includes(description.state)\nconst findTopicPartitions = async (cluster, topic) => {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n return cluster\n .findTopicPartitionMetadata(topic)\n .map(({ partitionId }) => partitionId)\n .sort()\n}\nconst indexByPartition = array =>\n array.reduce(\n (obj, { partition, ...props }) => Object.assign(obj, { [partition]: { ...props } }),\n {}\n )\n\n/**\n *\n * @param {Object} params\n * @param {import(\"../../types\").Logger} params.logger\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n * @param {import('../../types').RetryOptions} params.retry\n * @param {import(\"../../types\").Cluster} params.cluster\n *\n * @returns {import(\"../../types\").Admin}\n */\nmodule.exports = ({\n logger: rootLogger,\n instrumentationEmitter: rootInstrumentationEmitter,\n retry,\n cluster,\n}) => {\n const logger = rootLogger.namespace('Admin')\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n\n /**\n * @returns {Promise}\n */\n const connect = async () => {\n await cluster.connect()\n instrumentationEmitter.emit(CONNECT)\n }\n\n /**\n * @return {Promise}\n */\n const disconnect = async () => {\n await cluster.disconnect()\n instrumentationEmitter.emit(DISCONNECT)\n }\n\n /**\n * @return {Promise}\n */\n const listTopics = async () => {\n const { topicMetadata } = await cluster.metadata()\n const topics = topicMetadata.map(t => t.topic)\n return topics\n }\n\n /**\n * @param {Object} request\n * @param {array} request.topics\n * @param {boolean} [request.validateOnly=false]\n * @param {number} [request.timeout=5000]\n * @param {boolean} [request.waitForLeaders=true]\n * @return {Promise}\n */\n const createTopics = async ({ topics, validateOnly, timeout, waitForLeaders = true }) => {\n if (!topics || !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Invalid topics array ${topics}`)\n }\n\n if (topics.filter(({ topic }) => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topics array, the topic names have to be a valid string'\n )\n }\n\n const topicNames = new Set(topics.map(({ topic }) => topic))\n if (topicNames.size < topics.length) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topics array, it cannot have multiple entries for the same topic'\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createTopics({ topics, validateOnly, timeout })\n\n if (waitForLeaders) {\n const topicNamesArray = Array.from(topicNames.values())\n await retryOnLeaderNotAvailable(async () => await broker.metadata(topicNamesArray), {\n delay: 100,\n maxWait: timeout,\n timeoutMessage: 'Timed out while waiting for topic leaders',\n })\n }\n\n return true\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n if (e instanceof KafkaJSAggregateError) {\n if (e.errors.every(error => error.type === 'TOPIC_ALREADY_EXISTS')) {\n return false\n }\n }\n\n bail(e)\n }\n })\n }\n /**\n * @param {array} topicPartitions\n * @param {boolean} [validateOnly=false]\n * @param {number} [timeout=5000]\n * @return {Promise}\n */\n const createPartitions = async ({ topicPartitions, validateOnly, timeout }) => {\n if (!topicPartitions || !Array.isArray(topicPartitions)) {\n throw new KafkaJSNonRetriableError(`Invalid topic partitions array ${topicPartitions}`)\n }\n if (topicPartitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Empty topic partitions array`)\n }\n\n if (topicPartitions.filter(({ topic }) => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topic partitions array, the topic names have to be a valid string'\n )\n }\n\n const topicNames = new Set(topicPartitions.map(({ topic }) => topic))\n if (topicNames.size < topicPartitions.length) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topic partitions array, it cannot have multiple entries for the same topic'\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createPartitions({ topicPartitions, validateOnly, timeout })\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string[]} topics\n * @param {number} [timeout=5000]\n * @return {Promise}\n */\n const deleteTopics = async ({ topics, timeout }) => {\n if (!topics || !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Invalid topics array ${topics}`)\n }\n\n if (topics.filter(topic => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError('Invalid topics array, the names must be a valid string')\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.deleteTopics({ topics, timeout })\n\n // Remove deleted topics\n for (const topic of topics) {\n cluster.targetTopics.delete(topic)\n }\n\n await cluster.refreshMetadata()\n } catch (e) {\n if (['NOT_CONTROLLER', 'UNKNOWN_TOPIC_OR_PARTITION'].includes(e.type)) {\n logger.warn('Could not delete topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n if (e.type === 'REQUEST_TIMED_OUT') {\n logger.error(\n 'Could not delete topics, check if \"delete.topic.enable\" is set to \"true\" (the default value is \"false\") or increase the timeout',\n {\n error: e.message,\n retryCount,\n retryTime,\n }\n )\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string} topic\n */\n\n const fetchTopicOffsets = async topic => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n const metadata = cluster.findTopicPartitionMetadata(topic)\n const high = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: false,\n partitions: metadata.map(p => ({ partition: p.partitionId })),\n },\n ])\n\n const low = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: true,\n partitions: metadata.map(p => ({ partition: p.partitionId })),\n },\n ])\n\n const { partitions: highPartitions } = high.pop()\n const { partitions: lowPartitions } = low.pop()\n return highPartitions.map(({ partition, offset }) => ({\n partition,\n offset,\n high: offset,\n low: lowPartitions.find(({ partition: lowPartition }) => lowPartition === partition)\n .offset,\n }))\n } catch (e) {\n if (e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n await cluster.refreshMetadata()\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string} topic\n * @param {number} [timestamp]\n */\n\n const fetchTopicOffsetsByTimestamp = async (topic, timestamp) => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n const metadata = cluster.findTopicPartitionMetadata(topic)\n const partitions = metadata.map(p => ({ partition: p.partitionId }))\n\n const high = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: false,\n partitions,\n },\n ])\n const { partitions: highPartitions } = high.pop()\n\n const offsets = await cluster.fetchTopicsOffset([\n {\n topic,\n fromTimestamp: timestamp,\n partitions,\n },\n ])\n const { partitions: lowPartitions } = offsets.pop()\n\n return lowPartitions.map(({ partition, offset }) => ({\n partition,\n offset:\n parseInt(offset, 10) >= 0\n ? offset\n : highPartitions.find(({ partition: highPartition }) => highPartition === partition)\n .offset,\n }))\n } catch (e) {\n if (e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n await cluster.refreshMetadata()\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Fetch offsets for a topic or multiple topics\n *\n * Note: set either topic or topics but not both.\n *\n * @param {string} groupId\n * @param {string} topic - deprecated, use the `topics` parameter. Topic to fetch offsets for.\n * @param {string[]} topics - list of topics to fetch offsets for, defaults to `[]` which fetches all topics for `groupId`.\n * @param {boolean} [resolveOffsets=false]\n * @return {Promise}\n */\n const fetchOffsets = async ({ groupId, topic, topics, resolveOffsets = false }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic && !topics) {\n topics = []\n }\n\n if (!topic && !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Expected topic or topics array to be set`)\n }\n\n if (topic && topics) {\n throw new KafkaJSNonRetriableError(`Either topic or topics must be set, not both`)\n }\n\n if (topic) {\n topics = [topic]\n }\n\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n const topicsToFetch = await Promise.all(\n topics.map(async topic => {\n const partitions = await findTopicPartitions(cluster, topic)\n const partitionsToFetch = partitions.map(partition => ({ partition }))\n return { topic, partitions: partitionsToFetch }\n })\n )\n let { responses: consumerOffsets } = await coordinator.offsetFetch({\n groupId,\n topics: topicsToFetch,\n })\n\n if (resolveOffsets) {\n consumerOffsets = await Promise.all(\n consumerOffsets.map(async ({ topic, partitions }) => {\n const indexedOffsets = indexByPartition(await fetchTopicOffsets(topic))\n const recalculatedPartitions = partitions.map(({ offset, partition, ...props }) => {\n let resolvedOffset = offset\n if (Number(offset) === EARLIEST_OFFSET) {\n resolvedOffset = indexedOffsets[partition].low\n }\n if (Number(offset) === LATEST_OFFSET) {\n resolvedOffset = indexedOffsets[partition].high\n }\n return {\n partition,\n offset: resolvedOffset,\n ...props,\n }\n })\n\n await setOffsets({ groupId, topic, partitions: recalculatedPartitions })\n\n return {\n topic,\n partitions: recalculatedPartitions,\n }\n })\n )\n }\n\n const result = consumerOffsets.map(({ topic, partitions }) => {\n const completePartitions = partitions.map(({ partition, offset, metadata }) => ({\n partition,\n offset,\n metadata: metadata || null,\n }))\n\n return { topic, partitions: completePartitions }\n })\n\n if (topic) {\n return result.pop().partitions\n } else {\n return result\n }\n }\n\n /**\n * @param {string} groupId\n * @param {string} topic\n * @param {boolean} [earliest=false]\n * @return {Promise}\n */\n const resetOffsets = async ({ groupId, topic, earliest = false }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const partitions = await findTopicPartitions(cluster, topic)\n const partitionsToSeek = partitions.map(partition => ({\n partition,\n offset: cluster.defaultOffset({ fromBeginning: earliest }),\n }))\n\n return setOffsets({ groupId, topic, partitions: partitionsToSeek })\n }\n\n /**\n * @param {string} groupId\n * @param {string} topic\n * @param {Array} partitions\n * @return {Promise}\n *\n * @typedef {Object} SeekEntry\n * @property {number} partition\n * @property {string} offset\n */\n const setOffsets = async ({ groupId, topic, partitions }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (!partitions || partitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Invalid partitions`)\n }\n\n const consumer = createConsumer({\n logger: rootLogger.namespace('Admin', LEVELS.NOTHING),\n cluster,\n groupId,\n })\n\n await consumer.subscribe({ topic, fromBeginning: true })\n const description = await consumer.describeGroup()\n\n if (!isConsumerGroupRunning(description)) {\n throw new KafkaJSNonRetriableError(\n `The consumer group must have no running instances, current state: ${description.state}`\n )\n }\n\n return new Promise((resolve, reject) => {\n consumer.on(consumer.events.FETCH, async () =>\n consumer\n .stop()\n .then(resolve)\n .catch(reject)\n )\n\n consumer\n .run({\n eachBatchAutoResolve: false,\n eachBatch: async () => true,\n })\n .catch(reject)\n\n // This consumer doesn't need to consume any data\n consumer.pause([{ topic }])\n\n for (const seekData of partitions) {\n consumer.seek({ topic, ...seekData })\n }\n })\n }\n\n const isBrokerConfig = type =>\n [CONFIG_RESOURCE_TYPES.BROKER, CONFIG_RESOURCE_TYPES.BROKER_LOGGER].includes(type)\n\n /**\n * Broker configs can only be returned by the target broker\n *\n * @see\n * https://github.com/apache/kafka/blob/821c1ac6641845aeca96a43bc2b946ecec5cba4f/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L3783\n * https://github.com/apache/kafka/blob/821c1ac6641845aeca96a43bc2b946ecec5cba4f/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L2027\n *\n * @param {Broker} defaultBroker. Broker used in case the configuration is not a broker config\n */\n const groupResourcesByBroker = ({ resources, defaultBroker }) =>\n groupBy(resources, async ({ type, name: nodeId }) => {\n return isBrokerConfig(type)\n ? await cluster.findBroker({ nodeId: String(nodeId) })\n : defaultBroker\n })\n\n /**\n * @param {Array} resources\n * @param {boolean} [includeSynonyms=false]\n * @return {Promise}\n *\n * @typedef {Object} ResourceConfigQuery\n * @property {ConfigResourceType} type\n * @property {string} name\n * @property {Array} [configNames=[]]\n */\n const describeConfigs = async ({ resources, includeSynonyms }) => {\n if (!resources || !Array.isArray(resources)) {\n throw new KafkaJSNonRetriableError(`Invalid resources array ${resources}`)\n }\n\n if (resources.length === 0) {\n throw new KafkaJSNonRetriableError('Resources array cannot be empty')\n }\n\n const validResourceTypes = Object.values(CONFIG_RESOURCE_TYPES)\n const invalidType = resources.find(r => !validResourceTypes.includes(r.type))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.type}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const invalidName = resources.find(r => !r.name || typeof r.name !== 'string')\n\n if (invalidName) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource name ${invalidName.name}: ${JSON.stringify(invalidName)}`\n )\n }\n\n const invalidConfigs = resources.find(\n r => !Array.isArray(r.configNames) && r.configNames != null\n )\n\n if (invalidConfigs) {\n const { configNames } = invalidConfigs\n throw new KafkaJSNonRetriableError(\n `Invalid resource configNames ${configNames}: ${JSON.stringify(invalidConfigs)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const controller = await cluster.findControllerBroker()\n const resourcerByBroker = await groupResourcesByBroker({\n resources,\n defaultBroker: controller,\n })\n\n const describeConfigsAction = async broker => {\n const targetBroker = broker || controller\n return targetBroker.describeConfigs({\n resources: resourcerByBroker.get(targetBroker),\n includeSynonyms,\n })\n }\n\n const brokers = Array.from(resourcerByBroker.keys())\n const responses = await Promise.all(brokers.map(describeConfigsAction))\n const responseResources = responses.reduce(\n (result, { resources }) => [...result, ...resources],\n []\n )\n\n return { resources: responseResources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not describe configs', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {Array} resources\n * @param {boolean} [validateOnly=false]\n * @return {Promise}\n *\n * @typedef {Object} ResourceConfig\n * @property {ConfigResourceType} type\n * @property {string} name\n * @property {Array} configEntries\n *\n * @typedef {Object} ResourceConfigEntry\n * @property {string} name\n * @property {string} value\n */\n const alterConfigs = async ({ resources, validateOnly }) => {\n if (!resources || !Array.isArray(resources)) {\n throw new KafkaJSNonRetriableError(`Invalid resources array ${resources}`)\n }\n\n if (resources.length === 0) {\n throw new KafkaJSNonRetriableError('Resources array cannot be empty')\n }\n\n const validResourceTypes = Object.values(CONFIG_RESOURCE_TYPES)\n const invalidType = resources.find(r => !validResourceTypes.includes(r.type))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.type}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const invalidName = resources.find(r => !r.name || typeof r.name !== 'string')\n\n if (invalidName) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource name ${invalidName.name}: ${JSON.stringify(invalidName)}`\n )\n }\n\n const invalidConfigs = resources.find(r => !Array.isArray(r.configEntries))\n\n if (invalidConfigs) {\n const { configEntries } = invalidConfigs\n throw new KafkaJSNonRetriableError(\n `Invalid resource configEntries ${configEntries}: ${JSON.stringify(invalidConfigs)}`\n )\n }\n\n const invalidConfigValue = resources.find(r =>\n r.configEntries.some(e => typeof e.name !== 'string' || typeof e.value !== 'string')\n )\n\n if (invalidConfigValue) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource config value: ${JSON.stringify(invalidConfigValue)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const controller = await cluster.findControllerBroker()\n const resourcerByBroker = await groupResourcesByBroker({\n resources,\n defaultBroker: controller,\n })\n\n const alterConfigsAction = async broker => {\n const targetBroker = broker || controller\n return targetBroker.alterConfigs({\n resources: resourcerByBroker.get(targetBroker),\n validateOnly: !!validateOnly,\n })\n }\n\n const brokers = Array.from(resourcerByBroker.keys())\n const responses = await Promise.all(brokers.map(alterConfigsAction))\n const responseResources = responses.reduce(\n (result, { resources }) => [...result, ...resources],\n []\n )\n\n return { resources: responseResources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not alter configs', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @deprecated - This method was replaced by `fetchTopicMetadata`. This implementation\n * is limited by the topics in the target group, so it can't fetch all topics when\n * necessary.\n *\n * Fetch metadata for provided topics.\n *\n * If no topics are provided fetch metadata for all topics of which we are aware.\n * @see https://kafka.apache.org/protocol#The_Messages_Metadata\n *\n * @param {Object} [options]\n * @param {string[]} [options.topics]\n * @return {Promise}\n *\n * @typedef {Object} TopicsMetadata\n * @property {Array} topics\n *\n * @typedef {Object} TopicMetadata\n * @property {String} name\n * @property {Array} partitions\n *\n * @typedef {Object} PartitionMetadata\n * @property {number} partitionErrorCode Response error code\n * @property {number} partitionId Topic partition id\n * @property {number} leader The id of the broker acting as leader for this partition.\n * @property {Array} replicas The set of all nodes that host this partition.\n * @property {Array} isr The set of nodes that are in sync with the leader for this partition.\n */\n const getTopicMetadata = async options => {\n const { topics } = options || {}\n\n if (topics) {\n await Promise.all(\n topics.map(async topic => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n try {\n await cluster.addTargetTopic(topic)\n } catch (e) {\n e.message = `Failed to add target topic ${topic}: ${e.message}`\n throw e\n }\n })\n )\n }\n\n await cluster.refreshMetadataIfNecessary()\n const targetTopics = topics || [...cluster.targetTopics]\n\n return {\n topics: await Promise.all(\n targetTopics.map(async topic => ({\n name: topic,\n partitions: cluster.findTopicPartitionMetadata(topic),\n }))\n ),\n }\n }\n\n /**\n * Fetch metadata for provided topics.\n *\n * If no topics are provided fetch metadata for all topics.\n * @see https://kafka.apache.org/protocol#The_Messages_Metadata\n *\n * @param {Object} [options]\n * @param {string[]} [options.topics]\n * @return {Promise}\n *\n * @typedef {Object} TopicsMetadata\n * @property {Array} topics\n *\n * @typedef {Object} TopicMetadata\n * @property {String} name\n * @property {Array} partitions\n *\n * @typedef {Object} PartitionMetadata\n * @property {number} partitionErrorCode Response error code\n * @property {number} partitionId Topic partition id\n * @property {number} leader The id of the broker acting as leader for this partition.\n * @property {Array} replicas The set of all nodes that host this partition.\n * @property {Array} isr The set of nodes that are in sync with the leader for this partition.\n */\n const fetchTopicMetadata = async ({ topics = [] } = {}) => {\n if (topics) {\n topics.forEach(topic => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n })\n }\n\n const metadata = await cluster.metadata({ topics })\n\n return {\n topics: metadata.topicMetadata.map(topicMetadata => ({\n name: topicMetadata.topic,\n partitions: topicMetadata.partitionMetadata,\n })),\n }\n }\n\n /**\n * Describe cluster\n *\n * @return {Promise}\n *\n * @typedef {Object} ClusterMetadata\n * @property {Array} brokers\n * @property {Number} controller Current controller id. Returns null if unknown.\n * @property {String} clusterId\n *\n * @typedef {Object} Broker\n * @property {Number} nodeId\n * @property {String} host\n * @property {Number} port\n */\n const describeCluster = async () => {\n const { brokers: nodes, clusterId, controllerId } = await cluster.metadata({ topics: [] })\n const brokers = nodes.map(({ nodeId, host, port }) => ({\n nodeId,\n host,\n port,\n }))\n const controller =\n controllerId == null || controllerId === NO_CONTROLLER_ID ? null : controllerId\n\n return {\n brokers,\n controller,\n clusterId,\n }\n }\n\n /**\n * List groups in a broker\n *\n * @return {Promise}\n *\n * @typedef {Object} ListGroups\n * @property {Array} groups\n *\n * @typedef {Object} ListGroup\n * @property {string} groupId\n * @property {string} protocolType\n */\n const listGroups = async () => {\n await cluster.refreshMetadata()\n let groups = []\n for (var nodeId in cluster.brokerPool.brokers) {\n const broker = await cluster.findBroker({ nodeId })\n const response = await broker.listGroups()\n groups = groups.concat(response.groups)\n }\n\n return { groups }\n }\n\n /**\n * Describe groups by group ids\n * @param {Array} groupIds\n *\n * @typedef {Object} GroupDescriptions\n * @property {Array} groups\n *\n * @return {Promise}\n */\n const describeGroups = async groupIds => {\n const coordinatorsForGroup = await Promise.all(\n groupIds.map(async groupId => {\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n return {\n coordinator,\n groupId,\n }\n })\n )\n\n const groupsByCoordinator = Object.values(\n coordinatorsForGroup.reduce((coordinators, { coordinator, groupId }) => {\n const group = coordinators[coordinator.nodeId]\n\n if (group) {\n coordinators[coordinator.nodeId] = {\n ...group,\n groupIds: [...group.groupIds, groupId],\n }\n } else {\n coordinators[coordinator.nodeId] = { coordinator, groupIds: [groupId] }\n }\n return coordinators\n }, {})\n )\n\n const responses = await Promise.all(\n groupsByCoordinator.map(async ({ coordinator, groupIds }) => {\n const retrier = createRetry(retry)\n const { groups } = await retrier(() => coordinator.describeGroups({ groupIds }))\n return groups\n })\n )\n\n const groups = [].concat.apply([], responses)\n\n return { groups }\n }\n\n /**\n * Delete groups in a broker\n *\n * @param {string[]} [groupIds]\n * @return {Promise}\n *\n * @typedef {Array} DeleteGroups\n * @property {string} groupId\n * @property {number} errorCode\n */\n const deleteGroups = async groupIds => {\n if (!groupIds || !Array.isArray(groupIds)) {\n throw new KafkaJSNonRetriableError(`Invalid groupIds array ${groupIds}`)\n }\n\n const invalidGroupId = groupIds.some(g => typeof g !== 'string')\n\n if (invalidGroupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId name: ${JSON.stringify(invalidGroupId)}`)\n }\n\n const retrier = createRetry(retry)\n\n let results = []\n\n let clonedGroupIds = groupIds.slice()\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n if (clonedGroupIds.length === 0) return []\n\n await cluster.refreshMetadata()\n\n const brokersPerGroups = {}\n const brokersPerNode = {}\n for (const groupId of clonedGroupIds) {\n const broker = await cluster.findGroupCoordinator({ groupId })\n if (brokersPerGroups[broker.nodeId] === undefined) brokersPerGroups[broker.nodeId] = []\n brokersPerGroups[broker.nodeId].push(groupId)\n brokersPerNode[broker.nodeId] = broker\n }\n\n const res = await Promise.all(\n Object.keys(brokersPerNode).map(\n async nodeId => await brokersPerNode[nodeId].deleteGroups(brokersPerGroups[nodeId])\n )\n )\n\n const errors = flatten(\n res.map(({ results }) =>\n results.map(({ groupId, errorCode, error }) => {\n return { groupId, errorCode, error }\n })\n )\n ).filter(({ errorCode }) => errorCode !== 0)\n\n clonedGroupIds = errors.map(({ groupId }) => groupId)\n\n if (errors.length > 0) throw new KafkaJSDeleteGroupsError('Error in DeleteGroups', errors)\n\n results = flatten(res.map(({ results }) => results))\n\n return results\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER' || e.type === 'COORDINATOR_NOT_AVAILABLE') {\n logger.warn('Could not delete groups', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Delete topic records up to the selected partition offsets\n *\n * @param {string} topic\n * @param {Array} partitions\n * @return {Promise}\n *\n * @typedef {Object} SeekEntry\n * @property {number} partition\n * @property {string} offset\n */\n const deleteTopicRecords = async ({ topic, partitions }) => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic \"${topic}\"`)\n }\n\n if (!partitions || partitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Invalid partitions`)\n }\n\n const partitionsByBroker = cluster.findLeaderForPartitions(\n topic,\n partitions.map(p => p.partition)\n )\n\n const partitionsFound = flatten(values(partitionsByBroker))\n const topicOffsets = await fetchTopicOffsets(topic)\n\n const leaderNotFoundErrors = []\n partitions.forEach(({ partition, offset }) => {\n // throw if no leader found for partition\n if (!partitionsFound.includes(partition)) {\n leaderNotFoundErrors.push({\n partition,\n offset,\n error: new KafkaJSBrokerNotFound('Could not find the leader for the partition', {\n retriable: false,\n }),\n })\n return\n }\n const { low } = topicOffsets.find(p => p.partition === partition) || {\n high: undefined,\n low: undefined,\n }\n // warn in case of offset below low watermark\n if (parseInt(offset) < parseInt(low) && parseInt(offset) !== -1) {\n logger.warn(\n 'The requested offset is before the earliest offset maintained on the partition - no records will be deleted from this partition',\n {\n topic,\n partition,\n offset,\n }\n )\n }\n })\n\n if (leaderNotFoundErrors.length > 0) {\n throw new KafkaJSDeleteTopicRecordsError({ topic, partitions: leaderNotFoundErrors })\n }\n\n const seekEntriesByBroker = entries(partitionsByBroker).reduce(\n (obj, [nodeId, nodePartitions]) => {\n obj[nodeId] = {\n topic,\n partitions: partitions.filter(p => nodePartitions.includes(p.partition)),\n }\n return obj\n },\n {}\n )\n\n const retrier = createRetry(retry)\n return retrier(async bail => {\n try {\n const partitionErrors = []\n\n const brokerRequests = entries(seekEntriesByBroker).map(\n ([nodeId, { topic, partitions }]) => async () => {\n const broker = await cluster.findBroker({ nodeId })\n await broker.deleteRecords({ topics: [{ topic, partitions }] })\n // remove successful entry so it's ignored on retry\n delete seekEntriesByBroker[nodeId]\n }\n )\n\n await Promise.all(\n brokerRequests.map(request =>\n request().catch(e => {\n if (e.name === 'KafkaJSDeleteTopicRecordsError') {\n e.partitions.forEach(({ partition, offset, error }) => {\n partitionErrors.push({\n partition,\n offset,\n error,\n })\n })\n } else {\n // then it's an unknown error, not from the broker response\n throw e\n }\n })\n )\n )\n\n if (partitionErrors.length > 0) {\n throw new KafkaJSDeleteTopicRecordsError({\n topic,\n partitions: partitionErrors,\n })\n }\n } catch (e) {\n if (\n e.retriable &&\n e.partitions.some(\n ({ error }) => staleMetadata(error) || error.name === 'KafkaJSMetadataNotLoaded'\n )\n ) {\n await cluster.refreshMetadata()\n }\n throw e\n }\n })\n }\n\n /**\n * @param {Array} acl\n * @return {Promise}\n *\n * @typedef {Object} ACLEntry\n */\n const createAcls = async ({ acl }) => {\n if (!acl || !Array.isArray(acl)) {\n throw new KafkaJSNonRetriableError(`Invalid ACL array ${acl}`)\n }\n if (acl.length === 0) {\n throw new KafkaJSNonRetriableError('Empty ACL array')\n }\n\n // Validate principal\n if (acl.some(({ principal }) => typeof principal !== 'string')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL array, the principals have to be a valid string'\n )\n }\n\n // Validate host\n if (acl.some(({ host }) => typeof host !== 'string')) {\n throw new KafkaJSNonRetriableError('Invalid ACL array, the hosts have to be a valid string')\n }\n\n // Validate resourceName\n if (acl.some(({ resourceName }) => typeof resourceName !== 'string')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL array, the resourceNames have to be a valid string'\n )\n }\n\n let invalidType\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n invalidType = acl.find(i => !validOperationTypes.includes(i.operation))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid operation type ${invalidType.operation}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourcePatternTypes\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n invalidType = acl.find(i => !validResourcePatternTypes.includes(i.resourcePatternType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern type ${invalidType.resourcePatternType}: ${JSON.stringify(\n invalidType\n )}`\n )\n }\n\n // Validate permissionTypes\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n invalidType = acl.find(i => !validPermissionTypes.includes(i.permissionType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid permission type ${invalidType.permissionType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourceTypes\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n invalidType = acl.find(i => !validResourceTypes.includes(i.resourceType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.resourceType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createAcls({ acl })\n\n return true\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {ACLResourceTypes} resourceType The type of resource\n * @param {string} resourceName The name of the resource\n * @param {ACLResourcePatternTypes} resourcePatternType The resource pattern type filter\n * @param {string} principal The principal name\n * @param {string} host The hostname\n * @param {ACLOperationTypes} operation The type of operation\n * @param {ACLPermissionTypes} permissionType The type of permission\n * @return {Promise}\n *\n * @typedef {number} ACLResourceTypes\n * @typedef {number} ACLResourcePatternTypes\n * @typedef {number} ACLOperationTypes\n * @typedef {number} ACLPermissionTypes\n */\n const describeAcls = async ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) => {\n // Validate principal\n if (typeof principal !== 'string' && typeof principal !== 'undefined') {\n throw new KafkaJSNonRetriableError(\n 'Invalid principal, the principal have to be a valid string'\n )\n }\n\n // Validate host\n if (typeof host !== 'string' && typeof host !== 'undefined') {\n throw new KafkaJSNonRetriableError('Invalid host, the host have to be a valid string')\n }\n\n // Validate resourceName\n if (typeof resourceName !== 'string' && typeof resourceName !== 'undefined') {\n throw new KafkaJSNonRetriableError(\n 'Invalid resourceName, the resourceName have to be a valid string'\n )\n }\n\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n if (!validOperationTypes.includes(operation)) {\n throw new KafkaJSNonRetriableError(`Invalid operation type ${operation}`)\n }\n\n // Validate resourcePatternType\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n if (!validResourcePatternTypes.includes(resourcePatternType)) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern filter type ${resourcePatternType}`\n )\n }\n\n // Validate permissionType\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n if (!validPermissionTypes.includes(permissionType)) {\n throw new KafkaJSNonRetriableError(`Invalid permission type ${permissionType}`)\n }\n\n // Validate resourceType\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n if (!validResourceTypes.includes(resourceType)) {\n throw new KafkaJSNonRetriableError(`Invalid resource type ${resourceType}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n const { resources } = await broker.describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n })\n return { resources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not describe ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {Array} filters\n * @return {Promise}\n *\n * @typedef {Object} ACLFilter\n */\n const deleteAcls = async ({ filters }) => {\n if (!filters || !Array.isArray(filters)) {\n throw new KafkaJSNonRetriableError(`Invalid ACL Filter array ${filters}`)\n }\n\n if (filters.length === 0) {\n throw new KafkaJSNonRetriableError('Empty ACL Filter array')\n }\n\n // Validate principal\n if (\n filters.some(\n ({ principal }) => typeof principal !== 'string' && typeof principal !== 'undefined'\n )\n ) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the principals have to be a valid string'\n )\n }\n\n // Validate host\n if (filters.some(({ host }) => typeof host !== 'string' && typeof host !== 'undefined')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the hosts have to be a valid string'\n )\n }\n\n // Validate resourceName\n if (\n filters.some(\n ({ resourceName }) =>\n typeof resourceName !== 'string' && typeof resourceName !== 'undefined'\n )\n ) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the resourceNames have to be a valid string'\n )\n }\n\n let invalidType\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n invalidType = filters.find(i => !validOperationTypes.includes(i.operation))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid operation type ${invalidType.operation}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourcePatternTypes\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n invalidType = filters.find(i => !validResourcePatternTypes.includes(i.resourcePatternType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern type ${invalidType.resourcePatternType}: ${JSON.stringify(\n invalidType\n )}`\n )\n }\n\n // Validate permissionTypes\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n invalidType = filters.find(i => !validPermissionTypes.includes(i.permissionType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid permission type ${invalidType.permissionType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourceTypes\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n invalidType = filters.find(i => !validResourceTypes.includes(i.resourceType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.resourceType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n const { filterResponses } = await broker.deleteAcls({ filters })\n return { filterResponses }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not delete ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /** @type {import(\"../../types\").Admin[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * @return {Object} logger\n */\n const getLogger = () => logger\n\n return {\n connect,\n disconnect,\n listTopics,\n createTopics,\n deleteTopics,\n createPartitions,\n getTopicMetadata,\n fetchTopicMetadata,\n describeCluster,\n events,\n fetchOffsets,\n fetchTopicOffsets,\n fetchTopicOffsetsByTimestamp,\n setOffsets,\n resetOffsets,\n describeConfigs,\n alterConfigs,\n on,\n logger: getLogger,\n listGroups,\n describeGroups,\n deleteGroups,\n describeAcls,\n deleteAcls,\n createAcls,\n deleteTopicRecords,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst networkEvents = require('../network/instrumentationEvents')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst adminType = InstrumentationEventType('admin')\n\nconst events = {\n CONNECT: adminType('connect'),\n DISCONNECT: adminType('disconnect'),\n REQUEST: adminType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: adminType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: adminType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const Long = require('../utils/long')\nconst Lock = require('../utils/lock')\nconst { Types: Compression } = require('../protocol/message/compression')\nconst { requests, lookup } = require('../protocol/requests')\nconst { KafkaJSNonRetriableError } = require('../errors')\nconst apiKeys = require('../protocol/requests/apiKeys')\nconst SASLAuthenticator = require('./saslAuthenticator')\nconst shuffle = require('../utils/shuffle')\nconst { ApiVersions: apiVersionsApiKey } = require('../protocol/requests/apiKeys')\nconst sharedPromiseTo = require('../utils/sharedPromiseTo')\n\nconst PRIVATE = {\n SHOULD_REAUTHENTICATE: Symbol('private:Broker:shouldReauthenticate'),\n SEND_REQUEST: Symbol('private:Broker:sendRequest'),\n AUTHENTICATE: Symbol('private:Broker:authenticate'),\n}\n\n/** @type {import(\"../protocol/requests\").Lookup} */\nconst notInitializedLookup = () => {\n throw new Error('Broker not connected')\n}\n\n/**\n * @param request - request from protocol\n * @returns {boolean}\n */\nconst isAuthenticatedRequest = request => {\n return request.apiKey !== apiVersionsApiKey\n}\n\n/**\n * Each node in a Kafka cluster is called broker. This class contains\n * the high-level operations a node can perform.\n *\n * @type {import(\"../../types\").Broker}\n */\nmodule.exports = class Broker {\n /**\n * @param {Object} options\n * @param {import(\"../network/connection\")} options.connection\n * @param {import(\"../../types\").Logger} options.logger\n * @param {number} [options.nodeId]\n * @param {import(\"../../types\").ApiVersions} [options.versions=null] The object with all available versions and APIs\n * supported by this cluster. The output of broker#apiVersions\n * @param {number} [options.authenticationTimeout=1000]\n * @param {number} [options.reauthenticationThreshold=10000]\n * @param {boolean} [options.allowAutoTopicCreation=true] If this and the broker config 'auto.create.topics.enable'\n * are true, topics that don't exist will be created when\n * fetching metadata.\n * @param {boolean} [options.supportAuthenticationProtocol=null] If the server supports the SASLAuthenticate protocol\n */\n constructor({\n connection,\n logger,\n nodeId = null,\n versions = null,\n authenticationTimeout = 1000,\n reauthenticationThreshold = 10000,\n allowAutoTopicCreation = true,\n supportAuthenticationProtocol = null,\n }) {\n this.connection = connection\n this.nodeId = nodeId\n this.rootLogger = logger\n this.logger = logger.namespace('Broker')\n this.versions = versions\n this.authenticationTimeout = authenticationTimeout\n this.reauthenticationThreshold = reauthenticationThreshold\n this.allowAutoTopicCreation = allowAutoTopicCreation\n this.supportAuthenticationProtocol = supportAuthenticationProtocol\n\n this.authenticatedAt = null\n this.sessionLifetime = Long.ZERO\n\n // The lock timeout has twice the connectionTimeout because the same timeout is used\n // for the first apiVersions call\n const lockTimeout = 2 * this.connection.connectionTimeout + this.authenticationTimeout\n this.brokerAddress = `${this.connection.host}:${this.connection.port}`\n\n this.lock = new Lock({\n timeout: lockTimeout,\n description: `connect to broker ${this.brokerAddress}`,\n })\n\n this.lookupRequest = notInitializedLookup\n\n /**\n * @private\n * @returns {Promise}\n */\n this[PRIVATE.AUTHENTICATE] = sharedPromiseTo(async () => {\n if (this.connection.sasl && !this.isAuthenticated()) {\n const authenticator = new SASLAuthenticator(\n this.connection,\n this.rootLogger,\n this.versions,\n this.supportAuthenticationProtocol\n )\n\n await authenticator.authenticate()\n this.authenticatedAt = process.hrtime()\n this.sessionLifetime = Long.fromValue(authenticator.sessionLifetime)\n }\n })\n }\n\n /**\n * @public\n * @returns {boolean}\n */\n isAuthenticated() {\n return this.authenticatedAt != null && !this[PRIVATE.SHOULD_REAUTHENTICATE]()\n }\n\n /**\n * @public\n * @returns {boolean}\n */\n isConnected() {\n const { connected, sasl } = this.connection\n return sasl ? connected && this.isAuthenticated() : connected\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n try {\n await this.lock.acquire()\n if (this.isConnected()) {\n return\n }\n\n this.authenticatedAt = null\n await this.connection.connect()\n\n if (!this.versions) {\n this.versions = await this.apiVersions()\n }\n\n this.lookupRequest = lookup(this.versions)\n\n if (this.supportAuthenticationProtocol === null) {\n try {\n this.lookupRequest(apiKeys.SaslAuthenticate, requests.SaslAuthenticate)\n this.supportAuthenticationProtocol = true\n } catch (_) {\n this.supportAuthenticationProtocol = false\n }\n\n this.logger.debug(`Verified support for SaslAuthenticate`, {\n broker: this.brokerAddress,\n supportAuthenticationProtocol: this.supportAuthenticationProtocol,\n })\n }\n\n await this[PRIVATE.AUTHENTICATE]()\n } finally {\n await this.lock.release()\n }\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.authenticatedAt = null\n await this.connection.disconnect()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async apiVersions() {\n let response\n const availableVersions = requests.ApiVersions.versions\n .map(Number)\n .sort()\n .reverse()\n\n // Find the best version implemented by the server\n for (const candidateVersion of availableVersions) {\n try {\n const apiVersions = requests.ApiVersions.protocol({ version: candidateVersion })\n response = await this[PRIVATE.SEND_REQUEST]({\n ...apiVersions(),\n requestTimeout: this.connection.connectionTimeout,\n })\n break\n } catch (e) {\n if (e.type !== 'UNSUPPORTED_VERSION') {\n throw e\n }\n }\n }\n\n if (!response) {\n throw new KafkaJSNonRetriableError('API Versions not supported')\n }\n\n return response.apiVersions.reduce(\n (obj, version) =>\n Object.assign(obj, {\n [version.apiKey]: {\n minVersion: version.minVersion,\n maxVersion: version.maxVersion,\n },\n }),\n {}\n )\n }\n\n /**\n * @public\n * @type {import(\"../../types\").Broker['metadata']}\n * @param {string[]} [topics=[]] An array of topics to fetch metadata for.\n * If no topics are specified fetch metadata for all topics\n */\n async metadata(topics = []) {\n const metadata = this.lookupRequest(apiKeys.Metadata, requests.Metadata)\n const shuffledTopics = shuffle(topics)\n return await this[PRIVATE.SEND_REQUEST](\n metadata({ topics: shuffledTopics, allowAutoTopicCreation: this.allowAutoTopicCreation })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {Array} request.topicData An array of messages per topic and per partition, example:\n * [\n * {\n * topic: 'test-topic-1',\n * partitions: [\n * {\n * partition: 0,\n * firstSequence: 0,\n * messages: [\n * { key: '1', value: 'A' },\n * { key: '2', value: 'B' },\n * ]\n * },\n * {\n * partition: 1,\n * firstSequence: 0,\n * messages: [\n * { key: '3', value: 'C' },\n * ]\n * }\n * ]\n * },\n * {\n * topic: 'test-topic-2',\n * partitions: [\n * {\n * partition: 4,\n * firstSequence: 0,\n * messages: [\n * { key: '32', value: 'E' },\n * ]\n * },\n * ]\n * },\n * ]\n * @param {number} [request.acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n * @param {number} [request.timeout=30000] The time to await a response in ms\n * @param {string} [request.transactionalId=null]\n * @param {number} [request.producerId=-1] Broker assigned producerId\n * @param {number} [request.producerEpoch=0] Broker assigned producerEpoch\n * @param {import(\"../../types\").CompressionTypes} [request.compression=CompressionTypes.None] Compression codec\n * @returns {Promise}\n */\n async produce({\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n acks = -1,\n timeout = 30000,\n compression = Compression.None,\n }) {\n const produce = this.lookupRequest(apiKeys.Produce, requests.Produce)\n return await this[PRIVATE.SEND_REQUEST](\n produce({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {number} [request.replicaId=-1] Broker id of the follower. For normal consumers, use -1\n * @param {number} [request.isolationLevel=1] This setting controls the visibility of transactional records. Default READ_COMMITTED.\n * @param {number} [request.maxWaitTime=5000] Maximum time in ms to wait for the response\n * @param {number} [request.minBytes=1] Minimum bytes to accumulate in the response\n * @param {number} [request.maxBytes=10485760] Maximum bytes to accumulate in the response. Note that this is\n * not an absolute maximum, if the first message in the first non-empty\n * partition of the fetch is larger than this value, the message will still\n * be returned to ensure that progress can be made. Default 10MB.\n * @param {Array} request.topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n * @param {string} [request.rackId=''] A rack identifier for this client. This can be any string value which indicates where this\n * client is physically located. It corresponds with the broker config `broker.rack`.\n * @returns {Promise}\n */\n async fetch({\n replicaId,\n isolationLevel,\n maxWaitTime = 5000,\n minBytes = 1,\n maxBytes = 10485760,\n topics,\n rackId = '',\n }) {\n // TODO: validate topics not null/empty\n const fetch = this.lookupRequest(apiKeys.Fetch, requests.Fetch)\n\n // Shuffle topic-partitions to ensure fair response allocation across partitions (KIP-74)\n const flattenedTopicPartitions = topics.reduce((topicPartitions, { topic, partitions }) => {\n partitions.forEach(partition => {\n topicPartitions.push({ topic, partition })\n })\n return topicPartitions\n }, [])\n\n const shuffledTopicPartitions = shuffle(flattenedTopicPartitions)\n\n // Consecutive partitions for the same topic can be combined into a single `topic` entry\n const consolidatedTopicPartitions = shuffledTopicPartitions.reduce(\n (topicPartitions, { topic, partition }) => {\n const last = topicPartitions[topicPartitions.length - 1]\n\n if (last != null && last.topic === topic) {\n topicPartitions[topicPartitions.length - 1].partitions.push(partition)\n } else {\n topicPartitions.push({ topic, partitions: [partition] })\n }\n\n return topicPartitions\n },\n []\n )\n\n return await this[PRIVATE.SEND_REQUEST](\n fetch({\n replicaId,\n isolationLevel,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics: consolidatedTopicPartitions,\n rackId,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The group id\n * @param {number} request.groupGenerationId The generation of the group\n * @param {string} request.memberId The member id assigned by the group coordinator\n * @returns {Promise}\n */\n async heartbeat({ groupId, groupGenerationId, memberId }) {\n const heartbeat = this.lookupRequest(apiKeys.Heartbeat, requests.Heartbeat)\n return await this[PRIVATE.SEND_REQUEST](heartbeat({ groupId, groupGenerationId, memberId }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The unique group id\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} request.coordinatorType The type of coordinator to find\n * @returns {Promise}\n */\n async findGroupCoordinator({ groupId, coordinatorType }) {\n // TODO: validate groupId, mandatory\n const findCoordinator = this.lookupRequest(apiKeys.GroupCoordinator, requests.GroupCoordinator)\n return await this[PRIVATE.SEND_REQUEST](findCoordinator({ groupId, coordinatorType }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The unique group id\n * @param {number} request.sessionTimeout The coordinator considers the consumer dead if it receives\n * no heartbeat after this timeout in ms\n * @param {number} request.rebalanceTimeout The maximum time that the coordinator will wait for each member\n * to rejoin when rebalancing the group\n * @param {string} [request.memberId=\"\"] The assigned consumer id or an empty string for a new consumer\n * @param {string} [request.protocolType=\"consumer\"] Unique name for class of protocols implemented by group\n * @param {Array} request.groupProtocols List of protocols that the member supports (assignment strategy)\n * [{ name: 'AssignerName', metadata: '{\"version\": 1, \"topics\": []}' }]\n * @returns {Promise}\n */\n async joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId = '',\n protocolType = 'consumer',\n groupProtocols,\n }) {\n const joinGroup = this.lookupRequest(apiKeys.JoinGroup, requests.JoinGroup)\n const makeRequest = (assignedMemberId = memberId) =>\n this[PRIVATE.SEND_REQUEST](\n joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId: assignedMemberId,\n protocolType,\n groupProtocols,\n })\n )\n\n try {\n return await makeRequest()\n } catch (error) {\n if (error.name === 'KafkaJSMemberIdRequired') {\n return makeRequest(error.memberId)\n }\n\n throw error\n }\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {string} request.memberId\n * @returns {Promise}\n */\n async leaveGroup({ groupId, memberId }) {\n const leaveGroup = this.lookupRequest(apiKeys.LeaveGroup, requests.LeaveGroup)\n return await this[PRIVATE.SEND_REQUEST](leaveGroup({ groupId, memberId }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {number} request.generationId\n * @param {string} request.memberId\n * @param {object} request.groupAssignment\n * @returns {Promise}\n */\n async syncGroup({ groupId, generationId, memberId, groupAssignment }) {\n const syncGroup = this.lookupRequest(apiKeys.SyncGroup, requests.SyncGroup)\n return await this[PRIVATE.SEND_REQUEST](\n syncGroup({\n groupId,\n generationId,\n memberId,\n groupAssignment,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {number} request.replicaId=-1 Broker id of the follower. For normal consumers, use -1\n * @param {number} request.isolationLevel=1 This setting controls the visibility of transactional records (default READ_COMMITTED, Kafka >0.11 only)\n * @param {TopicPartitionOffset[]} request.topics e.g:\n *\n * @typedef {Object} TopicPartitionOffset\n * @property {string} topic\n * @property {PartitionOffset[]} partitions\n *\n * @typedef {Object} PartitionOffset\n * @property {number} partition\n * @property {number} [timestamp=-1]\n *\n *\n * @returns {Promise}\n */\n async listOffsets({ replicaId, isolationLevel, topics }) {\n const listOffsets = this.lookupRequest(apiKeys.ListOffsets, requests.ListOffsets)\n const result = await this[PRIVATE.SEND_REQUEST](\n listOffsets({ replicaId, isolationLevel, topics })\n )\n\n // ListOffsets >= v1 will return a single `offset` rather than an array of `offsets` (ListOffsets V0).\n // Normalize to just return `offset`.\n for (const response of result.responses) {\n response.partitions = response.partitions.map(({ offsets, ...partitionData }) => {\n return offsets ? { ...partitionData, offset: offsets.pop() } : partitionData\n })\n }\n\n return result\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {number} request.groupGenerationId\n * @param {string} request.memberId\n * @param {number} [request.retentionTime=-1] -1 signals to the broker that its default configuration\n * should be used.\n * @param {object} request.topics Topics to commit offsets, e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * { partition: 0, offset: '11' }\n * ]\n * }\n * ]\n * @returns {Promise}\n */\n async offsetCommit({ groupId, groupGenerationId, memberId, retentionTime, topics }) {\n const offsetCommit = this.lookupRequest(apiKeys.OffsetCommit, requests.OffsetCommit)\n return await this[PRIVATE.SEND_REQUEST](\n offsetCommit({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {object} request.topics - If the topic array is null fetch offsets for all topics. e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * { partition: 0 }\n * ]\n * }\n * ]\n * @returns {Promise}\n */\n async offsetFetch({ groupId, topics }) {\n const offsetFetch = this.lookupRequest(apiKeys.OffsetFetch, requests.OffsetFetch)\n return await this[PRIVATE.SEND_REQUEST](offsetFetch({ groupId, topics }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.groupIds\n * @returns {Promise}\n */\n async describeGroups({ groupIds }) {\n const describeGroups = this.lookupRequest(apiKeys.DescribeGroups, requests.DescribeGroups)\n return await this[PRIVATE.SEND_REQUEST](describeGroups({ groupIds }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.topics e.g:\n * [\n * {\n * topic: 'topic-name',\n * numPartitions: 1,\n * replicationFactor: 1\n * }\n * ]\n * @param {boolean} [request.validateOnly=false] If this is true, the request will be validated, but the topic\n * won't be created\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely created\n * on the controller node\n * @returns {Promise}\n */\n async createTopics({ topics, validateOnly = false, timeout = 5000 }) {\n const createTopics = this.lookupRequest(apiKeys.CreateTopics, requests.CreateTopics)\n return await this[PRIVATE.SEND_REQUEST](createTopics({ topics, validateOnly, timeout }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.topicPartitions e.g:\n * [\n * {\n * topic: 'topic-name',\n * count: 3,\n * assignments: []\n * }\n * ]\n * @param {boolean} [request.validateOnly=false] If this is true, the request will be validated, but the topic\n * won't be created\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely created\n * on the controller node\n * @returns {Promise}\n */\n async createPartitions({ topicPartitions, validateOnly = false, timeout = 5000 }) {\n const createPartitions = this.lookupRequest(apiKeys.CreatePartitions, requests.CreatePartitions)\n return await this[PRIVATE.SEND_REQUEST](\n createPartitions({ topicPartitions, validateOnly, timeout })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string[]} request.topics An array of topics to be deleted\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely deleted on the\n * controller node. Values <= 0 will trigger topic deletion and return\n * immediately\n * @returns {Promise}\n */\n async deleteTopics({ topics, timeout = 5000 }) {\n const deleteTopics = this.lookupRequest(apiKeys.DeleteTopics, requests.DeleteTopics)\n return await this[PRIVATE.SEND_REQUEST](deleteTopics({ topics, timeout }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").ResourceConfigQuery[]} request.resources\n * [{\n * type: RESOURCE_TYPES.TOPIC,\n * name: 'topic-name',\n * configNames: ['compression.type', 'retention.ms']\n * }]\n * @param {boolean} [request.includeSynonyms=false]\n * @returns {Promise}\n */\n async describeConfigs({ resources, includeSynonyms = false }) {\n const describeConfigs = this.lookupRequest(apiKeys.DescribeConfigs, requests.DescribeConfigs)\n return await this[PRIVATE.SEND_REQUEST](describeConfigs({ resources, includeSynonyms }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").IResourceConfig[]} request.resources\n * [{\n * type: RESOURCE_TYPES.TOPIC,\n * name: 'topic-name',\n * configEntries: [\n * {\n * name: 'cleanup.policy',\n * value: 'compact'\n * }\n * ]\n * }]\n * @param {boolean} [request.validateOnly=false]\n * @returns {Promise}\n */\n async alterConfigs({ resources, validateOnly = false }) {\n const alterConfigs = this.lookupRequest(apiKeys.AlterConfigs, requests.AlterConfigs)\n return await this[PRIVATE.SEND_REQUEST](alterConfigs({ resources, validateOnly }))\n }\n\n /**\n * Send an `InitProducerId` request to fetch a PID and bump the producer epoch.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {number} request.transactionTimeout The time in ms to wait for before aborting idle transactions\n * @param {number} [request.transactionalId] The transactional id or null if the producer is not transactional\n * @returns {Promise}\n */\n async initProducerId({ transactionalId, transactionTimeout }) {\n const initProducerId = this.lookupRequest(apiKeys.InitProducerId, requests.InitProducerId)\n return await this[PRIVATE.SEND_REQUEST](initProducerId({ transactionalId, transactionTimeout }))\n }\n\n /**\n * Send an `AddPartitionsToTxn` request to mark a TopicPartition as participating in the transaction.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {object[]} request.topics e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [ 0, 1]\n * }\n * ]\n * @returns {Promise}\n */\n async addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics }) {\n const addPartitionsToTxn = this.lookupRequest(\n apiKeys.AddPartitionsToTxn,\n requests.AddPartitionsToTxn\n )\n return await this[PRIVATE.SEND_REQUEST](\n addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics })\n )\n }\n\n /**\n * Send an `AddOffsetsToTxn` request.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {string} request.groupId The unique group identifier (for the consumer group)\n * @returns {Promise}\n */\n async addOffsetsToTxn({ transactionalId, producerId, producerEpoch, groupId }) {\n const addOffsetsToTxn = this.lookupRequest(apiKeys.AddOffsetsToTxn, requests.AddOffsetsToTxn)\n return await this[PRIVATE.SEND_REQUEST](\n addOffsetsToTxn({ transactionalId, producerId, producerEpoch, groupId })\n )\n }\n\n /**\n * Send a `TxnOffsetCommit` request to persist the offsets in the `__consumer_offsets` topics.\n *\n * Request should be made to the consumer coordinator.\n * @public\n * @param {object} request\n * @param {OffsetCommitTopic[]} request.topics\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {string} request.groupId The unique group identifier (for the consumer group)\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {OffsetCommitTopic[]} request.topics\n *\n * @typedef {Object} OffsetCommitTopic\n * @property {string} topic\n * @property {OffsetCommitTopicPartition[]} partitions\n *\n * @typedef {Object} OffsetCommitTopicPartition\n * @property {number} partition\n * @property {number} offset\n * @property {string} [metadata]\n *\n * @returns {Promise}\n */\n async txnOffsetCommit({ transactionalId, groupId, producerId, producerEpoch, topics }) {\n const txnOffsetCommit = this.lookupRequest(apiKeys.TxnOffsetCommit, requests.TxnOffsetCommit)\n return await this[PRIVATE.SEND_REQUEST](\n txnOffsetCommit({ transactionalId, groupId, producerId, producerEpoch, topics })\n )\n }\n\n /**\n * Send an `EndTxn` request to indicate transaction should be committed or aborted.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {boolean} request.transactionResult The result of the transaction (false = ABORT, true = COMMIT)\n * @returns {Promise}\n */\n async endTxn({ transactionalId, producerId, producerEpoch, transactionResult }) {\n const endTxn = this.lookupRequest(apiKeys.EndTxn, requests.EndTxn)\n return await this[PRIVATE.SEND_REQUEST](\n endTxn({ transactionalId, producerId, producerEpoch, transactionResult })\n )\n }\n\n /**\n * Send request for list of groups\n * @public\n * @returns {Promise}\n */\n async listGroups() {\n const listGroups = this.lookupRequest(apiKeys.ListGroups, requests.ListGroups)\n return await this[PRIVATE.SEND_REQUEST](listGroups())\n }\n\n /**\n * Send request to delete groups\n * @param {string[]} groupIds\n * @public\n * @returns {Promise}\n */\n async deleteGroups(groupIds) {\n const deleteGroups = this.lookupRequest(apiKeys.DeleteGroups, requests.DeleteGroups)\n return await this[PRIVATE.SEND_REQUEST](deleteGroups(groupIds))\n }\n\n /**\n * Send request to delete records\n * @public\n * @param {object} request\n * @param {TopicPartitionRecords[]} request.topics\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, offset 2 },\n * { partition: 1, offset 4 },\n * ],\n * }\n * ]\n * @returns {Promise} example:\n * {\n * throttleTime: 0\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, lowWatermark: '2n', errorCode: 0 },\n * { partition: 1, lowWatermark: '4n', errorCode: 0 },\n * ],\n * },\n * ]\n * }\n *\n * @typedef {object} TopicPartitionRecords\n * @property {string} topic\n * @property {PartitionRecord[]} partitions\n *\n * @typedef {object} PartitionRecord\n * @property {number} partition\n * @property {number} offset\n */\n async deleteRecords({ topics }) {\n const deleteRecords = this.lookupRequest(apiKeys.DeleteRecords, requests.DeleteRecords)\n return await this[PRIVATE.SEND_REQUEST](deleteRecords({ topics }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").AclEntry[]} request.acl e.g:\n * [\n * {\n * resourceType: AclResourceTypes.TOPIC,\n * resourceName: 'topic-name',\n * resourcePatternType: ResourcePatternTypes.LITERAL,\n * principal: 'User:bob',\n * host: '*',\n * operation: AclOperationTypes.ALL,\n * permissionType: AclPermissionTypes.DENY,\n * }\n * ]\n * @returns {Promise}\n */\n async createAcls({ acl }) {\n const createAcls = this.lookupRequest(apiKeys.CreateAcls, requests.CreateAcls)\n return await this[PRIVATE.SEND_REQUEST](createAcls({ creations: acl }))\n }\n\n /**\n * @public\n * @param {import(\"../../types\").AclEntry} aclEntry\n * @returns {Promise}\n */\n async describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) {\n const describeAcls = this.lookupRequest(apiKeys.DescribeAcls, requests.DescribeAcls)\n return await this[PRIVATE.SEND_REQUEST](\n describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {import(\"../../types\").AclEntry[]} request.filters\n * @returns {Promise}\n */\n async deleteAcls({ filters }) {\n const deleteAcls = this.lookupRequest(apiKeys.DeleteAcls, requests.DeleteAcls)\n return await this[PRIVATE.SEND_REQUEST](deleteAcls({ filters }))\n }\n\n /***\n * @private\n */\n [PRIVATE.SHOULD_REAUTHENTICATE]() {\n if (this.sessionLifetime.equals(Long.ZERO)) {\n return false\n }\n\n if (this.authenticatedAt == null) {\n return true\n }\n\n const [secondsSince, remainingNanosSince] = process.hrtime(this.authenticatedAt)\n const millisSince = Long.fromValue(secondsSince)\n .multiply(1000)\n .add(Long.fromValue(remainingNanosSince).divide(1000000))\n\n const reauthenticateAt = millisSince.add(this.reauthenticationThreshold)\n return reauthenticateAt.greaterThanOrEqual(this.sessionLifetime)\n }\n\n /**\n * @private\n */\n async [PRIVATE.SEND_REQUEST](protocolRequest) {\n if (!this.isAuthenticated() && isAuthenticatedRequest(protocolRequest.request)) {\n await this[PRIVATE.AUTHENTICATE]()\n }\n try {\n return await this.connection.send(protocolRequest)\n } catch (e) {\n if (e.name === 'KafkaJSConnectionClosedError') {\n await this.disconnect()\n }\n\n throw e\n }\n }\n}\n","const awsIam = require('../../protocol/sasl/awsIam')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class AWSIAMAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLAWSIAMAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (!sasl.authorizationIdentity) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing authorizationIdentity')\n }\n if (!sasl.accessKeyId) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing accessKeyId')\n }\n if (!sasl.secretAccessKey) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing secretAccessKey')\n }\n if (!sasl.sessionToken) {\n sasl.sessionToken = ''\n }\n\n const request = awsIam.request(sasl)\n const response = awsIam.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL AWS-IAM', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL AWS-IAM authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL AWS-IAM authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const { requests, lookup } = require('../../protocol/requests')\nconst apiKeys = require('../../protocol/requests/apiKeys')\nconst PlainAuthenticator = require('./plain')\nconst SCRAM256Authenticator = require('./scram256')\nconst SCRAM512Authenticator = require('./scram512')\nconst AWSIAMAuthenticator = require('./awsIam')\nconst OAuthBearerAuthenticator = require('./oauthBearer')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nconst AUTHENTICATORS = {\n PLAIN: PlainAuthenticator,\n 'SCRAM-SHA-256': SCRAM256Authenticator,\n 'SCRAM-SHA-512': SCRAM512Authenticator,\n AWS: AWSIAMAuthenticator,\n OAUTHBEARER: OAuthBearerAuthenticator,\n}\n\nconst SUPPORTED_MECHANISMS = Object.keys(AUTHENTICATORS)\nconst UNLIMITED_SESSION_LIFETIME = '0'\n\nmodule.exports = class SASLAuthenticator {\n constructor(connection, logger, versions, supportAuthenticationProtocol) {\n this.connection = connection\n this.logger = logger\n this.sessionLifetime = UNLIMITED_SESSION_LIFETIME\n\n const lookupRequest = lookup(versions)\n this.saslHandshake = lookupRequest(apiKeys.SaslHandshake, requests.SaslHandshake)\n this.protocolAuthentication = supportAuthenticationProtocol\n ? lookupRequest(apiKeys.SaslAuthenticate, requests.SaslAuthenticate)\n : null\n }\n\n async authenticate() {\n const mechanism = this.connection.sasl.mechanism.toUpperCase()\n if (!SUPPORTED_MECHANISMS.includes(mechanism)) {\n throw new KafkaJSSASLAuthenticationError(\n `SASL ${mechanism} mechanism is not supported by the client`\n )\n }\n\n const handshake = await this.connection.send(this.saslHandshake({ mechanism }))\n if (!handshake.enabledMechanisms.includes(mechanism)) {\n throw new KafkaJSSASLAuthenticationError(\n `SASL ${mechanism} mechanism is not supported by the server`\n )\n }\n\n const saslAuthenticate = async ({ request, response, authExpectResponse }) => {\n if (this.protocolAuthentication) {\n const { buffer: requestAuthBytes } = await request.encode()\n const authResponse = await this.connection.send(\n this.protocolAuthentication({ authBytes: requestAuthBytes })\n )\n\n // `0` is a string because `sessionLifetimeMs` is an int64 encoded as string.\n // This is not present in SaslAuthenticateV0, so we default to `\"0\"`\n this.sessionLifetime = authResponse.sessionLifetimeMs || UNLIMITED_SESSION_LIFETIME\n\n if (!authExpectResponse) {\n return\n }\n\n const { authBytes: responseAuthBytes } = authResponse\n const payloadDecoded = await response.decode(responseAuthBytes)\n return response.parse(payloadDecoded)\n }\n\n return this.connection.authenticate({ request, response, authExpectResponse })\n }\n\n const Authenticator = AUTHENTICATORS[mechanism]\n await new Authenticator(this.connection, this.logger, saslAuthenticate).authenticate()\n }\n}\n","/**\n * The sasl object must include a property named oauthBearerProvider, an\n * async function that is used to return the OAuth bearer token.\n *\n * The OAuth bearer token must be an object with properties value and\n * (optionally) extensions, that will be sent during the SASL/OAUTHBEARER\n * request.\n *\n * The implementation of the oauthBearerProvider must take care that tokens are\n * reused and refreshed when appropriate.\n */\n\nconst oauthBearer = require('../../protocol/sasl/oauthBearer')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class OAuthBearerAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLOAuthBearerAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (sasl.oauthBearerProvider == null) {\n throw new KafkaJSSASLAuthenticationError(\n 'SASL OAUTHBEARER: Missing OAuth bearer token provider'\n )\n }\n\n const { oauthBearerProvider } = sasl\n\n const oauthBearerToken = await oauthBearerProvider()\n\n if (oauthBearerToken.value == null) {\n throw new KafkaJSSASLAuthenticationError('SASL OAUTHBEARER: Invalid OAuth bearer token')\n }\n\n const request = await oauthBearer.request(sasl, oauthBearerToken)\n const response = oauthBearer.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL OAUTHBEARER', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL OAUTHBEARER authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL OAUTHBEARER authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const plain = require('../../protocol/sasl/plain')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class PlainAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLPlainAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (sasl.username == null || sasl.password == null) {\n throw new KafkaJSSASLAuthenticationError('SASL Plain: Invalid username or password')\n }\n\n const request = plain.request(sasl)\n const response = plain.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL PLAIN', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL PLAIN authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL PLAIN authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const crypto = require('crypto')\nconst scram = require('../../protocol/sasl/scram')\nconst { KafkaJSSASLAuthenticationError, KafkaJSNonRetriableError } = require('../../errors')\n\nconst GS2_HEADER = 'n,,'\n\nconst EQUAL_SIGN_REGEX = /=/g\nconst COMMA_SIGN_REGEX = /,/g\n\nconst URLSAFE_BASE64_PLUS_REGEX = /\\+/g\nconst URLSAFE_BASE64_SLASH_REGEX = /\\//g\nconst URLSAFE_BASE64_TRAILING_EQUAL_REGEX = /=+$/\n\nconst HMAC_CLIENT_KEY = 'Client Key'\nconst HMAC_SERVER_KEY = 'Server Key'\n\nconst DIGESTS = {\n SHA256: {\n length: 32,\n type: 'sha256',\n minIterations: 4096,\n },\n SHA512: {\n length: 64,\n type: 'sha512',\n minIterations: 4096,\n },\n}\n\nconst encode64 = str => Buffer.from(str).toString('base64')\n\nclass SCRAM {\n /**\n * From https://tools.ietf.org/html/rfc5802#section-5.1\n *\n * The characters ',' or '=' in usernames are sent as '=2C' and\n * '=3D' respectively. If the server receives a username that\n * contains '=' not followed by either '2C' or '3D', then the\n * server MUST fail the authentication.\n *\n * @returns {String}\n */\n static sanitizeString(str) {\n return str.replace(EQUAL_SIGN_REGEX, '=3D').replace(COMMA_SIGN_REGEX, '=2C')\n }\n\n /**\n * In cryptography, a nonce is an arbitrary number that can be used just once.\n * It is similar in spirit to a nonce * word, hence the name. It is often a random or pseudo-random\n * number issued in an authentication protocol to * ensure that old communications cannot be reused\n * in replay attacks.\n *\n * @returns {String}\n */\n static nonce() {\n return crypto\n .randomBytes(16)\n .toString('base64')\n .replace(URLSAFE_BASE64_PLUS_REGEX, '-') // make it url safe\n .replace(URLSAFE_BASE64_SLASH_REGEX, '_')\n .replace(URLSAFE_BASE64_TRAILING_EQUAL_REGEX, '')\n .toString('ascii')\n }\n\n /**\n * Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the\n * pseudorandom function (PRF) and with dkLen == output length of\n * HMAC() == output length of H()\n *\n * @returns {Promise}\n */\n static hi(password, salt, iterations, digestDefinition) {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n password,\n salt,\n iterations,\n digestDefinition.length,\n digestDefinition.type,\n (err, derivedKey) => (err ? reject(err) : resolve(derivedKey))\n )\n })\n }\n\n /**\n * Apply the exclusive-or operation to combine the octet string\n * on the left of this operator with the octet string on the right of\n * this operator. The length of the output and each of the two\n * inputs will be the same for this use\n *\n * @returns {Buffer}\n */\n static xor(left, right) {\n const bufferA = Buffer.from(left)\n const bufferB = Buffer.from(right)\n const length = Buffer.byteLength(bufferA)\n\n if (length !== Buffer.byteLength(bufferB)) {\n throw new KafkaJSNonRetriableError('Buffers must be of the same length')\n }\n\n const result = []\n for (let i = 0; i < length; i++) {\n result.push(bufferA[i] ^ bufferB[i])\n }\n\n return Buffer.from(result)\n }\n\n /**\n * @param {Connection} connection\n * @param {Logger} logger\n * @param {Function} saslAuthenticate\n * @param {DigestDefinition} digestDefinition\n */\n constructor(connection, logger, saslAuthenticate, digestDefinition) {\n this.connection = connection\n this.logger = logger\n this.saslAuthenticate = saslAuthenticate\n this.digestDefinition = digestDefinition\n\n const digestType = digestDefinition.type.toUpperCase()\n this.PREFIX = `SASL SCRAM ${digestType} authentication`\n\n this.currentNonce = SCRAM.nonce()\n }\n\n async authenticate() {\n const { PREFIX } = this\n const { host, port, sasl } = this.connection\n const broker = `${host}:${port}`\n\n if (sasl.username == null || sasl.password == null) {\n throw new KafkaJSSASLAuthenticationError(`${this.PREFIX}: Invalid username or password`)\n }\n\n try {\n this.logger.debug('Exchanging first client message', { broker })\n const clientMessageResponse = await this.sendClientFirstMessage()\n\n this.logger.debug('Sending final message', { broker })\n const finalResponse = await this.sendClientFinalMessage(clientMessageResponse)\n\n if (finalResponse.e) {\n throw new Error(finalResponse.e)\n }\n\n const serverKey = await this.serverKey(clientMessageResponse)\n const serverSignature = this.serverSignature(serverKey, clientMessageResponse)\n\n if (finalResponse.v !== serverSignature) {\n throw new Error('Invalid server signature in server final message')\n }\n\n this.logger.debug(`${PREFIX} successful`, { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(`${PREFIX} failed: ${e.message}`)\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n\n /**\n * @private\n */\n async sendClientFirstMessage() {\n const clientFirstMessage = `${GS2_HEADER}${this.firstMessageBare()}`\n const request = scram.firstMessage.request({ clientFirstMessage })\n const response = scram.firstMessage.response\n\n return this.saslAuthenticate({\n authExpectResponse: true,\n request,\n response,\n })\n }\n\n /**\n * @private\n */\n async sendClientFinalMessage(clientMessageResponse) {\n const { PREFIX } = this\n const iterations = parseInt(clientMessageResponse.i, 10)\n const { minIterations } = this.digestDefinition\n\n if (!clientMessageResponse.r.startsWith(this.currentNonce)) {\n throw new KafkaJSSASLAuthenticationError(\n `${PREFIX} failed: Invalid server nonce, it does not start with the client nonce`\n )\n }\n\n if (iterations < minIterations) {\n throw new KafkaJSSASLAuthenticationError(\n `${PREFIX} failed: Requested iterations ${iterations} is less than the minimum ${minIterations}`\n )\n }\n\n const finalMessageWithoutProof = this.finalMessageWithoutProof(clientMessageResponse)\n const clientProof = await this.clientProof(clientMessageResponse)\n const finalMessage = `${finalMessageWithoutProof},p=${clientProof}`\n const request = scram.finalMessage.request({ finalMessage })\n const response = scram.finalMessage.response\n\n return this.saslAuthenticate({\n authExpectResponse: true,\n request,\n response,\n })\n }\n\n /**\n * @private\n */\n async clientProof(clientMessageResponse) {\n const clientKey = await this.clientKey(clientMessageResponse)\n const storedKey = this.H(clientKey)\n const clientSignature = this.clientSignature(storedKey, clientMessageResponse)\n return encode64(SCRAM.xor(clientKey, clientSignature))\n }\n\n /**\n * @private\n */\n async clientKey(clientMessageResponse) {\n const saltedPassword = await this.saltPassword(clientMessageResponse)\n return this.HMAC(saltedPassword, HMAC_CLIENT_KEY)\n }\n\n /**\n * @private\n */\n async serverKey(clientMessageResponse) {\n const saltedPassword = await this.saltPassword(clientMessageResponse)\n return this.HMAC(saltedPassword, HMAC_SERVER_KEY)\n }\n\n /**\n * @private\n */\n clientSignature(storedKey, clientMessageResponse) {\n return this.HMAC(storedKey, this.authMessage(clientMessageResponse))\n }\n\n /**\n * @private\n */\n serverSignature(serverKey, clientMessageResponse) {\n return encode64(this.HMAC(serverKey, this.authMessage(clientMessageResponse)))\n }\n\n /**\n * @private\n */\n authMessage(clientMessageResponse) {\n return [\n this.firstMessageBare(),\n clientMessageResponse.original,\n this.finalMessageWithoutProof(clientMessageResponse),\n ].join(',')\n }\n\n /**\n * @private\n */\n async saltPassword(clientMessageResponse) {\n const salt = Buffer.from(clientMessageResponse.s, 'base64')\n const iterations = parseInt(clientMessageResponse.i, 10)\n return SCRAM.hi(this.encodedPassword(), salt, iterations, this.digestDefinition)\n }\n\n /**\n * @private\n */\n firstMessageBare() {\n return `n=${this.encodedUsername()},r=${this.currentNonce}`\n }\n\n /**\n * @private\n */\n finalMessageWithoutProof(clientMessageResponse) {\n const rnonce = clientMessageResponse.r\n return `c=${encode64(GS2_HEADER)},r=${rnonce}`\n }\n\n /**\n * @private\n */\n encodedUsername() {\n const { username } = this.connection.sasl\n return SCRAM.sanitizeString(username).toString('utf-8')\n }\n\n /**\n * @private\n */\n encodedPassword() {\n const { password } = this.connection.sasl\n return password.toString('utf-8')\n }\n\n /**\n * @private\n */\n H(data) {\n return crypto\n .createHash(this.digestDefinition.type)\n .update(data)\n .digest()\n }\n\n /**\n * @private\n */\n HMAC(key, data) {\n return crypto\n .createHmac(this.digestDefinition.type, key)\n .update(data)\n .digest()\n }\n}\n\nmodule.exports = {\n DIGESTS,\n SCRAM,\n}\n","const { SCRAM, DIGESTS } = require('./scram')\n\nmodule.exports = class SCRAM256Authenticator extends SCRAM {\n constructor(connection, logger, saslAuthenticate) {\n super(connection, logger.namespace('SCRAM256Authenticator'), saslAuthenticate, DIGESTS.SHA256)\n }\n}\n","const { SCRAM, DIGESTS } = require('./scram')\n\nmodule.exports = class SCRAM512Authenticator extends SCRAM {\n constructor(connection, logger, saslAuthenticate) {\n super(connection, logger.namespace('SCRAM512Authenticator'), saslAuthenticate, DIGESTS.SHA512)\n }\n}\n","const Broker = require('../broker')\nconst createRetry = require('../retry')\nconst shuffle = require('../utils/shuffle')\nconst arrayDiff = require('../utils/arrayDiff')\nconst { KafkaJSBrokerNotFound, KafkaJSProtocolError } = require('../errors')\n\nconst { keys, assign, values } = Object\nconst hasBrokerBeenReplaced = (broker, { host, port, rack }) =>\n broker.connection.host !== host ||\n broker.connection.port !== port ||\n broker.connection.rack !== rack\n\nmodule.exports = class BrokerPool {\n /**\n * @param {object} options\n * @param {import(\"./connectionBuilder\").ConnectionBuilder} options.connectionBuilder\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {boolean} [options.allowAutoTopicCreation]\n * @param {number} [options.authenticationTimeout]\n * @param {number} [options.reauthenticationThreshold]\n * @param {number} [options.metadataMaxAge]\n */\n constructor({\n connectionBuilder,\n logger,\n retry,\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n metadataMaxAge,\n }) {\n this.rootLogger = logger\n this.connectionBuilder = connectionBuilder\n this.metadataMaxAge = metadataMaxAge || 0\n this.logger = logger.namespace('BrokerPool')\n this.retrier = createRetry(assign({}, retry))\n\n this.createBroker = options =>\n new Broker({\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n ...options,\n })\n\n this.brokers = {}\n /** @type {Broker | undefined} */\n this.seedBroker = undefined\n /** @type {import(\"../../types\").BrokerMetadata | null} */\n this.metadata = null\n this.metadataExpireAt = null\n this.versions = null\n this.supportAuthenticationProtocol = null\n }\n\n /**\n * @public\n * @returns {Boolean}\n */\n hasConnectedBrokers() {\n const brokers = values(this.brokers)\n return (\n !!brokers.find(broker => broker.isConnected()) ||\n (this.seedBroker ? this.seedBroker.isConnected() : false)\n )\n }\n\n async createSeedBroker() {\n if (this.seedBroker) {\n await this.seedBroker.disconnect()\n }\n\n this.seedBroker = this.createBroker({\n connection: await this.connectionBuilder.build(),\n logger: this.rootLogger,\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n if (this.hasConnectedBrokers()) {\n return\n }\n\n if (!this.seedBroker) {\n await this.createSeedBroker()\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.seedBroker.connect()\n this.versions = this.seedBroker.versions\n } catch (e) {\n if (e.name === 'KafkaJSConnectionError' || e.type === 'ILLEGAL_SASL_STATE') {\n // Connection builder will always rotate the seed broker\n await this.createSeedBroker()\n this.logger.error(\n `Failed to connect to seed broker, trying another broker from the list: ${e.message}`,\n { retryCount, retryTime }\n )\n } else {\n this.logger.error(e.message, { retryCount, retryTime })\n }\n\n if (e.retriable) throw e\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.seedBroker && (await this.seedBroker.disconnect())\n await Promise.all(values(this.brokers).map(broker => broker.disconnect()))\n\n this.brokers = {}\n this.metadata = null\n this.versions = null\n this.supportAuthenticationProtocol = null\n }\n\n /**\n * @public\n * @param {Object} destination\n * @param {string} destination.host\n * @param {number} destination.port\n */\n removeBroker({ host, port }) {\n const removedBroker = values(this.brokers).find(\n broker => broker.connection.host === host && broker.connection.port === port\n )\n\n if (removedBroker) {\n delete this.brokers[removedBroker.nodeId]\n this.metadataExpireAt = null\n\n if (this.seedBroker.nodeId === removedBroker.nodeId) {\n this.seedBroker = shuffle(values(this.brokers))[0]\n }\n }\n }\n\n /**\n * @public\n * @param {Array} topics\n * @returns {Promise}\n */\n async refreshMetadata(topics) {\n const broker = await this.findConnectedBroker()\n const { host: seedHost, port: seedPort } = this.seedBroker.connection\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n this.metadata = await broker.metadata(topics)\n this.metadataExpireAt = Date.now() + this.metadataMaxAge\n\n const replacedBrokers = []\n\n this.brokers = await this.metadata.brokers.reduce(\n async (resultPromise, { nodeId, host, port, rack }) => {\n const result = await resultPromise\n\n if (result[nodeId]) {\n if (!hasBrokerBeenReplaced(result[nodeId], { host, port, rack })) {\n return result\n }\n\n replacedBrokers.push(result[nodeId])\n }\n\n if (host === seedHost && port === seedPort) {\n this.seedBroker.nodeId = nodeId\n this.seedBroker.connection.rack = rack\n return assign(result, {\n [nodeId]: this.seedBroker,\n })\n }\n\n return assign(result, {\n [nodeId]: this.createBroker({\n logger: this.rootLogger,\n versions: this.versions,\n supportAuthenticationProtocol: this.supportAuthenticationProtocol,\n connection: await this.connectionBuilder.build({ host, port, rack }),\n nodeId,\n }),\n })\n },\n this.brokers\n )\n\n const freshBrokerIds = this.metadata.brokers.map(({ nodeId }) => `${nodeId}`).sort()\n const currentBrokerIds = keys(this.brokers).sort()\n const unusedBrokerIds = arrayDiff(currentBrokerIds, freshBrokerIds)\n\n const brokerDisconnects = unusedBrokerIds.map(nodeId => {\n const broker = this.brokers[nodeId]\n return broker.disconnect().then(() => {\n delete this.brokers[nodeId]\n })\n })\n\n const replacedBrokersDisconnects = replacedBrokers.map(broker => broker.disconnect())\n await Promise.all([...brokerDisconnects, ...replacedBrokersDisconnects])\n } catch (e) {\n if (e.type === 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Only refreshes metadata if the data is stale according to the `metadataMaxAge` param or does not contain information about the provided topics\n *\n * @public\n * @param {Array} topics\n * @returns {Promise}\n */\n async refreshMetadataIfNecessary(topics) {\n const shouldRefresh =\n this.metadata == null ||\n this.metadataExpireAt == null ||\n Date.now() > this.metadataExpireAt ||\n !topics.every(topic =>\n this.metadata.topicMetadata.some(topicMetadata => topicMetadata.topic === topic)\n )\n\n if (shouldRefresh) {\n return this.refreshMetadata(topics)\n }\n }\n\n /**\n * @public\n * @param {object} options\n * @param {string} options.nodeId\n * @returns {Promise}\n */\n async findBroker({ nodeId }) {\n const broker = this.brokers[nodeId]\n\n if (!broker) {\n throw new KafkaJSBrokerNotFound(`Broker ${nodeId} not found in the cached metadata`)\n }\n\n await this.connectBroker(broker)\n return broker\n }\n\n /**\n * @public\n * @param {(params: { nodeId: string, broker: Broker }) => Promise} callback\n * @returns {Promise}\n * @template T\n */\n async withBroker(callback) {\n const brokers = shuffle(keys(this.brokers))\n if (brokers.length === 0) {\n throw new KafkaJSBrokerNotFound('No brokers in the broker pool')\n }\n\n for (const nodeId of brokers) {\n const broker = await this.findBroker({ nodeId })\n try {\n return await callback({ nodeId, broker })\n } catch (e) {}\n }\n\n return null\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async findConnectedBroker() {\n const nodeIds = shuffle(keys(this.brokers))\n const connectedBrokerId = nodeIds.find(nodeId => this.brokers[nodeId].isConnected())\n\n if (connectedBrokerId) {\n return await this.findBroker({ nodeId: connectedBrokerId })\n }\n\n // Cycle through the nodes until one connects\n for (const nodeId of nodeIds) {\n try {\n return await this.findBroker({ nodeId })\n } catch (e) {}\n }\n\n // Failed to connect to all known brokers, metadata might be old\n await this.connect()\n return this.seedBroker\n }\n\n /**\n * @private\n * @param {Broker} broker\n * @returns {Promise}\n */\n async connectBroker(broker) {\n if (broker.isConnected()) {\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await broker.connect()\n } catch (e) {\n if (e.name === 'KafkaJSConnectionError' || e.type === 'ILLEGAL_SASL_STATE') {\n await broker.disconnect()\n }\n\n // To avoid reconnecting to an unavailable host, we bail on connection errors\n // and refresh metadata on a higher level before reconnecting\n if (e.name === 'KafkaJSConnectionError') {\n return bail(e)\n }\n\n if (e.type === 'ILLEGAL_SASL_STATE') {\n // Rebuild the connection since it can't recover from illegal SASL state\n broker.connection = await this.connectionBuilder.build({\n host: broker.connection.host,\n port: broker.connection.port,\n rack: broker.connection.rack,\n })\n\n this.logger.error(`Failed to connect to broker, reconnecting`, { retryCount, retryTime })\n throw new KafkaJSProtocolError(e, { retriable: true })\n }\n\n if (e.retriable) throw e\n this.logger.error(e, { retryCount, retryTime, stack: e.stack })\n bail(e)\n }\n })\n }\n}\n","const Connection = require('../network/connection')\nconst { KafkaJSConnectionError, KafkaJSNonRetriableError } = require('../errors')\n\n/**\n * @typedef {Object} ConnectionBuilder\n * @property {(destination?: { host?: string, port?: number, rack?: string }) => Promise} build\n */\n\n/**\n * @param {Object} options\n * @param {import(\"../../types\").ISocketFactory} [options.socketFactory]\n * @param {string[]|(() => string[])} options.brokers\n * @param {Object} [options.ssl]\n * @param {Object} [options.sasl]\n * @param {string} options.clientId\n * @param {number} options.requestTimeout\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} [options.connectionTimeout]\n * @param {number} [options.maxInFlightRequests]\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter]\n * @returns {ConnectionBuilder}\n */\nmodule.exports = ({\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n requestTimeout,\n enforceRequestTimeout,\n connectionTimeout,\n maxInFlightRequests,\n logger,\n instrumentationEmitter = null,\n}) => {\n let index = 0\n\n const isValidBroker = broker => {\n return broker && typeof broker === 'string' && broker.length > 0\n }\n\n const validateBrokers = brokers => {\n if (!brokers) {\n throw new KafkaJSNonRetriableError(`Failed to connect: brokers should not be null`)\n }\n\n if (Array.isArray(brokers)) {\n if (!brokers.length) {\n throw new KafkaJSNonRetriableError(`Failed to connect: brokers array is empty`)\n }\n\n brokers.forEach((broker, index) => {\n if (!isValidBroker(broker)) {\n throw new KafkaJSNonRetriableError(\n `Failed to connect: broker at index ${index} is invalid \"${typeof broker}\"`\n )\n }\n })\n }\n }\n\n const getBrokers = async () => {\n let list\n\n if (typeof brokers === 'function') {\n try {\n list = await brokers()\n } catch (e) {\n const wrappedError = new KafkaJSConnectionError(\n `Failed to connect: \"config.brokers\" threw: ${e.message}`\n )\n wrappedError.stack = `${wrappedError.name}\\n Caused by: ${e.stack}`\n throw wrappedError\n }\n } else {\n list = brokers\n }\n\n validateBrokers(list)\n\n return list\n }\n\n return {\n build: async ({ host, port, rack } = {}) => {\n if (!host) {\n const list = await getBrokers()\n\n const randomBroker = list[index++ % list.length]\n\n host = randomBroker.split(':')[0]\n port = Number(randomBroker.split(':')[1])\n }\n\n return new Connection({\n host,\n port,\n rack,\n sasl,\n ssl,\n clientId,\n socketFactory,\n connectionTimeout,\n requestTimeout,\n enforceRequestTimeout,\n maxInFlightRequests,\n instrumentationEmitter,\n logger,\n })\n },\n }\n}\n","const BrokerPool = require('./brokerPool')\nconst Lock = require('../utils/lock')\nconst createRetry = require('../retry')\nconst connectionBuilder = require('./connectionBuilder')\nconst flatten = require('../utils/flatten')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\nconst {\n KafkaJSError,\n KafkaJSBrokerNotFound,\n KafkaJSMetadataNotLoaded,\n KafkaJSTopicMetadataNotLoaded,\n KafkaJSGroupCoordinatorNotFound,\n} = require('../errors')\nconst COORDINATOR_TYPES = require('../protocol/coordinatorTypes')\n\nconst { keys } = Object\n\nconst mergeTopics = (obj, { topic, partitions }) => ({\n ...obj,\n [topic]: [...(obj[topic] || []), ...partitions],\n})\n\nmodule.exports = class Cluster {\n /**\n * @param {Object} options\n * @param {Array} options.brokers example: ['127.0.0.1:9092', '127.0.0.1:9094']\n * @param {Object} options.ssl\n * @param {Object} options.sasl\n * @param {string} options.clientId\n * @param {number} options.connectionTimeout - in milliseconds\n * @param {number} options.authenticationTimeout - in milliseconds\n * @param {number} options.reauthenticationThreshold - in milliseconds\n * @param {number} [options.requestTimeout=30000] - in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} options.metadataMaxAge - in milliseconds\n * @param {boolean} options.allowAutoTopicCreation\n * @param {number} options.maxInFlightRequests\n * @param {number} options.isolationLevel\n * @param {import(\"../../types\").RetryOptions} options.retry\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {Map} [options.offsets]\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n logger: rootLogger,\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout = 30000,\n enforceRequestTimeout,\n metadataMaxAge,\n retry,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n instrumentationEmitter = null,\n offsets = new Map(),\n }) {\n this.rootLogger = rootLogger\n this.logger = rootLogger.namespace('Cluster')\n this.retrier = createRetry(retry)\n this.connectionBuilder = connectionBuilder({\n logger: rootLogger,\n instrumentationEmitter,\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n requestTimeout,\n enforceRequestTimeout,\n maxInFlightRequests,\n })\n\n this.targetTopics = new Set()\n this.mutatingTargetTopics = new Lock({\n description: `updating target topics`,\n timeout: requestTimeout,\n })\n this.isolationLevel = isolationLevel\n this.brokerPool = new BrokerPool({\n connectionBuilder: this.connectionBuilder,\n logger: this.rootLogger,\n retry,\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n metadataMaxAge,\n })\n this.committedOffsetsByGroup = offsets\n }\n\n isConnected() {\n return this.brokerPool.hasConnectedBrokers()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n await this.brokerPool.connect()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n await this.brokerPool.disconnect()\n }\n\n /**\n * @public\n * @param {object} destination\n * @param {String} destination.host\n * @param {Number} destination.port\n */\n removeBroker({ host, port }) {\n this.brokerPool.removeBroker({ host, port })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async refreshMetadata() {\n await this.brokerPool.refreshMetadata(Array.from(this.targetTopics))\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async refreshMetadataIfNecessary() {\n await this.brokerPool.refreshMetadataIfNecessary(Array.from(this.targetTopics))\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async metadata({ topics = [] } = {}) {\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.brokerPool.refreshMetadataIfNecessary(topics)\n return this.brokerPool.withBroker(async ({ broker }) => broker.metadata(topics))\n } catch (e) {\n if (e.type === 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @param {string} topic\n * @return {Promise}\n */\n async addTargetTopic(topic) {\n return this.addMultipleTargetTopics([topic])\n }\n\n /**\n * @public\n * @param {string[]} topics\n * @return {Promise}\n */\n async addMultipleTargetTopics(topics) {\n await this.mutatingTargetTopics.acquire()\n\n try {\n const previousSize = this.targetTopics.size\n const previousTopics = new Set(this.targetTopics)\n for (const topic of topics) {\n this.targetTopics.add(topic)\n }\n\n const hasChanged = previousSize !== this.targetTopics.size || !this.brokerPool.metadata\n\n if (hasChanged) {\n try {\n await this.refreshMetadata()\n } catch (e) {\n if (e.type === 'INVALID_TOPIC_EXCEPTION' || e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n this.targetTopics = previousTopics\n }\n\n throw e\n }\n }\n } finally {\n await this.mutatingTargetTopics.release()\n }\n }\n\n /**\n * @public\n * @param {object} options\n * @param {string} options.nodeId\n * @returns {Promise}\n */\n async findBroker({ nodeId }) {\n try {\n return await this.brokerPool.findBroker({ nodeId })\n } catch (e) {\n // The client probably has stale metadata\n if (\n e.name === 'KafkaJSBrokerNotFound' ||\n e.name === 'KafkaJSLockTimeout' ||\n e.name === 'KafkaJSConnectionError'\n ) {\n await this.refreshMetadata()\n }\n\n throw e\n }\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async findControllerBroker() {\n const { metadata } = this.brokerPool\n\n if (!metadata || metadata.controllerId == null) {\n throw new KafkaJSMetadataNotLoaded('Topic metadata not loaded')\n }\n\n const broker = await this.findBroker({ nodeId: metadata.controllerId })\n\n if (!broker) {\n throw new KafkaJSBrokerNotFound(\n `Controller broker with id ${metadata.controllerId} not found in the cached metadata`\n )\n }\n\n return broker\n }\n\n /**\n * @public\n * @param {string} topic\n * @returns {import(\"../../types\").PartitionMetadata[]} Example:\n * [{\n * isr: [2],\n * leader: 2,\n * partitionErrorCode: 0,\n * partitionId: 0,\n * replicas: [2],\n * }]\n */\n findTopicPartitionMetadata(topic) {\n const { metadata } = this.brokerPool\n if (!metadata || !metadata.topicMetadata) {\n throw new KafkaJSTopicMetadataNotLoaded('Topic metadata not loaded', { topic })\n }\n\n const topicMetadata = metadata.topicMetadata.find(t => t.topic === topic)\n return topicMetadata ? topicMetadata.partitionMetadata : []\n }\n\n /**\n * @public\n * @param {string} topic\n * @param {(number|string)[]} partitions\n * @returns {Object} Object with leader and partitions. For partitions 0 and 5\n * the result could be:\n * { '0': [0], '2': [5] }\n *\n * where the key is the nodeId.\n */\n findLeaderForPartitions(topic, partitions) {\n const partitionMetadata = this.findTopicPartitionMetadata(topic)\n return partitions.reduce((result, id) => {\n const partitionId = parseInt(id, 10)\n const metadata = partitionMetadata.find(p => p.partitionId === partitionId)\n\n if (!metadata) {\n return result\n }\n\n if (metadata.leader === null || metadata.leader === undefined) {\n throw new KafkaJSError('Invalid partition metadata', { topic, partitionId, metadata })\n }\n\n const { leader } = metadata\n const current = result[leader] || []\n return { ...result, [leader]: [...current, partitionId] }\n }, {})\n }\n\n /**\n * @public\n * @param {object} params\n * @param {string} params.groupId\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} [params.coordinatorType=0]\n * @returns {Promise}\n */\n async findGroupCoordinator({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) {\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n const { coordinator } = await this.findGroupCoordinatorMetadata({\n groupId,\n coordinatorType,\n })\n return await this.findBroker({ nodeId: coordinator.nodeId })\n } catch (e) {\n // A new broker can join the cluster before we have the chance\n // to refresh metadata\n if (e.name === 'KafkaJSBrokerNotFound' || e.type === 'GROUP_COORDINATOR_NOT_AVAILABLE') {\n this.logger.debug(`${e.message}, refreshing metadata and trying again...`, {\n groupId,\n retryCount,\n retryTime,\n })\n\n await this.refreshMetadata()\n throw e\n }\n\n if (e.code === 'ECONNREFUSED') {\n // During maintenance the current coordinator can go down; findBroker will\n // refresh metadata and re-throw the error. findGroupCoordinator has to re-throw\n // the error to go through the retry cycle.\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @param {object} params\n * @param {string} params.groupId\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} [params.coordinatorType=0]\n * @returns {Promise}\n */\n async findGroupCoordinatorMetadata({ groupId, coordinatorType }) {\n const brokerMetadata = await this.brokerPool.withBroker(async ({ nodeId, broker }) => {\n return await this.retrier(async (bail, retryCount, retryTime) => {\n try {\n const brokerMetadata = await broker.findGroupCoordinator({ groupId, coordinatorType })\n this.logger.debug('Found group coordinator', {\n broker: brokerMetadata.host,\n nodeId: brokerMetadata.coordinator.nodeId,\n })\n return brokerMetadata\n } catch (e) {\n this.logger.debug('Tried to find group coordinator', {\n nodeId,\n error: e,\n })\n\n if (e.type === 'GROUP_COORDINATOR_NOT_AVAILABLE') {\n this.logger.debug('Group coordinator not available, retrying...', {\n nodeId,\n retryCount,\n retryTime,\n })\n\n throw e\n }\n\n bail(e)\n }\n })\n })\n\n if (brokerMetadata) {\n return brokerMetadata\n }\n\n throw new KafkaJSGroupCoordinatorNotFound('Failed to find group coordinator')\n }\n\n /**\n * @param {object} topicConfiguration\n * @returns {number}\n */\n defaultOffset({ fromBeginning }) {\n return fromBeginning ? EARLIEST_OFFSET : LATEST_OFFSET\n }\n\n /**\n * @public\n * @param {Array} topics\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [{ partition: 0 }],\n * fromBeginning: false\n * }\n * ]\n * @returns {Promise} example:\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, offset: '1' },\n * { partition: 1, offset: '2' },\n * { partition: 2, offset: '1' },\n * ],\n * },\n * ]\n */\n async fetchTopicsOffset(topics) {\n const partitionsPerBroker = {}\n const topicConfigurations = {}\n\n const addDefaultOffset = topic => partition => {\n const { timestamp } = topicConfigurations[topic]\n return { ...partition, timestamp }\n }\n\n // Index all topics and partitions per leader (nodeId)\n for (const topicData of topics) {\n const { topic, partitions, fromBeginning, fromTimestamp } = topicData\n const partitionsPerLeader = this.findLeaderForPartitions(\n topic,\n partitions.map(p => p.partition)\n )\n const timestamp =\n fromTimestamp != null ? fromTimestamp : this.defaultOffset({ fromBeginning })\n\n topicConfigurations[topic] = { timestamp }\n\n keys(partitionsPerLeader).forEach(nodeId => {\n partitionsPerBroker[nodeId] = partitionsPerBroker[nodeId] || {}\n partitionsPerBroker[nodeId][topic] = partitions.filter(p =>\n partitionsPerLeader[nodeId].includes(p.partition)\n )\n })\n }\n\n // Create a list of requests to fetch the offset of all partitions\n const requests = keys(partitionsPerBroker).map(async nodeId => {\n const broker = await this.findBroker({ nodeId })\n const partitions = partitionsPerBroker[nodeId]\n\n const { responses: topicOffsets } = await broker.listOffsets({\n isolationLevel: this.isolationLevel,\n topics: keys(partitions).map(topic => ({\n topic,\n partitions: partitions[topic].map(addDefaultOffset(topic)),\n })),\n })\n\n return topicOffsets\n })\n\n // Execute all requests, merge and normalize the responses\n const responses = await Promise.all(requests)\n const partitionsPerTopic = flatten(responses).reduce(mergeTopics, {})\n\n return keys(partitionsPerTopic).map(topic => ({\n topic,\n partitions: partitionsPerTopic[topic].map(({ partition, offset }) => ({\n partition,\n offset,\n })),\n }))\n }\n\n /**\n * Retrieve the object mapping for committed offsets for a single consumer group\n * @param {object} options\n * @param {string} options.groupId\n * @returns {Object}\n */\n committedOffsets({ groupId }) {\n if (!this.committedOffsetsByGroup.has(groupId)) {\n this.committedOffsetsByGroup.set(groupId, {})\n }\n\n return this.committedOffsetsByGroup.get(groupId)\n }\n\n /**\n * Mark offset as committed for a single consumer group's topic-partition\n * @param {object} options\n * @param {string} options.groupId\n * @param {string} options.topic\n * @param {string|number} options.partition\n * @param {string} options.offset\n */\n markOffsetAsCommitted({ groupId, topic, partition, offset }) {\n const committedOffsets = this.committedOffsets({ groupId })\n\n committedOffsets[topic] = committedOffsets[topic] || {}\n committedOffsets[topic][partition] = offset\n }\n}\n","const EARLIEST_OFFSET = -2\nconst LATEST_OFFSET = -1\nconst INT_32_MAX_VALUE = Math.pow(2, 32)\n\nmodule.exports = {\n EARLIEST_OFFSET,\n LATEST_OFFSET,\n INT_32_MAX_VALUE,\n}\n","const Encoder = require('../protocol/encoder')\nconst Decoder = require('../protocol/decoder')\n\nconst MemberMetadata = {\n /**\n * @param {Object} metadata\n * @param {number} metadata.version\n * @param {Array} metadata.topics\n * @param {Buffer} [metadata.userData=Buffer.alloc(0)]\n *\n * @returns Buffer\n */\n encode({ version, topics, userData = Buffer.alloc(0) }) {\n return new Encoder()\n .writeInt16(version)\n .writeArray(topics)\n .writeBytes(userData).buffer\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Object}\n */\n decode(buffer) {\n const decoder = new Decoder(buffer)\n return {\n version: decoder.readInt16(),\n topics: decoder.readArray(d => d.readString()),\n userData: decoder.readBytes(),\n }\n },\n}\n\nconst MemberAssignment = {\n /**\n * @param {number} version\n * @param {Object} assignment, example:\n * {\n * 'topic-A': [0, 2, 4, 6],\n * 'topic-B': [0, 2],\n * }\n * @param {Buffer} [userData=Buffer.alloc(0)]\n *\n * @returns Buffer\n */\n encode({ version, assignment, userData = Buffer.alloc(0) }) {\n return new Encoder()\n .writeInt16(version)\n .writeArray(\n Object.keys(assignment).map(topic =>\n new Encoder().writeString(topic).writeArray(assignment[topic])\n )\n )\n .writeBytes(userData).buffer\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Object|null}\n */\n decode(buffer) {\n const decoder = new Decoder(buffer)\n const decodePartitions = d => d.readInt32()\n const decodeAssignment = d => ({\n topic: d.readString(),\n partitions: d.readArray(decodePartitions),\n })\n const indexAssignment = (obj, { topic, partitions }) =>\n Object.assign(obj, { [topic]: partitions })\n\n if (!decoder.canReadInt16()) {\n return null\n }\n\n return {\n version: decoder.readInt16(),\n assignment: decoder.readArray(decodeAssignment).reduce(indexAssignment, {}),\n userData: decoder.readBytes(),\n }\n },\n}\n\nmodule.exports = {\n MemberMetadata,\n MemberAssignment,\n}\n","const roundRobin = require('./roundRobinAssigner')\n\nmodule.exports = {\n roundRobin,\n}\n","const { MemberMetadata, MemberAssignment } = require('../../assignerProtocol')\nconst flatten = require('../../../utils/flatten')\n\n/**\n * RoundRobinAssigner\n * @param {Cluster} cluster\n * @returns {function}\n */\nmodule.exports = ({ cluster }) => ({\n name: 'RoundRobinAssigner',\n version: 1,\n\n /**\n * Assign the topics to the provided members.\n *\n * The members array contains information about each member, `memberMetadata` is the result of the\n * `protocol` operation.\n *\n * @param {array} members array of members, e.g:\n [{ memberId: 'test-5f93f5a3', memberMetadata: Buffer }]\n * @param {array} topics\n * @returns {array} object partitions per topic per member, e.g:\n * [\n * {\n * memberId: 'test-5f93f5a3',\n * memberAssignment: {\n * 'topic-A': [0, 2, 4, 6],\n * 'topic-B': [1],\n * },\n * },\n * {\n * memberId: 'test-3d3d5341',\n * memberAssignment: {\n * 'topic-A': [1, 3, 5],\n * 'topic-B': [0, 2],\n * },\n * }\n * ]\n */\n async assign({ members, topics }) {\n const membersCount = members.length\n const sortedMembers = members.map(({ memberId }) => memberId).sort()\n const assignment = {}\n\n const topicsPartionArrays = topics.map(topic => {\n const partitionMetadata = cluster.findTopicPartitionMetadata(topic)\n return partitionMetadata.map(m => ({ topic: topic, partitionId: m.partitionId }))\n })\n const topicsPartitions = flatten(topicsPartionArrays)\n\n topicsPartitions.forEach((topicPartition, i) => {\n const assignee = sortedMembers[i % membersCount]\n\n if (!assignment[assignee]) {\n assignment[assignee] = Object.create(null)\n }\n\n if (!assignment[assignee][topicPartition.topic]) {\n assignment[assignee][topicPartition.topic] = []\n }\n\n assignment[assignee][topicPartition.topic].push(topicPartition.partitionId)\n })\n\n return Object.keys(assignment).map(memberId => ({\n memberId,\n memberAssignment: MemberAssignment.encode({\n version: this.version,\n assignment: assignment[memberId],\n }),\n }))\n },\n\n protocol({ topics }) {\n return {\n name: this.name,\n metadata: MemberMetadata.encode({\n version: this.version,\n topics,\n }),\n }\n },\n})\n","/**\n * @template T\n * @return {{lock: Promise, unlock: (v?: T) => void, unlockWithError: (e: Error) => void}}\n */\nmodule.exports = () => {\n let unlock\n let unlockWithError\n const lock = new Promise(resolve => {\n unlock = resolve\n unlockWithError = resolve\n })\n\n return { lock, unlock, unlockWithError }\n}\n","const Long = require('../utils/long')\nconst filterAbortedMessages = require('./filterAbortedMessages')\n\n/**\n * A batch collects messages returned from a single fetch call.\n *\n * A batch could contain _multiple_ Kafka RecordBatches.\n */\nmodule.exports = class Batch {\n constructor(topic, fetchedOffset, partitionData) {\n this.fetchedOffset = fetchedOffset\n const longFetchedOffset = Long.fromValue(this.fetchedOffset)\n const { abortedTransactions, messages } = partitionData\n\n this.topic = topic\n this.partition = partitionData.partition\n this.highWatermark = partitionData.highWatermark\n\n this.rawMessages = messages\n // Apparently fetch can return different offsets than the target offset provided to the fetch API.\n // Discard messages that are not in the requested offset\n // https://github.com/apache/kafka/blob/bf237fa7c576bd141d78fdea9f17f65ea269c290/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L912\n this.messagesWithinOffset = this.rawMessages.filter(message =>\n Long.fromValue(message.offset).gte(longFetchedOffset)\n )\n\n // 1. Don't expose aborted messages\n // 2. Don't expose control records\n // @see https://kafka.apache.org/documentation/#controlbatch\n this.messages = filterAbortedMessages({\n messages: this.messagesWithinOffset,\n abortedTransactions,\n }).filter(message => !message.isControlRecord)\n }\n\n isEmpty() {\n return this.messages.length === 0\n }\n\n isEmptyIncludingFiltered() {\n return this.messagesWithinOffset.length === 0\n }\n\n /**\n * If the batch contained raw messages (i.e was not truely empty) but all messages were filtered out due to\n * log compaction, control records or other reasons\n */\n isEmptyDueToFiltering() {\n return this.isEmpty() && this.rawMessages.length > 0\n }\n\n isEmptyControlRecord() {\n return (\n this.isEmpty() && this.messagesWithinOffset.some(({ isControlRecord }) => isControlRecord)\n )\n }\n\n /**\n * With compressed messages, it's possible for the returned messages to have offsets smaller than the starting offset.\n * These messages will be filtered out (i.e. they are not even included in this.messagesWithinOffset)\n * If these are the only messages, the batch will appear as an empty batch.\n *\n * isEmpty() and isEmptyIncludingFiltered() will always return true if the batch is empty,\n * but this method will only return true if the batch is empty due to log compacted messages.\n *\n * @returns boolean True if the batch is empty, because of log compacted messages in the partition.\n */\n isEmptyDueToLogCompactedMessages() {\n const hasMessages = this.rawMessages.length > 0\n return hasMessages && this.isEmptyIncludingFiltered()\n }\n\n firstOffset() {\n return this.isEmptyIncludingFiltered() ? null : this.messagesWithinOffset[0].offset\n }\n\n lastOffset() {\n if (this.isEmptyDueToLogCompactedMessages()) {\n return this.fetchedOffset\n }\n\n if (this.isEmptyIncludingFiltered()) {\n return Long.fromValue(this.highWatermark)\n .add(-1)\n .toString()\n }\n\n return this.messagesWithinOffset[this.messagesWithinOffset.length - 1].offset\n }\n\n /**\n * Returns the lag based on the last offset in the batch (also known as \"high\")\n */\n offsetLag() {\n const lastOffsetOfPartition = Long.fromValue(this.highWatermark).add(-1)\n const lastConsumedOffset = Long.fromValue(this.lastOffset())\n return lastOffsetOfPartition.add(lastConsumedOffset.multiply(-1)).toString()\n }\n\n /**\n * Returns the lag based on the first offset in the batch\n */\n offsetLagLow() {\n if (this.isEmptyIncludingFiltered()) {\n return '0'\n }\n\n const lastOffsetOfPartition = Long.fromValue(this.highWatermark).add(-1)\n const firstConsumedOffset = Long.fromValue(this.firstOffset())\n return lastOffsetOfPartition.add(firstConsumedOffset.multiply(-1)).toString()\n }\n}\n","const flatten = require('../utils/flatten')\nconst sleep = require('../utils/sleep')\nconst BufferedAsyncIterator = require('../utils/bufferedAsyncIterator')\nconst websiteUrl = require('../utils/websiteUrl')\nconst arrayDiff = require('../utils/arrayDiff')\nconst createRetry = require('../retry')\nconst sharedPromiseTo = require('../utils/sharedPromiseTo')\n\nconst OffsetManager = require('./offsetManager')\nconst Batch = require('./batch')\nconst SeekOffsets = require('./seekOffsets')\nconst SubscriptionState = require('./subscriptionState')\nconst {\n events: { GROUP_JOIN, HEARTBEAT, CONNECT, RECEIVED_UNSUBSCRIBED_TOPICS },\n} = require('./instrumentationEvents')\nconst { MemberAssignment } = require('./assignerProtocol')\nconst {\n KafkaJSError,\n KafkaJSNonRetriableError,\n KafkaJSStaleTopicMetadataAssignment,\n} = require('../errors')\n\nconst { keys } = Object\n\nconst STALE_METADATA_ERRORS = [\n 'LEADER_NOT_AVAILABLE',\n // Fetch before v9 uses NOT_LEADER_FOR_PARTITION\n 'NOT_LEADER_FOR_PARTITION',\n // Fetch after v9 uses {FENCED,UNKNOWN}_LEADER_EPOCH\n 'FENCED_LEADER_EPOCH',\n 'UNKNOWN_LEADER_EPOCH',\n 'UNKNOWN_TOPIC_OR_PARTITION',\n]\n\nconst isRebalancing = e =>\n e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP'\n\nconst PRIVATE = {\n JOIN: Symbol('private:ConsumerGroup:join'),\n SYNC: Symbol('private:ConsumerGroup:sync'),\n HEARTBEAT: Symbol('private:ConsumerGroup:heartbeat'),\n SHAREDHEARTBEAT: Symbol('private:ConsumerGroup:sharedHeartbeat'),\n}\n\nmodule.exports = class ConsumerGroup {\n constructor({\n retry,\n cluster,\n groupId,\n topics,\n topicConfigurations,\n logger,\n instrumentationEmitter,\n assigners,\n sessionTimeout,\n rebalanceTimeout,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n isolationLevel,\n rackId,\n metadataMaxAge,\n }) {\n /** @type {import(\"../../types\").Cluster} */\n this.cluster = cluster\n this.groupId = groupId\n this.topics = topics\n this.topicsSubscribed = topics\n this.topicConfigurations = topicConfigurations\n this.logger = logger.namespace('ConsumerGroup')\n this.instrumentationEmitter = instrumentationEmitter\n this.retrier = createRetry(Object.assign({}, retry))\n this.assigners = assigners\n this.sessionTimeout = sessionTimeout\n this.rebalanceTimeout = rebalanceTimeout\n this.maxBytesPerPartition = maxBytesPerPartition\n this.minBytes = minBytes\n this.maxBytes = maxBytes\n this.maxWaitTime = maxWaitTimeInMs\n this.autoCommit = autoCommit\n this.autoCommitInterval = autoCommitInterval\n this.autoCommitThreshold = autoCommitThreshold\n this.isolationLevel = isolationLevel\n this.rackId = rackId\n this.metadataMaxAge = metadataMaxAge\n\n this.seekOffset = new SeekOffsets()\n this.coordinator = null\n this.generationId = null\n this.leaderId = null\n this.memberId = null\n this.members = null\n this.groupProtocol = null\n\n this.partitionsPerSubscribedTopic = null\n /**\n * Preferred read replica per topic and partition\n *\n * Each of the partitions tracks the preferred read replica (`nodeId`) and a timestamp\n * until when that preference is valid.\n *\n * @type {{[topicName: string]: {[partition: number]: {nodeId: number, expireAt: number}}}}\n */\n this.preferredReadReplicasPerTopicPartition = {}\n this.offsetManager = null\n this.subscriptionState = new SubscriptionState()\n\n this.lastRequest = Date.now()\n\n this[PRIVATE.SHAREDHEARTBEAT] = sharedPromiseTo(async ({ interval }) => {\n const { groupId, generationId, memberId } = this\n const now = Date.now()\n\n if (memberId && now >= this.lastRequest + interval) {\n const payload = {\n groupId,\n memberId,\n groupGenerationId: generationId,\n }\n\n await this.coordinator.heartbeat(payload)\n this.instrumentationEmitter.emit(HEARTBEAT, payload)\n this.lastRequest = Date.now()\n }\n })\n }\n\n isLeader() {\n return this.leaderId && this.memberId === this.leaderId\n }\n\n async connect() {\n await this.cluster.connect()\n this.instrumentationEmitter.emit(CONNECT)\n await this.cluster.refreshMetadataIfNecessary()\n }\n\n async [PRIVATE.JOIN]() {\n const { groupId, sessionTimeout, rebalanceTimeout } = this\n\n this.coordinator = await this.cluster.findGroupCoordinator({ groupId })\n\n const groupData = await this.coordinator.joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId: this.memberId || '',\n groupProtocols: this.assigners.map(assigner =>\n assigner.protocol({\n topics: this.topicsSubscribed,\n })\n ),\n })\n\n this.generationId = groupData.generationId\n this.leaderId = groupData.leaderId\n this.memberId = groupData.memberId\n this.members = groupData.members\n this.groupProtocol = groupData.groupProtocol\n }\n\n async leave() {\n const { groupId, memberId } = this\n if (memberId) {\n await this.coordinator.leaveGroup({ groupId, memberId })\n this.memberId = null\n }\n }\n\n async [PRIVATE.SYNC]() {\n let assignment = []\n const {\n groupId,\n generationId,\n memberId,\n members,\n groupProtocol,\n topics,\n topicsSubscribed,\n coordinator,\n } = this\n\n if (this.isLeader()) {\n this.logger.debug('Chosen as group leader', { groupId, generationId, memberId, topics })\n const assigner = this.assigners.find(({ name }) => name === groupProtocol)\n\n if (!assigner) {\n throw new KafkaJSNonRetriableError(\n `Unsupported partition assigner \"${groupProtocol}\", the assigner wasn't found in the assigners list`\n )\n }\n\n await this.cluster.refreshMetadata()\n assignment = await assigner.assign({ members, topics: topicsSubscribed })\n\n this.logger.debug('Group assignment', {\n groupId,\n generationId,\n groupProtocol,\n assignment,\n topics: topicsSubscribed,\n })\n }\n\n // Keep track of the partitions for the subscribed topics\n this.partitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n const { memberAssignment } = await this.coordinator.syncGroup({\n groupId,\n generationId,\n memberId,\n groupAssignment: assignment,\n })\n\n const decodedMemberAssignment = MemberAssignment.decode(memberAssignment)\n const decodedAssignment =\n decodedMemberAssignment != null ? decodedMemberAssignment.assignment : {}\n\n this.logger.debug('Received assignment', {\n groupId,\n generationId,\n memberId,\n memberAssignment: decodedAssignment,\n })\n\n const assignedTopics = keys(decodedAssignment)\n const topicsNotSubscribed = arrayDiff(assignedTopics, topicsSubscribed)\n\n if (topicsNotSubscribed.length > 0) {\n const payload = {\n groupId,\n generationId,\n memberId,\n assignedTopics,\n topicsSubscribed,\n topicsNotSubscribed,\n }\n\n this.instrumentationEmitter.emit(RECEIVED_UNSUBSCRIBED_TOPICS, payload)\n this.logger.warn('Consumer group received unsubscribed topics', {\n ...payload,\n helpUrl: websiteUrl(\n 'docs/faq',\n 'why-am-i-receiving-messages-for-topics-i-m-not-subscribed-to'\n ),\n })\n }\n\n // Remove unsubscribed topics from the list\n const safeAssignment = arrayDiff(assignedTopics, topicsNotSubscribed)\n const currentMemberAssignment = safeAssignment.map(topic => ({\n topic,\n partitions: decodedAssignment[topic],\n }))\n\n // Check if the consumer is aware of all assigned partitions\n for (const assignment of currentMemberAssignment) {\n const { topic, partitions: assignedPartitions } = assignment\n const knownPartitions = this.partitionsPerSubscribedTopic.get(topic)\n const isAwareOfAllAssignedPartitions = assignedPartitions.every(partition =>\n knownPartitions.includes(partition)\n )\n\n if (!isAwareOfAllAssignedPartitions) {\n this.logger.warn('Consumer is not aware of all assigned partitions, refreshing metadata', {\n groupId,\n generationId,\n memberId,\n topic,\n knownPartitions,\n assignedPartitions,\n })\n\n // If the consumer is not aware of all assigned partitions, refresh metadata\n // and update the list of partitions per subscribed topic. It's enough to perform\n // this operation once since refresh metadata will update metadata for all topics\n await this.cluster.refreshMetadata()\n this.partitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n break\n }\n }\n\n this.topics = currentMemberAssignment.map(({ topic }) => topic)\n this.subscriptionState.assign(currentMemberAssignment)\n this.offsetManager = new OffsetManager({\n cluster: this.cluster,\n topicConfigurations: this.topicConfigurations,\n instrumentationEmitter: this.instrumentationEmitter,\n memberAssignment: currentMemberAssignment.reduce(\n (partitionsByTopic, { topic, partitions }) => ({\n ...partitionsByTopic,\n [topic]: partitions,\n }),\n {}\n ),\n autoCommit: this.autoCommit,\n autoCommitInterval: this.autoCommitInterval,\n autoCommitThreshold: this.autoCommitThreshold,\n coordinator,\n groupId,\n generationId,\n memberId,\n })\n }\n\n joinAndSync() {\n const startJoin = Date.now()\n return this.retrier(async bail => {\n try {\n await this[PRIVATE.JOIN]()\n await this[PRIVATE.SYNC]()\n\n const memberAssignment = this.assigned().reduce(\n (result, { topic, partitions }) => ({ ...result, [topic]: partitions }),\n {}\n )\n\n const payload = {\n groupId: this.groupId,\n memberId: this.memberId,\n leaderId: this.leaderId,\n isLeader: this.isLeader(),\n memberAssignment,\n groupProtocol: this.groupProtocol,\n duration: Date.now() - startJoin,\n }\n\n this.instrumentationEmitter.emit(GROUP_JOIN, payload)\n this.logger.info('Consumer has joined the group', payload)\n } catch (e) {\n if (isRebalancing(e)) {\n // Rebalance in progress isn't a retriable protocol error since the consumer\n // has to go through find coordinator and join again before it can\n // actually retry the operation. We wrap the original error in a retriable error\n // here instead in order to restart the join + sync sequence using the retrier.\n throw new KafkaJSError(e)\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {import(\"../../types\").TopicPartition} topicPartition\n */\n resetOffset({ topic, partition }) {\n this.offsetManager.resetOffset({ topic, partition })\n }\n\n /**\n * @param {import(\"../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n resolveOffset({ topic, partition, offset }) {\n this.offsetManager.resolveOffset({ topic, partition, offset })\n }\n\n /**\n * Update the consumer offset for the given topic/partition. This will be used\n * on the next fetch. If this API is invoked for the same topic/partition more\n * than once, the latest offset will be used on the next fetch.\n *\n * @param {import(\"../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n seek({ topic, partition, offset }) {\n this.seekOffset.set(topic, partition, offset)\n }\n\n pause(topicPartitions) {\n this.logger.info(`Pausing fetching from ${topicPartitions.length} topics`, {\n topicPartitions,\n })\n this.subscriptionState.pause(topicPartitions)\n }\n\n resume(topicPartitions) {\n this.logger.info(`Resuming fetching from ${topicPartitions.length} topics`, {\n topicPartitions,\n })\n this.subscriptionState.resume(topicPartitions)\n }\n\n assigned() {\n return this.subscriptionState.assigned()\n }\n\n paused() {\n return this.subscriptionState.paused()\n }\n\n async commitOffsetsIfNecessary() {\n await this.offsetManager.commitOffsetsIfNecessary()\n }\n\n async commitOffsets(offsets) {\n await this.offsetManager.commitOffsets(offsets)\n }\n\n uncommittedOffsets() {\n return this.offsetManager.uncommittedOffsets()\n }\n\n async heartbeat({ interval }) {\n return this[PRIVATE.SHAREDHEARTBEAT]({ interval })\n }\n\n async fetch() {\n try {\n const { topics, maxBytesPerPartition, maxWaitTime, minBytes, maxBytes } = this\n /** @type {{[nodeId: string]: {topic: string, partitions: { partition: number; fetchOffset: string; maxBytes: number }[]}[]}} */\n const requestsPerNode = {}\n\n await this.cluster.refreshMetadataIfNecessary()\n this.checkForStaleAssignment()\n\n while (this.seekOffset.size > 0) {\n const seekEntry = this.seekOffset.pop()\n this.logger.debug('Seek offset', {\n groupId: this.groupId,\n memberId: this.memberId,\n seek: seekEntry,\n })\n await this.offsetManager.seek(seekEntry)\n }\n\n const pausedTopicPartitions = this.subscriptionState.paused()\n const activeTopicPartitions = this.subscriptionState.active()\n\n const activePartitions = flatten(activeTopicPartitions.map(({ partitions }) => partitions))\n const activeTopics = activeTopicPartitions\n .filter(({ partitions }) => partitions.length > 0)\n .map(({ topic }) => topic)\n\n if (activePartitions.length === 0) {\n this.logger.debug(`No active topic partitions, sleeping for ${this.maxWaitTime}ms`, {\n topics,\n activeTopicPartitions,\n pausedTopicPartitions,\n })\n\n await sleep(this.maxWaitTime)\n return BufferedAsyncIterator([])\n }\n\n await this.offsetManager.resolveOffsets()\n\n this.logger.debug(\n `Fetching from ${activePartitions.length} partitions for ${activeTopics.length} out of ${topics.length} topics`,\n {\n topics,\n activeTopicPartitions,\n pausedTopicPartitions,\n }\n )\n\n for (const topicPartition of activeTopicPartitions) {\n const partitionsPerNode = this.findReadReplicaForPartitions(\n topicPartition.topic,\n topicPartition.partitions\n )\n\n const nodeIds = keys(partitionsPerNode)\n const committedOffsets = this.offsetManager.committedOffsets()\n\n for (const nodeId of nodeIds) {\n const partitions = partitionsPerNode[nodeId]\n .filter(partition => {\n /**\n * When recovering from OffsetOutOfRange, each partition can recover\n * concurrently, which invalidates resolved and committed offsets as part\n * of the recovery mechanism (see OffsetManager.clearOffsets). In concurrent\n * scenarios this can initiate a new fetch with invalid offsets.\n *\n * This was further highlighted by https://github.com/tulios/kafkajs/pull/570,\n * which increased concurrency, making this more likely to happen.\n *\n * This is solved by only making requests for partitions with initialized offsets.\n *\n * See the following pull request which explains the context of the problem:\n * @issue https://github.com/tulios/kafkajs/pull/578\n */\n return committedOffsets[topicPartition.topic][partition] != null\n })\n .map(partition => ({\n partition,\n fetchOffset: this.offsetManager\n .nextOffset(topicPartition.topic, partition)\n .toString(),\n maxBytes: maxBytesPerPartition,\n }))\n\n requestsPerNode[nodeId] = requestsPerNode[nodeId] || []\n requestsPerNode[nodeId].push({ topic: topicPartition.topic, partitions })\n }\n }\n\n const requests = keys(requestsPerNode).map(async nodeId => {\n const broker = await this.cluster.findBroker({ nodeId })\n const { responses } = await broker.fetch({\n maxWaitTime,\n minBytes,\n maxBytes,\n isolationLevel: this.isolationLevel,\n topics: requestsPerNode[nodeId],\n rackId: this.rackId,\n })\n\n const batchesPerPartition = responses.map(({ topicName, partitions }) => {\n const topicRequestData = requestsPerNode[nodeId].find(({ topic }) => topic === topicName)\n let preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[topicName]\n if (!preferredReadReplicas) {\n this.preferredReadReplicasPerTopicPartition[topicName] = preferredReadReplicas = {}\n }\n\n return partitions\n .filter(\n partitionData =>\n !this.seekOffset.has(topicName, partitionData.partition) &&\n !this.subscriptionState.isPaused(topicName, partitionData.partition)\n )\n .map(partitionData => {\n const { partition, preferredReadReplica } = partitionData\n if (preferredReadReplica != null && preferredReadReplica !== -1) {\n const { nodeId: currentPreferredReadReplica } =\n preferredReadReplicas[partition] || {}\n if (currentPreferredReadReplica !== preferredReadReplica) {\n this.logger.info(`Preferred read replica is now ${preferredReadReplica}`, {\n groupId: this.groupId,\n memberId: this.memberId,\n topic: topicName,\n partition,\n })\n }\n preferredReadReplicas[partition] = {\n nodeId: preferredReadReplica,\n expireAt: Date.now() + this.metadataMaxAge,\n }\n }\n\n const partitionRequestData = topicRequestData.partitions.find(\n ({ partition }) => partition === partitionData.partition\n )\n\n const fetchedOffset = partitionRequestData.fetchOffset\n return new Batch(topicName, fetchedOffset, partitionData)\n })\n })\n\n return flatten(batchesPerPartition)\n })\n\n // fetch can generate empty requests when the consumer group receives an assignment\n // with more topics than the subscribed, so to prevent a busy loop we wait the\n // configured max wait time\n if (requests.length === 0) {\n await sleep(this.maxWaitTime)\n return BufferedAsyncIterator([])\n }\n\n return BufferedAsyncIterator(requests, e => this.recoverFromFetch(e))\n } catch (e) {\n await this.recoverFromFetch(e)\n }\n }\n\n async recoverFromFetch(e) {\n if (STALE_METADATA_ERRORS.includes(e.type) || e.name === 'KafkaJSTopicMetadataNotLoaded') {\n this.logger.debug('Stale cluster metadata, refreshing...', {\n groupId: this.groupId,\n memberId: this.memberId,\n error: e.message,\n })\n\n await this.cluster.refreshMetadata()\n await this.joinAndSync()\n throw new KafkaJSError(e.message)\n }\n\n if (e.name === 'KafkaJSStaleTopicMetadataAssignment') {\n this.logger.warn(`${e.message}, resync group`, {\n groupId: this.groupId,\n memberId: this.memberId,\n topic: e.topic,\n unknownPartitions: e.unknownPartitions,\n })\n\n await this.joinAndSync()\n }\n\n if (e.name === 'KafkaJSOffsetOutOfRange') {\n await this.recoverFromOffsetOutOfRange(e)\n }\n\n if (e.name === 'KafkaJSConnectionClosedError') {\n this.cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n if (e.name === 'KafkaJSBrokerNotFound' || e.name === 'KafkaJSConnectionClosedError') {\n this.logger.debug(`${e.message}, refreshing metadata and retrying...`)\n await this.cluster.refreshMetadata()\n }\n\n throw e\n }\n\n async recoverFromOffsetOutOfRange(e) {\n // If we are fetching from a follower try with the leader before resetting offsets\n const preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[e.topic]\n if (preferredReadReplicas && typeof preferredReadReplicas[e.partition] === 'number') {\n this.logger.info('Offset out of range while fetching from follower, retrying with leader', {\n topic: e.topic,\n partition: e.partition,\n groupId: this.groupId,\n memberId: this.memberId,\n })\n delete preferredReadReplicas[e.partition]\n } else {\n this.logger.error('Offset out of range, resetting to default offset', {\n topic: e.topic,\n partition: e.partition,\n groupId: this.groupId,\n memberId: this.memberId,\n })\n\n await this.offsetManager.setDefaultOffset({\n topic: e.topic,\n partition: e.partition,\n })\n }\n }\n\n generatePartitionsPerSubscribedTopic() {\n const map = new Map()\n\n for (const topic of this.topicsSubscribed) {\n const partitions = this.cluster\n .findTopicPartitionMetadata(topic)\n .map(m => m.partitionId)\n .sort()\n\n map.set(topic, partitions)\n }\n\n return map\n }\n\n checkForStaleAssignment() {\n if (!this.partitionsPerSubscribedTopic) {\n return\n }\n\n const newPartitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n\n for (const [topic, partitions] of newPartitionsPerSubscribedTopic) {\n const diff = arrayDiff(partitions, this.partitionsPerSubscribedTopic.get(topic))\n\n if (diff.length > 0) {\n throw new KafkaJSStaleTopicMetadataAssignment('Topic has been updated', {\n topic,\n unknownPartitions: diff,\n })\n }\n }\n }\n\n hasSeekOffset({ topic, partition }) {\n return this.seekOffset.has(topic, partition)\n }\n\n /**\n * For each of the partitions find the best nodeId to read it from\n *\n * @param {string} topic\n * @param {number[]} partitions\n * @returns {{[nodeId: number]: number[]}} per-node assignment of partitions\n * @see Cluster~findLeaderForPartitions\n */\n // Invariant: The resulting object has each partition referenced exactly once\n findReadReplicaForPartitions(topic, partitions) {\n const partitionMetadata = this.cluster.findTopicPartitionMetadata(topic)\n const preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[topic]\n return partitions.reduce((result, id) => {\n const partitionId = parseInt(id, 10)\n const metadata = partitionMetadata.find(p => p.partitionId === partitionId)\n if (!metadata) {\n return result\n }\n\n if (metadata.leader == null) {\n throw new KafkaJSError('Invalid partition metadata', { topic, partitionId, metadata })\n }\n\n // Pick the preferred replica if there is one, and it isn't known to be offline, otherwise the leader.\n let nodeId = metadata.leader\n if (preferredReadReplicas) {\n const { nodeId: preferredReadReplica, expireAt } = preferredReadReplicas[partitionId] || {}\n if (Date.now() >= expireAt) {\n this.logger.debug('Preferred read replica information has expired, using leader', {\n topic,\n partitionId,\n groupId: this.groupId,\n memberId: this.memberId,\n preferredReadReplica,\n leader: metadata.leader,\n })\n // Drop the entry\n delete preferredReadReplicas[partitionId]\n } else if (preferredReadReplica != null) {\n // Valid entry, check whether it is not offline\n // Note that we don't delete the preference here, and rather hope that eventually that replica comes online again\n const offlineReplicas = metadata.offlineReplicas\n if (Array.isArray(offlineReplicas) && offlineReplicas.includes(nodeId)) {\n this.logger.debug('Preferred read replica is offline, using leader', {\n topic,\n partitionId,\n groupId: this.groupId,\n memberId: this.memberId,\n preferredReadReplica,\n leader: metadata.leader,\n })\n } else {\n nodeId = preferredReadReplica\n }\n }\n }\n const current = result[nodeId] || []\n return { ...result, [nodeId]: [...current, partitionId] }\n }, {})\n }\n}\n","const Long = require('../utils/long')\nconst ABORTED_MESSAGE_KEY = Buffer.from([0, 0, 0, 0])\n\nconst isAbortMarker = ({ key }) => {\n // Handle null/undefined keys.\n if (!key) return false\n // Cast key to buffer defensively\n return Buffer.from(key).equals(ABORTED_MESSAGE_KEY)\n}\n\n/**\n * Remove messages marked as aborted according to the aborted transactions list.\n *\n * Start of an aborted transaction is determined by message offset.\n * End of an aborted transaction is determined by control messages.\n * @param {Message[]} messages\n * @param {Transaction[]} [abortedTransactions]\n * @returns {Message[]} Messages which did not participate in an aborted transaction\n *\n * @typedef {object} Message\n * @param {Buffer} key\n * @param {lastOffset} key Int64\n * @param {RecordBatch} batchContext\n *\n * @typedef {object} Transaction\n * @param {string} firstOffset Int64\n * @param {string} producerId Int64\n *\n * @typedef {object} RecordBatch\n * @param {string} producerId Int64\n * @param {boolean} inTransaction\n */\nmodule.exports = ({ messages, abortedTransactions }) => {\n const currentAbortedTransactions = new Map()\n\n if (!abortedTransactions || !abortedTransactions.length) {\n return messages\n }\n\n const remainingAbortedTransactions = [...abortedTransactions]\n\n return messages.filter(message => {\n // If the message offset is GTE the first offset of the next aborted transaction\n // then we have stepped into an aborted transaction.\n if (\n remainingAbortedTransactions.length &&\n Long.fromValue(message.offset).gte(remainingAbortedTransactions[0].firstOffset)\n ) {\n const { producerId } = remainingAbortedTransactions.shift()\n currentAbortedTransactions.set(producerId, true)\n }\n\n const { producerId, inTransaction } = message.batchContext\n\n if (isAbortMarker(message)) {\n // Transaction is over, we no longer need to ignore messages from this producer\n currentAbortedTransactions.delete(producerId)\n } else if (currentAbortedTransactions.has(producerId) && inTransaction) {\n return false\n }\n\n return true\n })\n}\n","const Long = require('../utils/long')\nconst createRetry = require('../retry')\nconst { initialRetryTime } = require('../retry/defaults')\nconst ConsumerGroup = require('./consumerGroup')\nconst Runner = require('./runner')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst { KafkaJSNonRetriableError } = require('../errors')\nconst { roundRobin } = require('./assigners')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\nconst ISOLATION_LEVEL = require('../protocol/isolationLevel')\n\nconst { keys, values } = Object\nconst { CONNECT, DISCONNECT, STOP, CRASH } = events\n\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `consumer.events.${key}`)\n .join(', ')\n\nconst specialOffsets = [\n Long.fromValue(EARLIEST_OFFSET).toString(),\n Long.fromValue(LATEST_OFFSET).toString(),\n]\n\n/**\n * @param {Object} params\n * @param {import(\"../../types\").Cluster} params.cluster\n * @param {String} params.groupId\n * @param {import('../../types').RetryOptions} [params.retry]\n * @param {import('../../types').Logger} params.logger\n * @param {import('../../types').PartitionAssigner[]} [params.partitionAssigners]\n * @param {number} [params.sessionTimeout]\n * @param {number} [params.rebalanceTimeout]\n * @param {number} [params.heartbeatInterval]\n * @param {number} [params.maxBytesPerPartition]\n * @param {number} [params.minBytes]\n * @param {number} [params.maxBytes]\n * @param {number} [params.maxWaitTimeInMs]\n * @param {number} [params.isolationLevel]\n * @param {string} [params.rackId]\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n * @param {number} params.metadataMaxAge\n *\n * @returns {import(\"../../types\").Consumer}\n */\nmodule.exports = ({\n cluster,\n groupId,\n retry,\n logger: rootLogger,\n partitionAssigners = [roundRobin],\n sessionTimeout = 30000,\n rebalanceTimeout = 60000,\n heartbeatInterval = 3000,\n maxBytesPerPartition = 1048576, // 1MB\n minBytes = 1,\n maxBytes = 10485760, // 10MB\n maxWaitTimeInMs = 5000,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n rackId = '',\n instrumentationEmitter: rootInstrumentationEmitter,\n metadataMaxAge,\n}) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError('Consumer groupId must be a non-empty string.')\n }\n\n const logger = rootLogger.namespace('Consumer')\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n const assigners = partitionAssigners.map(createAssigner =>\n createAssigner({ groupId, logger, cluster })\n )\n\n const topics = {}\n let runner = null\n let consumerGroup = null\n\n if (heartbeatInterval >= sessionTimeout) {\n throw new KafkaJSNonRetriableError(\n `Consumer heartbeatInterval (${heartbeatInterval}) must be lower than sessionTimeout (${sessionTimeout}). It is recommended to set heartbeatInterval to approximately a third of the sessionTimeout.`\n )\n }\n\n const createConsumerGroup = ({ autoCommit, autoCommitInterval, autoCommitThreshold }) => {\n return new ConsumerGroup({\n logger: rootLogger,\n topics: keys(topics),\n topicConfigurations: topics,\n retry,\n cluster,\n groupId,\n assigners,\n sessionTimeout,\n rebalanceTimeout,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n instrumentationEmitter,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n isolationLevel,\n rackId,\n metadataMaxAge,\n })\n }\n\n const createRunner = ({\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n onCrash,\n autoCommit,\n partitionsConsumedConcurrently,\n }) => {\n return new Runner({\n autoCommit,\n logger: rootLogger,\n consumerGroup,\n instrumentationEmitter,\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n heartbeatInterval,\n retry,\n onCrash,\n partitionsConsumedConcurrently,\n })\n }\n\n /** @type {import(\"../../types\").Consumer[\"connect\"]} */\n const connect = async () => {\n await cluster.connect()\n instrumentationEmitter.emit(CONNECT)\n }\n\n /** @type {import(\"../../types\").Consumer[\"disconnect\"]} */\n const disconnect = async () => {\n try {\n await stop()\n logger.debug('consumer has stopped, disconnecting', { groupId })\n await cluster.disconnect()\n instrumentationEmitter.emit(DISCONNECT)\n } catch (e) {\n logger.error(`Caught error when disconnecting the consumer: ${e.message}`, {\n stack: e.stack,\n groupId,\n })\n throw e\n }\n }\n\n /** @type {import(\"../../types\").Consumer[\"stop\"]} */\n const stop = async () => {\n try {\n if (runner) {\n await runner.stop()\n runner = null\n consumerGroup = null\n instrumentationEmitter.emit(STOP)\n }\n\n logger.info('Stopped', { groupId })\n } catch (e) {\n logger.error(`Caught error when stopping the consumer: ${e.message}`, {\n stack: e.stack,\n groupId,\n })\n\n throw e\n }\n }\n\n /** @type {import(\"../../types\").Consumer[\"subscribe\"]} */\n const subscribe = async ({ topic, fromBeginning = false }) => {\n if (consumerGroup) {\n throw new KafkaJSNonRetriableError('Cannot subscribe to topic while consumer is running')\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const isRegExp = topic instanceof RegExp\n if (typeof topic !== 'string' && !isRegExp) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${topic} (${typeof topic}), the topic name has to be a String or a RegExp`\n )\n }\n\n const topicsToSubscribe = []\n if (isRegExp) {\n const topicRegExp = topic\n const metadata = await cluster.metadata()\n const matchedTopics = metadata.topicMetadata\n .map(({ topic: topicName }) => topicName)\n .filter(topicName => topicRegExp.test(topicName))\n\n logger.debug('Subscription based on RegExp', {\n groupId,\n topicRegExp: topicRegExp.toString(),\n matchedTopics,\n })\n\n topicsToSubscribe.push(...matchedTopics)\n } else {\n topicsToSubscribe.push(topic)\n }\n\n for (const t of topicsToSubscribe) {\n topics[t] = { fromBeginning }\n }\n\n await cluster.addMultipleTargetTopics(topicsToSubscribe)\n }\n\n /** @type {import(\"../../types\").Consumer[\"run\"]} */\n const run = async ({\n autoCommit = true,\n autoCommitInterval = null,\n autoCommitThreshold = null,\n eachBatchAutoResolve = true,\n partitionsConsumedConcurrently = 1,\n eachBatch = null,\n eachMessage = null,\n } = {}) => {\n if (consumerGroup) {\n logger.warn('consumer#run was called, but the consumer is already running', { groupId })\n return\n }\n\n consumerGroup = createConsumerGroup({\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n })\n\n const start = async onCrash => {\n logger.info('Starting', { groupId })\n runner = createRunner({\n autoCommit,\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n onCrash,\n partitionsConsumedConcurrently,\n })\n\n await runner.start()\n }\n\n const restart = onCrash => {\n consumerGroup = createConsumerGroup({\n autoCommitInterval,\n autoCommitThreshold,\n })\n\n start(onCrash)\n }\n\n const onCrash = async e => {\n logger.error(`Crash: ${e.name}: ${e.message}`, {\n groupId,\n retryCount: e.retryCount,\n stack: e.stack,\n })\n\n if (e.name === 'KafkaJSConnectionClosedError') {\n cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n await disconnect()\n\n const isErrorRetriable = e.name === 'KafkaJSNumberOfRetriesExceeded' || e.retriable === true\n const shouldRestart =\n isErrorRetriable &&\n (!retry ||\n !retry.restartOnFailure ||\n (await retry.restartOnFailure(e).catch(error => {\n logger.error(\n 'Caught error when invoking user-provided \"restartOnFailure\" callback. Defaulting to restarting.',\n {\n error: error.message || error,\n originalError: e.message || e,\n groupId,\n }\n )\n\n return true\n })))\n\n instrumentationEmitter.emit(CRASH, {\n error: e,\n groupId,\n restart: shouldRestart,\n })\n\n if (shouldRestart) {\n const retryTime = e.retryTime || (retry && retry.initialRetryTime) || initialRetryTime\n logger.error(`Restarting the consumer in ${retryTime}ms`, {\n retryCount: e.retryCount,\n retryTime,\n groupId,\n })\n\n setTimeout(() => restart(onCrash), retryTime)\n }\n }\n\n await start(onCrash)\n }\n\n /** @type {import(\"../../types\").Consumer[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"commitOffsets\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partition: 0, offset: '1', metadata: 'event-id-3' }]\n */\n const commitOffsets = async (topicPartitions = []) => {\n const commitsByTopic = topicPartitions.reduce(\n (payload, { topic, partition, offset, metadata = null }) => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (isNaN(partition)) {\n throw new KafkaJSNonRetriableError(\n `Invalid partition, expected a number received ${partition}`\n )\n }\n\n let commitOffset\n try {\n commitOffset = Long.fromValue(offset)\n } catch (_) {\n throw new KafkaJSNonRetriableError(`Invalid offset, expected a long received ${offset}`)\n }\n\n if (commitOffset.lessThan(0)) {\n throw new KafkaJSNonRetriableError('Offset must not be a negative number')\n }\n\n if (metadata !== null && typeof metadata !== 'string') {\n throw new KafkaJSNonRetriableError(\n `Invalid offset metadata, expected string or null, received ${metadata}`\n )\n }\n\n const topicCommits = payload[topic] || []\n\n topicCommits.push({ partition, offset: commitOffset, metadata })\n\n return { ...payload, [topic]: topicCommits }\n },\n {}\n )\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n const topics = Object.keys(commitsByTopic)\n\n return runner.commitOffsets({\n topics: topics.map(topic => {\n return {\n topic,\n partitions: commitsByTopic[topic],\n }\n }),\n })\n }\n\n /** @type {import(\"../../types\").Consumer[\"seek\"]} */\n const seek = ({ topic, partition, offset }) => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (isNaN(partition)) {\n throw new KafkaJSNonRetriableError(\n `Invalid partition, expected a number received ${partition}`\n )\n }\n\n let seekOffset\n try {\n seekOffset = Long.fromValue(offset)\n } catch (_) {\n throw new KafkaJSNonRetriableError(`Invalid offset, expected a long received ${offset}`)\n }\n\n if (seekOffset.lessThan(0) && !specialOffsets.includes(seekOffset.toString())) {\n throw new KafkaJSNonRetriableError('Offset must not be a negative number')\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.seek({ topic, partition, offset: seekOffset.toString() })\n }\n\n /** @type {import(\"../../types\").Consumer[\"describeGroup\"]} */\n const describeGroup = async () => {\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n const retrier = createRetry(retry)\n return retrier(async () => {\n const { groups } = await coordinator.describeGroups({ groupIds: [groupId] })\n return groups.find(group => group.groupId === groupId)\n })\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"pause\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n const pause = (topicPartitions = []) => {\n for (const topicPartition of topicPartitions) {\n if (!topicPartition || !topicPartition.topic) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${(topicPartition && topicPartition.topic) || topicPartition}`\n )\n } else if (\n typeof topicPartition.partitions !== 'undefined' &&\n (!Array.isArray(topicPartition.partitions) || topicPartition.partitions.some(isNaN))\n ) {\n throw new KafkaJSNonRetriableError(\n `Array of valid partitions required to pause specific partitions instead of ${topicPartition.partitions}`\n )\n }\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.pause(topicPartitions)\n }\n\n /**\n * Returns the list of topic partitions paused on this consumer\n *\n * @type {import(\"../../types\").Consumer[\"paused\"]}\n */\n const paused = () => {\n if (!consumerGroup) {\n return []\n }\n\n return consumerGroup.paused()\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"resume\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n const resume = (topicPartitions = []) => {\n for (const topicPartition of topicPartitions) {\n if (!topicPartition || !topicPartition.topic) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${(topicPartition && topicPartition.topic) || topicPartition}`\n )\n } else if (\n typeof topicPartition.partitions !== 'undefined' &&\n (!Array.isArray(topicPartition.partitions) || topicPartition.partitions.some(isNaN))\n ) {\n throw new KafkaJSNonRetriableError(\n `Array of valid partitions required to resume specific partitions instead of ${topicPartition.partitions}`\n )\n }\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.resume(topicPartitions)\n }\n\n /**\n * @return {Object} logger\n */\n const getLogger = () => logger\n\n return {\n connect,\n disconnect,\n subscribe,\n stop,\n run,\n commitOffsets,\n seek,\n describeGroup,\n pause,\n paused,\n resume,\n on,\n events,\n logger: getLogger,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst networkEvents = require('../network/instrumentationEvents')\nconst consumerType = InstrumentationEventType('consumer')\n\nconst events = {\n HEARTBEAT: consumerType('heartbeat'),\n COMMIT_OFFSETS: consumerType('commit_offsets'),\n GROUP_JOIN: consumerType('group_join'),\n FETCH: consumerType('fetch'),\n FETCH_START: consumerType('fetch_start'),\n START_BATCH_PROCESS: consumerType('start_batch_process'),\n END_BATCH_PROCESS: consumerType('end_batch_process'),\n CONNECT: consumerType('connect'),\n DISCONNECT: consumerType('disconnect'),\n STOP: consumerType('stop'),\n CRASH: consumerType('crash'),\n REBALANCING: consumerType('rebalancing'),\n RECEIVED_UNSUBSCRIBED_TOPICS: consumerType('received_unsubscribed_topics'),\n REQUEST: consumerType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: consumerType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: consumerType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const Long = require('../../utils/long')\nconst flatten = require('../../utils/flatten')\nconst isInvalidOffset = require('./isInvalidOffset')\nconst initializeConsumerOffsets = require('./initializeConsumerOffsets')\nconst {\n events: { COMMIT_OFFSETS },\n} = require('../instrumentationEvents')\n\nconst { keys, assign } = Object\nconst indexTopics = topics => topics.reduce((obj, topic) => assign(obj, { [topic]: {} }), {})\n\nconst PRIVATE = {\n COMMITTED_OFFSETS: Symbol('private:OffsetManager:committedOffsets'),\n}\nmodule.exports = class OffsetManager {\n /**\n * @param {Object} options\n * @param {import(\"../../../types\").Cluster} options.cluster\n * @param {import(\"../../../types\").Broker} options.coordinator\n * @param {import(\"../../../types\").IMemberAssignment} options.memberAssignment\n * @param {boolean} options.autoCommit\n * @param {number | null} options.autoCommitInterval\n * @param {number | null} options.autoCommitThreshold\n * @param {{[topic: string]: { fromBeginning: boolean }}} options.topicConfigurations\n * @param {import(\"../../instrumentation/emitter\")} options.instrumentationEmitter\n * @param {string} options.groupId\n * @param {number} options.generationId\n * @param {string} options.memberId\n */\n constructor({\n cluster,\n coordinator,\n memberAssignment,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n topicConfigurations,\n instrumentationEmitter,\n groupId,\n generationId,\n memberId,\n }) {\n this.cluster = cluster\n this.coordinator = coordinator\n\n // memberAssignment format:\n // {\n // 'topic1': [0, 1, 2, 3],\n // 'topic2': [0, 1, 2, 3, 4, 5],\n // }\n this.memberAssignment = memberAssignment\n\n this.topicConfigurations = topicConfigurations\n this.instrumentationEmitter = instrumentationEmitter\n this.groupId = groupId\n this.generationId = generationId\n this.memberId = memberId\n\n this.autoCommit = autoCommit\n this.autoCommitInterval = autoCommitInterval\n this.autoCommitThreshold = autoCommitThreshold\n this.lastCommit = Date.now()\n\n this.topics = keys(memberAssignment)\n this.clearAllOffsets()\n }\n\n /**\n * @param {string} topic\n * @param {number} partition\n * @returns {Long}\n */\n nextOffset(topic, partition) {\n if (!this.resolvedOffsets[topic][partition]) {\n this.resolvedOffsets[topic][partition] = this.committedOffsets()[topic][partition]\n }\n\n let offset = this.resolvedOffsets[topic][partition]\n if (isInvalidOffset(offset)) {\n offset = '0'\n }\n\n return Long.fromValue(offset)\n }\n\n /**\n * @returns {Promise}\n */\n async getCoordinator() {\n if (!this.coordinator.isConnected()) {\n this.coordinator = await this.cluster.findBroker(this.coordinator)\n }\n\n return this.coordinator\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n resetOffset({ topic, partition }) {\n this.resolvedOffsets[topic][partition] = this.committedOffsets()[topic][partition]\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n resolveOffset({ topic, partition, offset }) {\n this.resolvedOffsets[topic][partition] = Long.fromValue(offset)\n .add(1)\n .toString()\n }\n\n /**\n * @returns {Long}\n */\n countResolvedOffsets() {\n const committedOffsets = this.committedOffsets()\n\n const subtractOffsets = (resolvedOffset, committedOffset) => {\n const resolvedOffsetLong = Long.fromValue(resolvedOffset)\n return isInvalidOffset(committedOffset)\n ? resolvedOffsetLong\n : resolvedOffsetLong.subtract(Long.fromValue(committedOffset))\n }\n\n const subtractPartitionOffsets = (resolvedTopicOffsets, committedTopicOffsets) =>\n keys(resolvedTopicOffsets).map(partition =>\n subtractOffsets(resolvedTopicOffsets[partition], committedTopicOffsets[partition])\n )\n\n const subtractTopicOffsets = topic =>\n subtractPartitionOffsets(this.resolvedOffsets[topic], committedOffsets[topic])\n\n const offsetsDiff = this.topics.map(subtractTopicOffsets)\n return flatten(offsetsDiff).reduce((sum, offset) => sum.add(offset), Long.fromValue(0))\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n async setDefaultOffset({ topic, partition }) {\n const { groupId, generationId, memberId } = this\n const defaultOffset = this.cluster.defaultOffset(this.topicConfigurations[topic])\n const coordinator = await this.getCoordinator()\n\n await coordinator.offsetCommit({\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics: [\n {\n topic,\n partitions: [{ partition, offset: defaultOffset }],\n },\n ],\n })\n\n this.clearOffsets({ topic, partition })\n }\n\n /**\n * Commit the given offset to the topic/partition. If the consumer isn't assigned to the given\n * topic/partition this method will be a NO-OP.\n *\n * @param {import(\"../../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n async seek({ topic, partition, offset }) {\n if (!this.memberAssignment[topic] || !this.memberAssignment[topic].includes(partition)) {\n return\n }\n\n if (!this.autoCommit) {\n this.resolveOffset({\n topic,\n partition,\n offset: Long.fromValue(offset)\n .subtract(1)\n .toString(),\n })\n return\n }\n\n const { groupId, generationId, memberId } = this\n const coordinator = await this.getCoordinator()\n\n await coordinator.offsetCommit({\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics: [\n {\n topic,\n partitions: [{ partition, offset }],\n },\n ],\n })\n\n this.clearOffsets({ topic, partition })\n }\n\n async commitOffsetsIfNecessary() {\n const now = Date.now()\n\n const timeoutReached =\n this.autoCommitInterval != null && now >= this.lastCommit + this.autoCommitInterval\n\n const thresholdReached =\n this.autoCommitThreshold != null &&\n this.countResolvedOffsets().gte(Long.fromValue(this.autoCommitThreshold))\n\n if (timeoutReached || thresholdReached) {\n return this.commitOffsets()\n }\n }\n\n /**\n * Return all locally resolved offsets which are not marked as committed, by topic-partition.\n * @returns {OffsetsByTopicPartition}\n *\n * @typedef {Object} OffsetsByTopicPartition\n * @property {TopicOffsets[]} topics\n *\n * @typedef {Object} TopicOffsets\n * @property {PartitionOffset[]} partitions\n *\n * @typedef {Object} PartitionOffset\n * @property {string} partition\n * @property {string} offset\n */\n uncommittedOffsets() {\n const offsets = topic => keys(this.resolvedOffsets[topic])\n const emptyPartitions = ({ partitions }) => partitions.length > 0\n const toPartitions = topic => partition => ({\n partition,\n offset: this.resolvedOffsets[topic][partition],\n })\n const changedOffsets = topic => ({ partition, offset }) => {\n return (\n offset !== this.committedOffsets()[topic][partition] &&\n Long.fromValue(offset).greaterThanOrEqual(0)\n )\n }\n\n // Select and format updated partitions\n const topicsWithPartitionsToCommit = this.topics\n .map(topic => ({\n topic,\n partitions: offsets(topic)\n .map(toPartitions(topic))\n .filter(changedOffsets(topic)),\n }))\n .filter(emptyPartitions)\n\n return { topics: topicsWithPartitionsToCommit }\n }\n\n async commitOffsets(offsets = {}) {\n const { groupId, generationId, memberId } = this\n const { topics = this.uncommittedOffsets().topics } = offsets\n\n if (topics.length === 0) {\n this.lastCommit = Date.now()\n return\n }\n\n const payload = {\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics,\n }\n\n try {\n const coordinator = await this.getCoordinator()\n await coordinator.offsetCommit(payload)\n this.instrumentationEmitter.emit(COMMIT_OFFSETS, payload)\n\n // Update local reference of committed offsets\n topics.forEach(({ topic, partitions }) => {\n const updatedOffsets = partitions.reduce(\n (obj, { partition, offset }) => assign(obj, { [partition]: offset }),\n {}\n )\n\n this[PRIVATE.COMMITTED_OFFSETS][topic] = assign(\n {},\n this.committedOffsets()[topic],\n updatedOffsets\n )\n })\n\n this.lastCommit = Date.now()\n } catch (e) {\n // metadata is stale, the coordinator has changed due to a restart or\n // broker reassignment\n if (e.type === 'NOT_COORDINATOR_FOR_GROUP') {\n await this.cluster.refreshMetadata()\n }\n\n throw e\n }\n }\n\n async resolveOffsets() {\n const { groupId } = this\n const invalidOffset = topic => partition => {\n return isInvalidOffset(this.committedOffsets()[topic][partition])\n }\n\n const pendingPartitions = this.topics\n .map(topic => ({\n topic,\n partitions: this.memberAssignment[topic]\n .filter(invalidOffset(topic))\n .map(partition => ({ partition })),\n }))\n .filter(t => t.partitions.length > 0)\n\n if (pendingPartitions.length === 0) {\n return\n }\n\n const coordinator = await this.getCoordinator()\n const { responses: consumerOffsets } = await coordinator.offsetFetch({\n groupId,\n topics: pendingPartitions,\n })\n\n const unresolvedPartitions = consumerOffsets.map(({ topic, partitions }) =>\n assign(\n {\n topic,\n partitions: partitions\n .filter(({ offset }) => isInvalidOffset(offset))\n .map(({ partition }) => assign({ partition })),\n },\n this.topicConfigurations[topic]\n )\n )\n\n const indexPartitions = (obj, { partition, offset }) => {\n return assign(obj, { [partition]: offset })\n }\n\n const hasUnresolvedPartitions = () => unresolvedPartitions.some(t => t.partitions.length > 0)\n\n let offsets = consumerOffsets\n if (hasUnresolvedPartitions()) {\n const topicOffsets = await this.cluster.fetchTopicsOffset(unresolvedPartitions)\n offsets = initializeConsumerOffsets(consumerOffsets, topicOffsets)\n }\n\n offsets.forEach(({ topic, partitions }) => {\n this.committedOffsets()[topic] = partitions.reduce(indexPartitions, {\n ...this.committedOffsets()[topic],\n })\n })\n }\n\n /**\n * @private\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n clearOffsets({ topic, partition }) {\n delete this.committedOffsets()[topic][partition]\n delete this.resolvedOffsets[topic][partition]\n }\n\n /**\n * @private\n */\n clearAllOffsets() {\n const committedOffsets = this.committedOffsets()\n\n for (const topic in committedOffsets) {\n delete committedOffsets[topic]\n }\n\n for (const topic of this.topics) {\n committedOffsets[topic] = {}\n }\n\n this.resolvedOffsets = indexTopics(this.topics)\n }\n\n committedOffsets() {\n if (!this[PRIVATE.COMMITTED_OFFSETS]) {\n this[PRIVATE.COMMITTED_OFFSETS] = this.groupId\n ? this.cluster.committedOffsets({ groupId: this.groupId })\n : {}\n }\n\n return this[PRIVATE.COMMITTED_OFFSETS]\n }\n}\n","const isInvalidOffset = require('./isInvalidOffset')\nconst { keys, assign } = Object\n\nconst indexPartitions = (obj, { partition, offset }) => assign(obj, { [partition]: offset })\nconst indexTopics = (obj, { topic, partitions }) =>\n assign(obj, { [topic]: partitions.reduce(indexPartitions, {}) })\n\nmodule.exports = (consumerOffsets, topicOffsets) => {\n const indexedConsumerOffsets = consumerOffsets.reduce(indexTopics, {})\n const indexedTopicOffsets = topicOffsets.reduce(indexTopics, {})\n\n return keys(indexedConsumerOffsets).map(topic => {\n const partitions = indexedConsumerOffsets[topic]\n return {\n topic,\n partitions: keys(partitions).map(partition => {\n const offset = partitions[partition]\n const resolvedOffset = isInvalidOffset(offset)\n ? indexedTopicOffsets[topic][partition]\n : offset\n\n return { partition: Number(partition), offset: resolvedOffset }\n }),\n }\n })\n}\n","const Long = require('../../utils/long')\n\nmodule.exports = offset => (!offset && offset !== 0) || Long.fromValue(offset).isNegative()\n","const { EventEmitter } = require('events')\nconst Long = require('../utils/long')\nconst createRetry = require('../retry')\nconst limitConcurrency = require('../utils/concurrency')\nconst { KafkaJSError } = require('../errors')\nconst barrier = require('./barrier')\n\nconst {\n events: { FETCH, FETCH_START, START_BATCH_PROCESS, END_BATCH_PROCESS, REBALANCING },\n} = require('./instrumentationEvents')\n\nconst isRebalancing = e =>\n e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP'\n\nconst isKafkaJSError = e => e instanceof KafkaJSError\nconst isSameOffset = (offsetA, offsetB) => Long.fromValue(offsetA).equals(Long.fromValue(offsetB))\nconst CONSUMING_START = 'consuming-start'\nconst CONSUMING_STOP = 'consuming-stop'\n\nmodule.exports = class Runner extends EventEmitter {\n /**\n * @param {object} options\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"./consumerGroup\")} options.consumerGroup\n * @param {import(\"../instrumentation/emitter\")} options.instrumentationEmitter\n * @param {boolean} [options.eachBatchAutoResolve=true]\n * @param {number} [options.partitionsConsumedConcurrently]\n * @param {(payload: import(\"../../types\").EachBatchPayload) => Promise} options.eachBatch\n * @param {(payload: import(\"../../types\").EachMessagePayload) => Promise} options.eachMessage\n * @param {number} [options.heartbeatInterval]\n * @param {(reason: Error) => void} options.onCrash\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {boolean} [options.autoCommit=true]\n */\n constructor({\n logger,\n consumerGroup,\n instrumentationEmitter,\n eachBatchAutoResolve = true,\n partitionsConsumedConcurrently,\n eachBatch,\n eachMessage,\n heartbeatInterval,\n onCrash,\n retry,\n autoCommit = true,\n }) {\n super()\n this.logger = logger.namespace('Runner')\n this.consumerGroup = consumerGroup\n this.instrumentationEmitter = instrumentationEmitter\n this.eachBatchAutoResolve = eachBatchAutoResolve\n this.eachBatch = eachBatch\n this.eachMessage = eachMessage\n this.heartbeatInterval = heartbeatInterval\n this.retrier = createRetry(Object.assign({}, retry))\n this.onCrash = onCrash\n this.autoCommit = autoCommit\n this.partitionsConsumedConcurrently = partitionsConsumedConcurrently\n\n this.running = false\n this.consuming = false\n }\n\n get consuming() {\n return this._consuming\n }\n\n set consuming(value) {\n if (this._consuming !== value) {\n this._consuming = value\n this.emit(value ? CONSUMING_START : CONSUMING_STOP)\n }\n }\n\n async join() {\n await this.consumerGroup.joinAndSync()\n this.running = true\n }\n\n async scheduleJoin() {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n return\n }\n\n return this.join().catch(this.onCrash)\n }\n\n async start() {\n if (this.running) {\n return\n }\n\n try {\n await this.consumerGroup.connect()\n await this.join()\n\n this.running = true\n this.scheduleFetch()\n } catch (e) {\n this.onCrash(e)\n }\n }\n\n async stop() {\n if (!this.running) {\n return\n }\n\n this.logger.debug('stop consumer group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n this.running = false\n\n try {\n await this.waitForConsumer()\n await this.consumerGroup.leave()\n } catch (e) {}\n }\n\n waitForConsumer() {\n return new Promise(resolve => {\n if (!this.consuming) {\n return resolve()\n }\n\n this.logger.debug('waiting for consumer to finish...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n this.once(CONSUMING_STOP, () => resolve())\n })\n }\n\n async processEachMessage(batch) {\n const { topic, partition } = batch\n\n for (const message of batch.messages) {\n if (!this.running || this.consumerGroup.hasSeekOffset({ topic, partition })) {\n break\n }\n\n try {\n await this.eachMessage({\n topic,\n partition,\n message,\n heartbeat: async () => {\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n },\n })\n } catch (e) {\n if (!isKafkaJSError(e)) {\n this.logger.error(`Error when calling eachMessage`, {\n topic,\n partition,\n offset: message.offset,\n stack: e.stack,\n error: e,\n })\n }\n\n // In case of errors, commit the previously consumed offsets unless autoCommit is disabled\n await this.autoCommitOffsets()\n throw e\n }\n\n this.consumerGroup.resolveOffset({ topic, partition, offset: message.offset })\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n await this.autoCommitOffsetsIfNecessary()\n }\n }\n\n async processEachBatch(batch) {\n const { topic, partition } = batch\n const lastFilteredMessage = batch.messages[batch.messages.length - 1]\n\n try {\n await this.eachBatch({\n batch,\n resolveOffset: offset => {\n /**\n * The transactional producer generates a control record after committing the transaction.\n * The control record is the last record on the RecordBatch, and it is filtered before it\n * reaches the eachBatch callback. When disabling auto-resolve, the user-land code won't\n * be able to resolve the control record offset, since it never reaches the callback,\n * causing stuck consumers as the consumer will never move the offset marker.\n *\n * When the last offset of the batch is resolved, we should automatically resolve\n * the control record offset as this entry doesn't have any meaning to the user-land code,\n * and won't interfere with the stream processing.\n *\n * @see https://github.com/apache/kafka/blob/9aa660786e46c1efbf5605a6a69136a1dac6edb9/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L1499-L1505\n */\n const offsetToResolve =\n lastFilteredMessage && isSameOffset(offset, lastFilteredMessage.offset)\n ? batch.lastOffset()\n : offset\n\n this.consumerGroup.resolveOffset({ topic, partition, offset: offsetToResolve })\n },\n heartbeat: async () => {\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n },\n /**\n * Commit offsets if provided. Otherwise commit most recent resolved offsets\n * if the autoCommit conditions are met.\n *\n * @param {OffsetsByTopicPartition} [offsets] Optional.\n */\n commitOffsetsIfNecessary: async offsets => {\n return offsets\n ? this.consumerGroup.commitOffsets(offsets)\n : this.consumerGroup.commitOffsetsIfNecessary()\n },\n uncommittedOffsets: () => this.consumerGroup.uncommittedOffsets(),\n isRunning: () => this.running,\n isStale: () => this.consumerGroup.hasSeekOffset({ topic, partition }),\n })\n } catch (e) {\n if (!isKafkaJSError(e)) {\n this.logger.error(`Error when calling eachBatch`, {\n topic,\n partition,\n offset: batch.firstOffset(),\n stack: e.stack,\n error: e,\n })\n }\n\n // eachBatch has a special resolveOffset which can be used\n // to keep track of the messages\n await this.autoCommitOffsets()\n throw e\n }\n\n // resolveOffset for the last offset can be disabled to allow the users of eachBatch to\n // stop their consumers without resolving unprocessed offsets (issues/18)\n if (this.eachBatchAutoResolve) {\n this.consumerGroup.resolveOffset({ topic, partition, offset: batch.lastOffset() })\n }\n }\n\n async fetch() {\n const startFetch = Date.now()\n\n this.instrumentationEmitter.emit(FETCH_START, {})\n\n const iterator = await this.consumerGroup.fetch()\n\n this.instrumentationEmitter.emit(FETCH, {\n /**\n * PR #570 removed support for the number of batches in this instrumentation event;\n * The new implementation uses an async generation to deliver the batches, which makes\n * this number impossible to get. The number is set to 0 to keep the event backward\n * compatible until we bump KafkaJS to version 2, following the end of node 8 LTS.\n *\n * @since 2019-11-29\n */\n numberOfBatches: 0,\n duration: Date.now() - startFetch,\n })\n\n const onBatch = async batch => {\n const startBatchProcess = Date.now()\n const payload = {\n topic: batch.topic,\n partition: batch.partition,\n highWatermark: batch.highWatermark,\n offsetLag: batch.offsetLag(),\n /**\n * @since 2019-06-24 (>= 1.8.0)\n *\n * offsetLag returns the lag based on the latest offset in the batch, to\n * keep the event backward compatible we just introduced \"offsetLagLow\"\n * which calculates the lag based on the first offset in the batch\n */\n offsetLagLow: batch.offsetLagLow(),\n batchSize: batch.messages.length,\n firstOffset: batch.firstOffset(),\n lastOffset: batch.lastOffset(),\n }\n\n /**\n * If the batch contained only control records or only aborted messages then we still\n * need to resolve and auto-commit to ensure the consumer can move forward.\n *\n * We also need to emit batch instrumentation events to allow any listeners keeping\n * track of offsets to know about the latest point of consumption.\n *\n * Added in #1256\n *\n * @see https://github.com/apache/kafka/blob/9aa660786e46c1efbf5605a6a69136a1dac6edb9/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L1499-L1505\n */\n if (batch.isEmptyDueToFiltering()) {\n this.instrumentationEmitter.emit(START_BATCH_PROCESS, payload)\n\n this.consumerGroup.resolveOffset({\n topic: batch.topic,\n partition: batch.partition,\n offset: batch.lastOffset(),\n })\n await this.autoCommitOffsetsIfNecessary()\n\n this.instrumentationEmitter.emit(END_BATCH_PROCESS, {\n ...payload,\n duration: Date.now() - startBatchProcess,\n })\n return\n }\n\n if (batch.isEmpty()) {\n return\n }\n\n this.instrumentationEmitter.emit(START_BATCH_PROCESS, payload)\n\n if (this.eachMessage) {\n await this.processEachMessage(batch)\n } else if (this.eachBatch) {\n await this.processEachBatch(batch)\n }\n\n this.instrumentationEmitter.emit(END_BATCH_PROCESS, {\n ...payload,\n duration: Date.now() - startBatchProcess,\n })\n\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n }\n\n const { lock, unlock, unlockWithError } = barrier()\n const concurrently = limitConcurrency({ limit: this.partitionsConsumedConcurrently })\n\n let requestsCompleted = false\n let numberOfExecutions = 0\n let expectedNumberOfExecutions = 0\n const enqueuedTasks = []\n\n while (true) {\n const result = iterator.next()\n\n if (result.done) {\n break\n }\n\n if (!this.running) {\n result.value.catch(error => {\n this.logger.debug('Ignoring error in fetch request while stopping runner', {\n error: error.message || error,\n stack: error.stack,\n })\n })\n\n continue\n }\n\n enqueuedTasks.push(async () => {\n const batches = await result.value\n expectedNumberOfExecutions += batches.length\n\n batches.map(batch =>\n concurrently(async () => {\n try {\n if (!this.running) {\n return\n }\n\n await onBatch(batch)\n } catch (e) {\n unlockWithError(e)\n } finally {\n numberOfExecutions++\n if (requestsCompleted && numberOfExecutions === expectedNumberOfExecutions) {\n unlock()\n }\n }\n }).catch(unlockWithError)\n )\n })\n }\n\n await Promise.all(enqueuedTasks.map(fn => fn()))\n requestsCompleted = true\n\n if (expectedNumberOfExecutions === numberOfExecutions) {\n unlock()\n }\n\n const error = await lock\n if (error) {\n throw error\n }\n\n await this.autoCommitOffsets()\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n }\n\n async scheduleFetch() {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n this.consuming = true\n await this.fetch()\n this.consuming = false\n\n if (this.running) {\n setImmediate(() => this.scheduleFetch())\n }\n } catch (e) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n error: e.message,\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n return\n }\n\n if (isRebalancing(e)) {\n this.logger.warn('The group is rebalancing, re-joining', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.instrumentationEmitter.emit(REBALANCING, {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n await this.join()\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.type === 'UNKNOWN_MEMBER_ID') {\n this.logger.error('The coordinator is not aware of this member, re-joining the group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.consumerGroup.memberId = null\n await this.join()\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.name === 'KafkaJSOffsetOutOfRange') {\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.name === 'KafkaJSNotImplemented') {\n return bail(e)\n }\n\n this.logger.debug('Error while fetching data, trying again...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n stack: e.stack,\n retryCount,\n retryTime,\n })\n\n throw e\n } finally {\n this.consuming = false\n }\n }).catch(this.onCrash)\n }\n\n autoCommitOffsets() {\n if (this.autoCommit) {\n return this.consumerGroup.commitOffsets()\n }\n }\n\n autoCommitOffsetsIfNecessary() {\n if (this.autoCommit) {\n return this.consumerGroup.commitOffsetsIfNecessary()\n }\n }\n\n commitOffsets(offsets) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n offsets,\n })\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.consumerGroup.commitOffsets(offsets)\n } catch (e) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n error: e.message,\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n offsets,\n })\n return\n }\n\n if (isRebalancing(e)) {\n this.logger.warn('The group is rebalancing, re-joining', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.instrumentationEmitter.emit(REBALANCING, {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n setImmediate(() => this.scheduleJoin())\n\n bail(new KafkaJSError(e))\n }\n\n if (e.type === 'UNKNOWN_MEMBER_ID') {\n this.logger.error('The coordinator is not aware of this member, re-joining the group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.consumerGroup.memberId = null\n setImmediate(() => this.scheduleJoin())\n\n bail(new KafkaJSError(e))\n }\n\n if (e.name === 'KafkaJSNotImplemented') {\n return bail(e)\n }\n\n this.logger.debug('Error while committing offsets, trying again...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n stack: e.stack,\n retryCount,\n retryTime,\n offsets,\n })\n\n throw e\n }\n })\n }\n}\n","module.exports = class SeekOffsets extends Map {\n set(topic, partition, offset) {\n super.set([topic, partition], offset)\n }\n\n has(topic, partition) {\n return Array.from(this.keys()).some(([t, p]) => t === topic && p === partition)\n }\n\n pop() {\n if (this.size === 0) {\n return\n }\n\n const [key, offset] = this.entries().next().value\n this.delete(key)\n const [topic, partition] = key\n return { topic, partition, offset }\n }\n}\n","const createState = topic => ({\n topic,\n paused: new Set(),\n pauseAll: false,\n resumed: new Set(),\n})\n\nmodule.exports = class SubscriptionState {\n constructor() {\n this.assignedPartitionsByTopic = {}\n this.subscriptionStatesByTopic = {}\n }\n\n /**\n * Replace the current assignment with a new set of assignments\n *\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n assign(topicPartitions = []) {\n this.assignedPartitionsByTopic = topicPartitions.reduce(\n (assigned, { topic, partitions = [] }) => {\n return { ...assigned, [topic]: { topic, partitions } }\n },\n {}\n )\n }\n\n /**\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n pause(topicPartitions = []) {\n topicPartitions.forEach(({ topic, partitions }) => {\n const state = this.subscriptionStatesByTopic[topic] || createState(topic)\n\n if (typeof partitions === 'undefined') {\n state.paused.clear()\n state.resumed.clear()\n state.pauseAll = true\n } else if (Array.isArray(partitions)) {\n partitions.forEach(partition => {\n state.paused.add(partition)\n state.resumed.delete(partition)\n })\n state.pauseAll = false\n }\n\n this.subscriptionStatesByTopic[topic] = state\n })\n }\n\n /**\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n resume(topicPartitions = []) {\n topicPartitions.forEach(({ topic, partitions }) => {\n const state = this.subscriptionStatesByTopic[topic] || createState(topic)\n\n if (typeof partitions === 'undefined') {\n state.paused.clear()\n state.resumed.clear()\n state.pauseAll = false\n } else if (Array.isArray(partitions)) {\n partitions.forEach(partition => {\n state.paused.delete(partition)\n\n if (state.pauseAll) {\n state.resumed.add(partition)\n }\n })\n }\n\n this.subscriptionStatesByTopic[topic] = state\n })\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n assigned() {\n return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.sort(),\n }))\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n active() {\n return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.filter(partition => !this.isPaused(topic, partition)).sort(),\n }))\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n paused() {\n return Object.values(this.assignedPartitionsByTopic)\n .map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.filter(partition => this.isPaused(topic, partition)).sort(),\n }))\n .filter(({ partitions }) => partitions.length !== 0)\n }\n\n isPaused(topic, partition) {\n const state = this.subscriptionStatesByTopic[topic]\n\n if (!state) {\n return false\n }\n\n const partitionResumed = state.resumed.has(partition)\n const partitionPaused = state.paused.has(partition)\n\n return (state.pauseAll && !partitionResumed) || partitionPaused\n }\n}\n","module.exports = () => ({\n KAFKAJS_DEBUG_PROTOCOL_BUFFERS: process.env.KAFKAJS_DEBUG_PROTOCOL_BUFFERS,\n KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS: process.env.KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS,\n})\n","const pkgJson = require('../package.json')\nconst { bugs } = pkgJson\n\nclass KafkaJSError extends Error {\n constructor(e, { retriable = true } = {}) {\n super(e)\n Error.captureStackTrace(this, this.constructor)\n this.message = e.message || e\n this.name = 'KafkaJSError'\n this.retriable = retriable\n this.helpUrl = e.helpUrl\n }\n}\n\nclass KafkaJSNonRetriableError extends KafkaJSError {\n constructor(e) {\n super(e, { retriable: false })\n this.name = 'KafkaJSNonRetriableError'\n this.originalError = e\n }\n}\n\nclass KafkaJSProtocolError extends KafkaJSError {\n constructor(e, { retriable = e.retriable } = {}) {\n super(e, { retriable })\n this.type = e.type\n this.code = e.code\n this.name = 'KafkaJSProtocolError'\n }\n}\n\nclass KafkaJSOffsetOutOfRange extends KafkaJSProtocolError {\n constructor(e, { topic, partition }) {\n super(e)\n this.topic = topic\n this.partition = partition\n this.name = 'KafkaJSOffsetOutOfRange'\n }\n}\n\nclass KafkaJSMemberIdRequired extends KafkaJSProtocolError {\n constructor(e, { memberId }) {\n super(e)\n this.memberId = memberId\n this.name = 'KafkaJSMemberIdRequired'\n }\n}\n\nclass KafkaJSNumberOfRetriesExceeded extends KafkaJSNonRetriableError {\n constructor(e, { retryCount, retryTime }) {\n super(e)\n this.stack = `${this.name}\\n Caused by: ${e.stack}`\n this.originalError = e\n this.retryCount = retryCount\n this.retryTime = retryTime\n this.name = 'KafkaJSNumberOfRetriesExceeded'\n }\n}\n\nclass KafkaJSConnectionError extends KafkaJSError {\n constructor(e, { broker, code } = {}) {\n super(e)\n this.broker = broker\n this.code = code\n this.name = 'KafkaJSConnectionError'\n }\n}\n\nclass KafkaJSConnectionClosedError extends KafkaJSConnectionError {\n constructor(e, { host, port } = {}) {\n super(e, { broker: `${host}:${port}` })\n this.host = host\n this.port = port\n this.name = 'KafkaJSConnectionClosedError'\n }\n}\n\nclass KafkaJSRequestTimeoutError extends KafkaJSError {\n constructor(e, { broker, correlationId, createdAt, sentAt, pendingDuration } = {}) {\n super(e)\n this.broker = broker\n this.correlationId = correlationId\n this.createdAt = createdAt\n this.sentAt = sentAt\n this.pendingDuration = pendingDuration\n this.name = 'KafkaJSRequestTimeoutError'\n }\n}\n\nclass KafkaJSMetadataNotLoaded extends KafkaJSError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSMetadataNotLoaded'\n }\n}\nclass KafkaJSTopicMetadataNotLoaded extends KafkaJSMetadataNotLoaded {\n constructor(e, { topic } = {}) {\n super(e)\n this.topic = topic\n this.name = 'KafkaJSTopicMetadataNotLoaded'\n }\n}\nclass KafkaJSStaleTopicMetadataAssignment extends KafkaJSError {\n constructor(e, { topic, unknownPartitions } = {}) {\n super(e)\n this.topic = topic\n this.unknownPartitions = unknownPartitions\n this.name = 'KafkaJSStaleTopicMetadataAssignment'\n }\n}\n\nclass KafkaJSDeleteGroupsError extends KafkaJSError {\n constructor(e, groups = []) {\n super(e)\n this.groups = groups\n this.name = 'KafkaJSDeleteGroupsError'\n }\n}\n\nclass KafkaJSServerDoesNotSupportApiKey extends KafkaJSNonRetriableError {\n constructor(e, { apiKey, apiName } = {}) {\n super(e)\n this.apiKey = apiKey\n this.apiName = apiName\n this.name = 'KafkaJSServerDoesNotSupportApiKey'\n }\n}\n\nclass KafkaJSBrokerNotFound extends KafkaJSError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSBrokerNotFound'\n }\n}\n\nclass KafkaJSPartialMessageError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSPartialMessageError'\n }\n}\n\nclass KafkaJSSASLAuthenticationError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSSASLAuthenticationError'\n }\n}\n\nclass KafkaJSGroupCoordinatorNotFound extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSGroupCoordinatorNotFound'\n }\n}\n\nclass KafkaJSNotImplemented extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNotImplemented'\n }\n}\n\nclass KafkaJSTimeout extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSTimeout'\n }\n}\n\nclass KafkaJSLockTimeout extends KafkaJSTimeout {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSLockTimeout'\n }\n}\n\nclass KafkaJSUnsupportedMagicByteInMessageSet extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSUnsupportedMagicByteInMessageSet'\n }\n}\n\nclass KafkaJSDeleteTopicRecordsError extends KafkaJSError {\n constructor({ partitions }) {\n /*\n * This error is retriable if all the errors were retriable\n */\n const retriable = partitions\n .filter(({ error }) => error != null)\n .every(({ error }) => error.retriable === true)\n\n super('Error while deleting records', { retriable })\n this.name = 'KafkaJSDeleteTopicRecordsError'\n this.partitions = partitions\n }\n}\n\nconst issueUrl = bugs ? bugs.url : null\n\nclass KafkaJSInvariantViolation extends KafkaJSNonRetriableError {\n constructor(e) {\n const message = e.message || e\n super(`Invariant violated: ${message}. This is likely a bug and should be reported.`)\n this.name = 'KafkaJSInvariantViolation'\n\n if (issueUrl !== null) {\n const issueTitle = encodeURIComponent(`Invariant violation: ${message}`)\n this.helpUrl = `${issueUrl}/new?assignees=&labels=bug&template=bug_report.md&title=${issueTitle}`\n }\n }\n}\n\nclass KafkaJSInvalidVarIntError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNonRetriableError'\n }\n}\n\nclass KafkaJSInvalidLongError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNonRetriableError'\n }\n}\n\nclass KafkaJSCreateTopicError extends KafkaJSProtocolError {\n constructor(e, topicName) {\n super(e)\n this.topic = topicName\n this.name = 'KafkaJSCreateTopicError'\n }\n}\nclass KafkaJSAggregateError extends Error {\n constructor(message, errors) {\n super(message)\n this.errors = errors\n this.name = 'KafkaJSAggregateError'\n }\n}\n\nmodule.exports = {\n KafkaJSError,\n KafkaJSNonRetriableError,\n KafkaJSPartialMessageError,\n KafkaJSBrokerNotFound,\n KafkaJSProtocolError,\n KafkaJSConnectionError,\n KafkaJSConnectionClosedError,\n KafkaJSRequestTimeoutError,\n KafkaJSSASLAuthenticationError,\n KafkaJSNumberOfRetriesExceeded,\n KafkaJSOffsetOutOfRange,\n KafkaJSMemberIdRequired,\n KafkaJSGroupCoordinatorNotFound,\n KafkaJSNotImplemented,\n KafkaJSMetadataNotLoaded,\n KafkaJSTopicMetadataNotLoaded,\n KafkaJSStaleTopicMetadataAssignment,\n KafkaJSDeleteGroupsError,\n KafkaJSTimeout,\n KafkaJSLockTimeout,\n KafkaJSServerDoesNotSupportApiKey,\n KafkaJSUnsupportedMagicByteInMessageSet,\n KafkaJSDeleteTopicRecordsError,\n KafkaJSInvariantViolation,\n KafkaJSInvalidVarIntError,\n KafkaJSInvalidLongError,\n KafkaJSCreateTopicError,\n KafkaJSAggregateError,\n}\n","const {\n createLogger,\n LEVELS: { INFO },\n} = require('./loggers')\n\nconst InstrumentationEventEmitter = require('./instrumentation/emitter')\nconst LoggerConsole = require('./loggers/console')\nconst Cluster = require('./cluster')\nconst createProducer = require('./producer')\nconst createConsumer = require('./consumer')\nconst createAdmin = require('./admin')\nconst ISOLATION_LEVEL = require('./protocol/isolationLevel')\nconst defaultSocketFactory = require('./network/socketFactory')\n\nconst PRIVATE = {\n CREATE_CLUSTER: Symbol('private:Kafka:createCluster'),\n CLUSTER_RETRY: Symbol('private:Kafka:clusterRetry'),\n LOGGER: Symbol('private:Kafka:logger'),\n OFFSETS: Symbol('private:Kafka:offsets'),\n}\n\nconst DEFAULT_METADATA_MAX_AGE = 300000\n\nmodule.exports = class Client {\n /**\n * @param {Object} options\n * @param {Array} options.brokers example: ['127.0.0.1:9092', '127.0.0.1:9094']\n * @param {Object} options.ssl\n * @param {Object} options.sasl\n * @param {string} options.clientId\n * @param {number} options.connectionTimeout - in milliseconds\n * @param {number} options.authenticationTimeout - in milliseconds\n * @param {number} options.reauthenticationThreshold - in milliseconds\n * @param {number} [options.requestTimeout=30000] - in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {import(\"../types\").RetryOptions} [options.retry]\n * @param {import(\"../types\").ISocketFactory} [options.socketFactory]\n */\n constructor({\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout,\n enforceRequestTimeout = false,\n retry,\n socketFactory = defaultSocketFactory(),\n logLevel = INFO,\n logCreator = LoggerConsole,\n }) {\n this[PRIVATE.OFFSETS] = new Map()\n this[PRIVATE.LOGGER] = createLogger({ level: logLevel, logCreator })\n this[PRIVATE.CLUSTER_RETRY] = retry\n this[PRIVATE.CREATE_CLUSTER] = ({\n metadataMaxAge,\n allowAutoTopicCreation = true,\n maxInFlightRequests = null,\n instrumentationEmitter = null,\n isolationLevel,\n }) =>\n new Cluster({\n logger: this[PRIVATE.LOGGER],\n retry: this[PRIVATE.CLUSTER_RETRY],\n offsets: this[PRIVATE.OFFSETS],\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout,\n enforceRequestTimeout,\n metadataMaxAge,\n instrumentationEmitter,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n })\n }\n\n /**\n * @public\n */\n producer({\n createPartitioner,\n retry,\n metadataMaxAge = DEFAULT_METADATA_MAX_AGE,\n allowAutoTopicCreation,\n idempotent,\n transactionalId,\n transactionTimeout,\n maxInFlightRequests,\n } = {}) {\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n metadataMaxAge,\n allowAutoTopicCreation,\n maxInFlightRequests,\n instrumentationEmitter,\n })\n\n return createProducer({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n cluster,\n createPartitioner,\n idempotent,\n transactionalId,\n transactionTimeout,\n instrumentationEmitter,\n })\n }\n\n /**\n * @public\n */\n consumer({\n groupId,\n partitionAssigners,\n metadataMaxAge = DEFAULT_METADATA_MAX_AGE,\n sessionTimeout,\n rebalanceTimeout,\n heartbeatInterval,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n retry = { retries: 5 },\n allowAutoTopicCreation,\n maxInFlightRequests,\n readUncommitted = false,\n rackId = '',\n } = {}) {\n const isolationLevel = readUncommitted\n ? ISOLATION_LEVEL.READ_UNCOMMITTED\n : ISOLATION_LEVEL.READ_COMMITTED\n\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n metadataMaxAge,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n instrumentationEmitter,\n })\n\n return createConsumer({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n cluster,\n groupId,\n partitionAssigners,\n sessionTimeout,\n rebalanceTimeout,\n heartbeatInterval,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n isolationLevel,\n instrumentationEmitter,\n rackId,\n metadataMaxAge,\n })\n }\n\n /**\n * @public\n */\n admin({ retry } = {}) {\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n allowAutoTopicCreation: false,\n instrumentationEmitter,\n })\n\n return createAdmin({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n instrumentationEmitter,\n cluster,\n })\n }\n\n /**\n * @public\n */\n logger() {\n return this[PRIVATE.LOGGER]\n }\n}\n","const { EventEmitter } = require('events')\nconst InstrumentationEvent = require('./event')\nconst { KafkaJSError } = require('../errors')\n\nmodule.exports = class InstrumentationEventEmitter {\n constructor() {\n this.emitter = new EventEmitter()\n }\n\n /**\n * @param {string} eventName\n * @param {Object} payload\n */\n emit(eventName, payload) {\n if (!eventName) {\n throw new KafkaJSError('Invalid event name', { retriable: false })\n }\n\n if (this.emitter.listenerCount(eventName) > 0) {\n const event = new InstrumentationEvent(eventName, payload)\n this.emitter.emit(eventName, event)\n }\n }\n\n /**\n * @param {string} eventName\n * @param {(...args: any[]) => void} listener\n * @returns {import(\"../../types\").RemoveInstrumentationEventListener} removeListener\n */\n addListener(eventName, listener) {\n this.emitter.addListener(eventName, listener)\n return () => this.emitter.removeListener(eventName, listener)\n }\n}\n","let id = 0\nconst nextId = () => {\n if (id === Number.MAX_VALUE) {\n id = 0\n }\n\n return id++\n}\n\nclass InstrumentationEvent {\n /**\n * @param {String} type\n * @param {Object} payload\n */\n constructor(type, payload) {\n this.id = nextId()\n this.type = type\n this.timestamp = Date.now()\n this.payload = payload\n }\n}\n\nmodule.exports = InstrumentationEvent\n","module.exports = namespace => type => `${namespace}.${type}`\n","const { LEVELS: logLevel } = require('./index')\n\nmodule.exports = () => ({ namespace, level, label, log }) => {\n const prefix = namespace ? `[${namespace}] ` : ''\n const message = JSON.stringify(\n Object.assign({ level: label }, log, {\n message: `${prefix}${log.message}`,\n })\n )\n\n switch (level) {\n case logLevel.INFO:\n return console.info(message)\n case logLevel.ERROR:\n return console.error(message)\n case logLevel.WARN:\n return console.warn(message)\n case logLevel.DEBUG:\n return console.log(message)\n }\n}\n","const { assign } = Object\n\nconst LEVELS = {\n NOTHING: 0,\n ERROR: 1,\n WARN: 2,\n INFO: 4,\n DEBUG: 5,\n}\n\nconst createLevel = (label, level, currentLevel, namespace, logFunction) => (\n message,\n extra = {}\n) => {\n if (level > currentLevel()) return\n logFunction({\n namespace,\n level,\n label,\n log: assign(\n {\n timestamp: new Date().toISOString(),\n logger: 'kafkajs',\n message,\n },\n extra\n ),\n })\n}\n\nconst evaluateLogLevel = logLevel => {\n const envLogLevel = (process.env.KAFKAJS_LOG_LEVEL || '').toUpperCase()\n return LEVELS[envLogLevel] == null ? logLevel : LEVELS[envLogLevel]\n}\n\nconst createLogger = ({ level = LEVELS.INFO, logCreator } = {}) => {\n let logLevel = evaluateLogLevel(level)\n const logFunction = logCreator(logLevel)\n\n const createNamespace = (namespace, logLevel = null) => {\n const namespaceLogLevel = evaluateLogLevel(logLevel)\n return createLogFunctions(namespace, namespaceLogLevel)\n }\n\n const createLogFunctions = (namespace, namespaceLogLevel = null) => {\n const currentLogLevel = () => (namespaceLogLevel == null ? logLevel : namespaceLogLevel)\n const logger = {\n info: createLevel('INFO', LEVELS.INFO, currentLogLevel, namespace, logFunction),\n error: createLevel('ERROR', LEVELS.ERROR, currentLogLevel, namespace, logFunction),\n warn: createLevel('WARN', LEVELS.WARN, currentLogLevel, namespace, logFunction),\n debug: createLevel('DEBUG', LEVELS.DEBUG, currentLogLevel, namespace, logFunction),\n }\n\n return assign(logger, {\n namespace: createNamespace,\n setLogLevel: newLevel => {\n logLevel = newLevel\n },\n })\n }\n\n return createLogFunctions()\n}\n\nmodule.exports = {\n LEVELS,\n createLogger,\n}\n","const createSocket = require('./socket')\nconst createRequest = require('../protocol/request')\nconst Decoder = require('../protocol/decoder')\nconst { KafkaJSConnectionError, KafkaJSConnectionClosedError } = require('../errors')\nconst { INT_32_MAX_VALUE } = require('../constants')\nconst getEnv = require('../env')\nconst RequestQueue = require('./requestQueue')\nconst { CONNECTION_STATUS, CONNECTED_STATUS } = require('./connectionStatus')\n\nconst requestInfo = ({ apiName, apiKey, apiVersion }) =>\n `${apiName}(key: ${apiKey}, version: ${apiVersion})`\n\nmodule.exports = class Connection {\n /**\n * @param {Object} options\n * @param {string} options.host\n * @param {number} options.port\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {string} [options.clientId='kafkajs']\n * @param {number} options.requestTimeout The maximum amount of time the client will wait for the response of a request,\n * in milliseconds\n * @param {string} [options.rack=null]\n * @param {Object} [options.ssl=null] Options for the TLS Secure Context. It accepts all options,\n * usually \"cert\", \"key\" and \"ca\". More information at\n * https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options\n * @param {Object} [options.sasl=null] Attributes used for SASL authentication. Options based on the\n * key \"mechanism\". Connection is not actively using the SASL attributes\n * but acting as a data object for this information\n * @param {number} [options.connectionTimeout=1000] The connection timeout, in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} [options.maxInFlightRequests=null] The maximum number of unacknowledged requests on a connection before\n * enqueuing\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n host,\n port,\n logger,\n socketFactory,\n requestTimeout,\n rack = null,\n ssl = null,\n sasl = null,\n clientId = 'kafkajs',\n connectionTimeout = 1000,\n enforceRequestTimeout = false,\n maxInFlightRequests = null,\n instrumentationEmitter = null,\n }) {\n this.host = host\n this.port = port\n this.rack = rack\n this.clientId = clientId\n this.broker = `${this.host}:${this.port}`\n this.logger = logger.namespace('Connection')\n\n this.socketFactory = socketFactory\n this.ssl = ssl\n this.sasl = sasl\n\n this.requestTimeout = requestTimeout\n this.connectionTimeout = connectionTimeout\n\n this.bytesBuffered = 0\n this.bytesNeeded = Decoder.int32Size()\n this.chunks = []\n\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTED\n this.correlationId = 0\n this.requestQueue = new RequestQueue({\n instrumentationEmitter,\n maxInFlightRequests,\n requestTimeout,\n enforceRequestTimeout,\n clientId,\n broker: this.broker,\n logger: logger.namespace('RequestQueue'),\n isConnected: () => this.connected,\n })\n\n this.authHandlers = null\n this.authExpectResponse = false\n\n const log = level => (message, extra = {}) => {\n const logFn = this.logger[level]\n logFn(message, { broker: this.broker, clientId, ...extra })\n }\n\n this.logDebug = log('debug')\n this.logError = log('error')\n\n const env = getEnv()\n this.shouldLogBuffers = env.KAFKAJS_DEBUG_PROTOCOL_BUFFERS === '1'\n this.shouldLogFetchBuffer =\n this.shouldLogBuffers && env.KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS === '1'\n }\n\n get connected() {\n return CONNECTED_STATUS.includes(this.connectionStatus)\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n connect() {\n return new Promise((resolve, reject) => {\n if (this.connected) {\n return resolve(true)\n }\n\n let timeoutId\n\n const onConnect = () => {\n clearTimeout(timeoutId)\n this.connectionStatus = CONNECTION_STATUS.CONNECTED\n this.requestQueue.scheduleRequestTimeoutCheck()\n resolve(true)\n }\n\n const onData = data => {\n this.processData(data)\n }\n\n const onEnd = async () => {\n clearTimeout(timeoutId)\n\n const wasConnected = this.connected\n\n if (this.authHandlers) {\n this.authHandlers.onError()\n } else if (wasConnected) {\n this.logDebug('Kafka server has closed connection')\n this.rejectRequests(\n new KafkaJSConnectionClosedError('Closed connection', {\n host: this.host,\n port: this.port,\n })\n )\n }\n\n await this.disconnect()\n }\n\n const onError = async e => {\n clearTimeout(timeoutId)\n\n const error = new KafkaJSConnectionError(`Connection error: ${e.message}`, {\n broker: `${this.host}:${this.port}`,\n code: e.code,\n })\n\n this.logError(error.message, { stack: e.stack })\n this.rejectRequests(error)\n await this.disconnect()\n\n reject(error)\n }\n\n const onTimeout = async () => {\n const error = new KafkaJSConnectionError('Connection timeout', {\n broker: `${this.host}:${this.port}`,\n })\n\n this.logError(error.message)\n this.rejectRequests(error)\n await this.disconnect()\n reject(error)\n }\n\n this.logDebug(`Connecting`, {\n ssl: !!this.ssl,\n sasl: !!this.sasl,\n })\n\n try {\n timeoutId = setTimeout(onTimeout, this.connectionTimeout)\n this.socket = createSocket({\n socketFactory: this.socketFactory,\n host: this.host,\n port: this.port,\n ssl: this.ssl,\n onConnect,\n onData,\n onEnd,\n onError,\n onTimeout,\n })\n } catch (e) {\n clearTimeout(timeoutId)\n reject(\n new KafkaJSConnectionError(`Failed to connect: ${e.message}`, {\n broker: `${this.host}:${this.port}`,\n })\n )\n }\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTING\n this.logDebug('disconnecting...')\n\n await this.requestQueue.waitForPendingRequests()\n this.requestQueue.destroy()\n\n if (this.socket) {\n this.socket.end()\n this.socket.unref()\n }\n\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTED\n this.logDebug('disconnected')\n return true\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n authenticate({ authExpectResponse = false, request, response }) {\n this.authExpectResponse = authExpectResponse\n\n /**\n * TODO: rewrite removing the async promise executor\n */\n\n /* eslint-disable no-async-promise-executor */\n return new Promise(async (resolve, reject) => {\n this.authHandlers = {\n onSuccess: rawData => {\n this.authHandlers = null\n this.authExpectResponse = false\n\n response\n .decode(rawData)\n .then(data => response.parse(data))\n .then(resolve)\n .catch(reject)\n },\n onError: () => {\n this.authHandlers = null\n this.authExpectResponse = false\n\n reject(\n new KafkaJSConnectionError('Connection closed by the server', {\n broker: `${this.host}:${this.port}`,\n })\n )\n },\n }\n\n try {\n const requestPayload = await request.encode()\n\n this.failIfNotConnected()\n this.socket.write(requestPayload.buffer, 'binary')\n } catch (e) {\n reject(e)\n }\n })\n }\n\n /**\n * @public\n * @param {object} protocol\n * @param {object} protocol.request It is defined by the protocol and consists of an object with \"apiKey\",\n * \"apiVersion\", \"apiName\" and an \"encode\" function. The encode function\n * must return an instance of Encoder\n *\n * @param {object} protocol.response It is defined by the protocol and consists of an object with two functions:\n * \"decode\" and \"parse\"\n *\n * @param {number} [protocol.requestTimeout=null] Override for the default requestTimeout\n * @param {boolean} [protocol.logResponseError=true] Whether to log errors\n * @returns {Promise} where data is the return of \"response#parse\"\n */\n async send({ request, response, requestTimeout = null, logResponseError = true }) {\n this.failIfNotConnected()\n\n const expectResponse = !request.expectResponse || request.expectResponse()\n const sendRequest = async () => {\n const { clientId } = this\n const correlationId = this.nextCorrelationId()\n\n const requestPayload = await createRequest({ request, correlationId, clientId })\n const { apiKey, apiName, apiVersion } = request\n this.logDebug(`Request ${requestInfo(request)}`, {\n correlationId,\n expectResponse,\n size: Buffer.byteLength(requestPayload.buffer),\n })\n\n return new Promise((resolve, reject) => {\n try {\n this.failIfNotConnected()\n const entry = { apiKey, apiName, apiVersion, correlationId, resolve, reject }\n\n this.requestQueue.push({\n entry,\n expectResponse,\n requestTimeout,\n sendRequest: () => {\n this.socket.write(requestPayload.buffer, 'binary')\n },\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n const { correlationId, size, entry, payload } = await sendRequest()\n\n if (!expectResponse) {\n return\n }\n\n try {\n const payloadDecoded = await response.decode(payload)\n\n /**\n * @see KIP-219\n * If the response indicates that the client-side needs to throttle, do that.\n */\n this.requestQueue.maybeThrottle(payloadDecoded.clientSideThrottleTime)\n\n const data = await response.parse(payloadDecoded)\n const isFetchApi = entry.apiName === 'Fetch'\n this.logDebug(`Response ${requestInfo(entry)}`, {\n correlationId,\n size,\n data: isFetchApi && !this.shouldLogFetchBuffer ? '[filtered]' : data,\n })\n\n return data\n } catch (e) {\n if (logResponseError) {\n this.logError(`Response ${requestInfo(entry)}`, {\n error: e.message,\n correlationId,\n size,\n })\n }\n\n const isBuffer = Buffer.isBuffer(payload)\n this.logDebug(`Response ${requestInfo(entry)}`, {\n error: e.message,\n correlationId,\n payload:\n isBuffer && !this.shouldLogBuffers ? { type: 'Buffer', data: '[filtered]' } : payload,\n })\n\n throw e\n }\n }\n\n /**\n * @private\n */\n failIfNotConnected() {\n if (!this.connected) {\n throw new KafkaJSConnectionError('Not connected', {\n broker: `${this.host}:${this.port}`,\n })\n }\n }\n\n /**\n * @private\n */\n nextCorrelationId() {\n if (this.correlationId >= INT_32_MAX_VALUE) {\n this.correlationId = 0\n }\n\n return this.correlationId++\n }\n\n /**\n * @private\n */\n processData(rawData) {\n if (this.authHandlers && !this.authExpectResponse) {\n return this.authHandlers.onSuccess(rawData)\n }\n\n // Accumulate the new chunk\n this.chunks.push(rawData)\n this.bytesBuffered += Buffer.byteLength(rawData)\n\n // Process data if there are enough bytes to read the expected response size,\n // otherwise keep buffering\n while (this.bytesNeeded <= this.bytesBuffered) {\n const buffer = this.chunks.length > 1 ? Buffer.concat(this.chunks) : this.chunks[0]\n const decoder = new Decoder(buffer)\n const expectedResponseSize = decoder.readInt32()\n\n // Return early if not enough bytes to read the full response\n if (!decoder.canReadBytes(expectedResponseSize)) {\n this.chunks = [buffer]\n this.bytesBuffered = Buffer.byteLength(buffer)\n this.bytesNeeded = Decoder.int32Size() + expectedResponseSize\n return\n }\n\n const response = new Decoder(decoder.readBytes(expectedResponseSize))\n\n // Reset the buffered chunks as the rest of the bytes\n const remainderBuffer = decoder.readAll()\n this.chunks = [remainderBuffer]\n this.bytesBuffered = Buffer.byteLength(remainderBuffer)\n this.bytesNeeded = Decoder.int32Size()\n\n if (this.authHandlers) {\n const rawResponseSize = Decoder.int32Size() + expectedResponseSize\n const rawResponseBuffer = buffer.slice(0, rawResponseSize)\n return this.authHandlers.onSuccess(rawResponseBuffer)\n }\n\n const correlationId = response.readInt32()\n const payload = response.readAll()\n\n this.requestQueue.fulfillRequest({\n size: expectedResponseSize,\n correlationId,\n payload,\n })\n }\n }\n\n /**\n * @private\n */\n rejectRequests(error) {\n this.requestQueue.rejectAll(error)\n }\n}\n","const CONNECTION_STATUS = {\n CONNECTED: 'connected',\n DISCONNECTING: 'disconnecting',\n DISCONNECTED: 'disconnected',\n}\n\nconst CONNECTED_STATUS = [CONNECTION_STATUS.CONNECTED, CONNECTION_STATUS.DISCONNECTING]\n\nmodule.exports = {\n CONNECTION_STATUS,\n CONNECTED_STATUS,\n}\n","const InstrumentationEventType = require('../instrumentation/eventType')\nconst eventType = InstrumentationEventType('network')\n\nmodule.exports = {\n NETWORK_REQUEST: eventType('request'),\n NETWORK_REQUEST_TIMEOUT: eventType('request_timeout'),\n NETWORK_REQUEST_QUEUE_SIZE: eventType('request_queue_size'),\n}\n","const { EventEmitter } = require('events')\nconst SocketRequest = require('./socketRequest')\nconst events = require('../instrumentationEvents')\nconst { KafkaJSInvariantViolation } = require('../../errors')\n\nconst PRIVATE = {\n EMIT_QUEUE_SIZE_EVENT: Symbol('private:RequestQueue:emitQueueSizeEvent'),\n EMIT_REQUEST_QUEUE_EMPTY: Symbol('private:RequestQueue:emitQueueEmpty'),\n}\n\nconst REQUEST_QUEUE_EMPTY = 'requestQueueEmpty'\n\nmodule.exports = class RequestQueue extends EventEmitter {\n /**\n * @param {Object} options\n * @param {number} options.maxInFlightRequests\n * @param {number} options.requestTimeout\n * @param {boolean} options.enforceRequestTimeout\n * @param {string} options.clientId\n * @param {string} options.broker\n * @param {import(\"../../../types\").Logger} options.logger\n * @param {import(\"../../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n * @param {() => boolean} [options.isConnected]\n */\n constructor({\n instrumentationEmitter = null,\n maxInFlightRequests,\n requestTimeout,\n enforceRequestTimeout,\n clientId,\n broker,\n logger,\n isConnected = () => true,\n }) {\n super()\n this.instrumentationEmitter = instrumentationEmitter\n this.maxInFlightRequests = maxInFlightRequests\n this.requestTimeout = requestTimeout\n this.enforceRequestTimeout = enforceRequestTimeout\n this.clientId = clientId\n this.broker = broker\n this.logger = logger\n this.isConnected = isConnected\n\n this.inflight = new Map()\n this.pending = []\n\n /**\n * Until when this request queue is throttled and shouldn't send requests\n *\n * The value represents the timestamp of the end of the throttling in ms-since-epoch. If the value\n * is smaller than the current timestamp no throttling is active.\n *\n * @type {number}\n */\n this.throttledUntil = -1\n\n /**\n * Timeout id if we have scheduled a check for pending requests due to client-side throttling\n *\n * @type {null|NodeJS.Timeout}\n */\n this.throttleCheckTimeoutId = null\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY] = () => {\n if (this.pending.length === 0 && this.inflight.size === 0) {\n this.emit(REQUEST_QUEUE_EMPTY)\n }\n }\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT] = () => {\n instrumentationEmitter &&\n instrumentationEmitter.emit(events.NETWORK_REQUEST_QUEUE_SIZE, {\n broker: this.broker,\n clientId: this.clientId,\n queueSize: this.pending.length,\n })\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n }\n }\n\n /**\n * @public\n */\n scheduleRequestTimeoutCheck() {\n if (this.enforceRequestTimeout) {\n this.destroy()\n\n this.requestTimeoutIntervalId = setInterval(() => {\n this.inflight.forEach(request => {\n if (Date.now() - request.sentAt > request.requestTimeout) {\n request.timeoutRequest()\n }\n })\n\n if (!this.isConnected()) {\n this.destroy()\n }\n }, Math.min(this.requestTimeout, 100))\n }\n }\n\n maybeThrottle(clientSideThrottleTime) {\n if (clientSideThrottleTime) {\n const minimumThrottledUntil = Date.now() + clientSideThrottleTime\n this.throttledUntil = Math.max(minimumThrottledUntil, this.throttledUntil)\n }\n }\n\n /**\n * @typedef {Object} PushedRequest\n * @property {import(\"./socketRequest\").RequestEntry} entry\n * @property {boolean} expectResponse\n * @property {Function} sendRequest\n * @property {number} [requestTimeout]\n *\n * @public\n * @param {PushedRequest} pushedRequest\n */\n push(pushedRequest) {\n const { correlationId } = pushedRequest.entry\n const defaultRequestTimeout = this.requestTimeout\n const customRequestTimeout = pushedRequest.requestTimeout\n\n // Some protocol requests have custom request timeouts (e.g JoinGroup, Fetch, etc). The custom\n // timeouts are influenced by user configurations, which can be lower than the default requestTimeout\n const requestTimeout = Math.max(defaultRequestTimeout, customRequestTimeout || 0)\n\n const socketRequest = new SocketRequest({\n entry: pushedRequest.entry,\n expectResponse: pushedRequest.expectResponse,\n broker: this.broker,\n clientId: this.clientId,\n instrumentationEmitter: this.instrumentationEmitter,\n requestTimeout,\n send: () => {\n if (this.inflight.has(correlationId)) {\n throw new KafkaJSInvariantViolation('Correlation id already exists')\n }\n this.inflight.set(correlationId, socketRequest)\n pushedRequest.sendRequest()\n },\n timeout: () => {\n this.inflight.delete(correlationId)\n this.checkPendingRequests()\n // Try to emit REQUEST_QUEUE_EMPTY. Otherwise, waitForPendingRequests may stuck forever\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n },\n })\n\n if (this.canSendSocketRequestImmediately()) {\n this.sendSocketRequest(socketRequest)\n return\n }\n\n this.pending.push(socketRequest)\n this.scheduleCheckPendingRequests()\n\n this.logger.debug(`Request enqueued`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId,\n })\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n /**\n * @param {SocketRequest} socketRequest\n */\n sendSocketRequest(socketRequest) {\n socketRequest.send()\n\n if (!socketRequest.expectResponse) {\n this.logger.debug(`Request does not expect a response, resolving immediately`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId: socketRequest.correlationId,\n })\n\n this.inflight.delete(socketRequest.correlationId)\n socketRequest.completed({ size: 0, payload: null })\n }\n }\n\n /**\n * @public\n * @param {object} response\n * @param {number} response.correlationId\n * @param {Buffer} response.payload\n * @param {number} response.size\n */\n fulfillRequest({ correlationId, payload, size }) {\n const socketRequest = this.inflight.get(correlationId)\n this.inflight.delete(correlationId)\n this.checkPendingRequests()\n\n if (socketRequest) {\n socketRequest.completed({ size, payload })\n } else {\n this.logger.warn(`Response without match`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId,\n })\n }\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n }\n\n /**\n * @public\n * @param {Error} error\n */\n rejectAll(error) {\n const requests = [...this.inflight.values(), ...this.pending]\n\n for (const socketRequest of requests) {\n socketRequest.rejected(error)\n this.inflight.delete(socketRequest.correlationId)\n }\n\n this.pending = []\n this.inflight.clear()\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n /**\n * @public\n */\n waitForPendingRequests() {\n return new Promise(resolve => {\n if (this.pending.length === 0 && this.inflight.size === 0) {\n return resolve()\n }\n\n this.logger.debug('Waiting for pending requests', {\n clientId: this.clientId,\n broker: this.broker,\n currentInflightRequests: this.inflight.size,\n currentPendingQueueSize: this.pending.length,\n })\n\n this.once(REQUEST_QUEUE_EMPTY, () => resolve())\n })\n }\n\n /**\n * @public\n */\n destroy() {\n clearInterval(this.requestTimeoutIntervalId)\n clearTimeout(this.throttleCheckTimeoutId)\n this.throttleCheckTimeoutId = null\n }\n\n canSendSocketRequestImmediately() {\n const shouldEnqueue =\n (this.maxInFlightRequests != null && this.inflight.size >= this.maxInFlightRequests) ||\n this.throttledUntil > Date.now()\n\n return !shouldEnqueue\n }\n\n /**\n * Check and process pending requests either now or in the future\n *\n * This function will send out as many pending requests as possible taking throttling and\n * in-flight limits into account.\n */\n checkPendingRequests() {\n while (this.pending.length > 0 && this.canSendSocketRequestImmediately()) {\n const pendingRequest = this.pending.shift() // first in first out\n this.sendSocketRequest(pendingRequest)\n\n this.logger.debug(`Consumed pending request`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId: pendingRequest.correlationId,\n pendingDuration: pendingRequest.pendingDuration,\n currentPendingQueueSize: this.pending.length,\n })\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n this.scheduleCheckPendingRequests()\n }\n\n /**\n * Ensure that pending requests will be checked in the future\n *\n * If there is a client-side throttling in place this will ensure that we will check\n * the pending request queue eventually.\n */\n scheduleCheckPendingRequests() {\n // If we're throttled: Schedule checkPendingRequests when the throttle\n // should be resolved. If there is already something scheduled we assume that that\n // will be fine, and potentially fix up a new timeout if needed at that time.\n // Note that if we're merely \"overloaded\" by having too many inflight requests\n // we will anyways check the queue when one of them gets fulfilled.\n const timeUntilUnthrottled = this.throttledUntil - Date.now()\n if (timeUntilUnthrottled > 0 && !this.throttleCheckTimeoutId) {\n this.throttleCheckTimeoutId = setTimeout(() => {\n this.throttleCheckTimeoutId = null\n this.checkPendingRequests()\n }, timeUntilUnthrottled)\n }\n }\n}\n","const { KafkaJSRequestTimeoutError, KafkaJSNonRetriableError } = require('../../errors')\nconst events = require('../instrumentationEvents')\n\nconst PRIVATE = {\n STATE: Symbol('private:SocketRequest:state'),\n EMIT_EVENT: Symbol('private:SocketRequest:emitEvent'),\n}\n\nconst REQUEST_STATE = {\n PENDING: Symbol('PENDING'),\n SENT: Symbol('SENT'),\n COMPLETED: Symbol('COMPLETED'),\n REJECTED: Symbol('REJECTED'),\n}\n\n/**\n * SocketRequest abstracts the life cycle of a socket request, making it easier to track\n * request durations and to have individual timeouts per request.\n *\n * @typedef {Object} SocketRequest\n * @property {number} createdAt\n * @property {number} sentAt\n * @property {number} pendingDuration\n * @property {number} duration\n * @property {number} requestTimeout\n * @property {string} broker\n * @property {string} clientId\n * @property {RequestEntry} entry\n * @property {boolean} expectResponse\n * @property {Function} send\n * @property {Function} timeout\n *\n * @typedef {Object} RequestEntry\n * @property {string} apiKey\n * @property {string} apiName\n * @property {number} apiVersion\n * @property {number} correlationId\n * @property {Function} resolve\n * @property {Function} reject\n */\nmodule.exports = class SocketRequest {\n /**\n * @param {Object} options\n * @param {number} options.requestTimeout\n * @param {string} options.broker - e.g: 127.0.0.1:9092\n * @param {string} options.clientId\n * @param {RequestEntry} options.entry\n * @param {boolean} options.expectResponse\n * @param {Function} options.send\n * @param {() => void} options.timeout\n * @param {import(\"../../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n requestTimeout,\n broker,\n clientId,\n entry,\n expectResponse,\n send,\n timeout,\n instrumentationEmitter = null,\n }) {\n this.createdAt = Date.now()\n this.requestTimeout = requestTimeout\n this.broker = broker\n this.clientId = clientId\n this.entry = entry\n this.correlationId = entry.correlationId\n this.expectResponse = expectResponse\n this.sendRequest = send\n this.timeoutHandler = timeout\n\n this.sentAt = null\n this.duration = null\n this.pendingDuration = null\n\n this[PRIVATE.STATE] = REQUEST_STATE.PENDING\n this[PRIVATE.EMIT_EVENT] = (eventName, payload) =>\n instrumentationEmitter && instrumentationEmitter.emit(eventName, payload)\n }\n\n send() {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.PENDING],\n next: REQUEST_STATE.SENT,\n })\n\n this.sendRequest()\n this.sentAt = Date.now()\n this.pendingDuration = this.sentAt - this.createdAt\n this[PRIVATE.STATE] = REQUEST_STATE.SENT\n }\n\n timeoutRequest() {\n const { apiName, apiKey, apiVersion } = this.entry\n const requestInfo = `${apiName}(key: ${apiKey}, version: ${apiVersion})`\n const eventData = {\n broker: this.broker,\n clientId: this.clientId,\n correlationId: this.correlationId,\n createdAt: this.createdAt,\n sentAt: this.sentAt,\n pendingDuration: this.pendingDuration,\n }\n\n this.timeoutHandler()\n this.rejected(new KafkaJSRequestTimeoutError(`Request ${requestInfo} timed out`, eventData))\n this[PRIVATE.EMIT_EVENT](events.NETWORK_REQUEST_TIMEOUT, {\n ...eventData,\n apiName,\n apiKey,\n apiVersion,\n })\n }\n\n completed({ size, payload }) {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.SENT],\n next: REQUEST_STATE.COMPLETED,\n })\n\n const { entry, correlationId, broker, clientId, createdAt, sentAt, pendingDuration } = this\n\n this[PRIVATE.STATE] = REQUEST_STATE.COMPLETED\n this.duration = Date.now() - this.sentAt\n entry.resolve({ correlationId, entry, size, payload })\n\n this[PRIVATE.EMIT_EVENT](events.NETWORK_REQUEST, {\n broker,\n clientId,\n correlationId,\n size,\n createdAt,\n sentAt,\n pendingDuration,\n duration: this.duration,\n apiName: entry.apiName,\n apiKey: entry.apiKey,\n apiVersion: entry.apiVersion,\n })\n }\n\n rejected(error) {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.PENDING, REQUEST_STATE.SENT],\n next: REQUEST_STATE.REJECTED,\n })\n\n this[PRIVATE.STATE] = REQUEST_STATE.REJECTED\n this.duration = Date.now() - this.sentAt\n this.entry.reject(error)\n }\n\n /**\n * @private\n */\n throwIfInvalidState({ accepted, next }) {\n if (accepted.includes(this[PRIVATE.STATE])) {\n return\n }\n\n const current = this[PRIVATE.STATE].toString()\n\n throw new KafkaJSNonRetriableError(\n `Invalid state, can't transition from ${current} to ${next.toString()}`\n )\n }\n}\n","/**\n * @param {Object} options\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {string} options.host\n * @param {number} options.port\n * @param {Object} options.ssl\n * @param {() => void} options.onConnect\n * @param {(data: Buffer) => void} options.onData\n * @param {() => void} options.onEnd\n * @param {(err: Error) => void} options.onError\n * @param {() => void} options.onTimeout\n */\nmodule.exports = ({\n socketFactory,\n host,\n port,\n ssl,\n onConnect,\n onData,\n onEnd,\n onError,\n onTimeout,\n}) => {\n const socket = socketFactory({ host, port, ssl, onConnect })\n\n socket.on('data', onData)\n socket.on('end', onEnd)\n socket.on('error', onError)\n socket.on('timeout', onTimeout)\n\n return socket\n}\n","const KEEP_ALIVE_DELAY = 60000 // in ms\n\n/**\n * @returns {import(\"../../types\").ISocketFactory}\n */\nmodule.exports = () => {\n const net = require('net')\n const tls = require('tls')\n\n return ({ host, port, ssl, onConnect }) => {\n const socket = ssl\n ? tls.connect(Object.assign({ host, port, servername: host }, ssl), onConnect)\n : net.connect({ host, port }, onConnect)\n\n socket.setKeepAlive(true, KEEP_ALIVE_DELAY)\n\n return socket\n }\n}\n","module.exports = topicDataForBroker => {\n return topicDataForBroker.map(\n ({ topic, partitions, messagesPerPartition, sequencePerPartition }) => ({\n topic,\n partitions: partitions.map(partition => ({\n partition,\n firstSequence: sequencePerPartition[partition],\n messages: messagesPerPartition[partition],\n })),\n })\n )\n}\n","const createRetry = require('../../retry')\nconst { KafkaJSNonRetriableError } = require('../../errors')\nconst COORDINATOR_TYPES = require('../../protocol/coordinatorTypes')\nconst createStateMachine = require('./transactionStateMachine')\nconst assert = require('assert')\n\nconst STATES = require('./transactionStates')\nconst NO_PRODUCER_ID = -1\nconst SEQUENCE_START = 0\nconst INT_32_MAX_VALUE = Math.pow(2, 32)\nconst INIT_PRODUCER_RETRIABLE_PROTOCOL_ERRORS = [\n 'NOT_COORDINATOR_FOR_GROUP',\n 'GROUP_COORDINATOR_NOT_AVAILABLE',\n 'GROUP_LOAD_IN_PROGRESS',\n /**\n * The producer might have crashed and never committed the transaction; retry the\n * request so Kafka can abort the current transaction\n * @see https://github.com/apache/kafka/blob/201da0542726472d954080d54bc585b111aaf86f/clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java#L1001-L1002\n */\n 'CONCURRENT_TRANSACTIONS',\n]\nconst COMMIT_RETRIABLE_PROTOCOL_ERRORS = [\n 'UNKNOWN_TOPIC_OR_PARTITION',\n 'COORDINATOR_LOAD_IN_PROGRESS',\n]\nconst COMMIT_STALE_COORDINATOR_PROTOCOL_ERRORS = ['COORDINATOR_NOT_AVAILABLE', 'NOT_COORDINATOR']\n\n/**\n * @typedef {Object} EosManager\n */\n\n/**\n * Manage behavior for an idempotent producer and transactions.\n *\n * @returns {EosManager}\n */\nmodule.exports = ({\n logger,\n cluster,\n transactionTimeout = 60000,\n transactional,\n transactionalId,\n}) => {\n if (transactional && !transactionalId) {\n throw new KafkaJSNonRetriableError('Cannot manage transactions without a transactionalId')\n }\n\n const retrier = createRetry(cluster.retry)\n\n /**\n * Current producer ID\n */\n let producerId = NO_PRODUCER_ID\n\n /**\n * Current producer epoch\n */\n let producerEpoch = 0\n\n /**\n * Idempotent production requires that the producer track the sequence number of messages.\n *\n * Sequences are sent with every Record Batch and tracked per Topic-Partition\n */\n let producerSequence = {}\n\n /**\n * Topic partitions already participating in the transaction\n */\n let transactionTopicPartitions = {}\n\n const stateMachine = createStateMachine({ logger })\n stateMachine.on('transition', ({ to }) => {\n if (to === STATES.READY) {\n transactionTopicPartitions = {}\n }\n })\n\n const findTransactionCoordinator = () => {\n return cluster.findGroupCoordinator({\n groupId: transactionalId,\n coordinatorType: COORDINATOR_TYPES.TRANSACTION,\n })\n }\n\n const transactionalGuard = () => {\n if (!transactional) {\n throw new KafkaJSNonRetriableError('Method unavailable if non-transactional')\n }\n }\n\n const eosManager = stateMachine.createGuarded(\n {\n /**\n * Get the current producer id\n * @returns {number}\n */\n getProducerId() {\n return producerId\n },\n\n /**\n * Get the current producer epoch\n * @returns {number}\n */\n getProducerEpoch() {\n return producerEpoch\n },\n\n getTransactionalId() {\n return transactionalId\n },\n\n /**\n * Initialize the idempotent producer by making an `InitProducerId` request.\n * Overwrites any existing state in this transaction manager\n */\n async initProducerId() {\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadataIfNecessary()\n\n // If non-transactional we can request the PID from any broker\n const broker = await (transactional\n ? findTransactionCoordinator()\n : cluster.findControllerBroker())\n\n const result = await broker.initProducerId({\n transactionalId: transactional ? transactionalId : undefined,\n transactionTimeout,\n })\n\n stateMachine.transitionTo(STATES.READY)\n producerId = result.producerId\n producerEpoch = result.producerEpoch\n producerSequence = {}\n\n logger.debug('Initialized producer id & epoch', { producerId, producerEpoch })\n } catch (e) {\n if (INIT_PRODUCER_RETRIABLE_PROTOCOL_ERRORS.includes(e.type)) {\n if (e.type === 'CONCURRENT_TRANSACTIONS') {\n logger.debug('There is an ongoing transaction on this transactionId, retrying', {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n })\n }\n\n throw e\n }\n\n bail(e)\n }\n })\n },\n\n /**\n * Get the current sequence for a given Topic-Partition. Defaults to 0.\n *\n * @param {string} topic\n * @param {string} partition\n * @returns {number}\n */\n getSequence(topic, partition) {\n if (!eosManager.isInitialized()) {\n return SEQUENCE_START\n }\n\n producerSequence[topic] = producerSequence[topic] || {}\n producerSequence[topic][partition] = producerSequence[topic][partition] || SEQUENCE_START\n\n return producerSequence[topic][partition]\n },\n\n /**\n * Update the sequence for a given Topic-Partition.\n *\n * Do nothing if not yet initialized (not idempotent)\n * @param {string} topic\n * @param {string} partition\n * @param {number} increment\n */\n updateSequence(topic, partition, increment) {\n if (!eosManager.isInitialized()) {\n return\n }\n\n const previous = eosManager.getSequence(topic, partition)\n let sequence = previous + increment\n\n // Sequence is defined as Int32 in the Record Batch,\n // so theoretically should need to rotate here\n if (sequence >= INT_32_MAX_VALUE) {\n logger.debug(\n `Sequence for ${topic} ${partition} exceeds max value (${sequence}). Rotating to 0.`\n )\n sequence = 0\n }\n\n producerSequence[topic][partition] = sequence\n },\n\n /**\n * Begin a transaction\n */\n beginTransaction() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.TRANSACTING)\n },\n\n /**\n * Add partitions to a transaction if they are not already marked as participating.\n *\n * Should be called prior to sending any messages during a transaction\n * @param {TopicData[]} topicData\n *\n * @typedef {Object} TopicData\n * @property {string} topic\n * @property {object[]} partitions\n * @property {number} partitions[].partition\n */\n async addPartitionsToTransaction(topicData) {\n transactionalGuard()\n const newTopicPartitions = {}\n\n topicData.forEach(({ topic, partitions }) => {\n transactionTopicPartitions[topic] = transactionTopicPartitions[topic] || {}\n\n partitions.forEach(({ partition }) => {\n if (!transactionTopicPartitions[topic][partition]) {\n newTopicPartitions[topic] = newTopicPartitions[topic] || []\n newTopicPartitions[topic].push(partition)\n }\n })\n })\n\n const topics = Object.keys(newTopicPartitions).map(topic => ({\n topic,\n partitions: newTopicPartitions[topic],\n }))\n\n if (topics.length) {\n const broker = await findTransactionCoordinator()\n await broker.addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics })\n }\n\n topics.forEach(({ topic, partitions }) => {\n partitions.forEach(partition => {\n transactionTopicPartitions[topic][partition] = true\n })\n })\n },\n\n /**\n * Commit the ongoing transaction\n */\n async commit() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.COMMITTING)\n\n const broker = await findTransactionCoordinator()\n await broker.endTxn({\n producerId,\n producerEpoch,\n transactionalId,\n transactionResult: true,\n })\n\n stateMachine.transitionTo(STATES.READY)\n },\n\n /**\n * Abort the ongoing transaction\n */\n async abort() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.ABORTING)\n\n const broker = await findTransactionCoordinator()\n await broker.endTxn({\n producerId,\n producerEpoch,\n transactionalId,\n transactionResult: false,\n })\n\n stateMachine.transitionTo(STATES.READY)\n },\n\n /**\n * Whether the producer id has already been initialized\n */\n isInitialized() {\n return producerId !== NO_PRODUCER_ID\n },\n\n isTransactional() {\n return transactional\n },\n\n isInTransaction() {\n return stateMachine.state() === STATES.TRANSACTING\n },\n\n /**\n * Mark the provided offsets as participating in the transaction for the given consumer group.\n *\n * This allows us to commit an offset as consumed only if the transaction passes.\n * @param {string} consumerGroupId The unique group identifier\n * @param {OffsetCommitTopic[]} topics The unique group identifier\n * @returns {Promise}\n *\n * @typedef {Object} OffsetCommitTopic\n * @property {string} topic\n * @property {OffsetCommitTopicPartition[]} partitions\n *\n * @typedef {Object} OffsetCommitTopicPartition\n * @property {number} partition\n * @property {number} offset\n */\n async sendOffsets({ consumerGroupId, topics }) {\n assert(consumerGroupId, 'Missing consumerGroupId')\n assert(topics, 'Missing offset topics')\n\n const transactionCoordinator = await findTransactionCoordinator()\n\n // Do we need to add offsets if we've already done so for this consumer group?\n await transactionCoordinator.addOffsetsToTxn({\n transactionalId,\n producerId,\n producerEpoch,\n groupId: consumerGroupId,\n })\n\n let groupCoordinator = await cluster.findGroupCoordinator({\n groupId: consumerGroupId,\n coordinatorType: COORDINATOR_TYPES.GROUP,\n })\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await groupCoordinator.txnOffsetCommit({\n transactionalId,\n producerId,\n producerEpoch,\n groupId: consumerGroupId,\n topics,\n })\n } catch (e) {\n if (COMMIT_RETRIABLE_PROTOCOL_ERRORS.includes(e.type)) {\n logger.debug('Group coordinator is not ready yet, retrying', {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n })\n\n throw e\n }\n\n if (\n COMMIT_STALE_COORDINATOR_PROTOCOL_ERRORS.includes(e.type) ||\n e.code === 'ECONNREFUSED'\n ) {\n logger.debug(\n 'Invalid group coordinator, finding new group coordinator and retrying',\n {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n }\n )\n\n groupCoordinator = await cluster.findGroupCoordinator({\n groupId: consumerGroupId,\n coordinatorType: COORDINATOR_TYPES.GROUP,\n })\n\n throw e\n }\n\n bail(e)\n }\n })\n },\n },\n\n /**\n * Transaction state guards\n */\n {\n initProducerId: { legalStates: [STATES.UNINITIALIZED, STATES.READY] },\n beginTransaction: { legalStates: [STATES.READY], async: false },\n addPartitionsToTransaction: { legalStates: [STATES.TRANSACTING] },\n sendOffsets: { legalStates: [STATES.TRANSACTING] },\n commit: { legalStates: [STATES.TRANSACTING] },\n abort: { legalStates: [STATES.TRANSACTING] },\n }\n )\n\n return eosManager\n}\n","const { EventEmitter } = require('events')\nconst { KafkaJSNonRetriableError } = require('../../errors')\nconst STATES = require('./transactionStates')\n\nconst VALID_STATE_TRANSITIONS = {\n [STATES.UNINITIALIZED]: [STATES.READY],\n [STATES.READY]: [STATES.READY, STATES.TRANSACTING],\n [STATES.TRANSACTING]: [STATES.COMMITTING, STATES.ABORTING],\n [STATES.COMMITTING]: [STATES.READY],\n [STATES.ABORTING]: [STATES.READY],\n}\n\nmodule.exports = ({ logger, initialState = STATES.UNINITIALIZED }) => {\n let currentState = initialState\n\n const guard = (object, method, { legalStates, async: isAsync = true }) => {\n if (!object[method]) {\n throw new KafkaJSNonRetriableError(`Cannot add guard on missing method \"${method}\"`)\n }\n\n return (...args) => {\n const fn = object[method]\n\n if (!legalStates.includes(currentState)) {\n const error = new KafkaJSNonRetriableError(\n `Transaction state exception: Cannot call \"${method}\" in state \"${currentState}\"`\n )\n\n if (isAsync) {\n return Promise.reject(error)\n } else {\n throw error\n }\n }\n\n return fn.apply(object, args)\n }\n }\n\n const stateMachine = Object.assign(new EventEmitter(), {\n /**\n * Create a clone of \"object\" where we ensure state machine is in correct state\n * prior to calling any of the configured methods\n * @param {Object} object The object whose methods we will guard\n * @param {Object} methodStateMapping Keys are method names on \"object\"\n * @param {string[]} methodStateMapping.legalStates Legal states for this method\n * @param {boolean=true} methodStateMapping.async Whether this method is async (throw vs reject)\n */\n createGuarded(object, methodStateMapping) {\n const guardedMethods = Object.keys(methodStateMapping).reduce((guards, method) => {\n guards[method] = guard(object, method, methodStateMapping[method])\n return guards\n }, {})\n\n return { ...object, ...guardedMethods }\n },\n /**\n * Transition safely to a new state\n */\n transitionTo(state) {\n logger.debug(`Transaction state transition ${currentState} --> ${state}`)\n\n if (!VALID_STATE_TRANSITIONS[currentState].includes(state)) {\n throw new KafkaJSNonRetriableError(\n `Transaction state exception: Invalid transition ${currentState} --> ${state}`\n )\n }\n\n stateMachine.emit('transition', { to: state, from: currentState })\n currentState = state\n },\n\n state() {\n return currentState\n },\n })\n\n return stateMachine\n}\n","module.exports = {\n UNINITIALIZED: 'UNINITIALIZED',\n READY: 'READY',\n TRANSACTING: 'TRANSACTING',\n COMMITTING: 'COMMITTING',\n ABORTING: 'ABORTING',\n}\n","module.exports = ({ topic, partitionMetadata, messages, partitioner }) => {\n if (partitionMetadata.length === 0) {\n return {}\n }\n\n return messages.reduce((result, message) => {\n const partition = partitioner({ topic, partitionMetadata, message })\n const current = result[partition] || []\n return Object.assign(result, { [partition]: [...current, message] })\n }, {})\n}\n","const createRetry = require('../retry')\nconst { CONNECTION_STATUS } = require('../network/connectionStatus')\nconst { DefaultPartitioner } = require('./partitioners/')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst createEosManager = require('./eosManager')\nconst createMessageProducer = require('./messageProducer')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst { KafkaJSNonRetriableError } = require('../errors')\n\nconst { values, keys } = Object\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `producer.events.${key}`)\n .join(', ')\n\nconst { CONNECT, DISCONNECT } = events\n\n/**\n *\n * @param {Object} params\n * @param {import('../../types').Cluster} params.cluster\n * @param {import('../../types').Logger} params.logger\n * @param {import('../../types').ICustomPartitioner} [params.createPartitioner]\n * @param {import('../../types').RetryOptions} [params.retry]\n * @param {boolean} [params.idempotent]\n * @param {string} [params.transactionalId]\n * @param {number} [params.transactionTimeout]\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n *\n * @returns {import('../../types').Producer}\n */\nmodule.exports = ({\n cluster,\n logger: rootLogger,\n createPartitioner = DefaultPartitioner,\n retry,\n idempotent = false,\n transactionalId,\n transactionTimeout,\n instrumentationEmitter: rootInstrumentationEmitter,\n}) => {\n let connectionStatus = CONNECTION_STATUS.DISCONNECTED\n retry = retry || { retries: idempotent ? Number.MAX_SAFE_INTEGER : 5 }\n\n if (idempotent && retry.retries < 1) {\n throw new KafkaJSNonRetriableError(\n 'Idempotent producer must allow retries to protect against transient errors'\n )\n }\n\n const logger = rootLogger.namespace('Producer')\n\n if (idempotent && retry.retries < Number.MAX_SAFE_INTEGER) {\n logger.warn('Limiting retries for the idempotent producer may invalidate EoS guarantees')\n }\n\n const partitioner = createPartitioner()\n const retrier = createRetry(Object.assign({}, cluster.retry, retry))\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n const idempotentEosManager = createEosManager({\n logger,\n cluster,\n transactionTimeout,\n transactional: false,\n transactionalId,\n })\n\n const { send, sendBatch } = createMessageProducer({\n logger,\n cluster,\n partitioner,\n eosManager: idempotentEosManager,\n idempotent,\n retrier,\n getConnectionStatus: () => connectionStatus,\n })\n\n let transactionalEosManager\n\n /** @type {import(\"../../types\").Producer[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * Begin a transaction. The returned object contains methods to send messages\n * to the transaction and end the transaction by committing or aborting.\n *\n * Only messages sent on the transaction object will participate in the transaction.\n *\n * Calling any of the transactional methods after the transaction has ended\n * will raise an exception (use `isActive` to ascertain if ended).\n * @returns {Promise}\n *\n * @typedef {Object} Transaction\n * @property {Function} send Identical to the producer \"send\" method\n * @property {Function} sendBatch Identical to the producer \"sendBatch\" method\n * @property {Function} abort Abort the transaction\n * @property {Function} commit Commit the transaction\n * @property {Function} isActive Whether the transaction is active\n */\n const transaction = async () => {\n if (!transactionalId) {\n throw new KafkaJSNonRetriableError('Must provide transactional id for transactional producer')\n }\n\n let transactionDidEnd = false\n transactionalEosManager =\n transactionalEosManager ||\n createEosManager({\n logger,\n cluster,\n transactionTimeout,\n transactional: true,\n transactionalId,\n })\n\n if (transactionalEosManager.isInTransaction()) {\n throw new KafkaJSNonRetriableError(\n 'There is already an ongoing transaction for this producer. Please end the transaction before beginning another.'\n )\n }\n\n // We only initialize the producer id once\n if (!transactionalEosManager.isInitialized()) {\n await transactionalEosManager.initProducerId()\n }\n transactionalEosManager.beginTransaction()\n\n const { send: sendTxn, sendBatch: sendBatchTxn } = createMessageProducer({\n logger,\n cluster,\n partitioner,\n retrier,\n eosManager: transactionalEosManager,\n idempotent: true,\n getConnectionStatus: () => connectionStatus,\n })\n\n const isActive = () => transactionalEosManager.isInTransaction() && !transactionDidEnd\n\n const transactionGuard = fn => (...args) => {\n if (!isActive()) {\n return Promise.reject(\n new KafkaJSNonRetriableError('Cannot continue to use transaction once ended')\n )\n }\n\n return fn(...args)\n }\n\n return {\n sendBatch: transactionGuard(sendBatchTxn),\n send: transactionGuard(sendTxn),\n /**\n * Abort the ongoing transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n abort: transactionGuard(async () => {\n await transactionalEosManager.abort()\n transactionDidEnd = true\n }),\n /**\n * Commit the ongoing transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n commit: transactionGuard(async () => {\n await transactionalEosManager.commit()\n transactionDidEnd = true\n }),\n /**\n * Sends a list of specified offsets to the consumer group coordinator, and also marks those offsets as part of the current transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n sendOffsets: transactionGuard(async ({ consumerGroupId, topics }) => {\n await transactionalEosManager.sendOffsets({ consumerGroupId, topics })\n\n for (const topicOffsets of topics) {\n const { topic, partitions } = topicOffsets\n for (const { partition, offset } of partitions) {\n cluster.markOffsetAsCommitted({\n groupId: consumerGroupId,\n topic,\n partition,\n offset,\n })\n }\n }\n }),\n isActive,\n }\n }\n\n /**\n * @returns {Object} logger\n */\n const getLogger = () => logger\n\n return {\n /**\n * @returns {Promise}\n */\n connect: async () => {\n await cluster.connect()\n connectionStatus = CONNECTION_STATUS.CONNECTED\n instrumentationEmitter.emit(CONNECT)\n\n if (idempotent && !idempotentEosManager.isInitialized()) {\n await idempotentEosManager.initProducerId()\n }\n },\n /**\n * @return {Promise}\n */\n disconnect: async () => {\n connectionStatus = CONNECTION_STATUS.DISCONNECTING\n await cluster.disconnect()\n connectionStatus = CONNECTION_STATUS.DISCONNECTED\n instrumentationEmitter.emit(DISCONNECT)\n },\n isIdempotent: () => {\n return idempotent\n },\n events,\n on,\n send,\n sendBatch,\n transaction,\n logger: getLogger,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst networkEvents = require('../network/instrumentationEvents')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst producerType = InstrumentationEventType('producer')\n\nconst events = {\n CONNECT: producerType('connect'),\n DISCONNECT: producerType('disconnect'),\n REQUEST: producerType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: producerType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: producerType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const createSendMessages = require('./sendMessages')\nconst { KafkaJSError, KafkaJSNonRetriableError } = require('../errors')\nconst { CONNECTION_STATUS } = require('../network/connectionStatus')\n\nmodule.exports = ({\n logger,\n cluster,\n partitioner,\n eosManager,\n idempotent,\n retrier,\n getConnectionStatus,\n}) => {\n const sendMessages = createSendMessages({\n logger,\n cluster,\n retrier,\n partitioner,\n eosManager,\n })\n\n const validateConnectionStatus = () => {\n const connectionStatus = getConnectionStatus()\n\n switch (connectionStatus) {\n case CONNECTION_STATUS.DISCONNECTING:\n throw new KafkaJSNonRetriableError(\n `The producer is disconnecting; therefore, it can't safely accept messages anymore`\n )\n case CONNECTION_STATUS.DISCONNECTED:\n throw new KafkaJSError('The producer is disconnected')\n }\n }\n\n /**\n * @typedef {Object} TopicMessages\n * @property {string} topic\n * @property {Array} messages An array of objects with \"key\" and \"value\", example:\n * [{ key: 'my-key', value: 'my-value'}]\n *\n * @typedef {Object} SendBatchRequest\n * @property {Array} topicMessages\n * @property {number} [acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n *\n * @property {number} [timeout=30000] The time to await a response in ms\n * @property {Compression.Types} [compression=Compression.Types.None] Compression codec\n *\n * @param {SendBatchRequest}\n * @returns {Promise}\n */\n const sendBatch = async ({ acks = -1, timeout, compression, topicMessages = [] }) => {\n if (topicMessages.some(({ topic }) => !topic)) {\n throw new KafkaJSNonRetriableError(`Invalid topic`)\n }\n\n if (idempotent && acks !== -1) {\n throw new KafkaJSNonRetriableError(\n `Not requiring ack for all messages invalidates the idempotent producer's EoS guarantees`\n )\n }\n\n for (const { topic, messages } of topicMessages) {\n if (!messages) {\n throw new KafkaJSNonRetriableError(\n `Invalid messages array [${messages}] for topic \"${topic}\"`\n )\n }\n\n const messageWithoutValue = messages.find(message => message.value === undefined)\n if (messageWithoutValue) {\n throw new KafkaJSNonRetriableError(\n `Invalid message without value for topic \"${topic}\": ${JSON.stringify(\n messageWithoutValue\n )}`\n )\n }\n }\n\n validateConnectionStatus()\n const mergedTopicMessages = topicMessages.reduce((merged, { topic, messages }) => {\n const index = merged.findIndex(({ topic: mergedTopic }) => topic === mergedTopic)\n\n if (index === -1) {\n merged.push({ topic, messages })\n } else {\n merged[index].messages = [...merged[index].messages, ...messages]\n }\n\n return merged\n }, [])\n\n return await sendMessages({\n acks,\n timeout,\n compression,\n topicMessages: mergedTopicMessages,\n })\n }\n\n /**\n * @param {ProduceRequest} ProduceRequest\n * @returns {Promise}\n *\n * @typedef {Object} ProduceRequest\n * @property {string} topic\n * @property {Array} messages An array of objects with \"key\" and \"value\", example:\n * [{ key: 'my-key', value: 'my-value'}]\n * @property {number} [acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n * @property {number} [timeout=30000] The time to await a response in ms\n * @property {Compression.Types} [compression=Compression.Types.None] Compression codec\n */\n const send = async ({ acks, timeout, compression, topic, messages }) => {\n const topicMessage = { topic, messages }\n return sendBatch({\n acks,\n timeout,\n compression,\n topicMessages: [topicMessage],\n })\n }\n\n return {\n send,\n sendBatch,\n }\n}\n","const murmur2 = require('./murmur2')\nconst createDefaultPartitioner = require('./partitioner')\n\nmodule.exports = createDefaultPartitioner(murmur2)\n","/* eslint-disable */\n\n// Based on the kafka client 0.10.2 murmur2 implementation\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L364\n\nconst SEED = 0x9747b28c\n\n// 'm' and 'r' are mixing constants generated offline.\n// They're not really 'magic', they just happen to work well.\nconst M = 0x5bd1e995\nconst R = 24\n\nmodule.exports = key => {\n const data = Buffer.isBuffer(key) ? key : Buffer.from(String(key))\n const length = data.length\n\n // Initialize the hash to a random value\n let h = SEED ^ length\n let length4 = length / 4\n\n for (let i = 0; i < length4; i++) {\n const i4 = i * 4\n let k =\n (data[i4 + 0] & 0xff) +\n ((data[i4 + 1] & 0xff) << 8) +\n ((data[i4 + 2] & 0xff) << 16) +\n ((data[i4 + 3] & 0xff) << 24)\n k *= M\n k ^= k >>> R\n k *= M\n h *= M\n h ^= k\n }\n\n // Handle the last few bytes of the input array\n switch (length % 4) {\n case 3:\n h ^= (data[(length & ~3) + 2] & 0xff) << 16\n case 2:\n h ^= (data[(length & ~3) + 1] & 0xff) << 8\n case 1:\n h ^= data[length & ~3] & 0xff\n h *= M\n }\n\n h ^= h >>> 13\n h *= M\n h ^= h >>> 15\n\n return h\n}\n","const randomBytes = require('./randomBytes')\n\n// Based on the java client 0.10.2\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/clients/producer/internals/DefaultPartitioner.java\n\n/**\n * A cheap way to deterministically convert a number to a positive value. When the input is\n * positive, the original value is returned. When the input number is negative, the returned\n * positive value is the original value bit AND against 0x7fffffff which is not its absolutely\n * value.\n */\nconst toPositive = x => x & 0x7fffffff\n\n/**\n * The default partitioning strategy:\n * - If a partition is specified in the message, use it\n * - If no partition is specified but a key is present choose a partition based on a hash of the key\n * - If no partition or key is present choose a partition in a round-robin fashion\n */\nmodule.exports = murmur2 => () => {\n const counters = {}\n\n return ({ topic, partitionMetadata, message }) => {\n if (!(topic in counters)) {\n counters[topic] = randomBytes(32).readUInt32BE(0)\n }\n const numPartitions = partitionMetadata.length\n const availablePartitions = partitionMetadata.filter(p => p.leader >= 0)\n const numAvailablePartitions = availablePartitions.length\n\n if (message.partition !== null && message.partition !== undefined) {\n return message.partition\n }\n\n if (message.key !== null && message.key !== undefined) {\n return toPositive(murmur2(message.key)) % numPartitions\n }\n\n if (numAvailablePartitions > 0) {\n const i = toPositive(++counters[topic]) % numAvailablePartitions\n return availablePartitions[i].partitionId\n }\n\n // no partitions are available, give a non-available partition\n return toPositive(++counters[topic]) % numPartitions\n }\n}\n","const { KafkaJSNonRetriableError } = require('../../../errors')\n\nconst toNodeCompatible = crypto => ({\n randomBytes: size => crypto.getRandomValues(Buffer.allocUnsafe(size)),\n})\n\nlet cryptoImplementation = null\nif (global && global.crypto) {\n cryptoImplementation =\n global.crypto.randomBytes === undefined ? toNodeCompatible(global.crypto) : global.crypto\n} else if (global && global.msCrypto) {\n cryptoImplementation = toNodeCompatible(global.msCrypto)\n} else if (global && !global.crypto) {\n cryptoImplementation = require('crypto')\n}\n\nconst MAX_BYTES = 65536\n\nmodule.exports = size => {\n if (size > MAX_BYTES) {\n throw new KafkaJSNonRetriableError(\n `Byte length (${size}) exceeds the max number of bytes of entropy available (${MAX_BYTES})`\n )\n }\n\n if (!cryptoImplementation) {\n throw new KafkaJSNonRetriableError('No available crypto implementation')\n }\n\n return cryptoImplementation.randomBytes(size)\n}\n","const murmur2 = require('./murmur2')\nconst createDefaultPartitioner = require('../default/partitioner')\n\nmodule.exports = createDefaultPartitioner(murmur2)\n","/* eslint-disable */\nconst Long = require('../../../utils/long')\n\n// Based on the kafka client 0.10.2 murmur2 implementation\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L364\n\nconst SEED = Long.fromValue(0x9747b28c)\n\n// 'm' and 'r' are mixing constants generated offline.\n// They're not really 'magic', they just happen to work well.\nconst M = Long.fromValue(0x5bd1e995)\nconst R = Long.fromValue(24)\n\nmodule.exports = key => {\n const data = Buffer.isBuffer(key) ? key : Buffer.from(String(key))\n const length = data.length\n\n // Initialize the hash to a random value\n let h = Long.fromValue(SEED.xor(length))\n let length4 = Math.floor(length / 4)\n\n for (let i = 0; i < length4; i++) {\n const i4 = i * 4\n let k =\n (data[i4 + 0] & 0xff) +\n ((data[i4 + 1] & 0xff) << 8) +\n ((data[i4 + 2] & 0xff) << 16) +\n ((data[i4 + 3] & 0xff) << 24)\n k = Long.fromValue(k)\n k = k.multiply(M)\n k = k.xor(k.toInt() >>> R)\n k = Long.fromValue(k).multiply(M)\n h = h.multiply(M)\n h = h.xor(k)\n }\n\n // Handle the last few bytes of the input array\n switch (length % 4) {\n case 3:\n h = h.xor((data[(length & ~3) + 2] & 0xff) << 16)\n case 2:\n h = h.xor((data[(length & ~3) + 1] & 0xff) << 8)\n case 1:\n h = h.xor(data[length & ~3] & 0xff)\n h = h.multiply(M)\n }\n\n h = h.xor(h.toInt() >>> 13)\n h = h.multiply(M)\n h = h.xor(h.toInt() >>> 15)\n\n return h.toInt()\n}\n","const DefaultPartitioner = require('./default')\nconst JavaCompatiblePartitioner = require('./defaultJava')\n\nmodule.exports = {\n DefaultPartitioner,\n JavaCompatiblePartitioner,\n}\n","const flatten = require('../utils/flatten')\n\nmodule.exports = ({ topics }) => {\n const partitions = topics.map(({ topicName, partitions }) =>\n partitions.map(partition => ({ topicName, ...partition }))\n )\n\n return flatten(partitions)\n}\n","const flatten = require('../utils/flatten')\nconst { KafkaJSMetadataNotLoaded } = require('../errors')\nconst { staleMetadata } = require('../protocol/error')\nconst groupMessagesPerPartition = require('./groupMessagesPerPartition')\nconst createTopicData = require('./createTopicData')\nconst responseSerializer = require('./responseSerializer')\n\nconst { keys } = Object\n\n/**\n * @param {Object} options\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").Cluster} options.cluster\n * @param {ReturnType} options.partitioner\n * @param {import(\"./eosManager\").EosManager} options.eosManager\n * @param {import(\"../retry\").Retrier} options.retrier\n */\nmodule.exports = ({ logger, cluster, partitioner, eosManager, retrier }) => {\n return async ({ acks, timeout, compression, topicMessages }) => {\n /** @type {Map} */\n const responsePerBroker = new Map()\n\n /** @param {Map} responsePerBroker */\n const createProducerRequests = async responsePerBroker => {\n const topicMetadata = new Map()\n\n await cluster.refreshMetadataIfNecessary()\n\n for (const { topic, messages } of topicMessages) {\n const partitionMetadata = cluster.findTopicPartitionMetadata(topic)\n\n if (partitionMetadata.length === 0) {\n logger.debug('Producing to topic without metadata', {\n topic,\n targetTopics: Array.from(cluster.targetTopics),\n })\n\n throw new KafkaJSMetadataNotLoaded('Producing to topic without metadata')\n }\n\n const messagesPerPartition = groupMessagesPerPartition({\n topic,\n partitionMetadata,\n messages,\n partitioner,\n })\n\n const partitions = keys(messagesPerPartition)\n const sequencePerPartition = partitions.reduce((result, partition) => {\n result[partition] = eosManager.getSequence(topic, partition)\n return result\n }, {})\n\n const partitionsPerLeader = cluster.findLeaderForPartitions(topic, partitions)\n const leaders = keys(partitionsPerLeader)\n\n topicMetadata.set(topic, {\n partitionsPerLeader,\n messagesPerPartition,\n sequencePerPartition,\n })\n\n for (const nodeId of leaders) {\n const broker = await cluster.findBroker({ nodeId })\n if (!responsePerBroker.has(broker)) {\n responsePerBroker.set(broker, null)\n }\n }\n }\n\n const brokers = Array.from(responsePerBroker.keys())\n const brokersWithoutResponse = brokers.filter(broker => !responsePerBroker.get(broker))\n\n return brokersWithoutResponse.map(async broker => {\n const entries = Array.from(topicMetadata.entries())\n const topicDataForBroker = entries\n .filter(([_, { partitionsPerLeader }]) => !!partitionsPerLeader[broker.nodeId])\n .map(([topic, { partitionsPerLeader, messagesPerPartition, sequencePerPartition }]) => ({\n topic,\n partitions: partitionsPerLeader[broker.nodeId],\n sequencePerPartition,\n messagesPerPartition,\n }))\n\n const topicData = createTopicData(topicDataForBroker)\n\n try {\n if (eosManager.isTransactional()) {\n await eosManager.addPartitionsToTransaction(topicData)\n }\n\n const response = await broker.produce({\n transactionalId: eosManager.isTransactional()\n ? eosManager.getTransactionalId()\n : undefined,\n producerId: eosManager.getProducerId(),\n producerEpoch: eosManager.getProducerEpoch(),\n acks,\n timeout,\n compression,\n topicData,\n })\n\n const expectResponse = acks !== 0\n const formattedResponse = expectResponse ? responseSerializer(response) : []\n\n formattedResponse.forEach(({ topicName, partition }) => {\n const increment = topicMetadata.get(topicName).messagesPerPartition[partition].length\n\n eosManager.updateSequence(topicName, partition, increment)\n })\n\n responsePerBroker.set(broker, formattedResponse)\n } catch (e) {\n responsePerBroker.delete(broker)\n throw e\n }\n })\n }\n\n return retrier(async (bail, retryCount, retryTime) => {\n const topics = topicMessages.map(({ topic }) => topic)\n await cluster.addMultipleTargetTopics(topics)\n\n try {\n const requests = await createProducerRequests(responsePerBroker)\n await Promise.all(requests)\n const responses = Array.from(responsePerBroker.values())\n return flatten(responses)\n } catch (e) {\n if (e.name === 'KafkaJSConnectionClosedError') {\n cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n if (!cluster.isConnected()) {\n logger.debug(`Cluster has disconnected, reconnecting: ${e.message}`, {\n retryCount,\n retryTime,\n })\n await cluster.connect()\n await cluster.refreshMetadata()\n throw e\n }\n\n // This is necessary in case the metadata is stale and the number of partitions\n // for this topic has increased in the meantime\n if (\n staleMetadata(e) ||\n e.name === 'KafkaJSMetadataNotLoaded' ||\n e.name === 'KafkaJSConnectionError' ||\n e.name === 'KafkaJSConnectionClosedError' ||\n (e.name === 'KafkaJSProtocolError' && e.retriable)\n ) {\n logger.error(`Failed to send messages: ${e.message}`, { retryCount, retryTime })\n await cluster.refreshMetadata()\n throw e\n }\n\n logger.error(`${e.message}`, { retryCount, retryTime })\n if (e.retriable) throw e\n bail(e)\n }\n })\n }\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/acl/AclOperation.java#L44\n\n/**\n * @typedef {number} ACLOperationTypes\n *\n * Enum for ACL Operations Types\n * @readonly\n * @enum {ACLOperationTypes}\n */\nmodule.exports = {\n /**\n * Represents any AclOperation which this client cannot understand, perhaps because this\n * client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any AclOperation.\n */\n ANY: 1,\n /**\n * ALL operation.\n */\n ALL: 2,\n /**\n * READ operation.\n */\n READ: 3,\n /**\n * WRITE operation.\n */\n WRITE: 4,\n /**\n * CREATE operation.\n */\n CREATE: 5,\n /**\n * DELETE operation.\n */\n DELETE: 6,\n /**\n * ALTER operation.\n */\n ALTER: 7,\n /**\n * DESCRIBE operation.\n */\n DESCRIBE: 8,\n /**\n * CLUSTER_ACTION operation.\n */\n CLUSTER_ACTION: 9,\n /**\n * DESCRIBE_CONFIGS operation.\n */\n DESCRIBE_CONFIGS: 10,\n /**\n * ALTER_CONFIGS operation.\n */\n ALTER_CONFIGS: 11,\n /**\n * IDEMPOTENT_WRITE operation.\n */\n IDEMPOTENT_WRITE: 12,\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/acl/AclPermissionType.java/#L31\n\n/**\n * @typedef {number} ACLPermissionTypes\n *\n * Enum for Permission Types\n * @readonly\n * @enum {ACLPermissionTypes}\n */\nmodule.exports = {\n /**\n * Represents any AclPermissionType which this client cannot understand,\n * perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any AclPermissionType.\n */\n ANY: 1,\n /**\n * Disallows access.\n */\n DENY: 2,\n /**\n * Grants access.\n */\n ALLOW: 3,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/a15387f34d142684859c2a57fcbef25edcdce25a/clients/src/main/java/org/apache/kafka/common/resource/ResourceType.java#L25-L31\n * @typedef {number} ACLResourceTypes\n *\n * Enum for ACL Resource Types\n * @readonly\n * @enum {ACLResourceTypes}\n */\n\nmodule.exports = {\n /**\n * Represents any ResourceType which this client cannot understand,\n * perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any ResourceType.\n */\n ANY: 1,\n /**\n * A Kafka topic.\n * @see http://kafka.apache.org/documentation/#topicconfigs\n */\n TOPIC: 2,\n /**\n * A consumer group.\n * @see http://kafka.apache.org/documentation/#consumerconfigs\n */\n GROUP: 3,\n /**\n * The cluster as a whole.\n */\n CLUSTER: 4,\n /**\n * A transactional ID.\n */\n TRANSACTIONAL_ID: 5,\n /**\n * A token ID.\n */\n DELEGATION_TOKEN: 6,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/config/ConfigResource.java\n */\nmodule.exports = {\n UNKNOWN: 0,\n TOPIC: 2,\n BROKER: 4,\n BROKER_LOGGER: 8,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/1f240ce1793cab09e1c4823e17436d2b030df2bc/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java#L115-L122\n */\nmodule.exports = {\n UNKNOWN: 0,\n TOPIC_CONFIG: 1,\n DYNAMIC_BROKER_CONFIG: 2,\n DYNAMIC_DEFAULT_BROKER_CONFIG: 3,\n STATIC_BROKER_CONFIG: 4,\n DEFAULT_CONFIG: 5,\n DYNAMIC_BROKER_LOGGER_CONFIG: 6,\n}\n","// From: https://kafka.apache.org/protocol.html#The_Messages_FindCoordinator\n\n/**\n * @typedef {number} CoordinatorType\n *\n * Enum for the types of coordinator to find.\n * @enum {CoordinatorType}\n */\nmodule.exports = {\n GROUP: 0,\n TRANSACTION: 1,\n}\n","// Based on https://github.com/brianloveswords/buffer-crc32/blob/master/index.js\n\nvar CRC_TABLE = new Int32Array([\n 0x00000000,\n 0x77073096,\n 0xee0e612c,\n 0x990951ba,\n 0x076dc419,\n 0x706af48f,\n 0xe963a535,\n 0x9e6495a3,\n 0x0edb8832,\n 0x79dcb8a4,\n 0xe0d5e91e,\n 0x97d2d988,\n 0x09b64c2b,\n 0x7eb17cbd,\n 0xe7b82d07,\n 0x90bf1d91,\n 0x1db71064,\n 0x6ab020f2,\n 0xf3b97148,\n 0x84be41de,\n 0x1adad47d,\n 0x6ddde4eb,\n 0xf4d4b551,\n 0x83d385c7,\n 0x136c9856,\n 0x646ba8c0,\n 0xfd62f97a,\n 0x8a65c9ec,\n 0x14015c4f,\n 0x63066cd9,\n 0xfa0f3d63,\n 0x8d080df5,\n 0x3b6e20c8,\n 0x4c69105e,\n 0xd56041e4,\n 0xa2677172,\n 0x3c03e4d1,\n 0x4b04d447,\n 0xd20d85fd,\n 0xa50ab56b,\n 0x35b5a8fa,\n 0x42b2986c,\n 0xdbbbc9d6,\n 0xacbcf940,\n 0x32d86ce3,\n 0x45df5c75,\n 0xdcd60dcf,\n 0xabd13d59,\n 0x26d930ac,\n 0x51de003a,\n 0xc8d75180,\n 0xbfd06116,\n 0x21b4f4b5,\n 0x56b3c423,\n 0xcfba9599,\n 0xb8bda50f,\n 0x2802b89e,\n 0x5f058808,\n 0xc60cd9b2,\n 0xb10be924,\n 0x2f6f7c87,\n 0x58684c11,\n 0xc1611dab,\n 0xb6662d3d,\n 0x76dc4190,\n 0x01db7106,\n 0x98d220bc,\n 0xefd5102a,\n 0x71b18589,\n 0x06b6b51f,\n 0x9fbfe4a5,\n 0xe8b8d433,\n 0x7807c9a2,\n 0x0f00f934,\n 0x9609a88e,\n 0xe10e9818,\n 0x7f6a0dbb,\n 0x086d3d2d,\n 0x91646c97,\n 0xe6635c01,\n 0x6b6b51f4,\n 0x1c6c6162,\n 0x856530d8,\n 0xf262004e,\n 0x6c0695ed,\n 0x1b01a57b,\n 0x8208f4c1,\n 0xf50fc457,\n 0x65b0d9c6,\n 0x12b7e950,\n 0x8bbeb8ea,\n 0xfcb9887c,\n 0x62dd1ddf,\n 0x15da2d49,\n 0x8cd37cf3,\n 0xfbd44c65,\n 0x4db26158,\n 0x3ab551ce,\n 0xa3bc0074,\n 0xd4bb30e2,\n 0x4adfa541,\n 0x3dd895d7,\n 0xa4d1c46d,\n 0xd3d6f4fb,\n 0x4369e96a,\n 0x346ed9fc,\n 0xad678846,\n 0xda60b8d0,\n 0x44042d73,\n 0x33031de5,\n 0xaa0a4c5f,\n 0xdd0d7cc9,\n 0x5005713c,\n 0x270241aa,\n 0xbe0b1010,\n 0xc90c2086,\n 0x5768b525,\n 0x206f85b3,\n 0xb966d409,\n 0xce61e49f,\n 0x5edef90e,\n 0x29d9c998,\n 0xb0d09822,\n 0xc7d7a8b4,\n 0x59b33d17,\n 0x2eb40d81,\n 0xb7bd5c3b,\n 0xc0ba6cad,\n 0xedb88320,\n 0x9abfb3b6,\n 0x03b6e20c,\n 0x74b1d29a,\n 0xead54739,\n 0x9dd277af,\n 0x04db2615,\n 0x73dc1683,\n 0xe3630b12,\n 0x94643b84,\n 0x0d6d6a3e,\n 0x7a6a5aa8,\n 0xe40ecf0b,\n 0x9309ff9d,\n 0x0a00ae27,\n 0x7d079eb1,\n 0xf00f9344,\n 0x8708a3d2,\n 0x1e01f268,\n 0x6906c2fe,\n 0xf762575d,\n 0x806567cb,\n 0x196c3671,\n 0x6e6b06e7,\n 0xfed41b76,\n 0x89d32be0,\n 0x10da7a5a,\n 0x67dd4acc,\n 0xf9b9df6f,\n 0x8ebeeff9,\n 0x17b7be43,\n 0x60b08ed5,\n 0xd6d6a3e8,\n 0xa1d1937e,\n 0x38d8c2c4,\n 0x4fdff252,\n 0xd1bb67f1,\n 0xa6bc5767,\n 0x3fb506dd,\n 0x48b2364b,\n 0xd80d2bda,\n 0xaf0a1b4c,\n 0x36034af6,\n 0x41047a60,\n 0xdf60efc3,\n 0xa867df55,\n 0x316e8eef,\n 0x4669be79,\n 0xcb61b38c,\n 0xbc66831a,\n 0x256fd2a0,\n 0x5268e236,\n 0xcc0c7795,\n 0xbb0b4703,\n 0x220216b9,\n 0x5505262f,\n 0xc5ba3bbe,\n 0xb2bd0b28,\n 0x2bb45a92,\n 0x5cb36a04,\n 0xc2d7ffa7,\n 0xb5d0cf31,\n 0x2cd99e8b,\n 0x5bdeae1d,\n 0x9b64c2b0,\n 0xec63f226,\n 0x756aa39c,\n 0x026d930a,\n 0x9c0906a9,\n 0xeb0e363f,\n 0x72076785,\n 0x05005713,\n 0x95bf4a82,\n 0xe2b87a14,\n 0x7bb12bae,\n 0x0cb61b38,\n 0x92d28e9b,\n 0xe5d5be0d,\n 0x7cdcefb7,\n 0x0bdbdf21,\n 0x86d3d2d4,\n 0xf1d4e242,\n 0x68ddb3f8,\n 0x1fda836e,\n 0x81be16cd,\n 0xf6b9265b,\n 0x6fb077e1,\n 0x18b74777,\n 0x88085ae6,\n 0xff0f6a70,\n 0x66063bca,\n 0x11010b5c,\n 0x8f659eff,\n 0xf862ae69,\n 0x616bffd3,\n 0x166ccf45,\n 0xa00ae278,\n 0xd70dd2ee,\n 0x4e048354,\n 0x3903b3c2,\n 0xa7672661,\n 0xd06016f7,\n 0x4969474d,\n 0x3e6e77db,\n 0xaed16a4a,\n 0xd9d65adc,\n 0x40df0b66,\n 0x37d83bf0,\n 0xa9bcae53,\n 0xdebb9ec5,\n 0x47b2cf7f,\n 0x30b5ffe9,\n 0xbdbdf21c,\n 0xcabac28a,\n 0x53b39330,\n 0x24b4a3a6,\n 0xbad03605,\n 0xcdd70693,\n 0x54de5729,\n 0x23d967bf,\n 0xb3667a2e,\n 0xc4614ab8,\n 0x5d681b02,\n 0x2a6f2b94,\n 0xb40bbe37,\n 0xc30c8ea1,\n 0x5a05df1b,\n 0x2d02ef8d,\n])\n\nmodule.exports = encoder => {\n const { buffer } = encoder\n const l = buffer.length\n let crc = -1\n for (let n = 0; n < l; n++) {\n crc = CRC_TABLE[(crc ^ buffer[n]) & 0xff] ^ (crc >>> 8)\n }\n return crc ^ -1\n}\n","const { KafkaJSInvalidVarIntError, KafkaJSInvalidLongError } = require('../errors')\nconst Long = require('../utils/long')\n\nconst INT8_SIZE = 1\nconst INT16_SIZE = 2\nconst INT32_SIZE = 4\nconst INT64_SIZE = 8\nconst DOUBLE_SIZE = 8\n\nconst MOST_SIGNIFICANT_BIT = 0x80 // 128\nconst OTHER_BITS = 0x7f // 127\n\nmodule.exports = class Decoder {\n static int32Size() {\n return INT32_SIZE\n }\n\n static decodeZigZag(value) {\n return (value >>> 1) ^ -(value & 1)\n }\n\n static decodeZigZag64(longValue) {\n return longValue.shiftRightUnsigned(1).xor(longValue.and(Long.fromInt(1)).negate())\n }\n\n constructor(buffer) {\n this.buffer = buffer\n this.offset = 0\n }\n\n readInt8() {\n const value = this.buffer.readInt8(this.offset)\n this.offset += INT8_SIZE\n return value\n }\n\n canReadInt16() {\n return this.canReadBytes(INT16_SIZE)\n }\n\n readInt16() {\n const value = this.buffer.readInt16BE(this.offset)\n this.offset += INT16_SIZE\n return value\n }\n\n canReadInt32() {\n return this.canReadBytes(INT32_SIZE)\n }\n\n readInt32() {\n const value = this.buffer.readInt32BE(this.offset)\n this.offset += INT32_SIZE\n return value\n }\n\n canReadInt64() {\n return this.canReadBytes(INT64_SIZE)\n }\n\n readInt64() {\n const first = this.buffer[this.offset]\n const last = this.buffer[this.offset + 7]\n\n const low =\n (first << 24) + // Overflow\n this.buffer[this.offset + 1] * 2 ** 16 +\n this.buffer[this.offset + 2] * 2 ** 8 +\n this.buffer[this.offset + 3]\n const high =\n this.buffer[this.offset + 4] * 2 ** 24 +\n this.buffer[this.offset + 5] * 2 ** 16 +\n this.buffer[this.offset + 6] * 2 ** 8 +\n last\n this.offset += INT64_SIZE\n\n return (BigInt(low) << 32n) + BigInt(high)\n }\n\n readDouble() {\n const value = this.buffer.readDoubleBE(this.offset)\n this.offset += DOUBLE_SIZE\n return value\n }\n\n readString() {\n const byteLength = this.readInt16()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n readVarIntString() {\n const byteLength = this.readVarInt()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n readUVarIntString() {\n const byteLength = this.readUVarInt()\n\n if (byteLength === 0) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n canReadBytes(length) {\n return Buffer.byteLength(this.buffer) - this.offset >= length\n }\n\n readBytes(byteLength = this.readInt32()) {\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readVarIntBytes() {\n const byteLength = this.readVarInt()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readUVarIntBytes() {\n const byteLength = this.readUVarInt()\n\n if (byteLength === 0) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readBoolean() {\n return this.readInt8() === 1\n }\n\n readAll() {\n const result = this.buffer.slice(this.offset)\n this.offset += Buffer.byteLength(this.buffer)\n return result\n }\n\n readArray(reader) {\n const length = this.readInt32()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n readVarIntArray(reader) {\n const length = this.readVarInt()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n readUVarIntArray(reader) {\n const length = this.readUVarInt()\n\n if (length === 0) {\n return []\n }\n\n const array = new Array(length - 1)\n for (let i = 0; i < length - 1; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n async readArrayAsync(reader) {\n const length = this.readInt32()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = await reader(this)\n }\n\n return array\n }\n\n readVarInt() {\n let currentByte\n let result = 0\n let i = 0\n\n do {\n currentByte = this.buffer[this.offset++]\n result += (currentByte & OTHER_BITS) << i\n i += 7\n } while (currentByte >= MOST_SIGNIFICANT_BIT)\n\n return Decoder.decodeZigZag(result)\n }\n\n // By default JavaScript's numbers are of type float64, performing bitwise operations converts the numbers to a signed 32-bit integer\n // Unsigned Right Shift Operator >>> ensures the returned value is an unsigned 32-bit integer\n readUVarInt() {\n let currentByte\n let result = 0\n let i = 0\n while (((currentByte = this.buffer[this.offset++]) & MOST_SIGNIFICANT_BIT) !== 0) {\n result |= (currentByte & OTHER_BITS) << i\n i += 7\n if (i > 28) {\n throw new KafkaJSInvalidVarIntError('Invalid VarInt, must contain 5 bytes or less')\n }\n }\n result |= currentByte << i\n return result >>> 0\n }\n\n readVarLong() {\n let currentByte\n let result = Long.fromInt(0)\n let i = 0\n\n do {\n if (i > 63) {\n throw new KafkaJSInvalidLongError('Invalid Long, must contain 9 bytes or less')\n }\n currentByte = this.buffer[this.offset++]\n result = result.add(Long.fromInt(currentByte & OTHER_BITS).shiftLeft(i))\n i += 7\n } while (currentByte >= MOST_SIGNIFICANT_BIT)\n\n return Decoder.decodeZigZag64(result)\n }\n\n slice(size) {\n return new Decoder(this.buffer.slice(this.offset, this.offset + size))\n }\n\n forward(size) {\n this.offset += size\n }\n}\n","const Long = require('../utils/long')\n\nconst INT8_SIZE = 1\nconst INT16_SIZE = 2\nconst INT32_SIZE = 4\nconst INT64_SIZE = 8\nconst DOUBLE_SIZE = 8\n\nconst MOST_SIGNIFICANT_BIT = 0x80 // 128\nconst OTHER_BITS = 0x7f // 127\nconst UNSIGNED_INT32_MAX_NUMBER = 0xffffff80\nconst UNSIGNED_INT64_MAX_NUMBER = 0xffffffffffffff80n\n\nmodule.exports = class Encoder {\n static encodeZigZag(value) {\n return (value << 1) ^ (value >> 31)\n }\n\n static encodeZigZag64(value) {\n const longValue = Long.fromValue(value)\n return longValue.shiftLeft(1).xor(longValue.shiftRight(63))\n }\n\n static sizeOfVarInt(value) {\n let encodedValue = this.encodeZigZag(value)\n let bytes = 1\n\n while ((encodedValue & UNSIGNED_INT32_MAX_NUMBER) !== 0) {\n bytes += 1\n encodedValue >>>= 7\n }\n\n return bytes\n }\n\n static sizeOfVarLong(value) {\n let longValue = Encoder.encodeZigZag64(value)\n let bytes = 1\n\n while (longValue.and(UNSIGNED_INT64_MAX_NUMBER).notEquals(Long.fromInt(0))) {\n bytes += 1\n longValue = longValue.shiftRightUnsigned(7)\n }\n\n return bytes\n }\n\n static sizeOfVarIntBytes(value) {\n const size = value == null ? -1 : Buffer.byteLength(value)\n\n if (size < 0) {\n return Encoder.sizeOfVarInt(-1)\n }\n\n return Encoder.sizeOfVarInt(size) + size\n }\n\n static nextPowerOfTwo(value) {\n return 1 << (31 - Math.clz32(value) + 1)\n }\n\n /**\n * Construct a new encoder with the given initial size\n *\n * @param {number} [initialSize] initial size\n */\n constructor(initialSize = 511) {\n this.buf = Buffer.alloc(Encoder.nextPowerOfTwo(initialSize))\n this.offset = 0\n }\n\n /**\n * @param {Buffer} buffer\n */\n writeBufferInternal(buffer) {\n const bufferLength = buffer.length\n this.ensureAvailable(bufferLength)\n buffer.copy(this.buf, this.offset, 0)\n this.offset += bufferLength\n }\n\n ensureAvailable(length) {\n if (this.offset + length > this.buf.length) {\n const newLength = Encoder.nextPowerOfTwo(this.offset + length)\n const newBuffer = Buffer.alloc(newLength)\n this.buf.copy(newBuffer, 0, 0, this.offset)\n this.buf = newBuffer\n }\n }\n\n get buffer() {\n return this.buf.slice(0, this.offset)\n }\n\n writeInt8(value) {\n this.ensureAvailable(INT8_SIZE)\n this.buf.writeInt8(value, this.offset)\n this.offset += INT8_SIZE\n return this\n }\n\n writeInt16(value) {\n this.ensureAvailable(INT16_SIZE)\n this.buf.writeInt16BE(value, this.offset)\n this.offset += INT16_SIZE\n return this\n }\n\n writeInt32(value) {\n this.ensureAvailable(INT32_SIZE)\n this.buf.writeInt32BE(value, this.offset)\n this.offset += INT32_SIZE\n return this\n }\n\n writeUInt32(value) {\n this.ensureAvailable(INT32_SIZE)\n this.buf.writeUInt32BE(value, this.offset)\n this.offset += INT32_SIZE\n return this\n }\n\n writeInt64(value) {\n this.ensureAvailable(INT64_SIZE)\n const longValue = Long.fromValue(value)\n this.buf.writeInt32BE(longValue.getHighBits(), this.offset)\n this.buf.writeInt32BE(longValue.getLowBits(), this.offset + INT32_SIZE)\n this.offset += INT64_SIZE\n return this\n }\n\n writeDouble(value) {\n this.ensureAvailable(DOUBLE_SIZE)\n this.buf.writeDoubleBE(value, this.offset)\n this.offset += DOUBLE_SIZE\n return this\n }\n\n writeBoolean(value) {\n value ? this.writeInt8(1) : this.writeInt8(0)\n return this\n }\n\n writeString(value) {\n if (value == null) {\n this.writeInt16(-1)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.ensureAvailable(INT16_SIZE + byteLength)\n this.writeInt16(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeVarIntString(value) {\n if (value == null) {\n this.writeVarInt(-1)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.writeVarInt(byteLength)\n this.ensureAvailable(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeUVarIntString(value) {\n if (value == null) {\n this.writeUVarInt(0)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.writeUVarInt(byteLength + 1)\n this.ensureAvailable(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeBytes(value) {\n if (value == null) {\n this.writeInt32(-1)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.ensureAvailable(INT32_SIZE + value.length)\n this.writeInt32(value.length)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.ensureAvailable(INT32_SIZE + byteLength)\n this.writeInt32(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeVarIntBytes(value) {\n if (value == null) {\n this.writeVarInt(-1)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.writeVarInt(value.length)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.writeVarInt(byteLength)\n this.ensureAvailable(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeUVarIntBytes(value) {\n if (value == null) {\n this.writeVarInt(0)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.writeUVarInt(value.length + 1)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.writeUVarInt(byteLength + 1)\n this.ensureAvailable(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeEncoder(value) {\n if (value == null || !Buffer.isBuffer(value.buf)) {\n throw new Error('value should be an instance of Encoder')\n }\n\n this.writeBufferInternal(value.buffer)\n return this\n }\n\n writeEncoderArray(value) {\n if (!Array.isArray(value) || value.some(v => v == null || !Buffer.isBuffer(v.buf))) {\n throw new Error('all values should be an instance of Encoder[]')\n }\n\n value.forEach(v => {\n this.writeBufferInternal(v.buffer)\n })\n return this\n }\n\n writeBuffer(value) {\n if (!Buffer.isBuffer(value)) {\n throw new Error('value should be an instance of Buffer')\n }\n\n this.writeBufferInternal(value)\n return this\n }\n\n /**\n * @param {any[]} array\n * @param {'int32'|'number'|'string'|'object'} [type]\n */\n writeNullableArray(array, type) {\n // A null value is encoded with length of -1 and there are no following bytes\n // On the context of this library, empty array and null are the same thing\n const length = array.length !== 0 ? array.length : -1\n this.writeArray(array, type, length)\n return this\n }\n\n /**\n * @param {any[]} array\n * @param {'int32'|'number'|'string'|'object'} [type]\n * @param {number} [length]\n */\n writeArray(array, type, length) {\n const arrayLength = length == null ? array.length : length\n this.writeInt32(arrayLength)\n if (type !== undefined) {\n switch (type) {\n case 'int32':\n case 'number':\n array.forEach(value => this.writeInt32(value))\n break\n case 'string':\n array.forEach(value => this.writeString(value))\n break\n case 'object':\n this.writeEncoderArray(array)\n break\n }\n } else {\n array.forEach(value => {\n switch (typeof value) {\n case 'number':\n this.writeInt32(value)\n break\n case 'string':\n this.writeString(value)\n break\n case 'object':\n this.writeEncoder(value)\n break\n }\n })\n }\n return this\n }\n\n writeVarIntArray(array, type) {\n if (type === 'object') {\n this.writeVarInt(array.length)\n this.writeEncoderArray(array)\n } else {\n const objectArray = array.filter(v => typeof v === 'object')\n this.writeVarInt(objectArray.length)\n this.writeEncoderArray(objectArray)\n }\n return this\n }\n\n writeUVarIntArray(array, type) {\n if (type === 'object') {\n this.writeUVarInt(array.length + 1)\n this.writeEncoderArray(array)\n } else {\n const objectArray = array.filter(v => typeof v === 'object')\n this.writeUVarInt(objectArray.length + 1)\n this.writeEncoderArray(objectArray)\n }\n return this\n }\n\n // Based on:\n // https://en.wikipedia.org/wiki/LEB128 Using LEB128 format similar to VLQ.\n // https://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/util/Varint.java#L106\n writeVarInt(value) {\n return this.writeUVarInt(Encoder.encodeZigZag(value))\n }\n\n writeUVarInt(value) {\n const byteArray = []\n while ((value & UNSIGNED_INT32_MAX_NUMBER) !== 0) {\n byteArray.push((value & OTHER_BITS) | MOST_SIGNIFICANT_BIT)\n value >>>= 7\n }\n byteArray.push(value & OTHER_BITS)\n this.writeBufferInternal(Buffer.from(byteArray))\n return this\n }\n\n writeVarLong(value) {\n const byteArray = []\n let longValue = Encoder.encodeZigZag64(value)\n\n while (longValue.and(UNSIGNED_INT64_MAX_NUMBER).notEquals(Long.fromInt(0))) {\n byteArray.push(\n longValue\n .and(OTHER_BITS)\n .or(MOST_SIGNIFICANT_BIT)\n .toInt()\n )\n longValue = longValue.shiftRightUnsigned(7)\n }\n\n byteArray.push(longValue.toInt())\n\n this.writeBufferInternal(Buffer.from(byteArray))\n return this\n }\n\n size() {\n // We can use the offset here directly, because we anyways will not re-encode the buffer when writing\n return this.offset\n }\n\n toJSON() {\n return this.buffer.toJSON()\n }\n}\n","const { KafkaJSProtocolError } = require('../errors')\nconst websiteUrl = require('../utils/websiteUrl')\n\nconst errorCodes = [\n {\n type: 'UNKNOWN',\n code: -1,\n retriable: false,\n message: 'The server experienced an unexpected error when processing the request',\n },\n {\n type: 'OFFSET_OUT_OF_RANGE',\n code: 1,\n retriable: false,\n message: 'The requested offset is not within the range of offsets maintained by the server',\n },\n {\n type: 'CORRUPT_MESSAGE',\n code: 2,\n retriable: true,\n message:\n 'This message has failed its CRC checksum, exceeds the valid size, or is otherwise corrupt',\n },\n {\n type: 'UNKNOWN_TOPIC_OR_PARTITION',\n code: 3,\n retriable: true,\n message: 'This server does not host this topic-partition',\n },\n {\n type: 'INVALID_FETCH_SIZE',\n code: 4,\n retriable: false,\n message: 'The requested fetch size is invalid',\n },\n {\n type: 'LEADER_NOT_AVAILABLE',\n code: 5,\n retriable: true,\n message:\n 'There is no leader for this topic-partition as we are in the middle of a leadership election',\n },\n {\n type: 'NOT_LEADER_FOR_PARTITION',\n code: 6,\n retriable: true,\n message: 'This server is not the leader for that topic-partition',\n },\n {\n type: 'REQUEST_TIMED_OUT',\n code: 7,\n retriable: true,\n message: 'The request timed out',\n },\n {\n type: 'BROKER_NOT_AVAILABLE',\n code: 8,\n retriable: false,\n message: 'The broker is not available',\n },\n {\n type: 'REPLICA_NOT_AVAILABLE',\n code: 9,\n retriable: false,\n message: 'The replica is not available for the requested topic-partition',\n },\n {\n type: 'MESSAGE_TOO_LARGE',\n code: 10,\n retriable: false,\n message:\n 'The request included a message larger than the max message size the server will accept',\n },\n {\n type: 'STALE_CONTROLLER_EPOCH',\n code: 11,\n retriable: false,\n message: 'The controller moved to another broker',\n },\n {\n type: 'OFFSET_METADATA_TOO_LARGE',\n code: 12,\n retriable: false,\n message: 'The metadata field of the offset request was too large',\n },\n {\n type: 'NETWORK_EXCEPTION',\n code: 13,\n retriable: true,\n message: 'The server disconnected before a response was received',\n },\n {\n type: 'GROUP_LOAD_IN_PROGRESS',\n code: 14,\n retriable: true,\n message: \"The coordinator is loading and hence can't process requests for this group\",\n },\n {\n type: 'GROUP_COORDINATOR_NOT_AVAILABLE',\n code: 15,\n retriable: true,\n message: 'The group coordinator is not available',\n },\n {\n type: 'NOT_COORDINATOR_FOR_GROUP',\n code: 16,\n retriable: true,\n message: 'This is not the correct coordinator for this group',\n },\n {\n type: 'INVALID_TOPIC_EXCEPTION',\n code: 17,\n retriable: false,\n message: 'The request attempted to perform an operation on an invalid topic',\n },\n {\n type: 'RECORD_LIST_TOO_LARGE',\n code: 18,\n retriable: false,\n message:\n 'The request included message batch larger than the configured segment size on the server',\n },\n {\n type: 'NOT_ENOUGH_REPLICAS',\n code: 19,\n retriable: true,\n message: 'Messages are rejected since there are fewer in-sync replicas than required',\n },\n {\n type: 'NOT_ENOUGH_REPLICAS_AFTER_APPEND',\n code: 20,\n retriable: true,\n message: 'Messages are written to the log, but to fewer in-sync replicas than required',\n },\n {\n type: 'INVALID_REQUIRED_ACKS',\n code: 21,\n retriable: false,\n message: 'Produce request specified an invalid value for required acks',\n },\n {\n type: 'ILLEGAL_GENERATION',\n code: 22,\n retriable: false,\n message: 'Specified group generation id is not valid',\n },\n {\n type: 'INCONSISTENT_GROUP_PROTOCOL',\n code: 23,\n retriable: false,\n message:\n \"The group member's supported protocols are incompatible with those of existing members\",\n },\n {\n type: 'INVALID_GROUP_ID',\n code: 24,\n retriable: false,\n message: 'The configured groupId is invalid',\n },\n {\n type: 'UNKNOWN_MEMBER_ID',\n code: 25,\n retriable: false,\n message: 'The coordinator is not aware of this member',\n },\n {\n type: 'INVALID_SESSION_TIMEOUT',\n code: 26,\n retriable: false,\n message:\n 'The session timeout is not within the range allowed by the broker (as configured by group.min.session.timeout.ms and group.max.session.timeout.ms)',\n },\n {\n type: 'REBALANCE_IN_PROGRESS',\n code: 27,\n retriable: false,\n message: 'The group is rebalancing, so a rejoin is needed',\n helpUrl: websiteUrl('docs/faq', 'what-does-it-mean-to-get-rebalance-in-progress-errors'),\n },\n {\n type: 'INVALID_COMMIT_OFFSET_SIZE',\n code: 28,\n retriable: false,\n message: 'The committing offset data size is not valid',\n },\n {\n type: 'TOPIC_AUTHORIZATION_FAILED',\n code: 29,\n retriable: false,\n message: 'Not authorized to access topics: [Topic authorization failed]',\n },\n {\n type: 'GROUP_AUTHORIZATION_FAILED',\n code: 30,\n retriable: false,\n message: 'Not authorized to access group: Group authorization failed',\n },\n {\n type: 'CLUSTER_AUTHORIZATION_FAILED',\n code: 31,\n retriable: false,\n message: 'Cluster authorization failed',\n },\n {\n type: 'INVALID_TIMESTAMP',\n code: 32,\n retriable: false,\n message: 'The timestamp of the message is out of acceptable range',\n },\n {\n type: 'UNSUPPORTED_SASL_MECHANISM',\n code: 33,\n retriable: false,\n message: 'The broker does not support the requested SASL mechanism',\n },\n {\n type: 'ILLEGAL_SASL_STATE',\n code: 34,\n retriable: false,\n message: 'Request is not valid given the current SASL state',\n },\n {\n type: 'UNSUPPORTED_VERSION',\n code: 35,\n retriable: false,\n message: 'The version of API is not supported',\n },\n {\n type: 'TOPIC_ALREADY_EXISTS',\n code: 36,\n retriable: false,\n message: 'Topic with this name already exists',\n },\n {\n type: 'INVALID_PARTITIONS',\n code: 37,\n retriable: false,\n message: 'Number of partitions is invalid',\n },\n {\n type: 'INVALID_REPLICATION_FACTOR',\n code: 38,\n retriable: false,\n message: 'Replication-factor is invalid',\n },\n {\n type: 'INVALID_REPLICA_ASSIGNMENT',\n code: 39,\n retriable: false,\n message: 'Replica assignment is invalid',\n },\n {\n type: 'INVALID_CONFIG',\n code: 40,\n retriable: false,\n message: 'Configuration is invalid',\n },\n {\n type: 'NOT_CONTROLLER',\n code: 41,\n retriable: true,\n message: 'This is not the correct controller for this cluster',\n },\n {\n type: 'INVALID_REQUEST',\n code: 42,\n retriable: false,\n message:\n 'This most likely occurs because of a request being malformed by the client library or the message was sent to an incompatible broker. See the broker logs for more details',\n },\n {\n type: 'UNSUPPORTED_FOR_MESSAGE_FORMAT',\n code: 43,\n retriable: false,\n message: 'The message format version on the broker does not support the request',\n },\n {\n type: 'POLICY_VIOLATION',\n code: 44,\n retriable: false,\n message: 'Request parameters do not satisfy the configured policy',\n },\n {\n type: 'OUT_OF_ORDER_SEQUENCE_NUMBER',\n code: 45,\n retriable: false,\n message: 'The broker received an out of order sequence number',\n },\n {\n type: 'DUPLICATE_SEQUENCE_NUMBER',\n code: 46,\n retriable: false,\n message: 'The broker received a duplicate sequence number',\n },\n {\n type: 'INVALID_PRODUCER_EPOCH',\n code: 47,\n retriable: false,\n message:\n \"Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker\",\n },\n {\n type: 'INVALID_TXN_STATE',\n code: 48,\n retriable: false,\n message: 'The producer attempted a transactional operation in an invalid state',\n },\n {\n type: 'INVALID_PRODUCER_ID_MAPPING',\n code: 49,\n retriable: false,\n message:\n 'The producer attempted to use a producer id which is not currently assigned to its transactional id',\n },\n {\n type: 'INVALID_TRANSACTION_TIMEOUT',\n code: 50,\n retriable: false,\n message:\n 'The transaction timeout is larger than the maximum value allowed by the broker (as configured by max.transaction.timeout.ms)',\n },\n {\n type: 'CONCURRENT_TRANSACTIONS',\n code: 51,\n /**\n * The concurrent transactions error has \"retriable\" set to false on the protocol documentation (https://kafka.apache.org/protocol.html#protocol_error_codes)\n * but the server expects the clients to retry. PR #223\n * @see https://github.com/apache/kafka/blob/12f310d50e7f5b1c18c4f61a119a6cd830da3bc0/core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala#L153\n */\n retriable: true,\n message:\n 'The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing',\n },\n {\n type: 'TRANSACTION_COORDINATOR_FENCED',\n code: 52,\n retriable: false,\n message:\n 'Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer',\n },\n {\n type: 'TRANSACTIONAL_ID_AUTHORIZATION_FAILED',\n code: 53,\n retriable: false,\n message: 'Transactional Id authorization failed',\n },\n {\n type: 'SECURITY_DISABLED',\n code: 54,\n retriable: false,\n message: 'Security features are disabled',\n },\n {\n type: 'OPERATION_NOT_ATTEMPTED',\n code: 55,\n retriable: false,\n message:\n 'The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest',\n },\n {\n type: 'KAFKA_STORAGE_ERROR',\n code: 56,\n retriable: true,\n message: 'Disk error when trying to access log file on the disk',\n },\n {\n type: 'LOG_DIR_NOT_FOUND',\n code: 57,\n retriable: false,\n message: 'The user-specified log directory is not found in the broker config',\n },\n {\n type: 'SASL_AUTHENTICATION_FAILED',\n code: 58,\n retriable: false,\n message: 'SASL Authentication failed',\n helpUrl: websiteUrl('docs/configuration', 'sasl'),\n },\n {\n type: 'UNKNOWN_PRODUCER_ID',\n code: 59,\n retriable: false,\n message:\n \"This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer's records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer's metadata is removed from the broker, and future appends by the producer will return this exception\",\n },\n {\n type: 'REASSIGNMENT_IN_PROGRESS',\n code: 60,\n retriable: false,\n message: 'A partition reassignment is in progress',\n },\n {\n type: 'DELEGATION_TOKEN_AUTH_DISABLED',\n code: 61,\n retriable: false,\n message: 'Delegation Token feature is not enabled',\n },\n {\n type: 'DELEGATION_TOKEN_NOT_FOUND',\n code: 62,\n retriable: false,\n message: 'Delegation Token is not found on server',\n },\n {\n type: 'DELEGATION_TOKEN_OWNER_MISMATCH',\n code: 63,\n retriable: false,\n message: 'Specified Principal is not valid Owner/Renewer',\n },\n {\n type: 'DELEGATION_TOKEN_REQUEST_NOT_ALLOWED',\n code: 64,\n retriable: false,\n message:\n 'Delegation Token requests are not allowed on PLAINTEXT/1-way SSL channels and on delegation token authenticated channels',\n },\n {\n type: 'DELEGATION_TOKEN_AUTHORIZATION_FAILED',\n code: 65,\n retriable: false,\n message: 'Delegation Token authorization failed',\n },\n {\n type: 'DELEGATION_TOKEN_EXPIRED',\n code: 66,\n retriable: false,\n message: 'Delegation Token is expired',\n },\n {\n type: 'INVALID_PRINCIPAL_TYPE',\n code: 67,\n retriable: false,\n message: 'Supplied principalType is not supported',\n },\n {\n type: 'NON_EMPTY_GROUP',\n code: 68,\n retriable: false,\n message: 'The group is not empty',\n },\n {\n type: 'GROUP_ID_NOT_FOUND',\n code: 69,\n retriable: false,\n message: 'The group id was not found',\n },\n {\n type: 'FETCH_SESSION_ID_NOT_FOUND',\n code: 70,\n retriable: true,\n message: 'The fetch session ID was not found',\n },\n {\n type: 'INVALID_FETCH_SESSION_EPOCH',\n code: 71,\n retriable: true,\n message: 'The fetch session epoch is invalid',\n },\n {\n type: 'LISTENER_NOT_FOUND',\n code: 72,\n retriable: true,\n message:\n 'There is no listener on the leader broker that matches the listener on which metadata request was processed',\n },\n {\n type: 'TOPIC_DELETION_DISABLED',\n code: 73,\n retriable: false,\n message: 'Topic deletion is disabled',\n },\n {\n type: 'FENCED_LEADER_EPOCH',\n code: 74,\n retriable: true,\n message: 'The leader epoch in the request is older than the epoch on the broker',\n },\n {\n type: 'UNKNOWN_LEADER_EPOCH',\n code: 75,\n retriable: true,\n message: 'The leader epoch in the request is newer than the epoch on the broker',\n },\n {\n type: 'UNSUPPORTED_COMPRESSION_TYPE',\n code: 76,\n retriable: false,\n message: 'The requesting client does not support the compression type of given partition',\n },\n {\n type: 'STALE_BROKER_EPOCH',\n code: 77,\n retriable: false,\n message: 'Broker epoch has changed',\n },\n {\n type: 'OFFSET_NOT_AVAILABLE',\n code: 78,\n retriable: true,\n message:\n 'The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing',\n },\n {\n type: 'MEMBER_ID_REQUIRED',\n code: 79,\n retriable: false,\n message:\n 'The group member needs to have a valid member id before actually entering a consumer group',\n },\n {\n type: 'PREFERRED_LEADER_NOT_AVAILABLE',\n code: 80,\n retriable: true,\n message: 'The preferred leader was not available',\n },\n {\n type: 'GROUP_MAX_SIZE_REACHED',\n code: 81,\n retriable: false,\n message:\n 'The consumer group has reached its max size. It already has the configured maximum number of members',\n },\n {\n type: 'FENCED_INSTANCE_ID',\n code: 82,\n retriable: false,\n message:\n 'The broker rejected this static consumer since another consumer with the same group instance id has registered with a different member id',\n },\n {\n type: 'ELIGIBLE_LEADERS_NOT_AVAILABLE',\n code: 83,\n retriable: true,\n message: 'Eligible topic partition leaders are not available',\n },\n {\n type: 'ELECTION_NOT_NEEDED',\n code: 84,\n retriable: true,\n message: 'Leader election not needed for topic partition',\n },\n {\n type: 'NO_REASSIGNMENT_IN_PROGRESS',\n code: 85,\n retriable: false,\n message: 'No partition reassignment is in progress',\n },\n {\n type: 'GROUP_SUBSCRIBED_TO_TOPIC',\n code: 86,\n retriable: false,\n message:\n 'Deleting offsets of a topic is forbidden while the consumer group is actively subscribed to it',\n },\n {\n type: 'INVALID_RECORD',\n code: 87,\n retriable: false,\n message: 'This record has failed the validation on broker and hence be rejected',\n },\n {\n type: 'UNSTABLE_OFFSET_COMMIT',\n code: 88,\n retriable: true,\n message: 'There are unstable offsets that need to be cleared',\n },\n]\n\nconst unknownErrorCode = errorCode => ({\n type: 'KAFKAJS_UNKNOWN_ERROR_CODE',\n code: -99,\n retriable: false,\n message: `Unknown error code ${errorCode}`,\n})\n\nconst SUCCESS_CODE = 0\nconst UNSUPPORTED_VERSION_CODE = 35\n\nconst failure = code => code !== SUCCESS_CODE\nconst createErrorFromCode = code => {\n return new KafkaJSProtocolError(errorCodes.find(e => e.code === code) || unknownErrorCode(code))\n}\n\nconst failIfVersionNotSupported = code => {\n if (code === UNSUPPORTED_VERSION_CODE) {\n throw createErrorFromCode(UNSUPPORTED_VERSION_CODE)\n }\n}\n\nconst staleMetadata = e =>\n ['UNKNOWN_TOPIC_OR_PARTITION', 'LEADER_NOT_AVAILABLE', 'NOT_LEADER_FOR_PARTITION'].includes(\n e.type\n )\n\nmodule.exports = {\n failure,\n errorCodes,\n createErrorFromCode,\n failIfVersionNotSupported,\n staleMetadata,\n}\n","/**\n * Enum for isolation levels\n * @readonly\n * @enum {number}\n */\nmodule.exports = {\n // Makes all records visible\n READ_UNCOMMITTED: 0,\n\n // non-transactional and COMMITTED transactional records are visible. It returns all data\n // from offsets smaller than the current LSO (last stable offset), and enables the inclusion of\n // the list of aborted transactions in the result, which allows consumers to discard ABORTED\n // transactional records\n READ_COMMITTED: 1,\n}\n","const { promisify } = require('util')\nconst zlib = require('zlib')\n\nconst gzip = promisify(zlib.gzip)\nconst unzip = promisify(zlib.unzip)\n\nmodule.exports = {\n /**\n * @param {Encoder} encoder\n * @returns {Promise}\n */\n async compress(encoder) {\n return await gzip(encoder.buffer)\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Promise}\n */\n async decompress(buffer) {\n return await unzip(buffer)\n },\n}\n","const { KafkaJSNotImplemented } = require('../../../errors')\n\nconst COMPRESSION_CODEC_MASK = 0x07\n\nconst Types = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n}\n\nconst Codecs = {\n [Types.GZIP]: () => require('./gzip'),\n [Types.Snappy]: () => {\n throw new KafkaJSNotImplemented('Snappy compression not implemented')\n },\n [Types.LZ4]: () => {\n throw new KafkaJSNotImplemented('LZ4 compression not implemented')\n },\n [Types.ZSTD]: () => {\n throw new KafkaJSNotImplemented('ZSTD compression not implemented')\n },\n}\n\nconst lookupCodec = type => (Codecs[type] ? Codecs[type]() : null)\nconst lookupCodecByAttributes = attributes => {\n const codec = Codecs[attributes & COMPRESSION_CODEC_MASK]\n return codec ? codec() : null\n}\n\nmodule.exports = {\n Types,\n Codecs,\n lookupCodec,\n lookupCodecByAttributes,\n COMPRESSION_CODEC_MASK,\n}\n","const {\n KafkaJSPartialMessageError,\n KafkaJSUnsupportedMagicByteInMessageSet,\n} = require('../../errors')\n\nconst V0Decoder = require('./v0/decoder')\nconst V1Decoder = require('./v1/decoder')\n\nconst decodeMessage = (decoder, magicByte) => {\n switch (magicByte) {\n case 0:\n return V0Decoder(decoder)\n case 1:\n return V1Decoder(decoder)\n default:\n throw new KafkaJSUnsupportedMagicByteInMessageSet(\n `Unsupported MessageSet message version, magic byte: ${magicByte}`\n )\n }\n}\n\nmodule.exports = (offset, size, decoder) => {\n // Don't decrement decoder.offset because slice is already considering the current\n // offset of the decoder\n const remainingBytes = Buffer.byteLength(decoder.slice(size).buffer)\n\n if (remainingBytes < size) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: remainingBytes(${remainingBytes}) < messageSize(${size})`\n )\n }\n\n const crc = decoder.readInt32()\n const magicByte = decoder.readInt8()\n const message = decodeMessage(decoder, magicByte)\n return Object.assign({ offset, size, crc, magicByte }, message)\n}\n","const versions = {\n 0: require('./v0'),\n 1: require('./v1'),\n}\n\nmodule.exports = ({ version = 0 }) => versions[version]\n","module.exports = decoder => ({\n attributes: decoder.readInt8(),\n key: decoder.readBytes(),\n value: decoder.readBytes(),\n})\n","const Encoder = require('../../encoder')\nconst crc32 = require('../../crc32')\nconst { Types: Compression, COMPRESSION_CODEC_MASK } = require('../compression')\n\n/**\n * v0\n * Message => Crc MagicByte Attributes Key Value\n * Crc => int32\n * MagicByte => int8\n * Attributes => int8\n * Key => bytes\n * Value => bytes\n */\n\nmodule.exports = ({ compression = Compression.None, key, value }) => {\n const content = new Encoder()\n .writeInt8(0) // magicByte\n .writeInt8(compression & COMPRESSION_CODEC_MASK)\n .writeBytes(key)\n .writeBytes(value)\n\n const crc = crc32(content)\n return new Encoder().writeInt32(crc).writeEncoder(content)\n}\n","module.exports = decoder => ({\n attributes: decoder.readInt8(),\n timestamp: decoder.readInt64().toString(),\n key: decoder.readBytes(),\n value: decoder.readBytes(),\n})\n","const Encoder = require('../../encoder')\nconst crc32 = require('../../crc32')\nconst { Types: Compression, COMPRESSION_CODEC_MASK } = require('../compression')\n\n/**\n * v1 (supported since 0.10.0)\n * Message => Crc MagicByte Attributes Key Value\n * Crc => int32\n * MagicByte => int8\n * Attributes => int8\n * Timestamp => int64\n * Key => bytes\n * Value => bytes\n */\n\nmodule.exports = ({ compression = Compression.None, timestamp = Date.now(), key, value }) => {\n const content = new Encoder()\n .writeInt8(1) // magicByte\n .writeInt8(compression & COMPRESSION_CODEC_MASK)\n .writeInt64(timestamp)\n .writeBytes(key)\n .writeBytes(value)\n\n const crc = crc32(content)\n return new Encoder().writeInt32(crc).writeEncoder(content)\n}\n","const Long = require('../../utils/long')\nconst Decoder = require('../decoder')\nconst MessageDecoder = require('../message/decoder')\nconst { lookupCodecByAttributes } = require('../message/compression')\nconst { KafkaJSPartialMessageError } = require('../../errors')\n\n/**\n * MessageSet => [Offset MessageSize Message]\n * Offset => int64\n * MessageSize => int32\n * Message => Bytes\n */\n\nmodule.exports = async (primaryDecoder, size = null) => {\n const messages = []\n const messageSetSize = size || primaryDecoder.readInt32()\n const messageSetDecoder = primaryDecoder.slice(messageSetSize)\n\n while (messageSetDecoder.offset < messageSetSize) {\n try {\n const message = EntryDecoder(messageSetDecoder)\n const codec = lookupCodecByAttributes(message.attributes)\n\n if (codec) {\n const buffer = await codec.decompress(message.value)\n messages.push(...EntriesDecoder(new Decoder(buffer), message))\n } else {\n messages.push(message)\n }\n } catch (e) {\n if (e.name === 'KafkaJSPartialMessageError') {\n // We tried to decode a partial message, it means that minBytes\n // is probably too low\n break\n }\n\n if (e.name === 'KafkaJSUnsupportedMagicByteInMessageSet') {\n // Received a MessageSet and a RecordBatch on the same response, the cluster is probably\n // upgrading the message format from 0.10 to 0.11. Stop processing this message set to\n // receive the full record batch on the next request\n break\n }\n\n throw e\n }\n }\n\n primaryDecoder.forward(messageSetSize)\n return messages\n}\n\nconst EntriesDecoder = (decoder, compressedMessage) => {\n const messages = []\n\n while (decoder.offset < decoder.buffer.length) {\n messages.push(EntryDecoder(decoder))\n }\n\n if (compressedMessage.magicByte > 0 && compressedMessage.offset >= 0) {\n const compressedOffset = Long.fromValue(compressedMessage.offset)\n const lastMessageOffset = Long.fromValue(messages[messages.length - 1].offset)\n const baseOffset = compressedOffset - lastMessageOffset\n\n for (const message of messages) {\n message.offset = Long.fromValue(message.offset)\n .add(baseOffset)\n .toString()\n }\n }\n\n return messages\n}\n\nconst EntryDecoder = decoder => {\n if (!decoder.canReadInt64()) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: There isn't enough bytes to read the offset`\n )\n }\n\n const offset = decoder.readInt64().toString()\n\n if (!decoder.canReadInt32()) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: There isn't enough bytes to read the message size`\n )\n }\n\n const size = decoder.readInt32()\n return MessageDecoder(offset, size, decoder)\n}\n","const Encoder = require('../encoder')\nconst MessageProtocol = require('../message')\nconst { Types } = require('../message/compression')\n\n/**\n * MessageSet => [Offset MessageSize Message]\n * Offset => int64\n * MessageSize => int32\n * Message => Bytes\n */\n\n/**\n * [\n * { key: \"\", value: \"\" },\n * { key: \"\", value: \"\" },\n * ]\n */\nmodule.exports = ({ messageVersion = 0, compression, entries }) => {\n const isCompressed = compression !== Types.None\n const Message = MessageProtocol({ version: messageVersion })\n const encoder = new Encoder()\n\n // Messages in a message set are __not__ encoded as an array.\n // They are written in sequence.\n // https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Messagesets\n\n entries.forEach((entry, i) => {\n const message = Message(entry)\n\n // This is the offset used in kafka as the log sequence number.\n // When the producer is sending non compressed messages, it can set the offsets to anything\n // When the producer is sending compressed messages, to avoid server side recompression, each compressed message\n // should have offset starting from 0 and increasing by one for each inner message in the compressed message\n encoder.writeInt64(isCompressed ? i : -1)\n encoder.writeInt32(message.size())\n\n encoder.writeEncoder(message)\n })\n\n return encoder\n}\n","/**\n * A javascript implementation of the CRC32 checksum that uses\n * the CRC32-C polynomial, the same polynomial used by iSCSI\n *\n * also known as CRC32 Castagnoli\n * based on: https://github.com/ashi009/node-fast-crc32c/blob/master/impls/js_crc32c.js\n */\nconst crc32C = buffer => {\n let crc = 0 ^ -1\n for (let i = 0; i < buffer.length; i++) {\n crc = T[(crc ^ buffer[i]) & 0xff] ^ (crc >>> 8)\n }\n\n return (crc ^ -1) >>> 0\n}\n\nmodule.exports = crc32C\n\n// prettier-ignore\nvar T = new Int32Array([\n 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,\n 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,\n 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,\n 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,\n 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,\n 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,\n 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,\n 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,\n 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,\n 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,\n 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,\n 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,\n 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,\n 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,\n 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,\n 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,\n 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,\n 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,\n 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,\n 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,\n 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,\n 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,\n 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,\n 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,\n 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,\n 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,\n 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,\n 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,\n 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,\n 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,\n 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,\n 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,\n 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,\n 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,\n 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,\n 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,\n 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,\n 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,\n 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,\n 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,\n 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,\n 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,\n 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,\n 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,\n 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,\n 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,\n 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,\n 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,\n 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,\n 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,\n 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,\n 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,\n 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,\n 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,\n 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,\n 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,\n 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,\n 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,\n 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,\n 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,\n 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,\n 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,\n 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,\n 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351\n]);\n","const crc32C = require('./crc32C')\nconst unsigned = value => Uint32Array.from([value])[0]\n\nmodule.exports = buffer => unsigned(crc32C(buffer))\n","module.exports = decoder => ({\n key: decoder.readVarIntString(),\n value: decoder.readVarIntBytes(),\n})\n","const Encoder = require('../../../encoder')\n\n/**\n * v0\n * Header => Key Value\n * Key => varInt|string\n * Value => varInt|bytes\n */\n\nmodule.exports = ({ key, value }) => {\n return new Encoder().writeVarIntString(key).writeVarIntBytes(value)\n}\n","const Long = require('../../../../utils/long')\nconst HeaderDecoder = require('../../header/v0/decoder')\nconst TimestampTypes = require('../../../timestampTypes')\n\n/**\n * v0\n * Record =>\n * Length => Varint\n * Attributes => Int8\n * TimestampDelta => Varlong\n * OffsetDelta => Varint\n * Key => varInt|Bytes\n * Value => varInt|Bytes\n * Headers => [HeaderKey HeaderValue]\n * HeaderKey => VarInt|String\n * HeaderValue => VarInt|Bytes\n */\n\nmodule.exports = (decoder, batchContext = {}) => {\n const {\n firstOffset,\n firstTimestamp,\n magicByte,\n isControlBatch = false,\n timestampType,\n maxTimestamp,\n } = batchContext\n const attributes = decoder.readInt8()\n\n const timestampDelta = decoder.readVarLong()\n const timestamp =\n timestampType === TimestampTypes.LOG_APPEND_TIME && maxTimestamp\n ? maxTimestamp\n : Long.fromValue(firstTimestamp)\n .add(timestampDelta)\n .toString()\n\n const offsetDelta = decoder.readVarInt()\n const offset = Long.fromValue(firstOffset)\n .add(offsetDelta)\n .toString()\n\n const key = decoder.readVarIntBytes()\n const value = decoder.readVarIntBytes()\n const headers = decoder\n .readVarIntArray(HeaderDecoder)\n .reduce((obj, { key, value }) => ({ ...obj, [key]: value }), {})\n\n return {\n magicByte,\n attributes, // Record level attributes are presently unused\n timestamp,\n offset,\n key,\n value,\n headers,\n isControlRecord: isControlBatch,\n batchContext,\n }\n}\n","const Encoder = require('../../../encoder')\nconst Header = require('../../header/v0')\n\n/**\n * v0\n * Record =>\n * Length => Varint\n * Attributes => Int8\n * TimestampDelta => Varlong\n * OffsetDelta => Varint\n * Key => varInt|Bytes\n * Value => varInt|Bytes\n * Headers => [HeaderKey HeaderValue]\n * HeaderKey => VarInt|String\n * HeaderValue => VarInt|Bytes\n */\n\n/**\n * @param [offsetDelta=0] {Integer}\n * @param [timestampDelta=0] {Long}\n * @param key {Buffer}\n * @param value {Buffer}\n * @param [headers={}] {Object}\n */\nmodule.exports = ({ offsetDelta = 0, timestampDelta = 0, key, value, headers = {} }) => {\n const headersArray = Object.keys(headers).map(headerKey => ({\n key: headerKey,\n value: headers[headerKey],\n }))\n\n const sizeOfBody =\n 1 + // always one byte for attributes\n Encoder.sizeOfVarLong(timestampDelta) +\n Encoder.sizeOfVarInt(offsetDelta) +\n Encoder.sizeOfVarIntBytes(key) +\n Encoder.sizeOfVarIntBytes(value) +\n sizeOfHeaders(headersArray)\n\n return new Encoder()\n .writeVarInt(sizeOfBody)\n .writeInt8(0) // no used record attributes at the moment\n .writeVarLong(timestampDelta)\n .writeVarInt(offsetDelta)\n .writeVarIntBytes(key)\n .writeVarIntBytes(value)\n .writeVarIntArray(headersArray.map(Header))\n}\n\nconst sizeOfHeaders = headersArray => {\n let size = Encoder.sizeOfVarInt(headersArray.length)\n\n for (const header of headersArray) {\n const keySize = Buffer.byteLength(header.key)\n const valueSize = Buffer.byteLength(header.value)\n\n size += Encoder.sizeOfVarInt(keySize) + keySize\n\n if (header.value === null) {\n size += Encoder.sizeOfVarInt(-1)\n } else {\n size += Encoder.sizeOfVarInt(valueSize) + valueSize\n }\n }\n\n return size\n}\n","const Decoder = require('../../decoder')\nconst { KafkaJSPartialMessageError } = require('../../../errors')\nconst { lookupCodecByAttributes } = require('../../message/compression')\nconst RecordDecoder = require('../record/v0/decoder')\nconst TimestampTypes = require('../../timestampTypes')\n\nconst TIMESTAMP_TYPE_FLAG_MASK = 0x8\nconst TRANSACTIONAL_FLAG_MASK = 0x10\nconst CONTROL_FLAG_MASK = 0x20\n\n/**\n * v0\n * RecordBatch =>\n * FirstOffset => int64\n * Length => int32\n * PartitionLeaderEpoch => int32\n * Magic => int8\n * CRC => int32\n * Attributes => int16\n * LastOffsetDelta => int32\n * FirstTimestamp => int64\n * MaxTimestamp => int64\n * ProducerId => int64\n * ProducerEpoch => int16\n * FirstSequence => int32\n * Records => [Record]\n */\n\nmodule.exports = async fetchDecoder => {\n const firstOffset = fetchDecoder.readInt64().toString()\n const length = fetchDecoder.readInt32()\n const decoder = fetchDecoder.slice(length)\n fetchDecoder.forward(length)\n\n const remainingBytes = Buffer.byteLength(decoder.buffer)\n\n if (remainingBytes < length) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial record batch: remainingBytes(${remainingBytes}) < recordBatchLength(${length})`\n )\n }\n\n const partitionLeaderEpoch = decoder.readInt32()\n\n // The magic byte was read by the Fetch protocol to distinguish between\n // the record batch and the legacy message set. It's not used here but\n // it has to be read.\n const magicByte = decoder.readInt8() // eslint-disable-line no-unused-vars\n\n // The library is currently not performing CRC validations\n const crc = decoder.readInt32() // eslint-disable-line no-unused-vars\n\n const attributes = decoder.readInt16()\n const lastOffsetDelta = decoder.readInt32()\n const firstTimestamp = decoder.readInt64().toString()\n const maxTimestamp = decoder.readInt64().toString()\n const producerId = decoder.readInt64().toString()\n const producerEpoch = decoder.readInt16()\n const firstSequence = decoder.readInt32()\n\n const inTransaction = (attributes & TRANSACTIONAL_FLAG_MASK) > 0\n const isControlBatch = (attributes & CONTROL_FLAG_MASK) > 0\n const timestampType =\n (attributes & TIMESTAMP_TYPE_FLAG_MASK) > 0\n ? TimestampTypes.LOG_APPEND_TIME\n : TimestampTypes.CREATE_TIME\n\n const codec = lookupCodecByAttributes(attributes)\n\n const recordContext = {\n firstOffset,\n firstTimestamp,\n partitionLeaderEpoch,\n inTransaction,\n isControlBatch,\n lastOffsetDelta,\n producerId,\n producerEpoch,\n firstSequence,\n maxTimestamp,\n timestampType,\n }\n\n const records = await decodeRecords(codec, decoder, { ...recordContext, magicByte })\n\n return {\n ...recordContext,\n records,\n }\n}\n\nconst decodeRecords = async (codec, recordsDecoder, recordContext) => {\n if (!codec) {\n return recordsDecoder.readArray(decoder => decodeRecord(decoder, recordContext))\n }\n\n const length = recordsDecoder.readInt32()\n\n if (length <= 0) {\n return []\n }\n\n const compressedRecordsBuffer = recordsDecoder.readAll()\n const decompressedRecordBuffer = await codec.decompress(compressedRecordsBuffer)\n const decompressedRecordDecoder = new Decoder(decompressedRecordBuffer)\n const records = new Array(length)\n\n for (let i = 0; i < length; i++) {\n records[i] = decodeRecord(decompressedRecordDecoder, recordContext)\n }\n\n return records\n}\n\nconst decodeRecord = (decoder, recordContext) => {\n const recordBuffer = decoder.readVarIntBytes()\n return RecordDecoder(new Decoder(recordBuffer), recordContext)\n}\n","const Long = require('../../../utils/long')\nconst Encoder = require('../../encoder')\nconst crc32C = require('../crc32C')\nconst {\n Types: Compression,\n lookupCodec,\n COMPRESSION_CODEC_MASK,\n} = require('../../message/compression')\n\nconst MAGIC_BYTE = 2\nconst TIMESTAMP_MASK = 0 // The fourth lowest bit, always set this bit to 0 (since 0.10.0)\nconst TRANSACTIONAL_MASK = 16 // The fifth lowest bit\n\n/**\n * v0\n * RecordBatch =>\n * FirstOffset => int64\n * Length => int32\n * PartitionLeaderEpoch => int32\n * Magic => int8\n * CRC => int32\n * Attributes => int16\n * LastOffsetDelta => int32\n * FirstTimestamp => int64\n * MaxTimestamp => int64\n * ProducerId => int64\n * ProducerEpoch => int16\n * FirstSequence => int32\n * Records => [Record]\n */\n\nconst RecordBatch = async ({\n compression = Compression.None,\n firstOffset = Long.fromInt(0),\n firstTimestamp = Date.now(),\n maxTimestamp = Date.now(),\n partitionLeaderEpoch = 0,\n lastOffsetDelta = 0,\n transactional = false,\n producerId = Long.fromValue(-1), // for idempotent messages\n producerEpoch = 0, // for idempotent messages\n firstSequence = 0, // for idempotent messages\n records = [],\n}) => {\n const COMPRESSION_CODEC = compression & COMPRESSION_CODEC_MASK\n const IN_TRANSACTION = transactional ? TRANSACTIONAL_MASK : 0\n const attributes = COMPRESSION_CODEC | TIMESTAMP_MASK | IN_TRANSACTION\n\n const batchBody = new Encoder()\n .writeInt16(attributes)\n .writeInt32(lastOffsetDelta)\n .writeInt64(firstTimestamp)\n .writeInt64(maxTimestamp)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeInt32(firstSequence)\n\n if (compression === Compression.None) {\n if (records.every(v => typeof v === typeof records[0])) {\n batchBody.writeArray(records, typeof records[0])\n } else {\n batchBody.writeArray(records)\n }\n } else {\n const compressedRecords = await compressRecords(compression, records)\n batchBody.writeInt32(records.length).writeBuffer(compressedRecords)\n }\n\n // CRC32C validation is happening here:\n // https://github.com/apache/kafka/blob/0.11.0.1/clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java#L148\n\n const batch = new Encoder()\n .writeInt32(partitionLeaderEpoch)\n .writeInt8(MAGIC_BYTE)\n .writeUInt32(crc32C(batchBody.buffer))\n .writeEncoder(batchBody)\n\n return new Encoder().writeInt64(firstOffset).writeBytes(batch.buffer)\n}\n\nconst compressRecords = async (compression, records) => {\n const codec = lookupCodec(compression)\n const recordsEncoder = new Encoder()\n\n recordsEncoder.writeEncoderArray(records)\n\n return codec.compress(recordsEncoder)\n}\n\nmodule.exports = {\n RecordBatch,\n MAGIC_BYTE,\n}\n","const Encoder = require('./encoder')\n\nmodule.exports = async ({ correlationId, clientId, request: { apiKey, apiVersion, encode } }) => {\n const payload = await encode()\n const requestPayload = new Encoder()\n .writeInt16(apiKey)\n .writeInt16(apiVersion)\n .writeInt32(correlationId)\n .writeString(clientId)\n .writeEncoder(payload)\n\n return new Encoder().writeInt32(requestPayload.size()).writeEncoder(requestPayload)\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, groupId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, producerId, producerEpoch, groupId }), response }\n },\n 1: ({ transactionalId, producerId, producerEpoch, groupId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, producerId, producerEpoch, groupId }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AddOffsetsToTxn: apiKey } = require('../../apiKeys')\n\n/**\n * AddOffsetsToTxn Request (Version: 0) => transactional_id producer_id producer_epoch group_id\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * group_id => STRING\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, groupId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AddOffsetsToTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeString(groupId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * AddOffsetsToTxn Response (Version: 0) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AddOffsetsToTxn Request (Version: 1) => transactional_id producer_id producer_epoch group_id\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * group_id => STRING\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, groupId }) =>\n Object.assign(\n requestV0({\n transactionalId,\n producerId,\n producerEpoch,\n groupId,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AddOffsetsToTxn Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, producerId, producerEpoch, topics }), response }\n },\n 1: ({ transactionalId, producerId, producerEpoch, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, producerId, producerEpoch, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AddPartitionsToTxn: apiKey } = require('../../apiKeys')\n\n/**\n * AddPartitionsToTxn Request (Version: 0) => transactional_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AddPartitionsToTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = partition => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * AddPartitionsToTxn Response (Version: 0) => throttle_time_ms [errors]\n * throttle_time_ms => INT32\n * errors => topic [partition_errors]\n * topic => STRING\n * partition_errors => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errors = await decoder.readArrayAsync(decodeError)\n\n return {\n throttleTime,\n errors,\n }\n}\n\nconst decodeError = async decoder => ({\n topic: decoder.readString(),\n partitionErrors: await decoder.readArrayAsync(decodePartitionError),\n})\n\nconst decodePartitionError = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const topicsWithErrors = data.errors\n .map(({ partitionErrors }) => ({\n partitionsWithErrors: partitionErrors.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n throw createErrorFromCode(topicsWithErrors[0].partitionsWithErrors[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AddPartitionsToTxn Request (Version: 1) => transactional_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, topics }) =>\n Object.assign(\n requestV0({\n transactionalId,\n producerId,\n producerEpoch,\n topics,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AddPartitionsToTxn Response (Version: 1) => throttle_time_ms [errors]\n * throttle_time_ms => INT32\n * errors => topic [partition_errors]\n * topic => STRING\n * partition_errors => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ resources, validateOnly }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ resources, validateOnly }), response }\n },\n 1: ({ resources, validateOnly }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ resources, validateOnly }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AlterConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * AlterConfigs Request (Version: 0) => [resources] validate_only\n * resources => resource_type resource_name [config_entries]\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * validate_only => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of resources to change\n * @param {boolean} [validateOnly=false]\n */\nmodule.exports = ({ resources, validateOnly = false }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AlterConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource)).writeBoolean(validateOnly)\n },\n})\n\nconst encodeResource = ({ type, name, configEntries }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * AlterConfigs Response (Version: 0) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n */\n\nconst decodeResources = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nconst parse = async data => {\n const resourcesWithError = data.resources.filter(({ errorCode }) => failure(errorCode))\n if (resourcesWithError.length > 0) {\n throw createErrorFromCode(resourcesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AlterConfigs Request (Version: 1) => [resources] validate_only\n * resources => resource_type resource_name [config_entries]\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * validate_only => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of resources to change\n * @param {boolean} [validateOnly=false]\n */\nmodule.exports = ({ resources, validateOnly }) =>\n Object.assign(\n requestV0({\n resources,\n validateOnly,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AlterConfigs Response (Version: 1) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","module.exports = {\n Produce: 0,\n Fetch: 1,\n ListOffsets: 2,\n Metadata: 3,\n LeaderAndIsr: 4,\n StopReplica: 5,\n UpdateMetadata: 6,\n ControlledShutdown: 7,\n OffsetCommit: 8,\n OffsetFetch: 9,\n GroupCoordinator: 10,\n JoinGroup: 11,\n Heartbeat: 12,\n LeaveGroup: 13,\n SyncGroup: 14,\n DescribeGroups: 15,\n ListGroups: 16,\n SaslHandshake: 17,\n ApiVersions: 18, // ApiVersions v0 on Kafka 0.10\n CreateTopics: 19,\n DeleteTopics: 20,\n DeleteRecords: 21,\n InitProducerId: 22,\n OffsetForLeaderEpoch: 23,\n AddPartitionsToTxn: 24,\n AddOffsetsToTxn: 25,\n EndTxn: 26,\n WriteTxnMarkers: 27,\n TxnOffsetCommit: 28,\n DescribeAcls: 29,\n CreateAcls: 30,\n DeleteAcls: 31,\n DescribeConfigs: 32,\n AlterConfigs: 33, // ApiVersions v0 and v1 on Kafka 0.11\n AlterReplicaLogDirs: 34,\n DescribeLogDirs: 35,\n SaslAuthenticate: 36,\n CreatePartitions: 37,\n CreateDelegationToken: 38,\n RenewDelegationToken: 39,\n ExpireDelegationToken: 40,\n DescribeDelegationToken: 41,\n DeleteGroups: 42, // ApiVersions v2 on Kafka 1.0\n ElectPreferredLeaders: 43,\n}\n","const logResponseError = false\n\nconst versions = {\n 0: () => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(), response, logResponseError: true }\n },\n 1: () => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(), response, logResponseError }\n },\n 2: () => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request(), response, logResponseError }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ApiVersions: apiKey } = require('../../apiKeys')\n\n/**\n * ApiVersionRequest => ApiKeys\n */\n\nmodule.exports = () => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ApiVersions',\n encode: async () => new Encoder(),\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * ApiVersionResponse => ApiVersions\n * ErrorCode = INT16\n * ApiVersions = [ApiVersion]\n * ApiVersion = ApiKey MinVersion MaxVersion\n * ApiKey = INT16\n * MinVersion = INT16\n * MaxVersion = INT16\n */\n\nconst apiVersion = decoder => ({\n apiKey: decoder.readInt16(),\n minVersion: decoder.readInt16(),\n maxVersion: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n apiVersions: decoder.readArray(apiVersion),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n// ApiVersions Request after v1 indicates the client can parse throttle_time_ms\n\nmodule.exports = () => ({ ...requestV0(), apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * ApiVersions Response (Version: 1) => error_code [api_versions] throttle_time_ms\n * error_code => INT16\n * api_versions => api_key min_version max_version\n * api_key => INT16\n * min_version => INT16\n * max_version => INT16\n * throttle_time_ms => INT32\n */\n\nconst apiVersion = decoder => ({\n apiKey: decoder.readInt16(),\n minVersion: decoder.readInt16(),\n maxVersion: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const apiVersions = decoder.readArray(apiVersion)\n\n /**\n * The Java client defaults this value to 0 if not present,\n * even though it is required in the protocol. This is to\n * work around https://github.com/tulios/kafkajs/issues/491\n *\n * See:\n * https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/protocol/CommonFields.java#L23-L25\n */\n const throttleTime = decoder.canReadInt32() ? decoder.readInt32() : 0\n\n return {\n errorCode,\n apiVersions,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV0 = require('../v0/request')\n\n// ApiVersions Request after v1 indicates the client can parse throttle_time_ms\n\nmodule.exports = () => ({ ...requestV0(), apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ApiVersions Response (Version: 2) => error_code [api_versions] throttle_time_ms\n * error_code => INT16\n * api_versions => api_key min_version max_version\n * api_key => INT16\n * min_version => INT16\n * max_version => INT16\n * throttle_time_ms => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ creations }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ creations }), response }\n },\n 1: ({ creations }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ creations }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreateAcls: apiKey } = require('../../apiKeys')\n\n/**\n * CreateAcls Request (Version: 0) => [creations]\n * creations => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => STRING\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeCreations = ({\n resourceType,\n resourceName,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ creations }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreateAcls',\n encode: async () => {\n return new Encoder().writeArray(creations.map(encodeCreations))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * CreateAcls Response (Version: 0) => throttle_time_ms [creation_responses]\n * throttle_time_ms => INT32\n * creation_responses => error_code error_message\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decodeCreationResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const creationResponses = decoder.readArray(decodeCreationResponse)\n\n return {\n throttleTime,\n creationResponses,\n }\n}\n\nconst parse = async data => {\n const creationResponsesWithError = data.creationResponses.filter(({ errorCode }) =>\n failure(errorCode)\n )\n\n if (creationResponsesWithError.length > 0) {\n throw createErrorFromCode(creationResponsesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { CreateAcls: apiKey } = require('../../apiKeys')\n\n/**\n * CreateAcls Request (Version: 1) => [creations]\n * creations => resource_type resource_name resource_pattern_type principal host operation permission_type\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeCreations = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ creations }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'CreateAcls',\n encode: async () => {\n return new Encoder().writeArray(creations.map(encodeCreations))\n },\n})\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreateAcls Response (Version: 1) => throttle_time_ms [creation_responses]\n * throttle_time_ms => INT32\n * creation_responses => error_code error_message\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topicPartitions, timeout, validateOnly }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topicPartitions, timeout, validateOnly }), response }\n },\n 1: ({ topicPartitions, validateOnly, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topicPartitions, validateOnly, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreatePartitions: apiKey } = require('../../apiKeys')\n\n/**\n * CreatePartitions Request (Version: 0) => [topic_partitions] timeout validate_only\n * topic_partitions => topic new_partitions\n * topic => STRING\n * new_partitions => count [assignment]\n * count => INT32\n * assignment => ARRAY(INT32)\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topicPartitions, validateOnly = false, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreatePartitions',\n encode: async () => {\n return new Encoder()\n .writeArray(topicPartitions.map(encodeTopicPartitions))\n .writeInt32(timeout)\n .writeBoolean(validateOnly)\n },\n})\n\nconst encodeTopicPartitions = ({ topic, count, assignments = [] }) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(count)\n .writeNullableArray(assignments.map(encodeAssignments))\n}\n\nconst encodeAssignments = brokerIds => {\n return new Encoder().writeNullableArray(brokerIds)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/*\n * CreatePartitions Response (Version: 0) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n return {\n throttleTime,\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw createErrorFromCode(topicsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * CreatePartitions Request (Version: 1) => [topic_partitions] timeout validate_only\n * topic_partitions => topic new_partitions\n * topic => STRING\n * new_partitions => count [assignment]\n * count => INT32\n * assignment => ARRAY(INT32)\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topicPartitions, validateOnly, timeout }) =>\n Object.assign(requestV0({ topicPartitions, validateOnly, timeout }), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreatePartitions Response (Version: 0) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response }\n },\n 1: ({ topics, validateOnly, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n 2: ({ topics, validateOnly, timeout }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n 3: ({ topics, validateOnly, timeout }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreateTopics: apiKey } = require('../../apiKeys')\n\n/**\n * CreateTopics Request (Version: 0) => [create_topic_requests] timeout\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n */\n\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreateTopics',\n encode: async () => {\n return new Encoder().writeArray(topics.map(encodeTopics)).writeInt32(timeout)\n },\n})\n\nconst encodeTopics = ({\n topic,\n numPartitions = 1,\n replicationFactor = 1,\n replicaAssignment = [],\n configEntries = [],\n}) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(numPartitions)\n .writeInt16(replicationFactor)\n .writeArray(replicaAssignment.map(encodeReplicaAssignment))\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeReplicaAssignment = ({ partition, replicas }) => {\n return new Encoder().writeInt32(partition).writeArray(replicas)\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst { KafkaJSAggregateError, KafkaJSCreateTopicError } = require('../../../../errors')\n\n/**\n * CreateTopics Response (Version: 0) => [topic_errors]\n * topic_errors => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw new KafkaJSAggregateError(\n 'Topic creation errors',\n topicsWithError.map(\n error => new KafkaJSCreateTopicError(createErrorFromCode(error.errorCode), error.topic)\n )\n )\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { CreateTopics: apiKey } = require('../../apiKeys')\n\n/**\n *CreateTopics Request (Version: 1) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly = false, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'CreateTopics',\n encode: async () => {\n return new Encoder()\n .writeArray(topics.map(encodeTopics))\n .writeInt32(timeout)\n .writeBoolean(validateOnly)\n },\n})\n\nconst encodeTopics = ({\n topic,\n numPartitions = 1,\n replicationFactor = 1,\n replicaAssignment = [],\n configEntries = [],\n}) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(numPartitions)\n .writeInt16(replicationFactor)\n .writeArray(replicaAssignment.map(encodeReplicaAssignment))\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeReplicaAssignment = ({ partition, replicas }) => {\n return new Encoder().writeInt32(partition).writeArray(replicas)\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * CreateTopics Response (Version: 1) => [topic_errors]\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * CreateTopics Request (Version: 2) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly, timeout }) =>\n Object.assign(requestV1({ topics, validateOnly, timeout }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\n\n/**\n * CreateTopics Response (Version: 2) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * CreateTopics Request (Version: 3) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly, timeout }) =>\n Object.assign(requestV2({ topics, validateOnly, timeout }), { apiVersion: 3 })\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * Starting in version 3, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreateTopics Response (Version: 3) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ filters }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ filters }), response }\n },\n 1: ({ filters }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ filters }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteAcls Request (Version: 0) => [filters]\n * filters => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeFilters = ({\n resourceType,\n resourceName,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ filters }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteAcls',\n encode: async () => {\n return new Encoder().writeArray(filters.map(encodeFilters))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteAcls Response (Version: 0) => throttle_time_ms [filter_responses]\n * throttle_time_ms => INT32\n * filter_responses => error_code error_message [matching_acls]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * matching_acls => error_code error_message resource_type resource_name principal host operation permission_type\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeMatchingAcls = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeFilterResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n matchingAcls: decoder.readArray(decodeMatchingAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const filterResponses = decoder.readArray(decodeFilterResponse)\n\n return {\n throttleTime,\n filterResponses,\n }\n}\n\nconst parse = async data => {\n const filterResponsesWithError = data.filterResponses.filter(({ errorCode }) =>\n failure(errorCode)\n )\n\n if (filterResponsesWithError.length > 0) {\n throw createErrorFromCode(filterResponsesWithError[0].errorCode)\n }\n\n for (const filterResponse of data.filterResponses) {\n const matchingAcls = filterResponse.matchingAcls\n const matchingAclsWithError = matchingAcls.filter(({ errorCode }) => failure(errorCode))\n\n if (matchingAclsWithError.length > 0) {\n throw createErrorFromCode(matchingAclsWithError[0].errorCode)\n }\n }\n\n return data\n}\n\nmodule.exports = {\n decodeMatchingAcls,\n decodeFilterResponse,\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteAcls Request (Version: 1) => [filters]\n * filters => resource_type resource_name resource_pattern_type_filter principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * resource_pattern_type_filter => INT8\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeFilters = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ filters }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DeleteAcls',\n encode: async () => {\n return new Encoder().writeArray(filters.map(encodeFilters))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n * Version 1 also introduces a new resource pattern type field.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-290%3A+Support+for+Prefixed+ACLs\n *\n * DeleteAcls Response (Version: 1) => throttle_time_ms [filter_responses]\n * throttle_time_ms => INT32\n * filter_responses => error_code error_message [matching_acls]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * matching_acls => error_code error_message resource_type resource_name resource_pattern_type principal host operation permission_type\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeMatchingAcls = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n resourcePatternType: decoder.readInt8(),\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeFilterResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n matchingAcls: decoder.readArray(decodeMatchingAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const filterResponses = decoder.readArray(decodeFilterResponse)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n filterResponses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: groupIds => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(groupIds), response }\n },\n 1: groupIds => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(groupIds), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteGroups: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteGroups Request (Version: 0) => [groups_names]\n * groups_names => STRING\n */\n\n/**\n */\nmodule.exports = groupIds => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteGroups',\n encode: async () => {\n return new Encoder().writeArray(groupIds.map(encodeGroups))\n },\n})\n\nconst encodeGroups = group => {\n return new Encoder().writeString(group)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n/**\n * DeleteGroups Response (Version: 0) => throttle_time_ms [results]\n * throttle_time_ms => INT32\n * results => group_id error_code\n * group_id => STRING\n * error_code => INT16\n */\n\nconst decodeGroup = decoder => ({\n groupId: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTimeMs = decoder.readInt32()\n const results = decoder.readArray(decodeGroup)\n\n for (const result of results) {\n if (failure(result.errorCode)) {\n result.error = createErrorFromCode(result.errorCode)\n }\n }\n return {\n throttleTimeMs,\n results,\n }\n}\n\nconst parse = async data => {\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteGroups Request (Version: 1)\n */\n\nmodule.exports = groupIds => Object.assign(requestV0(groupIds), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteGroups Response (Version: 1) => throttle_time_ms [results]\n * throttle_time_ms => INT32\n * results => group_id error_code\n * group_id => STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response: response({ topics }) }\n },\n 1: ({ topics, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, timeout }), response: response({ topics }) }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteRecords: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteRecords Request (Version: 0) => [topics] timeout_ms\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset\n * partition => INT32\n * offset => INT64\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteRecords',\n encode: async () => {\n return new Encoder()\n .writeArray(\n topics.map(({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(\n partitions.map(({ partition, offset }) => {\n return new Encoder().writeInt32(partition).writeInt64(offset)\n })\n )\n })\n )\n .writeInt32(timeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { KafkaJSDeleteTopicRecordsError } = require('../../../../errors')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteRecords Response (Version: 0) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => name [partitions]\n * name => STRING\n * partitions => partition low_watermark error_code\n * partition => INT32\n * low_watermark => INT64\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n topics: decoder\n .readArray(decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decoder => ({\n partition: decoder.readInt32(),\n lowWatermark: decoder.readInt64(),\n errorCode: decoder.readInt16(),\n })),\n }))\n .sort(topicNameComparator),\n }\n}\n\nconst parse = requestTopics => async data => {\n const topicsWithErrors = data.topics\n .map(({ partitions }) => ({\n partitionsWithErrors: partitions.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n // at present we only ever request one topic at a time, so can destructure the arrays\n const [{ topic }] = data.topics // topic name\n const [{ partitions: requestPartitions }] = requestTopics // requested offset(s)\n const [{ partitionsWithErrors }] = topicsWithErrors // partition(s) + error(s)\n\n throw new KafkaJSDeleteTopicRecordsError({\n topic,\n partitions: partitionsWithErrors.map(({ partition, errorCode }) => ({\n partition,\n error: createErrorFromCode(errorCode),\n // attach the original offset from the request, onto the error response\n offset: requestPartitions.find(p => p.partition === partition).offset,\n })),\n })\n }\n\n return data\n}\n\nmodule.exports = ({ topics }) => ({\n decode,\n parse: parse(topics),\n})\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteRecords Request (Version: 1) => [topics] timeout_ms\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset\n * partition => INT32\n * offset => INT64\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout }) =>\n Object.assign(requestV0({ topics, timeout }), { apiVersion: 1 })\n","const responseV0 = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteRecords Response (Version: 1) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => name [partitions]\n * name => STRING\n * partitions => partition_index low_watermark error_code\n * partition_index => INT32\n * low_watermark => INT64\n * error_code => INT16\n */\n\nmodule.exports = ({ topics }) => {\n const { parse, decode: decodeV0 } = responseV0({ topics })\n\n const decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n }\n\n return {\n decode,\n parse,\n }\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response }\n },\n 1: ({ topics, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteTopics: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteTopics Request (Version: 0) => [topics] timeout\n * topics => STRING\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteTopics',\n encode: async () => {\n return new Encoder().writeArray(topics).writeInt32(timeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteTopics Response (Version: 0) => [topic_error_codes]\n * topic_error_codes => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw createErrorFromCode(topicsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteTopics Request (Version: 1) => [topics] timeout\n * topics => STRING\n * timeout => INT32\n */\n\nmodule.exports = ({ topics, timeout }) =>\n Object.assign(requestV0({ topics, timeout }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteTopics Response (Version: 1) => throttle_time_ms [topic_error_codes]\n * throttle_time_ms => INT32\n * topic_error_codes => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ resourceType, resourceName, principal, host, operation, permissionType }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ resourceType, resourceName, principal, host, operation, permissionType }),\n response,\n }\n },\n 1: ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeAcls Request (Version: 0) => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nmodule.exports = ({ resourceType, resourceName, principal, host, operation, permissionType }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeAcls',\n encode: async () => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DescribeAcls Response (Version: 0) => throttle_time_ms error_code error_message [resources]\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resources => resource_type resource_name [acls]\n * resource_type => INT8\n * resource_name => STRING\n * acls => principal host operation permission_type\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeAcls = decoder => ({\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeResources = decoder => ({\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n acls: decoder.readArray(decodeAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n errorCode,\n errorMessage,\n resources,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeAcls Request (Version: 1) => resource_type resource_name resource_pattern_type_filter principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * resource_pattern_type_filter => INT8\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nmodule.exports = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DescribeAcls',\n encode: async () => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n },\n})\n","const { parse } = require('../v0/response')\nconst Decoder = require('../../../decoder')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n * Version 1 also introduces a new resource pattern type field.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-290%3A+Support+for+Prefixed+ACLs\n *\n * DescribeAcls Response (Version: 1) => throttle_time_ms error_code error_message [resources]\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resources => resource_type resource_name resource_pattern_type [acls]\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * acls => principal host operation permission_type\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\nconst decodeAcls = decoder => ({\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeResources = decoder => ({\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n resourcePatternType: decoder.readInt8(),\n acls: decoder.readArray(decodeAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n errorCode,\n errorMessage,\n resources,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ resources }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ resources }), response }\n },\n 1: ({ resources, includeSynonyms }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ resources, includeSynonyms }), response }\n },\n 2: ({ resources, includeSynonyms }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ resources, includeSynonyms }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeConfigs Request (Version: 0) => [resources]\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n */\nmodule.exports = ({ resources }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource))\n },\n})\n\nconst encodeResource = ({ type, name, configNames = [] }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeNullableArray(configNames)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst ConfigSource = require('../../../configSource')\nconst ConfigResourceTypes = require('../../../configResourceTypes')\n\n/**\n * DescribeConfigs Response (Version: 0) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only is_default is_sensitive\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * is_default => BOOLEAN\n * is_sensitive => BOOLEAN\n */\n\nconst decodeConfigEntries = (decoder, resourceType) => {\n const configName = decoder.readString()\n const configValue = decoder.readString()\n const readOnly = decoder.readBoolean()\n const isDefault = decoder.readBoolean()\n const isSensitive = decoder.readBoolean()\n\n /**\n * Backporting ConfigSource value to v0\n * @see https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java#L232-L242\n */\n let configSource\n if (isDefault) {\n configSource = ConfigSource.DEFAULT_CONFIG\n } else {\n switch (resourceType) {\n case ConfigResourceTypes.BROKER:\n configSource = ConfigSource.STATIC_BROKER_CONFIG\n break\n case ConfigResourceTypes.TOPIC:\n configSource = ConfigSource.TOPIC_CONFIG\n break\n default:\n configSource = ConfigSource.UNKNOWN\n }\n }\n\n return {\n configName,\n configValue,\n readOnly,\n isDefault,\n configSource,\n isSensitive,\n }\n}\n\nconst decodeResources = decoder => {\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resourceType = decoder.readInt8()\n const resourceName = decoder.readString()\n const configEntries = decoder.readArray(decoder => decodeConfigEntries(decoder, resourceType))\n\n return {\n errorCode,\n errorMessage,\n resourceType,\n resourceName,\n configEntries,\n }\n}\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nconst parse = async data => {\n const resourcesWithError = data.resources.filter(({ errorCode }) => failure(errorCode))\n if (resourcesWithError.length > 0) {\n throw createErrorFromCode(resourcesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeConfigs Request (Version: 1) => [resources] include_synonyms\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n * include_synonyms => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n * @param [includeSynonyms=false]\n */\nmodule.exports = ({ resources, includeSynonyms = false }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DescribeConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource)).writeBoolean(includeSynonyms)\n },\n})\n\nconst encodeResource = ({ type, name, configNames = [] }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeNullableArray(configNames)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst { DEFAULT_CONFIG } = require('../../../configSource')\n\n/**\n * DescribeConfigs Response (Version: 1) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only config_source is_sensitive [config_synonyms]\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * config_source => INT8\n * is_sensitive => BOOLEAN\n * config_synonyms => config_name config_value config_source\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * config_source => INT8\n */\n\nconst decodeSynonyms = decoder => ({\n configName: decoder.readString(),\n configValue: decoder.readString(),\n configSource: decoder.readInt8(),\n})\n\nconst decodeConfigEntries = decoder => {\n const configName = decoder.readString()\n const configValue = decoder.readString()\n const readOnly = decoder.readBoolean()\n const configSource = decoder.readInt8()\n const isSensitive = decoder.readBoolean()\n const configSynonyms = decoder.readArray(decodeSynonyms)\n\n return {\n configName,\n configValue,\n readOnly,\n isDefault: configSource === DEFAULT_CONFIG,\n configSource,\n isSensitive,\n configSynonyms,\n }\n}\n\nconst decodeResources = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n configEntries: decoder.readArray(decodeConfigEntries),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * DescribeConfigs Request (Version: 1) => [resources] include_synonyms\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n * include_synonyms => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n * @param [includeSynonyms=false]\n */\nmodule.exports = ({ resources, includeSynonyms }) =>\n Object.assign(requestV1({ resources, includeSynonyms }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DescribeConfigs Response (Version: 2) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only config_source is_sensitive [config_synonyms]\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * config_source => INT8\n * is_sensitive => BOOLEAN\n * config_synonyms => config_name config_value config_source\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * config_source => INT8\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupIds }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupIds }), response }\n },\n 1: ({ groupIds }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupIds }), response }\n },\n 2: ({ groupIds }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ groupIds }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeGroups: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeGroups Request (Version: 0) => [group_ids]\n * group_ids => STRING\n */\n\n/**\n * @param {Array} groupIds List of groupIds to request metadata for (an empty groupId array will return empty group metadata)\n */\nmodule.exports = ({ groupIds }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeGroups',\n encode: async () => {\n return new Encoder().writeArray(groupIds)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DescribeGroups Response (Version: 0) => [groups]\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decoderMember = decoder => ({\n memberId: decoder.readString(),\n clientId: decoder.readString(),\n clientHost: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n memberAssignment: decoder.readBytes(),\n})\n\nconst decodeGroup = decoder => ({\n errorCode: decoder.readInt16(),\n groupId: decoder.readString(),\n state: decoder.readString(),\n protocolType: decoder.readString(),\n protocol: decoder.readString(),\n members: decoder.readArray(decoderMember),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const groups = decoder.readArray(decodeGroup)\n\n return {\n groups,\n }\n}\n\nconst parse = async data => {\n const groupsWithError = data.groups.filter(({ errorCode }) => failure(errorCode))\n if (groupsWithError.length > 0) {\n throw createErrorFromCode(groupsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DescribeGroups Request (Version: 1) => [group_ids]\n * group_ids => STRING\n */\n\nmodule.exports = ({ groupIds }) => Object.assign(requestV0({ groupIds }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * DescribeGroups Response (Version: 1) => throttle_time_ms [groups]\n * throttle_time_ms => INT32\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decoderMember = decoder => ({\n memberId: decoder.readString(),\n clientId: decoder.readString(),\n clientHost: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n memberAssignment: decoder.readBytes(),\n})\n\nconst decodeGroup = decoder => ({\n errorCode: decoder.readInt16(),\n groupId: decoder.readString(),\n state: decoder.readString(),\n protocolType: decoder.readString(),\n protocol: decoder.readString(),\n members: decoder.readArray(decoderMember),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const groups = decoder.readArray(decodeGroup)\n\n return {\n throttleTime,\n groups,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * DescribeGroups Request (Version: 2) => [group_ids]\n * group_ids => STRING\n */\n\nmodule.exports = ({ groupIds }) => Object.assign(requestV1({ groupIds }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DescribeGroups Response (Version: 2) => throttle_time_ms [groups]\n * throttle_time_ms => INT32\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, transactionResult }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ transactionalId, producerId, producerEpoch, transactionResult }),\n response,\n }\n },\n 1: ({ transactionalId, producerId, producerEpoch, transactionResult }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ transactionalId, producerId, producerEpoch, transactionResult }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { EndTxn: apiKey } = require('../../apiKeys')\n\n/**\n * EndTxn Request (Version: 0) => transactional_id producer_id producer_epoch transaction_result\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * transaction_result => BOOLEAN\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, transactionResult }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'EndTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeBoolean(transactionResult)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * EndTxn Response (Version: 0) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * EndTxn Request (Version: 1) => transactional_id producer_id producer_epoch transaction_result\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * transaction_result => BOOLEAN\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, transactionResult }) =>\n Object.assign(requestV0({ transactionalId, producerId, producerEpoch, transactionResult }), {\n apiVersion: 1,\n })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * EndTxn Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const ISOLATION_LEVEL = require('../../isolationLevel')\n\n// For normal consumers, use -1\nconst REPLICA_ID = -1\nconst NETWORK_DELAY = 100\n\n/**\n * The FETCH request can block up to maxWaitTime, which can be bigger than the configured\n * request timeout. It's safer to always use the maxWaitTime\n **/\nconst requestTimeout = timeout =>\n Number.isSafeInteger(timeout + NETWORK_DELAY) ? timeout + NETWORK_DELAY : timeout\n\nconst versions = {\n 0: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 1: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 2: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 3: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, maxBytes, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 4: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 5: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 6: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 7: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v7/request')\n const response = require('./v7/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 8: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v8/request')\n const response = require('./v8/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 9: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v9/request')\n const response = require('./v9/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 10: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v10/request')\n const response = require('./v10/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 11: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId,\n }) => {\n const request = require('./v11/request')\n const response = require('./v11/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\n\n/**\n * Fetch Request (Version: 0) => replica_id max_wait_time min_bytes [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\n/**\n * @param {number} replicaId Broker id of the follower\n * @param {number} maxWaitTime Maximum time in ms to wait for the response\n * @param {number} minBytes Minimum bytes to accumulate in the response.\n * @param {Array} topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n */\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { KafkaJSOffsetOutOfRange } = require('../../../../errors')\nconst { failure, createErrorFromCode, errorCodes } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\n\n/**\n * Fetch Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n messages: await MessageSetDecoder(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n responses,\n }\n}\n\nconst { code: OFFSET_OUT_OF_RANGE_ERROR_CODE } = errorCodes.find(\n e => e.type === 'OFFSET_OUT_OF_RANGE'\n)\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(({ topicName, partitions }) => {\n return partitions\n .filter(partition => failure(partition.errorCode))\n .map(partition => Object.assign({}, partition, { topic: topicName }))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode, topic, partition } = errors[0]\n if (errorCode === OFFSET_OUT_OF_RANGE_ERROR_CODE) {\n throw new KafkaJSOffsetOutOfRange(createErrorFromCode(errorCode), { topic, partition })\n }\n\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => {\n return Object.assign(requestV0({ replicaId, maxWaitTime, minBytes, topics }), { apiVersion: 1 })\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\n\n/**\n * Fetch Response (Version: 1) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n messages: await MessageSetDecoder(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV9 = require('../v9/request')\n\n/**\n * ZStd Compression\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-110%3A+Add+Codec+for+ZStandard+Compression\n */\n\n/**\n * Fetch Request (Version: 10) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) =>\n Object.assign(\n requestV9({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n }),\n { apiVersion: 10 }\n )\n","const { decode, parse } = require('../v9/response')\n\n/**\n * Fetch Response (Version: 10) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Allow consumers to fetch from closest replica\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+fetch+from+closest+replica\n */\n\n/**\n * Fetch Request (Version: 11) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n * rack_id => STRING\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId = '',\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 11,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n .writeString(rackId)\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({\n partition,\n currentLeaderEpoch = -1,\n fetchOffset,\n logStartOffset = -1,\n maxBytes,\n}) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(currentLeaderEpoch)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 11) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * preferred_read_replica => INT32\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n preferredReadReplica: decoder.readInt32(),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const clientSideThrottleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n // Report a `throttleTime` of 0: The broker will not have throttled\n // this request, but if the `clientSideThrottleTime` is >0 then it\n // expects us to do that -- and it will ignore requests.\n return {\n throttleTime: 0,\n clientSideThrottleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => {\n return Object.assign(requestV0({ replicaId, maxWaitTime, minBytes, topics }), { apiVersion: 2 })\n}\n","const { decode, parse } = require('../v1/response')\n\n/**\n * Fetch Response (Version: 2) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\n\n/**\n * Fetch Request (Version: 3) => replica_id max_wait_time min_bytes max_bytes [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\n/**\n * @param {number} replicaId Broker id of the follower\n * @param {number} maxWaitTime Maximum time in ms to wait for the response\n * @param {number} minBytes Minimum bytes to accumulate in the response.\n * @param {number} maxBytes Maximum bytes to accumulate in the response. Note that this is not an absolute maximum,\n * if the first message in the first non-empty partition of the fetch is larger than this value,\n * the message will still be returned to ensure that progress can be made.\n * @param {Array} topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n */\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, maxBytes, topics }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const { decode, parse } = require('../v1/response')\n\n/**\n * Fetch Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Decoder = require('../../../decoder')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\nconst RecordBatchDecoder = require('../../../recordBatch/v0/decoder')\nconst { MAGIC_BYTE } = require('../../../recordBatch/v0')\n\n// the magic offset is at the same offset for all current message formats, but the 4 bytes\n// between the size and the magic is dependent on the version.\nconst MAGIC_OFFSET = 16\nconst RECORD_BATCH_OVERHEAD = 49\n\nconst decodeMessages = async decoder => {\n const messagesSize = decoder.readInt32()\n\n if (messagesSize <= 0 || !decoder.canReadBytes(messagesSize)) {\n return []\n }\n\n const messagesBuffer = decoder.readBytes(messagesSize)\n const messagesDecoder = new Decoder(messagesBuffer)\n const magicByte = messagesBuffer.slice(MAGIC_OFFSET).readInt8(0)\n\n if (magicByte === MAGIC_BYTE) {\n const records = []\n\n while (messagesDecoder.canReadBytes(RECORD_BATCH_OVERHEAD)) {\n try {\n const recordBatch = await RecordBatchDecoder(messagesDecoder)\n records.push(...recordBatch.records)\n } catch (e) {\n // The tail of the record batches can have incomplete records\n // due to how maxBytes works. See https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-FetchAPI\n if (e.name === 'KafkaJSPartialMessageError') {\n break\n }\n\n throw e\n }\n }\n\n return records\n }\n\n return MessageSetDecoder(messagesDecoder, messagesSize)\n}\n\nmodule.exports = decodeMessages\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Fetch Request (Version: 4) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) => ({\n apiKey,\n apiVersion: 4,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('./decodeMessages')\n\n/**\n * Fetch Response (Version: 4) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Fetch Request (Version: 5) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, logStartOffset = -1, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 5) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV5 = require('../v5/request')\n\n/**\n * Fetch Request (Version: 6) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) =>\n Object.assign(\n requestV5({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n }),\n { apiVersion: 6 }\n )\n","const { decode, parse } = require('../v5/response')\n\n/**\n * Fetch Response (Version: 6) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Sessions are only used by followers\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-227%3A+Introduce+Incremental+FetchRequests+to+Increase+Partition+Scalability\n */\n\n/**\n * Fetch Request (Version: 7) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 7,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, logStartOffset = -1, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 7) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV7 = require('../v7/request')\n\n/**\n * Quota violation brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n */\n\n/**\n * Fetch Request (Version: 8) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) =>\n Object.assign(\n requestV7({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n }),\n { apiVersion: 8 }\n )\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 8) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const clientSideThrottleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n // Report a `throttleTime` of 0: The broker will not have throttled\n // this request, but if the `clientSideThrottleTime` is >0 then it\n // expects us to do that -- and it will ignore requests.\n return {\n throttleTime: 0,\n clientSideThrottleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Allow fetchers to detect and handle log truncation\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-320%3A+Allow+fetchers+to+detect+and+handle+log+truncation\n */\n\n/**\n * Fetch Request (Version: 9) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 9,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({\n partition,\n currentLeaderEpoch = -1,\n fetchOffset,\n logStartOffset = -1,\n maxBytes,\n}) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(currentLeaderEpoch)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const { decode, parse } = require('../v8/response')\n\n/**\n * Fetch Response (Version: 9) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const COORDINATOR_TYPES = require('../../coordinatorTypes')\n\nconst versions = {\n 0: ({ groupId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupId }), response }\n },\n 1: ({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ coordinatorKey: groupId, coordinatorType }), response }\n },\n 2: ({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ coordinatorKey: groupId, coordinatorType }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { GroupCoordinator: apiKey } = require('../../apiKeys')\n\n/**\n * FindCoordinator Request (Version: 0) => group_id\n * group_id => STRING\n */\n\nmodule.exports = ({ groupId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'GroupCoordinator',\n encode: async () => {\n return new Encoder().writeString(groupId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * FindCoordinator Response (Version: 0) => error_code coordinator\n * error_code => INT16\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const coordinator = {\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n }\n\n return {\n errorCode,\n coordinator,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { GroupCoordinator: apiKey } = require('../../apiKeys')\n\n/**\n * FindCoordinator Request (Version: 1) => coordinator_key coordinator_type\n * coordinator_key => STRING\n * coordinator_type => INT8\n */\n\nmodule.exports = ({ coordinatorKey, coordinatorType }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'GroupCoordinator',\n encode: async () => {\n return new Encoder().writeString(coordinatorKey).writeInt8(coordinatorType)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * FindCoordinator Response (Version: 1) => throttle_time_ms error_code error_message coordinator\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const errorMessage = decoder.readString()\n const coordinator = {\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n }\n\n return {\n throttleTime,\n errorCode,\n errorMessage,\n coordinator,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * FindCoordinator Request (Version: 2) => coordinator_key coordinator_type\n * coordinator_key => STRING\n * coordinator_type => INT8\n */\n\nmodule.exports = ({ coordinatorKey, coordinatorType }) =>\n Object.assign(requestV1({ coordinatorKey, coordinatorType }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * FindCoordinator Response (Version: 1) => throttle_time_ms error_code error_message coordinator\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 1: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 2: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 3: ({ groupId, groupGenerationId, memberId, groupInstanceId }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, groupGenerationId, memberId, groupInstanceId }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Heartbeat: apiKey } = require('../../apiKeys')\n\n/**\n * Heartbeat Request (Version: 0) => group_id group_generation_id member_id\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Heartbeat',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * Heartbeat Response (Version: 0) => error_code\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { errorCode }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * Heartbeat Request (Version: 1) => group_id generation_id member_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) =>\n Object.assign(requestV0({ groupId, groupGenerationId, memberId }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Heartbeat Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime, errorCode }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Heartbeat Request (Version: 2) => group_id generation_id member_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) =>\n Object.assign(requestV1({ groupId, groupGenerationId, memberId }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * Heartbeat Response (Version: 2) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Heartbeat: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 adds group_instance_id to indicate member identity across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * Heartbeat Request (Version: 3) => group_id generation_id member_id group_instance_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, groupInstanceId }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Heartbeat',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeString(groupInstanceId)\n },\n})\n","const { parse, decode } = require('../v2/response')\n\n/**\n * Heartbeat Response (Version: 3) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const apiKeys = require('./apiKeys')\nconst { KafkaJSServerDoesNotSupportApiKey, KafkaJSNotImplemented } = require('../../errors')\n\n/**\n * @typedef {(options?: Object) => { request: any, response: any, logResponseErrors?: boolean }} Request\n */\n\n/**\n * @typedef {Object} RequestDefinitions\n * @property {string[]} versions\n * @property {({ version: number }) => Request} protocol\n */\n\n/**\n * @typedef {(apiKey: number, definitions: RequestDefinitions) => Request} Lookup\n */\n\n/** @type {RequestDefinitions} */\nconst noImplementedRequestDefinitions = {\n versions: [],\n protocol: () => {\n throw new KafkaJSNotImplemented()\n },\n}\n\n/**\n * @type {{[apiName: string]: RequestDefinitions}}\n */\nconst requests = {\n Produce: require('./produce'),\n Fetch: require('./fetch'),\n ListOffsets: require('./listOffsets'),\n Metadata: require('./metadata'),\n LeaderAndIsr: noImplementedRequestDefinitions,\n StopReplica: noImplementedRequestDefinitions,\n UpdateMetadata: noImplementedRequestDefinitions,\n ControlledShutdown: noImplementedRequestDefinitions,\n OffsetCommit: require('./offsetCommit'),\n OffsetFetch: require('./offsetFetch'),\n GroupCoordinator: require('./findCoordinator'),\n JoinGroup: require('./joinGroup'),\n Heartbeat: require('./heartbeat'),\n LeaveGroup: require('./leaveGroup'),\n SyncGroup: require('./syncGroup'),\n DescribeGroups: require('./describeGroups'),\n ListGroups: require('./listGroups'),\n SaslHandshake: require('./saslHandshake'),\n ApiVersions: require('./apiVersions'),\n CreateTopics: require('./createTopics'),\n DeleteTopics: require('./deleteTopics'),\n DeleteRecords: require('./deleteRecords'),\n InitProducerId: require('./initProducerId'),\n OffsetForLeaderEpoch: noImplementedRequestDefinitions,\n AddPartitionsToTxn: require('./addPartitionsToTxn'),\n AddOffsetsToTxn: require('./addOffsetsToTxn'),\n EndTxn: require('./endTxn'),\n WriteTxnMarkers: noImplementedRequestDefinitions,\n TxnOffsetCommit: require('./txnOffsetCommit'),\n DescribeAcls: require('./describeAcls'),\n CreateAcls: require('./createAcls'),\n DeleteAcls: require('./deleteAcls'),\n DescribeConfigs: require('./describeConfigs'),\n AlterConfigs: require('./alterConfigs'),\n AlterReplicaLogDirs: noImplementedRequestDefinitions,\n DescribeLogDirs: noImplementedRequestDefinitions,\n SaslAuthenticate: require('./saslAuthenticate'),\n CreatePartitions: require('./createPartitions'),\n CreateDelegationToken: noImplementedRequestDefinitions,\n RenewDelegationToken: noImplementedRequestDefinitions,\n ExpireDelegationToken: noImplementedRequestDefinitions,\n DescribeDelegationToken: noImplementedRequestDefinitions,\n DeleteGroups: require('./deleteGroups'),\n}\n\nconst names = Object.keys(apiKeys)\nconst keys = Object.values(apiKeys)\nconst findApiName = apiKey => names[keys.indexOf(apiKey)]\n\n/**\n * @param {import(\"../../../types\").ApiVersions} versions\n * @returns {Lookup}\n */\nconst lookup = versions => (apiKey, definition) => {\n const version = versions[apiKey]\n const availableVersions = definition.versions.map(Number)\n const bestImplementedVersion = Math.max(...availableVersions)\n\n if (!version || version.maxVersion == null) {\n throw new KafkaJSServerDoesNotSupportApiKey(\n `The Kafka server does not support the requested API version`,\n { apiKey, apiName: findApiName(apiKey) }\n )\n }\n\n const bestSupportedVersion = Math.min(bestImplementedVersion, version.maxVersion)\n return definition.protocol({ version: bestSupportedVersion })\n}\n\nmodule.exports = {\n requests,\n lookup,\n}\n","const versions = {\n 0: ({ transactionalId, transactionTimeout = 5000 }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, transactionTimeout }), response }\n },\n 1: ({ transactionalId, transactionTimeout = 5000 }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, transactionTimeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { InitProducerId: apiKey } = require('../../apiKeys')\n\n/**\n * InitProducerId Request (Version: 0) => transactional_id transaction_timeout_ms\n * transactional_id => NULLABLE_STRING\n * transaction_timeout_ms => INT32\n */\n\nmodule.exports = ({ transactionalId, transactionTimeout }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'InitProducerId',\n encode: async () => {\n return new Encoder().writeString(transactionalId).writeInt32(transactionTimeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * InitProducerId Response (Version: 0) => throttle_time_ms error_code producer_id producer_epoch\n * throttle_time_ms => INT32\n * error_code => INT16\n * producer_id => INT64\n * producer_epoch => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n producerId: decoder.readInt64().toString(),\n producerEpoch: decoder.readInt16(),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * InitProducerId Request (Version: 1) => transactional_id transaction_timeout_ms\n * transactional_id => NULLABLE_STRING\n * transaction_timeout_ms => INT32\n */\n\nmodule.exports = ({ transactionalId, transactionTimeout }) =>\n Object.assign(requestV0({ transactionalId, transactionTimeout }), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * InitProducerId Response (Version: 0) => throttle_time_ms error_code producer_id producer_epoch\n * throttle_time_ms => INT32\n * error_code => INT16\n * producer_id => INT64\n * producer_epoch => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const NETWORK_DELAY = 5000\n\n/**\n * @see https://github.com/apache/kafka/pull/5203\n * The JOIN_GROUP request may block up to sessionTimeout (or rebalanceTimeout in JoinGroupV1),\n * so we should override the requestTimeout to be a bit more than the sessionTimeout\n * NOTE: the sessionTimeout can be configured as Number.MAX_SAFE_INTEGER and overflow when\n * increased, so we have to check for potential overflows\n **/\nconst requestTimeout = ({ rebalanceTimeout, sessionTimeout }) => {\n const timeout = rebalanceTimeout || sessionTimeout\n return Number.isSafeInteger(timeout + NETWORK_DELAY) ? timeout + NETWORK_DELAY : timeout\n}\n\nconst logResponseError = memberId => memberId != null && memberId !== ''\n\nconst versions = {\n 0: ({ groupId, sessionTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout: null, sessionTimeout }),\n }\n },\n 1: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 2: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 3: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 4: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n logResponseError: logResponseError(memberId),\n }\n },\n 5: ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId,\n protocolType,\n groupProtocols,\n }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n logResponseError: logResponseError(memberId),\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * JoinGroup Request (Version: 0) => group_id session_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({ groupId, sessionTimeout, memberId, protocolType, groupProtocols }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeString(memberId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 0) => error_code generation_id group_protocol leader_id member_id [members]\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * JoinGroup Request (Version: 1) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeInt32(rebalanceTimeout)\n .writeString(memberId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * JoinGroup Response (Version: 1) => error_code generation_id group_protocol leader_id member_id [members]\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * JoinGroup Request (Version: 2) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV1({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 2 }\n )\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * JoinGroup Response (Version: 2) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * JoinGroup Request (Version: 3) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV2({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 3 }\n )\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * Starting in version 3, on quota violation, brokers send out responses\n * before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * JoinGroup Response (Version: 3) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Starting in version 4, the client needs to issue a second request to join group\n * with assigned id.\n *\n * JoinGroup Request (Version: 4) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV3({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 4 }\n )\n","const { decode } = require('../v3/response')\nconst { KafkaJSMemberIdRequired } = require('../../../../errors')\nconst { failure, createErrorFromCode, errorCodes } = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 4) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst { code: MEMBER_ID_REQUIRED_ERROR_CODE } = errorCodes.find(\n e => e.type === 'MEMBER_ID_REQUIRED'\n)\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n if (data.errorCode === MEMBER_ID_REQUIRED_ERROR_CODE) {\n throw new KafkaJSMemberIdRequired(createErrorFromCode(data.errorCode), {\n memberId: data.memberId,\n })\n }\n\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 5 adds group_instance_id to identify members across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * JoinGroup Request (Version: 5) => group_id session_timeout rebalance_timeout member_id group_instance_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId = null,\n protocolType,\n groupProtocols,\n}) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeInt32(rebalanceTimeout)\n .writeString(memberId)\n .writeString(groupInstanceId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { KafkaJSMemberIdRequired } = require('../../../../errors')\nconst {\n failure,\n createErrorFromCode,\n errorCodes,\n failIfVersionNotSupported,\n} = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 5) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id group_instance_id metadata\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * member_metadata => BYTES\n */\nconst { code: MEMBER_ID_REQUIRED_ERROR_CODE } = errorCodes.find(\n e => e.type === 'MEMBER_ID_REQUIRED'\n)\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n if (data.errorCode === MEMBER_ID_REQUIRED_ERROR_CODE) {\n throw new KafkaJSMemberIdRequired(createErrorFromCode(data.errorCode), {\n memberId: data.memberId,\n })\n }\n\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n groupInstanceId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupId, memberId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 1: ({ groupId, memberId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 2: ({ groupId, memberId }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 3: ({ groupId, memberId, groupInstanceId }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, members: [{ memberId, groupInstanceId }] }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { LeaveGroup: apiKey } = require('../../apiKeys')\n\n/**\n * LeaveGroup Request (Version: 0) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'LeaveGroup',\n encode: async () => {\n return new Encoder().writeString(groupId).writeString(memberId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * LeaveGroup Response (Version: 0) => error_code\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { errorCode }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * LeaveGroup Request (Version: 1) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) =>\n Object.assign(requestV0({ groupId, memberId }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * LeaveGroup Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime, errorCode }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * LeaveGroup Request (Version: 2) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) =>\n Object.assign(requestV1({ groupId, memberId }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * LeaveGroup Response (Version: 2) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { LeaveGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 changes leavegroup to operate on a batch of members\n * and adds group_instance_id to identify members across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * LeaveGroup Request (Version: 3) => group_id [members]\n * group_id => STRING\n * members => member_id group_instance_id\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, members }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'LeaveGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeArray(members.map(member => encodeMember(member)))\n },\n})\n\nconst encodeMember = ({ memberId, groupInstanceId = null }) => {\n return new Encoder().writeString(memberId).writeString(groupInstanceId)\n}\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported, failure, createErrorFromCode } = require('../../../error')\nconst { parse: parseV2 } = require('../v2/response')\n\n/**\n * LeaveGroup Response (Version: 3) => throttle_time_ms error_code [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * members => member_id group_instance_id error_code\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const members = decoder.readArray(decodeMembers)\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime: 0, clientSideThrottleTime: throttleTime, errorCode, members }\n}\n\nconst decodeMembers = decoder => ({\n memberId: decoder.readString(),\n groupInstanceId: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const parsed = parseV2(data)\n\n const memberWithError = data.members.find(member => failure(member.errorCode))\n if (memberWithError) {\n throw createErrorFromCode(memberWithError.errorCode)\n }\n\n return parsed\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: () => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(), response }\n },\n 1: () => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(), response }\n },\n 2: () => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request(), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ListGroups: apiKey } = require('../../apiKeys')\n\n/**\n * ListGroups Request (Version: 0)\n */\n\n/**\n */\nmodule.exports = () => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ListGroups',\n encode: async () => {\n return new Encoder()\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * ListGroups Response (Version: 0) => error_code [groups]\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\n\nconst decodeGroup = decoder => ({\n groupId: decoder.readString(),\n protocolType: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n const groups = decoder.readArray(decodeGroup)\n\n return {\n errorCode,\n groups,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decodeGroup,\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * ListGroups Request (Version: 1)\n */\n\nmodule.exports = () => Object.assign(requestV0(), { apiVersion: 1 })\n","const responseV0 = require('../v0/response')\n\nconst Decoder = require('../../../decoder')\n\n/**\n * ListGroups Response (Version: 1) => error_code [groups]\n * throttle_time_ms => INT32\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const groups = decoder.readArray(responseV0.decodeGroup)\n\n return {\n throttleTime,\n errorCode,\n groups,\n }\n}\n\nmodule.exports = {\n decode,\n parse: responseV0.parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * ListGroups Request (Version: 2)\n */\n\nmodule.exports = () => Object.assign(requestV1(), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ListGroups Response (Version: 2) => error_code [groups]\n * throttle_time_ms => INT32\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const ISOLATION_LEVEL = require('../../isolationLevel')\n\n// For normal consumers, use -1\nconst REPLICA_ID = -1\n\nconst versions = {\n 0: ({ replicaId = REPLICA_ID, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ replicaId, topics }), response }\n },\n 1: ({ replicaId = REPLICA_ID, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ replicaId, topics }), response }\n },\n 2: ({ replicaId = REPLICA_ID, isolationLevel = ISOLATION_LEVEL.READ_COMMITTED, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ replicaId, isolationLevel, topics }), response }\n },\n 3: ({ replicaId = REPLICA_ID, isolationLevel = ISOLATION_LEVEL.READ_COMMITTED, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ replicaId, isolationLevel, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 0) => replica_id [topics]\n * replica_id => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp max_num_offsets\n * partition => INT32\n * timestamp => INT64\n * max_num_offsets => INT32\n */\n\n/**\n * @param {number} replicaId\n * @param {object} topics use timestamp=-1 for latest offsets and timestamp=-2 for earliest.\n * Default timestamp=-1. Example:\n * {\n * topics: [\n * {\n * topic: 'topic-name',\n * partitions: [{ partition: 0, timestamp: -1 }]\n * }\n * ]\n * }\n */\nmodule.exports = ({ replicaId, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder().writeInt32(replicaId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1, maxNumOffsets = 1 }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(timestamp)\n .writeInt32(maxNumOffsets)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Offsets Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code [offsets]\n * partition => INT32\n * error_code => INT16\n * offsets => INT64\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offsets: decoder.readArray(decodeOffsets),\n})\n\nconst decodeOffsets = decoder => decoder.readInt64().toString()\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 1) => replica_id [topics]\n * replica_id => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder().writeInt32(replicaId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1 }) => {\n return new Encoder().writeInt32(partition).writeInt64(timestamp)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * ListOffsets Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n timestamp: decoder.readInt64().toString(),\n offset: decoder.readInt64().toString(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 2) => replica_id isolation_level [topics]\n * replica_id => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, isolationLevel, topics }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1 }) => {\n return new Encoder().writeInt32(partition).writeInt64(timestamp)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * ListOffsets Response (Version: 2) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n timestamp: decoder.readInt64().toString(),\n offset: decoder.readInt64().toString(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * ListOffsets Request (Version: 3) => replica_id isolation_level [topics]\n * replica_id => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, isolationLevel, topics }) =>\n Object.assign(requestV2({ replicaId, isolationLevel, topics }), { apiVersion: 3 })\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * In version 3 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ListOffsets Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics }), response }\n },\n 1: ({ topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics }), response }\n },\n 2: ({ topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ topics }), response }\n },\n 3: ({ topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ topics }), response }\n },\n 4: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n 5: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n 6: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 0) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeArray(topics)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Metadata Response (Version: 0) => [brokers] [topic_metadata]\n * brokers => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n * topic_metadata => topic_error_code topic [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n // leader: The node id for the kafka broker currently acting as leader\n // for this partition\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nconst parse = async data => {\n const topicsWithErrors = data.topicMetadata.filter(topic => failure(topic.topicErrorCode))\n if (topicsWithErrors.length > 0) {\n const { topicErrorCode } = topicsWithErrors[0]\n throw createErrorFromCode(topicErrorCode)\n }\n\n const partitionsWithErrors = data.topicMetadata.map(topic => {\n return topic.partitionMetadata.filter(partition => failure(partition.partitionErrorCode))\n })\n\n const errors = flatten(partitionsWithErrors)\n if (errors.length > 0) {\n const { partitionErrorCode } = errors[0]\n throw createErrorFromCode(partitionErrorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 1) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeNullableArray(topics)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 1) => [brokers] controller_id [topic_metadata]\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => topic_error_code topic is_internal [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Metadata Request (Version: 2) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 2) => [brokers] cluster_id controller_id [topic_metadata]\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => topic_error_code topic is_internal [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Metadata Request (Version: 3) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 3 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 3) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 4) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) => ({\n apiKey,\n apiVersion: 4,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeNullableArray(topics).writeBoolean(allowAutoTopicCreation)\n },\n})\n","const { parse: parseV3, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Metadata Response (Version: 4) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nmodule.exports = {\n parse: parseV3,\n decode: decodeV3,\n}\n","const requestV4 = require('../v4/request')\n\n/**\n * Metadata Request (Version: 5) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) =>\n Object.assign(requestV4({ topics, allowAutoTopicCreation }), { apiVersion: 5 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 5) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr] [offline_replicas]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n * offline_replicas => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n offlineReplicas: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV5 = require('../v5/request')\n\n/**\n * Metadata Request (Version: 6) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) =>\n Object.assign(requestV5({ topics, allowAutoTopicCreation }), { apiVersion: 6 })\n","const { parse, decode: decodeV1 } = require('../v5/response')\n\n/**\n * In version 6 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * Metadata Response (Version: 6) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr] [offline_replicas]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n * offline_replicas => INT32\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","// This value signals to the broker that its default configuration should be used.\nconst RETENTION_TIME = -1\n\nconst versions = {\n 0: ({ groupId, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupId, topics }), response }\n },\n 1: ({ groupId, groupGenerationId, memberId, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupId, groupGenerationId, memberId, topics }), response }\n },\n 2: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 3: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 4: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 5: ({ groupId, groupGenerationId, memberId, topics }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n topics,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 0) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder().writeString(groupId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetCommit Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 1) => group_id group_generation_id member_id [topics]\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset timestamp metadata\n * partition => INT32\n * offset => INT64\n * timestamp => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, timestamp = Date.now(), metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeInt64(timestamp)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 2) => group_id group_generation_id member_id retention_time [topics]\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeInt64(retentionTime)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * OffsetCommit Request (Version: 3) => group_id generation_id member_id retention_time [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) =>\n Object.assign(requestV2({ groupId, groupGenerationId, memberId, retentionTime, topics }), {\n apiVersion: 3,\n })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * OffsetCommit Request (Version: 4) => group_id generation_id member_id retention_time [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) =>\n Object.assign(requestV3({ groupId, groupGenerationId, memberId, retentionTime, topics }), {\n apiVersion: 4,\n })\n","const { parse, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Starting in version 4, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * OffsetCommit Response (Version: 4) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV3(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * Version 5 removes retention_time, as this is controlled by a broker setting\n *\n * OffsetCommit Request (Version: 4) => group_id generation_id member_id [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, topics }) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v4/response')\n\n/**\n * OffsetCommit Response (Version: 5) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 1: ({ groupId, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupId, topics }), response }\n },\n 2: ({ groupId, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ groupId, topics }), response }\n },\n 3: ({ groupId, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ groupId, topics }), response }\n },\n 4: ({ groupId, topics }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return { request: request({ groupId, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetFetch: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetFetch Request (Version: 1) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'OffsetFetch',\n encode: async () => {\n return new Encoder().writeString(groupId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition }) => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetFetch Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * OffsetFetch Request (Version: 2) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) =>\n Object.assign(requestV1({ groupId, topics }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetFetch Response (Version: 2) => [responses] error_code\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n errorCode: decoder.readInt16(),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetFetch: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetFetch Request (Version: 3) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'OffsetFetch',\n encode: async () => {\n return new Encoder().writeString(groupId).writeNullableArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition }) => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV2 } = require('../v2/response')\n\n/**\n * OffsetFetch Response (Version: 3) => throttle_time_ms [responses] error_code\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n errorCode: decoder.readInt16(),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nmodule.exports = {\n decode,\n parse: parseV2,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * OffsetFetch Request (Version: 4) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) =>\n Object.assign(requestV3({ groupId, topics }), { apiVersion: 4 })\n","const { parse, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Starting in version 4, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * OffsetFetch Response (Version: 4) => throttle_time_ms [responses] error_code\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV3(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ acks, timeout, topicData }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ acks, timeout, topicData }), response }\n },\n 1: ({ acks, timeout, topicData }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ acks, timeout, topicData }), response }\n },\n 2: ({ acks, timeout, topicData, compression }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ acks, timeout, compression, topicData }), response }\n },\n 3: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 4: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 5: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 6: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 7: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v7/request')\n const response = require('./v7/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst MessageSet = require('../../../messageSet')\n\n/**\n * Produce Request (Version: 0) => acks timeout [topic_data]\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set record_set_size\n * partition => INT32\n * record_set_size => INT32\n * record_set => RECORDS\n */\n\n/**\n * MessageV0:\n * {\n * key: bytes,\n * value: bytes\n * }\n *\n * MessageSet:\n * [\n * { key: \"\", value: \"\" },\n * { key: \"\", value: \"\" },\n * ]\n *\n * TopicData:\n * [\n * {\n * topic: 'name1',\n * partitions: [\n * {\n * partition: 0,\n * messages: []\n * }\n * ]\n * }\n * ]\n */\n\n/**\n * @param acks {Integer} This field indicates how many acknowledgements the servers should receive before\n * responding to the request. If it is 0 the server will not send any response\n * (this is the only case where the server will not reply to a request). If it is 1,\n * the server will wait the data is written to the local log before sending a response.\n * If it is -1 the server will block until the message is committed by all in sync replicas\n * before sending a response.\n *\n * @param timeout {Integer} This provides a maximum time in milliseconds the server can await the receipt of the number\n * of acknowledgements in RequiredAcks. The timeout is not an exact limit on the request time\n * for a few reasons:\n * (1) it does not include network latency,\n * (2) the timer begins at the beginning of the processing of this request so if many requests are\n * queued due to server overload that wait time will not be included,\n * (3) we will not terminate a local write so if the local write time exceeds this timeout it will not\n * be respected. To get a hard timeout of this type the client should use the socket timeout.\n *\n * @param topicData {Array}\n */\nmodule.exports = ({ acks, timeout, topicData }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n return new Encoder()\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(topicData.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartitions))\n}\n\nconst encodePartitions = ({ partition, messages }) => {\n const messageSet = MessageSet({ messageVersion: 0, entries: messages })\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(messageSet.size())\n .writeEncoder(messageSet)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * v0\n * ProduceResponse => [TopicName [Partition ErrorCode Offset]]\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n return {\n topics,\n }\n}\n\nconst parse = async data => {\n const partitionsWithError = data.topics.map(topic => {\n return topic.partitions.filter(partition => failure(partition.errorCode))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode } = errors[0]\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n// Produce Request on or after v1 indicates the client can parse the quota throttle time\n// in the Produce Response.\n\nmodule.exports = ({ acks, timeout, topicData }) => {\n return Object.assign(requestV0({ acks, timeout, topicData }), { apiVersion: 1 })\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * v1 (supported in 0.9.0 or later)\n * ProduceResponse => [TopicName [Partition ErrorCode Offset]] ThrottleTime\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n * ThrottleTime => int32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst MessageSet = require('../../../messageSet')\nconst { Types, lookupCodec } = require('../../../message/compression')\n\n// Produce Request on or after v2 indicates the client can parse the timestamp field\n// in the produce Response.\n\nmodule.exports = ({ acks, timeout, compression = Types.None, topicData }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n const encodeTopic = topicEncoder(compression)\n const encodedTopicData = []\n\n for (const data of topicData) {\n encodedTopicData.push(await encodeTopic(data))\n }\n\n return new Encoder()\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(encodedTopicData)\n },\n})\n\nconst topicEncoder = compression => {\n const encodePartitions = partitionsEncoder(compression)\n\n return async ({ topic, partitions }) => {\n const encodedPartitions = []\n\n for (const data of partitions) {\n encodedPartitions.push(await encodePartitions(data))\n }\n\n return new Encoder().writeString(topic).writeArray(encodedPartitions)\n }\n}\n\nconst partitionsEncoder = compression => async ({ partition, messages }) => {\n const messageSet = MessageSet({ messageVersion: 1, compression, entries: messages })\n\n if (compression === Types.None) {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(messageSet.size())\n .writeEncoder(messageSet)\n }\n\n const timestamp = messages[0].timestamp || Date.now()\n\n const codec = lookupCodec(compression)\n const compressedValue = await codec.compress(messageSet)\n const compressedMessageSet = MessageSet({\n messageVersion: 1,\n entries: [{ compression, timestamp, value: compressedValue }],\n })\n\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(compressedMessageSet.size())\n .writeEncoder(compressedMessageSet)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * v2 (supported in 0.10.0 or later)\n * ProduceResponse => [TopicName [Partition ErrorCode Offset Timestamp]] ThrottleTime\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n * Timestamp => int64\n * ThrottleTime => int32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n timestamp: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Long = require('../../../../utils/long')\nconst Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst { Types } = require('../../../message/compression')\nconst Record = require('../../../recordBatch/record/v0')\nconst { RecordBatch } = require('../../../recordBatch/v0')\n\n/**\n * Produce Request (Version: 3) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\n/**\n * @param [transactionalId=null] {String} The transactional id or null if the producer is not transactional\n * @param acks {Integer} See producer request v0\n * @param timeout {Integer} See producer request v0\n * @param [compression=CompressionTypes.None] {CompressionTypes}\n * @param topicData {Array}\n */\nmodule.exports = ({\n acks,\n timeout,\n transactionalId = null,\n producerId = Long.fromInt(-1),\n producerEpoch = 0,\n compression = Types.None,\n topicData,\n}) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n const encodeTopic = topicEncoder(compression)\n const encodedTopicData = []\n\n for (const data of topicData) {\n encodedTopicData.push(\n await encodeTopic({ ...data, transactionalId, producerId, producerEpoch })\n )\n }\n\n return new Encoder()\n .writeString(transactionalId)\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(encodedTopicData)\n },\n})\n\nconst topicEncoder = compression => async ({\n topic,\n partitions,\n transactionalId,\n producerId,\n producerEpoch,\n}) => {\n const encodePartitions = partitionsEncoder(compression)\n const encodedPartitions = []\n\n for (const data of partitions) {\n encodedPartitions.push(\n await encodePartitions({ ...data, transactionalId, producerId, producerEpoch })\n )\n }\n\n return new Encoder().writeString(topic).writeArray(encodedPartitions)\n}\n\nconst partitionsEncoder = compression => async ({\n partition,\n messages,\n transactionalId,\n firstSequence,\n producerId,\n producerEpoch,\n}) => {\n const dateNow = Date.now()\n const messageTimestamps = messages\n .map(m => m.timestamp)\n .filter(timestamp => timestamp != null)\n .sort()\n\n const timestamps = messageTimestamps.length === 0 ? [dateNow] : messageTimestamps\n const firstTimestamp = timestamps[0]\n const maxTimestamp = timestamps[timestamps.length - 1]\n\n const records = messages.map((message, i) =>\n Record({\n ...message,\n offsetDelta: i,\n timestampDelta: (message.timestamp || dateNow) - firstTimestamp,\n })\n )\n\n const recordBatch = await RecordBatch({\n compression,\n records,\n firstTimestamp,\n maxTimestamp,\n producerId,\n producerEpoch,\n firstSequence,\n transactional: !!transactionalId,\n lastOffsetDelta: records.length - 1,\n })\n\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(recordBatch.size())\n .writeEncoder(recordBatch)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Produce Response (Version: 3) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * throttle_time_ms => INT32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n baseOffset: decoder.readInt64().toString(),\n logAppendTime: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nconst parse = async data => {\n const partitionsWithError = data.topics.map(response => {\n return response.partitions.filter(partition => failure(partition.errorCode))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode } = errors[0]\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Produce Request (Version: 4) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV3({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 4 }\n )\n","const { decode, parse } = require('../v3/response')\n\n/**\n * Produce Response (Version: 4) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * throttle_time_ms => INT32\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Produce Request (Version: 5) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV3({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 5 }\n )\n","const Decoder = require('../../../decoder')\nconst { parse: parseV3 } = require('../v3/response')\n\n/**\n * Produce Response (Version: 5) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n baseOffset: decoder.readInt64().toString(),\n logAppendTime: decoder.readInt64().toString(),\n logStartOffset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV3,\n}\n","const requestV5 = require('../v5/request')\n\n/**\n * The version number is bumped to indicate that on quota violation brokers send out responses before throttling.\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java#L113-L117\n *\n * Produce Request (Version: 6) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV5({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 6 }\n )\n","const { parse, decode: decodeV5 } = require('../v5/response')\n\n/**\n * The version number is bumped to indicate that on quota violation brokers send out responses before throttling.\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java#L152-L156\n *\n * Produce Response (Version: 6) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV5(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV6 = require('../v6/request')\n\n/**\n * V7 indicates ZStandard capability (see KIP-110)\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java#L118-L121\n *\n * Produce Request (Version: 7) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV6({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 7 }\n )\n","const { decode, parse } = require('../v6/response')\n\n/**\n * Produce Response (Version: 7) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ authBytes }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ authBytes }), response }\n },\n 1: ({ authBytes }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ authBytes }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SaslAuthenticate: apiKey } = require('../../apiKeys')\n\n/**\n * SaslAuthenticate Request (Version: 0) => sasl_auth_bytes\n * sasl_auth_bytes => BYTES\n */\n\n/**\n * @param {Buffer} authBytes - SASL authentication bytes from client as defined by the SASL mechanism\n */\nmodule.exports = ({ authBytes }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SaslAuthenticate',\n encode: async () => {\n return new Encoder().writeBuffer(authBytes)\n },\n})\n","const Decoder = require('../../../decoder')\nconst Encoder = require('../../../encoder')\nconst {\n failure,\n createErrorFromCode,\n failIfVersionNotSupported,\n errorCodes,\n} = require('../../../error')\n\nconst { KafkaJSProtocolError } = require('../../../../errors')\nconst SASL_AUTHENTICATION_FAILED = 58\nconst protocolAuthError = errorCodes.find(e => e.code === SASL_AUTHENTICATION_FAILED)\n\n/**\n * SaslAuthenticate Response (Version: 0) => error_code error_message sasl_auth_bytes\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * sasl_auth_bytes => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n const errorMessage = decoder.readString()\n\n // This is necessary to make the response compatible with the original\n // mechanism protocols. They expect a byte response, which starts with\n // the size\n const authBytesEncoder = new Encoder().writeBytes(decoder.readBytes())\n const authBytes = authBytesEncoder.buffer\n\n return {\n errorCode,\n errorMessage,\n authBytes,\n }\n}\n\nconst parse = async data => {\n if (data.errorCode === SASL_AUTHENTICATION_FAILED && data.errorMessage) {\n throw new KafkaJSProtocolError({\n ...protocolAuthError,\n message: data.errorMessage,\n })\n }\n\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * SaslAuthenticate Request (Version: 1) => sasl_auth_bytes\n * sasl_auth_bytes => BYTES\n */\n\n/**\n * @param {Buffer} authBytes - SASL authentication bytes from client as defined by the SASL mechanism\n */\nmodule.exports = ({ authBytes }) => Object.assign(requestV0({ authBytes }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst Encoder = require('../../../encoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst { failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SaslAuthenticate Response (Version: 1) => error_code error_message sasl_auth_bytes\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * sasl_auth_bytes => BYTES\n * session_lifetime_ms => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n const errorMessage = decoder.readString()\n\n // This is necessary to make the response compatible with the original\n // mechanism protocols. They expect a byte response, which starts with\n // the size\n const authBytesEncoder = new Encoder().writeBytes(decoder.readBytes())\n const authBytes = authBytesEncoder.buffer\n const sessionLifetimeMs = decoder.readInt64().toString()\n\n return {\n errorCode,\n errorMessage,\n authBytes,\n sessionLifetimeMs,\n }\n}\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ mechanism }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ mechanism }), response }\n },\n 1: ({ mechanism }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ mechanism }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SaslHandshake: apiKey } = require('../../apiKeys')\n\n/**\n * SaslHandshake Request (Version: 0) => mechanism\n * mechanism => STRING\n */\n\n/**\n * @param {string} mechanism - SASL Mechanism chosen by the client\n */\nmodule.exports = ({ mechanism }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SaslHandshake',\n encode: async () => new Encoder().writeString(mechanism),\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SaslHandshake Response (Version: 0) => error_code [enabled_mechanisms]\n * error_code => INT16\n * enabled_mechanisms => STRING\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n enabledMechanisms: decoder.readArray(decoder => decoder.readString()),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ mechanism }) => ({ ...requestV0({ mechanism }), apiVersion: 1 })\n","const { decode: decodeV0, parse: parseV0 } = require('../v0/response')\n\nmodule.exports = {\n decode: decodeV0,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 1: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 2: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 3: ({ groupId, generationId, memberId, groupInstanceId, groupAssignment }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, generationId, memberId, groupInstanceId, groupAssignment }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SyncGroup: apiKey } = require('../../apiKeys')\n\n/**\n * SyncGroup Request (Version: 0) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SyncGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(generationId)\n .writeString(memberId)\n .writeArray(groupAssignment.map(encodeGroupAssignment))\n },\n})\n\nconst encodeGroupAssignment = ({ memberId, memberAssignment }) => {\n return new Encoder().writeString(memberId).writeBytes(memberAssignment)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SyncGroup Response (Version: 0) => error_code member_assignment\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n memberAssignment: decoder.readBytes(),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * SyncGroup Request (Version: 1) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) =>\n Object.assign(requestV0({ groupId, generationId, memberId, groupAssignment }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * SyncGroup Response (Version: 1) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n memberAssignment: decoder.readBytes(),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * SyncGroup Request (Version: 2) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) =>\n Object.assign(requestV1({ groupId, generationId, memberId, groupAssignment }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * SyncGroup Response (Version: 2) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { SyncGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 adds group_instance_id to indicate member identity across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * SyncGroup Request (Version: 3) => group_id generation_id member_id group_instance_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({\n groupId,\n generationId,\n memberId,\n groupInstanceId = null,\n groupAssignment,\n}) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'SyncGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(generationId)\n .writeString(memberId)\n .writeString(groupInstanceId)\n .writeArray(groupAssignment.map(encodeGroupAssignment))\n },\n})\n\nconst encodeGroupAssignment = ({ memberId, memberAssignment }) => {\n return new Encoder().writeString(memberId).writeBytes(memberAssignment)\n}\n","const { decode, parse } = require('../v2/response')\n\n/**\n * SyncGroup Response (Version: 2) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, groupId, producerId, producerEpoch, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ transactionalId, groupId, producerId, producerEpoch, topics }),\n response,\n }\n },\n 1: ({ transactionalId, groupId, producerId, producerEpoch, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ transactionalId, groupId, producerId, producerEpoch, topics }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { TxnOffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * TxnOffsetCommit Request (Version: 0) => transactional_id group_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * group_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ transactionalId, groupId, producerId, producerEpoch, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'TxnOffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeString(groupId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * TxnOffsetCommit Response (Version: 0) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const topics = await decoder.readArrayAsync(decodeTopic)\n\n return {\n throttleTime,\n topics,\n }\n}\n\nconst decodeTopic = async decoder => ({\n topic: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decodePartition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const topicsWithErrors = data.topics\n .map(({ partitions }) => ({\n partitionsWithErrors: partitions.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n throw createErrorFromCode(topicsWithErrors[0].partitionsWithErrors[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * TxnOffsetCommit Request (Version: 1) => transactional_id group_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * group_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ transactionalId, groupId, producerId, producerEpoch, topics }) =>\n Object.assign(requestV0({ transactionalId, groupId, producerId, producerEpoch, topics }), {\n apiVersion: 1,\n })\n","const { parse, decode: decodeV1 } = require('../v0/response')\n\n/**\n * In version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * TxnOffsetCommit Response (Version: 1) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/resource/PatternType.java#L32\n\n/**\n * @typedef {number} ACLResourcePatternTypes\n *\n * Enum for ACL Resource Pattern Type\n * @readonly\n * @enum {ACLResourcePatternTypes}\n */\nmodule.exports = {\n /**\n * Represents any PatternType which this client cannot understand, perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any resource pattern type.\n */\n ANY: 1,\n /**\n * In a filter, will perform pattern matching.\n *\n * e.g. Given a filter of {@code ResourcePatternFilter(TOPIC, \"payments.received\", MATCH)`}, the filter match\n * any {@link ResourcePattern} that matches topic 'payments.received'. This might include:\n *
    \n *
  • A Literal pattern with the same type and name, e.g. {@code ResourcePattern(TOPIC, \"payments.received\", LITERAL)}
  • \n *
  • A Wildcard pattern with the same type, e.g. {@code ResourcePattern(TOPIC, \"*\", LITERAL)}
  • \n *
  • A Prefixed pattern with the same type and where the name is a matching prefix, e.g. {@code ResourcePattern(TOPIC, \"payments.\", PREFIXED)}
  • \n *
\n */\n MATCH: 2,\n /**\n * A literal resource name.\n *\n * A literal name defines the full name of a resource, e.g. topic with name 'foo', or group with name 'bob'.\n *\n * The special wildcard character {@code *} can be used to represent a resource with any name.\n */\n LITERAL: 3,\n /**\n * A prefixed resource name.\n *\n * A prefixed name defines a prefix for a resource, e.g. topics with names that start with 'foo'.\n */\n PREFIXED: 4,\n}\n","const ACLResourceTypes = require('./aclResourceTypes')\n\n/**\n * @deprecated\n * @see https://github.com/tulios/kafkajs/issues/649\n *\n * Use ConfigResourceTypes or AclResourceTypes instead.\n */\nmodule.exports = ACLResourceTypes\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","const Encoder = require('../../encoder')\n\nconst US_ASCII_NULL_CHAR = '\\u0000'\n\nmodule.exports = ({ authorizationIdentity, accessKeyId, secretAccessKey, sessionToken = '' }) => ({\n encode: async () => {\n return new Encoder().writeBytes(\n [authorizationIdentity, accessKeyId, secretAccessKey, sessionToken].join(US_ASCII_NULL_CHAR)\n )\n },\n})\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","/**\n * http://www.ietf.org/rfc/rfc5801.txt\n *\n * See org.apache.kafka.common.security.oauthbearer.internals.OAuthBearerClientInitialResponse\n * for official Java client implementation.\n *\n * The mechanism consists of a message from the client to the server.\n * The client sends the \"n,\"\" GS header, followed by the authorizationIdentitty\n * prefixed by \"a=\" (if present), followed by \",\", followed by a US-ASCII SOH\n * character, followed by \"auth=Bearer \", followed by the token value, followed\n * by US-ASCII SOH character, followed by SASL extensions in OAuth \"friendly\"\n * format and then closed by two additionals US-ASCII SOH characters.\n *\n * SASL extensions are optional an must be expressed as key-value pairs in an\n * object. Each expression is converted as, the extension entry key, followed\n * by \"=\", followed by extension entry value. Each extension is separated by a\n * US-ASCII SOH character. If extensions are not present, their relative part\n * in the message, including the US-ASCII SOH character, is omitted.\n *\n * The client may leave the authorization identity empty to\n * indicate that it is the same as the authentication identity.\n *\n * The server will verify the authentication token and verify that the\n * authentication credentials permit the client to login as the authorization\n * identity. If both steps succeed, the user is logged in.\n */\n\nconst Encoder = require('../../encoder')\n\nconst SEPARATOR = '\\u0001' // SOH - Start Of Header ASCII\n\nfunction formatExtensions(extensions) {\n let msg = ''\n\n if (extensions == null) {\n return msg\n }\n\n let prefix = ''\n for (const k in extensions) {\n msg += `${prefix}${k}=${extensions[k]}`\n prefix = SEPARATOR\n }\n\n return msg\n}\n\nmodule.exports = async ({ authorizationIdentity = null }, oauthBearerToken) => {\n const authzid = authorizationIdentity == null ? '' : `\"a=${authorizationIdentity}`\n let ext = formatExtensions(oauthBearerToken.extensions)\n if (ext.length > 0) {\n ext = `${SEPARATOR}${ext}`\n }\n\n const oauthMsg = `n,${authzid},${SEPARATOR}auth=Bearer ${oauthBearerToken.value}${ext}${SEPARATOR}${SEPARATOR}`\n\n return {\n encode: async () => {\n return new Encoder().writeBytes(Buffer.from(oauthMsg))\n },\n }\n}\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","/**\n * http://www.ietf.org/rfc/rfc2595.txt\n *\n * The mechanism consists of a single message from the client to the\n * server. The client sends the authorization identity (identity to\n * login as), followed by a US-ASCII NUL character, followed by the\n * authentication identity (identity whose password will be used),\n * followed by a US-ASCII NUL character, followed by the clear-text\n * password. The client may leave the authorization identity empty to\n * indicate that it is the same as the authentication identity.\n *\n * The server will verify the authentication identity and password with\n * the system authentication database and verify that the authentication\n * credentials permit the client to login as the authorization identity.\n * If both steps succeed, the user is logged in.\n */\n\nconst Encoder = require('../../encoder')\n\nconst US_ASCII_NULL_CHAR = '\\u0000'\n\nmodule.exports = ({ authorizationIdentity = null, username, password }) => ({\n encode: async () => {\n return new Encoder().writeBytes(\n [authorizationIdentity, username, password].join(US_ASCII_NULL_CHAR)\n )\n },\n})\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","const Encoder = require('../../../encoder')\n\nmodule.exports = ({ finalMessage }) => ({\n encode: async () => new Encoder().writeBytes(finalMessage),\n})\n","module.exports = require('../firstMessage/response')\n","/**\n * https://tools.ietf.org/html/rfc5802\n *\n * First, the client sends the \"client-first-message\" containing:\n *\n * -> a GS2 header consisting of a flag indicating whether channel\n * binding is supported-but-not-used, not supported, or used, and an\n * optional SASL authorization identity;\n *\n * -> SCRAM username and a random, unique nonce attributes.\n *\n * Note that the client's first message will always start with \"n\", \"y\",\n * or \"p\"; otherwise, the message is invalid and authentication MUST\n * fail. This is important, as it allows for GS2 extensibility (e.g.,\n * to add support for security layers).\n */\n\nconst Encoder = require('../../../encoder')\n\nmodule.exports = ({ clientFirstMessage }) => ({\n encode: async () => new Encoder().writeBytes(clientFirstMessage),\n})\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"_\" }] */\n\nconst Decoder = require('../../../decoder')\n\nconst ENTRY_REGEX = /^([rsiev])=(.*)$/\n\nmodule.exports = {\n decode: async rawData => {\n return new Decoder(rawData).readBytes()\n },\n parse: async data => {\n const processed = data\n .toString()\n .split(',')\n .map(str => {\n const [_, key, value] = str.match(ENTRY_REGEX)\n return [key, value]\n })\n .reduce((obj, entry) => ({ ...obj, [entry[0]]: entry[1] }), {})\n\n return { original: data.toString(), ...processed }\n },\n}\n","module.exports = {\n firstMessage: {\n request: require('./firstMessage/request'),\n response: require('./firstMessage/response'),\n },\n finalMessage: {\n request: require('./finalMessage/request'),\n response: require('./finalMessage/response'),\n },\n}\n","/**\n * Enum for timestamp types\n * @readonly\n * @enum {TimestampType}\n */\nmodule.exports = {\n // Timestamp type is unknown\n NO_TIMESTAMP: -1,\n\n // Timestamp relates to message creation time as set by a Kafka client\n CREATE_TIME: 0,\n\n // Timestamp relates to the time a message was appended to a Kafka log\n LOG_APPEND_TIME: 1,\n}\n","module.exports = {\n maxRetryTime: 30 * 1000,\n initialRetryTime: 300,\n factor: 0.2, // randomization factor\n multiplier: 2, // exponential factor\n retries: 5, // max retries\n}\n","module.exports = {\n maxRetryTime: 1000,\n initialRetryTime: 50,\n factor: 0.02, // randomization factor\n multiplier: 1.5, // exponential factor\n retries: 15, // max retries\n}\n","const { KafkaJSNumberOfRetriesExceeded, KafkaJSNonRetriableError } = require('../errors')\n\nconst isTestMode = process.env.NODE_ENV === 'test'\nconst RETRY_DEFAULT = isTestMode ? require('./defaults.test') : require('./defaults')\n\nconst random = (min, max) => {\n return Math.random() * (max - min) + min\n}\n\nconst randomFromRetryTime = (factor, retryTime) => {\n const delta = factor * retryTime\n return Math.ceil(random(retryTime - delta, retryTime + delta))\n}\n\nconst UNRECOVERABLE_ERRORS = ['RangeError', 'ReferenceError', 'SyntaxError', 'TypeError']\nconst isErrorUnrecoverable = e => UNRECOVERABLE_ERRORS.includes(e.name)\nconst isErrorRetriable = error =>\n (error.retriable || error.retriable !== false) && !isErrorUnrecoverable(error)\n\nconst createRetriable = (configs, resolve, reject, fn) => {\n let aborted = false\n const { factor, multiplier, maxRetryTime, retries } = configs\n\n const bail = error => {\n aborted = true\n reject(error || new Error('Aborted'))\n }\n\n const calculateExponentialRetryTime = retryTime => {\n return Math.min(randomFromRetryTime(factor, retryTime) * multiplier, maxRetryTime)\n }\n\n const retry = (retryTime, retryCount = 0) => {\n if (aborted) return\n\n const nextRetryTime = calculateExponentialRetryTime(retryTime)\n const shouldRetry = retryCount < retries\n\n const scheduleRetry = () => {\n setTimeout(() => retry(nextRetryTime, retryCount + 1), retryTime)\n }\n\n fn(bail, retryCount, retryTime)\n .then(resolve)\n .catch(e => {\n if (isErrorRetriable(e)) {\n if (shouldRetry) {\n scheduleRetry()\n } else {\n reject(new KafkaJSNumberOfRetriesExceeded(e, { retryCount, retryTime }))\n }\n } else {\n reject(new KafkaJSNonRetriableError(e))\n }\n })\n }\n\n return retry\n}\n\n/**\n * @typedef {(fn: (bail: (err: Error) => void, retryCount: number, retryTime: number) => any) => Promise>} Retrier\n */\n\n/**\n * @param {import(\"../../types\").RetryOptions} [opts]\n * @returns {Retrier}\n */\nmodule.exports = (opts = {}) => fn => {\n return new Promise((resolve, reject) => {\n const configs = Object.assign({}, RETRY_DEFAULT, opts)\n const start = createRetriable(configs, resolve, reject, fn)\n start(randomFromRetryTime(configs.factor, configs.initialRetryTime))\n })\n}\n","module.exports = (a, b) => {\n const result = []\n const length = a.length\n let i = 0\n\n while (i < length) {\n if (b.indexOf(a[i]) === -1) {\n result.push(a[i])\n }\n i += 1\n }\n\n return result\n}\n","const defaultErrorHandler = e => {\n throw e\n}\n\n/**\n * Generator that processes the given promises, and yields their result in the order of them resolving.\n *\n * @template T\n * @param {Promise[]} promises promises to process\n * @param {(err: Error) => any} [handleError] optional error handler\n * @returns {Generator>}\n */\nfunction* BufferedAsyncIterator(promises, handleError = defaultErrorHandler) {\n /** Queue of promises in order of resolution */\n const promisesQueue = []\n /** Queue of {resolve, reject} in the same order as `promisesQueue` */\n const resolveRejectQueue = []\n\n promises.forEach(promise => {\n // Create a new promise into the promises queue, and keep the {resolve,reject}\n // in the resolveRejectQueue\n let resolvePromise\n let rejectPromise\n promisesQueue.push(\n new Promise((resolve, reject) => {\n resolvePromise = resolve\n rejectPromise = reject\n })\n )\n resolveRejectQueue.push({ resolve: resolvePromise, reject: rejectPromise })\n\n // When the promise resolves pick the next available {resolve, reject}, and\n // through that resolve the next promise in the queue\n promise.then(\n result => {\n const { resolve } = resolveRejectQueue.pop()\n resolve(result)\n },\n async err => {\n const { reject } = resolveRejectQueue.pop()\n try {\n await handleError(err)\n reject(err)\n } catch (newError) {\n reject(newError)\n }\n }\n )\n })\n\n // While there are promises left pick the next one to yield\n // The caller will then wait for the value to resolve.\n while (promisesQueue.length > 0) {\n const nextPromise = promisesQueue.pop()\n yield nextPromise\n }\n}\n\nmodule.exports = BufferedAsyncIterator\n","const { KafkaJSNonRetriableError } = require('../errors')\n\nconst REJECTED_ERROR = new KafkaJSNonRetriableError(\n 'Queued function aborted due to earlier promise rejection'\n)\nfunction NOOP() {}\n\nconst concurrency = ({ limit, onChange = NOOP } = {}) => {\n if (isNaN(limit) || typeof limit !== 'number' || limit < 1) {\n throw new KafkaJSNonRetriableError(`\"limit\" cannot be less than 1`)\n }\n\n let waiting = []\n let semaphore = 0\n\n const clear = () => {\n for (const lazyAction of waiting) {\n lazyAction((_1, _2, reject) => reject(REJECTED_ERROR))\n }\n waiting = []\n semaphore = 0\n }\n\n const next = () => {\n semaphore--\n onChange(semaphore)\n\n if (waiting.length > 0) {\n const lazyAction = waiting.shift()\n lazyAction()\n }\n }\n\n const invoke = (action, resolve, reject) => {\n semaphore++\n onChange(semaphore)\n\n action()\n .then(result => {\n resolve(result)\n next()\n })\n .catch(error => {\n reject(error)\n clear()\n })\n }\n\n const push = (action, resolve, reject) => {\n if (semaphore < limit) {\n invoke(action, resolve, reject)\n } else {\n waiting.push(override => {\n const execute = override || invoke\n execute(action, resolve, reject)\n })\n }\n }\n\n return action => new Promise((resolve, reject) => push(action, resolve, reject))\n}\n\nmodule.exports = concurrency\n","/**\n * Flatten the given arrays into a new array\n *\n * @param {Array>} arrays\n * @returns {Array}\n * @template T\n */\nfunction flatten(arrays) {\n return [].concat.apply([], arrays)\n}\n\nmodule.exports = flatten\n","module.exports = async (array, groupFn) => {\n const result = new Map()\n\n for (const item of array) {\n const group = await Promise.resolve(groupFn(item))\n result.set(group, result.has(group) ? [...result.get(group), item] : [item])\n }\n\n return result\n}\n","const { format } = require('util')\nconst { KafkaJSLockTimeout } = require('../errors')\n\nconst PRIVATE = {\n LOCKED: Symbol('private:Lock:locked'),\n TIMEOUT: Symbol('private:Lock:timeout'),\n WAITING: Symbol('private:Lock:waiting'),\n TIMEOUT_ERROR_MESSAGE: Symbol('private:Lock:timeoutErrorMessage'),\n}\n\nconst TIMEOUT_MESSAGE = 'Timeout while acquiring lock (%d waiting locks)'\n\nmodule.exports = class Lock {\n constructor({ timeout, description = null } = {}) {\n if (typeof timeout !== 'number') {\n throw new TypeError(`'timeout' is not a number, received '${typeof timeout}'`)\n }\n\n this[PRIVATE.LOCKED] = false\n this[PRIVATE.TIMEOUT] = timeout\n this[PRIVATE.WAITING] = new Set()\n this[PRIVATE.TIMEOUT_ERROR_MESSAGE] = () => {\n const timeoutMessage = format(TIMEOUT_MESSAGE, this[PRIVATE.WAITING].size)\n return description ? `${timeoutMessage}: \"${description}\"` : timeoutMessage\n }\n }\n\n async acquire() {\n return new Promise((resolve, reject) => {\n if (!this[PRIVATE.LOCKED]) {\n this[PRIVATE.LOCKED] = true\n return resolve()\n }\n\n let timeoutId = null\n const tryToAcquire = async () => {\n if (!this[PRIVATE.LOCKED]) {\n this[PRIVATE.LOCKED] = true\n clearTimeout(timeoutId)\n this[PRIVATE.WAITING].delete(tryToAcquire)\n return resolve()\n }\n }\n\n this[PRIVATE.WAITING].add(tryToAcquire)\n timeoutId = setTimeout(() => {\n // The message should contain the number of waiters _including_ this one\n const error = new KafkaJSLockTimeout(this[PRIVATE.TIMEOUT_ERROR_MESSAGE]())\n this[PRIVATE.WAITING].delete(tryToAcquire)\n reject(error)\n }, this[PRIVATE.TIMEOUT])\n })\n }\n\n async release() {\n this[PRIVATE.LOCKED] = false\n const waitingLock = this[PRIVATE.WAITING].values().next().value\n\n if (waitingLock) {\n return waitingLock()\n }\n }\n}\n","/**\n * @exports Long\n * @class A Long class for representing a 64 bit int (BigInt)\n * @param {bigint} value The value of the 64 bit int\n * @constructor\n */\nclass Long {\n constructor(value) {\n this.value = value\n }\n\n /**\n * @function isLong\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\n static isLong(obj) {\n return typeof obj.value === 'bigint'\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromBits(value) {\n return new Long(BigInt(value))\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromInt(value) {\n if (isNaN(value)) return Long.ZERO\n\n return new Long(BigInt.asIntN(64, BigInt(value)))\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromNumber(value) {\n if (isNaN(value)) return Long.ZERO\n\n return new Long(BigInt(value))\n }\n\n /**\n * @function\n * @param {bigint|number|string|Long} val\n * @returns {!Long}\n * @inner\n */\n static fromValue(val) {\n if (typeof val === 'number') return this.fromNumber(val)\n if (typeof val === 'string') return this.fromString(val)\n if (typeof val === 'bigint') return new Long(val)\n if (this.isLong(val)) return new Long(BigInt(val.value))\n\n return new Long(BigInt(val))\n }\n\n /**\n * @param {string} str\n * @returns {!Long}\n * @inner\n */\n static fromString(str) {\n if (str.length === 0) throw Error('empty string')\n if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity')\n return Long.ZERO\n return new Long(BigInt(str))\n }\n\n /**\n * Tests if this Long's value equals zero.\n * @returns {boolean}\n */\n isZero() {\n return this.value === BigInt(0)\n }\n\n /**\n * Tests if this Long's value is negative.\n * @returns {boolean}\n */\n isNegative() {\n return this.value < BigInt(0)\n }\n\n /**\n * Converts the Long to a string.\n * @returns {string}\n * @override\n */\n toString() {\n return String(this.value)\n }\n\n /**\n * Converts the Long to the nearest floating-point representation (double, 53-bit mantissa)\n * @returns {number}\n * @override\n */\n toNumber() {\n return Number(this.value)\n }\n\n /**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @returns {number}\n */\n toInt() {\n return Number(BigInt.asIntN(32, this.value))\n }\n\n /**\n * Converts the Long to JSON\n * @returns {string}\n * @override\n */\n toJSON() {\n return this.toString()\n }\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftLeft(numBits) {\n return new Long(this.value << BigInt(numBits))\n }\n\n /**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftRight(numBits) {\n return new Long(this.value >> BigInt(numBits))\n }\n\n /**\n * Returns the bitwise OR of this Long and the specified.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n or(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return Long.fromBits(this.value | other.value)\n }\n\n /**\n * Returns the bitwise XOR of this Long and the given one.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n xor(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return new Long(this.value ^ other.value)\n }\n\n /**\n * Returns the bitwise AND of this Long and the specified.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n and(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return new Long(this.value & other.value)\n }\n\n /**\n * Returns the bitwise NOT of this Long.\n * @returns {!Long}\n */\n not() {\n return new Long(~this.value)\n }\n\n /**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftRightUnsigned(numBits) {\n return new Long(this.value >> BigInt.asUintN(64, BigInt(numBits)))\n }\n\n /**\n * Tests if this Long's value equals the specified's.\n * @param {bigint|number|string} other Other value\n * @returns {boolean}\n */\n equals(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value === other.value\n }\n\n /**\n * Tests if this Long's value is greater than or equal the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n greaterThanOrEqual(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value >= other.value\n }\n\n gte(other) {\n return this.greaterThanOrEqual(other)\n }\n\n notEquals(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return !this.equals(/* validates */ other)\n }\n\n /**\n * Returns the sum of this and the specified Long.\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\n add(addend) {\n if (!Long.isLong(addend)) addend = Long.fromValue(addend)\n return new Long(this.value + addend.value)\n }\n\n /**\n * Returns the difference of this and the specified Long.\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n subtract(subtrahend) {\n if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend)\n return this.add(subtrahend.negate())\n }\n\n /**\n * Returns the product of this and the specified Long.\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n multiply(multiplier) {\n if (this.isZero()) return Long.ZERO\n if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier)\n return new Long(this.value * multiplier.value)\n }\n\n /**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n divide(divisor) {\n if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor)\n if (divisor.isZero()) throw Error('division by zero')\n return new Long(this.value / divisor.value)\n }\n\n /**\n * Compares this Long's value with the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n compare(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n if (this.value === other.value) return 0\n if (this.value > other.value) return 1\n if (other.value > this.value) return -1\n }\n\n /**\n * Tests if this Long's value is less than the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n lessThan(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value < other.value\n }\n\n /**\n * Negates this Long's value.\n * @returns {!Long} Negated Long\n */\n negate() {\n if (this.equals(Long.MIN_VALUE)) {\n return Long.MIN_VALUE\n }\n return this.not().add(Long.ONE)\n }\n\n /**\n * Gets the high 32 bits as a signed integer.\n * @returns {number} Signed high bits\n */\n getHighBits() {\n return Number(BigInt.asIntN(32, this.value >> BigInt(32)))\n }\n\n /**\n * Gets the low 32 bits as a signed integer.\n * @returns {number} Signed low bits\n */\n getLowBits() {\n return Number(BigInt.asIntN(32, this.value))\n }\n}\n\n/**\n * Minimum signed value.\n * @type {bigint}\n */\nLong.MIN_VALUE = new Long(BigInt('-9223372036854775808'))\n\n/**\n * Maximum signed value.\n * @type {bigint}\n */\nLong.MAX_VALUE = new Long(BigInt('9223372036854775807'))\n\n/**\n * Signed zero.\n * @type {Long}\n */\nLong.ZERO = Long.fromInt(0)\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = Long.fromInt(1)\n\nmodule.exports = Long\n","/**\n * @template T\n * @param { (...args: any) => Promise } [asyncFunction]\n * Promise returning function that will only ever be invoked sequentially.\n * @returns { (...args: any) => Promise }\n * Function that may invoke asyncFunction if there is not a currently executing invocation.\n * Returns promise from the currently executing invocation.\n */\nmodule.exports = asyncFunction => {\n let promise = null\n\n return (...args) => {\n if (promise == null) {\n promise = asyncFunction(...args).finally(() => (promise = null))\n }\n return promise\n }\n}\n","/**\n * @param {T[]} array\n * @returns T[]\n * @template T\n */\nmodule.exports = array => {\n if (!Array.isArray(array)) {\n throw new TypeError(\"'array' is not an array\")\n }\n\n if (array.length < 2) {\n return array\n }\n\n const copy = array.slice()\n\n for (let i = copy.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1))\n const temp = copy[i]\n copy[i] = copy[j]\n copy[j] = temp\n }\n\n return copy\n}\n","module.exports = timeInMs =>\n new Promise(resolve => {\n setTimeout(resolve, timeInMs)\n })\n","const { keys } = Object\nmodule.exports = object =>\n keys(object).reduce((result, key) => ({ ...result, [object[key]]: key }), {})\n","const sleep = require('./sleep')\nconst { KafkaJSTimeout } = require('../errors')\n\nmodule.exports = (\n fn,\n { delay = 50, maxWait = 10000, timeoutMessage = 'Timeout', ignoreTimeout = false } = {}\n) => {\n let timeoutId\n let totalWait = 0\n let fulfilled = false\n\n const checkCondition = async (resolve, reject) => {\n totalWait += delay\n await sleep(delay)\n\n try {\n const result = await fn(totalWait)\n if (result) {\n fulfilled = true\n clearTimeout(timeoutId)\n return resolve(result)\n }\n\n checkCondition(resolve, reject)\n } catch (e) {\n fulfilled = true\n clearTimeout(timeoutId)\n reject(e)\n }\n }\n\n return new Promise((resolve, reject) => {\n checkCondition(resolve, reject)\n\n if (ignoreTimeout) {\n return\n }\n\n timeoutId = setTimeout(() => {\n if (!fulfilled) {\n return reject(new KafkaJSTimeout(timeoutMessage))\n }\n }, maxWait)\n })\n}\n","const BASE_URL = 'https://kafka.js.org'\n\nmodule.exports = (path, hash) => `${BASE_URL}/${path}${hash ? '#' + hash : ''}`\n","/*!\n * media-typer\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * RegExp to match *( \";\" parameter ) in RFC 2616 sec 3.7\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = >\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * TEXT = \n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = \n * LF = \n * SP = \n * SHT = \n * CTL = \n * OCTET = \n */\nvar paramRegExp = /; *([!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+) *= *(\"(?:[ !\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u0020-\\u007e])*\"|[!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+) */g;\nvar textRegExp = /^[\\u0020-\\u007e\\u0080-\\u00ff]+$/\nvar tokenRegExp = /^[!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+$/\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n */\nvar qescRegExp = /\\\\([\\u0000-\\u007f])/g;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n */\nvar quoteRegExp = /([\\\\\"])/g;\n\n/**\n * RegExp to match type in RFC 6838\n *\n * type-name = restricted-name\n * subtype-name = restricted-name\n * restricted-name = restricted-name-first *126restricted-name-chars\n * restricted-name-first = ALPHA / DIGIT\n * restricted-name-chars = ALPHA / DIGIT / \"!\" / \"#\" /\n * \"$\" / \"&\" / \"-\" / \"^\" / \"_\"\n * restricted-name-chars =/ \".\" ; Characters before first dot always\n * ; specify a facet name\n * restricted-name-chars =/ \"+\" ; Characters after last plus always\n * ; specify a structured syntax suffix\n * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n * DIGIT = %x30-39 ; 0-9\n */\nvar subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/\nvar typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/\nvar typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;\n\n/**\n * Module exports.\n */\n\nexports.format = format\nexports.parse = parse\n\n/**\n * Format object to media type.\n *\n * @param {object} obj\n * @return {string}\n * @api public\n */\n\nfunction format(obj) {\n if (!obj || typeof obj !== 'object') {\n throw new TypeError('argument obj is required')\n }\n\n var parameters = obj.parameters\n var subtype = obj.subtype\n var suffix = obj.suffix\n var type = obj.type\n\n if (!type || !typeNameRegExp.test(type)) {\n throw new TypeError('invalid type')\n }\n\n if (!subtype || !subtypeNameRegExp.test(subtype)) {\n throw new TypeError('invalid subtype')\n }\n\n // format as type/subtype\n var string = type + '/' + subtype\n\n // append +suffix\n if (suffix) {\n if (!typeNameRegExp.test(suffix)) {\n throw new TypeError('invalid suffix')\n }\n\n string += '+' + suffix\n }\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n if (!tokenRegExp.test(param)) {\n throw new TypeError('invalid parameter name')\n }\n\n string += '; ' + param + '=' + qstring(parameters[param])\n }\n }\n\n return string\n}\n\n/**\n * Parse media type to object.\n *\n * @param {string|object} string\n * @return {Object}\n * @api public\n */\n\nfunction parse(string) {\n if (!string) {\n throw new TypeError('argument string is required')\n }\n\n // support req/res-like objects as argument\n if (typeof string === 'object') {\n string = getcontenttype(string)\n }\n\n if (typeof string !== 'string') {\n throw new TypeError('argument string is required to be a string')\n }\n\n var index = string.indexOf(';')\n var type = index !== -1\n ? string.substr(0, index)\n : string\n\n var key\n var match\n var obj = splitType(type)\n var params = {}\n var value\n\n paramRegExp.lastIndex = index\n\n while (match = paramRegExp.exec(string)) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .substr(1, value.length - 2)\n .replace(qescRegExp, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n obj.parameters = params\n\n return obj\n}\n\n/**\n * Get content-type from req/res objects.\n *\n * @param {object}\n * @return {Object}\n * @api private\n */\n\nfunction getcontenttype(obj) {\n if (typeof obj.getHeader === 'function') {\n // res-like\n return obj.getHeader('content-type')\n }\n\n if (typeof obj.headers === 'object') {\n // req-like\n return obj.headers && obj.headers['content-type']\n }\n}\n\n/**\n * Quote a string if necessary.\n *\n * @param {string} val\n * @return {string}\n * @api private\n */\n\nfunction qstring(val) {\n var str = String(val)\n\n // no need to quote tokens\n if (tokenRegExp.test(str)) {\n return str\n }\n\n if (str.length > 0 && !textRegExp.test(str)) {\n throw new TypeError('invalid parameter value')\n }\n\n return '\"' + str.replace(quoteRegExp, '\\\\$1') + '\"'\n}\n\n/**\n * Simply \"type/subtype+siffx\" into parts.\n *\n * @param {string} string\n * @return {Object}\n * @api private\n */\n\nfunction splitType(string) {\n var match = typeRegExp.exec(string.toLowerCase())\n\n if (!match) {\n throw new TypeError('invalid media type')\n }\n\n var type = match[1]\n var subtype = match[2]\n var suffix\n\n // suffix after last +\n var index = subtype.lastIndexOf('+')\n if (index !== -1) {\n suffix = subtype.substr(index + 1)\n subtype = subtype.substr(0, index)\n }\n\n var obj = {\n type: type,\n subtype: subtype,\n suffix: suffix\n }\n\n return obj\n}\n","/*!\n * merge-descriptors\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = merge\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n\n/**\n * Merge the property descriptors of `src` into `dest`\n *\n * @param {object} dest Object to add descriptors to\n * @param {object} src Object to clone descriptors from\n * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties\n * @returns {object} Reference to dest\n * @public\n */\n\nfunction merge(dest, src, redefine) {\n if (!dest) {\n throw new TypeError('argument dest is required')\n }\n\n if (!src) {\n throw new TypeError('argument src is required')\n }\n\n if (redefine === undefined) {\n // Default to true\n redefine = true\n }\n\n Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {\n if (!redefine && hasOwnProperty.call(dest, name)) {\n // Skip desriptor\n return\n }\n\n // Copy descriptor\n var descriptor = Object.getOwnPropertyDescriptor(src, name)\n Object.defineProperty(dest, name, descriptor)\n })\n\n return dest\n}\n","/*!\n * methods\n * Copyright(c) 2013-2014 TJ Holowaychuk\n * Copyright(c) 2015-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar http = require('http');\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = getCurrentNodeMethods() || getBasicNodeMethods();\n\n/**\n * Get the current Node.js methods.\n * @private\n */\n\nfunction getCurrentNodeMethods() {\n return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) {\n return method.toLowerCase();\n });\n}\n\n/**\n * Get the \"basic\" Node.js methods, a snapshot from Node.js 0.10.\n * @private\n */\n\nfunction getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","var path = require('path');\nvar fs = require('fs');\n\nfunction Mime() {\n // Map of extension -> mime type\n this.types = Object.create(null);\n\n // Map of mime type -> extension\n this.extensions = Object.create(null);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * @param map (Object) type definitions\n */\nMime.prototype.define = function (map) {\n for (var type in map) {\n var exts = map[type];\n for (var i = 0; i < exts.length; i++) {\n if (process.env.DEBUG_MIME && this.types[exts[i]]) {\n console.warn((this._loading || \"define()\").replace(/.*\\//, ''), 'changes \"' + exts[i] + '\" extension type from ' +\n this.types[exts[i]] + ' to ' + type);\n }\n\n this.types[exts[i]] = type;\n }\n\n // Default extension is the first one we encounter\n if (!this.extensions[type]) {\n this.extensions[type] = exts[0];\n }\n }\n};\n\n/**\n * Load an Apache2-style \".types\" file\n *\n * This may be called multiple times (it's expected). Where files declare\n * overlapping types/extensions, the last file wins.\n *\n * @param file (String) path of file to load.\n */\nMime.prototype.load = function(file) {\n this._loading = file;\n // Read file and split into lines\n var map = {},\n content = fs.readFileSync(file, 'ascii'),\n lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(function(line) {\n // Clean up whitespace/comments, and split into fields\n var fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.lookup = function(path, fallback) {\n var ext = path.replace(/^.*[\\.\\/\\\\]/, '').toLowerCase();\n\n return this.types[ext] || fallback || this.default_type;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.extension = function(mimeType) {\n var type = mimeType.match(/^\\s*([^;\\s]*)(?:;|\\s|$)/)[1].toLowerCase();\n return this.extensions[type];\n};\n\n// Default instance\nvar mime = new Mime();\n\n// Define built-in types\nmime.define(require('./types.json'));\n\n// Default type\nmime.default_type = mime.lookup('bin');\n\n//\n// Additional API specific to the default instance\n//\n\nmime.Mime = Mime;\n\n/**\n * Lookup a charset based on mime type.\n */\nmime.charsets = {\n lookup: function(mimeType, fallback) {\n // Assume text types are utf8\n return (/^text\\/|^application\\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback;\n }\n};\n\nmodule.exports = mime;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","var packet = require('dns-packet')\nvar dgram = require('dgram')\nvar thunky = require('thunky')\nvar events = require('events')\nvar os = require('os')\n\nvar noop = function () {}\n\nmodule.exports = function (opts) {\n if (!opts) opts = {}\n\n var that = new events.EventEmitter()\n var port = typeof opts.port === 'number' ? opts.port : 5353\n var type = opts.type || 'udp4'\n var ip = opts.ip || opts.host || (type === 'udp4' ? '224.0.0.251' : null)\n var me = {address: ip, port: port}\n var memberships = {}\n var destroyed = false\n var interval = null\n\n if (type === 'udp6' && (!ip || !opts.interface)) {\n throw new Error('For IPv6 multicast you must specify `ip` and `interface`')\n }\n\n var socket = opts.socket || dgram.createSocket({\n type: type,\n reuseAddr: opts.reuseAddr !== false,\n toString: function () {\n return type\n }\n })\n\n socket.on('error', function (err) {\n if (err.code === 'EACCES' || err.code === 'EADDRINUSE') that.emit('error', err)\n else that.emit('warning', err)\n })\n\n socket.on('message', function (message, rinfo) {\n try {\n message = packet.decode(message)\n } catch (err) {\n that.emit('warning', err)\n return\n }\n\n that.emit('packet', message, rinfo)\n\n if (message.type === 'query') that.emit('query', message, rinfo)\n if (message.type === 'response') that.emit('response', message, rinfo)\n })\n\n socket.on('listening', function () {\n if (!port) port = me.port = socket.address().port\n if (opts.multicast !== false) {\n that.update()\n interval = setInterval(that.update, 5000)\n socket.setMulticastTTL(opts.ttl || 255)\n socket.setMulticastLoopback(opts.loopback !== false)\n }\n })\n\n var bind = thunky(function (cb) {\n if (!port || opts.bind === false) return cb(null)\n socket.once('error', cb)\n socket.bind(port, opts.bind || opts.interface, function () {\n socket.removeListener('error', cb)\n cb(null)\n })\n })\n\n bind(function (err) {\n if (err) return that.emit('error', err)\n that.emit('ready')\n })\n\n that.send = function (value, rinfo, cb) {\n if (typeof rinfo === 'function') return that.send(value, null, rinfo)\n if (!cb) cb = noop\n if (!rinfo) rinfo = me\n else if (!rinfo.host && !rinfo.address) rinfo.address = me.address\n\n bind(onbind)\n\n function onbind (err) {\n if (destroyed) return cb()\n if (err) return cb(err)\n var message = packet.encode(value)\n socket.send(message, 0, message.length, rinfo.port, rinfo.address || rinfo.host, cb)\n }\n }\n\n that.response =\n that.respond = function (res, rinfo, cb) {\n if (Array.isArray(res)) res = {answers: res}\n\n res.type = 'response'\n res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER\n that.send(res, rinfo, cb)\n }\n\n that.query = function (q, type, rinfo, cb) {\n if (typeof type === 'function') return that.query(q, null, null, type)\n if (typeof type === 'object' && type && type.port) return that.query(q, null, type, rinfo)\n if (typeof rinfo === 'function') return that.query(q, type, null, rinfo)\n if (!cb) cb = noop\n\n if (typeof q === 'string') q = [{name: q, type: type || 'ANY'}]\n if (Array.isArray(q)) q = {type: 'query', questions: q}\n\n q.type = 'query'\n that.send(q, rinfo, cb)\n }\n\n that.destroy = function (cb) {\n if (!cb) cb = noop\n if (destroyed) return process.nextTick(cb)\n destroyed = true\n clearInterval(interval)\n\n // Need to drop memberships by hand and ignore errors.\n // socket.close() does not cope with errors.\n for (var iface in memberships) {\n try {\n socket.dropMembership(ip, iface)\n } catch (e) {\n // eat it\n }\n }\n memberships = {}\n socket.close(cb)\n }\n\n that.update = function () {\n var ifaces = opts.interface ? [].concat(opts.interface) : allInterfaces()\n var updated = false\n\n for (var i = 0; i < ifaces.length; i++) {\n var addr = ifaces[i]\n if (memberships[addr]) continue\n\n try {\n socket.addMembership(ip, addr)\n memberships[addr] = true\n updated = true\n } catch (err) {\n that.emit('warning', err)\n }\n }\n\n if (updated) {\n if (socket.setMulticastInterface) {\n try {\n socket.setMulticastInterface(opts.interface || defaultInterface())\n } catch (err) {\n that.emit('warning', err)\n }\n }\n that.emit('networkInterface')\n }\n }\n\n return that\n}\n\nfunction defaultInterface () {\n var networks = os.networkInterfaces()\n var names = Object.keys(networks)\n\n for (var i = 0; i < names.length; i++) {\n var net = networks[names[i]]\n for (var j = 0; j < net.length; j++) {\n var iface = net[j]\n if (isIPv4(iface.family) && !iface.internal) {\n if (os.platform() === 'darwin' && names[i] === 'en0') return iface.address\n return '0.0.0.0'\n }\n }\n }\n\n return '127.0.0.1'\n}\n\nfunction allInterfaces () {\n var networks = os.networkInterfaces()\n var names = Object.keys(networks)\n var res = []\n\n for (var i = 0; i < names.length; i++) {\n var net = networks[names[i]]\n for (var j = 0; j < net.length; j++) {\n var iface = net[j]\n if (isIPv4(iface.family)) {\n res.push(iface.address)\n // could only addMembership once per interface (https://nodejs.org/api/dgram.html#dgram_socket_addmembership_multicastaddress_multicastinterface)\n break\n }\n }\n }\n\n return res\n}\n\nfunction isIPv4 (family) { // for backwards compat\n return family === 4 || family === 'IPv4'\n}\n","/*!\n * negotiator\n * Copyright(c) 2012 Federico Romero\n * Copyright(c) 2012-2014 Isaac Z. Schlueter\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\nvar preferredCharsets = require('./lib/charset')\nvar preferredEncodings = require('./lib/encoding')\nvar preferredLanguages = require('./lib/language')\nvar preferredMediaTypes = require('./lib/mediaType')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Negotiator;\nmodule.exports.Negotiator = Negotiator;\n\n/**\n * Create a Negotiator instance from a request.\n * @param {object} request\n * @public\n */\n\nfunction Negotiator(request) {\n if (!(this instanceof Negotiator)) {\n return new Negotiator(request);\n }\n\n this.request = request;\n}\n\nNegotiator.prototype.charset = function charset(available) {\n var set = this.charsets(available);\n return set && set[0];\n};\n\nNegotiator.prototype.charsets = function charsets(available) {\n return preferredCharsets(this.request.headers['accept-charset'], available);\n};\n\nNegotiator.prototype.encoding = function encoding(available) {\n var set = this.encodings(available);\n return set && set[0];\n};\n\nNegotiator.prototype.encodings = function encodings(available) {\n return preferredEncodings(this.request.headers['accept-encoding'], available);\n};\n\nNegotiator.prototype.language = function language(available) {\n var set = this.languages(available);\n return set && set[0];\n};\n\nNegotiator.prototype.languages = function languages(available) {\n return preferredLanguages(this.request.headers['accept-language'], available);\n};\n\nNegotiator.prototype.mediaType = function mediaType(available) {\n var set = this.mediaTypes(available);\n return set && set[0];\n};\n\nNegotiator.prototype.mediaTypes = function mediaTypes(available) {\n return preferredMediaTypes(this.request.headers.accept, available);\n};\n\n// Backwards compatibility\nNegotiator.prototype.preferredCharset = Negotiator.prototype.charset;\nNegotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;\nNegotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;\nNegotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;\nNegotiator.prototype.preferredLanguage = Negotiator.prototype.language;\nNegotiator.prototype.preferredLanguages = Negotiator.prototype.languages;\nNegotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;\nNegotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredCharsets;\nmodule.exports.preferredCharsets = preferredCharsets;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleCharsetRegExp = /^\\s*([^\\s;]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Charset header.\n * @private\n */\n\nfunction parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a charset from the Accept-Charset header.\n * @private\n */\n\nfunction parseCharset(str, i) {\n var match = simpleCharsetRegExp.exec(str);\n if (!match) return null;\n\n var charset = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n charset: charset,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of a charset.\n * @private\n */\n\nfunction getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the charset.\n * @private\n */\n\nfunction specify(charset, spec, index) {\n var s = 0;\n if(spec.charset.toLowerCase() === charset.toLowerCase()){\n s |= 1;\n } else if (spec.charset !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n}\n\n/**\n * Get the preferred charsets from an Accept-Charset header.\n * @public\n */\n\nfunction preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full charset string.\n * @private\n */\n\nfunction getFullCharset(spec) {\n return spec.charset;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredEncodings;\nmodule.exports.preferredEncodings = preferredEncodings;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleEncodingRegExp = /^\\s*([^\\s;]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Encoding header.\n * @private\n */\n\nfunction parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse an encoding from the Accept-Encoding header.\n * @private\n */\n\nfunction parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of an encoding.\n * @private\n */\n\nfunction getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the encoding.\n * @private\n */\n\nfunction specify(encoding, spec, index) {\n var s = 0;\n if(spec.encoding.toLowerCase() === encoding.toLowerCase()){\n s |= 1;\n } else if (spec.encoding !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n};\n\n/**\n * Get the preferred encodings from an Accept-Encoding header.\n * @public\n */\n\nfunction preferredEncodings(accept, provided) {\n var accepts = parseAcceptEncoding(accept || '');\n\n if (!provided) {\n // sorted list of all encodings\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullEncoding);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getEncodingPriority(type, accepts, index);\n });\n\n // sorted list of accepted encodings\n return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full encoding string.\n * @private\n */\n\nfunction getFullEncoding(spec) {\n return spec.encoding;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredLanguages;\nmodule.exports.preferredLanguages = preferredLanguages;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleLanguageRegExp = /^\\s*([^\\s\\-;]+)(?:-([^\\s;]+))?\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Language header.\n * @private\n */\n\nfunction parseAcceptLanguage(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var language = parseLanguage(accepts[i].trim(), i);\n\n if (language) {\n accepts[j++] = language;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a language from the Accept-Language header.\n * @private\n */\n\nfunction parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1]\n var suffix = match[2]\n var full = prefix\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}\n\n/**\n * Get the priority of a language.\n * @private\n */\n\nfunction getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the language.\n * @private\n */\n\nfunction specify(language, spec, index) {\n var p = parseLanguage(language)\n if (!p) return null;\n var s = 0;\n if(spec.full.toLowerCase() === p.full.toLowerCase()){\n s |= 4;\n } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {\n s |= 2;\n } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {\n s |= 1;\n } else if (spec.full !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n};\n\n/**\n * Get the preferred languages from an Accept-Language header.\n * @public\n */\n\nfunction preferredLanguages(accept, provided) {\n // RFC 2616 sec 14.4: no header = *\n var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all languages\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullLanguage);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getLanguagePriority(type, accepts, index);\n });\n\n // sorted list of accepted languages\n return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full language string.\n * @private\n */\n\nfunction getFullLanguage(spec) {\n return spec.full;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredMediaTypes;\nmodule.exports.preferredMediaTypes = preferredMediaTypes;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleMediaTypeRegExp = /^\\s*([^\\s\\/;]+)\\/([^;\\s]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept header.\n * @private\n */\n\nfunction parseAccept(accept) {\n var accepts = splitMediaTypes(accept);\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var mediaType = parseMediaType(accepts[i].trim(), i);\n\n if (mediaType) {\n accepts[j++] = mediaType;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a media type from the Accept header.\n * @private\n */\n\nfunction parseMediaType(str, i) {\n var match = simpleMediaTypeRegExp.exec(str);\n if (!match) return null;\n\n var params = Object.create(null);\n var q = 1;\n var subtype = match[2];\n var type = match[1];\n\n if (match[3]) {\n var kvps = splitParameters(match[3]).map(splitKeyValuePair);\n\n for (var j = 0; j < kvps.length; j++) {\n var pair = kvps[j];\n var key = pair[0].toLowerCase();\n var val = pair[1];\n\n // get the value, unwrapping quotes\n var value = val && val[0] === '\"' && val[val.length - 1] === '\"'\n ? val.substr(1, val.length - 2)\n : val;\n\n if (key === 'q') {\n q = parseFloat(value);\n break;\n }\n\n // store parameter\n params[key] = value;\n }\n }\n\n return {\n type: type,\n subtype: subtype,\n params: params,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of a media type.\n * @private\n */\n\nfunction getMediaTypePriority(type, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(type, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the media type.\n * @private\n */\n\nfunction specify(type, spec, index) {\n var p = parseMediaType(type);\n var s = 0;\n\n if (!p) {\n return null;\n }\n\n if(spec.type.toLowerCase() == p.type.toLowerCase()) {\n s |= 4\n } else if(spec.type != '*') {\n return null;\n }\n\n if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {\n s |= 2\n } else if(spec.subtype != '*') {\n return null;\n }\n\n var keys = Object.keys(spec.params);\n if (keys.length > 0) {\n if (keys.every(function (k) {\n return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();\n })) {\n s |= 1\n } else {\n return null\n }\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s,\n }\n}\n\n/**\n * Get the preferred media types from an Accept header.\n * @public\n */\n\nfunction preferredMediaTypes(accept, provided) {\n // RFC 2616 sec 14.2: no header = */*\n var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');\n\n if (!provided) {\n // sorted list of all types\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullType);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getMediaTypePriority(type, accepts, index);\n });\n\n // sorted list of accepted types\n return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full type string.\n * @private\n */\n\nfunction getFullType(spec) {\n return spec.type + '/' + spec.subtype;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n\n/**\n * Count the number of quotes in a string.\n * @private\n */\n\nfunction quoteCount(string) {\n var count = 0;\n var index = 0;\n\n while ((index = string.indexOf('\"', index)) !== -1) {\n count++;\n index++;\n }\n\n return count;\n}\n\n/**\n * Split a key value pair.\n * @private\n */\n\nfunction splitKeyValuePair(str) {\n var index = str.indexOf('=');\n var key;\n var val;\n\n if (index === -1) {\n key = str;\n } else {\n key = str.substr(0, index);\n val = str.substr(index + 1);\n }\n\n return [key, val];\n}\n\n/**\n * Split an Accept header into media types.\n * @private\n */\n\nfunction splitMediaTypes(accept) {\n var accepts = accept.split(',');\n\n for (var i = 1, j = 0; i < accepts.length; i++) {\n if (quoteCount(accepts[j]) % 2 == 0) {\n accepts[++j] = accepts[i];\n } else {\n accepts[j] += ',' + accepts[i];\n }\n }\n\n // trim accepts\n accepts.length = j + 1;\n\n return accepts;\n}\n\n/**\n * Split a string of parameters.\n * @private\n */\n\nfunction splitParameters(str) {\n var parameters = str.split(';');\n\n for (var i = 1, j = 0; i < parameters.length; i++) {\n if (quoteCount(parameters[j]) % 2 == 0) {\n parameters[++j] = parameters[i];\n } else {\n parameters[j] += ';' + parameters[i];\n }\n }\n\n // trim parameters\n parameters.length = j + 1;\n\n for (var i = 0; i < parameters.length; i++) {\n parameters[i] = parameters[i].trim();\n }\n\n return parameters;\n}\n","if (typeof process.addon === 'function') { // if the platform supports native resolving prefer that\n module.exports = process.addon.bind(process)\n} else { // else use the runtime version here\n module.exports = require('./node-gyp-build.js')\n}\n","var fs = require('fs')\nvar path = require('path')\nvar os = require('os')\n\n// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'\nvar runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line\n\nvar vars = (process.config && process.config.variables) || {}\nvar prebuildsOnly = !!process.env.PREBUILDS_ONLY\nvar abi = process.versions.modules // TODO: support old node where this is undef\nvar runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node')\n\nvar arch = process.env.npm_config_arch || os.arch()\nvar platform = process.env.npm_config_platform || os.platform()\nvar libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')\nvar armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''\nvar uv = (process.versions.uv || '').split('.')[0]\n\nmodule.exports = load\n\nfunction load (dir) {\n return runtimeRequire(load.resolve(dir))\n}\n\nload.resolve = load.path = function (dir) {\n dir = path.resolve(dir || '.')\n\n try {\n var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')\n if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']\n } catch (err) {}\n\n if (!prebuildsOnly) {\n var release = getFirst(path.join(dir, 'build/Release'), matchBuild)\n if (release) return release\n\n var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)\n if (debug) return debug\n }\n\n var prebuild = resolve(dir)\n if (prebuild) return prebuild\n\n var nearby = resolve(path.dirname(process.execPath))\n if (nearby) return nearby\n\n var target = [\n 'platform=' + platform,\n 'arch=' + arch,\n 'runtime=' + runtime,\n 'abi=' + abi,\n 'uv=' + uv,\n armv ? 'armv=' + armv : '',\n 'libc=' + libc,\n 'node=' + process.versions.node,\n process.versions.electron ? 'electron=' + process.versions.electron : '',\n typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line\n ].filter(Boolean).join(' ')\n\n throw new Error('No native build was found for ' + target + '\\n loaded from: ' + dir + '\\n')\n\n function resolve (dir) {\n // Find matching \"prebuilds/-\" directory\n var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)\n var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]\n if (!tuple) return\n\n // Find most specific flavor first\n var prebuilds = path.join(dir, 'prebuilds', tuple.name)\n var parsed = readdirSync(prebuilds).map(parseTags)\n var candidates = parsed.filter(matchTags(runtime, abi))\n var winner = candidates.sort(compareTags(runtime))[0]\n if (winner) return path.join(prebuilds, winner.file)\n }\n}\n\nfunction readdirSync (dir) {\n try {\n return fs.readdirSync(dir)\n } catch (err) {\n return []\n }\n}\n\nfunction getFirst (dir, filter) {\n var files = readdirSync(dir).filter(filter)\n return files[0] && path.join(dir, files[0])\n}\n\nfunction matchBuild (name) {\n return /\\.node$/.test(name)\n}\n\nfunction parseTuple (name) {\n // Example: darwin-x64+arm64\n var arr = name.split('-')\n if (arr.length !== 2) return\n\n var platform = arr[0]\n var architectures = arr[1].split('+')\n\n if (!platform) return\n if (!architectures.length) return\n if (!architectures.every(Boolean)) return\n\n return { name, platform, architectures }\n}\n\nfunction matchTuple (platform, arch) {\n return function (tuple) {\n if (tuple == null) return false\n if (tuple.platform !== platform) return false\n return tuple.architectures.includes(arch)\n }\n}\n\nfunction compareTuples (a, b) {\n // Prefer single-arch prebuilds over multi-arch\n return a.architectures.length - b.architectures.length\n}\n\nfunction parseTags (file) {\n var arr = file.split('.')\n var extension = arr.pop()\n var tags = { file: file, specificity: 0 }\n\n if (extension !== 'node') return\n\n for (var i = 0; i < arr.length; i++) {\n var tag = arr[i]\n\n if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {\n tags.runtime = tag\n } else if (tag === 'napi') {\n tags.napi = true\n } else if (tag.slice(0, 3) === 'abi') {\n tags.abi = tag.slice(3)\n } else if (tag.slice(0, 2) === 'uv') {\n tags.uv = tag.slice(2)\n } else if (tag.slice(0, 4) === 'armv') {\n tags.armv = tag.slice(4)\n } else if (tag === 'glibc' || tag === 'musl') {\n tags.libc = tag\n } else {\n continue\n }\n\n tags.specificity++\n }\n\n return tags\n}\n\nfunction matchTags (runtime, abi) {\n return function (tags) {\n if (tags == null) return false\n if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false\n if (tags.abi !== abi && !tags.napi) return false\n if (tags.uv && tags.uv !== uv) return false\n if (tags.armv && tags.armv !== armv) return false\n if (tags.libc && tags.libc !== libc) return false\n\n return true\n }\n}\n\nfunction runtimeAgnostic (tags) {\n return tags.runtime === 'node' && tags.napi\n}\n\nfunction compareTags (runtime) {\n // Precedence: non-agnostic runtime, abi over napi, then by specificity.\n return function (a, b) {\n if (a.runtime !== b.runtime) {\n return a.runtime === runtime ? -1 : 1\n } else if (a.abi !== b.abi) {\n return a.abi ? -1 : 1\n } else if (a.specificity !== b.specificity) {\n return a.specificity > b.specificity ? -1 : 1\n } else {\n return 0\n }\n }\n}\n\nfunction isNwjs () {\n return !!(process.versions && process.versions.nw)\n}\n\nfunction isElectron () {\n if (process.versions && process.versions.electron) return true\n if (process.env.ELECTRON_RUN_AS_NODE) return true\n return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'\n}\n\nfunction isAlpine (platform) {\n return platform === 'linux' && fs.existsSync('/etc/alpine-release')\n}\n\n// Exposed for unit tests\n// TODO: move to lib\nload.parseTags = parseTags\nload.matchTags = matchTags\nload.compareTags = compareTags\nload.parseTuple = parseTuple\nload.matchTuple = matchTuple\nload.compareTuples = compareTuples\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","module.exports = require('util').inspect;\n","/*!\n * on-finished\n * Copyright(c) 2013 Jonathan Ong\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = onFinished\nmodule.exports.isFinished = isFinished\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar asyncHooks = tryRequireAsyncHooks()\nvar first = require('ee-first')\n\n/**\n * Variables.\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Invoke callback when the response has finished, useful for\n * cleaning up resources afterwards.\n *\n * @param {object} msg\n * @param {function} listener\n * @return {object}\n * @public\n */\n\nfunction onFinished (msg, listener) {\n if (isFinished(msg) !== false) {\n defer(listener, null, msg)\n return msg\n }\n\n // attach the listener to the message\n attachListener(msg, wrap(listener))\n\n return msg\n}\n\n/**\n * Determine if message is already finished.\n *\n * @param {object} msg\n * @return {boolean}\n * @public\n */\n\nfunction isFinished (msg) {\n var socket = msg.socket\n\n if (typeof msg.finished === 'boolean') {\n // OutgoingMessage\n return Boolean(msg.finished || (socket && !socket.writable))\n }\n\n if (typeof msg.complete === 'boolean') {\n // IncomingMessage\n return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))\n }\n\n // don't know\n return undefined\n}\n\n/**\n * Attach a finished listener to the message.\n *\n * @param {object} msg\n * @param {function} callback\n * @private\n */\n\nfunction attachFinishedListener (msg, callback) {\n var eeMsg\n var eeSocket\n var finished = false\n\n function onFinish (error) {\n eeMsg.cancel()\n eeSocket.cancel()\n\n finished = true\n callback(error)\n }\n\n // finished on first message event\n eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)\n\n function onSocket (socket) {\n // remove listener\n msg.removeListener('socket', onSocket)\n\n if (finished) return\n if (eeMsg !== eeSocket) return\n\n // finished on first socket event\n eeSocket = first([[socket, 'error', 'close']], onFinish)\n }\n\n if (msg.socket) {\n // socket already assigned\n onSocket(msg.socket)\n return\n }\n\n // wait for socket to be assigned\n msg.on('socket', onSocket)\n\n if (msg.socket === undefined) {\n // istanbul ignore next: node.js 0.8 patch\n patchAssignSocket(msg, onSocket)\n }\n}\n\n/**\n * Attach the listener to the message.\n *\n * @param {object} msg\n * @return {function}\n * @private\n */\n\nfunction attachListener (msg, listener) {\n var attached = msg.__onFinished\n\n // create a private single listener with queue\n if (!attached || !attached.queue) {\n attached = msg.__onFinished = createListener(msg)\n attachFinishedListener(msg, attached)\n }\n\n attached.queue.push(listener)\n}\n\n/**\n * Create listener on message.\n *\n * @param {object} msg\n * @return {function}\n * @private\n */\n\nfunction createListener (msg) {\n function listener (err) {\n if (msg.__onFinished === listener) msg.__onFinished = null\n if (!listener.queue) return\n\n var queue = listener.queue\n listener.queue = null\n\n for (var i = 0; i < queue.length; i++) {\n queue[i](err, msg)\n }\n }\n\n listener.queue = []\n\n return listener\n}\n\n/**\n * Patch ServerResponse.prototype.assignSocket for node.js 0.8.\n *\n * @param {ServerResponse} res\n * @param {function} callback\n * @private\n */\n\n// istanbul ignore next: node.js 0.8 patch\nfunction patchAssignSocket (res, callback) {\n var assignSocket = res.assignSocket\n\n if (typeof assignSocket !== 'function') return\n\n // res.on('socket', callback) is broken in 0.8\n res.assignSocket = function _assignSocket (socket) {\n assignSocket.call(this, socket)\n callback(socket)\n }\n}\n\n/**\n * Try to require async_hooks\n * @private\n */\n\nfunction tryRequireAsyncHooks () {\n try {\n return require('async_hooks')\n } catch (e) {\n return {}\n }\n}\n\n/**\n * Wrap function with async resource, if possible.\n * AsyncResource.bind static method backported.\n * @private\n */\n\nfunction wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}\n","/*!\n * on-headers\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = onHeaders\n\n/**\n * Create a replacement writeHead method.\n *\n * @param {function} prevWriteHead\n * @param {function} listener\n * @private\n */\n\nfunction createWriteHead (prevWriteHead, listener) {\n var fired = false\n\n // return function with core name and argument list\n return function writeHead (statusCode) {\n // set headers from arguments\n var args = setWriteHeadHeaders.apply(this, arguments)\n\n // fire listener\n if (!fired) {\n fired = true\n listener.call(this)\n\n // pass-along an updated status code\n if (typeof args[0] === 'number' && this.statusCode !== args[0]) {\n args[0] = this.statusCode\n args.length = 1\n }\n }\n\n return prevWriteHead.apply(this, args)\n }\n}\n\n/**\n * Execute a listener when a response is about to write headers.\n *\n * @param {object} res\n * @return {function} listener\n * @public\n */\n\nfunction onHeaders (res, listener) {\n if (!res) {\n throw new TypeError('argument res is required')\n }\n\n if (typeof listener !== 'function') {\n throw new TypeError('argument listener must be a function')\n }\n\n res.writeHead = createWriteHead(res.writeHead, listener)\n}\n\n/**\n * Set headers contained in array on the response object.\n *\n * @param {object} res\n * @param {array} headers\n * @private\n */\n\nfunction setHeadersFromArray (res, headers) {\n for (var i = 0; i < headers.length; i++) {\n res.setHeader(headers[i][0], headers[i][1])\n }\n}\n\n/**\n * Set headers contained in object on the response object.\n *\n * @param {object} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeadersFromObject (res, headers) {\n var keys = Object.keys(headers)\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i]\n if (k) res.setHeader(k, headers[k])\n }\n}\n\n/**\n * Set headers and other properties on the response object.\n *\n * @param {number} statusCode\n * @private\n */\n\nfunction setWriteHeadHeaders (statusCode) {\n var length = arguments.length\n var headerIndex = length > 1 && typeof arguments[1] === 'string'\n ? 2\n : 1\n\n var headers = length >= headerIndex + 1\n ? arguments[headerIndex]\n : undefined\n\n this.statusCode = statusCode\n\n if (Array.isArray(headers)) {\n // handle array case\n setHeadersFromArray(this, headers)\n } else if (headers) {\n // handle object case\n setHeadersFromObject(this, headers)\n }\n\n // copy leading arguments\n var args = new Array(Math.min(length, headerIndex))\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n return args\n}\n","/*!\n * parseurl\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar url = require('url')\nvar parse = url.parse\nvar Url = url.Url\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = parseurl\nmodule.exports.original = originalurl\n\n/**\n * Parse the `req` url with memoization.\n *\n * @param {ServerRequest} req\n * @return {Object}\n * @public\n */\n\nfunction parseurl (req) {\n var url = req.url\n\n if (url === undefined) {\n // URL is undefined\n return undefined\n }\n\n var parsed = req._parsedUrl\n\n if (fresh(url, parsed)) {\n // Return cached URL parse\n return parsed\n }\n\n // Parse the URL\n parsed = fastparse(url)\n parsed._raw = url\n\n return (req._parsedUrl = parsed)\n};\n\n/**\n * Parse the `req` original url with fallback and memoization.\n *\n * @param {ServerRequest} req\n * @return {Object}\n * @public\n */\n\nfunction originalurl (req) {\n var url = req.originalUrl\n\n if (typeof url !== 'string') {\n // Fallback\n return parseurl(req)\n }\n\n var parsed = req._parsedOriginalUrl\n\n if (fresh(url, parsed)) {\n // Return cached URL parse\n return parsed\n }\n\n // Parse the URL\n parsed = fastparse(url)\n parsed._raw = url\n\n return (req._parsedOriginalUrl = parsed)\n};\n\n/**\n * Parse the `str` url with fast-path short-cut.\n *\n * @param {string} str\n * @return {Object}\n * @private\n */\n\nfunction fastparse (str) {\n if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {\n return parse(str)\n }\n\n var pathname = str\n var query = null\n var search = null\n\n // This takes the regexp from https://github.com/joyent/node/pull/7878\n // Which is /^(\\/[^?#\\s]*)(\\?[^#\\s]*)?$/\n // And unrolls it into a for loop\n for (var i = 1; i < str.length; i++) {\n switch (str.charCodeAt(i)) {\n case 0x3f: /* ? */\n if (search === null) {\n pathname = str.substring(0, i)\n query = str.substring(i + 1)\n search = str.substring(i)\n }\n break\n case 0x09: /* \\t */\n case 0x0a: /* \\n */\n case 0x0c: /* \\f */\n case 0x0d: /* \\r */\n case 0x20: /* */\n case 0x23: /* # */\n case 0xa0:\n case 0xfeff:\n return parse(str)\n }\n }\n\n var url = Url !== undefined\n ? new Url()\n : {}\n\n url.path = str\n url.href = str\n url.pathname = pathname\n\n if (search !== null) {\n url.query = query\n url.search = search\n }\n\n return url\n}\n\n/**\n * Determine if parsed is still fresh for url.\n *\n * @param {string} url\n * @param {object} parsedUrl\n * @return {boolean}\n * @private\n */\n\nfunction fresh (url, parsedUrl) {\n return typeof parsedUrl === 'object' &&\n parsedUrl !== null &&\n (Url === undefined || parsedUrl instanceof Url) &&\n parsedUrl._raw === url\n}\n","/**\n * Expose `pathtoRegexp`.\n */\n\nmodule.exports = pathtoRegexp;\n\n/**\n * Match matching groups in a regular expression.\n */\nvar MATCHING_GROUP_REGEXP = /\\((?!\\?)/g;\n\n/**\n * Normalize the given path string,\n * returning a regular expression.\n *\n * An empty array should be passed,\n * which will contain the placeholder\n * key names. For example \"/user/:id\" will\n * then contain [\"id\"].\n *\n * @param {String|RegExp|Array} path\n * @param {Array} keys\n * @param {Object} options\n * @return {RegExp}\n * @api private\n */\n\nfunction pathtoRegexp(path, keys, options) {\n options = options || {};\n keys = keys || [];\n var strict = options.strict;\n var end = options.end !== false;\n var flags = options.sensitive ? '' : 'i';\n var extraOffset = 0;\n var keysOffset = keys.length;\n var i = 0;\n var name = 0;\n var m;\n\n if (path instanceof RegExp) {\n while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {\n keys.push({\n name: name++,\n optional: false,\n offset: m.index\n });\n }\n\n return path;\n }\n\n if (Array.isArray(path)) {\n // Map array parts into regexps and return their source. We also pass\n // the same keys and options instance into every generation to get\n // consistent matching groups before we join the sources together.\n path = path.map(function (value) {\n return pathtoRegexp(value, keys, options).source;\n });\n\n return new RegExp('(?:' + path.join('|') + ')', flags);\n }\n\n path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'))\n .replace(/\\/\\(/g, '/(?:')\n .replace(/([\\/\\.])/g, '\\\\$1')\n .replace(/(\\\\\\/)?(\\\\\\.)?:(\\w+)(\\(.*?\\))?(\\*)?(\\?)?/g, function (match, slash, format, key, capture, star, optional, offset) {\n slash = slash || '';\n format = format || '';\n capture = capture || '([^\\\\/' + format + ']+?)';\n optional = optional || '';\n\n keys.push({\n name: key,\n optional: !!optional,\n offset: offset + extraOffset\n });\n\n var result = ''\n + (optional ? '' : slash)\n + '(?:'\n + format + (optional ? slash : '') + capture\n + (star ? '((?:[\\\\/' + format + '].+?)?)' : '')\n + ')'\n + optional;\n\n extraOffset += result.length - match.length;\n\n return result;\n })\n .replace(/\\*/g, function (star, index) {\n var len = keys.length\n\n while (len-- > keysOffset && keys[len].offset > index) {\n keys[len].offset += 3; // Replacement length minus asterisk length.\n }\n\n return '(.*)';\n });\n\n // This is a workaround for handling unnamed matching groups.\n while (m = MATCHING_GROUP_REGEXP.exec(path)) {\n var escapeCount = 0;\n var index = m.index;\n\n while (path.charAt(--index) === '\\\\') {\n escapeCount++;\n }\n\n // It's possible to escape the bracket.\n if (escapeCount % 2 === 1) {\n continue;\n }\n\n if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {\n keys.splice(keysOffset + i, 0, {\n name: name++, // Unnamed matching groups must be consistently linear.\n optional: false,\n offset: m.index\n });\n }\n\n i++;\n }\n\n // If the path is non-ending, match until the end or a slash.\n path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\\\/|$)'));\n\n return new RegExp(path, flags);\n};\n","/*!\n * proxy-addr\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = proxyaddr\nmodule.exports.all = alladdrs\nmodule.exports.compile = compile\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar forwarded = require('forwarded')\nvar ipaddr = require('ipaddr.js')\n\n/**\n * Variables.\n * @private\n */\n\nvar DIGIT_REGEXP = /^[0-9]+$/\nvar isip = ipaddr.isValid\nvar parseip = ipaddr.parse\n\n/**\n * Pre-defined IP ranges.\n * @private\n */\n\nvar IP_RANGES = {\n linklocal: ['169.254.0.0/16', 'fe80::/10'],\n loopback: ['127.0.0.1/8', '::1/128'],\n uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']\n}\n\n/**\n * Get all addresses in the request, optionally stopping\n * at the first untrusted.\n *\n * @param {Object} request\n * @param {Function|Array|String} [trust]\n * @public\n */\n\nfunction alladdrs (req, trust) {\n // get addresses\n var addrs = forwarded(req)\n\n if (!trust) {\n // Return all addresses\n return addrs\n }\n\n if (typeof trust !== 'function') {\n trust = compile(trust)\n }\n\n for (var i = 0; i < addrs.length - 1; i++) {\n if (trust(addrs[i], i)) continue\n\n addrs.length = i + 1\n }\n\n return addrs\n}\n\n/**\n * Compile argument into trust function.\n *\n * @param {Array|String} val\n * @private\n */\n\nfunction compile (val) {\n if (!val) {\n throw new TypeError('argument is required')\n }\n\n var trust\n\n if (typeof val === 'string') {\n trust = [val]\n } else if (Array.isArray(val)) {\n trust = val.slice()\n } else {\n throw new TypeError('unsupported trust argument')\n }\n\n for (var i = 0; i < trust.length; i++) {\n val = trust[i]\n\n if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) {\n continue\n }\n\n // Splice in pre-defined range\n val = IP_RANGES[val]\n trust.splice.apply(trust, [i, 1].concat(val))\n i += val.length - 1\n }\n\n return compileTrust(compileRangeSubnets(trust))\n}\n\n/**\n * Compile `arr` elements into range subnets.\n *\n * @param {Array} arr\n * @private\n */\n\nfunction compileRangeSubnets (arr) {\n var rangeSubnets = new Array(arr.length)\n\n for (var i = 0; i < arr.length; i++) {\n rangeSubnets[i] = parseipNotation(arr[i])\n }\n\n return rangeSubnets\n}\n\n/**\n * Compile range subnet array into trust function.\n *\n * @param {Array} rangeSubnets\n * @private\n */\n\nfunction compileTrust (rangeSubnets) {\n // Return optimized function based on length\n var len = rangeSubnets.length\n return len === 0\n ? trustNone\n : len === 1\n ? trustSingle(rangeSubnets[0])\n : trustMulti(rangeSubnets)\n}\n\n/**\n * Parse IP notation string into range subnet.\n *\n * @param {String} note\n * @private\n */\n\nfunction parseipNotation (note) {\n var pos = note.lastIndexOf('/')\n var str = pos !== -1\n ? note.substring(0, pos)\n : note\n\n if (!isip(str)) {\n throw new TypeError('invalid IP address: ' + str)\n }\n\n var ip = parseip(str)\n\n if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) {\n // Store as IPv4\n ip = ip.toIPv4Address()\n }\n\n var max = ip.kind() === 'ipv6'\n ? 128\n : 32\n\n var range = pos !== -1\n ? note.substring(pos + 1, note.length)\n : null\n\n if (range === null) {\n range = max\n } else if (DIGIT_REGEXP.test(range)) {\n range = parseInt(range, 10)\n } else if (ip.kind() === 'ipv4' && isip(range)) {\n range = parseNetmask(range)\n } else {\n range = null\n }\n\n if (range <= 0 || range > max) {\n throw new TypeError('invalid range on address: ' + note)\n }\n\n return [ip, range]\n}\n\n/**\n * Parse netmask string into CIDR range.\n *\n * @param {String} netmask\n * @private\n */\n\nfunction parseNetmask (netmask) {\n var ip = parseip(netmask)\n var kind = ip.kind()\n\n return kind === 'ipv4'\n ? ip.prefixLengthFromSubnetMask()\n : null\n}\n\n/**\n * Determine address of proxied request.\n *\n * @param {Object} request\n * @param {Function|Array|String} trust\n * @public\n */\n\nfunction proxyaddr (req, trust) {\n if (!req) {\n throw new TypeError('req argument is required')\n }\n\n if (!trust) {\n throw new TypeError('trust argument is required')\n }\n\n var addrs = alladdrs(req, trust)\n var addr = addrs[addrs.length - 1]\n\n return addr\n}\n\n/**\n * Static trust function to trust nothing.\n *\n * @private\n */\n\nfunction trustNone () {\n return false\n}\n\n/**\n * Compile trust function for multiple subnets.\n *\n * @param {Array} subnets\n * @private\n */\n\nfunction trustMulti (subnets) {\n return function trust (addr) {\n if (!isip(addr)) return false\n\n var ip = parseip(addr)\n var ipconv\n var kind = ip.kind()\n\n for (var i = 0; i < subnets.length; i++) {\n var subnet = subnets[i]\n var subnetip = subnet[0]\n var subnetkind = subnetip.kind()\n var subnetrange = subnet[1]\n var trusted = ip\n\n if (kind !== subnetkind) {\n if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) {\n // Incompatible IP addresses\n continue\n }\n\n if (!ipconv) {\n // Convert IP to match subnet IP kind\n ipconv = subnetkind === 'ipv4'\n ? ip.toIPv4Address()\n : ip.toIPv4MappedAddress()\n }\n\n trusted = ipconv\n }\n\n if (trusted.match(subnetip, subnetrange)) {\n return true\n }\n }\n\n return false\n }\n}\n\n/**\n * Compile trust function for single subnet.\n *\n * @param {Object} subnet\n * @private\n */\n\nfunction trustSingle (subnet) {\n var subnetip = subnet[0]\n var subnetkind = subnetip.kind()\n var subnetisipv4 = subnetkind === 'ipv4'\n var subnetrange = subnet[1]\n\n return function trust (addr) {\n if (!isip(addr)) return false\n\n var ip = parseip(addr)\n var kind = ip.kind()\n\n if (kind !== subnetkind) {\n if (subnetisipv4 && !ip.isIPv4MappedAddress()) {\n // Incompatible IP addresses\n return false\n }\n\n // Convert IP to match subnet IP kind\n ip = subnetisipv4\n ? ip.toIPv4Address()\n : ip.toIPv4MappedAddress()\n }\n\n return ip.match(subnetip, subnetrange)\n }\n}\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar split = String.prototype.split;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n if (generateArrayPrefix === 'comma' && encodeValuesOnly) {\n var valuesArray = split.call(String(obj), ',');\n var valuesJoined = '';\n for (var i = 0; i < valuesArray.length; ++i) {\n valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));\n }\n return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];\n }\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","/*!\n * random-bytes\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar crypto = require('crypto')\n\n/**\n * Module variables.\n * @private\n */\n\nvar generateAttempts = crypto.randomBytes === crypto.pseudoRandomBytes ? 1 : 3\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = randomBytes\nmodule.exports.sync = randomBytesSync\n\n/**\n * Generates strong pseudo-random bytes.\n *\n * @param {number} size\n * @param {function} [callback]\n * @return {Promise}\n * @public\n */\n\nfunction randomBytes(size, callback) {\n // validate callback is a function, if provided\n if (callback !== undefined && typeof callback !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!callback && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n if (callback) {\n // classic callback style\n return generateRandomBytes(size, generateAttempts, callback)\n }\n\n return new Promise(function executor(resolve, reject) {\n generateRandomBytes(size, generateAttempts, function onRandomBytes(err, str) {\n if (err) return reject(err)\n resolve(str)\n })\n })\n}\n\n/**\n * Generates strong pseudo-random bytes sync.\n *\n * @param {number} size\n * @return {Buffer}\n * @public\n */\n\nfunction randomBytesSync(size) {\n var err = null\n\n for (var i = 0; i < generateAttempts; i++) {\n try {\n return crypto.randomBytes(size)\n } catch (e) {\n err = e\n }\n }\n\n throw err\n}\n\n/**\n * Generates strong pseudo-random bytes.\n *\n * @param {number} size\n * @param {number} attempts\n * @param {function} callback\n * @private\n */\n\nfunction generateRandomBytes(size, attempts, callback) {\n crypto.randomBytes(size, function onRandomBytes(err, buf) {\n if (!err) return callback(null, buf)\n if (!--attempts) return callback(err)\n setTimeout(generateRandomBytes.bind(null, size, attempts, callback), 10)\n })\n}\n","/*!\n * range-parser\n * Copyright(c) 2012-2014 TJ Holowaychuk\n * Copyright(c) 2015-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = rangeParser\n\n/**\n * Parse \"Range\" header `str` relative to the given file `size`.\n *\n * @param {Number} size\n * @param {String} str\n * @param {Object} [options]\n * @return {Array}\n * @public\n */\n\nfunction rangeParser (size, str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string')\n }\n\n var index = str.indexOf('=')\n\n if (index === -1) {\n return -2\n }\n\n // split the range string\n var arr = str.slice(index + 1).split(',')\n var ranges = []\n\n // add ranges type\n ranges.type = str.slice(0, index)\n\n // parse all ranges\n for (var i = 0; i < arr.length; i++) {\n var range = arr[i].split('-')\n var start = parseInt(range[0], 10)\n var end = parseInt(range[1], 10)\n\n // -nnn\n if (isNaN(start)) {\n start = size - end\n end = size - 1\n // nnn-\n } else if (isNaN(end)) {\n end = size - 1\n }\n\n // limit last-byte-pos to current length\n if (end > size - 1) {\n end = size - 1\n }\n\n // invalid or unsatisifiable\n if (isNaN(start) || isNaN(end) || start > end || start < 0) {\n continue\n }\n\n // add range\n ranges.push({\n start: start,\n end: end\n })\n }\n\n if (ranges.length < 1) {\n // unsatisifiable\n return -1\n }\n\n return options && options.combine\n ? combineRanges(ranges)\n : ranges\n}\n\n/**\n * Combine overlapping & adjacent ranges.\n * @private\n */\n\nfunction combineRanges (ranges) {\n var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart)\n\n for (var j = 0, i = 1; i < ordered.length; i++) {\n var range = ordered[i]\n var current = ordered[j]\n\n if (range.start > current.end + 1) {\n // next range\n ordered[++j] = range\n } else if (range.end > current.end) {\n // extend range\n current.end = range.end\n current.index = Math.min(current.index, range.index)\n }\n }\n\n // trim ordered array\n ordered.length = j + 1\n\n // generate combined range\n var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex)\n\n // copy ranges type\n combined.type = ranges.type\n\n return combined\n}\n\n/**\n * Map function to add index value to ranges.\n * @private\n */\n\nfunction mapWithIndex (range, index) {\n return {\n start: range.start,\n end: range.end,\n index: index\n }\n}\n\n/**\n * Map function to remove index value from ranges.\n * @private\n */\n\nfunction mapWithoutIndex (range) {\n return {\n start: range.start,\n end: range.end\n }\n}\n\n/**\n * Sort function to sort ranges by index.\n * @private\n */\n\nfunction sortByRangeIndex (a, b) {\n return a.index - b.index\n}\n\n/**\n * Sort function to sort ranges by start position.\n * @private\n */\n\nfunction sortByRangeStart (a, b) {\n return a.start - b.start\n}\n","/*!\n * raw-body\n * Copyright(c) 2013-2014 Jonathan Ong\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar asyncHooks = tryRequireAsyncHooks()\nvar bytes = require('bytes')\nvar createError = require('http-errors')\nvar iconv = require('iconv-lite')\nvar unpipe = require('unpipe')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = getRawBody\n\n/**\n * Module variables.\n * @private\n */\n\nvar ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /\n\n/**\n * Get the decoder for a given encoding.\n *\n * @param {string} encoding\n * @private\n */\n\nfunction getDecoder (encoding) {\n if (!encoding) return null\n\n try {\n return iconv.getDecoder(encoding)\n } catch (e) {\n // error getting decoder\n if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e\n\n // the encoding was not found\n throw createError(415, 'specified encoding unsupported', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n}\n\n/**\n * Get the raw body of a stream (typically HTTP).\n *\n * @param {object} stream\n * @param {object|string|function} [options]\n * @param {function} [callback]\n * @public\n */\n\nfunction getRawBody (stream, options, callback) {\n var done = callback\n var opts = options || {}\n\n if (options === true || typeof options === 'string') {\n // short cut for encoding\n opts = {\n encoding: options\n }\n }\n\n if (typeof options === 'function') {\n done = options\n opts = {}\n }\n\n // validate callback is a function, if provided\n if (done !== undefined && typeof done !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!done && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n // get encoding\n var encoding = opts.encoding !== true\n ? opts.encoding\n : 'utf-8'\n\n // convert the limit to an integer\n var limit = bytes.parse(opts.limit)\n\n // convert the expected length to an integer\n var length = opts.length != null && !isNaN(opts.length)\n ? parseInt(opts.length, 10)\n : null\n\n if (done) {\n // classic callback style\n return readStream(stream, encoding, length, limit, wrap(done))\n }\n\n return new Promise(function executor (resolve, reject) {\n readStream(stream, encoding, length, limit, function onRead (err, buf) {\n if (err) return reject(err)\n resolve(buf)\n })\n })\n}\n\n/**\n * Halt a stream.\n *\n * @param {Object} stream\n * @private\n */\n\nfunction halt (stream) {\n // unpipe everything from the stream\n unpipe(stream)\n\n // pause stream\n if (typeof stream.pause === 'function') {\n stream.pause()\n }\n}\n\n/**\n * Read the data from the stream.\n *\n * @param {object} stream\n * @param {string} encoding\n * @param {number} length\n * @param {number} limit\n * @param {function} callback\n * @public\n */\n\nfunction readStream (stream, encoding, length, limit, callback) {\n var complete = false\n var sync = true\n\n // check the length and limit options.\n // note: we intentionally leave the stream paused,\n // so users should handle the stream themselves.\n if (limit !== null && length !== null && length > limit) {\n return done(createError(413, 'request entity too large', {\n expected: length,\n length: length,\n limit: limit,\n type: 'entity.too.large'\n }))\n }\n\n // streams1: assert request encoding is buffer.\n // streams2+: assert the stream encoding is buffer.\n // stream._decoder: streams1\n // state.encoding: streams2\n // state.decoder: streams2, specifically < 0.10.6\n var state = stream._readableState\n if (stream._decoder || (state && (state.encoding || state.decoder))) {\n // developer error\n return done(createError(500, 'stream encoding should not be set', {\n type: 'stream.encoding.set'\n }))\n }\n\n if (typeof stream.readable !== 'undefined' && !stream.readable) {\n return done(createError(500, 'stream is not readable', {\n type: 'stream.not.readable'\n }))\n }\n\n var received = 0\n var decoder\n\n try {\n decoder = getDecoder(encoding)\n } catch (err) {\n return done(err)\n }\n\n var buffer = decoder\n ? ''\n : []\n\n // attach listeners\n stream.on('aborted', onAborted)\n stream.on('close', cleanup)\n stream.on('data', onData)\n stream.on('end', onEnd)\n stream.on('error', onEnd)\n\n // mark sync section complete\n sync = false\n\n function done () {\n var args = new Array(arguments.length)\n\n // copy arguments\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n // mark complete\n complete = true\n\n if (sync) {\n process.nextTick(invokeCallback)\n } else {\n invokeCallback()\n }\n\n function invokeCallback () {\n cleanup()\n\n if (args[0]) {\n // halt the stream on error\n halt(stream)\n }\n\n callback.apply(null, args)\n }\n }\n\n function onAborted () {\n if (complete) return\n\n done(createError(400, 'request aborted', {\n code: 'ECONNABORTED',\n expected: length,\n length: length,\n received: received,\n type: 'request.aborted'\n }))\n }\n\n function onData (chunk) {\n if (complete) return\n\n received += chunk.length\n\n if (limit !== null && received > limit) {\n done(createError(413, 'request entity too large', {\n limit: limit,\n received: received,\n type: 'entity.too.large'\n }))\n } else if (decoder) {\n buffer += decoder.write(chunk)\n } else {\n buffer.push(chunk)\n }\n }\n\n function onEnd (err) {\n if (complete) return\n if (err) return done(err)\n\n if (length !== null && received !== length) {\n done(createError(400, 'request size did not match content length', {\n expected: length,\n length: length,\n received: received,\n type: 'request.size.invalid'\n }))\n } else {\n var string = decoder\n ? buffer + (decoder.end() || '')\n : Buffer.concat(buffer)\n done(null, string)\n }\n }\n\n function cleanup () {\n buffer = null\n\n stream.removeListener('aborted', onAborted)\n stream.removeListener('data', onData)\n stream.removeListener('end', onEnd)\n stream.removeListener('error', onEnd)\n stream.removeListener('close', cleanup)\n }\n}\n\n/**\n * Try to require async_hooks\n * @private\n */\n\nfunction tryRequireAsyncHooks () {\n try {\n return require('async_hooks')\n } catch (e) {\n return {}\n }\n}\n\n/**\n * Wrap function with async resource, if possible.\n * AsyncResource.bind static method backported.\n * @private\n */\n\nfunction wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) });\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next mehtod, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","/*!\n * send\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = require('http-errors')\nvar debug = require('debug')('send')\nvar deprecate = require('depd')('send')\nvar destroy = require('destroy')\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar etag = require('etag')\nvar fresh = require('fresh')\nvar fs = require('fs')\nvar mime = require('mime')\nvar ms = require('ms')\nvar onFinished = require('on-finished')\nvar parseRange = require('range-parser')\nvar path = require('path')\nvar statuses = require('statuses')\nvar Stream = require('stream')\nvar util = require('util')\n\n/**\n * Path function references.\n * @private\n */\n\nvar extname = path.extname\nvar join = path.join\nvar normalize = path.normalize\nvar resolve = path.resolve\nvar sep = path.sep\n\n/**\n * Regular expression for identifying a bytes Range header.\n * @private\n */\n\nvar BYTES_RANGE_REGEXP = /^ *bytes=/\n\n/**\n * Maximum value allowed for the max age.\n * @private\n */\n\nvar MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year\n\n/**\n * Regular expression to match a path with a directory up component.\n * @private\n */\n\nvar UP_PATH_REGEXP = /(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$)/\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = send\nmodule.exports.mime = mime\n\n/**\n * Return a `SendStream` for `req` and `path`.\n *\n * @param {object} req\n * @param {string} path\n * @param {object} [options]\n * @return {SendStream}\n * @public\n */\n\nfunction send (req, path, options) {\n return new SendStream(req, path, options)\n}\n\n/**\n * Initialize a `SendStream` with the given `path`.\n *\n * @param {Request} req\n * @param {String} path\n * @param {object} [options]\n * @private\n */\n\nfunction SendStream (req, path, options) {\n Stream.call(this)\n\n var opts = options || {}\n\n this.options = opts\n this.path = path\n this.req = req\n\n this._acceptRanges = opts.acceptRanges !== undefined\n ? Boolean(opts.acceptRanges)\n : true\n\n this._cacheControl = opts.cacheControl !== undefined\n ? Boolean(opts.cacheControl)\n : true\n\n this._etag = opts.etag !== undefined\n ? Boolean(opts.etag)\n : true\n\n this._dotfiles = opts.dotfiles !== undefined\n ? opts.dotfiles\n : 'ignore'\n\n if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') {\n throw new TypeError('dotfiles option must be \"allow\", \"deny\", or \"ignore\"')\n }\n\n this._hidden = Boolean(opts.hidden)\n\n if (opts.hidden !== undefined) {\n deprecate('hidden: use dotfiles: \\'' + (this._hidden ? 'allow' : 'ignore') + '\\' instead')\n }\n\n // legacy support\n if (opts.dotfiles === undefined) {\n this._dotfiles = undefined\n }\n\n this._extensions = opts.extensions !== undefined\n ? normalizeList(opts.extensions, 'extensions option')\n : []\n\n this._immutable = opts.immutable !== undefined\n ? Boolean(opts.immutable)\n : false\n\n this._index = opts.index !== undefined\n ? normalizeList(opts.index, 'index option')\n : ['index.html']\n\n this._lastModified = opts.lastModified !== undefined\n ? Boolean(opts.lastModified)\n : true\n\n this._maxage = opts.maxAge || opts.maxage\n this._maxage = typeof this._maxage === 'string'\n ? ms(this._maxage)\n : Number(this._maxage)\n this._maxage = !isNaN(this._maxage)\n ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)\n : 0\n\n this._root = opts.root\n ? resolve(opts.root)\n : null\n\n if (!this._root && opts.from) {\n this.from(opts.from)\n }\n}\n\n/**\n * Inherits from `Stream`.\n */\n\nutil.inherits(SendStream, Stream)\n\n/**\n * Enable or disable etag generation.\n *\n * @param {Boolean} val\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.etag = deprecate.function(function etag (val) {\n this._etag = Boolean(val)\n debug('etag %s', this._etag)\n return this\n}, 'send.etag: pass etag as option')\n\n/**\n * Enable or disable \"hidden\" (dot) files.\n *\n * @param {Boolean} path\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.hidden = deprecate.function(function hidden (val) {\n this._hidden = Boolean(val)\n this._dotfiles = undefined\n debug('hidden %s', this._hidden)\n return this\n}, 'send.hidden: use dotfiles option')\n\n/**\n * Set index `paths`, set to a falsy\n * value to disable index support.\n *\n * @param {String|Boolean|Array} paths\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.index = deprecate.function(function index (paths) {\n var index = !paths ? [] : normalizeList(paths, 'paths argument')\n debug('index %o', paths)\n this._index = index\n return this\n}, 'send.index: pass index as option')\n\n/**\n * Set root `path`.\n *\n * @param {String} path\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.root = function root (path) {\n this._root = resolve(String(path))\n debug('root %s', this._root)\n return this\n}\n\nSendStream.prototype.from = deprecate.function(SendStream.prototype.root,\n 'send.from: pass root as option')\n\nSendStream.prototype.root = deprecate.function(SendStream.prototype.root,\n 'send.root: pass root as option')\n\n/**\n * Set max-age to `maxAge`.\n *\n * @param {Number} maxAge\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {\n this._maxage = typeof maxAge === 'string'\n ? ms(maxAge)\n : Number(maxAge)\n this._maxage = !isNaN(this._maxage)\n ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)\n : 0\n debug('max-age %d', this._maxage)\n return this\n}, 'send.maxage: pass maxAge as option')\n\n/**\n * Emit error with `status`.\n *\n * @param {number} status\n * @param {Error} [err]\n * @private\n */\n\nSendStream.prototype.error = function error (status, err) {\n // emit if listeners instead of responding\n if (hasListeners(this, 'error')) {\n return this.emit('error', createHttpError(status, err))\n }\n\n var res = this.res\n var msg = statuses.message[status] || String(status)\n var doc = createHtmlDocument('Error', escapeHtml(msg))\n\n // clear existing headers\n clearHeaders(res)\n\n // add error headers\n if (err && err.headers) {\n setHeaders(res, err.headers)\n }\n\n // send basic response\n res.statusCode = status\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.end(doc)\n}\n\n/**\n * Check if the pathname ends with \"/\".\n *\n * @return {boolean}\n * @private\n */\n\nSendStream.prototype.hasTrailingSlash = function hasTrailingSlash () {\n return this.path[this.path.length - 1] === '/'\n}\n\n/**\n * Check if this is a conditional GET request.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isConditionalGET = function isConditionalGET () {\n return this.req.headers['if-match'] ||\n this.req.headers['if-unmodified-since'] ||\n this.req.headers['if-none-match'] ||\n this.req.headers['if-modified-since']\n}\n\n/**\n * Check if the request preconditions failed.\n *\n * @return {boolean}\n * @private\n */\n\nSendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {\n var req = this.req\n var res = this.res\n\n // if-match\n var match = req.headers['if-match']\n if (match) {\n var etag = res.getHeader('ETag')\n return !etag || (match !== '*' && parseTokenList(match).every(function (match) {\n return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag\n }))\n }\n\n // if-unmodified-since\n var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since'])\n if (!isNaN(unmodifiedSince)) {\n var lastModified = parseHttpDate(res.getHeader('Last-Modified'))\n return isNaN(lastModified) || lastModified > unmodifiedSince\n }\n\n return false\n}\n\n/**\n * Strip various content header fields for a change in entity.\n *\n * @private\n */\n\nSendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {\n var res = this.res\n\n res.removeHeader('Content-Encoding')\n res.removeHeader('Content-Language')\n res.removeHeader('Content-Length')\n res.removeHeader('Content-Range')\n res.removeHeader('Content-Type')\n}\n\n/**\n * Respond with 304 not modified.\n *\n * @api private\n */\n\nSendStream.prototype.notModified = function notModified () {\n var res = this.res\n debug('not modified')\n this.removeContentHeaderFields()\n res.statusCode = 304\n res.end()\n}\n\n/**\n * Raise error that headers already sent.\n *\n * @api private\n */\n\nSendStream.prototype.headersAlreadySent = function headersAlreadySent () {\n var err = new Error('Can\\'t set headers after they are sent.')\n debug('headers already sent')\n this.error(500, err)\n}\n\n/**\n * Check if the request is cacheable, aka\n * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isCachable = function isCachable () {\n var statusCode = this.res.statusCode\n return (statusCode >= 200 && statusCode < 300) ||\n statusCode === 304\n}\n\n/**\n * Handle stat() error.\n *\n * @param {Error} error\n * @private\n */\n\nSendStream.prototype.onStatError = function onStatError (error) {\n switch (error.code) {\n case 'ENAMETOOLONG':\n case 'ENOENT':\n case 'ENOTDIR':\n this.error(404, error)\n break\n default:\n this.error(500, error)\n break\n }\n}\n\n/**\n * Check if the cache is fresh.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isFresh = function isFresh () {\n return fresh(this.req.headers, {\n etag: this.res.getHeader('ETag'),\n 'last-modified': this.res.getHeader('Last-Modified')\n })\n}\n\n/**\n * Check if the range is fresh.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isRangeFresh = function isRangeFresh () {\n var ifRange = this.req.headers['if-range']\n\n if (!ifRange) {\n return true\n }\n\n // if-range as etag\n if (ifRange.indexOf('\"') !== -1) {\n var etag = this.res.getHeader('ETag')\n return Boolean(etag && ifRange.indexOf(etag) !== -1)\n }\n\n // if-range as modified date\n var lastModified = this.res.getHeader('Last-Modified')\n return parseHttpDate(lastModified) <= parseHttpDate(ifRange)\n}\n\n/**\n * Redirect to path.\n *\n * @param {string} path\n * @private\n */\n\nSendStream.prototype.redirect = function redirect (path) {\n var res = this.res\n\n if (hasListeners(this, 'directory')) {\n this.emit('directory', res, path)\n return\n }\n\n if (this.hasTrailingSlash()) {\n this.error(403)\n return\n }\n\n var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to ' +\n escapeHtml(loc) + '')\n\n // redirect\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n}\n\n/**\n * Pipe to `res.\n *\n * @param {Stream} res\n * @return {Stream} res\n * @api public\n */\n\nSendStream.prototype.pipe = function pipe (res) {\n // root path\n var root = this._root\n\n // references\n this.res = res\n\n // decode the path\n var path = decode(this.path)\n if (path === -1) {\n this.error(400)\n return res\n }\n\n // null byte(s)\n if (~path.indexOf('\\0')) {\n this.error(400)\n return res\n }\n\n var parts\n if (root !== null) {\n // normalize\n if (path) {\n path = normalize('.' + sep + path)\n }\n\n // malicious path\n if (UP_PATH_REGEXP.test(path)) {\n debug('malicious path \"%s\"', path)\n this.error(403)\n return res\n }\n\n // explode path parts\n parts = path.split(sep)\n\n // join / normalize from optional root dir\n path = normalize(join(root, path))\n } else {\n // \"..\" is malicious without \"root\"\n if (UP_PATH_REGEXP.test(path)) {\n debug('malicious path \"%s\"', path)\n this.error(403)\n return res\n }\n\n // explode path parts\n parts = normalize(path).split(sep)\n\n // resolve the path\n path = resolve(path)\n }\n\n // dotfile handling\n if (containsDotFile(parts)) {\n var access = this._dotfiles\n\n // legacy support\n if (access === undefined) {\n access = parts[parts.length - 1][0] === '.'\n ? (this._hidden ? 'allow' : 'ignore')\n : 'allow'\n }\n\n debug('%s dotfile \"%s\"', access, path)\n switch (access) {\n case 'allow':\n break\n case 'deny':\n this.error(403)\n return res\n case 'ignore':\n default:\n this.error(404)\n return res\n }\n }\n\n // index file support\n if (this._index.length && this.hasTrailingSlash()) {\n this.sendIndex(path)\n return res\n }\n\n this.sendFile(path)\n return res\n}\n\n/**\n * Transfer `path`.\n *\n * @param {String} path\n * @api public\n */\n\nSendStream.prototype.send = function send (path, stat) {\n var len = stat.size\n var options = this.options\n var opts = {}\n var res = this.res\n var req = this.req\n var ranges = req.headers.range\n var offset = options.start || 0\n\n if (headersSent(res)) {\n // impossible to send now\n this.headersAlreadySent()\n return\n }\n\n debug('pipe \"%s\"', path)\n\n // set header fields\n this.setHeader(path, stat)\n\n // set content-type\n this.type(path)\n\n // conditional GET support\n if (this.isConditionalGET()) {\n if (this.isPreconditionFailure()) {\n this.error(412)\n return\n }\n\n if (this.isCachable() && this.isFresh()) {\n this.notModified()\n return\n }\n }\n\n // adjust len to start/end options\n len = Math.max(0, len - offset)\n if (options.end !== undefined) {\n var bytes = options.end - offset + 1\n if (len > bytes) len = bytes\n }\n\n // Range support\n if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) {\n // parse\n ranges = parseRange(len, ranges, {\n combine: true\n })\n\n // If-Range support\n if (!this.isRangeFresh()) {\n debug('range stale')\n ranges = -2\n }\n\n // unsatisfiable\n if (ranges === -1) {\n debug('range unsatisfiable')\n\n // Content-Range\n res.setHeader('Content-Range', contentRange('bytes', len))\n\n // 416 Requested Range Not Satisfiable\n return this.error(416, {\n headers: { 'Content-Range': res.getHeader('Content-Range') }\n })\n }\n\n // valid (syntactically invalid/multiple ranges are treated as a regular response)\n if (ranges !== -2 && ranges.length === 1) {\n debug('range %j', ranges)\n\n // Content-Range\n res.statusCode = 206\n res.setHeader('Content-Range', contentRange('bytes', len, ranges[0]))\n\n // adjust for requested range\n offset += ranges[0].start\n len = ranges[0].end - ranges[0].start + 1\n }\n }\n\n // clone options\n for (var prop in options) {\n opts[prop] = options[prop]\n }\n\n // set read options\n opts.start = offset\n opts.end = Math.max(offset, offset + len - 1)\n\n // content-length\n res.setHeader('Content-Length', len)\n\n // HEAD support\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n\n this.stream(path, opts)\n}\n\n/**\n * Transfer file for `path`.\n *\n * @param {String} path\n * @api private\n */\nSendStream.prototype.sendFile = function sendFile (path) {\n var i = 0\n var self = this\n\n debug('stat \"%s\"', path)\n fs.stat(path, function onstat (err, stat) {\n if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) {\n // not found, check extensions\n return next(err)\n }\n if (err) return self.onStatError(err)\n if (stat.isDirectory()) return self.redirect(path)\n self.emit('file', path, stat)\n self.send(path, stat)\n })\n\n function next (err) {\n if (self._extensions.length <= i) {\n return err\n ? self.onStatError(err)\n : self.error(404)\n }\n\n var p = path + '.' + self._extensions[i++]\n\n debug('stat \"%s\"', p)\n fs.stat(p, function (err, stat) {\n if (err) return next(err)\n if (stat.isDirectory()) return next()\n self.emit('file', p, stat)\n self.send(p, stat)\n })\n }\n}\n\n/**\n * Transfer index for `path`.\n *\n * @param {String} path\n * @api private\n */\nSendStream.prototype.sendIndex = function sendIndex (path) {\n var i = -1\n var self = this\n\n function next (err) {\n if (++i >= self._index.length) {\n if (err) return self.onStatError(err)\n return self.error(404)\n }\n\n var p = join(path, self._index[i])\n\n debug('stat \"%s\"', p)\n fs.stat(p, function (err, stat) {\n if (err) return next(err)\n if (stat.isDirectory()) return next()\n self.emit('file', p, stat)\n self.send(p, stat)\n })\n }\n\n next()\n}\n\n/**\n * Stream `path` to the response.\n *\n * @param {String} path\n * @param {Object} options\n * @api private\n */\n\nSendStream.prototype.stream = function stream (path, options) {\n var self = this\n var res = this.res\n\n // pipe\n var stream = fs.createReadStream(path, options)\n this.emit('stream', stream)\n stream.pipe(res)\n\n // cleanup\n function cleanup () {\n destroy(stream, true)\n }\n\n // response finished, cleanup\n onFinished(res, cleanup)\n\n // error handling\n stream.on('error', function onerror (err) {\n // clean up stream early\n cleanup()\n\n // error\n self.onStatError(err)\n })\n\n // end\n stream.on('end', function onend () {\n self.emit('end')\n })\n}\n\n/**\n * Set content-type based on `path`\n * if it hasn't been explicitly set.\n *\n * @param {String} path\n * @api private\n */\n\nSendStream.prototype.type = function type (path) {\n var res = this.res\n\n if (res.getHeader('Content-Type')) return\n\n var type = mime.lookup(path)\n\n if (!type) {\n debug('no content-type')\n return\n }\n\n var charset = mime.charsets.lookup(type)\n\n debug('content-type %s', type)\n res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''))\n}\n\n/**\n * Set response header fields, most\n * fields may be pre-defined.\n *\n * @param {String} path\n * @param {Object} stat\n * @api private\n */\n\nSendStream.prototype.setHeader = function setHeader (path, stat) {\n var res = this.res\n\n this.emit('headers', res, path, stat)\n\n if (this._acceptRanges && !res.getHeader('Accept-Ranges')) {\n debug('accept ranges')\n res.setHeader('Accept-Ranges', 'bytes')\n }\n\n if (this._cacheControl && !res.getHeader('Cache-Control')) {\n var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000)\n\n if (this._immutable) {\n cacheControl += ', immutable'\n }\n\n debug('cache-control %s', cacheControl)\n res.setHeader('Cache-Control', cacheControl)\n }\n\n if (this._lastModified && !res.getHeader('Last-Modified')) {\n var modified = stat.mtime.toUTCString()\n debug('modified %s', modified)\n res.setHeader('Last-Modified', modified)\n }\n\n if (this._etag && !res.getHeader('ETag')) {\n var val = etag(stat)\n debug('etag %s', val)\n res.setHeader('ETag', val)\n }\n}\n\n/**\n * Clear all headers from a response.\n *\n * @param {object} res\n * @private\n */\n\nfunction clearHeaders (res) {\n var headers = getHeaderNames(res)\n\n for (var i = 0; i < headers.length; i++) {\n res.removeHeader(headers[i])\n }\n}\n\n/**\n * Collapse all leading slashes into a single slash\n *\n * @param {string} str\n * @private\n */\nfunction collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}\n\n/**\n * Determine if path parts contain a dotfile.\n *\n * @api private\n */\n\nfunction containsDotFile (parts) {\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i]\n if (part.length > 1 && part[0] === '.') {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Create a Content-Range header.\n *\n * @param {string} type\n * @param {number} size\n * @param {array} [range]\n */\n\nfunction contentRange (type, size, range) {\n return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size\n}\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} title\n * @param {string} body\n * @private\n */\n\nfunction createHtmlDocument (title, body) {\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n '' + title + '\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Create a HttpError object from simple arguments.\n *\n * @param {number} status\n * @param {Error|object} err\n * @private\n */\n\nfunction createHttpError (status, err) {\n if (!err) {\n return createError(status)\n }\n\n return err instanceof Error\n ? createError(status, err, { expose: false })\n : createError(status, err)\n}\n\n/**\n * decodeURIComponent.\n *\n * Allows V8 to only deoptimize this fn instead of all\n * of send().\n *\n * @param {String} path\n * @api private\n */\n\nfunction decode (path) {\n try {\n return decodeURIComponent(path)\n } catch (err) {\n return -1\n }\n}\n\n/**\n * Get the header names on a respnse.\n *\n * @param {object} res\n * @returns {array[string]}\n * @private\n */\n\nfunction getHeaderNames (res) {\n return typeof res.getHeaderNames !== 'function'\n ? Object.keys(res._headers || {})\n : res.getHeaderNames()\n}\n\n/**\n * Determine if emitter has listeners of a given type.\n *\n * The way to do this check is done three different ways in Node.js >= 0.8\n * so this consolidates them into a minimal set using instance methods.\n *\n * @param {EventEmitter} emitter\n * @param {string} type\n * @returns {boolean}\n * @private\n */\n\nfunction hasListeners (emitter, type) {\n var count = typeof emitter.listenerCount !== 'function'\n ? emitter.listeners(type).length\n : emitter.listenerCount(type)\n\n return count > 0\n}\n\n/**\n * Determine if the response headers have been sent.\n *\n * @param {object} res\n * @returns {boolean}\n * @private\n */\n\nfunction headersSent (res) {\n return typeof res.headersSent !== 'boolean'\n ? Boolean(res._header)\n : res.headersSent\n}\n\n/**\n * Normalize the index option into an array.\n *\n * @param {boolean|string|array} val\n * @param {string} name\n * @private\n */\n\nfunction normalizeList (val, name) {\n var list = [].concat(val || [])\n\n for (var i = 0; i < list.length; i++) {\n if (typeof list[i] !== 'string') {\n throw new TypeError(name + ' must be array of strings or false')\n }\n }\n\n return list\n}\n\n/**\n * Parse an HTTP Date into a number.\n *\n * @param {string} date\n * @private\n */\n\nfunction parseHttpDate (date) {\n var timestamp = date && Date.parse(date)\n\n return typeof timestamp === 'number'\n ? timestamp\n : NaN\n}\n\n/**\n * Parse a HTTP token list.\n *\n * @param {string} str\n * @private\n */\n\nfunction parseTokenList (str) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = str.length; i < len; i++) {\n switch (str.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n if (start !== end) {\n list.push(str.substring(start, end))\n }\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n if (start !== end) {\n list.push(str.substring(start, end))\n }\n\n return list\n}\n\n/**\n * Set an object of headers on a response.\n *\n * @param {object} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeaders (res, headers) {\n var keys = Object.keys(headers)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n res.setHeader(key, headers[key])\n }\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/*!\n * serve-static\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar parseUrl = require('parseurl')\nvar resolve = require('path').resolve\nvar send = require('send')\nvar url = require('url')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = serveStatic\nmodule.exports.mime = send.mime\n\n/**\n * @param {string} root\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction serveStatic (root, options) {\n if (!root) {\n throw new TypeError('root path required')\n }\n\n if (typeof root !== 'string') {\n throw new TypeError('root path must be a string')\n }\n\n // copy options object\n var opts = Object.create(options || null)\n\n // fall-though\n var fallthrough = opts.fallthrough !== false\n\n // default redirect\n var redirect = opts.redirect !== false\n\n // headers listener\n var setHeaders = opts.setHeaders\n\n if (setHeaders && typeof setHeaders !== 'function') {\n throw new TypeError('option setHeaders must be function')\n }\n\n // setup options for send\n opts.maxage = opts.maxage || opts.maxAge || 0\n opts.root = resolve(root)\n\n // construct directory listener\n var onDirectory = redirect\n ? createRedirectDirectoryListener()\n : createNotFoundDirectoryListener()\n\n return function serveStatic (req, res, next) {\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n if (fallthrough) {\n return next()\n }\n\n // method not allowed\n res.statusCode = 405\n res.setHeader('Allow', 'GET, HEAD')\n res.setHeader('Content-Length', '0')\n res.end()\n return\n }\n\n var forwardError = !fallthrough\n var originalUrl = parseUrl.original(req)\n var path = parseUrl(req).pathname\n\n // make sure redirect occurs at mount\n if (path === '/' && originalUrl.pathname.substr(-1) !== '/') {\n path = ''\n }\n\n // create send stream\n var stream = send(req, path, opts)\n\n // add directory handler\n stream.on('directory', onDirectory)\n\n // add headers listener\n if (setHeaders) {\n stream.on('headers', setHeaders)\n }\n\n // add file listener for fallthrough\n if (fallthrough) {\n stream.on('file', function onFile () {\n // once file is determined, always forward error\n forwardError = true\n })\n }\n\n // forward errors\n stream.on('error', function error (err) {\n if (forwardError || !(err.statusCode < 500)) {\n next(err)\n return\n }\n\n next()\n })\n\n // pipe\n stream.pipe(res)\n }\n}\n\n/**\n * Collapse all leading slashes into a single slash\n * @private\n */\nfunction collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} title\n * @param {string} body\n * @private\n */\n\nfunction createHtmlDocument (title, body) {\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n '' + title + '\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Create a directory listener that just 404s.\n * @private\n */\n\nfunction createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}\n\n/**\n * Create a directory listener that performs a redirect.\n * @private\n */\n\nfunction createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to ' +\n escapeHtml(loc) + '')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}\n","'use strict'\n/* eslint no-proto: 0 */\nmodule.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)\n\nfunction setProtoOf (obj, proto) {\n obj.__proto__ = proto\n return obj\n}\n\nfunction mixinProperties (obj, proto) {\n for (var prop in proto) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) {\n obj[prop] = proto[prop]\n }\n }\n return obj\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","module.exports = {\n\tcore: {\n\t\tBatch: require(\"./src/Batch\"),\n\t\tClientBuilder: require(\"./src/ClientBuilder\"),\n\t\tbuildClient: require(\"./src/util/buildClients\"),\n\t\tSharedCredentials: require(\"./src/SharedCredentials\"),\n\t\tStaticCredentials: require(\"./src/StaticCredentials\"),\n\t\tErrors: require(\"./src/Errors\"),\n\t},\n\tusStreet: {\n\t\tLookup: require(\"./src/us_street/Lookup\"),\n\t\tCandidate: require(\"./src/us_street/Candidate\"),\n\t},\n\tusZipcode: {\n\t\tLookup: require(\"./src/us_zipcode/Lookup\"),\n\t\tResult: require(\"./src/us_zipcode/Result\"),\n\t},\n\tusAutocomplete: {\n\t\tLookup: require(\"./src/us_autocomplete/Lookup\"),\n\t\tSuggestion: require(\"./src/us_autocomplete/Suggestion\"),\n\t},\n\tusAutocompletePro: {\n\t\tLookup: require(\"./src/us_autocomplete_pro/Lookup\"),\n\t\tSuggestion: require(\"./src/us_autocomplete_pro/Suggestion\"),\n\t},\n\tusExtract: {\n\t\tLookup: require(\"./src/us_extract/Lookup\"),\n\t\tResult: require(\"./src/us_extract/Result\"),\n\t},\n\tinternationalStreet: {\n\t\tLookup: require(\"./src/international_street/Lookup\"),\n\t\tCandidate: require(\"./src/international_street/Candidate\"),\n\t},\n\tusReverseGeo: {\n\t\tLookup: require(\"./src/us_reverse_geo/Lookup\"),\n\t},\n\tinternationalAddressAutocomplete: {\n\t\tLookup: require(\"./src/international_address_autocomplete/Lookup\"),\n\t\tSuggestion: require(\"./src/international_address_autocomplete/Suggestion\"),\n\t},\n};\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar VERSION = require('./../env/data').version;\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n var resolve = function resolve(value) {\n done();\n resolvePromise(value);\n };\n var rejected = false;\n var reject = function reject(value) {\n done();\n rejected = true;\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n var headerNames = {};\n\n Object.keys(headers).forEach(function storeLowerName(name) {\n headerNames[name.toLowerCase()] = name;\n });\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('user-agent' in headerNames) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers[headerNames['user-agent']]) {\n delete headers[headerNames['user-agent']];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + VERSION;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(createError('Request body larger than maxBodyLength limit', config));\n }\n\n // Add Content-Length header if data exists\n if (!headerNames['content-length']) {\n headers['Content-Length'] = data.length;\n }\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth && headerNames.authorization) {\n delete headers[headerNames.authorization];\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n try {\n buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, '');\n } catch (err) {\n var customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n reject(customErr);\n }\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destoy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n stream.destroy();\n reject(createError('error request aborted', config, 'ERR_REQUEST_ABORTED', lastRequest));\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n try {\n var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n reject(enhanceError(err, config, err.code, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n var timeoutErrorMessage = '';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n } else {\n timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n }\n var transitional = config.transitional || transitionalDefaults;\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.26.1\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","class AgentSender {\n\tconstructor(innerSender) {\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\trequest.parameters.agent = \"smarty (sdk:javascript@\" + require(\"../package.json\").version + \")\";\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = AgentSender;","class BaseUrlSender {\n\tconstructor(innerSender, urlOverride) {\n\t\tthis.urlOverride = urlOverride;\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\trequest.baseUrl = this.urlOverride;\n\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = BaseUrlSender;","const BatchFullError = require(\"./Errors\").BatchFullError;\n\n/**\n * This class contains a collection of up to 100 lookups to be sent to one of the Smarty APIs
\n * all at once. This is more efficient than sending them one at a time.\n */\nclass Batch {\n\tconstructor () {\n\t\tthis.lookups = [];\n\t}\n\n\tadd (lookup) {\n\t\tif (this.lookupsHasRoomForLookup()) this.lookups.push(lookup);\n\t\telse throw new BatchFullError();\n\t}\n\n\tlookupsHasRoomForLookup() {\n\t\tconst maxNumberOfLookups = 100;\n\t\treturn this.lookups.length < maxNumberOfLookups;\n\t}\n\n\tlength() {\n\t\treturn this.lookups.length;\n\t}\n\n\tgetByIndex(index) {\n\t\treturn this.lookups[index];\n\t}\n\n\tgetByInputId(inputId) {\n\t\treturn this.lookups.filter(lookup => {\n\t\t\treturn lookup.inputId === inputId;\n\t\t})[0];\n\t}\n\n\t/**\n\t * Clears the lookups stored in the batch so it can be used again.
\n\t * This helps avoid the overhead of building a new Batch object for each group of lookups.\n\t */\n\tclear () {\n\t\tthis.lookups = [];\n\t}\n\n\tisEmpty () {\n\t\treturn this.length() === 0;\n\t}\n}\n\nmodule.exports = Batch;","const HttpSender = require(\"./HttpSender\");\nconst SigningSender = require(\"./SigningSender\");\nconst BaseUrlSender = require(\"./BaseUrlSender\");\nconst AgentSender = require(\"./AgentSender\");\nconst StaticCredentials = require(\"./StaticCredentials\");\nconst SharedCredentials = require(\"./SharedCredentials\");\nconst CustomHeaderSender = require(\"./CustomHeaderSender\");\nconst StatusCodeSender = require(\"./StatusCodeSender\");\nconst LicenseSender = require(\"./LicenseSender\");\nconst BadCredentialsError = require(\"./Errors\").BadCredentialsError;\n\n//TODO: refactor this to work more cleanly with a bundler.\nconst UsStreetClient = require(\"./us_street/Client\");\nconst UsZipcodeClient = require(\"./us_zipcode/Client\");\nconst UsAutocompleteClient = require(\"./us_autocomplete/Client\");\nconst UsAutocompleteProClient = require(\"./us_autocomplete_pro/Client\");\nconst UsExtractClient = require(\"./us_extract/Client\");\nconst InternationalStreetClient = require(\"./international_street/Client\");\nconst UsReverseGeoClient = require(\"./us_reverse_geo/Client\");\nconst InternationalAddressAutocompleteClient = require(\"./international_address_autocomplete/Client\");\n\nconst INTERNATIONAL_STREET_API_URI = \"https://international-street.api.smartystreets.com/verify\";\nconst US_AUTOCOMPLETE_API_URL = \"https://us-autocomplete.api.smartystreets.com/suggest\";\nconst US_AUTOCOMPLETE_PRO_API_URL = \"https://us-autocomplete-pro.api.smartystreets.com/lookup\";\nconst US_EXTRACT_API_URL = \"https://us-extract.api.smartystreets.com/\";\nconst US_STREET_API_URL = \"https://us-street.api.smartystreets.com/street-address\";\nconst US_ZIP_CODE_API_URL = \"https://us-zipcode.api.smartystreets.com/lookup\";\nconst US_REVERSE_GEO_API_URL = \"https://us-reverse-geo.api.smartystreets.com/lookup\";\nconst INTERNATIONAL_ADDRESS_AUTOCOMPLETE_API_URL = \"https://international-autocomplete.api.smartystreets.com/lookup\";\n\n/**\n * The ClientBuilder class helps you build a client object for one of the supported Smarty APIs.
\n * You can use ClientBuilder's methods to customize settings like maximum retries or timeout duration. These methods
\n * are chainable, so you can usually get set up with one line of code.\n */\nclass ClientBuilder {\n\tconstructor(signer) {\n\t\tif (noCredentialsProvided()) throw new BadCredentialsError();\n\n\t\tthis.signer = signer;\n\t\tthis.httpSender = undefined;\n\t\tthis.maxRetries = 5;\n\t\tthis.maxTimeout = 10000;\n\t\tthis.baseUrl = undefined;\n\t\tthis.proxy = undefined;\n\t\tthis.customHeaders = {};\n\t\tthis.debug = undefined;\n\t\tthis.licenses = [];\n\n\t\tfunction noCredentialsProvided() {\n\t\t\treturn !signer instanceof StaticCredentials || !signer instanceof SharedCredentials;\n\t\t}\n\t}\n\n\t/**\n\t * @param retries The maximum number of times to retry sending the request to the API. (Default is 5)\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithMaxRetries(retries) {\n\t\tthis.maxRetries = retries;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @param timeout The maximum time (in milliseconds) to wait for a connection, and also to wait for
\n\t * the response to be read. (Default is 10000)\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithMaxTimeout(timeout) {\n\t\tthis.maxTimeout = timeout;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @param sender Default is a series of nested senders. See buildSender().\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithSender(sender) {\n\t\tthis.httpSender = sender;\n\t\treturn this;\n\t}\n\n\t/**\n\t * This may be useful when using a local installation of the Smarty APIs.\n\t * @param url Defaults to the URL for the API corresponding to the Client object being built.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithBaseUrl(url) {\n\t\tthis.baseUrl = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Use this to specify a proxy through which to send all lookups.\n\t * @param host The host of the proxy server (do not include the port).\n\t * @param port The port on the proxy server to which you wish to connect.\n\t * @param protocol The protocol on the proxy server to which you wish to connect. If the proxy server uses HTTPS, then you must set the protocol to 'https'.\n\t * @param username The username to login to the proxy.\n\t * @param password The password to login to the proxy.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithProxy(host, port, protocol, username, password) {\n\t\tthis.proxy = {\n\t\t\thost: host,\n\t\t\tport: port,\n\t\t\tprotocol: protocol,\n\t\t};\n\n\t\tif (username && password) {\n\t\t\tthis.proxy.auth = {\n\t\t\t\tusername: username,\n\t\t\t\tpassword: password,\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Use this to add any additional headers you need.\n\t * @param customHeaders A String to Object Map of header name/value pairs.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithCustomHeaders(customHeaders) {\n\t\tthis.customHeaders = customHeaders;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Enables debug mode, which will print information about the HTTP request and response to console.log\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithDebug() {\n\t\tthis.debug = true;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Allows the caller to specify the subscription license (aka \"track\") they wish to use.\n\t * @param licenses A String Array of licenses.\n\t * @returns Returns this to accommodate method chaining.\n\t */\n\twithLicenses(licenses) {\n\t\tthis.licenses = licenses;\n\n\t\treturn this;\n\t}\n\n\tbuildSender() {\n\t\tif (this.httpSender) return this.httpSender;\n\n\t\tconst httpSender = new HttpSender(this.maxTimeout, this.maxRetries, this.proxy, this.debug);\n\t\tconst statusCodeSender = new StatusCodeSender(httpSender);\n\t\tconst signingSender = new SigningSender(statusCodeSender, this.signer);\n\t\tconst agentSender = new AgentSender(signingSender);\n\t\tconst customHeaderSender = new CustomHeaderSender(agentSender, this.customHeaders);\n\t\tconst baseUrlSender = new BaseUrlSender(customHeaderSender, this.baseUrl);\n\t\tconst licenseSender = new LicenseSender(baseUrlSender, this.licenses);\n\n\t\treturn licenseSender;\n\t}\n\n\tbuildClient(baseUrl, Client) {\n\t\tif (!this.baseUrl) {\n\t\t\tthis.baseUrl = baseUrl;\n\t\t}\n\n\t\treturn new Client(this.buildSender());\n\t}\n\n\tbuildUsStreetApiClient() {\n\t\treturn this.buildClient(US_STREET_API_URL, UsStreetClient);\n\t}\n\n\tbuildUsZipcodeClient() {\n\t\treturn this.buildClient(US_ZIP_CODE_API_URL, UsZipcodeClient);\n\t}\n\n\tbuildUsAutocompleteClient() { // Deprecated\n\t\treturn this.buildClient(US_AUTOCOMPLETE_API_URL, UsAutocompleteClient);\n\t}\n\n\tbuildUsAutocompleteProClient() {\n\t\treturn this.buildClient(US_AUTOCOMPLETE_PRO_API_URL, UsAutocompleteProClient);\n\t}\n\n\tbuildUsExtractClient() {\n\t\treturn this.buildClient(US_EXTRACT_API_URL, UsExtractClient);\n\t}\n\n\tbuildInternationalStreetClient() {\n\t\treturn this.buildClient(INTERNATIONAL_STREET_API_URI, InternationalStreetClient);\n\t}\n\n\tbuildUsReverseGeoClient() {\n\t\treturn this.buildClient(US_REVERSE_GEO_API_URL, UsReverseGeoClient);\n\t}\n\n\tbuildInternationalAddressAutocompleteClient() {\n\t\treturn this.buildClient(INTERNATIONAL_ADDRESS_AUTOCOMPLETE_API_URL, InternationalAddressAutocompleteClient);\n\t}\n}\n\nmodule.exports = ClientBuilder;","class CustomHeaderSender {\n\tconstructor(innerSender, customHeaders) {\n\t\tthis.sender = innerSender;\n\t\tthis.customHeaders = customHeaders;\n\t}\n\n\tsend(request) {\n\t\tfor (let key in this.customHeaders) {\n\t\t\trequest.headers[key] = this.customHeaders[key];\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = CustomHeaderSender;","class SmartyError extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t}\n}\n\nclass BatchFullError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"A batch can contain a max of 100 lookups.\");\n\t}\n}\n\nclass BatchEmptyError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"A batch must contain at least 1 lookup.\");\n\t}\n}\n\nclass UndefinedLookupError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"The lookup provided is missing or undefined. Make sure you're passing a Lookup object.\");\n\t}\n}\n\nclass BadCredentialsError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Unauthorized: The credentials were provided incorrectly or did not match any existing active credentials.\");\n\t}\n}\n\nclass PaymentRequiredError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Payment Required: There is no active subscription for the account associated with the credentials submitted with the request.\");\n\t}\n}\n\nclass RequestEntityTooLargeError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Request Entity Too Large: The request body has exceeded the maximum size.\");\n\t}\n}\n\nclass BadRequestError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Bad Request (Malformed Payload): A GET request lacked a street field or the request body of a POST request contained malformed JSON.\");\n\t}\n}\n\nclass UnprocessableEntityError extends SmartyError {\n\tconstructor(message) {\n\t\tsuper(message);\n\t}\n}\n\nclass TooManyRequestsError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"When using the public 'embedded key' authentication, we restrict the number of requests coming from a given source over too short of a time.\");\n\t}\n}\n\nclass InternalServerError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Internal Server Error.\");\n\t}\n}\n\nclass ServiceUnavailableError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Service Unavailable. Try again later.\");\n\t}\n}\n\nclass GatewayTimeoutError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"The upstream data provider did not respond in a timely fashion and the request failed. A serious, yet rare occurrence indeed.\");\n\t}\n}\n\nmodule.exports = {\n\tBatchFullError: BatchFullError,\n\tBatchEmptyError: BatchEmptyError,\n\tUndefinedLookupError: UndefinedLookupError,\n\tBadCredentialsError: BadCredentialsError,\n\tPaymentRequiredError: PaymentRequiredError,\n\tRequestEntityTooLargeError: RequestEntityTooLargeError,\n\tBadRequestError: BadRequestError,\n\tUnprocessableEntityError: UnprocessableEntityError,\n\tTooManyRequestsError: TooManyRequestsError,\n\tInternalServerError: InternalServerError,\n\tServiceUnavailableError: ServiceUnavailableError,\n\tGatewayTimeoutError: GatewayTimeoutError\n};","const Response = require(\"./Response\");\nconst Axios = require(\"axios\");\nconst axiosRetry = require(\"axios-retry\");\n\nclass HttpSender {\n\tconstructor(timeout = 10000, retries = 5, proxyConfig, debug = false) {\n\t\taxiosRetry(Axios, {\n\t\t\tretries: retries,\n\t\t});\n\t\tthis.timeout = timeout;\n\t\tthis.proxyConfig = proxyConfig;\n\t\tif (debug) this.enableDebug();\n\t}\n\n\tbuildRequestConfig({payload, parameters, headers, baseUrl}) {\n\t\tlet config = {\n\t\t\tmethod: \"GET\",\n\t\t\ttimeout: this.timeout,\n\t\t\tparams: parameters,\n\t\t\theaders: headers,\n\t\t\tbaseURL: baseUrl,\n\t\t\tvalidateStatus: function (status) {\n\t\t\t\treturn status < 500;\n\t\t\t},\n\t\t};\n\n\t\tif (payload) {\n\t\t\tconfig.method = \"POST\";\n\t\t\tconfig.data = payload;\n\t\t}\n\n\t\tif (this.proxyConfig) config.proxy = this.proxyConfig;\n\t\treturn config;\n\t}\n\n\tbuildSmartyResponse(response, error) {\n\t\tif (response) return new Response(response.status, response.data);\n\t\treturn new Response(undefined, undefined, error)\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet requestConfig = this.buildRequestConfig(request);\n\n\t\t\tAxios(requestConfig)\n\t\t\t\t.then(response => {\n\t\t\t\t\tlet smartyResponse = this.buildSmartyResponse(response);\n\n\t\t\t\t\tif (smartyResponse.statusCode >= 400) reject(smartyResponse);\n\n\t\t\t\t\tresolve(smartyResponse);\n\t\t\t\t})\n\t\t\t\t.catch(error => reject(this.buildSmartyResponse(undefined, error)));\n\t\t});\n\t}\n\n\tenableDebug() {\n\t\tAxios.interceptors.request.use(request => {\n\t\t\tconsole.log('Request:\\r\\n', request);\n\t\t\tconsole.log('\\r\\n*******************************************\\r\\n');\n\t\t\treturn request\n\t\t});\n\n\t\tAxios.interceptors.response.use(response => {\n\t\t\tconsole.log('Response:\\r\\n');\n\t\t\tconsole.log('Status:', response.status, response.statusText);\n\t\t\tconsole.log('Headers:', response.headers);\n\t\t\tconsole.log('Data:', response.data);\n\t\t\treturn response\n\t\t})\n\t}\n}\n\nmodule.exports = HttpSender;","class InputData {\n\tconstructor(lookup) {\n\t\tthis.lookup = lookup;\n\t\tthis.data = {};\n\t}\n\n\tadd(apiField, lookupField) {\n\t\tif (this.lookupFieldIsPopulated(lookupField)) this.data[apiField] = this.lookup[lookupField];\n\t}\n\n\tlookupFieldIsPopulated(lookupField) {\n\t\treturn this.lookup[lookupField] !== \"\" && this.lookup[lookupField] !== undefined;\n\t}\n}\n\nmodule.exports = InputData;","class LicenseSender {\n\tconstructor(innerSender, licenses) {\n\t\tthis.sender = innerSender;\n\t\tthis.licenses = licenses;\n\t}\n\n\tsend(request) {\n\t\tif (this.licenses.length !== 0) {\n\t\t\trequest.parameters[\"license\"] = this.licenses.join(\",\");\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = LicenseSender;","class Request {\n\tconstructor(payload) {\n\t\tthis.baseUrl = \"\";\n\t\tthis.payload = payload;\n\t\tthis.headers = {\n\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t\t};\n\n\t\tthis.parameters = {};\n\t}\n}\n\nmodule.exports = Request;","class Response {\n\tconstructor (statusCode, payload, error = undefined) {\n\t\tthis.statusCode = statusCode;\n\t\tthis.payload = payload;\n\t\tthis.error = error;\n\t}\n}\n\nmodule.exports = Response;","class SharedCredentials {\n\tconstructor(authId, hostName) {\n\t\tthis.authId = authId;\n\t\tthis.hostName = hostName;\n\t}\n\n\tsign(request) {\n\t\trequest.parameters[\"key\"] = this.authId;\n\t\tif (this.hostName) request.headers[\"Referer\"] = \"https://\" + this.hostName;\n\t}\n}\n\nmodule.exports = SharedCredentials;","const UnprocessableEntityError = require(\"./Errors\").UnprocessableEntityError;\nconst SharedCredentials = require(\"./SharedCredentials\");\n\nclass SigningSender {\n\tconstructor(innerSender, signer) {\n\t\tthis.signer = signer;\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\tconst sendingPostWithSharedCredentials = request.payload && this.signer instanceof SharedCredentials;\n\t\tif (sendingPostWithSharedCredentials) {\n\t\t\tconst message = \"Shared credentials cannot be used in batches with a length greater than 1 or when using the US Extract API.\";\n\t\t\tthrow new UnprocessableEntityError(message);\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.signer.sign(request);\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = SigningSender;","class StaticCredentials {\n\tconstructor (authId, authToken) {\n\t\tthis.authId = authId;\n\t\tthis.authToken = authToken;\n\t}\n\n\tsign (request) {\n\t\trequest.parameters[\"auth-id\"] = this.authId;\n\t\trequest.parameters[\"auth-token\"] = this.authToken;\n\t}\n}\n\nmodule.exports = StaticCredentials;","const Errors = require(\"./Errors\");\n\nclass StatusCodeSender {\n\tconstructor(innerSender) {\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(error => {\n\t\t\t\t\tswitch (error.statusCode) {\n\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\terror.error = new Errors.BadRequestError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\terror.error = new Errors.BadCredentialsError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 402:\n\t\t\t\t\t\t\terror.error = new Errors.PaymentRequiredError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 413:\n\t\t\t\t\t\t\terror.error = new Errors.RequestEntityTooLargeError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 422:\n\t\t\t\t\t\t\terror.error = new Errors.UnprocessableEntityError(\"GET request lacked required fields.\");\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 429:\n\t\t\t\t\t\t\terror.error = new Errors.TooManyRequestsError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 500:\n\t\t\t\t\t\t\terror.error = new Errors.InternalServerError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 503:\n\t\t\t\t\t\t\terror.error = new Errors.ServiceUnavailableError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 504:\n\t\t\t\t\t\t\terror.error = new Errors.GatewayTimeoutError();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t}\n}\n\nmodule.exports = StatusCodeSender;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = {\n\t\t\tsearch: lookup.search,\n\t\t\tcountry: lookup.country,\n\t\t\tmax_results: lookup.max_results,\n\t\t\tinclude_only_administrative_area: lookup.include_only_administrative_area,\n\t\t\tinclude_only_locality: lookup.include_only_locality,\n\t\t\tinclude_only_postal_code: lookup.include_only_postal_code,\n\t\t};\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload && payload.candidates === null) return [];\n\n\t\t\treturn payload.candidates.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","class Lookup {\n\tconstructor(search = \"\", country = \"United States\", max_results = undefined, include_only_administrative_area = \"\", include_only_locality = \"\", include_only_postal_code = \"\") {\n\t\tthis.result = [];\n\n\t\tthis.search = search;\n\t\tthis.country = country;\n\t\tthis.max_results = max_results;\n\t\tthis.include_only_administrative_area = include_only_administrative_area;\n\t\tthis.include_only_locality = include_only_locality;\n\t\tthis.include_only_postal_code = include_only_postal_code;\n\t}\n}\n\nmodule.exports = Lookup;","class Suggestion {\n\tconstructor(responseData) {\n\t\tthis.street = responseData.street;\n\t\tthis.locality = responseData.locality;\n\t\tthis.administrativeArea = responseData.administrative_area;\n\t\tthis.postalCode = responseData.postal_code;\n\t\tthis.countryIso3 = responseData.country_iso3;\n\t}\n}\n\nmodule.exports = Suggestion;","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous.\n *\n * @see \"https://www.smarty.com/docs/cloud/international-street-api#root\"\n */\nclass Candidate {\n\tconstructor(responseData) {\n\t\tthis.organization = responseData.organization;\n\t\tthis.address1 = responseData.address1;\n\t\tthis.address2 = responseData.address2;\n\t\tthis.address3 = responseData.address3;\n\t\tthis.address4 = responseData.address4;\n\t\tthis.address5 = responseData.address5;\n\t\tthis.address6 = responseData.address6;\n\t\tthis.address7 = responseData.address7;\n\t\tthis.address8 = responseData.address8;\n\t\tthis.address9 = responseData.address9;\n\t\tthis.address10 = responseData.address10;\n\t\tthis.address11 = responseData.address11;\n\t\tthis.address12 = responseData.address12;\n\n\t\tthis.components = {};\n\t\tif (responseData.components !== undefined) {\n\t\t\tthis.components.countryIso3 = responseData.components.country_iso_3;\n\t\t\tthis.components.superAdministrativeArea = responseData.components.super_administrative_area;\n\t\t\tthis.components.administrativeArea = responseData.components.administrative_area;\n\t\t\tthis.components.subAdministrativeArea = responseData.components.sub_administrative_area;\n\t\t\tthis.components.dependentLocality = responseData.components.dependent_locality;\n\t\t\tthis.components.dependentLocalityName = responseData.components.dependent_locality_name;\n\t\t\tthis.components.doubleDependentLocality = responseData.components.double_dependent_locality;\n\t\t\tthis.components.locality = responseData.components.locality;\n\t\t\tthis.components.postalCode = responseData.components.postal_code;\n\t\t\tthis.components.postalCodeShort = responseData.components.postal_code_short;\n\t\t\tthis.components.postalCodeExtra = responseData.components.postal_code_extra;\n\t\t\tthis.components.premise = responseData.components.premise;\n\t\t\tthis.components.premiseExtra = responseData.components.premise_extra;\n\t\t\tthis.components.premisePrefixNumber = responseData.components.premise_prefix_number;\n\t\t\tthis.components.premiseNumber = responseData.components.premise_number;\n\t\t\tthis.components.premiseType = responseData.components.premise_type;\n\t\t\tthis.components.thoroughfare = responseData.components.thoroughfare;\n\t\t\tthis.components.thoroughfarePredirection = responseData.components.thoroughfare_predirection;\n\t\t\tthis.components.thoroughfarePostdirection = responseData.components.thoroughfare_postdirection;\n\t\t\tthis.components.thoroughfareName = responseData.components.thoroughfare_name;\n\t\t\tthis.components.thoroughfareTrailingType = responseData.components.thoroughfare_trailing_type;\n\t\t\tthis.components.thoroughfareType = responseData.components.thoroughfare_type;\n\t\t\tthis.components.dependentThoroughfare = responseData.components.dependent_thoroughfare;\n\t\t\tthis.components.dependentThoroughfarePredirection = responseData.components.dependent_thoroughfare_predirection;\n\t\t\tthis.components.dependentThoroughfarePostdirection = responseData.components.dependent_thoroughfare_postdirection;\n\t\t\tthis.components.dependentThoroughfareName = responseData.components.dependent_thoroughfare_name;\n\t\t\tthis.components.dependentThoroughfareTrailingType = responseData.components.dependent_thoroughfare_trailing_type;\n\t\t\tthis.components.dependentThoroughfareType = responseData.components.dependent_thoroughfare_type;\n\t\t\tthis.components.building = responseData.components.building;\n\t\t\tthis.components.buildingLeadingType = responseData.components.building_leading_type;\n\t\t\tthis.components.buildingName = responseData.components.building_name;\n\t\t\tthis.components.buildingTrailingType = responseData.components.building_trailing_type;\n\t\t\tthis.components.subBuildingType = responseData.components.sub_building_type;\n\t\t\tthis.components.subBuildingNumber = responseData.components.sub_building_number;\n\t\t\tthis.components.subBuildingName = responseData.components.sub_building_name;\n\t\t\tthis.components.subBuilding = responseData.components.sub_building;\n\t\t\tthis.components.postBox = responseData.components.post_box;\n\t\t\tthis.components.postBoxType = responseData.components.post_box_type;\n\t\t\tthis.components.postBoxNumber = responseData.components.post_box_number;\n\t\t}\n\n\t\tthis.analysis = {};\n\t\tif (responseData.analysis !== undefined) {\n\t\t\tthis.analysis.verificationStatus = responseData.analysis.verification_status;\n\t\t\tthis.analysis.addressPrecision = responseData.analysis.address_precision;\n\t\t\tthis.analysis.maxAddressPrecision = responseData.analysis.max_address_precision;\n\n\t\t\tthis.analysis.changes = {};\n\t\t\tif (responseData.analysis.changes !== undefined) {\n\t\t\t\tthis.analysis.changes.organization = responseData.analysis.changes.organization;\n\t\t\t\tthis.analysis.changes.address1 = responseData.analysis.changes.address1;\n\t\t\t\tthis.analysis.changes.address2 = responseData.analysis.changes.address2;\n\t\t\t\tthis.analysis.changes.address3 = responseData.analysis.changes.address3;\n\t\t\t\tthis.analysis.changes.address4 = responseData.analysis.changes.address4;\n\t\t\t\tthis.analysis.changes.address5 = responseData.analysis.changes.address5;\n\t\t\t\tthis.analysis.changes.address6 = responseData.analysis.changes.address6;\n\t\t\t\tthis.analysis.changes.address7 = responseData.analysis.changes.address7;\n\t\t\t\tthis.analysis.changes.address8 = responseData.analysis.changes.address8;\n\t\t\t\tthis.analysis.changes.address9 = responseData.analysis.changes.address9;\n\t\t\t\tthis.analysis.changes.address10 = responseData.analysis.changes.address10;\n\t\t\t\tthis.analysis.changes.address11 = responseData.analysis.changes.address11;\n\t\t\t\tthis.analysis.changes.address12 = responseData.analysis.changes.address12;\n\n\t\t\t\tthis.analysis.changes.components = {};\n\t\t\t\tif (responseData.analysis.changes.components !== undefined) {\n\t\t\t\t\tthis.analysis.changes.components.countryIso3 = responseData.analysis.changes.components.country_iso_3;\n\t\t\t\t\tthis.analysis.changes.components.superAdministrativeArea = responseData.analysis.changes.components.super_administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.administrativeArea = responseData.analysis.changes.components.administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.subAdministrativeArea = responseData.analysis.changes.components.sub_administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.dependentLocality = responseData.analysis.changes.components.dependent_locality;\n\t\t\t\t\tthis.analysis.changes.components.dependentLocalityName = responseData.analysis.changes.components.dependent_locality_name;\n\t\t\t\t\tthis.analysis.changes.components.doubleDependentLocality = responseData.analysis.changes.components.double_dependent_locality;\n\t\t\t\t\tthis.analysis.changes.components.locality = responseData.analysis.changes.components.locality;\n\t\t\t\t\tthis.analysis.changes.components.postalCode = responseData.analysis.changes.components.postal_code;\n\t\t\t\t\tthis.analysis.changes.components.postalCodeShort = responseData.analysis.changes.components.postal_code_short;\n\t\t\t\t\tthis.analysis.changes.components.postalCodeExtra = responseData.analysis.changes.components.postal_code_extra;\n\t\t\t\t\tthis.analysis.changes.components.premise = responseData.analysis.changes.components.premise;\n\t\t\t\t\tthis.analysis.changes.components.premiseExtra = responseData.analysis.changes.components.premise_extra;\n\t\t\t\t\tthis.analysis.changes.components.premisePrefixNumber = responseData.analysis.changes.components.premise_prefix_number;\n\t\t\t\t\tthis.analysis.changes.components.premiseNumber = responseData.analysis.changes.components.premise_number;\n\t\t\t\t\tthis.analysis.changes.components.premiseType = responseData.analysis.changes.components.premise_type;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfare = responseData.analysis.changes.components.thoroughfare;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfarePredirection = responseData.analysis.changes.components.thoroughfare_predirection;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfarePostdirection = responseData.analysis.changes.components.thoroughfare_postdirection;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareName = responseData.analysis.changes.components.thoroughfare_name;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareTrailingType = responseData.analysis.changes.components.thoroughfare_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareType = responseData.analysis.changes.components.thoroughfare_type;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfare = responseData.analysis.changes.components.dependent_thoroughfare;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfarePredirection = responseData.analysis.changes.components.dependent_thoroughfare_predirection;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfarePostdirection = responseData.analysis.changes.components.dependent_thoroughfare_postdirection;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareName = responseData.analysis.changes.components.dependent_thoroughfare_name;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareTrailingType = responseData.analysis.changes.components.dependent_thoroughfare_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareType = responseData.analysis.changes.components.dependent_thoroughfare_type;\n\t\t\t\t\tthis.analysis.changes.components.building = responseData.analysis.changes.components.building;\n\t\t\t\t\tthis.analysis.changes.components.buildingLeadingType = responseData.analysis.changes.components.building_leading_type;\n\t\t\t\t\tthis.analysis.changes.components.buildingName = responseData.analysis.changes.components.building_name;\n\t\t\t\t\tthis.analysis.changes.components.buildingTrailingType = responseData.analysis.changes.components.building_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingType = responseData.analysis.changes.components.sub_building_type;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingNumber = responseData.analysis.changes.components.sub_building_number;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingName = responseData.analysis.changes.components.sub_building_name;\n\t\t\t\t\tthis.analysis.changes.components.subBuilding = responseData.analysis.changes.components.sub_building;\n\t\t\t\t\tthis.analysis.changes.components.postBox = responseData.analysis.changes.components.post_box;\n\t\t\t\t\tthis.analysis.changes.components.postBoxType = responseData.analysis.changes.components.post_box_type;\n\t\t\t\t\tthis.analysis.changes.components.postBoxNumber = responseData.analysis.changes.components.post_box_number;\n\t\t\t\t}\n\t\t\t\t//TODO: Fill in the rest of these fields and their corresponding tests.\n\t\t\t}\n\t\t}\n\n\t\tthis.metadata = {};\n\t\tif (responseData.metadata !== undefined) {\n\t\t\tthis.metadata.latitude = responseData.metadata.latitude;\n\t\t\tthis.metadata.longitude = responseData.metadata.longitude;\n\t\t\tthis.metadata.geocodePrecision = responseData.metadata.geocode_precision;\n\t\t\tthis.metadata.maxGeocodePrecision = responseData.metadata.max_geocode_precision;\n\t\t\tthis.metadata.addressFormat = responseData.metadata.address_format;\n\t\t}\n\t}\n}\n\nmodule.exports = Candidate;","const Request = require(\"../Request\");\nconst Errors = require(\"../Errors\");\nconst Candidate = require(\"./Candidate\");\nconst buildInputData = require(\"../util/buildInputData\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").internationalStreet;\n\n/**\n * This client sends lookups to the Smarty International Street API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildInputData(lookup, keyTranslationFormat);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tresolve(attachLookupCandidates(response, lookup));\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction attachLookupCandidates(response, lookup) {\n\t\t\tresponse.payload.map(rawCandidate => {\n\t\t\t\tlookup.result.push(new Candidate(rawCandidate));\n\t\t\t});\n\n\t\t\treturn lookup;\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","const UnprocessableEntityError = require(\"../Errors\").UnprocessableEntityError;\nconst messages = {\n\tcountryRequired: \"Country field is required.\",\n\tfreeformOrAddress1Required: \"Either freeform or address1 is required.\",\n\tinsufficientInformation: \"Insufficient information: One or more required fields were not set on the lookup.\",\n\tbadGeocode: \"Invalid input: geocode can only be set to 'true' (default is 'false'.\",\n\tinvalidLanguage: \"Invalid input: language can only be set to 'latin' or 'native'. When not set, the the output language will match the language of the input values.\"\n};\n\n\n/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n *

Note: Lookups must have certain required fields set with non-blank values.
\n * These can be found at the URL below.

\n * @see \"https://www.smarty.com/docs/cloud/international-street-api#http-input-fields\"\n */\nclass Lookup {\n\tconstructor(country, freeform) {\n\t\tthis.result = [];\n\n\t\tthis.country = country;\n\t\tthis.freeform = freeform;\n\t\tthis.address1 = undefined;\n\t\tthis.address2 = undefined;\n\t\tthis.address3 = undefined;\n\t\tthis.address4 = undefined;\n\t\tthis.organization = undefined;\n\t\tthis.locality = undefined;\n\t\tthis.administrativeArea = undefined;\n\t\tthis.postalCode = undefined;\n\t\tthis.geocode = undefined;\n\t\tthis.language = undefined;\n\t\tthis.inputId = undefined;\n\n\t\tthis.ensureEnoughInfo = this.ensureEnoughInfo.bind(this);\n\t\tthis.ensureValidData = this.ensureValidData.bind(this);\n\t}\n\n\tensureEnoughInfo() {\n\t\tif (fieldIsMissing(this.country)) throw new UnprocessableEntityError(messages.countryRequired);\n\n\t\tif (fieldIsSet(this.freeform)) return true;\n\n\t\tif (fieldIsMissing(this.address1)) throw new UnprocessableEntityError(messages.freeformOrAddress1Required);\n\n\t\tif (fieldIsSet(this.postalCode)) return true;\n\n\t\tif (fieldIsMissing(this.locality) || fieldIsMissing(this.administrativeArea)) throw new UnprocessableEntityError(messages.insufficientInformation);\n\n\t\treturn true;\n\t}\n\n\tensureValidData() {\n\t\tlet languageIsSetIncorrectly = () => {\n\t\t\tlet isLanguage = language => this.language.toLowerCase() === language;\n\n\t\t\treturn fieldIsSet(this.language) && !(isLanguage(\"latin\") || isLanguage(\"native\"));\n\t\t};\n\n\t\tlet geocodeIsSetIncorrectly = () => {\n\t\t\treturn fieldIsSet(this.geocode) && this.geocode.toLowerCase() !== \"true\";\n\t\t};\n\n\t\tif (geocodeIsSetIncorrectly()) throw new UnprocessableEntityError(messages.badGeocode);\n\n\t\tif (languageIsSetIncorrectly()) throw new UnprocessableEntityError(messages.invalidLanguage);\n\n\t\treturn true;\n\t}\n}\n\nfunction fieldIsMissing (field) {\n\tif (!field) return true;\n\n\tconst whitespaceCharacters = /\\s/g;\n\n\treturn field.replace(whitespaceCharacters, \"\").length < 1;\n}\n\nfunction fieldIsSet (field) {\n\treturn !fieldIsMissing(field);\n}\n\nmodule.exports = Lookup;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\n/**\n * This client sends lookups to the Smarty US Autocomplete API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildRequestParameters(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParameters(lookup) {\n\t\t\treturn {\n\t\t\t\tprefix: lookup.prefix,\n\t\t\t\tsuggestions: lookup.maxSuggestions,\n\t\t\t\tcity_filter: joinFieldWith(lookup.cityFilter, \",\"),\n\t\t\t\tstate_filter: joinFieldWith(lookup.stateFilter, \",\"),\n\t\t\t\tprefer: joinFieldWith(lookup.prefer, \";\"),\n\t\t\t\tprefer_ratio: lookup.preferRatio,\n\t\t\t\tgeolocate: lookup.geolocate,\n\t\t\t\tgeolocate_precision: lookup.geolocatePrecision,\n\t\t\t};\n\n\t\t\tfunction joinFieldWith(field, delimiter) {\n\t\t\t\tif (field.length) return field.join(delimiter);\n\t\t\t}\n\t\t}\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload.suggestions === null) return [];\n\n\t\t\treturn payload.suggestions.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param prefix The beginning of an address. This is required to be set.\n\t */\n\tconstructor(prefix) {\n\t\tthis.result = [];\n\n\t\tthis.prefix = prefix;\n\t\tthis.maxSuggestions = undefined;\n\t\tthis.cityFilter = [];\n\t\tthis.stateFilter = [];\n\t\tthis.prefer = [];\n\t\tthis.preferRatio = undefined;\n\t\tthis.geolocate = undefined;\n\t\tthis.geolocatePrecision = undefined;\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#http-response\"\n */\nclass Suggestion {\n\tconstructor(responseData) {\n\t\tthis.text = responseData.text;\n\t\tthis.streetLine = responseData.street_line;\n\t\tthis.city = responseData.city;\n\t\tthis.state = responseData.state;\n\t}\n}\n\nmodule.exports = Suggestion;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\n/**\n * This client sends lookups to the Smarty US Autocomplete Pro API,
\n * and attaches the suggestions to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildRequestParameters(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParameters(lookup) {\n\t\t\treturn {\n\t\t\t\tsearch: lookup.search,\n\t\t\t\tselected: lookup.selected,\n\t\t\t\tmax_results: lookup.maxResults,\n\t\t\t\tinclude_only_cities: joinFieldWith(lookup.includeOnlyCities, \";\"),\n\t\t\t\tinclude_only_states: joinFieldWith(lookup.includeOnlyStates, \";\"),\n\t\t\t\tinclude_only_zip_codes: joinFieldWith(lookup.includeOnlyZIPCodes, \";\"),\n\t\t\t\texclude_states: joinFieldWith(lookup.excludeStates, \";\"),\n\t\t\t\tprefer_cities: joinFieldWith(lookup.preferCities, \";\"),\n\t\t\t\tprefer_states: joinFieldWith(lookup.preferStates, \";\"),\n\t\t\t\tprefer_zip_codes: joinFieldWith(lookup.preferZIPCodes, \";\"),\n\t\t\t\tprefer_ratio: lookup.preferRatio,\n\t\t\t\tprefer_geolocation: lookup.preferGeolocation,\n\t\t\t\tsource: lookup.source,\n\t\t\t};\n\n\t\t\tfunction joinFieldWith(field, delimiter) {\n\t\t\t\tif (field.length) return field.join(delimiter);\n\t\t\t}\n\t\t}\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload.suggestions === null) return [];\n\n\t\t\treturn payload.suggestions.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#pro-http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param search The beginning of an address. This is required to be set.\n\t */\n\tconstructor(search) {\n\t\tthis.result = [];\n\n\t\tthis.search = search;\n\t\tthis.selected = undefined;\n\t\tthis.maxResults = undefined;\n\t\tthis.includeOnlyCities = [];\n\t\tthis.includeOnlyStates = [];\n\t\tthis.includeOnlyZIPCodes = [];\n\t\tthis.excludeStates = [];\n\t\tthis.preferCities = [];\n\t\tthis.preferStates = [];\n\t\tthis.preferZIPCodes = [];\n\t\tthis.preferRatio = undefined;\n\t\tthis.preferGeolocation = undefined;\n\t\tthis.source = undefined\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#pro-http-response\"\n */\nclass Suggestion {\n\tconstructor(responseData) {\n\t\tthis.streetLine = responseData.street_line;\n\t\tthis.secondary = responseData.secondary;\n\t\tthis.city = responseData.city;\n\t\tthis.state = responseData.state;\n\t\tthis.zipcode = responseData.zipcode;\n\t\tthis.entries = responseData.entries;\n\t}\n}\n\nmodule.exports = Suggestion;","const Candidate = require(\"../us_street/Candidate\");\n\n/**\n * @see Smarty US Extract API docs\n */\nclass Address {\n\tconstructor (responseData) {\n\t\tthis.text = responseData.text;\n\t\tthis.verified = responseData.verified;\n\t\tthis.line = responseData.line;\n\t\tthis.start = responseData.start;\n\t\tthis.end = responseData.end;\n\t\tthis.candidates = responseData.api_output.map(rawAddress => new Candidate(rawAddress));\n\t}\n}\n\nmodule.exports = Address;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Result = require(\"./Result\");\n\n/**\n * This client sends lookups to the Smarty US Extract API,
\n * and attaches the results to the Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request(lookup.text);\n\t\trequest.parameters = buildRequestParams(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = new Result(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParams(lookup) {\n\t\t\treturn {\n\t\t\t\thtml: lookup.html,\n\t\t\t\taggressive: lookup.aggressive,\n\t\t\t\taddr_line_breaks: lookup.addressesHaveLineBreaks,\n\t\t\t\taddr_per_line: lookup.addressesPerLine,\n\t\t\t};\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-extract-api#http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param text The text that is to have addresses extracted out of it for verification (required)\n\t */\n\tconstructor(text) {\n\t\tthis.result = {\n\t\t\tmeta: {},\n\t\t\taddresses: [],\n\t\t};\n\t\t//TODO: require the text field.\n\t\tthis.text = text;\n\t\tthis.html = undefined;\n\t\tthis.aggressive = undefined;\n\t\tthis.addressesHaveLineBreaks = undefined;\n\t\tthis.addressesPerLine = undefined;\n\t}\n}\n\nmodule.exports = Lookup;","const Address = require(\"./Address\");\n\n/**\n * @see Smarty US Extract API docs\n */\nclass Result {\n\tconstructor({meta, addresses}) {\n\t\tthis.meta = {\n\t\t\tlines: meta.lines,\n\t\t\tunicode: meta.unicode,\n\t\t\taddressCount: meta.address_count,\n\t\t\tverifiedCount: meta.verified_count,\n\t\t\tbytes: meta.bytes,\n\t\t\tcharacterCount: meta.character_count,\n\t\t};\n\n\t\tthis.addresses = addresses.map(rawAddress => new Address(rawAddress));\n\t}\n}\n\nmodule.exports = Result;","const Request = require(\"../Request\");\nconst Response = require(\"./Response\");\nconst buildInputData = require(\"../util/buildInputData\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usReverseGeo;\nconst {UndefinedLookupError} = require(\"../Errors.js\");\n\n/**\n * This client sends lookups to the Smarty US Reverse Geo API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildInputData(lookup, keyTranslationFormat);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tresolve(attachLookupResults(response, lookup));\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction attachLookupResults(response, lookup) {\n\t\t\tlookup.response = new Response(response.payload);\n\n\t\t\treturn lookup;\n\t\t}\n\t}\n}\n\nmodule.exports = Client;\n","const Response = require(\"./Response\");\n\n/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#input-fields\"\n */\nclass Lookup {\n\tconstructor(latitude, longitude) {\n\t\tthis.latitude = latitude.toFixed(8);\n\t\tthis.longitude = longitude.toFixed(8);\n\t\tthis.response = new Response();\n\t}\n}\n\nmodule.exports = Lookup;\n","const Result = require(\"./Result\");\n\n/**\n * The SmartyResponse contains the response from a call to the US Reverse Geo API.\n */\nclass Response {\n\tconstructor(responseData) {\n\t\tthis.results = [];\n\n\t\tif (responseData)\n\t\t\tresponseData.results.map(rawResult => {\n\t\t\t\tthis.results.push(new Result(rawResult));\n\t\t\t});\n\t}\n}\n\nmodule.exports = Response;\n","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous.\n *\n * @see \"https://www.smarty.com/docs/cloud/us-reverse-geo-api#result\"\n */\nclass Result {\n\tconstructor(responseData) {\n\t\tthis.distance = responseData.distance;\n\n\t\tthis.address = {};\n\t\tif (responseData.address) {\n\t\t\tthis.address.street = responseData.address.street;\n\t\t\tthis.address.city = responseData.address.city;\n\t\t\tthis.address.state_abbreviation = responseData.address.state_abbreviation;\n\t\t\tthis.address.zipcode = responseData.address.zipcode;\n\t\t}\n\n\t\tthis.coordinate = {};\n\t\tif (responseData.coordinate) {\n\t\t\tthis.coordinate.latitude = responseData.coordinate.latitude;\n\t\t\tthis.coordinate.longitude = responseData.coordinate.longitude;\n\t\t\tthis.coordinate.accuracy = responseData.coordinate.accuracy;\n\t\t\tswitch (responseData.coordinate.license) {\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.coordinate.license = \"SmartyStreets Proprietary\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.coordinate.license = \"SmartyStreets\";\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule.exports = Result;","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous, and
\n * the maxCandidates field is set higher than 1.\n *\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#root\"\n */\nclass Candidate {\n\tconstructor(responseData) {\n\t\tthis.inputIndex = responseData.input_index;\n\t\tthis.candidateIndex = responseData.candidate_index;\n\t\tthis.addressee = responseData.addressee;\n\t\tthis.deliveryLine1 = responseData.delivery_line_1;\n\t\tthis.deliveryLine2 = responseData.delivery_line_2;\n\t\tthis.lastLine = responseData.last_line;\n\t\tthis.deliveryPointBarcode = responseData.delivery_point_barcode;\n\n\t\tthis.components = {};\n\t\tif (responseData.components !== undefined) {\n\t\t\tthis.components.urbanization = responseData.components.urbanization;\n\t\t\tthis.components.primaryNumber = responseData.components.primary_number;\n\t\t\tthis.components.streetName = responseData.components.street_name;\n\t\t\tthis.components.streetPredirection = responseData.components.street_predirection;\n\t\t\tthis.components.streetPostdirection = responseData.components.street_postdirection;\n\t\t\tthis.components.streetSuffix = responseData.components.street_suffix;\n\t\t\tthis.components.secondaryNumber = responseData.components.secondary_number;\n\t\t\tthis.components.secondaryDesignator = responseData.components.secondary_designator;\n\t\t\tthis.components.extraSecondaryNumber = responseData.components.extra_secondary_number;\n\t\t\tthis.components.extraSecondaryDesignator = responseData.components.extra_secondary_designator;\n\t\t\tthis.components.pmbDesignator = responseData.components.pmb_designator;\n\t\t\tthis.components.pmbNumber = responseData.components.pmb_number;\n\t\t\tthis.components.cityName = responseData.components.city_name;\n\t\t\tthis.components.defaultCityName = responseData.components.default_city_name;\n\t\t\tthis.components.state = responseData.components.state_abbreviation;\n\t\t\tthis.components.zipCode = responseData.components.zipcode;\n\t\t\tthis.components.plus4Code = responseData.components.plus4_code;\n\t\t\tthis.components.deliveryPoint = responseData.components.delivery_point;\n\t\t\tthis.components.deliveryPointCheckDigit = responseData.components.delivery_point_check_digit;\n\t\t}\n\n\t\tthis.metadata = {};\n\t\tif (responseData.metadata !== undefined) {\n\t\t\tthis.metadata.recordType = responseData.metadata.record_type;\n\t\t\tthis.metadata.zipType = responseData.metadata.zip_type;\n\t\t\tthis.metadata.countyFips = responseData.metadata.county_fips;\n\t\t\tthis.metadata.countyName = responseData.metadata.county_name;\n\t\t\tthis.metadata.carrierRoute = responseData.metadata.carrier_route;\n\t\t\tthis.metadata.congressionalDistrict = responseData.metadata.congressional_district;\n\t\t\tthis.metadata.buildingDefaultIndicator = responseData.metadata.building_default_indicator;\n\t\t\tthis.metadata.rdi = responseData.metadata.rdi;\n\t\t\tthis.metadata.elotSequence = responseData.metadata.elot_sequence;\n\t\t\tthis.metadata.elotSort = responseData.metadata.elot_sort;\n\t\t\tthis.metadata.latitude = responseData.metadata.latitude;\n\t\t\tthis.metadata.longitude = responseData.metadata.longitude;\n\t\t\tswitch (responseData.metadata.coordinate_license)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.metadata.coordinateLicense = \"SmartyStreets Proprietary\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.metadata.coordinateLicense = \"SmartyStreets\";\n\t\t\t}\n\t\t\tthis.metadata.precision = responseData.metadata.precision;\n\t\t\tthis.metadata.timeZone = responseData.metadata.time_zone;\n\t\t\tthis.metadata.utcOffset = responseData.metadata.utc_offset;\n\t\t\tthis.metadata.obeysDst = responseData.metadata.dst;\n\t\t\tthis.metadata.isEwsMatch = responseData.metadata.ews_match;\n\t\t}\n\n\t\tthis.analysis = {};\n\t\tif (responseData.analysis !== undefined) {\n\t\t\tthis.analysis.dpvMatchCode = responseData.analysis.dpv_match_code;\n\t\t\tthis.analysis.dpvFootnotes = responseData.analysis.dpv_footnotes;\n\t\t\tthis.analysis.cmra = responseData.analysis.dpv_cmra;\n\t\t\tthis.analysis.vacant = responseData.analysis.dpv_vacant;\n\t\t\tthis.analysis.noStat = responseData.analysis.dpv_no_stat;\n\t\t\tthis.analysis.active = responseData.analysis.active;\n\t\t\tthis.analysis.isEwsMatch = responseData.analysis.ews_match; // Deprecated, refer to metadata.ews_match\n\t\t\tthis.analysis.footnotes = responseData.analysis.footnotes;\n\t\t\tthis.analysis.lacsLinkCode = responseData.analysis.lacslink_code;\n\t\t\tthis.analysis.lacsLinkIndicator = responseData.analysis.lacslink_indicator;\n\t\t\tthis.analysis.isSuiteLinkMatch = responseData.analysis.suitelink_match;\n\t\t\tthis.analysis.enhancedMatch = responseData.analysis.enhanced_match;\n\t\t}\n\t}\n}\n\nmodule.exports = Candidate;","const Candidate = require(\"./Candidate\");\nconst Lookup = require(\"./Lookup\");\nconst Batch = require(\"../Batch\");\nconst UndefinedLookupError = require(\"../Errors\").UndefinedLookupError;\nconst sendBatch = require(\"../util/sendBatch\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usStreet;\n\n/**\n * This client sends lookups to the Smarty US Street API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\t/**\n\t * Sends up to 100 lookups for validation.\n\t * @param data may be a Lookup object, or a Batch which must contain between 1 and 100 Lookup objects\n\t * @throws SmartyException\n\t */\n\tsend(data) {\n\t\tconst dataIsBatch = data instanceof Batch;\n\t\tconst dataIsLookup = data instanceof Lookup;\n\n\t\tif (!dataIsLookup && !dataIsBatch) throw new UndefinedLookupError;\n\n\t\tlet batch;\n\n\t\tif (dataIsLookup) {\n\t\t\tif (data.maxCandidates == null && data.match == \"enhanced\")\n\t\t\t\tdata.maxCandidates = 5;\n\t\t\tbatch = new Batch();\n\t\t\tbatch.add(data);\n\t\t} else {\n\t\t\tbatch = data;\n\t\t}\n\n\t\treturn sendBatch(batch, this.sender, Candidate, keyTranslationFormat);\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#input-fields\"\n */\nclass Lookup {\n\tconstructor(street, street2, secondary, city, state, zipCode, lastLine, addressee, urbanization, match, maxCandidates, inputId) {\n\t\tthis.street = street;\n\t\tthis.street2 = street2;\n\t\tthis.secondary = secondary;\n\t\tthis.city = city;\n\t\tthis.state = state;\n\t\tthis.zipCode = zipCode;\n\t\tthis.lastLine = lastLine;\n\t\tthis.addressee = addressee;\n\t\tthis.urbanization = urbanization;\n\t\tthis.match = match;\n\t\tthis.maxCandidates = maxCandidates;\n\t\tthis.inputId = inputId;\n\t\tthis.result = [];\n\t}\n}\n\nmodule.exports = Lookup;\n","const Lookup = require(\"./Lookup\");\nconst Result = require(\"./Result\");\nconst Batch = require(\"../Batch\");\nconst UndefinedLookupError = require(\"../Errors\").UndefinedLookupError;\nconst sendBatch = require(\"../util/sendBatch\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usZipcode;\n\n/**\n * This client sends lookups to the Smarty US ZIP Code API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\t/**\n\t * Sends up to 100 lookups for validation.\n\t * @param data May be a Lookup object, or a Batch which must contain between 1 and 100 Lookup objects\n\t * @throws SmartyException\n\t */\n\tsend(data) {\n\t\tconst dataIsBatch = data instanceof Batch;\n\t\tconst dataIsLookup = data instanceof Lookup;\n\n\t\tif (!dataIsLookup && !dataIsBatch) throw new UndefinedLookupError;\n\n\t\tlet batch;\n\n\t\tif (dataIsLookup) {\n\t\t\tbatch = new Batch();\n\t\t\tbatch.add(data);\n\t\t} else batch = data;\n\n\t\treturn sendBatch(batch, this.sender, Result, keyTranslationFormat);\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-zipcode-api#http-request-input-fields\"\n */\nclass Lookup {\n\tconstructor(city, state, zipCode, inputId) {\n\t\tthis.city = city;\n\t\tthis.state = state;\n\t\tthis.zipCode = zipCode;\n\t\tthis.inputId = inputId;\n\t\tthis.result = [];\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-zipcode-api#root\"\n */\nclass Result {\n\tconstructor(responseData) {\n\t\tthis.inputIndex = responseData.input_index;\n\t\tthis.status = responseData.status;\n\t\tthis.reason = responseData.reason;\n\t\tthis.valid = this.status === undefined && this.reason === undefined;\n\n\t\tthis.cities = !responseData.city_states ? [] : responseData.city_states.map(city => {\n\t\t\treturn {\n\t\t\t\tcity: city.city,\n\t\t\t\tstateAbbreviation: city.state_abbreviation,\n\t\t\t\tstate: city.state,\n\t\t\t\tmailableCity: city.mailable_city,\n\t\t\t};\n\t\t});\n\n\t\tthis.zipcodes = !responseData.zipcodes ? [] : responseData.zipcodes.map(zipcode => {\n\t\t\treturn {\n\t\t\t\tzipcode: zipcode.zipcode,\n\t\t\t\tzipcodeType: zipcode.zipcode_type,\n\t\t\t\tdefaultCity: zipcode.default_city,\n\t\t\t\tcountyFips: zipcode.county_fips,\n\t\t\t\tcountyName: zipcode.county_name,\n\t\t\t\tlatitude: zipcode.latitude,\n\t\t\t\tlongitude: zipcode.longitude,\n\t\t\t\tprecision: zipcode.precision,\n\t\t\t\tstateAbbreviation: zipcode.state_abbreviation,\n\t\t\t\tstate: zipcode.state,\n\t\t\t\talternateCounties: !zipcode.alternate_counties ? [] : zipcode.alternate_counties.map(county => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcountyFips: county.county_fips,\n\t\t\t\t\t\tcountyName: county.county_name,\n\t\t\t\t\t\tstateAbbreviation: county.state_abbreviation,\n\t\t\t\t\t\tstate: county.state,\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t};\n\t\t});\n\t}\n}\n\nmodule.exports = Result;","module.exports = {\n\tusStreet: {\n\t\t\"street\": \"street\",\n\t\t\"street2\": \"street2\",\n\t\t\"secondary\": \"secondary\",\n\t\t\"city\": \"city\",\n\t\t\"state\": \"state\",\n\t\t\"zipcode\": \"zipCode\",\n\t\t\"lastline\": \"lastLine\",\n\t\t\"addressee\": \"addressee\",\n\t\t\"urbanization\": \"urbanization\",\n\t\t\"match\": \"match\",\n\t\t\"candidates\": \"maxCandidates\",\n\t},\n\tusZipcode: {\n\t\t\"city\": \"city\",\n\t\t\"state\": \"state\",\n\t\t\"zipcode\": \"zipCode\",\n\t},\n\tinternationalStreet: {\n\t\t\"country\": \"country\",\n\t\t\"freeform\": \"freeform\",\n\t\t\"address1\": \"address1\",\n\t\t\"address2\": \"address2\",\n\t\t\"address3\": \"address3\",\n\t\t\"address4\": \"address4\",\n\t\t\"organization\": \"organization\",\n\t\t\"locality\": \"locality\",\n\t\t\"administrative_area\": \"administrativeArea\",\n\t\t\"postal_code\": \"postalCode\",\n\t\t\"geocode\": \"geocode\",\n\t\t\"language\": \"language\",\n\t},\n\tusReverseGeo: {\n\t\t\"latitude\": \"latitude\",\n\t\t\"longitude\": \"longitude\",\n\t}\n};","const ClientBuilder = require(\"../ClientBuilder\");\n\nfunction instantiateClientBuilder(credentials) {\n\treturn new ClientBuilder(credentials);\n}\n\nfunction buildUsStreetApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsStreetApiClient();\n}\n\nfunction buildUsAutocompleteApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsAutocompleteClient();\n}\n\nfunction buildUsAutocompleteProApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsAutocompleteProClient();\n}\n\nfunction buildUsExtractApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsExtractClient();\n}\n\nfunction buildUsZipcodeApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsZipcodeClient();\n}\n\nfunction buildInternationalStreetApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildInternationalStreetClient();\n}\n\nfunction buildUsReverseGeoApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsReverseGeoClient();\n}\n\nfunction buildInternationalAddressAutocompleteApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildInternationalAddressAutocompleteClient();\n}\n\nmodule.exports = {\n\tusStreet: buildUsStreetApiClient,\n\tusAutocomplete: buildUsAutocompleteApiClient,\n\tusAutocompletePro: buildUsAutocompleteProApiClient,\n\tusExtract: buildUsExtractApiClient,\n\tusZipcode: buildUsZipcodeApiClient,\n\tinternationalStreet: buildInternationalStreetApiClient,\n\tusReverseGeo: buildUsReverseGeoApiClient,\n\tinternationalAddressAutocomplete: buildInternationalAddressAutocompleteApiClient,\n};","const InputData = require(\"../InputData\");\n\nmodule.exports = (lookup, keyTranslationFormat) => {\n\tlet inputData = new InputData(lookup);\n\n\tfor (let key in keyTranslationFormat) {\n\t\tinputData.add(key, keyTranslationFormat[key]);\n\t}\n\n\treturn inputData.data;\n};\n","const Request = require(\"../Request\");\nconst Errors = require(\"../Errors\");\nconst buildInputData = require(\"../util/buildInputData\");\n\nmodule.exports = (batch, sender, Result, keyTranslationFormat) => {\n\tif (batch.isEmpty()) throw new Errors.BatchEmptyError;\n\n\tlet request = new Request();\n\n\tif (batch.length() === 1) request.parameters = generateRequestPayload(batch)[0];\n\telse request.payload = generateRequestPayload(batch);\n\n\treturn new Promise((resolve, reject) => {\n\t\tsender.send(request)\n\t\t\t.then(response => {\n\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\tresolve(assignResultsToLookups(batch, response));\n\t\t\t})\n\t\t\t.catch(reject);\n\t});\n\n\tfunction generateRequestPayload(batch) {\n\t\treturn batch.lookups.map((lookup) => {\n\t\t\treturn buildInputData(lookup, keyTranslationFormat);\n\t\t});\n\t}\n\n\tfunction assignResultsToLookups(batch, response) {\n\t\tresponse.payload.map(rawResult => {\n\t\t\tlet result = new Result(rawResult);\n\t\t\tlet lookup = batch.getByIndex(result.inputIndex);\n\n\t\t\tlookup.result.push(result);\n\t\t});\n\n\t\treturn batch;\n\t}\n};\n","/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n","'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n","'use strict';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","'use strict'\n\nvar nextTick = nextTickArgs\nprocess.nextTick(upgrade, 42) // pass 42 and see if upgrade is called with it\n\nmodule.exports = thunky\n\nfunction thunky (fn) {\n var state = run\n return thunk\n\n function thunk (callback) {\n state(callback || noop)\n }\n\n function run (callback) {\n var stack = [callback]\n state = wait\n fn(done)\n\n function wait (callback) {\n stack.push(callback)\n }\n\n function done (err) {\n var args = arguments\n state = isError(err) ? run : finished\n while (stack.length) finished(stack.shift())\n\n function finished (callback) {\n nextTick(apply, callback, args)\n }\n }\n }\n}\n\nfunction isError (err) { // inlined from util so this works in the browser\n return Object.prototype.toString.call(err) === '[object Error]'\n}\n\nfunction noop () {}\n\nfunction apply (callback, args) {\n callback.apply(null, args)\n}\n\nfunction upgrade (val) {\n if (val === 42) nextTick = process.nextTick\n}\n\nfunction nextTickArgs (fn, a, b) {\n process.nextTick(function () {\n fn(a, b)\n })\n}\n","/*!\n * toidentifier\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = toIdentifier\n\n/**\n * Trasform the given string into a JavaScript identifier\n *\n * @param {string} str\n * @returns {string}\n * @public\n */\n\nfunction toIdentifier (str) {\n return str\n .split(' ')\n .map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n })\n .join('')\n .replace(/[^ _0-9a-z]/gi, '')\n}\n","/*!\n * type-is\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar typer = require('media-typer')\nvar mime = require('mime-types')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = typeofrequest\nmodule.exports.is = typeis\nmodule.exports.hasBody = hasbody\nmodule.exports.normalize = normalize\nmodule.exports.match = mimeMatch\n\n/**\n * Compare a `value` content-type with `types`.\n * Each `type` can be an extension like `html`,\n * a special shortcut like `multipart` or `urlencoded`,\n * or a mime type.\n *\n * If no types match, `false` is returned.\n * Otherwise, the first `type` that matches is returned.\n *\n * @param {String} value\n * @param {Array} types\n * @public\n */\n\nfunction typeis (value, types_) {\n var i\n var types = types_\n\n // remove parameters and normalize\n var val = tryNormalizeType(value)\n\n // no type or invalid\n if (!val) {\n return false\n }\n\n // support flattened arguments\n if (types && !Array.isArray(types)) {\n types = new Array(arguments.length - 1)\n for (i = 0; i < types.length; i++) {\n types[i] = arguments[i + 1]\n }\n }\n\n // no types, return the content type\n if (!types || !types.length) {\n return val\n }\n\n var type\n for (i = 0; i < types.length; i++) {\n if (mimeMatch(normalize(type = types[i]), val)) {\n return type[0] === '+' || type.indexOf('*') !== -1\n ? val\n : type\n }\n }\n\n // no matches\n return false\n}\n\n/**\n * Check if a request has a request body.\n * A request with a body __must__ either have `transfer-encoding`\n * or `content-length` headers set.\n * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3\n *\n * @param {Object} request\n * @return {Boolean}\n * @public\n */\n\nfunction hasbody (req) {\n return req.headers['transfer-encoding'] !== undefined ||\n !isNaN(req.headers['content-length'])\n}\n\n/**\n * Check if the incoming request contains the \"Content-Type\"\n * header field, and it contains any of the give mime `type`s.\n * If there is no request body, `null` is returned.\n * If there is no content type, `false` is returned.\n * Otherwise, it returns the first `type` that matches.\n *\n * Examples:\n *\n * // With Content-Type: text/html; charset=utf-8\n * this.is('html'); // => 'html'\n * this.is('text/html'); // => 'text/html'\n * this.is('text/*', 'application/json'); // => 'text/html'\n *\n * // When Content-Type is application/json\n * this.is('json', 'urlencoded'); // => 'json'\n * this.is('application/json'); // => 'application/json'\n * this.is('html', 'application/*'); // => 'application/json'\n *\n * this.is('html'); // => false\n *\n * @param {String|Array} types...\n * @return {String|false|null}\n * @public\n */\n\nfunction typeofrequest (req, types_) {\n var types = types_\n\n // no body\n if (!hasbody(req)) {\n return null\n }\n\n // support flattened arguments\n if (arguments.length > 2) {\n types = new Array(arguments.length - 1)\n for (var i = 0; i < types.length; i++) {\n types[i] = arguments[i + 1]\n }\n }\n\n // request content type\n var value = req.headers['content-type']\n\n return typeis(value, types)\n}\n\n/**\n * Normalize a mime type.\n * If it's a shorthand, expand it to a valid mime type.\n *\n * In general, you probably want:\n *\n * var type = is(req, ['urlencoded', 'json', 'multipart']);\n *\n * Then use the appropriate body parsers.\n * These three are the most common request body types\n * and are thus ensured to work.\n *\n * @param {String} type\n * @private\n */\n\nfunction normalize (type) {\n if (typeof type !== 'string') {\n // invalid type\n return false\n }\n\n switch (type) {\n case 'urlencoded':\n return 'application/x-www-form-urlencoded'\n case 'multipart':\n return 'multipart/*'\n }\n\n if (type[0] === '+') {\n // \"+json\" -> \"*/*+json\" expando\n return '*/*' + type\n }\n\n return type.indexOf('/') === -1\n ? mime.lookup(type)\n : type\n}\n\n/**\n * Check if `expected` mime type\n * matches `actual` mime type with\n * wildcard and +suffix support.\n *\n * @param {String} expected\n * @param {String} actual\n * @return {Boolean}\n * @private\n */\n\nfunction mimeMatch (expected, actual) {\n // invalid type\n if (expected === false) {\n return false\n }\n\n // split types\n var actualParts = actual.split('/')\n var expectedParts = expected.split('/')\n\n // invalid format\n if (actualParts.length !== 2 || expectedParts.length !== 2) {\n return false\n }\n\n // validate type\n if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {\n return false\n }\n\n // validate suffix wildcard\n if (expectedParts[1].substr(0, 2) === '*+') {\n return expectedParts[1].length <= actualParts[1].length + 1 &&\n expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length)\n }\n\n // validate subtype\n if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {\n return false\n }\n\n return true\n}\n\n/**\n * Normalize a type and remove parameters.\n *\n * @param {string} value\n * @return {string}\n * @private\n */\n\nfunction normalizeType (value) {\n // parse the type\n var type = typer.parse(value)\n\n // remove the parameters\n type.parameters = undefined\n\n // reformat it\n return typer.format(type)\n}\n\n/**\n * Try to normalize a type and remove parameters.\n *\n * @param {string} value\n * @return {string}\n * @private\n */\n\nfunction tryNormalizeType (value) {\n if (!value) {\n return null\n }\n\n try {\n return normalizeType(value)\n } catch (err) {\n return null\n }\n}\n","/*!\n * uid-safe\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar randomBytes = require('random-bytes')\n\n/**\n * Module variables.\n * @private\n */\n\nvar EQUAL_END_REGEXP = /=+$/\nvar PLUS_GLOBAL_REGEXP = /\\+/g\nvar SLASH_GLOBAL_REGEXP = /\\//g\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = uid\nmodule.exports.sync = uidSync\n\n/**\n * Create a unique ID.\n *\n * @param {number} length\n * @param {function} [callback]\n * @return {Promise}\n * @public\n */\n\nfunction uid (length, callback) {\n // validate callback is a function, if provided\n if (callback !== undefined && typeof callback !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!callback && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n if (callback) {\n // classic callback style\n return generateUid(length, callback)\n }\n\n return new Promise(function executor (resolve, reject) {\n generateUid(length, function onUid (err, str) {\n if (err) return reject(err)\n resolve(str)\n })\n })\n}\n\n/**\n * Create a unique ID sync.\n *\n * @param {number} length\n * @return {string}\n * @public\n */\n\nfunction uidSync (length) {\n return toString(randomBytes.sync(length))\n}\n\n/**\n * Generate a unique ID string.\n *\n * @param {number} length\n * @param {function} callback\n * @private\n */\n\nfunction generateUid (length, callback) {\n randomBytes(length, function (err, buf) {\n if (err) return callback(err)\n callback(null, toString(buf))\n })\n}\n\n/**\n * Change a Buffer into a string.\n *\n * @param {Buffer} buf\n * @return {string}\n * @private\n */\n\nfunction toString (buf) {\n return buf.toString('base64')\n .replace(EQUAL_END_REGEXP, '')\n .replace(PLUS_GLOBAL_REGEXP, '-')\n .replace(SLASH_GLOBAL_REGEXP, '_')\n}\n","/*!\n * unpipe\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = unpipe\n\n/**\n * Determine if there are Node.js pipe-like data listeners.\n * @private\n */\n\nfunction hasPipeDataListeners(stream) {\n var listeners = stream.listeners('data')\n\n for (var i = 0; i < listeners.length; i++) {\n if (listeners[i].name === 'ondata') {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Unpipe a stream from all destinations.\n *\n * @param {object} stream\n * @public\n */\n\nfunction unpipe(stream) {\n if (!stream) {\n throw new TypeError('argument stream is required')\n }\n\n if (typeof stream.unpipe === 'function') {\n // new-style\n stream.unpipe()\n return\n }\n\n // Node.js 0.8 hack\n if (!hasPipeDataListeners(stream)) {\n return\n }\n\n var listener\n var listeners = stream.listeners('close')\n\n for (var i = 0; i < listeners.length; i++) {\n listener = listeners[i]\n\n if (listener.name !== 'cleanup' && listener.name !== 'onclose') {\n continue\n }\n\n // invoke the listener\n listener.call(stream)\n }\n}\n","'use strict';\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if ((buf[i] & 0x80) === 0x00) { // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // overlong\n ) {\n return false;\n }\n\n i += 2;\n } else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80 || // overlong\n buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0 // surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n }\n\n i += 3;\n } else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80 || // overlong\n buf[i] === 0xf4 && buf[i + 1] > 0x8f || buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n }\n\n i += 4;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = isValidUTF8;\n","'use strict';\n\ntry {\n module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n module.exports = require('./fallback');\n}\n","/**\n * Merge object b with object a.\n *\n * var a = { foo: 'bar' }\n * , b = { bar: 'baz' };\n *\n * merge(a, b);\n * // => { foo: 'bar', bar: 'baz' }\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object}\n * @api public\n */\n\nexports = module.exports = function(a, b){\n if (a && b) {\n for (var key in b) {\n a[key] = b[key];\n }\n }\n return a;\n};\n","/*!\n * vary\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n */\n\nmodule.exports = vary\nmodule.exports.append = append\n\n/**\n * RegExp to match field-name in RFC 7230 sec 3.2\n *\n * field-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n * / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * / DIGIT / ALPHA\n * ; any VCHAR, except delimiters\n */\n\nvar FIELD_NAME_REGEXP = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/\n\n/**\n * Append a field to a vary header.\n *\n * @param {String} header\n * @param {String|Array} field\n * @return {String}\n * @public\n */\n\nfunction append (header, field) {\n if (typeof header !== 'string') {\n throw new TypeError('header argument is required')\n }\n\n if (!field) {\n throw new TypeError('field argument is required')\n }\n\n // get fields array\n var fields = !Array.isArray(field)\n ? parse(String(field))\n : field\n\n // assert on invalid field names\n for (var j = 0; j < fields.length; j++) {\n if (!FIELD_NAME_REGEXP.test(fields[j])) {\n throw new TypeError('field argument contains an invalid header name')\n }\n }\n\n // existing, unspecified vary\n if (header === '*') {\n return header\n }\n\n // enumerate current values\n var val = header\n var vals = parse(header.toLowerCase())\n\n // unspecified vary\n if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {\n return '*'\n }\n\n for (var i = 0; i < fields.length; i++) {\n var fld = fields[i].toLowerCase()\n\n // append value (case-preserving)\n if (vals.indexOf(fld) === -1) {\n vals.push(fld)\n val = val\n ? val + ', ' + fields[i]\n : fields[i]\n }\n }\n\n return val\n}\n\n/**\n * Parse a vary header into an array.\n *\n * @param {String} header\n * @return {Array}\n * @private\n */\n\nfunction parse (header) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = header.length; i < len; i++) {\n switch (header.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n list.push(header.substring(start, end))\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n list.push(header.substring(start, end))\n\n return list\n}\n\n/**\n * Mark that a request is varied on a header field.\n *\n * @param {Object} res\n * @param {String|Array} field\n * @public\n */\n\nfunction vary (res, field) {\n if (!res || !res.getHeader || !res.setHeader) {\n // quack quack\n throw new TypeError('res argument is required')\n }\n\n // get existing header\n var val = res.getHeader('Vary') || ''\n var header = Array.isArray(val)\n ? val.join(', ')\n : String(val)\n\n // set new header\n if ((val = append(header, field))) {\n res.setHeader('Vary', val)\n }\n}\n","'use strict';\n\nconst WebSocket = require('./lib/websocket');\n\nWebSocket.createWebSocketStream = require('./lib/stream');\nWebSocket.Server = require('./lib/websocket-server');\nWebSocket.Receiver = require('./lib/receiver');\nWebSocket.Sender = require('./lib/sender');\n\nmodule.exports = WebSocket;\n","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n if (list.length === 0) return EMPTY_BUFFER;\n if (list.length === 1) return list[0];\n\n const target = Buffer.allocUnsafe(totalLength);\n let offset = 0;\n\n for (let i = 0; i < list.length; i++) {\n const buf = list[i];\n target.set(buf, offset);\n offset += buf.length;\n }\n\n if (offset < totalLength) return target.slice(0, offset);\n\n return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n for (let i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (let i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n if (buf.byteLength === buf.buffer.byteLength) {\n return buf.buffer;\n }\n\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n toBuffer.readOnly = true;\n\n if (Buffer.isBuffer(data)) return data;\n\n let buf;\n\n if (data instanceof ArrayBuffer) {\n buf = Buffer.from(data);\n } else if (ArrayBuffer.isView(data)) {\n buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n } else {\n buf = Buffer.from(data);\n toBuffer.readOnly = false;\n }\n\n return buf;\n}\n\ntry {\n const bufferUtil = require('bufferutil');\n const bu = bufferUtil.BufferUtil || bufferUtil;\n\n module.exports = {\n concat,\n mask(source, mask, output, offset, length) {\n if (length < 48) _mask(source, mask, output, offset, length);\n else bu.mask(source, mask, output, offset, length);\n },\n toArrayBuffer,\n toBuffer,\n unmask(buffer, mask) {\n if (buffer.length < 32) _unmask(buffer, mask);\n else bu.unmask(buffer, mask);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n concat,\n mask: _mask,\n toArrayBuffer,\n toBuffer,\n unmask: _unmask\n };\n}\n","'use strict';\n\nmodule.exports = {\n BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n kStatusCode: Symbol('status-code'),\n kWebSocket: Symbol('websocket'),\n EMPTY_BUFFER: Buffer.alloc(0),\n NOOP: () => {}\n};\n","'use strict';\n\n/**\n * Class representing an event.\n *\n * @private\n */\nclass Event {\n /**\n * Create a new `Event`.\n *\n * @param {String} type The name of the event\n * @param {Object} target A reference to the target to which the event was\n * dispatched\n */\n constructor(type, target) {\n this.target = target;\n this.type = type;\n }\n}\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n * @private\n */\nclass MessageEvent extends Event {\n /**\n * Create a new `MessageEvent`.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(data, target) {\n super('message', target);\n\n this.data = data;\n }\n}\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n * @private\n */\nclass CloseEvent extends Event {\n /**\n * Create a new `CloseEvent`.\n *\n * @param {Number} code The status code explaining why the connection is being\n * closed\n * @param {String} reason A human-readable string explaining why the\n * connection is closing\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(code, reason, target) {\n super('close', target);\n\n this.wasClean = target._closeFrameReceived && target._closeFrameSent;\n this.reason = reason;\n this.code = code;\n }\n}\n\n/**\n * Class representing an open event.\n *\n * @extends Event\n * @private\n */\nclass OpenEvent extends Event {\n /**\n * Create a new `OpenEvent`.\n *\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(target) {\n super('open', target);\n }\n}\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n * @private\n */\nclass ErrorEvent extends Event {\n /**\n * Create a new `ErrorEvent`.\n *\n * @param {Object} error The error that generated this event\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(error, target) {\n super('error', target);\n\n this.message = error.message;\n this.error = error;\n }\n}\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n /**\n * Register an event listener.\n *\n * @param {String} type A string representing the event type to listen for\n * @param {Function} listener The listener to add\n * @param {Object} [options] An options object specifies characteristics about\n * the event listener\n * @param {Boolean} [options.once=false] A `Boolean`` indicating that the\n * listener should be invoked at most once after being added. If `true`,\n * the listener would be automatically removed when invoked.\n * @public\n */\n addEventListener(type, listener, options) {\n if (typeof listener !== 'function') return;\n\n function onMessage(data) {\n listener.call(this, new MessageEvent(data, this));\n }\n\n function onClose(code, message) {\n listener.call(this, new CloseEvent(code, message, this));\n }\n\n function onError(error) {\n listener.call(this, new ErrorEvent(error, this));\n }\n\n function onOpen() {\n listener.call(this, new OpenEvent(this));\n }\n\n const method = options && options.once ? 'once' : 'on';\n\n if (type === 'message') {\n onMessage._listener = listener;\n this[method](type, onMessage);\n } else if (type === 'close') {\n onClose._listener = listener;\n this[method](type, onClose);\n } else if (type === 'error') {\n onError._listener = listener;\n this[method](type, onError);\n } else if (type === 'open') {\n onOpen._listener = listener;\n this[method](type, onOpen);\n } else {\n this[method](type, listener);\n }\n },\n\n /**\n * Remove an event listener.\n *\n * @param {String} type A string representing the event type to remove\n * @param {Function} listener The listener to remove\n * @public\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners(type);\n\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener || listeners[i]._listener === listener) {\n this.removeListener(type, listeners[i]);\n }\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n * parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n if (dest[name] === undefined) dest[name] = [elem];\n else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n const offers = Object.create(null);\n\n if (header === undefined || header === '') return offers;\n\n let params = Object.create(null);\n let mustUnescape = false;\n let isEscaping = false;\n let inQuotes = false;\n let extensionName;\n let paramName;\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (; i < header.length; i++) {\n const code = header.charCodeAt(i);\n\n if (extensionName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\\t' */) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n const name = header.slice(start, end);\n if (code === 0x2c) {\n push(offers, name, params);\n params = Object.create(null);\n } else {\n extensionName = name;\n }\n\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (paramName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 || code === 0x09) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n push(params, header.slice(start, end), true);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n start = end = -1;\n } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n paramName = header.slice(start, i);\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else {\n //\n // The value of a quoted-string after unescaping must conform to the\n // token ABNF, so only token characters are valid.\n // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n //\n if (isEscaping) {\n if (tokenChars[code] !== 1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1) start = i;\n else if (!mustUnescape) mustUnescape = true;\n isEscaping = false;\n } else if (inQuotes) {\n if (tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x22 /* '\"' */ && start !== -1) {\n inQuotes = false;\n end = i;\n } else if (code === 0x5c /* '\\' */) {\n isEscaping = true;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n inQuotes = true;\n } else if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n if (end === -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n let value = header.slice(start, end);\n if (mustUnescape) {\n value = value.replace(/\\\\/g, '');\n mustUnescape = false;\n }\n push(params, paramName, value);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n paramName = undefined;\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n }\n }\n\n if (start === -1 || inQuotes) {\n throw new SyntaxError('Unexpected end of input');\n }\n\n if (end === -1) end = i;\n const token = header.slice(start, end);\n if (extensionName === undefined) {\n push(offers, token, params);\n } else {\n if (paramName === undefined) {\n push(params, token, true);\n } else if (mustUnescape) {\n push(params, paramName, token.replace(/\\\\/g, ''));\n } else {\n push(params, paramName, token);\n }\n push(offers, extensionName, params);\n }\n\n return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n return Object.keys(extensions)\n .map((extension) => {\n let configurations = extensions[extension];\n if (!Array.isArray(configurations)) configurations = [configurations];\n return configurations\n .map((params) => {\n return [extension]\n .concat(\n Object.keys(params).map((k) => {\n let values = params[k];\n if (!Array.isArray(values)) values = [values];\n return values\n .map((v) => (v === true ? k : `${k}=${v}`))\n .join('; ');\n })\n )\n .join('; ');\n })\n .join(', ');\n })\n .join(', ');\n}\n\nmodule.exports = { format, parse };\n","'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n /**\n * Creates a new `Limiter`.\n *\n * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n * to run concurrently\n */\n constructor(concurrency) {\n this[kDone] = () => {\n this.pending--;\n this[kRun]();\n };\n this.concurrency = concurrency || Infinity;\n this.jobs = [];\n this.pending = 0;\n }\n\n /**\n * Adds a job to the queue.\n *\n * @param {Function} job The job to run\n * @public\n */\n add(job) {\n this.jobs.push(job);\n this[kRun]();\n }\n\n /**\n * Removes a job from the queue and runs it if possible.\n *\n * @private\n */\n [kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }\n}\n\nmodule.exports = Limiter;\n","'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode, NOOP } = require('./constants');\n\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n /**\n * Creates a PerMessageDeflate instance.\n *\n * @param {Object} [options] Configuration options\n * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n * disabling of server context takeover\n * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n * acknowledge disabling of client context takeover\n * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n * use of a custom server window size\n * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n * for, or request, a custom client window size\n * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n * deflate\n * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n * inflate\n * @param {Number} [options.threshold=1024] Size (in bytes) below which\n * messages should not be compressed\n * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n * calls to zlib\n * @param {Boolean} [isServer=false] Create the instance in either server or\n * client mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(options, isServer, maxPayload) {\n this._maxPayload = maxPayload | 0;\n this._options = options || {};\n this._threshold =\n this._options.threshold !== undefined ? this._options.threshold : 1024;\n this._isServer = !!isServer;\n this._deflate = null;\n this._inflate = null;\n\n this.params = null;\n\n if (!zlibLimiter) {\n const concurrency =\n this._options.concurrencyLimit !== undefined\n ? this._options.concurrencyLimit\n : 10;\n zlibLimiter = new Limiter(concurrency);\n }\n }\n\n /**\n * @type {String}\n */\n static get extensionName() {\n return 'permessage-deflate';\n }\n\n /**\n * Create an extension negotiation offer.\n *\n * @return {Object} Extension parameters\n * @public\n */\n offer() {\n const params = {};\n\n if (this._options.serverNoContextTakeover) {\n params.server_no_context_takeover = true;\n }\n if (this._options.clientNoContextTakeover) {\n params.client_no_context_takeover = true;\n }\n if (this._options.serverMaxWindowBits) {\n params.server_max_window_bits = this._options.serverMaxWindowBits;\n }\n if (this._options.clientMaxWindowBits) {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n } else if (this._options.clientMaxWindowBits == null) {\n params.client_max_window_bits = true;\n }\n\n return params;\n }\n\n /**\n * Accept an extension negotiation offer/response.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Object} Accepted configuration\n * @public\n */\n accept(configurations) {\n configurations = this.normalizeParams(configurations);\n\n this.params = this._isServer\n ? this.acceptAsServer(configurations)\n : this.acceptAsClient(configurations);\n\n return this.params;\n }\n\n /**\n * Releases all resources used by the extension.\n *\n * @public\n */\n cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n const callback = this._deflate[kCallback];\n\n this._deflate.close();\n this._deflate = null;\n\n if (callback) {\n callback(\n new Error(\n 'The deflate stream was closed while data was being processed'\n )\n );\n }\n }\n }\n\n /**\n * Accept an extension negotiation offer.\n *\n * @param {Array} offers The extension negotiation offers\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsServer(offers) {\n const opts = this._options;\n const accepted = offers.find((params) => {\n if (\n (opts.serverNoContextTakeover === false &&\n params.server_no_context_takeover) ||\n (params.server_max_window_bits &&\n (opts.serverMaxWindowBits === false ||\n (typeof opts.serverMaxWindowBits === 'number' &&\n opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n (typeof opts.clientMaxWindowBits === 'number' &&\n !params.client_max_window_bits)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (!accepted) {\n throw new Error('None of the extension offers can be accepted');\n }\n\n if (opts.serverNoContextTakeover) {\n accepted.server_no_context_takeover = true;\n }\n if (opts.clientNoContextTakeover) {\n accepted.client_no_context_takeover = true;\n }\n if (typeof opts.serverMaxWindowBits === 'number') {\n accepted.server_max_window_bits = opts.serverMaxWindowBits;\n }\n if (typeof opts.clientMaxWindowBits === 'number') {\n accepted.client_max_window_bits = opts.clientMaxWindowBits;\n } else if (\n accepted.client_max_window_bits === true ||\n opts.clientMaxWindowBits === false\n ) {\n delete accepted.client_max_window_bits;\n }\n\n return accepted;\n }\n\n /**\n * Accept the extension negotiation response.\n *\n * @param {Array} response The extension negotiation response\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsClient(response) {\n const params = response[0];\n\n if (\n this._options.clientNoContextTakeover === false &&\n params.client_no_context_takeover\n ) {\n throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n }\n\n if (!params.client_max_window_bits) {\n if (typeof this._options.clientMaxWindowBits === 'number') {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n }\n } else if (\n this._options.clientMaxWindowBits === false ||\n (typeof this._options.clientMaxWindowBits === 'number' &&\n params.client_max_window_bits > this._options.clientMaxWindowBits)\n ) {\n throw new Error(\n 'Unexpected or invalid parameter \"client_max_window_bits\"'\n );\n }\n\n return params;\n }\n\n /**\n * Normalize parameters.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Array} The offers/response with normalized parameters\n * @private\n */\n normalizeParams(configurations) {\n configurations.forEach((params) => {\n Object.keys(params).forEach((key) => {\n let value = params[key];\n\n if (value.length > 1) {\n throw new Error(`Parameter \"${key}\" must have only a single value`);\n }\n\n value = value[0];\n\n if (key === 'client_max_window_bits') {\n if (value !== true) {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (!this._isServer) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else if (key === 'server_max_window_bits') {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (\n key === 'client_no_context_takeover' ||\n key === 'server_no_context_takeover'\n ) {\n if (value !== true) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else {\n throw new Error(`Unknown parameter \"${key}\"`);\n }\n\n params[key] = value;\n });\n });\n\n return configurations;\n }\n\n /**\n * Decompress data. Concurrency limited.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n decompress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._decompress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Compress data. Concurrency limited.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n compress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._compress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Decompress data.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _decompress(data, fin, callback) {\n const endpoint = this._isServer ? 'client' : 'server';\n\n if (!this._inflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._inflate = zlib.createInflateRaw({\n ...this._options.zlibInflateOptions,\n windowBits\n });\n this._inflate[kPerMessageDeflate] = this;\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n this._inflate.on('error', inflateOnError);\n this._inflate.on('data', inflateOnData);\n }\n\n this._inflate[kCallback] = callback;\n\n this._inflate.write(data);\n if (fin) this._inflate.write(TRAILER);\n\n this._inflate.flush(() => {\n const err = this._inflate[kError];\n\n if (err) {\n this._inflate.close();\n this._inflate = null;\n callback(err);\n return;\n }\n\n const data = bufferUtil.concat(\n this._inflate[kBuffers],\n this._inflate[kTotalLength]\n );\n\n if (this._inflate._readableState.endEmitted) {\n this._inflate.close();\n this._inflate = null;\n } else {\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._inflate.reset();\n }\n }\n\n callback(null, data);\n });\n }\n\n /**\n * Compress data.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _compress(data, fin, callback) {\n const endpoint = this._isServer ? 'server' : 'client';\n\n if (!this._deflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._deflate = zlib.createDeflateRaw({\n ...this._options.zlibDeflateOptions,\n windowBits\n });\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n //\n // An `'error'` event is emitted, only on Node.js < 10.0.0, if the\n // `zlib.DeflateRaw` instance is closed while data is being processed.\n // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong\n // time due to an abnormal WebSocket closure.\n //\n this._deflate.on('error', NOOP);\n this._deflate.on('data', deflateOnData);\n }\n\n this._deflate[kCallback] = callback;\n\n this._deflate.write(data);\n this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n if (!this._deflate) {\n //\n // The deflate stream was closed while data was being processed.\n //\n return;\n }\n\n let data = bufferUtil.concat(\n this._deflate[kBuffers],\n this._deflate[kTotalLength]\n );\n\n if (fin) data = data.slice(0, data.length - 4);\n\n //\n // Ensure that the callback will not be called again in\n // `PerMessageDeflate#cleanup()`.\n //\n this._deflate[kCallback] = null;\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._deflate.reset();\n }\n\n callback(null, data);\n });\n }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n this[kBuffers].push(chunk);\n this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n this[kTotalLength] += chunk.length;\n\n if (\n this[kPerMessageDeflate]._maxPayload < 1 ||\n this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n ) {\n this[kBuffers].push(chunk);\n return;\n }\n\n this[kError] = new RangeError('Max payload size exceeded');\n this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';\n this[kError][kStatusCode] = 1009;\n this.removeListener('data', inflateOnData);\n this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n //\n // There is no need to call `Zlib#close()` as the handle is automatically\n // closed when an error is emitted.\n //\n this[kPerMessageDeflate]._inflate = null;\n err[kStatusCode] = 1007;\n this[kCallback](err);\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n kStatusCode,\n kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends Writable\n */\nclass Receiver extends Writable {\n /**\n * Creates a Receiver instance.\n *\n * @param {String} [binaryType=nodebuffer] The type for binary data\n * @param {Object} [extensions] An object containing the negotiated extensions\n * @param {Boolean} [isServer=false] Specifies whether to operate in client or\n * server mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(binaryType, extensions, isServer, maxPayload) {\n super();\n\n this._binaryType = binaryType || BINARY_TYPES[0];\n this[kWebSocket] = undefined;\n this._extensions = extensions || {};\n this._isServer = !!isServer;\n this._maxPayload = maxPayload | 0;\n\n this._bufferedBytes = 0;\n this._buffers = [];\n\n this._compressed = false;\n this._payloadLength = 0;\n this._mask = undefined;\n this._fragmented = 0;\n this._masked = false;\n this._fin = false;\n this._opcode = 0;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragments = [];\n\n this._state = GET_INFO;\n this._loop = false;\n }\n\n /**\n * Implements `Writable.prototype._write()`.\n *\n * @param {Buffer} chunk The chunk of data to write\n * @param {String} encoding The character encoding of `chunk`\n * @param {Function} cb Callback\n * @private\n */\n _write(chunk, encoding, cb) {\n if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n this._bufferedBytes += chunk.length;\n this._buffers.push(chunk);\n this.startLoop(cb);\n }\n\n /**\n * Consumes `n` bytes from the buffered data.\n *\n * @param {Number} n The number of bytes to consume\n * @return {Buffer} The consumed bytes\n * @private\n */\n consume(n) {\n this._bufferedBytes -= n;\n\n if (n === this._buffers[0].length) return this._buffers.shift();\n\n if (n < this._buffers[0].length) {\n const buf = this._buffers[0];\n this._buffers[0] = buf.slice(n);\n return buf.slice(0, n);\n }\n\n const dst = Buffer.allocUnsafe(n);\n\n do {\n const buf = this._buffers[0];\n const offset = dst.length - n;\n\n if (n >= buf.length) {\n dst.set(this._buffers.shift(), offset);\n } else {\n dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n this._buffers[0] = buf.slice(n);\n }\n\n n -= buf.length;\n } while (n > 0);\n\n return dst;\n }\n\n /**\n * Starts the parsing loop.\n *\n * @param {Function} cb Callback\n * @private\n */\n startLoop(cb) {\n let err;\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n err = this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n err = this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n err = this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n err = this.getData(cb);\n break;\n default:\n // `INFLATING`\n this._loop = false;\n return;\n }\n } while (this._loop);\n\n cb(err);\n }\n\n /**\n * Reads the first two bytes of a frame.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getInfo() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV2 and RSV3 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_2_3'\n );\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (!this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n 'invalid opcode 0',\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._opcode = this._fragmented;\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this._loop = false;\n return error(\n RangeError,\n 'FIN must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_FIN'\n );\n }\n\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (this._payloadLength > 0x7d) {\n this._loop = false;\n return error(\n RangeError,\n `invalid payload length ${this._payloadLength}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n }\n } else {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._isServer) {\n if (!this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_MASK'\n );\n }\n } else if (this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_MASK'\n );\n }\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+16).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength16() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n this._payloadLength = this.consume(2).readUInt16BE(0);\n return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+64).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength64() {\n if (this._bufferedBytes < 8) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(8);\n const num = buf.readUInt32BE(0);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this._loop = false;\n return error(\n RangeError,\n 'Unsupported WebSocket frame: payload length > 2^53 - 1',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'\n );\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n return this.haveLength();\n }\n\n /**\n * Payload length has been read.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n haveLength() {\n if (this._payloadLength && this._opcode < 0x08) {\n this._totalPayloadLength += this._payloadLength;\n if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n this._loop = false;\n return error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n );\n }\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }\n\n /**\n * Reads mask bytes.\n *\n * @private\n */\n getMask() {\n if (this._bufferedBytes < 4) {\n this._loop = false;\n return;\n }\n\n this._mask = this.consume(4);\n this._state = GET_DATA;\n }\n\n /**\n * Reads data bytes.\n *\n * @param {Function} cb Callback\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n getData(cb) {\n let data = EMPTY_BUFFER;\n\n if (this._payloadLength) {\n if (this._bufferedBytes < this._payloadLength) {\n this._loop = false;\n return;\n }\n\n data = this.consume(this._payloadLength);\n if (this._masked) unmask(data, this._mask);\n }\n\n if (this._opcode > 0x07) return this.controlMessage(data);\n\n if (this._compressed) {\n this._state = INFLATING;\n this.decompress(data, cb);\n return;\n }\n\n if (data.length) {\n //\n // This message is not compressed so its lenght is the sum of the payload\n // length of all fragments.\n //\n this._messageLength = this._totalPayloadLength;\n this._fragments.push(data);\n }\n\n return this.dataMessage();\n }\n\n /**\n * Decompresses data.\n *\n * @param {Buffer} data Compressed data\n * @param {Function} cb Callback\n * @private\n */\n decompress(data, cb) {\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n if (err) return cb(err);\n\n if (buf.length) {\n this._messageLength += buf.length;\n if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n return cb(\n error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n )\n );\n }\n\n this._fragments.push(buf);\n }\n\n const er = this.dataMessage();\n if (er) return cb(er);\n\n this.startLoop(cb);\n });\n }\n\n /**\n * Handles a data message.\n *\n * @return {(Error|undefined)} A possible error\n * @private\n */\n dataMessage() {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n let data;\n\n if (this._binaryType === 'nodebuffer') {\n data = concat(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(concat(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.emit('message', data);\n } else {\n const buf = concat(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this._loop = false;\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('message', buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }\n\n /**\n * Handles a control message.\n *\n * @param {Buffer} data Data to handle\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n controlMessage(data) {\n if (this._opcode === 0x08) {\n this._loop = false;\n\n if (data.length === 0) {\n this.emit('conclude', 1005, '');\n this.end();\n } else if (data.length === 1) {\n return error(\n RangeError,\n 'invalid payload length 1',\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n } else {\n const code = data.readUInt16BE(0);\n\n if (!isValidStatusCode(code)) {\n return error(\n RangeError,\n `invalid status code ${code}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CLOSE_CODE'\n );\n }\n\n const buf = data.slice(2);\n\n if (!isValidUTF8(buf)) {\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('conclude', code, buf.toString());\n this.end();\n }\n } else if (this._opcode === 0x09) {\n this.emit('ping', data);\n } else {\n this.emit('pong', data);\n }\n\n this._state = GET_INFO;\n }\n}\n\nmodule.exports = Receiver;\n\n/**\n * Builds an error object.\n *\n * @param {function(new:Error|RangeError)} ErrorCtor The error constructor\n * @param {String} message The error message\n * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n * `message`\n * @param {Number} statusCode The status code\n * @param {String} errorCode The exposed error code\n * @return {(Error|RangeError)} The error\n * @private\n */\nfunction error(ErrorCtor, message, prefix, statusCode, errorCode) {\n const err = new ErrorCtor(\n prefix ? `Invalid WebSocket frame: ${message}` : message\n );\n\n Error.captureStackTrace(err, error);\n err.code = errorCode;\n err[kStatusCode] = statusCode;\n return err;\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls$\" }] */\n\n'use strict';\n\nconst net = require('net');\nconst tls = require('tls');\nconst { randomFillSync } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst mask = Buffer.alloc(4);\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n /**\n * Creates a Sender instance.\n *\n * @param {(net.Socket|tls.Socket)} socket The connection socket\n * @param {Object} [extensions] An object containing the negotiated extensions\n */\n constructor(socket, extensions) {\n this._extensions = extensions || {};\n this._socket = socket;\n\n this._firstFragment = true;\n this._compress = false;\n\n this._bufferedBytes = 0;\n this._deflating = false;\n this._queue = [];\n }\n\n /**\n * Frames a piece of data according to the HyBi WebSocket protocol.\n *\n * @param {Buffer} data The data to frame\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @return {Buffer[]} The framed data as a list of `Buffer` instances\n * @public\n */\n static frame(data, options) {\n const merge = options.mask && options.readOnly;\n let offset = options.mask ? 6 : 2;\n let payloadLength = data.length;\n\n if (data.length >= 65536) {\n offset += 8;\n payloadLength = 127;\n } else if (data.length > 125) {\n offset += 2;\n payloadLength = 126;\n }\n\n const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);\n\n target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n if (options.rsv1) target[0] |= 0x40;\n\n target[1] = payloadLength;\n\n if (payloadLength === 126) {\n target.writeUInt16BE(data.length, 2);\n } else if (payloadLength === 127) {\n target.writeUInt32BE(0, 2);\n target.writeUInt32BE(data.length, 6);\n }\n\n if (!options.mask) return [target, data];\n\n randomFillSync(mask, 0, 4);\n\n target[1] |= 0x80;\n target[offset - 4] = mask[0];\n target[offset - 3] = mask[1];\n target[offset - 2] = mask[2];\n target[offset - 1] = mask[3];\n\n if (merge) {\n applyMask(data, mask, target, offset, data.length);\n return [target];\n }\n\n applyMask(data, mask, data, 0, data.length);\n return [target, data];\n }\n\n /**\n * Sends a close message to the other peer.\n *\n * @param {Number} [code] The status code component of the body\n * @param {String} [data] The message component of the body\n * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n * @param {Function} [cb] Callback\n * @public\n */\n close(code, data, mask, cb) {\n let buf;\n\n if (code === undefined) {\n buf = EMPTY_BUFFER;\n } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n throw new TypeError('First argument must be a valid error code number');\n } else if (data === undefined || data === '') {\n buf = Buffer.allocUnsafe(2);\n buf.writeUInt16BE(code, 0);\n } else {\n const length = Buffer.byteLength(data);\n\n if (length > 123) {\n throw new RangeError('The message must not be greater than 123 bytes');\n }\n\n buf = Buffer.allocUnsafe(2 + length);\n buf.writeUInt16BE(code, 0);\n buf.write(data, 2);\n }\n\n if (this._deflating) {\n this.enqueue([this.doClose, buf, mask, cb]);\n } else {\n this.doClose(buf, mask, cb);\n }\n }\n\n /**\n * Frames and sends a close message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @private\n */\n doClose(data, mask, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x08,\n mask,\n readOnly: false\n }),\n cb\n );\n }\n\n /**\n * Sends a ping message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n ping(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPing(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a ping message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPing(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x09,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a pong message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n pong(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPong(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a pong message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPong(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x0a,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a data message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} [options.compress=false] Specifies whether or not to\n * compress `data`\n * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n * or text\n * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Function} [cb] Callback\n * @public\n */\n send(data, options, cb) {\n const buf = toBuffer(data);\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n let opcode = options.binary ? 2 : 1;\n let rsv1 = options.compress;\n\n if (this._firstFragment) {\n this._firstFragment = false;\n if (rsv1 && perMessageDeflate) {\n rsv1 = buf.length >= perMessageDeflate._threshold;\n }\n this._compress = rsv1;\n } else {\n rsv1 = false;\n opcode = 0;\n }\n\n if (options.fin) this._firstFragment = true;\n\n if (perMessageDeflate) {\n const opts = {\n fin: options.fin,\n rsv1,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n };\n\n if (this._deflating) {\n this.enqueue([this.dispatch, buf, this._compress, opts, cb]);\n } else {\n this.dispatch(buf, this._compress, opts, cb);\n }\n } else {\n this.sendFrame(\n Sender.frame(buf, {\n fin: options.fin,\n rsv1: false,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n }),\n cb\n );\n }\n }\n\n /**\n * Dispatches a data message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [compress=false] Specifies whether or not to compress\n * `data`\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @param {Function} [cb] Callback\n * @private\n */\n dispatch(data, compress, options, cb) {\n if (!compress) {\n this.sendFrame(Sender.frame(data, options), cb);\n return;\n }\n\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n this._bufferedBytes += data.length;\n this._deflating = true;\n perMessageDeflate.compress(data, options.fin, (_, buf) => {\n if (this._socket.destroyed) {\n const err = new Error(\n 'The socket was closed while data was being compressed'\n );\n\n if (typeof cb === 'function') cb(err);\n\n for (let i = 0; i < this._queue.length; i++) {\n const callback = this._queue[i][4];\n\n if (typeof callback === 'function') callback(err);\n }\n\n return;\n }\n\n this._bufferedBytes -= data.length;\n this._deflating = false;\n options.readOnly = false;\n this.sendFrame(Sender.frame(buf, options), cb);\n this.dequeue();\n });\n }\n\n /**\n * Executes queued send operations.\n *\n * @private\n */\n dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }\n\n /**\n * Enqueues a send operation.\n *\n * @param {Array} params Send operation parameters.\n * @private\n */\n enqueue(params) {\n this._bufferedBytes += params[1].length;\n this._queue.push(params);\n }\n\n /**\n * Sends a frame.\n *\n * @param {Buffer[]} list The frame to send\n * @param {Function} [cb] Callback\n * @private\n */\n sendFrame(list, cb) {\n if (list.length === 2) {\n this._socket.cork();\n this._socket.write(list[0]);\n this._socket.write(list[1], cb);\n this._socket.uncork();\n } else {\n this._socket.write(list[0], cb);\n }\n }\n}\n\nmodule.exports = Sender;\n","'use strict';\n\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {Duplex} stream The stream.\n * @private\n */\nfunction emitClose(stream) {\n stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n if (!this.destroyed && this._writableState.finished) {\n this.destroy();\n }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n this.removeListener('error', duplexOnError);\n this.destroy();\n if (this.listenerCount('error') === 0) {\n // Do not suppress the throwing behavior.\n this.emit('error', err);\n }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n let resumeOnReceiverDrain = true;\n let terminateOnDestroy = true;\n\n function receiverOnDrain() {\n if (resumeOnReceiverDrain) ws._socket.resume();\n }\n\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n });\n } else {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n }\n\n const duplex = new Duplex({\n ...options,\n autoDestroy: false,\n emitClose: false,\n objectMode: false,\n writableObjectMode: false\n });\n\n ws.on('message', function message(msg) {\n if (!duplex.push(msg)) {\n resumeOnReceiverDrain = false;\n ws._socket.pause();\n }\n });\n\n ws.once('error', function error(err) {\n if (duplex.destroyed) return;\n\n // Prevent `ws.terminate()` from being called by `duplex._destroy()`.\n //\n // - If the `'error'` event is emitted before the `'open'` event, then\n // `ws.terminate()` is a noop as no socket is assigned.\n // - Otherwise, the error is re-emitted by the listener of the `'error'`\n // event of the `Receiver` object. The listener already closes the\n // connection by calling `ws.close()`. This allows a close frame to be\n // sent to the other peer. If `ws.terminate()` is called right after this,\n // then the close frame might not be sent.\n terminateOnDestroy = false;\n duplex.destroy(err);\n });\n\n ws.once('close', function close() {\n if (duplex.destroyed) return;\n\n duplex.push(null);\n });\n\n duplex._destroy = function (err, callback) {\n if (ws.readyState === ws.CLOSED) {\n callback(err);\n process.nextTick(emitClose, duplex);\n return;\n }\n\n let called = false;\n\n ws.once('error', function error(err) {\n called = true;\n callback(err);\n });\n\n ws.once('close', function close() {\n if (!called) callback(err);\n process.nextTick(emitClose, duplex);\n });\n\n if (terminateOnDestroy) ws.terminate();\n };\n\n duplex._final = function (callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._final(callback);\n });\n return;\n }\n\n // If the value of the `_socket` property is `null` it means that `ws` is a\n // client websocket and the handshake failed. In fact, when this happens, a\n // socket is never assigned to the websocket. Wait for the `'error'` event\n // that will be emitted by the websocket.\n if (ws._socket === null) return;\n\n if (ws._socket._writableState.finished) {\n callback();\n if (duplex._readableState.endEmitted) duplex.destroy();\n } else {\n ws._socket.once('finish', function finish() {\n // `duplex` is not destroyed here because the `'end'` event will be\n // emitted on `duplex` after this `'finish'` event. The EOF signaling\n // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n callback();\n });\n ws.close();\n }\n };\n\n duplex._read = function () {\n if (\n (ws.readyState === ws.OPEN || ws.readyState === ws.CLOSING) &&\n !resumeOnReceiverDrain\n ) {\n resumeOnReceiverDrain = true;\n if (!ws._receiver._writableState.needDrain) ws._socket.resume();\n }\n };\n\n duplex._write = function (chunk, encoding, callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._write(chunk, encoding, callback);\n });\n return;\n }\n\n ws.send(chunk, callback);\n };\n\n duplex.on('end', duplexOnEnd);\n duplex.on('error', duplexOnError);\n return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n","'use strict';\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n return (\n (code >= 1000 &&\n code <= 1014 &&\n code !== 1004 &&\n code !== 1005 &&\n code !== 1006) ||\n (code >= 3000 && code <= 4999)\n );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if ((buf[i] & 0x80) === 0) {\n // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) {\n // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // Overlong\n ) {\n return false;\n }\n\n i += 2;\n } else if ((buf[i] & 0xf0) === 0xe0) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n }\n\n i += 3;\n } else if ((buf[i] & 0xf8) === 0xf0) {\n // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n }\n\n i += 4;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\ntry {\n let isValidUTF8 = require('utf-8-validate');\n\n /* istanbul ignore if */\n if (typeof isValidUTF8 === 'object') {\n isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0\n }\n\n module.exports = {\n isValidStatusCode,\n isValidUTF8(buf) {\n return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n isValidStatusCode,\n isValidUTF8: _isValidUTF8\n };\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls|https$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst http = require('http');\nconst https = require('https');\nconst net = require('net');\nconst tls = require('tls');\nconst { createHash } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst WebSocket = require('./websocket');\nconst { format, parse } = require('./extension');\nconst { GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\nconst RUNNING = 0;\nconst CLOSING = 1;\nconst CLOSED = 2;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n /**\n * Create a `WebSocketServer` instance.\n *\n * @param {Object} options Configuration options\n * @param {Number} [options.backlog=511] The maximum length of the queue of\n * pending connections\n * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n * track clients\n * @param {Function} [options.handleProtocols] A hook to handle protocols\n * @param {String} [options.host] The hostname where to bind the server\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.noServer=false] Enable no server mode\n * @param {String} [options.path] Accept only connections matching this path\n * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n * permessage-deflate\n * @param {Number} [options.port] The port where to bind the server\n * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n * server to use\n * @param {Function} [options.verifyClient] A hook to reject connections\n * @param {Function} [callback] A listener for the `listening` event\n */\n constructor(options, callback) {\n super();\n\n options = {\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: false,\n handleProtocols: null,\n clientTracking: true,\n verifyClient: null,\n noServer: false,\n backlog: null, // use default (511 as implemented in net.js)\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n };\n\n if (\n (options.port == null && !options.server && !options.noServer) ||\n (options.port != null && (options.server || options.noServer)) ||\n (options.server && options.noServer)\n ) {\n throw new TypeError(\n 'One and only one of the \"port\", \"server\", or \"noServer\" options ' +\n 'must be specified'\n );\n }\n\n if (options.port != null) {\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n\n res.writeHead(426, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n });\n this._server.listen(\n options.port,\n options.host,\n options.backlog,\n callback\n );\n } else if (options.server) {\n this._server = options.server;\n }\n\n if (this._server) {\n const emitConnection = this.emit.bind(this, 'connection');\n\n this._removeListeners = addListeners(this._server, {\n listening: this.emit.bind(this, 'listening'),\n error: this.emit.bind(this, 'error'),\n upgrade: (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n }\n });\n }\n\n if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n if (options.clientTracking) this.clients = new Set();\n this.options = options;\n this._state = RUNNING;\n }\n\n /**\n * Returns the bound address, the address family name, and port of the server\n * as reported by the operating system if listening on an IP socket.\n * If the server is listening on a pipe or UNIX domain socket, the name is\n * returned as a string.\n *\n * @return {(Object|String|null)} The address of the server\n * @public\n */\n address() {\n if (this.options.noServer) {\n throw new Error('The server is operating in \"noServer\" mode');\n }\n\n if (!this._server) return null;\n return this._server.address();\n }\n\n /**\n * Close the server.\n *\n * @param {Function} [cb] Callback\n * @public\n */\n close(cb) {\n if (cb) this.once('close', cb);\n\n if (this._state === CLOSED) {\n process.nextTick(emitClose, this);\n return;\n }\n\n if (this._state === CLOSING) return;\n this._state = CLOSING;\n\n //\n // Terminate all associated clients.\n //\n if (this.clients) {\n for (const client of this.clients) client.terminate();\n }\n\n const server = this._server;\n\n if (server) {\n this._removeListeners();\n this._removeListeners = this._server = null;\n\n //\n // Close the http server if it was internally created.\n //\n if (this.options.port != null) {\n server.close(emitClose.bind(undefined, this));\n return;\n }\n }\n\n process.nextTick(emitClose, this);\n }\n\n /**\n * See if a given request should be handled by this server instance.\n *\n * @param {http.IncomingMessage} req Request object to inspect\n * @return {Boolean} `true` if the request is valid, else `false`\n * @public\n */\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf('?');\n const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n if (pathname !== this.options.path) return false;\n }\n\n return true;\n }\n\n /**\n * Handle a HTTP Upgrade request.\n *\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @public\n */\n handleUpgrade(req, socket, head, cb) {\n socket.on('error', socketOnError);\n\n const key =\n req.headers['sec-websocket-key'] !== undefined\n ? req.headers['sec-websocket-key'].trim()\n : false;\n const version = +req.headers['sec-websocket-version'];\n const extensions = {};\n\n if (\n req.method !== 'GET' ||\n req.headers.upgrade.toLowerCase() !== 'websocket' ||\n !key ||\n !keyRegex.test(key) ||\n (version !== 8 && version !== 13) ||\n !this.shouldHandle(req)\n ) {\n return abortHandshake(socket, 400);\n }\n\n if (this.options.perMessageDeflate) {\n const perMessageDeflate = new PerMessageDeflate(\n this.options.perMessageDeflate,\n true,\n this.options.maxPayload\n );\n\n try {\n const offers = parse(req.headers['sec-websocket-extensions']);\n\n if (offers[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n }\n } catch (err) {\n return abortHandshake(socket, 400);\n }\n }\n\n //\n // Optionally call external client verification handler.\n //\n if (this.options.verifyClient) {\n const info = {\n origin:\n req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified) {\n return abortHandshake(socket, code || 401, message, headers);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n });\n return;\n }\n\n if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n }\n\n /**\n * Upgrade the connection to WebSocket.\n *\n * @param {String} key The value of the `Sec-WebSocket-Key` header\n * @param {Object} extensions The accepted extensions\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @throws {Error} If called more than once with the same socket\n * @private\n */\n completeUpgrade(key, extensions, req, socket, head, cb) {\n //\n // Destroy the socket if the client has already sent a FIN packet.\n //\n if (!socket.readable || !socket.writable) return socket.destroy();\n\n if (socket[kWebSocket]) {\n throw new Error(\n 'server.handleUpgrade() was called more than once with the same ' +\n 'socket, possibly due to a misconfiguration'\n );\n }\n\n if (this._state > RUNNING) return abortHandshake(socket, 503);\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n const headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${digest}`\n ];\n\n const ws = new WebSocket(null);\n let protocol = req.headers['sec-websocket-protocol'];\n\n if (protocol) {\n protocol = protocol.split(',').map(trim);\n\n //\n // Optionally call external protocol selection handler.\n //\n if (this.options.handleProtocols) {\n protocol = this.options.handleProtocols(protocol, req);\n } else {\n protocol = protocol[0];\n }\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n ws._protocol = protocol;\n }\n }\n\n if (extensions[PerMessageDeflate.extensionName]) {\n const params = extensions[PerMessageDeflate.extensionName].params;\n const value = format({\n [PerMessageDeflate.extensionName]: [params]\n });\n headers.push(`Sec-WebSocket-Extensions: ${value}`);\n ws._extensions = extensions;\n }\n\n //\n // Allow external modification/inspection of handshake headers.\n //\n this.emit('headers', headers, req);\n\n socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n socket.removeListener('error', socketOnError);\n\n ws.setSocket(socket, head, this.options.maxPayload);\n\n if (this.clients) {\n this.clients.add(ws);\n ws.on('close', () => this.clients.delete(ws));\n }\n\n cb(ws, req);\n }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of \n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n * called\n * @private\n */\nfunction addListeners(server, map) {\n for (const event of Object.keys(map)) server.on(event, map[event]);\n\n return function removeListeners() {\n for (const event of Object.keys(map)) {\n server.removeListener(event, map[event]);\n }\n };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n server._state = CLOSED;\n server.emit('close');\n}\n\n/**\n * Handle premature socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n if (socket.writable) {\n message = message || http.STATUS_CODES[code];\n headers = {\n Connection: 'close',\n 'Content-Type': 'text/html',\n 'Content-Length': Buffer.byteLength(message),\n ...headers\n };\n\n socket.write(\n `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n Object.keys(headers)\n .map((h) => `${h}: ${headers[h]}`)\n .join('\\r\\n') +\n '\\r\\n\\r\\n' +\n message\n );\n }\n\n socket.removeListener('error', socketOnError);\n socket.destroy();\n}\n\n/**\n * Remove whitespace characters from both ends of a string.\n *\n * @param {String} str The string\n * @return {String} A new string representing `str` stripped of whitespace\n * characters from both its beginning and end\n * @private\n */\nfunction trim(str) {\n return str.trim();\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Readable$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { Readable } = require('stream');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n GUID,\n kStatusCode,\n kWebSocket,\n NOOP\n} = require('./constants');\nconst { addEventListener, removeEventListener } = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst protocolVersions = [8, 13];\nconst closeTimeout = 30 * 1000;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n /**\n * Create a new `WebSocket`.\n *\n * @param {(String|URL)} address The URL to which to connect\n * @param {(String|String[])} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n */\n constructor(address, protocols, options) {\n super();\n\n this._binaryType = BINARY_TYPES[0];\n this._closeCode = 1006;\n this._closeFrameReceived = false;\n this._closeFrameSent = false;\n this._closeMessage = '';\n this._closeTimer = null;\n this._extensions = {};\n this._protocol = '';\n this._readyState = WebSocket.CONNECTING;\n this._receiver = null;\n this._sender = null;\n this._socket = null;\n\n if (address !== null) {\n this._bufferedAmount = 0;\n this._isServer = false;\n this._redirects = 0;\n\n if (Array.isArray(protocols)) {\n protocols = protocols.join(', ');\n } else if (typeof protocols === 'object' && protocols !== null) {\n options = protocols;\n protocols = undefined;\n }\n\n initAsClient(this, address, protocols, options);\n } else {\n this._isServer = true;\n }\n }\n\n /**\n * This deviates from the WHATWG interface since ws doesn't support the\n * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n * type).\n *\n * @type {String}\n */\n get binaryType() {\n return this._binaryType;\n }\n\n set binaryType(type) {\n if (!BINARY_TYPES.includes(type)) return;\n\n this._binaryType = type;\n\n //\n // Allow to change `binaryType` on the fly.\n //\n if (this._receiver) this._receiver._binaryType = type;\n }\n\n /**\n * @type {Number}\n */\n get bufferedAmount() {\n if (!this._socket) return this._bufferedAmount;\n\n return this._socket._writableState.length + this._sender._bufferedBytes;\n }\n\n /**\n * @type {String}\n */\n get extensions() {\n return Object.keys(this._extensions).join();\n }\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onclose() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onclose(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onerror() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onerror(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onopen() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onopen(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onmessage() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onmessage(listener) {}\n\n /**\n * @type {String}\n */\n get protocol() {\n return this._protocol;\n }\n\n /**\n * @type {Number}\n */\n get readyState() {\n return this._readyState;\n }\n\n /**\n * @type {String}\n */\n get url() {\n return this._url;\n }\n\n /**\n * Set up the socket and the internal resources.\n *\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Number} [maxPayload=0] The maximum allowed message size\n * @private\n */\n setSocket(socket, head, maxPayload) {\n const receiver = new Receiver(\n this.binaryType,\n this._extensions,\n this._isServer,\n maxPayload\n );\n\n this._sender = new Sender(socket, this._extensions);\n this._receiver = receiver;\n this._socket = socket;\n\n receiver[kWebSocket] = this;\n socket[kWebSocket] = this;\n\n receiver.on('conclude', receiverOnConclude);\n receiver.on('drain', receiverOnDrain);\n receiver.on('error', receiverOnError);\n receiver.on('message', receiverOnMessage);\n receiver.on('ping', receiverOnPing);\n receiver.on('pong', receiverOnPong);\n\n socket.setTimeout(0);\n socket.setNoDelay();\n\n if (head.length > 0) socket.unshift(head);\n\n socket.on('close', socketOnClose);\n socket.on('data', socketOnData);\n socket.on('end', socketOnEnd);\n socket.on('error', socketOnError);\n\n this._readyState = WebSocket.OPEN;\n this.emit('open');\n }\n\n /**\n * Emit the `'close'` event.\n *\n * @private\n */\n emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }\n\n /**\n * Start a closing handshake.\n *\n * +----------+ +-----------+ +----------+\n * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n * | +----------+ +-----------+ +----------+ |\n * +----------+ +-----------+ |\n * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING\n * +----------+ +-----------+ |\n * | | | +---+ |\n * +------------------------+-->|fin| - - - -\n * | +---+ | +---+\n * - - - - -|fin|<---------------------+\n * +---+\n *\n * @param {Number} [code] Status code explaining why the connection is closing\n * @param {String} [data] A string explaining why the connection is closing\n * @public\n */\n close(code, data) {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this.readyState === WebSocket.CLOSING) {\n if (\n this._closeFrameSent &&\n (this._closeFrameReceived || this._receiver._writableState.errorEmitted)\n ) {\n this._socket.end();\n }\n\n return;\n }\n\n this._readyState = WebSocket.CLOSING;\n this._sender.close(code, data, !this._isServer, (err) => {\n //\n // This error is handled by the `'error'` listener on the socket. We only\n // want to know if the close frame has been sent here.\n //\n if (err) return;\n\n this._closeFrameSent = true;\n\n if (\n this._closeFrameReceived ||\n this._receiver._writableState.errorEmitted\n ) {\n this._socket.end();\n }\n });\n\n //\n // Specify a timeout for the closing handshake to complete.\n //\n this._closeTimer = setTimeout(\n this._socket.destroy.bind(this._socket),\n closeTimeout\n );\n }\n\n /**\n * Send a ping.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the ping is sent\n * @public\n */\n ping(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a pong.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the pong is sent\n * @public\n */\n pong(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a data message.\n *\n * @param {*} data The message to send\n * @param {Object} [options] Options object\n * @param {Boolean} [options.compress] Specifies whether or not to compress\n * `data`\n * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n * text\n * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when data is written out\n * @public\n */\n send(data, options, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n const opts = {\n binary: typeof data !== 'string',\n mask: !this._isServer,\n compress: true,\n fin: true,\n ...options\n };\n\n if (!this._extensions[PerMessageDeflate.extensionName]) {\n opts.compress = false;\n }\n\n this._sender.send(data || EMPTY_BUFFER, opts, cb);\n }\n\n /**\n * Forcibly close the connection.\n *\n * @public\n */\n terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }\n}\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n[\n 'binaryType',\n 'bufferedAmount',\n 'extensions',\n 'protocol',\n 'readyState',\n 'url'\n].forEach((property) => {\n Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n Object.defineProperty(WebSocket.prototype, `on${method}`, {\n enumerable: true,\n get() {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]._listener) return listeners[i]._listener;\n }\n\n return undefined;\n },\n set(listener) {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n //\n // Remove only the listeners added via `addEventListener`.\n //\n if (listeners[i]._listener) this.removeListener(method, listeners[i]);\n }\n this.addEventListener(method, listener);\n }\n });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|URL)} address The URL to which to connect\n * @param {String} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n * permessage-deflate\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n * handshake request\n * @param {Number} [options.protocolVersion=13] Value of the\n * `Sec-WebSocket-Version` header\n * @param {String} [options.origin] Value of the `Origin` or\n * `Sec-WebSocket-Origin` header\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n * redirects\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n * allowed\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n const opts = {\n protocolVersion: protocolVersions[1],\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: true,\n followRedirects: false,\n maxRedirects: 10,\n ...options,\n createConnection: undefined,\n socketPath: undefined,\n hostname: undefined,\n protocol: undefined,\n timeout: undefined,\n method: undefined,\n host: undefined,\n path: undefined,\n port: undefined\n };\n\n if (!protocolVersions.includes(opts.protocolVersion)) {\n throw new RangeError(\n `Unsupported protocol version: ${opts.protocolVersion} ` +\n `(supported versions: ${protocolVersions.join(', ')})`\n );\n }\n\n let parsedUrl;\n\n if (address instanceof URL) {\n parsedUrl = address;\n websocket._url = address.href;\n } else {\n parsedUrl = new URL(address);\n websocket._url = address;\n }\n\n const isUnixSocket = parsedUrl.protocol === 'ws+unix:';\n\n if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) {\n const err = new Error(`Invalid URL: ${websocket.url}`);\n\n if (websocket._redirects === 0) {\n throw err;\n } else {\n emitErrorAndClose(websocket, err);\n return;\n }\n }\n\n const isSecure =\n parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:';\n const defaultPort = isSecure ? 443 : 80;\n const key = randomBytes(16).toString('base64');\n const get = isSecure ? https.get : http.get;\n let perMessageDeflate;\n\n opts.createConnection = isSecure ? tlsConnect : netConnect;\n opts.defaultPort = opts.defaultPort || defaultPort;\n opts.port = parsedUrl.port || defaultPort;\n opts.host = parsedUrl.hostname.startsWith('[')\n ? parsedUrl.hostname.slice(1, -1)\n : parsedUrl.hostname;\n opts.headers = {\n 'Sec-WebSocket-Version': opts.protocolVersion,\n 'Sec-WebSocket-Key': key,\n Connection: 'Upgrade',\n Upgrade: 'websocket',\n ...opts.headers\n };\n opts.path = parsedUrl.pathname + parsedUrl.search;\n opts.timeout = opts.handshakeTimeout;\n\n if (opts.perMessageDeflate) {\n perMessageDeflate = new PerMessageDeflate(\n opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n false,\n opts.maxPayload\n );\n opts.headers['Sec-WebSocket-Extensions'] = format({\n [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n });\n }\n if (protocols) {\n opts.headers['Sec-WebSocket-Protocol'] = protocols;\n }\n if (opts.origin) {\n if (opts.protocolVersion < 13) {\n opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n } else {\n opts.headers.Origin = opts.origin;\n }\n }\n if (parsedUrl.username || parsedUrl.password) {\n opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n }\n\n if (isUnixSocket) {\n const parts = opts.path.split(':');\n\n opts.socketPath = parts[0];\n opts.path = parts[1];\n }\n\n if (opts.followRedirects) {\n if (websocket._redirects === 0) {\n websocket._originalUnixSocket = isUnixSocket;\n websocket._originalSecure = isSecure;\n websocket._originalHostOrSocketPath = isUnixSocket\n ? opts.socketPath\n : parsedUrl.host;\n\n const headers = options && options.headers;\n\n //\n // Shallow copy the user provided options so that headers can be changed\n // without mutating the original object.\n //\n options = { ...options, headers: {} };\n\n if (headers) {\n for (const [key, value] of Object.entries(headers)) {\n options.headers[key.toLowerCase()] = value;\n }\n }\n } else {\n const isSameHost = isUnixSocket\n ? websocket._originalUnixSocket\n ? opts.socketPath === websocket._originalHostOrSocketPath\n : false\n : websocket._originalUnixSocket\n ? false\n : parsedUrl.host === websocket._originalHostOrSocketPath;\n\n if (!isSameHost || (websocket._originalSecure && !isSecure)) {\n //\n // Match curl 7.77.0 behavior and drop the following headers. These\n // headers are also dropped when following a redirect to a subdomain.\n //\n delete opts.headers.authorization;\n delete opts.headers.cookie;\n\n if (!isSameHost) delete opts.headers.host;\n\n opts.auth = undefined;\n }\n }\n\n //\n // Match curl 7.77.0 behavior and make the first `Authorization` header win.\n // If the `Authorization` header is set, then there is nothing to do as it\n // will take precedence.\n //\n if (opts.auth && !options.headers.authorization) {\n options.headers.authorization =\n 'Basic ' + Buffer.from(opts.auth).toString('base64');\n }\n }\n\n let req = (websocket._req = get(opts));\n\n if (opts.timeout) {\n req.on('timeout', () => {\n abortHandshake(websocket, req, 'Opening handshake has timed out');\n });\n }\n\n req.on('error', (err) => {\n if (req === null || req.aborted) return;\n\n req = websocket._req = null;\n emitErrorAndClose(websocket, err);\n });\n\n req.on('response', (res) => {\n const location = res.headers.location;\n const statusCode = res.statusCode;\n\n if (\n location &&\n opts.followRedirects &&\n statusCode >= 300 &&\n statusCode < 400\n ) {\n if (++websocket._redirects > opts.maxRedirects) {\n abortHandshake(websocket, req, 'Maximum redirects exceeded');\n return;\n }\n\n req.abort();\n\n let addr;\n\n try {\n addr = new URL(location, address);\n } catch (err) {\n emitErrorAndClose(websocket, err);\n return;\n }\n\n initAsClient(websocket, addr, protocols, options);\n } else if (!websocket.emit('unexpected-response', req, res)) {\n abortHandshake(\n websocket,\n req,\n `Unexpected server response: ${res.statusCode}`\n );\n }\n });\n\n req.on('upgrade', (res, socket, head) => {\n websocket.emit('upgrade', res);\n\n //\n // The user may have closed the connection from a listener of the `upgrade`\n // event.\n //\n if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n req = websocket._req = null;\n\n if (res.headers.upgrade.toLowerCase() !== 'websocket') {\n abortHandshake(websocket, socket, 'Invalid Upgrade header');\n return;\n }\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n if (res.headers['sec-websocket-accept'] !== digest) {\n abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n return;\n }\n\n const serverProt = res.headers['sec-websocket-protocol'];\n const protList = (protocols || '').split(/, */);\n let protError;\n\n if (!protocols && serverProt) {\n protError = 'Server sent a subprotocol but none was requested';\n } else if (protocols && !serverProt) {\n protError = 'Server sent no subprotocol';\n } else if (serverProt && !protList.includes(serverProt)) {\n protError = 'Server sent an invalid subprotocol';\n }\n\n if (protError) {\n abortHandshake(websocket, socket, protError);\n return;\n }\n\n if (serverProt) websocket._protocol = serverProt;\n\n const secWebSocketExtensions = res.headers['sec-websocket-extensions'];\n\n if (secWebSocketExtensions !== undefined) {\n if (!perMessageDeflate) {\n const message =\n 'Server sent a Sec-WebSocket-Extensions header but no extension ' +\n 'was requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n let extensions;\n\n try {\n extensions = parse(secWebSocketExtensions);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n const extensionNames = Object.keys(extensions);\n\n if (extensionNames.length) {\n if (\n extensionNames.length !== 1 ||\n extensionNames[0] !== PerMessageDeflate.extensionName\n ) {\n const message =\n 'Server indicated an extension that was not requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n try {\n perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n websocket._extensions[PerMessageDeflate.extensionName] =\n perMessageDeflate;\n }\n }\n\n websocket.setSocket(socket, head, opts.maxPayload);\n });\n}\n\n/**\n * Emit the `'error'` and `'close'` event.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {Error} The error to emit\n * @private\n */\nfunction emitErrorAndClose(websocket, err) {\n websocket._readyState = WebSocket.CLOSING;\n websocket.emit('error', err);\n websocket.emitClose();\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n options.path = options.socketPath;\n return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n options.path = undefined;\n\n if (!options.servername && options.servername !== '') {\n options.servername = net.isIP(options.host) ? '' : options.host;\n }\n\n return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to\n * abort or the socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n websocket._readyState = WebSocket.CLOSING;\n\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshake);\n\n if (stream.setHeader) {\n stream.abort();\n\n if (stream.socket && !stream.socket.destroyed) {\n //\n // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n // called after the request completed. See\n // https://github.com/websockets/ws/issues/1869.\n //\n stream.socket.destroy();\n }\n\n stream.once('abort', websocket.emitClose.bind(websocket));\n websocket.emit('error', err);\n } else {\n stream.destroy(err);\n stream.once('error', websocket.emit.bind(websocket, 'error'));\n stream.once('close', websocket.emitClose.bind(websocket));\n }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n if (data) {\n const length = toBuffer(data).length;\n\n //\n // The `_bufferedAmount` property is used only when the peer is a client and\n // the opening handshake fails. Under these circumstances, in fact, the\n // `setSocket()` method is not called, so the `_socket` and `_sender`\n // properties are set to `null`.\n //\n if (websocket._socket) websocket._sender._bufferedBytes += length;\n else websocket._bufferedAmount += length;\n }\n\n if (cb) {\n const err = new Error(\n `WebSocket is not open: readyState ${websocket.readyState} ` +\n `(${readyStates[websocket.readyState]})`\n );\n cb(err);\n }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {String} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n const websocket = this[kWebSocket];\n\n websocket._closeFrameReceived = true;\n websocket._closeMessage = reason;\n websocket._closeCode = code;\n\n if (websocket._socket[kWebSocket] === undefined) return;\n\n websocket._socket.removeListener('data', socketOnData);\n process.nextTick(resume, websocket._socket);\n\n if (code === 1005) websocket.close();\n else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n const websocket = this[kWebSocket];\n\n if (websocket._socket[kWebSocket] !== undefined) {\n websocket._socket.removeListener('data', socketOnData);\n\n //\n // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See\n // https://github.com/websockets/ws/issues/1940.\n //\n process.nextTick(resume, websocket._socket);\n\n websocket.close(err[kStatusCode]);\n }\n\n websocket.emit('error', err);\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message\n * @private\n */\nfunction receiverOnMessage(data) {\n this[kWebSocket].emit('message', data);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n const websocket = this[kWebSocket];\n\n websocket.pong(data, !websocket._isServer, NOOP);\n websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n this[kWebSocket].emit('pong', data);\n}\n\n/**\n * Resume a readable stream\n *\n * @param {Readable} stream The readable stream\n * @private\n */\nfunction resume(stream) {\n stream.resume();\n}\n\n/**\n * The listener of the `net.Socket` `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('data', socketOnData);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n let chunk;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk.\n //\n if (\n !this._readableState.endEmitted &&\n !websocket._closeFrameReceived &&\n !websocket._receiver._writableState.errorEmitted &&\n (chunk = websocket._socket.read()) !== null\n ) {\n websocket._receiver.write(chunk);\n }\n\n websocket._receiver.end();\n\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}\n\n/**\n * The listener of the `net.Socket` `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n if (!this[kWebSocket]._receiver.write(chunk)) {\n this.pause();\n }\n}\n\n/**\n * The listener of the `net.Socket` `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}\n\n/**\n * The listener of the `net.Socket` `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n const websocket = this[kWebSocket];\n\n this.removeListener('error', socketOnError);\n this.on('error', NOOP);\n\n if (websocket) {\n websocket._readyState = WebSocket.CLOSING;\n this.destroy();\n }\n}\n","module.exports = require(\"assert\");","module.exports = require(\"async_hooks\");","module.exports = require(\"buffer\");","module.exports = require(\"cluster\");","module.exports = require(\"crypto\");","module.exports = require(\"dgram\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"querystring\");","module.exports = require(\"stream\");","module.exports = require(\"string_decoder\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// GENERATED FILE. DO NOT EDIT.\nvar ipCodec = (function(exports) {\n \"use strict\";\n \n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.decode = decode;\n exports.encode = encode;\n exports.familyOf = familyOf;\n exports.name = void 0;\n exports.sizeOf = sizeOf;\n exports.v6 = exports.v4 = void 0;\n const v4Regex = /^(\\d{1,3}\\.){3,3}\\d{1,3}$/;\n const v4Size = 4;\n const v6Regex = /^(::)?(((\\d{1,3}\\.){3}(\\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;\n const v6Size = 16;\n const v4 = {\n name: 'v4',\n size: v4Size,\n isFormat: ip => v4Regex.test(ip),\n \n encode(ip, buff, offset) {\n offset = ~~offset;\n buff = buff || new Uint8Array(offset + v4Size);\n const max = ip.length;\n let n = 0;\n \n for (let i = 0; i < max;) {\n const c = ip.charCodeAt(i++);\n \n if (c === 46) {\n // \".\"\n buff[offset++] = n;\n n = 0;\n } else {\n n = n * 10 + (c - 48);\n }\n }\n \n buff[offset] = n;\n return buff;\n },\n \n decode(buff, offset) {\n offset = ~~offset;\n return `${buff[offset++]}.${buff[offset++]}.${buff[offset++]}.${buff[offset]}`;\n }\n \n };\n exports.v4 = v4;\n const v6 = {\n name: 'v6',\n size: v6Size,\n isFormat: ip => ip.length > 0 && v6Regex.test(ip),\n \n encode(ip, buff, offset) {\n offset = ~~offset;\n let end = offset + v6Size;\n let fill = -1;\n let hexN = 0;\n let decN = 0;\n let prevColon = true;\n let useDec = false;\n buff = buff || new Uint8Array(offset + v6Size); // Note: This algorithm needs to check if the offset\n // could exceed the buffer boundaries as it supports\n // non-standard compliant encodings that may go beyond\n // the boundary limits. if (offset < end) checks should\n // not be necessary...\n \n for (let i = 0; i < ip.length; i++) {\n let c = ip.charCodeAt(i);\n \n if (c === 58) {\n // :\n if (prevColon) {\n if (fill !== -1) {\n // Not Standard! (standard doesn't allow multiple ::)\n // We need to treat\n if (offset < end) buff[offset] = 0;\n if (offset < end - 1) buff[offset + 1] = 0;\n offset += 2;\n } else if (offset < end) {\n // :: in the middle\n fill = offset;\n }\n } else {\n // : ends the previous number\n if (useDec === true) {\n // Non-standard! (ipv4 should be at end only)\n // A ipv4 address should not be found anywhere else but at\n // the end. This codec also support putting characters\n // after the ipv4 address..\n if (offset < end) buff[offset] = decN;\n offset++;\n } else {\n if (offset < end) buff[offset] = hexN >> 8;\n if (offset < end - 1) buff[offset + 1] = hexN & 0xff;\n offset += 2;\n }\n \n hexN = 0;\n decN = 0;\n }\n \n prevColon = true;\n useDec = false;\n } else if (c === 46) {\n // . indicates IPV4 notation\n if (offset < end) buff[offset] = decN;\n offset++;\n decN = 0;\n hexN = 0;\n prevColon = false;\n useDec = true;\n } else {\n prevColon = false;\n \n if (c >= 97) {\n c -= 87; // a-f ... 97~102 -87 => 10~15\n } else if (c >= 65) {\n c -= 55; // A-F ... 65~70 -55 => 10~15\n } else {\n c -= 48; // 0-9 ... starting from charCode 48\n \n decN = decN * 10 + c;\n } // We don't know yet if its a dec or hex number\n \n \n hexN = (hexN << 4) + c;\n }\n }\n \n if (prevColon === false) {\n // Commiting last number\n if (useDec === true) {\n if (offset < end) buff[offset] = decN;\n offset++;\n } else {\n if (offset < end) buff[offset] = hexN >> 8;\n if (offset < end - 1) buff[offset + 1] = hexN & 0xff;\n offset += 2;\n }\n } else if (fill === 0) {\n // Not Standard! (standard doesn't allow multiple ::)\n // This means that a : was found at the start AND end which means the\n // end needs to be treated as 0 entry...\n if (offset < end) buff[offset] = 0;\n if (offset < end - 1) buff[offset + 1] = 0;\n offset += 2;\n } else if (fill !== -1) {\n // Non-standard! (standard doens't allow multiple ::)\n // Here we find that there has been a :: somewhere in the middle\n // and the end. To treat the end with priority we need to move all\n // written data two bytes to the right.\n offset += 2;\n \n for (let i = Math.min(offset - 1, end - 1); i >= fill + 2; i--) {\n buff[i] = buff[i - 2];\n }\n \n buff[fill] = 0;\n buff[fill + 1] = 0;\n fill = offset;\n }\n \n if (fill !== offset && fill !== -1) {\n // Move the written numbers to the end while filling the everything\n // \"fill\" to the bytes with zeros.\n if (offset > end - 2) {\n // Non Standard support, when the cursor exceeds bounds.\n offset = end - 2;\n }\n \n while (end > fill) {\n buff[--end] = offset < end && offset > fill ? buff[--offset] : 0;\n }\n } else {\n // Fill the rest with zeros\n while (offset < end) {\n buff[offset++] = 0;\n }\n }\n \n return buff;\n },\n \n decode(buff, offset) {\n offset = ~~offset;\n let result = '';\n \n for (let i = 0; i < v6Size; i += 2) {\n if (i !== 0) {\n result += ':';\n }\n \n result += (buff[offset + i] << 8 | buff[offset + i + 1]).toString(16);\n }\n \n return result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3').replace(/:{3,4}/, '::');\n }\n \n };\n exports.v6 = v6;\n const name = 'ip';\n exports.name = name;\n \n function sizeOf(ip) {\n if (v4.isFormat(ip)) return v4.size;\n if (v6.isFormat(ip)) return v6.size;\n throw Error(`Invalid ip address: ${ip}`);\n }\n \n function familyOf(string) {\n return sizeOf(string) === v4.size ? 1 : 2;\n }\n \n function encode(ip, buff, offset) {\n offset = ~~offset;\n const size = sizeOf(ip);\n \n if (typeof buff === 'function') {\n buff = buff(offset + size);\n }\n \n if (size === v4.size) {\n return v4.encode(ip, buff, offset);\n }\n \n return v6.encode(ip, buff, offset);\n }\n \n function decode(buff, offset, length) {\n offset = ~~offset;\n length = length || buff.length - offset;\n \n if (length === v4.size) {\n return v4.decode(buff, offset, length);\n }\n \n if (length === v6.size) {\n return v6.decode(buff, offset, length);\n }\n \n throw Error(`Invalid buffer size needs to be ${v4.size} for v4 or ${v6.size} for v6.`);\n }\n return \"default\" in exports ? exports.default : exports;\n})({});\nif (typeof define === 'function' && define.amd) define([], function() { return ipCodec; });\nelse if (typeof module === 'object' && typeof exports==='object') module.exports = ipCodec;\n","import crypto from 'crypto'\nimport { urlAlphabet } from './url-alphabet/index.js'\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\nlet fillPool = bytes => {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.randomFillSync(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.randomFillSync(pool)\n poolOffset = 0\n }\n poolOffset += bytes\n}\nlet random = bytes => {\n fillPool((bytes -= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let i = step\n while (i--) {\n id += alphabet[bytes[i] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n fillPool((size -= 0))\n let id = ''\n for (let i = poolOffset - size; i < poolOffset; i++) {\n id += urlAlphabet[pool[i] & 63]\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = function(name, initScope) {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = function(msg) {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"aegis-app\";\n\tvar register = function(name, version, factory, eager) {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = function(id) {\n\t\tvar handleError = function(err) { warn(\"Initialization of sharing external failed: \" + err); };\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = function(module) { return module && module.init && module.init(__webpack_require__.S[name], initScope); }\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"axios\", \"0.21.4\", function() { return function() { return __webpack_require__(/*! ./node_modules/axios/index.js */ \"./node_modules/axios/index.js\"); }; }, 1);\n\t\t\tregister(\"axios\", \"0.26.1\", function() { return function() { return __webpack_require__(/*! ./node_modules/smartystreets-javascript-sdk/node_modules/axios/index.js */ \"./node_modules/smartystreets-javascript-sdk/node_modules/axios/index.js\"); }; }, 1);\n\t\t\tregister(\"kafkajs\", \"1.16.0\", function() { return function() { return __webpack_require__(/*! ./node_modules/kafkajs/index.js */ \"./node_modules/kafkajs/index.js\"); }; }, 1);\n\t\t\tregister(\"multicast-dns\", \"7.2.5\", function() { return function() { return __webpack_require__(/*! ./node_modules/multicast-dns/index.js */ \"./node_modules/multicast-dns/index.js\"); }; }, 1);\n\t\t\tregister(\"nanoid\", \"3.3.6\", function() { return function() { return __webpack_require__(/*! ./node_modules/nanoid/index.js */ \"./node_modules/nanoid/index.js\"); }; }, 1);\n\t\t\tregister(\"smartystreets-javascript-sdk\", \"1.13.7\", function() { return function() { return __webpack_require__(/*! ./node_modules/smartystreets-javascript-sdk/index.js */ \"./node_modules/smartystreets-javascript-sdk/index.js\"); }; }, 1);\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(function() { return initPromises[name] = 1; });\n};","var parseVersion = function(str) {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=function(p){return p.split(\".\").map((function(p){return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = function(a, b) {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f \"html\"\n *\n * // Accept: text/*, application/json\n * this.types('html');\n * // => \"html\"\n * this.types('text/html');\n * // => \"text/html\"\n * this.types('json', 'text');\n * // => \"json\"\n * this.types('application/json');\n * // => \"application/json\"\n *\n * // Accept: text/*, application/json\n * this.types('image/png');\n * this.types('png');\n * // => undefined\n *\n * // Accept: text/*;q=.5, application/json\n * this.types(['html', 'json']);\n * this.types('html', 'json');\n * // => \"json\"\n *\n * @param {String|Array} types...\n * @return {String|Array|Boolean}\n * @public\n */\n\nAccepts.prototype.type =\nAccepts.prototype.types = function (types_) {\n var types = types_\n\n // support flattened arguments\n if (types && !Array.isArray(types)) {\n types = new Array(arguments.length)\n for (var i = 0; i < types.length; i++) {\n types[i] = arguments[i]\n }\n }\n\n // no types, return all requested types\n if (!types || types.length === 0) {\n return this.negotiator.mediaTypes()\n }\n\n // no accept header, return first given type\n if (!this.headers.accept) {\n return types[0]\n }\n\n var mimes = types.map(extToMime)\n var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))\n var first = accepts[0]\n\n return first\n ? types[mimes.indexOf(first)]\n : false\n}\n\n/**\n * Return accepted encodings or best fit based on `encodings`.\n *\n * Given `Accept-Encoding: gzip, deflate`\n * an array sorted by quality is returned:\n *\n * ['gzip', 'deflate']\n *\n * @param {String|Array} encodings...\n * @return {String|Array}\n * @public\n */\n\nAccepts.prototype.encoding =\nAccepts.prototype.encodings = function (encodings_) {\n var encodings = encodings_\n\n // support flattened arguments\n if (encodings && !Array.isArray(encodings)) {\n encodings = new Array(arguments.length)\n for (var i = 0; i < encodings.length; i++) {\n encodings[i] = arguments[i]\n }\n }\n\n // no encodings, return all requested encodings\n if (!encodings || encodings.length === 0) {\n return this.negotiator.encodings()\n }\n\n return this.negotiator.encodings(encodings)[0] || false\n}\n\n/**\n * Return accepted charsets or best fit based on `charsets`.\n *\n * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`\n * an array sorted by quality is returned:\n *\n * ['utf-8', 'utf-7', 'iso-8859-1']\n *\n * @param {String|Array} charsets...\n * @return {String|Array}\n * @public\n */\n\nAccepts.prototype.charset =\nAccepts.prototype.charsets = function (charsets_) {\n var charsets = charsets_\n\n // support flattened arguments\n if (charsets && !Array.isArray(charsets)) {\n charsets = new Array(arguments.length)\n for (var i = 0; i < charsets.length; i++) {\n charsets[i] = arguments[i]\n }\n }\n\n // no charsets, return all requested charsets\n if (!charsets || charsets.length === 0) {\n return this.negotiator.charsets()\n }\n\n return this.negotiator.charsets(charsets)[0] || false\n}\n\n/**\n * Return accepted languages or best fit based on `langs`.\n *\n * Given `Accept-Language: en;q=0.8, es, pt`\n * an array sorted by quality is returned:\n *\n * ['es', 'pt', 'en']\n *\n * @param {String|Array} langs...\n * @return {Array|String}\n * @public\n */\n\nAccepts.prototype.lang =\nAccepts.prototype.langs =\nAccepts.prototype.language =\nAccepts.prototype.languages = function (languages_) {\n var languages = languages_\n\n // support flattened arguments\n if (languages && !Array.isArray(languages)) {\n languages = new Array(arguments.length)\n for (var i = 0; i < languages.length; i++) {\n languages[i] = arguments[i]\n }\n }\n\n // no languages, return all requested languages\n if (!languages || languages.length === 0) {\n return this.negotiator.languages()\n }\n\n return this.negotiator.languages(languages)[0] || false\n}\n\n/**\n * Convert extnames to mime.\n *\n * @param {String} type\n * @return {String}\n * @private\n */\n\nfunction extToMime (type) {\n return type.indexOf('/') === -1\n ? mime.lookup(type)\n : type\n}\n\n/**\n * Check if mime is valid.\n *\n * @param {String} type\n * @return {String}\n * @private\n */\n\nfunction validMime (type) {\n return typeof type === 'string'\n}\n","'use strict'\n\n/**\n * Expose `arrayFlatten`.\n */\nmodule.exports = arrayFlatten\n\n/**\n * Recursive flatten function with depth.\n *\n * @param {Array} array\n * @param {Array} result\n * @param {Number} depth\n * @return {Array}\n */\nfunction flattenWithDepth (array, result, depth) {\n for (var i = 0; i < array.length; i++) {\n var value = array[i]\n\n if (depth > 0 && Array.isArray(value)) {\n flattenWithDepth(value, result, depth - 1)\n } else {\n result.push(value)\n }\n }\n\n return result\n}\n\n/**\n * Recursive flatten function. Omitting depth is slightly faster.\n *\n * @param {Array} array\n * @param {Array} result\n * @return {Array}\n */\nfunction flattenForever (array, result) {\n for (var i = 0; i < array.length; i++) {\n var value = array[i]\n\n if (Array.isArray(value)) {\n flattenForever(value, result)\n } else {\n result.push(value)\n }\n }\n\n return result\n}\n\n/**\n * Flatten an array, with the ability to define a depth.\n *\n * @param {Array} array\n * @param {Number} depth\n * @return {Array}\n */\nfunction arrayFlatten (array, depth) {\n if (depth == null) {\n return flattenForever(array, [])\n }\n\n return flattenWithDepth(array, [], depth)\n}\n","module.exports = require('./lib/index').default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isNetworkError = isNetworkError;\nexports.isRetryableError = isRetryableError;\nexports.isSafeRequestError = isSafeRequestError;\nexports.isIdempotentRequestError = isIdempotentRequestError;\nexports.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;\nexports.exponentialDelay = exponentialDelay;\nexports.default = axiosRetry;\n\nvar _isRetryAllowed = require('is-retry-allowed');\n\nvar _isRetryAllowed2 = _interopRequireDefault(_isRetryAllowed);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar namespace = 'axios-retry';\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isNetworkError(error) {\n return !error.response && Boolean(error.code) && // Prevents retrying cancelled requests\n error.code !== 'ECONNABORTED' && // Prevents retrying timed out requests\n (0, _isRetryAllowed2.default)(error); // Prevents retrying unsafe errors\n}\n\nvar SAFE_HTTP_METHODS = ['get', 'head', 'options'];\nvar IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isRetryableError(error) {\n return error.code !== 'ECONNABORTED' && (!error.response || error.response.status >= 500 && error.response.status <= 599);\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isSafeRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nfunction isIdempotentRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean | Promise}\n */\nfunction isNetworkOrIdempotentRequestError(error) {\n return isNetworkError(error) || isIdempotentRequestError(error);\n}\n\n/**\n * @return {number} - delay in milliseconds, always 0\n */\nfunction noDelay() {\n return 0;\n}\n\n/**\n * @param {number} [retryNumber=0]\n * @return {number} - delay in milliseconds\n */\nfunction exponentialDelay() {\n var retryNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n var delay = Math.pow(2, retryNumber) * 100;\n var randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay\n return delay + randomSum;\n}\n\n/**\n * Initializes and returns the retry state for the given request/config\n * @param {AxiosRequestConfig} config\n * @return {Object}\n */\nfunction getCurrentState(config) {\n var currentState = config[namespace] || {};\n currentState.retryCount = currentState.retryCount || 0;\n config[namespace] = currentState;\n return currentState;\n}\n\n/**\n * Returns the axios-retry options for the current request\n * @param {AxiosRequestConfig} config\n * @param {AxiosRetryConfig} defaultOptions\n * @return {AxiosRetryConfig}\n */\nfunction getRequestOptions(config, defaultOptions) {\n return Object.assign({}, defaultOptions, config[namespace]);\n}\n\n/**\n * @param {Axios} axios\n * @param {AxiosRequestConfig} config\n */\nfunction fixConfig(axios, config) {\n if (axios.defaults.agent === config.agent) {\n delete config.agent;\n }\n if (axios.defaults.httpAgent === config.httpAgent) {\n delete config.httpAgent;\n }\n if (axios.defaults.httpsAgent === config.httpsAgent) {\n delete config.httpsAgent;\n }\n}\n\n/**\n * Checks retryCondition if request can be retried. Handles it's retruning value or Promise.\n * @param {number} retries\n * @param {Function} retryCondition\n * @param {Object} currentState\n * @param {Error} error\n * @return {boolean}\n */\nasync function shouldRetry(retries, retryCondition, currentState, error) {\n var shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error);\n\n // This could be a promise\n if ((typeof shouldRetryOrPromise === 'undefined' ? 'undefined' : _typeof(shouldRetryOrPromise)) === 'object') {\n try {\n await shouldRetryOrPromise;\n return true;\n } catch (_err) {\n return false;\n }\n }\n return shouldRetryOrPromise;\n}\n\n/**\n * Adds response interceptors to an axios instance to retry requests failed due to network issues\n *\n * @example\n *\n * import axios from 'axios';\n *\n * axiosRetry(axios, { retries: 3 });\n *\n * axios.get('http://example.com/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Exponential back-off retry delay between requests\n * axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});\n *\n * // Custom retry delay\n * axiosRetry(axios, { retryDelay : (retryCount) => {\n * return retryCount * 1000;\n * }});\n *\n * // Also works with custom axios instances\n * const client = axios.create({ baseURL: 'http://example.com' });\n * axiosRetry(client, { retries: 3 });\n *\n * client.get('/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Allows request-specific configuration\n * client\n * .get('/test', {\n * 'axios-retry': {\n * retries: 0\n * }\n * })\n * .catch(error => { // The first request fails\n * error !== undefined\n * });\n *\n * @param {Axios} axios An axios instance (the axios object or one created from axios.create)\n * @param {Object} [defaultOptions]\n * @param {number} [defaultOptions.retries=3] Number of retries\n * @param {boolean} [defaultOptions.shouldResetTimeout=false]\n * Defines if the timeout should be reset between retries\n * @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]\n * A function to determine if the error can be retried\n * @param {Function} [defaultOptions.retryDelay=noDelay]\n * A function to determine the delay between retry requests\n */\nfunction axiosRetry(axios, defaultOptions) {\n axios.interceptors.request.use(function (config) {\n var currentState = getCurrentState(config);\n currentState.lastRequestTime = Date.now();\n return config;\n });\n\n axios.interceptors.response.use(null, async function (error) {\n var config = error.config;\n\n // If we have no information to retry the request\n if (!config) {\n return Promise.reject(error);\n }\n\n var _getRequestOptions = getRequestOptions(config, defaultOptions),\n _getRequestOptions$re = _getRequestOptions.retries,\n retries = _getRequestOptions$re === undefined ? 3 : _getRequestOptions$re,\n _getRequestOptions$re2 = _getRequestOptions.retryCondition,\n retryCondition = _getRequestOptions$re2 === undefined ? isNetworkOrIdempotentRequestError : _getRequestOptions$re2,\n _getRequestOptions$re3 = _getRequestOptions.retryDelay,\n retryDelay = _getRequestOptions$re3 === undefined ? noDelay : _getRequestOptions$re3,\n _getRequestOptions$sh = _getRequestOptions.shouldResetTimeout,\n shouldResetTimeout = _getRequestOptions$sh === undefined ? false : _getRequestOptions$sh;\n\n var currentState = getCurrentState(config);\n\n if (await shouldRetry(retries, retryCondition, currentState, error)) {\n currentState.retryCount += 1;\n var delay = retryDelay(currentState.retryCount, error);\n\n // Axios fails merging this configuration to the default configuration because it has an issue\n // with circular structures: https://github.com/mzabriskie/axios/issues/370\n fixConfig(axios, config);\n\n if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {\n var lastRequestDuration = Date.now() - currentState.lastRequestTime;\n // Minimum 1ms timeout (passing 0 or less to XHR means no timeout)\n config.timeout = Math.max(config.timeout - lastRequestDuration - delay, 1);\n }\n\n config.transformRequest = [function (data) {\n return data;\n }];\n\n return new Promise(function (resolve) {\n return setTimeout(function () {\n return resolve(axios(config));\n }, delay);\n });\n }\n\n return Promise.reject(error);\n });\n}\n\n// Compatibility with CommonJS\naxiosRetry.isNetworkError = isNetworkError;\naxiosRetry.isSafeRequestError = isSafeRequestError;\naxiosRetry.isIdempotentRequestError = isIdempotentRequestError;\naxiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;\naxiosRetry.exponentialDelay = exponentialDelay;\naxiosRetry.isRetryableError = isRetryableError;\n//# sourceMappingURL=index.js.map","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('User-Agent' in headers || 'user-agent' in headers) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers['User-Agent'] && !headers['user-agent']) {\n delete headers['User-Agent'];\n delete headers['user-agent'];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError(\n 'timeout of ' + timeout + 'ms exceeded',\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","\"use strict\";\n\n/**\n * @typedef {import('../domain/order').Order} Order\n * @typedef {string} address\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order})} - verified/corrected address\n */\n\n/**\n *\n * @type {adapterFactory}\n * @param {import(\"../services/address-service\").Address} service\n */\nexport function validateAddress(service) {\n return async function (options) {\n const {\n model: order,\n args: [callback],\n } = options;\n\n try {\n const shippingAddress = await service.validateAddress(\n order.decrypt().shippingAddress\n );\n const update = await callback(options, { shippingAddress });\n return update;\n } catch (error) {\n console.error({ func: validateAddress.name, error, options });\n }\n };\n}\n","// export function upload (filename, catalog, storagePath, readableStream) {}\n\n// export function search (filename, catalog, tags, limit, writableStream) {}\n\n// export function browse (catalog, tags, limit, writableStream) {}\n\n// export function download (fileId, writableStream) {}\n\nexport function damUploadOut (service) {\n return function (data) {\n console.log({ data })\n return {\n filename: data.args[0].filename,\n status: 'UPLOADING'\n }\n }\n}\n\nexport function damSearchOut (service) {\n return function (data) {\n return {\n tags: data.args[0].tags,\n matches: 361,\n status: 'COMPLETE'\n }\n }\n}\n\nexport function damBrowseOut (service) {\n return function (data) {\n return {\n catalog: data.args[0].catalog,\n status: 'COMPLETE'\n }\n }\n}\n\nexport function damDownloadOut (service) {\n return function (data) {\n return {\n fileId: data.args[0],\n status: 'DOWNLOADING'\n }\n }\n}\n","export const DataSourceAdapterCustomer = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomer extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n }\n\n return DataSourceCustomer\n}\n","export const DataSourceAdapterCustomFile = function (\n url,\n cacheSize,\n DataSourceFile\n) {\n /**\n * Datasource adapter for AWS Dynamo DB\n */\n class DataSourceCustomFile extends DataSourceFile {\n save (id, data) {\n super.save(id, data)\n }\n\n list (options) {\n return super.list(options)\n }\n\n serialize () {\n return false\n }\n }\n\n return DataSourceCustomFile\n}\n","'use strict'\n\nfunction getSecret () {\n return process.env.MONGODB_CREDS || { user: null, pass: null, token: null }\n}\n\nfunction archive (id) {\n console.debug('mock archive', id)\n}\n\n/**\n * Datasource adapter factory.\n * @param {string} url database url\n * @param {number} [cacheSize] number of models to keep in cache\n * @param {*} DataSource base class that enables caching\n * @returns {import(\"./datasource\").default}\n */\nexport const DataSourceAdapterMongoDb = function (\n url,\n cacheSize,\n DataSourceMongoDb\n) {\n /**\n * MongoDB adapter extends in-memory datasource to support caching.\n * The cache is always updated first, which allows the system to run\n * even when the database is offline.\n */\n class DataSourceMongoDbArchive extends DataSourceMongoDb {\n constructor (datasource, factory, name) {\n super(datasource, factory, name)\n this.url = url\n this.cacheSize = cacheSize\n this.creds = getSecret()\n }\n\n /**\n * @override\n */\n delete (id) {\n console.debug('archive', id)\n archive(id)\n }\n }\n\n return DataSourceMongoDbArchive\n}\n","\"use strict\";\n\n/**\n * @typedef {import('../domain').Model} Model\n * @typedef {string} serviceName\n *\n * @typedef {Object} EventMessage\n * @property {serviceName} eventSource\n * @property {serviceName|\"broadcast\"} eventTarget\n * @property {\"command\"|\"commandResponse\"|\"notification\"|\"import\"} eventType\n * @property {string} eventName\n * @property {string} eventTime\n * @property {string} eventUuid\n * @property {NotificationEvent|ImportEvent|CommandEvent} eventData\n *\n * @typedef {object} ImportEvent\n * @property {\"service\"|\"model\"|\"adapter\"} type\n * @property {string} url\n * @property {string} path\n * @property {string} importRemote\n *\n * @typedef {object} NotificationEvent\n * @property {string|} message\n * @property {\"utf8\"|Uint32Array} encoding\n *\n * @typedef {Object} CommandEvent\n * @property {string} commandName\n * @property {string} commandResp\n * @property {*} commandArgs\n */\n\n/**\n * @typedef {{\n * filter:function(message):Promise,\n * unsubscribe:function()\n * }} Subscription\n * @typedef {string|RegExp} topic\n * @callback eventHandler\n * @param {string} eventData\n * @typedef {eventHandler} notifyType\n * @typedef {{\n * listen:function(topic, x),\n * notify:notifyType\n * }} EventService\n * @callback adapterFactory\n * @param {EventService} service\n * @returns {function(topic, eventHandler)}\n */\nimport { Event } from \"../services/event-service\";\n\n/**\n * @type {Map>}\n */\nconst subscriptions = new Map();\n\n/**\n * Test the filter.\n * @param {string} message\n * @returns {function(string|RegExp):boolean} did the filter match?\n */\nfunction filterMatches(message) {\n return function (filter) {\n const regex = new RegExp(filter);\n const result = regex.test(message);\n if (result)\n console.debug({\n func: filterMatches.name,\n filter,\n result,\n message: message.substring(0, 100).concat(\"...\"),\n });\n return result;\n };\n}\n\n/**\n * @typedef {string} message\n * @typedef {string|RegExp} topic\n * @param {{\n * id:string,\n * callback:function(message,Subscription),\n * topic:topic,\n * filter:string|RegExp,\n * once:boolean,\n * model:import(\"../domain\").Model\n * }} options\n */\nconst Subscription = function ({ id, callback, topic, filters, once, model }) {\n return {\n /**\n * unsubscribe from topic\n */\n unsubscribe() {\n subscriptions.get(topic).delete(id);\n },\n\n getId() {\n return id;\n },\n\n getModel() {\n return model;\n },\n\n getSubscriptions() {\n return [...subscriptions.entries()];\n },\n\n /**\n * Filter message and invoke callback\n * @param {string} message\n */\n async filter(message) {\n if (filters) {\n // Every filter must match.\n if (filters.every(filterMatches(message))) {\n if (once) {\n // Only looking for 1 msg, got it.\n this.unsubscribe();\n }\n await callback({ message, subscription: this });\n return;\n }\n // no match\n return;\n }\n // no filters defined, just invoke the callback.\n await callback({ message, subscription: this });\n },\n };\n};\n\n/**\n * Listen for external events with default event service if none specified.\n * @type {adapterFactory}\n * @param {import('../services/event-service').Event} [service] - has default service\n */\nexport function listen(service = Event) {\n return async function (options) {\n const {\n model,\n args: [arg],\n } = options;\n\n const subscription = Subscription({ model, ...arg });\n\n if (subscriptions.has(arg.topic)) {\n subscriptions.get(arg.topic).set(arg.id, subscription);\n return subscription;\n }\n\n subscriptions.set(arg.topic, new Map().set(arg.id, subscription));\n\n if (!service.listening) {\n service.listen(/Channel/, async function ({ topic, message }) {\n if (subscriptions.has(topic)) {\n subscriptions.get(topic).forEach(async subscription => {\n await subscription.filter(message);\n });\n }\n });\n }\n return subscription;\n };\n}\n\n/**\n * @type {adapterFactory}\n * @returns {function(topic, eventData)}\n */\nexport function notify(service = Event) {\n return async function ({ model, args: [topic, message] }) {\n console.debug(\"sending...\", { topic, message: JSON.parse(message) });\n await service.notify(topic, message);\n return model;\n };\n}\n","'use strict'\n\nexport * from './service-locator'\nexport * from './websocket-adapter'\nexport * from './address-adapter'\nexport * from './event-adapter'\nexport * from './inventory-adapter'\nexport * from './order-adapter'\nexport * from './payment-adapter'\nexport * from './shipping-adapter'\nexport * from './qe-public-ipaddr'\nexport * from './wasm-public-ipaddr'\nexport * from './dam-api'\nexport * from './ticket-master'\n\n/**\n * @typedef {import('../domain').Model} Model\n * @typedef {function(function(eventCallback):Promise)} adapterFunction\n */\n","'use strict'\n\n/**\n * @typedef {string|RegExp} topic\n * @callback eventCallback\n * @param {string} message\n * @param {{\n * getModel:function():object,\n * unsubscribe:function()\n * }} subscription\n * @typedef {eventCallback} shipOrderType\n * @param topic,\n * @param eventCallback\n * @typedef {{\n * shipOrder:shipOrderType,\n * trackShipment:function(),\n * verifyDelivery:function()\n * }} InventoryAdapter\n * @typedef {import('../domain/order').Order} Order\n * @typedef {InventoryAdapter} service \n * @typedef {{\n * listen:function(topic,RegExp,eventCallback)\n * notify:function(topic,eventCallback)\n * }} event\n * @callback adapterFactory\n * @param {service} service\n * @param {event} event\n * @returns {function({\n * model:Order,\n * resolve:function()\n * ,args:[\n * eventCallback, \n * options:{}]\n * })}\n \n }]})} \n *\n */\n\n/**\n * @type {adapterFactory}\n */\nexport function pickOrder (service) {\n return function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n return new Promise(function (resolve, reject) {\n // start listening first then send the event\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: 'orderChannel',\n filters: [order.orderNo, 'orderPicked', 'warehouse_addr'],\n callback: async ({ message }) => {\n try {\n const event = JSON.parse(message)\n console.log('recieved event: ', event)\n const pickupAddress = event.eventData.warehouse_addr\n const newOrder = await callback(options, { pickupAddress })\n resolve(newOrder) // hold promise until we get an answer\n } catch (error) {\n reject(error)\n }\n }\n })\n .then(() => {\n return order.notify(\n 'inventoryChannel',\n JSON.stringify({\n eventType: 'Command',\n eventTime: new Date().toISOString(),\n eventSource: 'orderService',\n eventData: {\n respChannel: 'orderChannel',\n commandName: 'pickOrder',\n commandArgs: {\n lineItems: order.orderItems,\n externalId: order.orderNo\n }\n }\n })\n )\n })\n .catch(reason => {\n throw new Error(reason)\n })\n })\n }\n}\n","\"use strict\";\n\nconst axios = require(\"axios\");\n\nexport class OrderAdapter {\n constructor() {}\n\n addOrder({\n customerId,\n orderItems = [],\n creditCardNumber,\n shippingAddress,\n billingAddress,\n firstName,\n lastName,\n email,\n } = {}) {\n this.orderInfo = {\n customerId,\n orderItems,\n creditCardNumber,\n shippingAddress,\n billingAddress,\n firstName,\n lastName,\n email,\n };\n return this;\n }\n\n addOrderItem(itemId, price, qty = 1) {\n if (![typeof price, typeof qty].indexOf(\"number\") === 0) {\n throw new Error(\"qty and price must be numbers\");\n }\n if (!itemId || typeof itemId !== \"string\") {\n throw new Error(\"itemId must be a non-null string\");\n }\n this.orderInfo.orderItems.push({ itemId, price, qty });\n return this;\n }\n\n async createOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n\n async submitOrder(orderId = this.orderId) {\n throw new Error(\"unimplemented abstract method\");\n }\n\n async getOrder(orderId = this.orderId) {\n throw new Error(\"unimplememnted abstract method\");\n }\n\n completeOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n\n cancelOrder() {\n throw new Error(\"unimplemented abstract method\");\n }\n}\n\nexport class RestOrderAdapter extends OrderAdapter {\n constructor(url) {\n super();\n this.url = url;\n }\n\n /**\n * @override\n */\n async createOrder() {\n if (!this.orderInfo) {\n throw new Error(\"there is no order data\");\n }\n return axios\n .post(this.url, this.orderInfo)\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n }\n )\n .catch(e => console.log(e));\n }\n\n /**\n * @override\n * @param {*} orderId\n */\n async submitOrder(orderId = this.orderId) {\n if (!this.orderInfo) {\n throw new Error(\"there is no order data\");\n }\n return axios.patch(this.url + orderId, { orderStatus: \"APPROVED\" }).then(\n () => this,\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n async getOrder(orderId = this.orderId) {\n return axios.get(this.url + orderId).then(\n response => {\n console.log(response.data);\n this.order = response.data;\n return this.order;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n completeOrder() {\n return axios\n .patch(this.url + orderId, {\n orderStatus: \"COMPLETE\",\n proofOfDelivery: pod,\n })\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n\n cancelOrder() {\n return axios\n .patch(this.url + orderId, {\n orderStatus: \"CANCELED\",\n cancelReason: reason,\n })\n .then(\n response => {\n this.orderId = response.data.modelId;\n return this;\n },\n error => {\n console.error(error.response.data);\n throw new Error(error);\n }\n );\n }\n}\n\nexport class GraphQlOrderAdapter extends OrderAdapter {\n /**\n * @override\n */\n createOrder() {}\n submitOrder() {}\n fillOrder() {}\n shipOrder() {}\n trackShipment() {}\n verifyDelivery() {}\n completeOrder() {}\n cancelOrder() {}\n}\n","'use strict'\n\n/**\n * @typedef {import('../domain/order').Order} Order\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order,parms:any[]})}\n */\n\n/**\n * @type {adapterFactory}\n * @param {import(\"../services/payment-service\").PaymentService} service\n */\nexport function authorizePayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n const paymentAuthorization = await service.authorizePayment(\n order.orderNo,\n 12.0,\n 'src',\n 'ibm',\n false\n )\n const paymentStatus = 'APPROVED'\n return callback(options, { paymentStatus })\n }\n}\n\n/**\n * @type {adapterFactory}\n */\nexport function completePayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n const confirmationCode = await service.completePayment(order)\n const newOrder = await callback(options, { confirmationCode })\n return newOrder\n }\n}\n/**\n * @type {adapterFactory}\n */\nexport function refundPayment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n await service.refundPayment(order)\n const newOrder = await callback(options)\n return newOrder\n }\n}\n","import http from 'http'\n\n/**\n *\n * @returns\n */\nexport function qeGetPublicIpAddressOut () {\n return async function () {\n const buffer = []\n return new Promise(resolve => {\n http.get(\n {\n hostname: 'checkip.amazonaws.com',\n method: 'get'\n },\n response => {\n response.on('data', chunk => buffer.push(chunk))\n response.on('end', () => {\n resolve({ address: buffer.join('') })\n })\n }\n )\n })\n }\n}\n","'use strict'\n\nimport Dns from 'multicast-dns'\n\nconst debug = /true/i.test(process.env.DEBUG)\n\nexport class ServiceLocator {\n constructor ({\n name,\n serviceUrl,\n primary = false,\n backup = false,\n maxRetries = 20,\n retryInterval = 8000\n } = {}) {\n this.url = serviceUrl\n this.name = name\n this.dns = Dns()\n this.isPrimary = primary\n this.isBackup = backup\n this.maxRetries = maxRetries\n this.retryInterval = retryInterval\n }\n\n runningAsService () {\n return this.isPrimary || (this.isBackup && this.activateBackup)\n }\n\n /**\n * Query DNS for the webswitch service.\n * Recursively retry by incrementing a\n * counter we pass to ourselves on the\n * stack. Once the URL is populated, exit.\n *\n * @param {number} retries number of query attempts\n * @returns\n */\n ask (retries = 0) {\n // have we found the url?\n if (this.url) {\n console.log('url found')\n return\n }\n\n // if designated as backup, takeover for primary after maxRetries\n if (retries > this.maxRetries && this.isBackup) {\n this.activateBackup = true\n this.answer()\n return\n }\n debug && console.debug('looking for srv %s retries: %d', this.name, retries)\n // then query the service name\n this.dns.query({\n questions: [\n {\n name: this.name,\n type: 'SRV'\n }\n ]\n })\n\n // keep asking\n setTimeout(() => this.ask(++retries), this.retryInterval)\n }\n\n answer () {\n this.dns.on('query', query => {\n debug && console.debug('got a query packet:', query)\n\n const fromClient = query.questions.find(\n question => question.name === this.name\n )\n\n if (fromClient && this.runningAsService()) {\n const url = new URL(this.url)\n const answer = {\n answers: [\n {\n name: this.name,\n type: 'SRV',\n data: {\n port: url.port,\n target: url.hostname\n }\n }\n ]\n }\n console.info('advertising this location', url)\n this.dns.respond(answer)\n }\n })\n }\n\n listen () {\n console.log('resolving service url')\n return new Promise(resolve => {\n const buildUrl = response => {\n debug && console.debug({ answers: response.answers })\n\n const fromServer = response.answers.find(\n answer => answer.name === this.name && answer.type === 'SRV'\n )\n\n if (fromServer) {\n const { target, port } = fromServer.data\n const protocol = port === 443 ? 'wss' : 'ws'\n this.url = `${protocol}://${target}:${port}`\n\n console.info({\n msg: 'found dns service record for',\n service: this.name,\n url: this.url\n })\n\n this.dns.off('response', buildUrl)\n resolve(this.url)\n }\n }\n console.log('looking for service', this.name)\n this.dns.on('response', buildUrl)\n this.ask()\n })\n }\n}\n\nlet locator\nexport function serviceLocatorInit () {\n return async function ({ args: [options] }) {\n console.debug('serviceLocatorInit called')\n locator = new ServiceLocator(options)\n }\n}\n\nexport function serviceLocatorAsk () {\n return async function () {\n return locator.listen()\n }\n}\n\nexport function serviceLocatorAnswer () {\n return async function () {\n return locator.answer()\n }\n}\n","'use strict'\n\n/**\n * @callback portCallback\n * @param {{options:{}}}\n * @param {{payload:{[key]:string}}}\n */\n\n/**\n * @typedef {string} message\n * @callback eventCallback\n * @param {string} message\n * @param {{\n * unsubscribe:function(),\n * filter:function(message):boolean\n * }} subscription\n */\n\n/**\n * @typedef {import('../domain/order').Order} Order\n */\n\n/**\n * @typedef {import(\"../services/shipping-service\").shippingService} shippingService\n */\n\n/**\n * @typedef {{\n * listen:function(topic,RegExp,portCallback)\n * notify:function(topic,eventCallback)\n * }} event\n */\n\n/**\n * @callback adapterFactory\n * @param {service} service\n * @returns {function({model:Order,args:[portCallback]}):Order}\n */\n\nconst ORDER_SERVICE = 'orderService'\nconst ORDER_TOPIC = 'orderChannel'\n\nconst handleError = (error, reject = null, func = null) => {\n console.error({ file: __filename, func, error })\n if (reject) reject(error)\n}\n\n/**\n * Call `shipOrder` to request shipment of the order items.\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n * @returns {function(options):Promise}\n * Return a promise that is resolved once we receive\n * a response message from the shipping service. Start\n * listening for the response first and then send the\n * request message.\n *\n */\nexport function shipOrder (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n * Called by the event listener when the shipOrder\n * response message arrives. Resolve the promise\n * the caller has been waiting on since we sent\n * the request message.\n * @param {function(Order)} resolve\n * @param {function(Error)} reject\n * @returns {function(message):Promise}\n */\n function shipOrderCallback (resolve, reject) {\n return async function ({ message }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event... ', event)\n const payload = service.getPayload(shipOrder.name, event)\n const updated = await callback(options, payload)\n resolve(updated)\n } catch (error) {\n handleError(error, reject, shipOrderCallback.name)\n }\n }\n }\n\n /**\n * Send the shipOrder event to the shipping service.\n */\n function callShipOrder () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.shipOrder({\n shipTo: order.decrypt().shippingAddress,\n shipFrom: order.pickupAddress,\n lineItems: order.orderItems,\n signature: order.signatureRequired,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(function (resolve, reject) {\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: ORDER_TOPIC,\n filters: [order.orderNo, 'orderShipped', 'shipmentId'],\n callback: shipOrderCallback(resolve, reject)\n })\n .then(callShipOrder)\n .catch(handleError)\n })\n }\n}\n\n/**\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n */\nexport function trackShipment (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n *\n * @param {function(Order)} resolve resolve the promise\n * @param {function(Error)} reject reject promise\n */\n function trackShipmentCallback (resolve, reject) {\n return async function ({ message, subscription }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event...', event)\n const payload = service.getPayload(trackShipment.name, event)\n const updated = await callback(options, payload)\n if (updated.trackingStatus === 'orderDelivered') {\n subscription.unsubscribe()\n resolve(updated)\n }\n } catch (error) {\n handleError(error, reject, trackShipment.name)\n }\n }\n }\n\n function callTrackShipment () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.trackShipment({\n shipmentId: order.shipmentId,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(async function (resolve, reject) {\n return order\n .listen({\n once: false,\n model: order,\n id: order.orderNo,\n topic: ORDER_TOPIC,\n filters: [order.orderNo, 'trackingId', 'trackingStatus'],\n callback: trackShipmentCallback(resolve, reject)\n })\n .then(callTrackShipment)\n .catch(handleError)\n })\n }\n}\n\n/**\n * @param {import('../services/shipping-service').shippingService} service\n * @type {adapterFactory}\n */\nexport function verifyDelivery (service) {\n return async function (options) {\n const {\n model: order,\n args: [callback]\n } = options\n\n /**\n *\n * @param {function(Order)} resolve\n * @param {function(Error)} reject\n * @returns\n */\n function verifyDeliveryCallback (resolve, reject) {\n return async function ({ message }) {\n try {\n const event = JSON.parse(message)\n console.debug('received event...', event)\n const payload = service.getPayload(verifyDelivery.name, event)\n const updated = await callback(options, payload)\n resolve(updated)\n } catch (e) {\n handleError(e, reject, verifyDeliveryCallback.name)\n }\n }\n }\n\n function callVerifyDelivery () {\n return order.notify(\n service.topic,\n JSON.stringify(\n service.verifyDelivery({\n trackingId: order.trackingId,\n externalId: order.orderNo,\n requester: ORDER_SERVICE,\n respondOn: ORDER_TOPIC\n })\n )\n )\n }\n\n return new Promise(async function (resolve, reject) {\n return order\n .listen({\n once: true,\n model: order,\n id: order.orderNo,\n topic: 'orderChannel',\n filters: [order.orderNo, 'deliveryVerified', 'proofOfDelivery'],\n callback: verifyDeliveryCallback(resolve, reject)\n })\n .then(callVerifyDelivery)\n .catch(handleError)\n })\n }\n}\n","export function tmListEventsOut (service) {\n return async function (data) {\n try {\n const key = data.args[0].apiKey\n const url = `https://app.ticketmaster.com/discovery/v2/events.json?apikey=${key}`\n return await (await fetch(url)).json()\n } catch (error) {\n console.error({ fn: tmListEventsOut.name, error })\n throw error\n }\n }\n}\n","import http from 'http'\n\nexport function wasmGetPublicIpAddress () {\n return async function () {\n const chunks = []\n return new Promise(resolve => {\n http.get(\n {\n hostname: 'checkip.amazonaws.com',\n method: 'get'\n },\n res => {\n res.on('data', chunk => chunks.push(chunk))\n res.on('end', function () {\n resolve({ address: chunks.join('').trim() })\n })\n }\n )\n })\n }\n}\n","'use strict'\n\nimport WebSocket from 'ws'\n/** @type {WebSocket} */\nlet socket\nconst useBinary = () => socket.binaryType === 'arraybuffer'\n\n/**\n * use binary messages\n */\nconst primitives = {\n encode: {\n object: msg => Buffer.from(JSON.stringify(msg)),\n string: msg => Buffer.from(JSON.stringify(msg)),\n number: msg => Buffer.from(JSON.stringify(msg)),\n symbol: msg => console.error('unsupported', msg),\n undefined: msg => console.error('undefined', msg)\n },\n decode: {\n object: msg => JSON.parse(Buffer.from(msg).toString()),\n string: msg => JSON.parse(Buffer.from(msg).toString()),\n number: msg => JSON.parse(Buffer.from(msg).toString()),\n symbol: msg => console.error('unsupported', msg),\n undefined: msg => console.error('undefined', msg)\n }\n}\n\nexport function websocketConnect () {\n return function ({ args: [url, options] }) {\n if (socket) return socket\n if (url) {\n socket = new WebSocket(url, options)\n console.debug('connected', url)\n if (options.useBinary) socket.binaryType = 'arraybuffer'\n return socket\n }\n throw new Error('missing url', url)\n }\n}\n\nfunction encode (msg) {\n if (useBinary()) return primitives.encode[typeof msg](msg)\n return msg\n}\n\nfunction decode (msg) {\n if (useBinary()) return primitives.decode[typeof msg](msg)\n return msg\n}\n\nexport function websocketSend () {\n return function ({ args: [msg, options = {}] }) {\n if (socket?.readyState === socket?.OPEN && socket?.bufferedAmount < 1) {\n socket.send(\n encode(msg),\n useBinary() ? { ...options, binary: true } : options\n )\n return true\n }\n return false\n }\n}\n\nexport function websocketClose () {\n return function ({ args: [code, reason] }) {\n if (socket) return socket.close(code, reason)\n }\n}\n\nexport function websocketPing () {\n return function ({ args: [options] }) {\n if (socket) return socket.ping(options)\n }\n}\n\nexport function websocketOnMessage () {\n return function ({ args: [callback] }) {\n if (socket) return socket.on('message', msg => callback(decode(msg)))\n }\n}\n\nexport function websocketOnClose () {\n return function ({ args: [callback] }) {\n if (socket) socket.onclose = callback\n }\n}\n\nexport function websocketOnOpen () {\n return async function ({ args: [callback] }) {\n if (socket) socket.onopen = callback\n }\n}\n\nexport function websocketOnPong () {\n return function ({ args: [callback] }) {\n if (socket) socket.on('pong', callback)\n }\n}\n\nexport function websocketStatus () {\n return function ({ args: [callback] }) {\n if (socket) return socket.readyState\n }\n}\n\nexport function websocketOnError () {\n return function ({ args: [callback] }) {\n if (socket) return socket.on('error', err => callback(err))\n }\n}\n\nexport function websocketTerminate () {\n return function () {\n if (socket) return socket.terminate()\n }\n}\n","'use strict'\n\nimport {\n validateModel,\n freezeProperties,\n validateProperties,\n requireProperties\n} from '../util/mixins'\nimport { makeCustomerFactory, okToDelete } from '../models/customer'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterCustomer } from '../../adapters/datasources/datasource-adapter-customer'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Customer = {\n modelName: 'customer',\n endpoint: 'customers',\n dependencies: { uuid: () => nanoid(8) },\n factory: makeCustomerFactory,\n validate: validateModel,\n onDelete: okToDelete,\n // datasource: {\n // factory: DataSourceAdapterCustomer,\n // cacheSize: 4000,\n // baseClass: 'DataSourceFile'\n // },\n mixins: [\n freezeProperties('customerId'),\n requireProperties(\n 'firstName',\n 'lastName',\n 'email',\n 'shippingAddress',\n 'billingAddress',\n 'creditCardNumber'\n ),\n validateProperties([\n {\n propKey: 'email',\n // unique: { encrypted: true },\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n }\n ])\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'customerId'\n }\n },\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n ports: {\n runFibonacciCust: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n },\n doesFieldExist: {\n service: 'customer',\n type: 'inbound',\n timeout: 0\n }\n },\n accessControlList: {\n customer: {\n allow: 'read',\n type: 'relation',\n desc: 'Allow orders to see customers.'\n }\n }\n}\n","export * from './webswitch' // always export this\nexport * from './order'\nexport * from './customer'\nexport * from './inventory'\nexport * from './todo'\n// export * from './user'\n// export * from './query-engine'\n// export * from './dam-api'\n// export * from './ticket-master'\n// export * from './access-controller'\n","'use strict'\n\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\nimport {\n makeInventoryFactory,\n assetTypes,\n properties,\n categories\n} from '../models/inventory'\n\nimport {\n requireProperties,\n freezeProperties,\n validateProperties\n} from '../util/mixins'\n\n/**\n * @type {import(\"../domain/order\").ModelSpecification}\n */\nexport const Inventory = {\n modelName: 'inventory',\n endpoint: 'inventory',\n dependencies: {},\n factory: makeInventoryFactory,\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n mixins: [\n requireProperties('name', 'inStock', 'category', 'price', 'purchaseOrder'),\n validateProperties([\n {\n propKey: 'inStock',\n typeof: 'number',\n maxnum: 99999\n },\n {\n propKey: 'category',\n values: categories\n },\n {\n propKey: 'assetType',\n values: assetTypes\n },\n {\n propKey: 'properties',\n isValid: (_obj, prop) => prop.every(p => properties.includes(p))\n },\n {\n propKey: 'price',\n typeof: 'number',\n maxnum: 999.99\n }\n ]),\n freezeProperties('*')\n ],\n relations: {\n orders: {\n modelName: 'order',\n type: 'oneToMany',\n foreignKey: 'itemId',\n desc: 'many items per order'\n }\n }\n}\n","'use strict'\n\nimport {\n makeOrderFactory,\n readyToDelete,\n handleOrderEvent,\n orderShipped,\n paymentCompleted,\n OrderStatus,\n recalcTotal,\n requiredForCompletion,\n statusChangeValid,\n freezeOnApproval,\n freezeOnCompletion,\n orderTotalValid,\n returnInventory,\n returnShipment,\n refundPayment,\n returnDelivery,\n cancelPayment,\n updateSignature,\n requiredForGuest,\n requiredForApproval,\n approve,\n cancel,\n OrderError,\n orderPicked\n} from '../models/order'\n\nimport {\n requireProperties,\n freezeProperties,\n updateProperties,\n validateProperties,\n validateModel\n} from '../util/mixins'\n\nimport { nanoid } from 'nanoid'\nimport { DataSourceAdapterMongoDb } from '../../adapters/datasources/datasource-mongodb'\n\n/**\n * @type {import('../domain/index').ModelSpecification}\n */\nexport const Order = {\n endpoint: 'orders',\n factory: makeOrderFactory,\n domain: 'order',\n // datasource: {\n // factory: DataSourceAdapterMongoDb,\n // url: 'mongodb://127.0.0.1:27017',\n // cacheSize: 4000,\n // baseClass: 'DataSourceMongoDb'\n // },\n dependencies: { uuid: () => nanoid(8) },\n mixins: [\n requireProperties(\n 'orderItems',\n requiredForGuest([\n 'lastName',\n 'firstName',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'email'\n ]),\n requiredForApproval('paymentStatus'),\n requiredForCompletion('proofOfDelivery')\n ),\n freezeProperties(\n 'orderNo',\n 'customerId',\n freezeOnApproval([\n 'email',\n 'lastName',\n 'firstName',\n 'orderItems',\n 'orderTotal',\n 'billingAddress',\n 'shippingAddress',\n 'creditCardNumber',\n 'paymentStatus'\n ]),\n freezeOnCompletion('*')\n ),\n updateProperties([\n {\n propKey: 'orderItems',\n update: recalcTotal\n },\n {\n propKey: 'orderItems',\n update: updateSignature\n }\n ]),\n validateProperties([\n {\n propKey: 'orderStatus',\n values: Object.values(OrderStatus),\n isValid: statusChangeValid\n },\n {\n propKey: 'orderTotal',\n maxnum: 99999.99,\n isValid: orderTotalValid\n },\n {\n propKey: 'email',\n regex: 'email'\n },\n {\n propKey: 'creditCardNumber',\n regex: 'creditCard'\n },\n {\n propKey: 'phone',\n regex: 'phone'\n }\n ])\n // allowProperties([fibonacci, time, result])\n ],\n validate: validateModel,\n onDelete: readyToDelete,\n eventHandlers: [handleOrderEvent],\n ports: {\n listen: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n notify: {\n service: 'Event',\n type: 'outbound',\n timeout: 0\n },\n validateAddress: {\n service: 'Address',\n type: 'outbound',\n keys: 'shippingAddress',\n producesEvent: 'addressValidated',\n disabled: true\n },\n authorizePayment: {\n service: 'Payment',\n type: 'outbound',\n keys: 'paymentStatus',\n consumesEvent: 'startWorkflow',\n producesEvent: 'paymentAuthorized',\n undo: cancelPayment,\n disabled: true\n },\n pickOrder: {\n service: 'Inventory',\n type: 'outbound',\n keys: 'pickupAddress',\n callback: orderPicked,\n consumesEvent: 'itemsAvailable',\n producesEvent: 'orderPicked',\n undo: returnInventory,\n circuitBreaker: {\n portTimeout_pickOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 5000\n }\n }\n },\n shipOrder: {\n service: 'Shipping',\n type: 'outbound',\n callback: orderShipped,\n consumesEvent: 'orderPicked',\n producesEvent: 'orderShipped',\n undo: returnShipment,\n circuitBreaker: {\n portTimeout_shipOrder_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n },\n portRetryFailed_order: {\n callVolume: 3,\n errorRate: 2,\n intervalMs: 60000,\n fallbackFn: cancel\n },\n default: {\n callVolume: 3,\n errorRate: 3,\n intervalMs: 60000\n }\n }\n },\n trackShipment: {\n service: 'Shipping',\n type: 'outbound',\n keys: ['trackingStatus', 'trackingId'],\n consumesEvent: 'orderShipped',\n producesEvent: 'orderDelivered',\n circuitBreaker: {\n portRetryFailed_order: {\n callVolume: 2,\n errorRate: 1,\n intervalMs: 60000\n }\n }\n },\n verifyDelivery: {\n service: 'Shipping',\n type: 'outbound',\n keys: 'proofOfDelivery',\n consumesEvent: 'orderDelivered',\n producesEvent: 'deliveryVerified',\n undo: returnDelivery\n },\n completePayment: {\n service: 'Payment',\n type: 'outbound',\n callback: paymentCompleted,\n consumesEvent: 'deliveryVerified',\n producesEvent: 'orderComplete',\n undo: refundPayment\n },\n cancelShipment: {\n service: 'Shipping',\n type: 'outbound'\n },\n refundPayment: {\n service: 'Payment',\n type: 'outbound'\n },\n cancelOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['post']\n },\n approveOrders: {\n service: 'Order',\n type: 'inbound',\n timeout: 0,\n methods: ['patch']\n },\n trackAsyncContext: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n customHttpStatus: {\n service: 'Telemetry',\n type: 'inbound',\n timeout: 0\n },\n testContainsMany: {\n service: 'Inventory',\n type: 'inbound',\n timeout: 0\n },\n runFibonacciJs: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n getFieldList: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n },\n createModelEvent: {\n service: 'Test',\n type: 'inbound',\n timeout: 0\n }\n },\n relations: {\n customer: {\n modelName: 'customer',\n type: 'manyToOne',\n foreignKey: 'customerId',\n desc: 'Many orders per customer, just one customer per order'\n },\n inventory: {\n modelName: 'inventory',\n type: 'containsMany',\n foreignKey: 'itemId',\n arrayKey: 'orderItems',\n desc: 'An order contains a list of inventory items to ship.'\n }\n },\n routes: [\n {\n path: '/orders',\n get: async (req, res, ports) =>\n ports.listModels({\n writable: res,\n query: req.query\n }),\n\n post: async (req, res, ports) => {\n try {\n const result = await ports.createModel(req.body)\n res\n .status(200)\n .json({ message: 'ok', ctx: result.context, id: result.id })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n }\n },\n {\n path: '/orders/:id',\n get: async (req, res, ports) => ports.findModel(req.params.id),\n patch: async (req, res, ports) => {\n try {\n const result = await ports.editModel({\n id: req.params.id,\n changes: req.body\n })\n res.status(200).json({ message: 'ok', ctx: result.context })\n } catch (error) {\n throw new OrderError(error, 404)\n }\n },\n delete: async (req, res, ports) => {\n ports.removeModel(req.params.id)\n res.status(200).json({ message: 'ok' })\n }\n }\n ],\n commands: {\n decrypt: {\n command: 'decrypt',\n acl: ['read', 'decrypt']\n },\n approve: {\n command: approve,\n acl: ['write', 'approve']\n },\n cancel: {\n command: cancel,\n acl: ['write', 'cancel']\n },\n runFibonacci: {\n command: model => {\n const start = Date.now()\n function fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n }\n const param = parseFloat(model.fibonacci)\n return {\n result: fibonacci(Number.isNaN(param) ? 10 : param),\n time: Date.now() - start\n }\n },\n acl: ['read', 'write']\n }\n },\n serializers: [\n {\n on: 'deserialize',\n key: 'creditCardNumber',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n },\n {\n on: 'deserialize',\n key: 'shippingAddress',\n type: 'string',\n value: (key, value) => decrypt(value),\n enabled: false\n }\n // {\n // on: 'deserialize',\n // key: 'billingAddress',\n // type: 'string',\n // value: (key, value) => decrypt(value),\n // enabled: false\n // }\n ]\n}\n","'use strict'\n\nimport { DataSourceAdapterCustomFile } from '../../adapters/datasources/datasource-adapter-file'\nimport { makeToDoFactory } from '../models/todo'\nimport { nanoid } from 'nanoid'\n\n/**\n * @type {import('../index').ModelSpecification}\n */\nexport const ToDo = {\n modelName: 'todo',\n endpoint: 'todo',\n dependencies: { uuid: nanoid },\n factory: makeToDoFactory,\n datasource: {\n factory: DataSourceAdapterCustomFile,\n cacheSize: 4000,\n baseClass: 'DataSourceFile'\n }\n}\n","'use strict'\n\nimport { makeClient } from '../models/webswitch'\n\n/**\n * @type {import('../domain').ModelSpecification}\n */\nexport const WebSwitch = {\n modelName: 'webswitch',\n endpoint: 'appfabric',\n factory: makeClient,\n internal: true,\n ports: {\n serviceLocatorInit: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAsk: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n serviceLocatorAnswer: {\n service: 'serviceLocator',\n type: 'outbound',\n timeout: 0\n },\n websocketConnect: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketPing: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketSend: {\n service: 'websocket',\n type: 'outbound',\n timeout: 3000\n },\n websocketClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketStatus: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketTerminate: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnClose: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnOpen: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnMessage: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnError: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n },\n websocketOnPong: {\n service: 'websocket',\n type: 'outbound',\n timeout: 0\n }\n }\n}\n","'use strict'\n\n/**\n * @typedef {string} eventName\n */\n\n/**\n * @typedef Model\n * @property {string} _Symbol_id - immutable/private uuid\n * @property {string} _Symbol_modelName - immutable/private name\n * @property {string} _Symbol_createTime - immutable/private createTime\n * @property {onUpdate} _Symbol_onUpdate - immutable/private update function\n * @property {onDelete} _Symbol_onDelete\n * @property {function(Object)} update - use this function to update model\n * specify changes in an object\n * @property {function()} toJSON - de/serialization logic\n * @property {function(eventName,function(eventName,Model):void)} addListener listen for domain events\n * @property {function(eventName,Model):Promise} emit emit domain event\n * @property {function(function():Promise):Promise} [port] - when a\n * port is configured, the framework generates a function to invoke it. When data\n * arrives on the port, depending on the implementation, the port's adapter invokes\n * the callback specified in the port configuration, or as an argument to the port\n * function. The callback returns an updated Model, and control is returned to the\n * caller. Optionally, an event is fired to trigger the next port function to run\n * @property {function():Promise} [relation] - when you configure a relation,\n * the framework generates a function that your code can call to run the query\n * @property {function(*):*} [command] - the framework will call any model method\n * you specify when passed as a parameter or query in an API call.\n */\n\n/**\n * @callback onUpdate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onDelete\n * @param {Model} model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback validate called to handle model updates\n * @param {Model} model\n * @param {Object} changes\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @callback onLoad\n * @param {Model} savedModel rehydrated model\n * @returns {Model | Error} updated model or throw\n */\n\n/**\n * @typedef {string} service - name of the service object to inject in adapter\n * @typedef {number} timeout - call to adapter will timeout after `timeout` milliseconds\n *\n * @typedef {{\n * [x: string]: {\n * service: service,\n * timeout?: timeout,\n * callback?: function({model: Model})\n * errorCallback?: function({model: Model, port: string, error:Error}),\n * timeoutCallback?: function({model: Model, port: string}),\n * consumesEvent?:string,\n * producesEvent?:string,\n * type?:'inbound'|'outbound',\n * disabled?: boolean,\n * adapter?: string,\n * circuitBreaker?: thresholds\n * }\n * }} ports - input/output ports for the domain\n */\n\n/**\n * @typedef {{\n * [x:string]: {\n * errorRate:number\n * callVolume:number,\n * intervalMs:number,\n * fallbackFn:function()\n * },\n * }} thresholds - thresholds for different errors\n */\n\n/**\n * @typedef {{\n * [x: string]: {\n * modelName:string,\n * type:\"oneToMany\"|\"oneToOne\"|\"manyToOne\",\n * foreignKey:any,\n * }\n * }} relations - define related domain entities\n *\n * @typedef {Array>} eventHandler - callbacks invoked to handle domain and\n * application events\n */\n\n/**\n *\n * @typedef {string} key\n * @typedef {*} value\n */\n\n/**\n * @typedef {{\n * on: \"serialize\" | \"deserialize\",\n * key: string | RegExp | \"*\" | (function(key,value):boolean)\n * type: \"string\" | \"object\" | \"number\" | \"function\" | \"any\" | (function(key,value):boolean)\n * value(key, value):value\n * }} serializer\n */\n/**\n * @typedef {{\n * [x:string]: {\n * allow:string|function(*):boolean|Array\n * deny:string|function(*):boolean|Array\n * type:\"role\"|\"relation\"|\"command\"\n * desc?:string\n * }\n * }} accessControlList\n */\n/**\n * @typedef {{\n * [x: string]: {\n * command:string|function(Model):Promise,\n * acl:accessControlList[]\n * }\n * }} commands - configure functions to execute when specified in a\n * URL parameter or query of the auto-generate REST API\n */\n/**\n * @callback controller\n * @param {Request} req\n * @param {Response} res\n */\n\n/**\n * @typedef {{\n * [path: string]: {\n * get?: controller,\n * post?: controller,\n * patch?: controller,\n * delete?:controller\n * }\n * }} endpoints\n */\n\n/**\n * @callback modelSpecFactoryFn\n * @param {object} dependencies\n * @returns {function(...args):Readonly}\n */\n\n/**\n * @typedef {object} ModelSpecification Specify domain model properties and functions\n * @property {string} modelName name of model (case-insenstive)\n * @property {string} endpoint URI reference (e.g. plural of `modelName` noun)\n * @property {modelSpecFactoryFn} factory returns factory function that creates the model instance\n * @property {object} [dependencies] injected into the model for inverted dependency/control\n * @property {Array} [mixins] - use functional mixins\n * to compose the object from common domain logic, like input validation.\n * @property {onUpdate} [onUpdate] - Function called to handle update requests. Called\n * before save.\n * @property {onDelete} [onDelete] - Function called before deletion.\n * @property {validate} [validate] - called to validate model updates\n * @property {ports} [ports] - input/output ports for the domain\n * @property {eventHandler[]} [eventHandlers] - callbacks invoked to handle CRUD events\n * @property {serializer[]} [serializers] - use for custom de/serialization of the model\n * when reading or writing to storage or network\n * @property {relations} [relations] - create related models or query in aggregate\n * @property {commands} [commands] - define functions to execute when specified in a\n * URL parameter or query of the auto-generated REST API\n * @property {accessControlList} [accessControlList] - configure authorization\n * @property {endpoints} [routes] - additional custom API endpoints - specify inbound port\n * @property {{factory:import(\"../adapters/datasources/datasource-mongodb\"),url:string,credentials?:string}} [datasource] - custom datasource\n * for this model. If not set, the default set by the server is used.\n *\n */\n\n/**\n * @callback addModel\n * @param {{ searchTerm1, searchTerm2, searchTermN }} input\n * @returns {Promise}\n */\n\n/**\n * @callback editModel\n * @param {{ id:string, changes:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findModel\n * @param {{ id:string, query:object }} input\n * @returns { Promise }\n */\n\n/**\n * @callback findRelatedModels\n * @param {{ query:object, relation:string }} input\n * @returns { Promise<{Model,[Model]}> }\n */\n\n/**\n * @callback listModels\n * @param {{ query:object }} input e.g. { searchTerm1 : 'val', ...etc }\n * @returns { [Promise] }\n */\n\n/**\n * @callback executeCommand\n * @param {{ id:string }} input\n * @returns { Model }\n */\n\n/**\n * @typedef DomainPortAPI\n * @property { addModel } addModel\n * @property { editModel } editModel\n * @property { listModels } listModels\n * @property { findModel } findModel\n * @property { findRelatedModels } findModel\n * @property { removeModel } removeModel\n * @property { executeCommand } executeCommand\n */\n\nimport GlobalMixins from './util/mixins'\nimport bindAdapters from './util/bind-adapters'\n\n// Service dependencies\nimport * as services from '../services'\nimport * as adapters from '../adapters'\nimport * as ports from './ports'\n// Models\nimport * as modelSpecs from './config'\n\nfunction validateSpec (spec) {\n const missing = ['endpoint', 'factory'].filter(key => !spec[key])\n if (missing?.length > 0) {\n throw new Error(\n `missing properties: ${missing}, spec: ${Object.entries(spec)}`\n )\n }\n}\n\n/**\n * @param {ModelSpecification} spec\n * @param {*} dependencies - services injected\n */\nfunction makeModel (spec, modelName) {\n validateSpec(spec)\n const mixins = spec.mixins || []\n const dependencies = spec.dependencies || {}\n return {\n ...spec,\n modelName: modelName.toUpperCase(),\n mixins: mixins.concat(GlobalMixins),\n dependencies: {\n ...dependencies,\n ...bindAdapters(spec.ports, adapters, services)\n }\n }\n}\n\nexport const models = Object.entries(modelSpecs)\n .map(([k, v]) => ({ [k.toUpperCase()]: makeModel(v, k) }))\n .reduce((a, b) => ({ ...a, ...b }))\n\n","'use strict'\n\nexport function makeCustomerFactory (dependencies) {\n return function createCustomer ({\n firstName,\n lastName,\n shippingAddress,\n creditCardNumber,\n billingAddress = shippingAddress,\n phone,\n email,\n userId\n } = {}) {\n return Object.freeze({\n customerId: dependencies.uuid(),\n firstName,\n lastName,\n creditCardNumber,\n shippingAddress,\n billingAddress,\n phone,\n email,\n userId\n })\n }\n}\n\nexport async function okToDelete (customer) {\n const orders = await customer.orders()\n if (orders?.length > 0)\n throw new Error('cant delete customer with open orders')\n return customer\n}\n\nfunction fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n}\n\nexport async function runFibonacciCust (data) {\n console.log({ data })\n const param = parseInt(data.args.fibonacci || 20)\n const start = Date.now()\n return {\n fibonacci: param,\n result: fibonacci(param),\n time: Date.now() - start\n }\n}\n\nexport async function doesFieldExist (data) {\n console.log({ name: data.args?.name })\n return {\n field: data.args?.name,\n exists: (\n await (await this.fetchRelatedService('ORDER')).getFieldList()\n ).includes(data.args?.name)\n }\n}\n","'use strict'\n\nexport const assetTypes = ['rotating-asset', 'spare-part']\nexport const properties = ['height', 'length', 'width', 'weight', 'color']\nexport const categories = ['home', 'auto', 'business']\n\nexport const makeInventoryFactory = dependencies => ({\n category,\n properties,\n price,\n discount,\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n}) =>\n Object.freeze({\n category,\n properties,\n price: price - (discount || 0.0),\n name,\n desc,\n sku,\n purchaseOrder,\n vendor,\n inStock,\n assetType,\n quantity\n })\n","'use strict'\n\nimport { prevmodel } from '../util/mixins'\nimport { asyncPipe } from '../util/utils'\nimport checkPayload from '../util/check-payload'\nimport { Transform } from 'stream'\n\n/** @typedef { import('../domain/index.js').ModelSpecification} ModelSpecification */\n/** @typedef {string|RegExp} topic*/\n/** @typedef {function(string)} eventCallback*/\n/** @typedef {import('../adapters/index').adapterFunction} adapterFunction*/\n/** @typedef {string} id */\n/** @typedef {import(\"./customer\").Customer} Customer */\n/** @typedef {function(Order)} undoFunction */\n/**\n * @callback logMessageFn\n * @param {object|string} message\n * @param {logType} [type]\n *\n */\n\n/** @typedef {'first'|'last'|'lastStateChange'|'stateChange'|'error'|'undo'} logType */\n\n/**\n * @typedef readLogType\n * @property {number} index\n * @property {logType} type\n */\n\n/**\n * @typedef {{\n * itemId: string,\n * price: number,\n * qty?: number\n * }} orderItemType\n */\n\n/**\n * @callback relationFunction\n * @property {...args}\n * @returns {Promise}\n * } relationFunction\n */\n\n/**\n * @typedef {Object} Order The Order Service\n * @property {function(topic,eventCallback)} listen - listen for events\n * @property {import('../adapters/event-adapter').notifyType} notify\n * @property {adapterFunction} validateAddress - returns valid address or throws exception\n * @property {adapterFunction} completePayment - completes payment for an authorized charge\n * @property {adapterFunction} verifyDelivery - verify the order was received by the customer\n * @property {adapterFunction} trackShipment\n * @property {adapterFunction} refundPayment\n * @property {relationFunction} inventory - reserve inventory items\n * @property {adapterFunction} undo - undo all transactions up to this point\n * @property {function():Promise} pickOrder - pick items from warehouse and prepare for shipment\n * @property {adapterFunction} authorizePayment - verify payment, i.e. reserve the balance due\n * @property {import('../adapters/shipping-adapter').shipOrder} shipOrder -\n * calls shipping service to print label and request delivery\n * @property {function(Order):Promise} save - saves order\n * @property {function():Promise} find - finds order\n * @property {string} shippingAddress\n * @property {string} orderNo = the order number\n * @property {string} trackingId - id given by tracking status for this `orderNo`\n * @property {function():Order} decrypt - decrypts sensitive properties\n * @property {function({key1:any,keyN:any}, boolean):Promise} update - update the order,\n * set the second arg to false to turn off validation.\n * @property {'PENDING'|'APPROVED'|'SHIPPING'|'CANCELED'|'COMPLETED'} orderStatus\n * @property {function(...args):Promise} customer - retrieves related customer object,\n * or if args are provided, creates a new customer object, using the provided args as the input.\n * @property {function(string,Order):Promise} emit - broadcast domain event\n * @property {function():boolean} paymentAccepted - payment approved and funds reserved\n * @property {function():boolean} autoCheckout - whether or not to immediately submit the order\n * @property {boolean} saveShippingDetails save shipping and payment details in a new customer record\n * @property {{itemId:string,price:number,qty:number}[]} orderItems\n * @property {Symbol} customerId {@link Customer}\n * @property {logMessageFn} logEvent\n * @property {logMessageFn} logError\n * @property {logMessageFn} logUndo\n * @property {logMessageFn} logStateChange\n * @property {readMessageFn} readLog\n */\n\nconst orderStatus = 'orderStatus'\nconst orderTotal = 'orderTotal'\nconst orderNo = 'orderNo'\n\nexport const OrderStatus = {\n PENDING: 'PENDING',\n APPROVED: 'APPROVED',\n SHIPPING: 'SHIPPING',\n COMPLETE: 'COMPLETE',\n CANCELED: 'CANCELED'\n}\n\n/**\n *\n * @param {orderItemType} orderItem\n * @returns {boolean} true if item is valid\n */\nexport const checkItem = function (orderItem) {\n return (\n typeof orderItem.itemId === 'string' && typeof orderItem.price === 'number'\n )\n}\n\n/**\n * @param {orderItemType[]} orderItems\n */\nexport const checkItems = function (orderItems) {\n if (!orderItems || orderItems.length < 1) {\n throw new Error('order contains no items')\n }\n const items = Array.isArray(orderItems) ? orderItems : [orderItems]\n\n if (items.length > 0 && items.every(checkItem)) {\n return items\n }\n throw new Error('order items invalid', { items })\n}\n\n/**\n * Calculate order total\n * @param {orderItemType[]} orderItems\n */\nexport const calcTotal = function (orderItems) {\n const items = checkItems(orderItems)\n\n return items.reduce((total, item) => {\n const qty = item.qty || 1\n return (total += item.price * qty)\n }, 0)\n}\n\n/**\n * @param {orderItemType[]} orderItems\n * @returns {number} number of items\n */\nexport const itemCount = function (orderItems) {\n return orderItems.reduce((total, item) => (total += item.qty || 1))\n}\n\n/**\n * No changes to `propKey` properties once the order is approved\n * @param {*} o - the order\n * @param {*} propKey\n * @returns {string | null} the key or `null`\n */\nexport const freezeOnApproval = propKey => o =>\n o.orderStatus && o.orderStatus !== OrderStatus.PENDING ? propKey : null\n\nconst finalStatus = status =>\n [OrderStatus.COMPLETE, OrderStatus.CANCELED].includes(status)\n\n/**\n * No changes to `propKey` once order is complete or canceled\n * @param {*} o - the order\n * @param {*} propKey\n * @returns {string | null} the key or `null`\n */\nexport const freezeOnCompletion = propKey => o =>\n finalStatus(o.orderStatus) ? null : propKey\n\n/**\n * If not a registered customer, provide shipping & payment details.\n * @param {*} o\n * @param {*} propKey\n * @returns {string | void} the key or `void`\n */\nexport const requiredForGuest = propKey => o => o.customerId ? null : propKey\n\n/**\n * Value required to approve order.\n * @param {*} propKey\n */\nexport const requiredForApproval = propKey => o =>\n o.orderStatus === OrderStatus.APPROVED ? propKey : null\n\n/**\n * Value required to complete order\n * @param {object} o\n * @param {string | string[]} propKey these props are required to comlete the order\n * @returns {string | void} the key or `void`\n */\nexport const requiredForCompletion = propKey => o =>\n o.orderStatus === OrderStatus.COMPLETE ? propKey : null\n\n/**\n *\n * @param {enum} from\n * @param {enum} to\n * @returns\n */\nconst invalidStatusChange = (from, to) => (o, propVal) =>\n propVal === to && o[prevmodel].orderStatus === from\n\nconst invalidStatusChanges = [\n // Can't change back to pending once approved\n invalidStatusChange(OrderStatus.APPROVED, OrderStatus.PENDING),\n // Can't change back to pending once shipped\n invalidStatusChange(OrderStatus.SHIPPING, OrderStatus.PENDING),\n // Can't change back to approved once shipped\n invalidStatusChange(OrderStatus.SHIPPING, OrderStatus.APPROVED),\n // Can't change directly to shipping from pending\n invalidStatusChange(OrderStatus.PENDING, OrderStatus.SHIPPING),\n // Can't change directly to complete from pending\n invalidStatusChange(OrderStatus.PENDING, OrderStatus.COMPLETE),\n // Can't change final status\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.PENDING),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.SHIPPING),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.APPROVED),\n invalidStatusChange(OrderStatus.COMPLETE, OrderStatus.CANCELED),\n // Can't change final status\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.PENDING),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.SHIPPING),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.APPROVED),\n invalidStatusChange(OrderStatus.CANCELED, OrderStatus.COMPLETE)\n]\n\n/**\n * Check that status changes are valid\n */\nexport const statusChangeValid = (o, propVal) => {\n if (invalidStatusChanges.some(i => i(o, propVal))) {\n throw new Error('invalid status change')\n }\n return true\n}\n\n/**\n *\n * @param {*} o\n * @param {*} propVal\n */\nexport const orderTotalValid = (o, propVal) =>\n calcTotal(o.orderItems) === propVal\n\n/**\n * Recalculate order total\n * @param {object} o - the object (order)\n * @param {number} propVal - the property value\n */\nexport const recalcTotal = (o, propVal) => ({\n orderTotal: calcTotal(propVal)\n})\n\n/**\n * Updated signature requirement if `orderTotal` above certain value\n * @param {object} o - the object (order)\n * @param {number} propVal - the property value\n */\nexport const updateSignature = (o, propVal) => ({\n signatureRequired: calcTotal(propVal) > 999.99 || o.signatureRequired\n})\n\n/**\n * Don't delete orders before they're complete.\n */\nexport function readyToDelete (model) {\n if (\n ![OrderStatus.COMPLETE, OrderStatus.CANCELED].includes(model.orderStatus)\n ) {\n throw new Error('order must be canceled or completed')\n }\n return model\n}\n\n/**\n *\n * @param {Error} error\n * @param {Order} order\n * @param {*} func\n */\nfunction handleError (error, order, func) {\n const errMsg = { func, orderNo: order.orderNo, error }\n if (order) order.emit('orderError', errMsg)\n\n throw new Error(JSON.stringify(errMsg))\n}\n\n/**\n * Callback invoked by adapter when payment is complete\n * @param {{model:Order}} options\n */\nexport async function paymentCompleted (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'confirmationCode',\n options,\n payload,\n paymentCompleted.name\n )\n return order.update({ ...changes, orderStatus: OrderStatus.COMPLETE })\n}\n\n/**\n * Callback invoked by shipping adapter when order is picked up.\n * @param {{model:Order}} options\n * @param {string} shipmentId\n */\nexport async function orderShipped (options = {}, payload = {}) {\n const { model: order } = options\n const shipmentPayload = checkPayload(\n 'shipmentId',\n options,\n payload,\n orderShipped.name\n )\n return order.update({\n shipmentId: shipmentPayload.shipmentId,\n orderStatus: OrderStatus.SHIPPING\n })\n}\n\n/**\n * Callback invoked when order is ready for pickup\n * @param {{ model:Order }} options\n */\nexport async function orderPicked (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'pickupAddress',\n options,\n payload,\n addressValidated.name\n )\n return order.update(changes)\n}\n\n/**\n * Callback invoked when shippingAddress is verified (and possibly corrected)\n * @param {{ model:Order }} options\n * @param {string} shippingAddress\n */\nexport async function addressValidated (options = {}, payload = {}) {\n const { model: order } = options\n const addressPayload = checkPayload(\n 'shippingAddress',\n options,\n payload,\n addressValidated.name\n )\n return order.update({ shippingAddress: addressPayload.shippingAddress })\n}\n\n/**\n * Called by adapter when port recevies response from payment service.\n * @param {{ model:Order }} options\n * @param {*} paymentAuthorization\n */\nexport async function paymentAuthorized (options = {}, payload = {}) {\n const { model: order } = options\n const changes = checkPayload(\n 'paymentStatus',\n options,\n payload,\n paymentAuthorized.name\n )\n return order.update({ ...changes, paymentStatus }, false)\n}\n\n/**\n * Called to refund payment when order is canceled.\n * @param {*} options\n * @param {*} payload\n * @returns\n */\nexport async function refundPayment (order) {\n // call port by same name.\n order.refundPayment((options, payload) => {\n const changes = checkPayload(\n 'refundReceipt',\n options,\n payload,\n refundPayment.name\n )\n return order.update({ ...changes, orderStatus: OrderStatus.CANCELED })\n })\n}\n\n/**\n *\n * @param {Order} order\n * @returns {Promise}\n */\nasync function verifyAddress (order) {\n console.debug({\n fn: verifyAddress.name,\n validateAddress: order.validateAddress\n })\n return order.validateAddress(addressValidated)\n}\n\n/**\n * Request the bank or lender to place a hold on\n * the customer account in the amount of the payment\n * due, to be withdrawn once the shipment is safely\n * in our customer's hands, or credited back if things\n * don't work out.\n *\n * @param {Order} order\n * @returns {Promise}\n */\nasync function verifyPayment (order) {\n try {\n /**\n * @type {Order}\n */\n const authorizeOrder = await order.authorizePayment(paymentAuthorized)\n\n if (!authorizeOrder.paymentDeclined) {\n throw new Error('payment declined')\n }\n\n return authorizeOrder\n } catch (e) {\n handleError(e, order, verifyPayment.name)\n }\n return order\n}\n\n/**\n *\n * @param {Order} order\n * @returns {Promise}\n * @throws {'oInventory'}\n */\nasync function verifyInventory (order) {\n const inventory = await order.inventory()\n if (inventory.length < 1) throw new Error('bad inventory ID')\n\n const insufficient = order.orderItems.filter(item => {\n const inv = inventory.find(i => i.id === item.itemId)\n if (!inv) return true\n if (inv.quantity < item.qty) return true\n return false\n })\n\n if (insufficient.length > 0) {\n order.emit('lowOrOutOfStock', insufficient)\n throw new Error(`low or out of stock: ${insufficient.map(i => i.itemId)}`)\n }\n}\n/**\n * Copy existing customer data into the order\n * or create new customer from order details.\n *\n * @param {Order} order\n * @throws {'InvalidCustomerId'}\n */\nasync function getCustomerOrder (order) {\n // If an id is given, try fetching the model\n if (order.customerId) {\n if (!order.customer) {\n console.log({ order })\n }\n // Use the relation defined in the spec\n const customer = await order.customer()\n\n if (!customer) {\n throw new Error('invalid customer id', order.customerId)\n }\n\n // Add customer data to the order\n const custInfo = { ...customer.decrypt(), firstName: customer.firstName }\n const update = await order.update(custInfo)\n\n console.info('update order with data from existing customer', custInfo)\n return update\n }\n\n // Create a new customer from the shipping details\n if (order.saveShippingDetails) {\n const custInfo = { ...order.decrypt(), firstName: order.firstName }\n const customer = await order.customer(custInfo)\n\n console.info('create new customer with data from order', customer)\n return order\n }\n\n return order\n}\n\n/**\n * Handle a new order:\n * - fetch or save customer info\n * - check item availability\n * - authorize payment\n * - verify shipping address\n */\nconst processPendingOrder = asyncPipe(\n getCustomerOrder,\n verifyInventory,\n verifyPayment,\n verifyAddress\n)\n\n/**\n * Implements the beginging of the order service workflow.\n * The rest is implemented by the {@link ModelSpecification}.\n * See the port configuration section of {@link Order}.\n */\nconst OrderActions = {\n /**\n * Verifies the shipping address and authorizes payment\n * for the order total when the order is first created,\n * or when it is updated while still in pending status.\n *\n * @param {Order} order - the order\n * @returns {Promise>}\n */\n [OrderStatus.PENDING]: order => {\n // return processPendingOrder(order)\n\n if (order.autoCheckout)\n /**@type {Order} */\n getCustomerOrder(order).then(order =>\n runOrderWorkflow(\n order.updateSync({ orderStatus: OrderStatus.APPROVED })\n )\n )\n },\n\n /**\n * If payment is authorized, check inventory.\n * This kicks off the rest of the workflow,\n * which is controlled by port event flow.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.APPROVED]: order => {\n try {\n //if (/approved/i.test(order.paymentStatus))\n return order.pickOrder(orderPicked)\n\n // order.emit('PayAuthFail', 'Payment authorization problem')\n // return order\n } catch (error) {\n console.log({ error })\n handleError(error, order, OrderStatus.APPROVED)\n }\n return order\n },\n\n /**\n * Useful if we need to restart tracking.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.SHIPPING]: async order => {\n try {\n order.trackShipment(trackingUpdate)\n console.debug({ func: OrderStatus.SHIPPING, order })\n await (\n await order.update({ orderStatus: OrderStatus.SHIPPING })\n ).emit('orderPicked')\n } catch (error) {\n handleError(error, order, OrderStatus.SHIPPING)\n }\n return order\n },\n\n /**\n * Start cancellation process.\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.CANCELED]: async order => {\n try {\n console.debug({\n func: OrderStatus.CANCELED,\n desc: 'order canceled, calling undo',\n orderNo: order.orderNo\n })\n return order.undo()\n } catch (error) {\n handleError(error, order, OrderStatus.CANCELED)\n }\n return order\n },\n /**\n *\n * @param {Order} order\n * @returns {Promise>}\n */\n [OrderStatus.COMPLETE]: async order => {\n // send route to questionnaire, perform analysis, schedule follow-up\n console.log('customer sentiment analysis, customer care, sales analysis')\n return order\n }\n}\n\n/**\n * Call order service workflow - controlled by status\n * @param {Order} order\n * @returns {Promise>}\n */\nexport function runOrderWorkflow (order) {\n console.log({ orderStatus: order.orderStatus })\n OrderActions[order.orderStatus](order)\n}\n\n/**\n * Called on create, update, delete of model instance.\n * @param {{model:Promise>}}\n */\nexport function handleOrderEvent ({ model: order, eventType, changes }) {\n if (changes?.orderStatus || eventType === 'CREATE') {\n // console.debug({ fn: handleOrderEvent.name, order })\n runOrderWorkflow(order)\n }\n}\n\n/**\n * Require a signature for orders $1000 and up\n * @param {*} input\n * @param {*} orderTotal\n */\nfunction needsSignature (input, orderTotal) {\n return typeof input === 'boolean' ? input : orderTotal > 999.99\n}\n\n/** format and classify log entries */\nfunction logMessage (message, type) {\n const msg = typeof message === 'string' ? message : JSON.stringify(message)\n\n return {\n desc: msg.substring(0, 140),\n type,\n time: Date.now(),\n toJSON () {\n return {\n desc: this.desc,\n type,\n time: new Date(this.time).toISOString()\n }\n }\n }\n}\n\n/**\n * Returns factory function for the Order model.\n * @type {import('../domain/index.js').modelSpecFactoryFn}\n * @param {*} dependencies - inject dependencies\n */\nexport function makeOrderFactory (dependencies) {\n return function createOrder ({\n orderItems,\n email = null,\n lastName = null,\n firstName = null,\n customerId = null,\n billingAddress = null,\n shippingAddress = null,\n creditCardNumber = null,\n shippingPriority = null,\n autoCheckout = false,\n saveShippingDetails = false,\n requireSignature,\n fibonacci = 10\n }) {\n //const signatureRequired = needsSignature(requireSignature, total)\n const order = {\n email,\n lastName,\n firstName,\n customerId,\n orderItems,\n creditCardNumber,\n billingAddress,\n shippingAddress,\n signatureRequired: false,\n saveShippingDetails,\n shippingPriority,\n fibonacci,\n result: 0,\n time: 0,\n estimatedArrival: null,\n log: [logMessage('order created')],\n [orderTotal]: 0,\n [orderStatus]: OrderStatus.PENDING,\n [orderNo]: dependencies.uuid(),\n desc: 'new order 25',\n itemId: null,\n /**\n * Has payment for the order been authorized?\n */\n paymentAccepted () {\n return true\n },\n /**\n * Proceed to checkout automatically or wait for approval?\n */\n autoCheckout () {\n return autoCheckout\n },\n totalItems () {\n return itemCount(this.orderItems)\n },\n total () {\n return calcTotal(this.orderItems)\n },\n addItem (item) {\n if (checkItem(item)) {\n this.orderItems.push(item)\n return true\n }\n return false\n },\n logEvent (message, type = 'info') {\n this.log.push(logMessage(message, type))\n },\n logError (message) {\n this.logEvent(message, 'error')\n },\n logUndo (message) {\n this.logEvent(message, 'undo')\n },\n logStateChange (message) {\n this.logEvent(message, 'stateChange')\n },\n\n /**\n *\n * @param {viewLog} options\n * @returns {logMessageFn[]|logMessageFn}\n */\n readLog ({ index = null, type = null }) {\n const indx = parseInt(index)\n if (indx < this.log.length && indx !== NaN) return this.log[indx]\n if (type === 'first') return this.log[0]\n if (type === 'last') return this.log[this.log.length - 1]\n if (type === 'lastStateChange')\n return this.log[this.log.lastIndexOf({ type: 'stateChange' })]\n if (type === 'stateChanges')\n return this.log.filter(l => l.type === 'stateChange')\n if (type === 'error') return this.log.filter(l => l.type === 'error')\n if (type === 'undo') return this.log.filter(l => l.type === 'undo')\n return this.log\n }\n }\n\n return Object.freeze(order)\n }\n}\n\n/**\n * Called as command to approve/submit order.\n * @param {Order} order\n */\nexport async function approve (order) {\n console.debug({ msg: 'got order', order })\n const approvedOrder = order.updateSync(\n {\n orderStatus: OrderStatus.APPROVED\n },\n false\n )\n console.debug({ approvedOrder })\n approvedOrder.logStateChange(OrderStatus.APPROVED)\n return runOrderWorkflow(approvedOrder)\n}\n\n/**\n * Called as command to cancel order.\n * @param {Order} order\n */\nexport async function cancel (order) {\n const canceledOrder = await order.update({\n orderStatus: OrderStatus.CANCELED\n })\n canceledOrder.logStateChange(OrderStatus.CANCELED)\n return runOrderWorkflow(canceledOrder)\n}\n\n/**\n * Alias of `approve`\n * @param {Order} order\n * @returns\n */\nexport async function checkout (order) {\n return approve(order)\n}\n\n/**\n *\n * @param {{model:Order}} param0\n */\nexport function errorCallback ({ port, model: order, error }) {\n const errMsg = { error, port, error }\n console.error(errorCallback.name, errMsg)\n order.logEvent(errMsg)\n order.emit(errorCallback.name, errMsg)\n return order.undo()\n}\n\n/**\n *\n * @param {{model:Order}} param0\n */\nexport function timeoutCallback ({ port, ports, adapterFn, model: order }) {\n console.error('timeout...', port)\n //order.logError(timeoutCallback.name, 'timeout')\n order.emit(timeoutCallback.name, errMsg)\n}\n\n/**\n * @type {undoFunction}\n * Start process to return canceled order items to inventory.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnInventory (order) {\n console.log(returnInventory.name)\n order.logEvent(returnInventory.name, 'timeout')\n order.emit(returnInventory.name, errMsg)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\n/**\n * @type {undoFunction}\n * Start process for the shipper to pick the items to return.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnShipment (order) {\n console.log(returnShipment.name)\n order.logUndo(returnShipment.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\nexport function accountOrder (req, res) {}\n\n/**\n * @type {undoFunction}\n * Start process to return canceled order items to inventory.\n * Do not call `runOrderWorkflow` - it is already running (in\n * reverse) if we get here.\n */\nexport async function returnDelivery (order) {\n console.log(returnDelivery.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\n/**\n * @type {undoFunction}\n */\nexport async function cancelPayment (order) {\n console.log(cancelPayment.name)\n return order.update({ orderStatus: OrderStatus.CANCELED })\n}\n\nexport class OrderError extends Error {\n constructor (error, code) {\n super(error)\n this.code = code\n }\n}\n\n/**\n *\n * @param {Date.now} data\n * @returns\n */\nexport async function cancelOrders (data) {\n const cancelOrdersTransform = new Transform({\n objectMode: true,\n transform: (chunk, _encoding, done) => {\n done(\n null,\n JSON.stringify({ ...chunk, orderStatus: OrderStatus.CANCELED })\n )\n }\n })\n\n await this.list({\n writable: this.createWriteStream(),\n transform: cancelOrdersTransform,\n serialize: false\n })\n\n return { status: '🏆' }\n}\n\n/**\n *\n * @param {Date.now} data\n * @returns\n */\n\nexport async function approveOrders (data) {\n const approveOrdersTransform = new Transform({\n objectMode: true,\n transform: (chunk, encoding, done) => {\n if (chunk._id) delete chunk._id\n this.push(JSON.stringify({ ...chunk, orderStatus: OrderStatus.APPROVED }))\n done()\n }\n })\n\n await this.list({\n writable: this.createWriteStream(),\n transform: approveOrdersTransform\n })\n\n return { status: '🏆' }\n}\n\n/**\n *\n * @returns\n */\nexport async function trackAsyncContext () {\n const ctx = this.getContext()\n const dur = 'test-duration'\n const startTime = Date.now()\n\n await new Promise(resolve => setTimeout(resolve, 100))\n\n // require('fs')\n // .stream('/etc/hosts')\n // .pipe(ctx.get('res'))\n\n ctx.set(dur, Date.now() - startTime)\n\n const metric = {\n requestId: ctx.get('id'),\n fn: trackAsyncContext.name,\n duration: ctx.get(dur),\n context: [...ctx]\n }\n\n this.emit('metric', metric)\n console.log(metric.ctx)\n\n return metric\n}\n\nexport async function customHttpStatus (data) {\n if (data.args.code)\n throw new OrderError(data.args.message || 'custom status', data.args.code)\n try {\n console.log(x)\n } catch (error) {\n throw new OrderError(error, 500)\n }\n}\n\nexport async function testContainsMany (data) {\n console.log({ fn: testContainsMany.name, data })\n return { status: '👍', inventory: await this.inventory() }\n}\n\nfunction fibonacci (x) {\n if (x === 0) {\n return 0\n }\n if (x === 1) {\n return 1\n }\n return fibonacci(x - 1) + fibonacci(x - 2)\n}\n\nexport async function runFibonacciJs (data) {\n console.log({ data })\n const param = parseInt(data.args.fibonacci || 20)\n const start = Date.now()\n return {\n fibonacci: param,\n result: fibonacci(param),\n time: Date.now() - start\n }\n}\n\nexport async function getFieldList () {\n const model = await this.list({ query: { __limit: 1 }, stream: false })\n if (model && model.length) console.log({ model: model[0] })\n return Object.keys(model[0])\n}\n\nexport async function createModelEvent () {\n s\n return new Promise(resolve => {\n this.emit('createModel_ORDER', {\n cb: model => resolve(model),\n args: {\n a: 1,\n b: 2\n }\n })\n })\n}\n","'use strict'\n\nexport function makeToDoFactory (dependencies) {\n return function toDoFactory ({ text, isComplete }) {\n return Object.freeze({\n id: dependencies.uuid(),\n text,\n isComplete: isComplete || false\n })\n }\n} \n","/**\n * webswitch (c)\n *\n * Websocket clients connect to a common ws server,\n * called a webswitch. When a client sends a message,\n * webswitch broadcasts the message to all other\n * connected clients, including a special webswitch\n * server that acts as an uplink to another network,\n * if one is defined. A Webswitch server can also\n * receive messgages from an uplink and will broadcast\n * those messages to its clients as well.\n */\n\n'use strict'\n\nimport os from 'os'\nimport EventEmitter from 'events'\nimport { nanoid } from 'nanoid'\n\nconst HOSTNAME = 'webswitch.local'\nconst SERVICENAME = 'webswitch'\nconst HBEATTIMEOUT = 'heartBeatTimeout'\nconst WSOCKETERROR = 'webSocketError'\n\nconst isPrimary = /true/i.test(process.env.SWITCH)\nconst isBackup = /true/i.test(process.env.BACKUP)\nconst debug = /true/i.test(process.env.DEBUG)\nconst heartbeatMs = 10000\nconst sslEnabled = /true/i.test(process.env.SSL_ENABLED)\nconst clearPort = process.env.PORT || 80\nconst cipherPort = process.env.SSL_PORT || 443\nconst activePort = sslEnabled ? cipherPort : clearPort\nconst activeProto = sslEnabled ? 'wss' : 'ws'\nconst activeHost = process.env.DOMAIN || os.hostname()\nconst proto = isPrimary ? activeProto : process.env.SWITCH_PROTO\nconst port = isPrimary ? activePort : process.env.SWITCH_PORT\nconst host = isPrimary ? activeHost : process.env.SWITCH_HOST\nconst override = /true/i.test(process.env.SWITCH_OVERRIDE)\nconst apiProto = sslEnabled ? 'https' : 'http'\nconst apiUrl = `${apiProto}://${activeHost}:${activePort}`\n\nfunction serviceUrl () {\n const url = `${proto}://${host}:${port}`\n if (proto && host && port) return url\n if (isPrimary) throw new Error(`invalid url ${url}`)\n return null\n}\n\n/**\n * Service mesh client impl. Uses websocket and service-locator\n * adapters through ports injected into the {@link mesh} model.\n * Cf. modelSpec by the same name, i.e. `webswitch`.\n */\nexport class ServiceMeshClient extends EventEmitter {\n /**\n * The model is passed as the only arg.\n *\n * @param {import('../../domain').Model} mesh the domain model\n */\n constructor (mesh) {\n super('webswitch')\n this.url\n this.mesh = mesh\n this.name = SERVICENAME\n this.isPrimary = isPrimary\n this.isBackup = isBackup\n this.pong = true\n this.heartbeatTimer = 3000\n this.headers = {\n 'x-webswitch-host': os.hostname(),\n 'x-webswitch-role': 'node',\n 'x-webswitch-pid': process.pid\n }\n }\n\n /**\n *\n * @param {number} asyncId id's instance to kill\n * @returns {{telemetry:{mem:number,cpu:number}}}\n */\n telemetry () {\n return {\n eventName: 'telemetry',\n proto: this.name,\n apiUrl,\n heartbeatMs,\n hostname: os.hostname(),\n role: 'node',\n pid: process.pid,\n telemetry: {\n ...process.memoryUsage(),\n ...process.cpuUsage(),\n ...performance.nodeTiming\n },\n services: this.mesh.listServices(),\n events: this.mesh.listEvents(),\n socketState: this.mesh.websocketStatus() || 'undefined'\n }\n }\n\n /**\n * Zero-config, self-forming mesh network:\n * Discover URL of broker to connect to, or\n * if this is the broker, cast the local url\n * @returns {Promise} url\n */\n async resolveUrl () {\n await this.mesh.serviceLocatorInit({\n serviceUrl: serviceUrl(),\n name: this.name,\n primary: this.isPrimary,\n backup: this.isBackup\n })\n if (this.isPrimary) {\n await this.mesh.serviceLocatorAnswer()\n return serviceUrl()\n }\n return override ? serviceUrl() : this.mesh.serviceLocatorAsk()\n }\n\n /**\n * Use multicast dns to resolve broker url. Connect to\n * service mesh broker. Allow listeners to subscribe to\n * indivdual or all events. Send binary messages with\n * protocol and idempotentency headers. Periodically send\n * telemetry data.\n *\n * @param {*} options\n * @returns\n */\n async connect (options = { binary: true }) {\n this.options = options\n this.url = await this.resolveUrl()\n\n this.mesh.websocketConnect(this.url, {\n agent: false,\n headers: this.headers,\n protocol: SERVICENAME,\n useBinary: options.binary\n })\n\n this.mesh.websocketOnOpen(() => {\n console.log('connection open')\n this.send(this.telemetry())\n this.heartbeat()\n setTimeout(() => this.sendQueuedMsgs(), 3000)\n })\n\n this.mesh.websocketOnMessage(message => {\n if (!message.eventName) {\n debug && console.debug({ missingEventName: message })\n this.emit('missingEventName', message)\n return\n }\n try {\n this.emit(message.eventName, message)\n this.listeners('*').forEach(listener => listener(message))\n } catch (error) {\n console.error({ fn: this.connect.name, error })\n }\n })\n\n this.mesh.websocketOnError(error => {\n this.emit(WSOCKETERROR, error)\n console.error({ fn: this.connect.name, error })\n })\n\n this.mesh.websocketOnClose((code, reason) => {\n console.log({\n msg: 'received close frame',\n code,\n reason: reason?.toString()\n })\n clearTimeout(this.heartbeatTimer)\n setTimeout(() => {\n console.debug('reconnect due to socket close')\n this.connect()\n }, 5000)\n })\n\n this.mesh.websocketOnPong(() => (this.pong = true))\n this.once('timeout', this.timeout)\n }\n\n timeout () {\n console.warn('timeout')\n this.emit(HBEATTIMEOUT, this.telemetry())\n this.mesh.websocketTerminate()\n setTimeout(() => {\n console.debug('reconnect due to timeout')\n this.connect()\n }, 5000)\n }\n\n heartbeat () {\n if (this.pong) {\n this.pong = false\n this.mesh.websocketPing()\n this.heartbeatTimer = setTimeout(() => this.heartbeat(), heartbeatMs)\n } else {\n clearTimeout(this.heartbeatTimer)\n this.emit('timeout')\n }\n }\n\n /**\n * Convert message to binary and send with protocol and idempotency headers.\n * If message cannot be sent because of connection state or buffering queue\n * message in domain object for retry later. Using a domain object ensures\n * persistence of the queue across boots.\n *\n * @param {object} msg\n * @returns {Promise} true if sent, false if not\n */\n send (msg) {\n const sent = this.mesh.websocketSend(msg, {\n headers: {\n ...this.headers,\n 'idempotency-key': nanoid()\n }\n })\n if (sent) return true\n this.mesh.enqueue(msg)\n return false\n }\n\n /**\n * Send any messages buffered in `sendQueue`.\n */\n sendQueuedMsgs () {\n let sent = true\n while (this.mesh.queueDepth() > 0 && sent)\n sent = this.send(this.mesh.dequeue())\n }\n\n /**\n * Sends message to mesh broker service.\n * @param {*} msg\n */\n publish (msg) {\n return this.send(msg)\n }\n\n /**\n * Register handler to fire on event\n * @param {string} eventName\n * @param {function()} callback\n */\n subscribe (eventName, callback) {\n this.on(eventName, callback)\n }\n\n /**\n * A new object will be created on system reload.\n * Dispose of the old one. Run in context to\n * distinguish between the new and old instance.\n *\n * @param {*} code\n * @param {*} reason\n */\n async close (code, reason) {\n console.debug('closing socket')\n await this.mesh.save() // save queued messages\n this.removeAllListeners()\n this.mesh.websocketClose(code, reason)\n }\n}\n\n/**\n * @typedef {{\n * senderQueue:string[],\n * queueDepth:function():number,\n * connect:function(),\n * close:function(),\n * publish(object),\n * enqueue:function(string),\n * dequeue:function(),\n * subscribe:function(string,function())\n * }} serviceMeshIface\n */\n\n/**\n * Domain model factory function. This model is\n * used internally by the Aegis framework as a\n * pluggable service mesh client. Implement the\n * the methods below to create a new plugin.\n *\n * @param {*} dependencies injected depedencies\n * @returns {function({function():string[],function():string[]}):serviceMeshIface}\n */\nexport function makeClient (dependencies) {\n let client\n return function ({ listServices, listEvents }) {\n return {\n /**@type {function():string[]} */\n listServices,\n /**@type {function():string[]} */\n listEvents,\n /**@type {string[]} */\n sendQueue: [],\n /**@type {number} */\n sendQueueMax: 1000,\n\n queueDepth () {\n return this.sendQueue.length\n },\n\n enqueue (msg) {\n this.sendQueue.push(msg)\n },\n\n dequeue () {\n return this.sendQueue.shift()\n },\n\n /**\n *\n * @returns {ServiceMeshClient}\n */\n getClient () {\n if (client) return client\n client = new ServiceMeshClient(this)\n return client\n },\n\n async connect (options) {\n this.getClient().connect(options)\n },\n\n async publish (event) {\n this.getClient().publish(event)\n },\n\n subscribe (eventName, handler) {\n this.getClient().subscribe(eventName, handler)\n },\n\n async close (code, reason) {\n this.getClient().close(code, reason)\n }\n }\n }\n}\n","// import { systemsInGalaxy } from './SolarSystem'\n\nexport {\n cancelOrders,\n approveOrders,\n trackAsyncContext,\n customHttpStatus,\n testContainsMany,\n runFibonacciJs,\n getFieldList,\n createModelEvent\n} from './models/order'\n\nexport { runFibonacciCust, doesFieldExist } from './models/customer'\n// export { listSolarSystems, sendGalaticSignal } from './Galaxy'\n// export {\n// systemsInGalaxy,\n// sendSolarSignal,\n// receiveGalacticSignal\n// } from './SolarSystem'\n// export { receiveSolarSignal, planetsInSolarSystem } from './Planet'\n// export {\n// qeRunFibonacci,\n// qeCustomHttpStatus,\n// qeGetPublicIpAddressIn\n// } from './query-engine'\n// export { damBrowseIn, damDownloadIn, damSearchIn, damUploadIn } from './dam-api'\n// export { tmListEventsIn } from './ticket-master'\n// export { callFetchService } from './access-controller'\n","'use strict'\n\nexport default function makeAdapters (ports, adapters, services) {\n if (!ports || !adapters) {\n return\n }\n return Object.keys(ports)\n .map(port => {\n if (!adapters[port]) {\n return\n }\n\n try {\n return {\n [port]: adapters[port](services[ports[port].service])\n }\n } catch (e) {\n console.warn(e.message)\n }\n })\n .reduce((p, c) => ({ ...p, ...c }))\n}\n","'use strict'\n\n/**\n * Check the payload for expected properties.\n * @param {string|string[]} key name of property or properties\n * @param {*} options\n * @param {*} payload\n * @param {*} port\n */\nexport default function checkPayload (\n key,\n options = {},\n payload = {},\n port = checkPayload.name\n) {\n const { model } = options\n\n if (!model || Object.keys(payload) < 1 || !key) {\n throw new Error({\n desc: 'model, payload, or key is missing',\n model,\n port,\n error,\n payload,\n key\n })\n }\n\n if (Array.isArray(key)) {\n const keys = key.map(k => checkPayload(k, options, payload, port))\n\n return keys.reduce((p, c) => ({ ...p, ...c }))\n }\n\n if (payload[key]) {\n return { [key]: payload[key] }\n }\n\n if (model[key]) {\n return { [key]: model[key] }\n }\n\n return model\n .find()\n .then(latest => ({ [key]: latest[key] }))\n .catch(error => {\n throw new Error('property is missing' + key, port, error, payload, model)\n })\n}\n","'use strict'\n\nimport { hash, encrypt, decrypt, compose } from './utils'\nimport util from 'util'\n\n/**\n * Functional mixin created by `functionalMixinFactory`\n * @callback functionalMixin\n * @param {Object} o Object to compose\n * @returns {Object} Composed object\n */\n\n/**\n * Functional mixin factory - partial application - returns mixin function\n * @callback functionalMixinFactory\n * @param {*} mixinParams params for mixin function\n * @returns {functionalMixin}\n */\n\n/**\n * @typedef {import(\"../index\").Model} Model\n */\n\n/**\n * Private key to access previous version of the model\n */\nexport const prevmodel = Symbol('prevModel')\n/**\n * private key to access validation config\n */\nexport const validations = Symbol('validations')\n/**\n * Process mixin pre or post update\n */\nexport const mixinType = {\n pre: Symbol('pre'),\n post: Symbol('post')\n}\n\n/**\n * Stored mixins - use private symbol as key to prevent overwrite\n */\nexport const mixinSets = {\n [mixinType.pre]: Symbol('preUpdateMixins'),\n [mixinType.post]: Symbol('postUpdateMixins')\n}\n\n/**\n * Set of pre mixins\n */\nconst premixins = mixinSets[mixinType.pre]\n/**\n * Set of post mixins\n */\nconst postmixins = mixinSets[mixinType.post]\n\n/**\n * Apply any pre and post mixins and return the result.\n * @deprecated\n * @param {*} model - current model\n * @param {*} changes - object containing changes\n * @returns {import('..').Model} updated model\n */\nexport function processUpdate (model, changes) {\n changes[prevmodel] = JSON.parse(JSON.stringify(model)) // keep history\n\n const updates = model[premixins]\n ? compose(...model[premixins].values())(changes)\n : changes\n\n const updated = { ...model, ...updates }\n\n return model[postmixins]\n ? compose(...model[postmixins].values())(updated)\n : updated\n}\n\n/**\n * @deprecated\n * Store mixins for execution on update\n * @param {mixinType} type\n * run before changes are applied or afterward\n * @param {*} o Object containing changes to apply (pre)\n * or new object after changes have been applied (post)\n * @param {string} name `Function.name`\n * @param {functionalMixin} cb mixin function\n */\nexport function updateMixins (type, o, name, cb) {\n if (!mixinSets[type]) {\n throw new Error('invalid mixin type')\n }\n\n const mixinSet = o[mixinSets[type]] || new Map()\n\n if (!mixinSet.has(name)) {\n mixinSet.set(name, cb())\n\n return {\n ...o,\n [mixinSets[type]]: mixinSet\n }\n }\n return o\n}\n\n/**\n * bitmask for identifying events\n */\nconst eventMask = {\n update: 1, // 0001 Update\n create: 1 << 1, // 0010 Create\n onload: 1 << 2 // 0100 Load\n}\n\nfunction handleUpdateEvent (model, updates, event) {\n const isUpdate = eventMask.update & event\n const decrypted = isUpdate ? model.decrypt() : {}\n return {\n ...model,\n ...updates,\n ...decrypted\n }\n}\n\nfunction isObject (p) {\n return p != null && typeof p === 'object'\n}\n\nfunction containsUpdates (model, changes, event) {\n try {\n if (!changes) return false\n if (eventMask.update & event) {\n const changeList = Object.keys(changes)\n if (changeList.length < 1) return false\n\n if (\n changeList.every(\n k => model[k] && util.isDeepStrictEqual(changes[k], model[k])\n )\n ) {\n return false\n }\n }\n return true\n } catch (error) {\n console.error({ fn: containsUpdates.name, error })\n }\n return false\n}\n\n/**\n * Run validation functions enabled for a given event.\n * @param {Model} model - the composed object\n * @param {*} changes - object containing changes\n * @param {Number} event - Indicates what event is occuring:\n * 1st bit turned on means update, 2nd bit create, 3rd load,\n * see {@link eventMask}.\n */\nexport function validateModel (model, changes, event) {\n if (!model || !changes || !event) return {}\n // if there are no changes, and the event is an update, return\n if (!containsUpdates(model, changes, event)) {\n return model\n }\n\n // keep a history of the last saved model\n const input = {\n ...changes,\n [prevmodel]: JSON.parse(JSON.stringify(model || {}))\n }\n\n // Validate just the input data\n const updates = model[validations]\n .filter(v => v.input & event)\n .sort((a, b) => a.order - b.order)\n .map(v => model[v.name].apply(input))\n .reduce((p, c) => ({ ...p, ...c }), input)\n\n const updated = { ...model, ...updates }\n\n // Validate the updated model\n return updated[validations]\n .filter(v => v.output & event)\n .sort((a, b) => a.order - b.order)\n .map(v => updated[v.name]())\n .reduce((p, c) => ({ ...p, ...c }), updated)\n}\n\n/**\n * Enable validation to run on specific events.\n * @param {boolean} onUpdate - whether or not to run the validation on update.\n * Defaults to `true`.\n * @param {boolean} onCreate - whether or not to run the validation on create.\n * Defaults to `true`.\n * @param {boolean} onLoad - whether or not to run the validation when\n * the object is being loaded into memory after being deserialized.\n * Defaults to `false`.\n */\nfunction enableEvent ({ onUpdate = true, onCreate = true, onLoad = false }) {\n let enabled = 0\n\n if (onUpdate) {\n enabled |= eventMask.update\n }\n if (onCreate) {\n enabled |= eventMask.create\n }\n if (onLoad) {\n enabled |= eventMask.onload\n }\n return enabled\n}\n\n/**\n * Specify when validations run.\n */\nconst enableValidation = (() => {\n return {\n /**\n * Validation runs on update.\n */\n onUpdate: enableEvent({\n onUpdate: true,\n onCreate: false,\n onLoad: false\n }),\n /**\n * Validation runs on create.\n */\n onCreate: enableEvent({\n onUpdate: false,\n onCreate: true,\n onLoad: false\n }),\n /**\n * Validation runs on both create and update.\n */\n onCreateAndUpdate: enableEvent({\n onUpdate: true,\n onCreate: true,\n onLoad: false\n }),\n /**\n * Validation runs on load.\n */\n onLoad: enableEvent({\n onUpdate: false,\n onCreate: false,\n onLoad: true\n }),\n /**\n * Validation runs on load and create.\n */\n onLoadAndCreate: enableEvent({\n onUpdate: false,\n onCreate: true,\n onLoad: true\n }),\n /**\n * Validation runs on load and create.\n */\n onLoadAndUpdate: enableEvent({\n onUpdate: true,\n onCreate: false,\n onLoad: true\n }),\n /**\n * Validation runs on all events.\n */\n onAll: enableEvent({\n onUpdate: true,\n onCreate: true,\n onLoad: true\n })\n }\n})()\n\n/**\n * Add a validation function to be called for a given event.\n * @typedef {object} validationConfig\n * @property {*} o - the composed object\n * @property {string} name - name of function to run\n * @property {number} input - \"input\" validations run against\n * the data passed by the caller in the request. Use `enableValidation`\n * to provide a value for this param.\n * @property {number} output - \"output\" functions run against the\n * model after the changes have been applied.\n * @property {number} order - order in which validation runs\n * @param {validationConfig} param0\n */\nfunction addValidation ({ model, name, input = 0, output = 0, order = 50 }) {\n const config = model[validations] || []\n\n if (config.some(v => v.name === name)) {\n console.warn('duplicate validation name', name)\n return model\n }\n\n return {\n ...model,\n validateModel,\n [validations]: [...config, { name, input, output, order }]\n }\n}\n\n/**\n * Resolve keys:\n * If the value includes an array, flatten it, then for each element:\n * If the value is \"*\", return all keys of the object.\n * If the value is a function, execute it to get a dynamic key or key list.\n * If the value is a RegExp, test it to get dynamic key list.\n * If any of the above produce an array of keys, flatten it.\n * @param {*} o - Object to compose\n * @param {Array} propKeys -\n * Names (or functions that return names) of properties\n * @returns {string[]} list of (resolved) property keys\n */\nfunction parseKeys (o, ...propKeys) {\n if (!propKeys || !o) return null\n const keys = propKeys.flat().map(function (k) {\n if (typeof k === 'function') return k(o)\n if (k instanceof RegExp) return Object.keys(o).filter(key => k.test(key))\n if (k === '*') return Object.keys(o)\n return k\n })\n return keys.flat()\n}\n\n/**\n * Encrypt properties. Properties remain encrypted indefinitely, and\n * must be explicitly decrypted as needed, e.g. reading values in memory,\n * from storage, serializing and sending to an external system.\n * @param {Array} propKeys -\n * Names (or functions that return names) of properties to encrypt\n * @returns {functionalMixin} mixin function\n */\nexport const encryptProperties =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n const encryptProps = obj => {\n return keys\n .map(key => (obj[key] ? { [key]: encrypt(obj[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n\n return {\n encryptProperties () {\n return encryptProps(this)\n },\n\n ...addValidation({\n model: o,\n name: encryptProperties.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 100\n }),\n\n decrypt () {\n return keys\n .map(key => (this[key] ? { [key]: decrypt(this[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }), {})\n }\n }\n }\n\n/**\n * Prevent properties from being modified.\n * Accepts a property name or a function that returns a property name.\n * @param {Array} propKeys - names of properties to freeze\n */\nexport const freezeProperties =\n (...propKeys) =>\n o => {\n const preventUpdates = obj => {\n const keys = parseKeys(obj, ...propKeys)\n\n const mutations = Object.keys(obj).filter(key => keys.includes(key))\n if (mutations?.length > 0) {\n throw new Error(`cannot update readonly properties: ${mutations}`)\n }\n }\n\n return {\n freezeProperties () {\n preventUpdates(this)\n },\n\n ...addValidation({\n model: o,\n name: freezeProperties.name,\n input: enableValidation.onUpdate,\n order: 20\n })\n }\n }\n\n/**\n * Enforce required fields.\n * @param {Array} propKeys -\n * required property key names - can be a function or regex\n * that returns the property key names\n */\nexport const requireProperties =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n function requireProps (obj) {\n const missing = keys.filter(key => key && !obj[key])\n if (missing?.length > 0) {\n throw new Error(`missing required properties: ${missing}`)\n }\n }\n return {\n requireProperties () {\n requireProps(this)\n },\n\n ...addValidation({\n model: o,\n name: requireProperties.name,\n output: enableValidation.onCreateAndUpdate,\n order: 90\n })\n }\n }\n\n/**\n * Hash passwords.\n * @param {*} hash hash algorithm\n * @param {Array} propKeys name of password props\n */\nexport const hashPasswords =\n (...propKeys) =>\n o => {\n const keys = parseKeys(o, ...propKeys)\n\n function hashPwds (obj) {\n return keys\n .map(key => (obj[key] ? { [key]: hash(obj[key]) } : {}))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n\n return {\n hashPasswords () {\n return hashPwds(this)\n },\n\n ...addValidation({\n model: o,\n name: hashPasswords.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 100\n })\n }\n }\n\nconst internalPropList = []\n\n/**\n * Reject unknown properties in user input. Allow only approved keys.\n * @param {...any} propKeys\n */\nexport const allowProperties =\n (...propKeys) =>\n o => {\n function rejectUnknownProps () {\n const keys = parseKeys(o, ...propKeys)\n const allowList = keys.concat(internalPropList)\n\n const unknownProps = Object.keys(o).filter(\n key => !allowList.includes(key)\n )\n\n if (unknownProps?.length > 0) {\n throw new Error(`invalid properties: ${unknownProps}`)\n }\n }\n\n return {\n rejectUnknownProperties () {\n return rejectUnknownProps(this)\n },\n\n ...addValidation({\n model: o,\n name: rejectUnknownProps.name,\n input: enableValidation.onUpdate,\n order: 10\n })\n }\n }\n\n/**\n * Test regular expressions\n */\nexport const RegEx = {\n email: /^(.+)@(.+){2,}\\.(.+){2,}$/,\n ipv4Address:\n /^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\\\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/,\n ipv6Address:\n /^((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}$/,\n phone: /^[1-9]\\d{2}-\\d{3}-\\d{4}/,\n creditCard:\n /^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/,\n ssn: /^(?!666|000|9\\\\d{2})\\\\d{3}-(?!00)\\\\d{2}-(?!0{4})\\\\d{4}$/,\n /**\n * Allow caller to pass a keyword that refers to one of the regex above\n * @param {regexType} expr\n * @param {*} val\n */\n test (expr, val) {\n const _expr =\n Object.keys(this).includes(expr) && this[expr] instanceof RegExp\n ? this[expr]\n : expr\n return _expr.test(val)\n }\n}\n\n/**\n * @callback isValid\n * @param {Object} o - the property owner\n * @param {*} propVal - the property value\n * @returns {boolean} - true if valid\n *\n * @typedef {'email'|'phone'|'ipv4Address'|'ipv6Address'|'creditCard'|'ssn'|RegExp} regexType\n *\n * @typedef {{\n * propKey:string,\n * isValid?:isValid,\n * values?:any[],\n * regex?:regexType,\n * maxlen?:number\n * maxnum?:numbertp\n * typeof?:string\n * unique?:{ encrypted:boolean }\n * }} validation\n */\n\nfunction evaluateUniqueness (v, o, propVal) {\n const compareVal = v.unique.encrypted ? encrypt(propVal) : propVal\n return o.listSync({ [v.propKey]: compareVal }).length < 1\n}\n\n/**\n * Run validation tests\n */\nconst Validator = {\n tests: {\n isValid: (v, o, propVal) => v.isValid(o, propVal),\n values: (v, o, propVal) => v.values.includes(propVal),\n regex: (v, o, propVal) => RegEx.test(v.regex, propVal),\n typeof: (v, o, propVal) => v.typeof === typeof propVal,\n maxnum: (v, o, propVal) => v.maxnum + 1 > propVal,\n maxlen: (v, o, propVal) => v.maxlen + 1 > propVal.length,\n unique: (v, o, propVal) => evaluateUniqueness(v, o, propVal)\n },\n /**\n * Returns true if tests pass.\n * @param {validation} v validation config\n * @param {Object} o object to compose\n * @param {*} propVal value of property to validate\n * @returns {boolean} true if tests pass\n */\n isValid (v, o, propVal) {\n return Object.keys(this.tests).every(key => {\n if (v[key]) {\n // the test `key` is specified, run it\n return this.tests[key](v, o, propVal)\n }\n return true\n })\n }\n}\n\n/**\n * Verify a property value is a member of a list,\n * is unique within a set of model instances,\n * is of a certain length, size or type,\n * matches a regular expression,\n * or satisfies a custom validation function.\n * @param {validation[]} validations\n */\nexport const validateProperties = validations => o => {\n function validate (obj) {\n const invalid = validations.filter(v => {\n const propVal = obj[v.propKey]\n\n if (!propVal) {\n return false\n }\n return !Validator.isValid(v, obj, propVal)\n })\n\n if (invalid?.length > 0) {\n throw new Error(`invalid value for ${[...invalid.map(v => v.propKey)]}`)\n }\n }\n\n return {\n validateProperties () {\n validate(this)\n },\n\n ...addValidation({\n model: o,\n name: validateProperties.name,\n input: enableValidation.onUpdate,\n output: enableValidation.onCreate,\n order: 50\n })\n }\n}\n\n/**\n * @callback updaterFn\n * @param {Object} o\n * @param {*} propVal\n * @returns {Object} object with updated properties\n *\n * @typedef {{\n * propKey: string,\n * update: updaterFn\n * }} updater\n */\n\n/**\n * Respond to property updates by updating addtional (dependent) properties as needed.\n * @param {updater[]} updaters\n */\nexport const updateProperties = updaters => o => {\n function updateProps (obj) {\n const updates = updaters.filter(u => obj[u.propKey])\n\n if (updates?.length > 0) {\n return updates\n .map(u => u.update(o, obj[u.propKey]))\n .reduce((p, c) => ({ ...p, ...c }))\n }\n }\n\n return {\n updateProperties () {\n return updateProps(this)\n },\n\n ...addValidation({\n model: o,\n name: updateProperties.name,\n output: enableValidation.onUpdate,\n order: 30\n })\n }\n}\n\n/**\n * Set a validation that invokes a port. The port must be configured\n * in the `ModelSpecification`.\n * @param {string} fn - name of port (as it appears in the ModelSpec)\n * @param {boolean} onCreate - invoke on create\n * @param {boolean} onUpdate - invoke on update\n * @param {...any} args - pass arguments\n */\nexport const invokePort =\n (fn, onCreate, onUpdate, ...args) =>\n async o => {\n return {\n ...o,\n invokePort () {\n console.log({ func: 'invokePort', fn, args })\n return this[fn](...args).then(o => o)\n },\n\n ...addValidation({\n model: o,\n name: 'invokePort',\n output: enableValidation.onUpdate,\n order: 85\n })\n }\n }\n\n/**\n * Set a validation that calls a model method or provided function.\n * @param {string|function(Model, ...any):Promise} fn - callback function\n * or name of method to executee\n * @param {boolean} onCreate - invoke on create\n * @param {boolean} onUpdate - invoke on update\n * @param {...any} args - pass arguments to the method/function\n * @return {Model}\n */\nexport const execMethod =\n (fn, onCreate, onUpdate, ...args) =>\n async o => {\n const functionType = {\n function: (fn, obj, ...args) => fn(obj, ...args).then(o => o),\n string: (fn, obj, ...args) => obj[fn](...args).then(o => o)\n }\n\n return {\n ...o,\n async execMethod () {\n const model = await functionType[typeof fn](fn, this, ...args)\n return model\n },\n\n ...addValidation({\n model: o,\n name: 'execMethod',\n output: enableValidation.onUpdate,\n order: 40\n })\n }\n }\n\n/**\n * Create a method on a model.\n * @param {*} fn\n * @param {...any} args\n */\nexport const createMethod =\n (fn, ...args) =>\n o => {\n return {\n ...o,\n [fn.name]: () => fn(...args)\n }\n }\n\n/**\n * Check the value of the property before returning its key.\n * @param {*} propKey\n * @param {regexType} expr\n * @returns {function(any):any} dynamic property func\n */\nexport const withValidFormat = (propKey, expr) => o => {\n if (o[propKey] && !RegEx.test(expr, o[propKey])) {\n throw new Error(`invalid ${propKey}`)\n }\n return propKey\n}\n\n/**\n *\n * @param {string} value\n * @param {regexType} expr\n */\nexport const checkFormat = (value, expr) => {\n if (value && !RegEx.test(expr, value)) {\n const x = expr instanceof RegExp ? value : expr\n throw new Error(`${x} invalid`)\n }\n}\n\n/**\n * Implement GDPR encryption requirement across models\n */\nexport const encryptPersonalInfo = encryptProperties(\n /^last.*Name$|^surname$|^family.*Name$/i,\n /^shipping.*Address$/i,\n /^billing.*Address$/i,\n /^home.*Address$/i,\n /email|e-mail/i,\n /^phone$|^home.*phone$/i,\n /^mobile$|^mobile.*number$|^cell.*number$/i,\n /^credit.*Card/i,\n /^cvv$/i,\n /^ssn$|^socialSecurity/i,\n /^encrypted/i\n)\n\n/**\n * Global mixins\n */\nconst GlobalMixins = [encryptPersonalInfo]\n\nexport default GlobalMixins\n","'use strict'\n\nimport crypto from 'crypto'\nimport { nanoid } from 'nanoid'\n\nexport function compose (...funcs) {\n return function (initVal) {\n return funcs.reduceRight((val, func) => func(val), initVal)\n }\n}\n\nexport function composeAsync (...funcs) {\n return function (initVal) {\n return funcs.reduceRight(\n (val, func) => val.then(func),\n Promise.resolve(initVal)\n )\n }\n}\n\n/**\n * @callback pipeFn\n * @param {object} obj - the object to compose\n * @returns {object} - the composed object\n */\n\n/**\n * @param {pipeFn} func\n */\nexport const asyncPipe = (...func) => obj =>\n func.reduce((o, f) => o.then(f), Promise.resolve(obj))\n\nconst passwd = process.env.ENCRYPTION_PWD\nconst algo = 'aes-192-cbc'\nconst key = crypto.scryptSync(String(passwd), 'salt', 24)\nconst iv = Buffer.alloc(16, 0)\n\nexport function encrypt (text) {\n const cipher = crypto.createCipheriv(algo, key, iv)\n let encrypted = cipher.update(text, 'utf8', 'hex')\n encrypted += cipher.final('hex')\n return encrypted\n}\n\nexport function decrypt (cipherText) {\n console.log('decrypt(%s)', cipherText)\n const decipher = crypto.createDecipheriv(algo, key, iv)\n let decrypted = decipher.update(cipherText, 'hex', 'utf8')\n decrypted += decipher.final('utf8')\n return decrypted\n}\n\nexport function hash (data) {\n return crypto\n .createHash('sha1')\n .update(data)\n .digest('hex')\n}\n\nexport function uuid () {\n // return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n // (c ^ (crypto.randomBytes(16)[0] & (15 >> (c / 4)))).toString(16)\n // );\n return nanoid()\n}\n\nexport function makeArray (v) {\n return Array.isArray(v) ? v : [v]\n}\n\nexport function makeObject (prop) {\n if (Array.isArray(prop)) {\n return prop.reduce((p, c) => ({ ...p, ...c }))\n }\n return prop\n}\n\n/**\n *\n * @param {Promise<{\n * ok:()=>any,\n *\n * }} promise\n * @returns\n */\nexport function async (promise) {\n return promise\n .then(result => ({\n ok: true,\n object: result,\n asObject: () => makeObject(result),\n asArray: () => makeArray(result)\n }))\n .catch(error => {\n console.error(error)\n return Promise.resolve({ ok: false, error })\n })\n}\n","'use strict'\n\nimport { Event } from './services/event-service'\n\nexport class EventDispatcher {\n constructor (adapter = Event) {\n this.adapter = adapter\n this.subscriptions = new Map()\n }\n\n registerCallback (topic, callback) {\n if (this.subscriptions.has(topic)) {\n this.subscriptions.get(topic).push(callback)\n return\n }\n this.subscriptions.set(topic, [callback])\n }\n\n async emitEvent (topic, message, method = 'notify') {\n await this.adapter[method](topic, message)\n }\n\n async init (method = 'listen') {\n function emitEvent (topic, message) {\n this.emitEvent(topic, message)\n }\n\n await this.adapter[method](\n /Channel/,\n function ({ topic, message }) {\n if (this.subscriptions.has(topic)) {\n this.subscriptions\n .get(topic)\n .forEach(callback =>\n callback({ message, emitEvent: emitEvent.bind(this) })\n )\n }\n }.bind(this)\n )\n }\n}\n","'use strict'\n\nconst session = require('express-session')\nconst express = require('express')\nconst http = require('http')\nconst WebSocket = require('ws')\nconst { uuid } = require('./domain/util/utils')\nrequire('dotenv').config()\nconst services = require('./service-registry').default\nconst cluster = require('cluster')\nconst fs = require('fs')\nconst _srv_ = require('./services')\n\nconst app = express()\nconst map = new Map()\nconst API_ROOT = '/api'\nconst PORT = 8060\n\nimport axios from 'axios'\n// list the models we expose to host through module federation\nimport { models } from './domain'\nconsole.log(models)\n\n// Run test service endpoints\nservices.init()\n\n// We need the same instance of the session parser in express and\n// WebSocket server.\nconst sessionParser = session({\n saveUninitialized: false,\n secret: '$eCuRiTy',\n resave: false\n})\n\n// Serve static files from the 'public' folder.\napp.use(express.static('public'))\napp.use(express.static('dist')) // remoteEntry.js\napp.use(sessionParser)\napp.use(express.json())\n\napp.post('/login', function (req, res) {\n // \"Log in\" user and set userId to session.\n const id = uuid()\n console.log(`Updating session for user ${id}`)\n req.session.userId = id\n res.send({ result: 'OK', message: 'Session updated' })\n})\n\napp.delete('/logout', function (request, response) {\n const ws = map.get(request.session.userId)\n console.log('Destroying session')\n request.session.destroy(function () {\n if (ws) ws.close()\n response.send({ result: 'OK', message: 'Session destroyed' })\n })\n})\n\napp.get(`${API_ROOT}/fedmonserv`, (req, res) =>\n res.send('Federated Monolith Service')\n)\n\napp.get(`${API_ROOT}/service1`, (req, res) => {\n console.log({ from: req.ip, url: req.originalUrl })\n res.status(200).send({\n from: 'fedmonserv',\n ip: req.ip,\n port: PORT,\n url: req.originalUrl,\n date: new Date().toISOString()\n })\n})\n\n// Create HTTP server\nconst server = http.createServer(app)\nconst wss = new WebSocket.Server({ clientTracking: true, noServer: true })\n\n// Send events emitted from host to any WS clients\napp.post(`${API_ROOT}/publish`, (req, res) => {\n console.log({ event: req.body })\n //handleEvents(req, res);\n wss.clients.forEach(function each (client) {\n if (client.url === req.url) return\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify({ event: req.body }))\n }\n })\n})\n\n// Handle request to upgrade to websocket protocol\nserver.on('upgrade', function (request, socket, head) {\n console.log('Parsing session from request...')\n\n sessionParser(request, {}, () => {\n if (!request.session.userId) {\n socket.destroy()\n return\n }\n console.log('Session is parsed')\n wss.handleUpgrade(request, socket, head, function (ws) {\n wss.emit('connection', ws, request)\n })\n })\n})\n\nwss.on('connection', function (ws, request) {\n const userId = request.session.userId\n map.set(userId, ws)\n\n ws.on('message', function (message) {\n console.log(`Received message ${message} from user ${userId}`)\n })\n\n ws.on('close', function () {\n map.delete(userId)\n })\n})\n\nfunction startServer () {\n server.listen(PORT, function () {\n console.log(`Listening on http://localhost:${PORT}\\n`)\n })\n}\n\nfunction hotReload () {\n const url = process.env.RELOAD_URL || 'http://localhost:8070'\n const auth = /true/i.test(process.env.AUTH_ENABLED)\n const ssl = url.startsWith('https')\n if (auth) {\n const text = fs.readFileSync('./public/token.json', 'utf-8')\n const token = JSON.parse(text)\n axios.defaults.headers.common[\n 'Authorization'\n ] = `bearer ${token.access_token}`\n }\n // setTimeout(() => {\n try {\n if (ssl) {\n const https = require('https')\n const httpsAgent = new https.Agent({\n rejectUnauthorized: false\n })\n axios\n .get(url, { httpsAgent })\n .then(response => console.log(response.data))\n } else {\n axios.get(url).then(response => console.log(response.data))\n }\n } catch (e) {\n console.log(e.message)\n }\n //}, 10000);\n}\n\nstartServer()\n\n// function startHotLoadWorker() {\n// const worker = cluster.fork();\n// const timerId = setTimeout(function (params) {\n// startHotLoadWorker();\n// }, 10000);\n// worker.on(\"message\", msg => {\n// if (msg?.status === \"done\") {\n// clearTimeout(timerId);\n// }\n// });\n//\n\n// if (cluster.isMaster) {\n// cluster.fork();\n// startServer();\n// } else {\n// hotReload();\n// }\n\n// let reloaded = false;\n// let serverRunning = false;\n\n// (async () => {\n// while (!reloaded) {\n// const worker = cluster.fork();\n\n// if (cluster.master) {\n// if (!serverRunning) {\n// startServer();\n// serverRunning = true;\n// }\n// function waitOnHotLoad() {\n// return new Promise(function (resolve) {\n// worker.on(\"message\", msg => {\n// if (msg === \"all good\") {\n// reloading = true;\n// resolve(true);\n// }\n// });\n// });\n// }\n// await waitOnHotLoad();\n\n// await new Promise(r => setTimeout(r, 2000));\n// }\n// }\n// })();\n\n// if (cluster.worker) {\n// hotReload();\n// process.send(\"all good\");\n// }\n","'use strict'\n\nimport { EventDispatcher } from './event-dispatcher'\nimport { uuid } from './domain/util/utils'\n\nexport const Registry = {\n eventNames: {\n shipOrder: 'orderShipped',\n trackShipment: 'outForDelivery',\n verifyDelivery: 'deliveryVerified'\n },\n\n sendEvent ({ emitEvent, topic, eventData, eventSource, eventName }) {\n console.log('Sending event...')\n console.log({ emitEvent, topic, eventData, eventSource, eventName })\n setTimeout(async () => {\n await emitEvent(\n topic,\n JSON.stringify({\n eventData,\n eventName,\n eventTime: new Date().toISOString(),\n eventType: 'commandResponse',\n eventSource: eventSource\n })\n )\n }, 5000)\n },\n\n generateShippingEventData (event, externalId) {\n const trackingId = uuid()\n const shipmentId = trackingId\n const proofOfDelivery = `http://shipping.service.com?proof=${trackingId}`\n const eventData = { externalId }\n if (event.eventName === 'shipOrder') {\n return { ...eventData, shipmentId }\n }\n if (event.eventName === 'trackShipment') {\n return { ...eventData, trackingId, trackingStatus: 'outForDelivery' }\n }\n if (event.eventName === 'verifyDelivery') {\n return { ...eventData, proofOfDelivery }\n }\n },\n\n generateShippingMessage (emitEvent, event, externalId) {\n return {\n emitEvent,\n topic: event.eventData.commandResp,\n eventData: this.generateShippingEventData(event, externalId),\n eventName: this.eventNames[event.eventName],\n eventSource: 'shippingService'\n }\n },\n\n inventoryCallbackFactory () {\n function inventoryCallback ({ message, emitEvent }) {\n const event = JSON.parse(message)\n const warehouseAddress = /*null;*/ '1234 warehouse dr, dock 2'\n const externalId = event.eventData.commandArgs.externalId\n const eventName = /*'outOfStock';*/ 'orderPicked'\n this.sendEvent({\n emitEvent,\n topic: event.eventData.respChannel,\n eventName,\n eventData: { warehouse_addr: warehouseAddress, externalId },\n eventSource: 'inventoryService'\n })\n }\n return inventoryCallback.bind(this)\n },\n\n shippingCallbackFactory () {\n function shippingCallback ({ message, emitEvent }) {\n const event = JSON.parse(message)\n const externalId = event.eventData.commandArgs.externalId\n const _message = this.generateShippingMessage(\n emitEvent,\n event,\n externalId\n )\n this.sendEvent(_message)\n\n if (event.eventName === 'trackShipment') {\n const eventData = {\n ..._message.eventData,\n trackingStatus: 'orderDelivered'\n }\n setTimeout(\n () =>\n this.sendEvent({\n ..._message,\n eventData,\n eventName: 'orderDelivered'\n }),\n 7000\n )\n }\n }\n return shippingCallback.bind(this)\n }\n}\n\nconst dispatcher = new EventDispatcher()\n\ndispatcher.registerCallback(\n 'inventoryChannel',\n Registry.inventoryCallbackFactory()\n)\n\ndispatcher.registerCallback(\n 'shippingChannel',\n Registry.shippingCallbackFactory()\n)\n\nexport default dispatcher\n","'use strict'\n\nconst uuid = require('../domain/util/utils').uuid\nconst SmartyStreetsSDK = require('smartystreets-javascript-sdk')\n\nconst SmartyStreetsCore = SmartyStreetsSDK.core\nconst Lookup = SmartyStreetsSDK.usStreet.Lookup\n\n// for Server-to-server requests, use this code:\nconst disabled = process.env.SMARTY_DISABLED || false\nconst authId = process.env.SMARTY_AUTH_ID\nconst authToken = process.env.SMARTY_AUTH_TOKEN\nconst credentials = new SmartyStreetsCore.StaticCredentials(authId, authToken)\n\nconst client = SmartyStreetsCore.buildClient.usStreet(credentials)\n\n/**\n * @typedef {{function(address):Promise}} Address\n */\nexport const Address = {\n // Documentation for input fields can be found at:\n // https://smartystreets.com/docs/us-street-api#input-fields\n\n async validateAddress (address) {\n console.log(`REAL validating address...${address}`)\n\n if (!address) {\n console.log('no address')\n return\n }\n\n if (disabled) {\n console.log('address service disabled')\n return address\n }\n\n try {\n let lookup = new Lookup()\n lookup.inputId = uuid()\n lookup.street = address\n lookup.maxCandidates = 1\n\n let response\n try {\n response = await client.send(lookup)\n } catch (error) {\n throw new Error(error)\n }\n\n const candidate = response.lookups[0].result[0]\n if (!candidate) {\n throw new Error('invalid address')\n }\n\n const validatedAddress = [\n candidate.deliveryLine1,\n candidate.deliveryLine2,\n candidate.lastLine\n ].join(' ')\n\n console.log(`address: ${validatedAddress}`)\n\n if (!validatedAddress) {\n throw new Error('invalid address')\n }\n return validatedAddress\n } catch (error) {\n console.error(error)\n throw new Error('Address service error', error.message)\n }\n }\n}\n","\"use strict\";\n\n// Build EventBus client for host\nimport { listen, notify } from \"../adapters\";\nimport { Event } from \"./event-service\";\n\nconst _notify = notify(Event);\nconst _listen = listen(Event);\nconst model = { listen: _listen };\n\nexport const EventBus = {\n notify(topic, message) {\n return _notify({ model, args: [topic, message] });\n },\n listen(options) {\n return _listen({ model, args: [options] });\n },\n};\n","\"use strict\";\n\nimport { Kafka } from \"kafkajs\";\n\nconst brokers = process.env.KAFKA_BROKERS || \"localhost:9092\";\nconst topics = new RegExp(process.env.KAFKA_TOPICS) || /Channel/;\nconst groupId = (process.env.KAFKA_GROUP_ID || \"MicroLib\") + process.pid;\n\nconst kafka = new Kafka({\n clientId: \"MicroLib\",\n brokers: brokers.split(\",\"),\n});\n\nconst consumer = kafka.consumer({ groupId });\nconst producer = kafka.producer();\n\n/**\n * @type {import('../adapters/event-adapter')}\n */\nexport const Event = {\n listening: false,\n topics,\n\n /**\n * Implements event consumer service.\n * @param {string|RegExp} topic\n * @param {function({message, topic})} callback\n */\n async listen(topic, callback) {\n try {\n await consumer.connect();\n await consumer.subscribe({ topic, fromBeginning: true });\n this.listening = true;\n await consumer.run({\n eachMessage: async ({ topic, message }) => {\n try {\n callback({\n topic,\n message: message.value.toString(),\n });\n } catch (error) {\n console.error(error);\n }\n },\n });\n } catch (error) {\n console.error(error);\n }\n },\n\n /**\n * Implemements event producer service.\n * @param {string|RegExp} topic\n * @param {string} message\n */\n async notify(topic, message) {\n try {\n await producer.connect();\n await producer.send({\n topic: topic,\n messages: [{ value: message }],\n });\n await producer.disconnect();\n } catch (error) {\n console.error({ func: this.notify.name, error });\n }\n },\n};\n","export * from \"./address-service\";\nexport * from \"./event-service\";\nexport * from \"./inventory-service\";\nexport * from \"./payment-service\";\nexport * from \"./shipping-service\";\nexport * from \"./event-bus\";","'use strict'\n\n// JSON.stringify({\n// eventType: \"Command\",\n// eventTime: new Date().toISOString(),\n// eventSource: \"orderService\",\n// eventData: {\n// replyChannel: \"orderChannel\",\n// commandName: \"pickOrder\",\n// commandArgs: {\n// }\n\n","\"use strict\";\n\n/**\n * @callback authorizePaymentType\n * @param {string} id\n * @param {number} amount\n * @param {string} source_id\n * @param {string} customer_id\n * @param {boolean} [autocomplete]\n * @returns {Promise}\n */\n\n/**\n * @typedef PaymentService\n * @property {authorizePaymentType} authorizePayment\n * @property {function()} completePayment\n * @property {function()} refundPayment\n */\n\n// import { Client, Environment, ApiError } from \"square\";\n\n// const client = new Client({\n// environment: Environment.Sandbox,\n// accessToken: process.env.SQUARE_ACCESS_TOKEN,\n// });\n\nexport const Payment = {\n /**\n * @type {authorizePaymentType}\n * @param {*} id\n * @param {*} amount\n * @param {*} source_id\n * @param {*} customer_id\n * @param {*} autocomplete\n * @param {*} currency\n */\n async authorizePayment(\n id,\n amount,\n source_id,\n customer_id,\n autocomplete = false,\n currency = \"USD\"\n ) {\n const payload = {\n idempotency_key: id,\n amount_money: {\n amount,\n currency,\n },\n source_id,\n autocomplete,\n customer_id,\n location_id: \"XK3DBG77NJBFX\",\n reference_id: \"123456\",\n note: \"Brief description\",\n app_fee_money: {\n amount: 10,\n currency: \"USD\",\n },\n };\n /*\n const bodyAmountMoney = {};\n bodyAmountMoney.amount = 200;\n bodyAmountMoney.currency = \"USD\";\n\n const bodyTipMoney = {};\n bodyTipMoney.amount = 198;\n bodyTipMoney.currency = \"CHF\";\n\n const bodyAppFeeMoney = {};\n bodyAppFeeMoney.amount = 10;\n bodyAppFeeMoney.currency = \"USD\";\n\n const body = {\n sourceId: \"ccof:uIbfJXhXETSP197M3GB\",\n idempotencyKey: \"4935a656-a929-4792-b97c-8848be85c27c\",\n amountMoney: bodyAmountMoney,\n };\n\n body.tipMoney = bodyTipMoney;\n body.appFeeMoney = bodyAppFeeMoney;\n body.delayDuration = \"delay_duration6\";\n body.autocomplete = true;\n body.orderId = \"order_id0\";\n body.customerId = \"VDKXEEKPJN48QDG3BGGFAK05P8\";\n body.locationId = \"XK3DBG77NJBFX\";\n body.referenceId = \"123456\";\n body.note = \"Brief description\";\n\n // try {\n // const {\n // result,\n // ...httpResponse\n // } = await client.paymentsApi.createPayment(body);\n // // Get more response info...\n // // const { statusCode, headers } = httpResponse;\n // } catch (error) {\n // if (error instanceof ApiError) {\n // const errors = error.result;\n // // const { statusCode, headers } = error;\n // }\n // }\n */\n return \"1234\";\n },\n\n /*\n const response ={\n \"payment\": {\n \"id\": \"GQTFp1ZlXdpoW4o6eGiZhbjosiDFf\",\n \"created_at\": \"2019-07-10T13:23:49.154Z\",\n \"updated_at\": \"2019-07-10T13:23:49.446Z\",\n \"amount_money\": {\n \"amount\": 200,\n \"currency\": \"USD\"\n },\n \"app_fee_money\": {\n \"amount\": 10,\n \"currency\": \"USD\"\n },\n \"total_money\": {\n \"amount\": 200,\n \"currency\": \"USD\"\n },\n \"status\": \"COMPLETED\",\n \"source_type\": \"CARD\",\n \"card_details\": {\n \"status\": \"CAPTURED\",\n \"card\": {\n \"card_brand\": \"VISA\",\n \"last_4\": \"1111\",\n \"exp_month\": 7,\n \"exp_year\": 2026,\n \"fingerprint\": \"sq-1-TpmjbNBMFdibiIjpQI5LiRgNUBC7u1689i0TgHjnlyHEWYB7tnn-K4QbW4ttvtaqXw\",\n \"card_type\": \"DEBIT\",\n \"prepaid_type\": \"PREPAID\",\n \"bin\": \"411111\"\n },\n \"entry_method\": \"ON_FILE\",\n \"cvv_status\": \"CVV_ACCEPTED\",\n \"avs_status\": \"AVS_ACCEPTED\",\n \"auth_result_code\": \"nsAyY2\",\n \"statement_description\": \"SQ *MY MERCHANT\"\n },\n \"location_id\": \"XTI0H92143A39\",\n \"order_id\": \"m2Hr8Hk8A3CTyQQ1k4ynExg92tO3\",\n \"reference_id\": \"123456\",\n \"note\": \"Brief description\",\n \"customer_id\": \"RDX9Z4XTIZR7MRZJUXNY9HUK6I\",\n \"receipt_number\": \"GQTF\",\n \"receipt_url\": \"https://squareup.com/receipt/preview/GQTFp1ZlXdpoW4o6eGiZhbjosiDFf\"\n }\n}\n /*\n{\n \"errors\": [\n {\n \"code\": \"VALUE_EMPTY\",\n \"detail\": \"Field must not be blank\",\n \"field\": \"source_id\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n },\n {\n \"code\": \"VALUE_EMPTY\",\n \"detail\": \"Field must not be blank\",\n \"field\": \"idempotency_key\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n },\n {\n \"code\": \"MISSING_REQUIRED_PARAMETER\",\n \"detail\": \"Field must be set\",\n \"field\": \"amount_money\",\n \"category\": \"INVALID_REQUEST_ERROR\"\n }\n ]\n}\n */\n\n async completePayment(model) {\n console.log(\"REAL completing payment: %s\", model.orderNo);\n return \"1234\";\n },\n\n async refundPayment(model) {\n console.log(\"REAL refunding payment: %s\", model.orderNo);\n },\n};\n","\"use strict\";\n\n/**\n * @typedef {import('../adapters/event-adapter').EventMessage} EventMessage\n */\n\n/**\n * @typedef {import('../adapters/event-adapter').CommandEvent} CommandEvent\n */\n\n/**\n * @callback shipOrder\n * @param {string} shipTo\n * @param {string} shipFrom\n * @param {string} lineItems\n * @param {string} signature\n * @param {string} externalId\n * @param {string} requester\n * @param {string} respondOn\n * @returns {EventMessage}\n */\n\n/**\n * @callback trackShipment\n * @param {string} shipmentId\n * @param {string} externalId\n * @param {string} requester\n * @param {string} respondOn\n * @returns {EventMessage}\n */\n\n/**\n * @typedef {string} functionName\n */\n\n/**\n * @typedef {Object} shippingService formats and parses shipping event messages\n * @property {string} serviceName - programmatic service name in eventSource/Target\n * @property {string} topic - event topic \"shippingChannel\" when sending messasges\n * @property {shipOrder} shipOrder - format event message requesting shipping label and pickup of order\n * @property {trackShipment} trackShipment - report on location/status of parcel\n * @property {function():EventMessage} verifyDelivery - ensure customer recieved parcel\n * @property {function():EventMessage} returnShipment - return to sender if refunding\n * @property {function(functionName,EventMessage):{[key]:string}} getPayload - extract payload\n */\n\nfunction createEventMessage({ requester, service, type, name, id, data }) {\n return {\n eventSource: requester,\n eventTarget: service,\n eventType: type,\n eventName: name,\n eventTime: new Date().getTime(),\n eventUuid: id,\n eventData: data,\n };\n}\n\nfunction createCommandEvent(name, topic, args) {\n return {\n commandName: name,\n commandResp: topic,\n commandArgs: { ...args },\n };\n}\n\n/**\n * Shipping service events\n * @type {shippingService}\n */\nexport const Shipping = {\n serviceName: \"shippingService\",\n topic: \"shippingChannel\",\n\n /**\n *\n * @param {*} param0\n * @returns {shipMessage}\n */\n shipOrder({\n shipTo,\n shipFrom,\n lineItems,\n signature,\n externalId,\n requester,\n respondOn,\n }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.shipOrder.name,\n id: externalId,\n data: createCommandEvent(this.shipOrder.name, respondOn, {\n shipTo,\n shipFrom,\n lineItems,\n signature,\n externalId,\n }),\n });\n },\n\n /**\n *\n * @param {*} param0\n * @returns {EventMessage}\n */\n trackShipment({ externalId, shipmentId, trackingId, requester, respondOn }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.trackShipment.name,\n id: externalId,\n data: createCommandEvent(this.trackShipment.name, respondOn, {\n externalId,\n shipmentId,\n trackingId,\n }),\n });\n },\n\n /**\n *\n * @param {*} param0\n * @returns {EventMessage}\n */\n verifyDelivery({ requester, respondOn, trackingId, externalId }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n name: this.verifyDelivery.name,\n id: externalId,\n data: createCommandEvent(this.verifyDelivery.name, respondOn, {\n externalId,\n trackingId,\n }),\n });\n },\n\n returnShipment({ requester, respondOn, shipmentId, externalId }) {\n return createEventMessage({\n requester,\n service: this.serviceName,\n type: \"command\",\n id: externalId,\n name: this.returnShipment.name,\n data: createCommandEvent(this.returnShipment, respondOn, {\n shipmentId,\n externalId,\n }),\n });\n },\n\n getPayload(func, event) {\n const payloads = {\n [this.shipOrder.name]: {\n shipmentId: event.eventData.shipmentId,\n },\n [this.trackShipment.name]: {\n trackingId: event.eventData.trackingId,\n trackingStatus: event.eventData.trackingStatus,\n },\n [this.verifyDelivery.name]: {\n proofOfDelivery: event.eventData.proofOfDelivery,\n },\n };\n return payloads[func];\n },\n\n getProperty(event, key) {\n return event.eventData[key];\n },\n};\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar deprecate = require('depd')('body-parser')\n\n/**\n * Cache of loaded parsers.\n * @private\n */\n\nvar parsers = Object.create(null)\n\n/**\n * @typedef Parsers\n * @type {function}\n * @property {function} json\n * @property {function} raw\n * @property {function} text\n * @property {function} urlencoded\n */\n\n/**\n * Module exports.\n * @type {Parsers}\n */\n\nexports = module.exports = deprecate.function(bodyParser,\n 'bodyParser: use individual json/urlencoded middlewares')\n\n/**\n * JSON parser.\n * @public\n */\n\nObject.defineProperty(exports, 'json', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('json')\n})\n\n/**\n * Raw parser.\n * @public\n */\n\nObject.defineProperty(exports, 'raw', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('raw')\n})\n\n/**\n * Text parser.\n * @public\n */\n\nObject.defineProperty(exports, 'text', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('text')\n})\n\n/**\n * URL-encoded parser.\n * @public\n */\n\nObject.defineProperty(exports, 'urlencoded', {\n configurable: true,\n enumerable: true,\n get: createParserGetter('urlencoded')\n})\n\n/**\n * Create a middleware to parse json and urlencoded bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @deprecated\n * @public\n */\n\nfunction bodyParser (options) {\n // use default type for parsers\n var opts = Object.create(options || null, {\n type: {\n configurable: true,\n enumerable: true,\n value: undefined,\n writable: true\n }\n })\n\n var _urlencoded = exports.urlencoded(opts)\n var _json = exports.json(opts)\n\n return function bodyParser (req, res, next) {\n _json(req, res, function (err) {\n if (err) return next(err)\n _urlencoded(req, res, next)\n })\n }\n}\n\n/**\n * Create a getter for loading a parser.\n * @private\n */\n\nfunction createParserGetter (name) {\n return function get () {\n return loadParser(name)\n }\n}\n\n/**\n * Load a parser module.\n * @private\n */\n\nfunction loadParser (parserName) {\n var parser = parsers[parserName]\n\n if (parser !== undefined) {\n return parser\n }\n\n // this uses a switch for static require analysis\n switch (parserName) {\n case 'json':\n parser = require('./lib/types/json')\n break\n case 'raw':\n parser = require('./lib/types/raw')\n break\n case 'text':\n parser = require('./lib/types/text')\n break\n case 'urlencoded':\n parser = require('./lib/types/urlencoded')\n break\n }\n\n // store to prevent invoking require()\n return (parsers[parserName] = parser)\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = require('http-errors')\nvar destroy = require('destroy')\nvar getBody = require('raw-body')\nvar iconv = require('iconv-lite')\nvar onFinished = require('on-finished')\nvar unpipe = require('unpipe')\nvar zlib = require('zlib')\n\n/**\n * Module exports.\n */\n\nmodule.exports = read\n\n/**\n * Read a request into a buffer and parse.\n *\n * @param {object} req\n * @param {object} res\n * @param {function} next\n * @param {function} parse\n * @param {function} debug\n * @param {object} options\n * @private\n */\n\nfunction read (req, res, next, parse, debug, options) {\n var length\n var opts = options\n var stream\n\n // flag as parsed\n req._body = true\n\n // read options\n var encoding = opts.encoding !== null\n ? opts.encoding\n : null\n var verify = opts.verify\n\n try {\n // get the content stream\n stream = contentstream(req, debug, opts.inflate)\n length = stream.length\n stream.length = undefined\n } catch (err) {\n return next(err)\n }\n\n // set raw-body options\n opts.length = length\n opts.encoding = verify\n ? null\n : encoding\n\n // assert charset is supported\n if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {\n return next(createError(415, 'unsupported charset \"' + encoding.toUpperCase() + '\"', {\n charset: encoding.toLowerCase(),\n type: 'charset.unsupported'\n }))\n }\n\n // read body\n debug('read body')\n getBody(stream, opts, function (error, body) {\n if (error) {\n var _error\n\n if (error.type === 'encoding.unsupported') {\n // echo back charset\n _error = createError(415, 'unsupported charset \"' + encoding.toUpperCase() + '\"', {\n charset: encoding.toLowerCase(),\n type: 'charset.unsupported'\n })\n } else {\n // set status code on error\n _error = createError(400, error)\n }\n\n // unpipe from stream and destroy\n if (stream !== req) {\n unpipe(req)\n destroy(stream, true)\n }\n\n // read off entire request\n dump(req, function onfinished () {\n next(createError(400, _error))\n })\n return\n }\n\n // verify\n if (verify) {\n try {\n debug('verify body')\n verify(req, res, body, encoding)\n } catch (err) {\n next(createError(403, err, {\n body: body,\n type: err.type || 'entity.verify.failed'\n }))\n return\n }\n }\n\n // parse\n var str = body\n try {\n debug('parse body')\n str = typeof body !== 'string' && encoding !== null\n ? iconv.decode(body, encoding)\n : body\n req.body = parse(str)\n } catch (err) {\n next(createError(400, err, {\n body: str,\n type: err.type || 'entity.parse.failed'\n }))\n return\n }\n\n next()\n })\n}\n\n/**\n * Get the content stream of the request.\n *\n * @param {object} req\n * @param {function} debug\n * @param {boolean} [inflate=true]\n * @return {object}\n * @api private\n */\n\nfunction contentstream (req, debug, inflate) {\n var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()\n var length = req.headers['content-length']\n var stream\n\n debug('content-encoding \"%s\"', encoding)\n\n if (inflate === false && encoding !== 'identity') {\n throw createError(415, 'content encoding unsupported', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n\n switch (encoding) {\n case 'deflate':\n stream = zlib.createInflate()\n debug('inflate body')\n req.pipe(stream)\n break\n case 'gzip':\n stream = zlib.createGunzip()\n debug('gunzip body')\n req.pipe(stream)\n break\n case 'identity':\n stream = req\n stream.length = length\n break\n default:\n throw createError(415, 'unsupported content encoding \"' + encoding + '\"', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n\n return stream\n}\n\n/**\n * Dump the contents of a request.\n *\n * @param {object} req\n * @param {function} callback\n * @api private\n */\n\nfunction dump (req, callback) {\n if (onFinished.isFinished(req)) {\n callback(null)\n } else {\n onFinished(req, callback)\n req.resume()\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar createError = require('http-errors')\nvar debug = require('debug')('body-parser:json')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = json\n\n/**\n * RegExp to match the first non-space in a string.\n *\n * Allowed whitespace is defined in RFC 7159:\n *\n * ws = *(\n * %x20 / ; Space\n * %x09 / ; Horizontal tab\n * %x0A / ; Line feed or New line\n * %x0D ) ; Carriage return\n */\n\nvar FIRST_CHAR_REGEXP = /^[\\x20\\x09\\x0a\\x0d]*([^\\x20\\x09\\x0a\\x0d])/ // eslint-disable-line no-control-regex\n\n/**\n * Create a middleware to parse JSON bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction json (options) {\n var opts = options || {}\n\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var inflate = opts.inflate !== false\n var reviver = opts.reviver\n var strict = opts.strict !== false\n var type = opts.type || 'application/json'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (body) {\n if (body.length === 0) {\n // special-case empty json body, as it's a common client-side mistake\n // TODO: maybe make this configurable or part of \"strict\" option\n return {}\n }\n\n if (strict) {\n var first = firstchar(body)\n\n if (first !== '{' && first !== '[') {\n debug('strict violation')\n throw createStrictSyntaxError(body, first)\n }\n }\n\n try {\n debug('parse json')\n return JSON.parse(body, reviver)\n } catch (e) {\n throw normalizeJsonSyntaxError(e, {\n message: e.message,\n stack: e.stack\n })\n }\n }\n\n return function jsonParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // assert charset per RFC 7159 sec 8.1\n var charset = getCharset(req) || 'utf-8'\n if (charset.slice(0, 4) !== 'utf-') {\n debug('invalid charset')\n next(createError(415, 'unsupported charset \"' + charset.toUpperCase() + '\"', {\n charset: charset,\n type: 'charset.unsupported'\n }))\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Create strict violation syntax error matching native error.\n *\n * @param {string} str\n * @param {string} char\n * @return {Error}\n * @private\n */\n\nfunction createStrictSyntaxError (str, char) {\n var index = str.indexOf(char)\n var partial = index !== -1\n ? str.substring(0, index) + '#'\n : ''\n\n try {\n JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')\n } catch (e) {\n return normalizeJsonSyntaxError(e, {\n message: e.message.replace('#', char),\n stack: e.stack\n })\n }\n}\n\n/**\n * Get the first non-whitespace character in a string.\n *\n * @param {string} str\n * @return {function}\n * @private\n */\n\nfunction firstchar (str) {\n var match = FIRST_CHAR_REGEXP.exec(str)\n\n return match\n ? match[1]\n : undefined\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Normalize a SyntaxError for JSON.parse.\n *\n * @param {SyntaxError} error\n * @param {object} obj\n * @return {SyntaxError}\n */\n\nfunction normalizeJsonSyntaxError (error, obj) {\n var keys = Object.getOwnPropertyNames(error)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key !== 'stack' && key !== 'message') {\n delete error[key]\n }\n }\n\n // replace stack before message for Node.js 0.10 and below\n error.stack = obj.stack.replace(error.message, obj.message)\n error.message = obj.message\n\n return error\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n */\n\nvar bytes = require('bytes')\nvar debug = require('debug')('body-parser:raw')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = raw\n\n/**\n * Create a middleware to parse raw bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @api public\n */\n\nfunction raw (options) {\n var opts = options || {}\n\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'application/octet-stream'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (buf) {\n return buf\n }\n\n return function rawParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n encoding: null,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar debug = require('debug')('body-parser:text')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = text\n\n/**\n * Create a middleware to parse text bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @api public\n */\n\nfunction text (options) {\n var opts = options || {}\n\n var defaultCharset = opts.defaultCharset || 'utf-8'\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'text/plain'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (buf) {\n return buf\n }\n\n return function textParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // get charset\n var charset = getCharset(req) || defaultCharset\n\n // read\n read(req, res, next, parse, debug, {\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar bytes = require('bytes')\nvar contentType = require('content-type')\nvar createError = require('http-errors')\nvar debug = require('debug')('body-parser:urlencoded')\nvar deprecate = require('depd')('body-parser')\nvar read = require('../read')\nvar typeis = require('type-is')\n\n/**\n * Module exports.\n */\n\nmodule.exports = urlencoded\n\n/**\n * Cache of parser modules.\n */\n\nvar parsers = Object.create(null)\n\n/**\n * Create a middleware to parse urlencoded bodies.\n *\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction urlencoded (options) {\n var opts = options || {}\n\n // notice because option default will flip in next major\n if (opts.extended === undefined) {\n deprecate('undefined extended: provide extended option')\n }\n\n var extended = opts.extended !== false\n var inflate = opts.inflate !== false\n var limit = typeof opts.limit !== 'number'\n ? bytes.parse(opts.limit || '100kb')\n : opts.limit\n var type = opts.type || 'application/x-www-form-urlencoded'\n var verify = opts.verify || false\n\n if (verify !== false && typeof verify !== 'function') {\n throw new TypeError('option verify must be function')\n }\n\n // create the appropriate query parser\n var queryparse = extended\n ? extendedparser(opts)\n : simpleparser(opts)\n\n // create the appropriate type checking function\n var shouldParse = typeof type !== 'function'\n ? typeChecker(type)\n : type\n\n function parse (body) {\n return body.length\n ? queryparse(body)\n : {}\n }\n\n return function urlencodedParser (req, res, next) {\n if (req._body) {\n debug('body already parsed')\n next()\n return\n }\n\n req.body = req.body || {}\n\n // skip requests without bodies\n if (!typeis.hasBody(req)) {\n debug('skip empty body')\n next()\n return\n }\n\n debug('content-type %j', req.headers['content-type'])\n\n // determine if request should be parsed\n if (!shouldParse(req)) {\n debug('skip parsing')\n next()\n return\n }\n\n // assert charset\n var charset = getCharset(req) || 'utf-8'\n if (charset !== 'utf-8') {\n debug('invalid charset')\n next(createError(415, 'unsupported charset \"' + charset.toUpperCase() + '\"', {\n charset: charset,\n type: 'charset.unsupported'\n }))\n return\n }\n\n // read\n read(req, res, next, parse, debug, {\n debug: debug,\n encoding: charset,\n inflate: inflate,\n limit: limit,\n verify: verify\n })\n }\n}\n\n/**\n * Get the extended query parser.\n *\n * @param {object} options\n */\n\nfunction extendedparser (options) {\n var parameterLimit = options.parameterLimit !== undefined\n ? options.parameterLimit\n : 1000\n var parse = parser('qs')\n\n if (isNaN(parameterLimit) || parameterLimit < 1) {\n throw new TypeError('option parameterLimit must be a positive number')\n }\n\n if (isFinite(parameterLimit)) {\n parameterLimit = parameterLimit | 0\n }\n\n return function queryparse (body) {\n var paramCount = parameterCount(body, parameterLimit)\n\n if (paramCount === undefined) {\n debug('too many parameters')\n throw createError(413, 'too many parameters', {\n type: 'parameters.too.many'\n })\n }\n\n var arrayLimit = Math.max(100, paramCount)\n\n debug('parse extended urlencoding')\n return parse(body, {\n allowPrototypes: true,\n arrayLimit: arrayLimit,\n depth: Infinity,\n parameterLimit: parameterLimit\n })\n }\n}\n\n/**\n * Get the charset of a request.\n *\n * @param {object} req\n * @api private\n */\n\nfunction getCharset (req) {\n try {\n return (contentType.parse(req).parameters.charset || '').toLowerCase()\n } catch (e) {\n return undefined\n }\n}\n\n/**\n * Count the number of parameters, stopping once limit reached\n *\n * @param {string} body\n * @param {number} limit\n * @api private\n */\n\nfunction parameterCount (body, limit) {\n var count = 0\n var index = 0\n\n while ((index = body.indexOf('&', index)) !== -1) {\n count++\n index++\n\n if (count === limit) {\n return undefined\n }\n }\n\n return count\n}\n\n/**\n * Get parser for module name dynamically.\n *\n * @param {string} name\n * @return {function}\n * @api private\n */\n\nfunction parser (name) {\n var mod = parsers[name]\n\n if (mod !== undefined) {\n return mod.parse\n }\n\n // this uses a switch for static require analysis\n switch (name) {\n case 'qs':\n mod = require('qs')\n break\n case 'querystring':\n mod = require('querystring')\n break\n }\n\n // store to prevent invoking require()\n parsers[name] = mod\n\n return mod.parse\n}\n\n/**\n * Get the simple query parser.\n *\n * @param {object} options\n */\n\nfunction simpleparser (options) {\n var parameterLimit = options.parameterLimit !== undefined\n ? options.parameterLimit\n : 1000\n var parse = parser('querystring')\n\n if (isNaN(parameterLimit) || parameterLimit < 1) {\n throw new TypeError('option parameterLimit must be a positive number')\n }\n\n if (isFinite(parameterLimit)) {\n parameterLimit = parameterLimit | 0\n }\n\n return function queryparse (body) {\n var paramCount = parameterCount(body, parameterLimit)\n\n if (paramCount === undefined) {\n debug('too many parameters')\n throw createError(413, 'too many parameters', {\n type: 'parameters.too.many'\n })\n }\n\n debug('parse urlencoding')\n return parse(body, undefined, undefined, { maxKeys: parameterLimit })\n }\n}\n\n/**\n * Get the simple type checker.\n *\n * @param {string} type\n * @return {function}\n */\n\nfunction typeChecker (type) {\n return function checkType (req) {\n return Boolean(typeis(req, type))\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","'use strict';\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nconst mask = (source, mask, output, offset, length) => {\n for (var i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n};\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nconst unmask = (buffer, mask) => {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (var i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n};\n\nmodule.exports = { mask, unmask };\n","'use strict';\n\ntry {\n module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n module.exports = require('./fallback');\n}\n","/*!\n * bytes\n * Copyright(c) 2012-2014 TJ Holowaychuk\n * Copyright(c) 2015 Jed Watson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = bytes;\nmodule.exports.format = format;\nmodule.exports.parse = parse;\n\n/**\n * Module variables.\n * @private\n */\n\nvar formatThousandsRegExp = /\\B(?=(\\d{3})+(?!\\d))/g;\n\nvar formatDecimalsRegExp = /(?:\\.0*|(\\.[^0]+)0+)$/;\n\nvar map = {\n b: 1,\n kb: 1 << 10,\n mb: 1 << 20,\n gb: 1 << 30,\n tb: Math.pow(1024, 4),\n pb: Math.pow(1024, 5),\n};\n\nvar parseRegExp = /^((-|\\+)?(\\d+(?:\\.\\d+)?)) *(kb|mb|gb|tb|pb)$/i;\n\n/**\n * Convert the given value in bytes into a string or parse to string to an integer in bytes.\n *\n * @param {string|number} value\n * @param {{\n * case: [string],\n * decimalPlaces: [number]\n * fixedDecimals: [boolean]\n * thousandsSeparator: [string]\n * unitSeparator: [string]\n * }} [options] bytes options.\n *\n * @returns {string|number|null}\n */\n\nfunction bytes(value, options) {\n if (typeof value === 'string') {\n return parse(value);\n }\n\n if (typeof value === 'number') {\n return format(value, options);\n }\n\n return null;\n}\n\n/**\n * Format the given value in bytes into a string.\n *\n * If the value is negative, it is kept as such. If it is a float,\n * it is rounded.\n *\n * @param {number} value\n * @param {object} [options]\n * @param {number} [options.decimalPlaces=2]\n * @param {number} [options.fixedDecimals=false]\n * @param {string} [options.thousandsSeparator=]\n * @param {string} [options.unit=]\n * @param {string} [options.unitSeparator=]\n *\n * @returns {string|null}\n * @public\n */\n\nfunction format(value, options) {\n if (!Number.isFinite(value)) {\n return null;\n }\n\n var mag = Math.abs(value);\n var thousandsSeparator = (options && options.thousandsSeparator) || '';\n var unitSeparator = (options && options.unitSeparator) || '';\n var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;\n var fixedDecimals = Boolean(options && options.fixedDecimals);\n var unit = (options && options.unit) || '';\n\n if (!unit || !map[unit.toLowerCase()]) {\n if (mag >= map.pb) {\n unit = 'PB';\n } else if (mag >= map.tb) {\n unit = 'TB';\n } else if (mag >= map.gb) {\n unit = 'GB';\n } else if (mag >= map.mb) {\n unit = 'MB';\n } else if (mag >= map.kb) {\n unit = 'KB';\n } else {\n unit = 'B';\n }\n }\n\n var val = value / map[unit.toLowerCase()];\n var str = val.toFixed(decimalPlaces);\n\n if (!fixedDecimals) {\n str = str.replace(formatDecimalsRegExp, '$1');\n }\n\n if (thousandsSeparator) {\n str = str.split('.').map(function (s, i) {\n return i === 0\n ? s.replace(formatThousandsRegExp, thousandsSeparator)\n : s\n }).join('.');\n }\n\n return str + unitSeparator + unit;\n}\n\n/**\n * Parse the string value into an integer in bytes.\n *\n * If no unit is given, it is assumed the value is in bytes.\n *\n * @param {number|string} val\n *\n * @returns {number|null}\n * @public\n */\n\nfunction parse(val) {\n if (typeof val === 'number' && !isNaN(val)) {\n return val;\n }\n\n if (typeof val !== 'string') {\n return null;\n }\n\n // Test if the string passed is valid\n var results = parseRegExp.exec(val);\n var floatValue;\n var unit = 'b';\n\n if (!results) {\n // Nothing could be extracted from the given string\n floatValue = parseInt(val, 10);\n unit = 'b'\n } else {\n // Retrieve the value and the unit\n floatValue = parseFloat(results[1]);\n unit = results[4].toLowerCase();\n }\n\n if (isNaN(floatValue)) {\n return null;\n }\n\n return Math.floor(map[unit] * floatValue);\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","/*!\n * content-disposition\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = contentDisposition\nmodule.exports.parse = parse\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar basename = require('path').basename\nvar Buffer = require('safe-buffer').Buffer\n\n/**\n * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including \"%\")\n * @private\n */\n\nvar ENCODE_URL_ATTR_CHAR_REGEXP = /[\\x00-\\x20\"'()*,/:;<=>?@[\\\\\\]{}\\x7f]/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match percent encoding escape.\n * @private\n */\n\nvar HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/\nvar HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g\n\n/**\n * RegExp to match non-latin1 characters.\n * @private\n */\n\nvar NON_LATIN1_REGEXP = /[^\\x20-\\x7e\\xa0-\\xff]/g\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * @private\n */\n\nvar QESC_REGEXP = /\\\\([\\u0000-\\u007f])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n * @private\n */\n\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp for various RFC 2616 grammar\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = >\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * TEXT = \n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = \n * LF = \n * SP = \n * HT = \n * CTL = \n * OCTET = \n * @private\n */\n\nvar PARAM_REGEXP = /;[\\x09\\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*=[\\x09\\x20]*(\"(?:[\\x20!\\x23-\\x5b\\x5d-\\x7e\\x80-\\xff]|\\\\[\\x20-\\x7e])*\"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*/g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\x20-\\x7e\\x80-\\xff]+$/\nvar TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/\n\n/**\n * RegExp for various RFC 5987 grammar\n *\n * ext-value = charset \"'\" [ language ] \"'\" value-chars\n * charset = \"UTF-8\" / \"ISO-8859-1\" / mime-charset\n * mime-charset = 1*mime-charsetc\n * mime-charsetc = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"%\" / \"&\"\n * / \"+\" / \"-\" / \"^\" / \"_\" / \"`\"\n * / \"{\" / \"}\" / \"~\"\n * language = ( 2*3ALPHA [ extlang ] )\n * / 4ALPHA\n * / 5*8ALPHA\n * extlang = *3( \"-\" 3ALPHA )\n * value-chars = *( pct-encoded / attr-char )\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * attr-char = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"&\" / \"+\" / \"-\" / \".\"\n * / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * @private\n */\n\nvar EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/\n\n/**\n * RegExp for various RFC 6266 grammar\n *\n * disposition-type = \"inline\" | \"attachment\" | disp-ext-type\n * disp-ext-type = token\n * disposition-parm = filename-parm | disp-ext-parm\n * filename-parm = \"filename\" \"=\" value\n * | \"filename*\" \"=\" ext-value\n * disp-ext-parm = token \"=\" value\n * | ext-token \"=\" ext-value\n * ext-token = \n * @private\n */\n\nvar DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*(?:$|;)/ // eslint-disable-line no-control-regex\n\n/**\n * Create an attachment Content-Disposition header.\n *\n * @param {string} [filename]\n * @param {object} [options]\n * @param {string} [options.type=attachment]\n * @param {string|boolean} [options.fallback=true]\n * @return {string}\n * @public\n */\n\nfunction contentDisposition (filename, options) {\n var opts = options || {}\n\n // get type\n var type = opts.type || 'attachment'\n\n // get parameters\n var params = createparams(filename, opts.fallback)\n\n // format into string\n return format(new ContentDisposition(type, params))\n}\n\n/**\n * Create parameters object from filename and fallback.\n *\n * @param {string} [filename]\n * @param {string|boolean} [fallback=true]\n * @return {object}\n * @private\n */\n\nfunction createparams (filename, fallback) {\n if (filename === undefined) {\n return\n }\n\n var params = {}\n\n if (typeof filename !== 'string') {\n throw new TypeError('filename must be a string')\n }\n\n // fallback defaults to true\n if (fallback === undefined) {\n fallback = true\n }\n\n if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {\n throw new TypeError('fallback must be a string or boolean')\n }\n\n if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {\n throw new TypeError('fallback must be ISO-8859-1 string')\n }\n\n // restrict to file base name\n var name = basename(filename)\n\n // determine if name is suitable for quoted string\n var isQuotedString = TEXT_REGEXP.test(name)\n\n // generate fallback name\n var fallbackName = typeof fallback !== 'string'\n ? fallback && getlatin1(name)\n : basename(fallback)\n var hasFallback = typeof fallbackName === 'string' && fallbackName !== name\n\n // set extended filename parameter\n if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {\n params['filename*'] = name\n }\n\n // set filename parameter\n if (isQuotedString || hasFallback) {\n params.filename = hasFallback\n ? fallbackName\n : name\n }\n\n return params\n}\n\n/**\n * Format object to Content-Disposition header.\n *\n * @param {object} obj\n * @param {string} obj.type\n * @param {object} [obj.parameters]\n * @return {string}\n * @private\n */\n\nfunction format (obj) {\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n // start with normalized type\n var string = String(type).toLowerCase()\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n var val = param.substr(-1) === '*'\n ? ustring(parameters[param])\n : qstring(parameters[param])\n\n string += '; ' + param + '=' + val\n }\n }\n\n return string\n}\n\n/**\n * Decode a RFC 5987 field value (gracefully).\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction decodefield (str) {\n var match = EXT_VALUE_REGEXP.exec(str)\n\n if (!match) {\n throw new TypeError('invalid extended field value')\n }\n\n var charset = match[1].toLowerCase()\n var encoded = match[2]\n var value\n\n // to binary string\n var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode)\n\n switch (charset) {\n case 'iso-8859-1':\n value = getlatin1(binary)\n break\n case 'utf-8':\n value = Buffer.from(binary, 'binary').toString('utf8')\n break\n default:\n throw new TypeError('unsupported charset in extended field')\n }\n\n return value\n}\n\n/**\n * Get ISO-8859-1 version of string.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction getlatin1 (val) {\n // simple Unicode -> ISO-8859-1 transformation\n return String(val).replace(NON_LATIN1_REGEXP, '?')\n}\n\n/**\n * Parse Content-Disposition header string.\n *\n * @param {string} string\n * @return {object}\n * @public\n */\n\nfunction parse (string) {\n if (!string || typeof string !== 'string') {\n throw new TypeError('argument string is required')\n }\n\n var match = DISPOSITION_TYPE_REGEXP.exec(string)\n\n if (!match) {\n throw new TypeError('invalid type format')\n }\n\n // normalize type\n var index = match[0].length\n var type = match[1].toLowerCase()\n\n var key\n var names = []\n var params = {}\n var value\n\n // calculate index to start at\n index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';'\n ? index - 1\n : index\n\n // match parameters\n while ((match = PARAM_REGEXP.exec(string))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (names.indexOf(key) !== -1) {\n throw new TypeError('invalid duplicate parameter')\n }\n\n names.push(key)\n\n if (key.indexOf('*') + 1 === key.length) {\n // decode extended value\n key = key.slice(0, -1)\n value = decodefield(value)\n\n // overwrite existing value\n params[key] = value\n continue\n }\n\n if (typeof params[key] === 'string') {\n continue\n }\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .substr(1, value.length - 2)\n .replace(QESC_REGEXP, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n return new ContentDisposition(type, params)\n}\n\n/**\n * Percent decode a single character.\n *\n * @param {string} str\n * @param {string} hex\n * @return {string}\n * @private\n */\n\nfunction pdecode (str, hex) {\n return String.fromCharCode(parseInt(hex, 16))\n}\n\n/**\n * Percent encode a single character.\n *\n * @param {string} char\n * @return {string}\n * @private\n */\n\nfunction pencode (char) {\n return '%' + String(char)\n .charCodeAt(0)\n .toString(16)\n .toUpperCase()\n}\n\n/**\n * Quote a string for HTTP.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Encode a Unicode string for HTTP (RFC 5987).\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction ustring (val) {\n var str = String(val)\n\n // percent encode as UTF-8\n var encoded = encodeURIComponent(str)\n .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)\n\n return 'UTF-8\\'\\'' + encoded\n}\n\n/**\n * Class for parsed Content-Disposition header for v8 optimization\n *\n * @public\n * @param {string} type\n * @param {object} parameters\n * @constructor\n */\n\nfunction ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}\n","/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * RegExp to match *( \";\" parameter ) in RFC 7231 sec 3.1.1.1\n *\n * parameter = token \"=\" ( token / quoted-string )\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n * / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * / DIGIT / ALPHA\n * ; any VCHAR, except delimiters\n * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE\n * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text\n * obs-text = %x80-FF\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n */\nvar PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *(\"(?:[\\u000b\\u0020\\u0021\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u000b\\u0020-\\u00ff])*\"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\u000b\\u0020-\\u007e\\u0080-\\u00ff]+$/ // eslint-disable-line no-control-regex\nvar TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/\n\n/**\n * RegExp to match quoted-pair in RFC 7230 sec 3.2.6\n *\n * quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n * obs-text = %x80-FF\n */\nvar QESC_REGEXP = /\\\\([\\u000b\\u0020-\\u00ff])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6\n */\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp to match type in RFC 7231 sec 3.1.1.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nvar TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/\n\n/**\n * Module exports.\n * @public\n */\n\nexports.format = format\nexports.parse = parse\n\n/**\n * Format object to media type.\n *\n * @param {object} obj\n * @return {string}\n * @public\n */\n\nfunction format (obj) {\n if (!obj || typeof obj !== 'object') {\n throw new TypeError('argument obj is required')\n }\n\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n var string = type\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError('invalid parameter name')\n }\n\n string += '; ' + param + '=' + qstring(parameters[param])\n }\n }\n\n return string\n}\n\n/**\n * Parse media type to object.\n *\n * @param {string|object} string\n * @return {Object}\n * @public\n */\n\nfunction parse (string) {\n if (!string) {\n throw new TypeError('argument string is required')\n }\n\n // support req/res-like objects as argument\n var header = typeof string === 'object'\n ? getcontenttype(string)\n : string\n\n if (typeof header !== 'string') {\n throw new TypeError('argument string is required to be a string')\n }\n\n var index = header.indexOf(';')\n var type = index !== -1\n ? header.slice(0, index).trim()\n : header.trim()\n\n if (!TYPE_REGEXP.test(type)) {\n throw new TypeError('invalid media type')\n }\n\n var obj = new ContentType(type.toLowerCase())\n\n // parse parameters\n if (index !== -1) {\n var key\n var match\n var value\n\n PARAM_REGEXP.lastIndex = index\n\n while ((match = PARAM_REGEXP.exec(header))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value.charCodeAt(0) === 0x22 /* \" */) {\n // remove quotes\n value = value.slice(1, -1)\n\n // remove escapes\n if (value.indexOf('\\\\') !== -1) {\n value = value.replace(QESC_REGEXP, '$1')\n }\n }\n\n obj.parameters[key] = value\n }\n\n if (index !== header.length) {\n throw new TypeError('invalid parameter format')\n }\n }\n\n return obj\n}\n\n/**\n * Get content-type from req/res objects.\n *\n * @param {object}\n * @return {Object}\n * @private\n */\n\nfunction getcontenttype (obj) {\n var header\n\n if (typeof obj.getHeader === 'function') {\n // res-like\n header = obj.getHeader('content-type')\n } else if (typeof obj.headers === 'object') {\n // req-like\n header = obj.headers && obj.headers['content-type']\n }\n\n if (typeof header !== 'string') {\n throw new TypeError('content-type header is missing from object')\n }\n\n return header\n}\n\n/**\n * Quote a string if necessary.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n // no need to quote tokens\n if (TOKEN_REGEXP.test(str)) {\n return str\n }\n\n if (str.length > 0 && !TEXT_REGEXP.test(str)) {\n throw new TypeError('invalid parameter value')\n }\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Class to represent a content type.\n * @private\n */\nfunction ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}\n","/**\n * Module dependencies.\n */\n\nvar crypto = require('crypto');\n\n/**\n * Sign the given `val` with `secret`.\n *\n * @param {String} val\n * @param {String} secret\n * @return {String}\n * @api private\n */\n\nexports.sign = function(val, secret){\n if ('string' != typeof val) throw new TypeError(\"Cookie value must be provided as a string.\");\n if ('string' != typeof secret) throw new TypeError(\"Secret string must be provided.\");\n return val + '.' + crypto\n .createHmac('sha256', secret)\n .update(val)\n .digest('base64')\n .replace(/\\=+$/, '');\n};\n\n/**\n * Unsign and decode the given `val` with `secret`,\n * returning `false` if the signature is invalid.\n *\n * @param {String} val\n * @param {String} secret\n * @return {String|Boolean}\n * @api private\n */\n\nexports.unsign = function(val, secret){\n if ('string' != typeof val) throw new TypeError(\"Signed cookie string must be provided.\");\n if ('string' != typeof secret) throw new TypeError(\"Secret string must be provided.\");\n var str = val.slice(0, val.lastIndexOf('.'))\n , mac = exports.sign(str, secret);\n \n return sha1(mac) == sha1(val) ? str : false;\n};\n\n/**\n * Private\n */\n\nfunction sha1(str){\n return crypto.createHash('sha1').update(str).digest('hex');\n}\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar __toString = Object.prototype.toString\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var dec = opt.decode || decode;\n\n var index = 0\n while (index < str.length) {\n var eqIdx = str.indexOf('=', index)\n\n // no more cookie pairs\n if (eqIdx === -1) {\n break\n }\n\n var endIdx = str.indexOf(';', index)\n\n if (endIdx === -1) {\n endIdx = str.length\n } else if (endIdx < eqIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(';', eqIdx - 1) + 1\n continue\n }\n\n var key = str.slice(index, eqIdx).trim()\n\n // only assign once\n if (undefined === obj[key]) {\n var val = str.slice(eqIdx + 1, endIdx).trim()\n\n // quoted values\n if (val.charCodeAt(0) === 0x22) {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n\n index = endIdx + 1\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n var expires = opt.expires\n\n if (!isDate(expires) || isNaN(expires.valueOf())) {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + expires.toUTCString()\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.priority) {\n var priority = typeof opt.priority === 'string'\n ? opt.priority.toLowerCase()\n : opt.priority\n\n switch (priority) {\n case 'low':\n str += '; Priority=Low'\n break\n case 'medium':\n str += '; Priority=Medium'\n break\n case 'high':\n str += '; Priority=High'\n break\n default:\n throw new TypeError('option priority is invalid')\n }\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n *\n * @param {string} str\n * @returns {string}\n */\n\nfunction decode (str) {\n return str.indexOf('%') !== -1\n ? decodeURIComponent(str)\n : str\n}\n\n/**\n * URL-encode value.\n *\n * @param {string} str\n * @returns {string}\n */\n\nfunction encode (val) {\n return encodeURIComponent(val)\n}\n\n/**\n * Determine if value is a Date.\n *\n * @param {*} val\n * @private\n */\n\nfunction isDate (val) {\n return __toString.call(val) === '[object Date]' ||\n val instanceof Date\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","require('../modules/es6.symbol');\nrequire('../modules/es6.object.create');\nrequire('../modules/es6.object.define-property');\nrequire('../modules/es6.object.define-properties');\nrequire('../modules/es6.object.get-own-property-descriptor');\nrequire('../modules/es6.object.get-prototype-of');\nrequire('../modules/es6.object.keys');\nrequire('../modules/es6.object.get-own-property-names');\nrequire('../modules/es6.object.freeze');\nrequire('../modules/es6.object.seal');\nrequire('../modules/es6.object.prevent-extensions');\nrequire('../modules/es6.object.is-frozen');\nrequire('../modules/es6.object.is-sealed');\nrequire('../modules/es6.object.is-extensible');\nrequire('../modules/es6.object.assign');\nrequire('../modules/es6.object.is');\nrequire('../modules/es6.object.set-prototype-of');\nrequire('../modules/es6.object.to-string');\nrequire('../modules/es6.function.bind');\nrequire('../modules/es6.function.name');\nrequire('../modules/es6.function.has-instance');\nrequire('../modules/es6.parse-int');\nrequire('../modules/es6.parse-float');\nrequire('../modules/es6.number.constructor');\nrequire('../modules/es6.number.to-fixed');\nrequire('../modules/es6.number.to-precision');\nrequire('../modules/es6.number.epsilon');\nrequire('../modules/es6.number.is-finite');\nrequire('../modules/es6.number.is-integer');\nrequire('../modules/es6.number.is-nan');\nrequire('../modules/es6.number.is-safe-integer');\nrequire('../modules/es6.number.max-safe-integer');\nrequire('../modules/es6.number.min-safe-integer');\nrequire('../modules/es6.number.parse-float');\nrequire('../modules/es6.number.parse-int');\nrequire('../modules/es6.math.acosh');\nrequire('../modules/es6.math.asinh');\nrequire('../modules/es6.math.atanh');\nrequire('../modules/es6.math.cbrt');\nrequire('../modules/es6.math.clz32');\nrequire('../modules/es6.math.cosh');\nrequire('../modules/es6.math.expm1');\nrequire('../modules/es6.math.fround');\nrequire('../modules/es6.math.hypot');\nrequire('../modules/es6.math.imul');\nrequire('../modules/es6.math.log10');\nrequire('../modules/es6.math.log1p');\nrequire('../modules/es6.math.log2');\nrequire('../modules/es6.math.sign');\nrequire('../modules/es6.math.sinh');\nrequire('../modules/es6.math.tanh');\nrequire('../modules/es6.math.trunc');\nrequire('../modules/es6.string.from-code-point');\nrequire('../modules/es6.string.raw');\nrequire('../modules/es6.string.trim');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/es6.string.code-point-at');\nrequire('../modules/es6.string.ends-with');\nrequire('../modules/es6.string.includes');\nrequire('../modules/es6.string.repeat');\nrequire('../modules/es6.string.starts-with');\nrequire('../modules/es6.string.anchor');\nrequire('../modules/es6.string.big');\nrequire('../modules/es6.string.blink');\nrequire('../modules/es6.string.bold');\nrequire('../modules/es6.string.fixed');\nrequire('../modules/es6.string.fontcolor');\nrequire('../modules/es6.string.fontsize');\nrequire('../modules/es6.string.italics');\nrequire('../modules/es6.string.link');\nrequire('../modules/es6.string.small');\nrequire('../modules/es6.string.strike');\nrequire('../modules/es6.string.sub');\nrequire('../modules/es6.string.sup');\nrequire('../modules/es6.date.now');\nrequire('../modules/es6.date.to-json');\nrequire('../modules/es6.date.to-iso-string');\nrequire('../modules/es6.date.to-string');\nrequire('../modules/es6.date.to-primitive');\nrequire('../modules/es6.array.is-array');\nrequire('../modules/es6.array.from');\nrequire('../modules/es6.array.of');\nrequire('../modules/es6.array.join');\nrequire('../modules/es6.array.slice');\nrequire('../modules/es6.array.sort');\nrequire('../modules/es6.array.for-each');\nrequire('../modules/es6.array.map');\nrequire('../modules/es6.array.filter');\nrequire('../modules/es6.array.some');\nrequire('../modules/es6.array.every');\nrequire('../modules/es6.array.reduce');\nrequire('../modules/es6.array.reduce-right');\nrequire('../modules/es6.array.index-of');\nrequire('../modules/es6.array.last-index-of');\nrequire('../modules/es6.array.copy-within');\nrequire('../modules/es6.array.fill');\nrequire('../modules/es6.array.find');\nrequire('../modules/es6.array.find-index');\nrequire('../modules/es6.array.species');\nrequire('../modules/es6.array.iterator');\nrequire('../modules/es6.regexp.constructor');\nrequire('../modules/es6.regexp.exec');\nrequire('../modules/es6.regexp.to-string');\nrequire('../modules/es6.regexp.flags');\nrequire('../modules/es6.regexp.match');\nrequire('../modules/es6.regexp.replace');\nrequire('../modules/es6.regexp.search');\nrequire('../modules/es6.regexp.split');\nrequire('../modules/es6.promise');\nrequire('../modules/es6.map');\nrequire('../modules/es6.set');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es6.weak-set');\nrequire('../modules/es6.typed.array-buffer');\nrequire('../modules/es6.typed.data-view');\nrequire('../modules/es6.typed.int8-array');\nrequire('../modules/es6.typed.uint8-array');\nrequire('../modules/es6.typed.uint8-clamped-array');\nrequire('../modules/es6.typed.int16-array');\nrequire('../modules/es6.typed.uint16-array');\nrequire('../modules/es6.typed.int32-array');\nrequire('../modules/es6.typed.uint32-array');\nrequire('../modules/es6.typed.float32-array');\nrequire('../modules/es6.typed.float64-array');\nrequire('../modules/es6.reflect.apply');\nrequire('../modules/es6.reflect.construct');\nrequire('../modules/es6.reflect.define-property');\nrequire('../modules/es6.reflect.delete-property');\nrequire('../modules/es6.reflect.enumerate');\nrequire('../modules/es6.reflect.get');\nrequire('../modules/es6.reflect.get-own-property-descriptor');\nrequire('../modules/es6.reflect.get-prototype-of');\nrequire('../modules/es6.reflect.has');\nrequire('../modules/es6.reflect.is-extensible');\nrequire('../modules/es6.reflect.own-keys');\nrequire('../modules/es6.reflect.prevent-extensions');\nrequire('../modules/es6.reflect.set');\nrequire('../modules/es6.reflect.set-prototype-of');\nmodule.exports = require('../modules/_core');\n","require('../../modules/es7.array.flat-map');\nmodule.exports = require('../../modules/_core').Array.flatMap;\n","require('../../modules/es7.array.includes');\nmodule.exports = require('../../modules/_core').Array.includes;\n","require('../../modules/es7.object.entries');\nmodule.exports = require('../../modules/_core').Object.entries;\n","require('../../modules/es7.object.get-own-property-descriptors');\nmodule.exports = require('../../modules/_core').Object.getOwnPropertyDescriptors;\n","require('../../modules/es7.object.values');\nmodule.exports = require('../../modules/_core').Object.values;\n","'use strict';\nrequire('../../modules/es6.promise');\nrequire('../../modules/es7.promise.finally');\nmodule.exports = require('../../modules/_core').Promise['finally'];\n","require('../../modules/es7.string.pad-end');\nmodule.exports = require('../../modules/_core').String.padEnd;\n","require('../../modules/es7.string.pad-start');\nmodule.exports = require('../../modules/_core').String.padStart;\n","require('../../modules/es7.string.trim-right');\nmodule.exports = require('../../modules/_core').String.trimRight;\n","require('../../modules/es7.string.trim-left');\nmodule.exports = require('../../modules/_core').String.trimLeft;\n","require('../../modules/es7.symbol.async-iterator');\nmodule.exports = require('../../modules/_wks-ext').f('asyncIterator');\n","require('../modules/es7.global');\nmodule.exports = require('../modules/_core').global;\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.G, { global: require('./_global') });\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar at = require('./_string-at')(true);\n\n // `AdvanceStringIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? at(S, index).length : 1);\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n","'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nrequire('./es6.regexp.exec');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\nvar regexpExec = require('./_regexp-exec');\n\nvar SPECIES = wks('species');\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n // #replace needs built-in support for named groups.\n // #match works fine because it just return the exec results, even if it has\n // a \"grops\" property.\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$') !== '7';\n});\n\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {\n // Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length === 2 && result[0] === 'a' && result[1] === 'b';\n})();\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n re.exec = function () { execCalled = true; return null; };\n if (KEY === 'split') {\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n }\n re[SYMBOL]('');\n return !execCalled;\n }) : undefined;\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||\n (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var fns = exec(\n defined,\n SYMBOL,\n ''[KEY],\n function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {\n if (regexp.exec === regexpExec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n }\n );\n var strfn = fns[0];\n var rxfn = fns[1];\n\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","module.exports = require('./_shared')('native-function-to-string', Function.toString);\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = false;\n","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","var DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || isEnum.call(O, key)) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n","var $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar $toString = require('./_function-to-string');\nvar TO_STRING = 'toString';\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","'use strict';\n\nvar classof = require('./_classof');\nvar builtinExec = RegExp.prototype.exec;\n\n // `RegExpExec` abstract operation\n// https://tc39.github.io/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw new TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n if (classof(R) !== 'RegExp') {\n throw new TypeError('RegExp#exec called on incompatible receiver');\n }\n return builtinExec.call(R, S);\n};\n","'use strict';\n\nvar regexpFlags = require('./_flags');\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar LAST_INDEX = 'lastIndex';\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/,\n re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;\n})();\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + re.source + '$(?!\\\\s)', regexpFlags.call(re));\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];\n\n match = nativeExec.call(re, str);\n\n if (UPDATES_LAST_INDEX_WRONG && match) {\n re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n // eslint-disable-next-line no-loop-func\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","var $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n","module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n","'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n","'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n","// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('./_set-species')('Array');\n","// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n","// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n","var TO_PRIMITIVE = require('./_wks')('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));\n","var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n require('./_redefine')(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n","// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n","'use strict';\nvar isObject = require('./_is-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar HAS_INSTANCE = require('./_wks')('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n","// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n","// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n","// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n","// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n","// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n","// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n","// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n","// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n","// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n","// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n","// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n","'use strict';\nvar global = require('./_global');\nvar has = require('./_has');\nvar cof = require('./_cof');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar toPrimitive = require('./_to-primitive');\nvar fails = require('./_fails');\nvar gOPN = require('./_object-gopn').f;\nvar gOPD = require('./_object-gopd').f;\nvar dP = require('./_object-dp').f;\nvar $trim = require('./_string-trim').trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = require('./_descriptors') ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n require('./_redefine')(global, NUMBER, $Number);\n}\n","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n","'use strict';\nvar $export = require('./_export');\nvar toInteger = require('./_to-integer');\nvar aNumberValue = require('./_a-number-value');\nvar repeat = require('./_string-repeat');\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !require('./_fails')(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $fails = require('./_fails');\nvar aNumberValue = require('./_a-number-value');\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar userAgent = require('./_user-agent');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n","'use strict';\n// 26.1.5 Reflect.enumerate(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\nrequire('./_iter-create')(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n","// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n","// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n","// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n","// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n","var global = require('./_global');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar dP = require('./_object-dp').f;\nvar gOPN = require('./_object-gopn').f;\nvar isRegExp = require('./_is-regexp');\nvar $flags = require('./_flags');\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () {\n re2[require('./_wks')('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n require('./_redefine')(global, 'RegExp', $RegExp);\n}\n\nrequire('./_set-species')('RegExp');\n","'use strict';\nvar regexpExec = require('./_regexp-exec');\nrequire('./_export')({\n target: 'RegExp',\n proto: true,\n forced: regexpExec !== /./.exec\n}, {\n exec: regexpExec\n});\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar advanceStringIndex = require('./_advance-string-index');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match\n function (regexp) {\n var res = maybeCallNative($match, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n if (!rx.global) return regExpExec(rx, S);\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = String(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar toInteger = require('./_to-integer');\nvar advanceStringIndex = require('./_advance-string-index');\nvar regExpExec = require('./_regexp-exec-abstract');\nvar max = Math.max;\nvar min = Math.min;\nvar floor = Math.floor;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&`']|\\d\\d?|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&`']|\\d\\d?)/g;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {\n return [\n // `String.prototype.replace` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace\n function (regexp, replaceValue) {\n var res = maybeCallNative($replace, regexp, this, replaceValue);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = String(replaceValue);\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n results.push(result);\n if (!global) break;\n var matchStr = String(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n var matched = String(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = String(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n\n // https://tc39.github.io/ecma262/#sec-getsubstitution\n function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return $replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n }\n});\n","'use strict';\n\nvar anObject = require('./_an-object');\nvar sameValue = require('./_same-value');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative($search, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","'use strict';\n\nvar isRegExp = require('./_is-regexp');\nvar anObject = require('./_an-object');\nvar speciesConstructor = require('./_species-constructor');\nvar advanceStringIndex = require('./_advance-string-index');\nvar toLength = require('./_to-length');\nvar callRegExpExec = require('./_regexp-exec-abstract');\nvar regexpExec = require('./_regexp-exec');\nvar fails = require('./_fails');\nvar $min = Math.min;\nvar $push = [].push;\nvar $SPLIT = 'split';\nvar LENGTH = 'length';\nvar LAST_INDEX = 'lastIndex';\nvar MAX_UINT32 = 0xffffffff;\n\n// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError\nvar SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });\n\n// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return $split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy[LAST_INDEX];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);\n };\n } else {\n internalSplit = $split;\n }\n\n return [\n // `String.prototype.split` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = defined(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(String(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (regexp, limit) {\n var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (SUPPORTS_Y ? 'y' : 'g');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = SUPPORTS_Y ? q : 0;\n var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));\n var e;\n if (\n z === null ||\n (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","'use strict';\n// B.2.3.2 String.prototype.anchor(name)\nrequire('./_string-html')('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n","'use strict';\n// B.2.3.3 String.prototype.big()\nrequire('./_string-html')('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n","'use strict';\n// B.2.3.4 String.prototype.blink()\nrequire('./_string-html')('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n","'use strict';\n// B.2.3.5 String.prototype.bold()\nrequire('./_string-html')('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","'use strict';\n// B.2.3.6 String.prototype.fixed()\nrequire('./_string-html')('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n","'use strict';\n// B.2.3.7 String.prototype.fontcolor(color)\nrequire('./_string-html')('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n","'use strict';\n// B.2.3.8 String.prototype.fontsize(size)\nrequire('./_string-html')('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\n// B.2.3.9 String.prototype.italics()\nrequire('./_string-html')('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// B.2.3.10 String.prototype.link(url)\nrequire('./_string-html')('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n","'use strict';\n// B.2.3.11 String.prototype.small()\nrequire('./_string-html')('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","'use strict';\n// B.2.3.12 String.prototype.strike()\nrequire('./_string-html')('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n","'use strict';\n// B.2.3.13 String.prototype.sub()\nrequire('./_string-html')('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n","'use strict';\n// B.2.3.14 String.prototype.sup()\nrequire('./_string-html')('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n","'use strict';\n// 21.1.3.25 String.prototype.trim()\nrequire('./_string-trim')('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toObject = require('./_to-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $GOPS = require('./_object-gops');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n","var $export = require('./_export');\n$export($export.G + $export.W + $export.F * !require('./_typed').ABV, {\n DataView: require('./_typed-buffer').DataView\n});\n","require('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","'use strict';\nvar global = require('./_global');\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar validate = require('./_validate-collection');\nvar NATIVE_WEAK_MAP = require('./_validate-collection');\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar aFunction = require('./_a-function');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatMap');\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\nvar WEBKIT_BUG = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n\n$export($export.P + $export.F * WEBKIT_BUG, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n","require('./_wks-define')('asyncIterator');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n","// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar userAgent = require('./_user-agent');\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n","require('../modules/web.timers');\nrequire('../modules/web.immediate');\nrequire('../modules/web.dom.iterable');\nmodule.exports = require('../modules/_core');\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/*!\n * depd\n * Copyright(c) 2014-2018 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar relative = require('path').relative\n\n/**\n * Module exports.\n */\n\nmodule.exports = depd\n\n/**\n * Get the path to base files on.\n */\n\nvar basePath = process.cwd()\n\n/**\n * Determine if namespace is contained in the string.\n */\n\nfunction containsNamespace (str, namespace) {\n var vals = str.split(/[ ,]+/)\n var ns = String(namespace).toLowerCase()\n\n for (var i = 0; i < vals.length; i++) {\n var val = vals[i]\n\n // namespace contained\n if (val && (val === '*' || val.toLowerCase() === ns)) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Convert a data descriptor to accessor descriptor.\n */\n\nfunction convertDataDescriptorToAccessor (obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter () { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter (val) { return (value = val) }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}\n\n/**\n * Create arguments string to keep arity.\n */\n\nfunction createArgumentsString (arity) {\n var str = ''\n\n for (var i = 0; i < arity; i++) {\n str += ', arg' + i\n }\n\n return str.substr(2)\n}\n\n/**\n * Create stack string from stack.\n */\n\nfunction createStackString (stack) {\n var str = this.name + ': ' + this.namespace\n\n if (this.message) {\n str += ' deprecated ' + this.message\n }\n\n for (var i = 0; i < stack.length; i++) {\n str += '\\n at ' + stack[i].toString()\n }\n\n return str\n}\n\n/**\n * Create deprecate for namespace in caller.\n */\n\nfunction depd (namespace) {\n if (!namespace) {\n throw new TypeError('argument namespace is required')\n }\n\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n var file = site[0]\n\n function deprecate (message) {\n // call to self as log\n log.call(deprecate, message)\n }\n\n deprecate._file = file\n deprecate._ignored = isignored(namespace)\n deprecate._namespace = namespace\n deprecate._traced = istraced(namespace)\n deprecate._warned = Object.create(null)\n\n deprecate.function = wrapfunction\n deprecate.property = wrapproperty\n\n return deprecate\n}\n\n/**\n * Determine if event emitter has listeners of a given type.\n *\n * The way to do this check is done three different ways in Node.js >= 0.8\n * so this consolidates them into a minimal set using instance methods.\n *\n * @param {EventEmitter} emitter\n * @param {string} type\n * @returns {boolean}\n * @private\n */\n\nfunction eehaslisteners (emitter, type) {\n var count = typeof emitter.listenerCount !== 'function'\n ? emitter.listeners(type).length\n : emitter.listenerCount(type)\n\n return count > 0\n}\n\n/**\n * Determine if namespace is ignored.\n */\n\nfunction isignored (namespace) {\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}\n\n/**\n * Determine if namespace is traced.\n */\n\nfunction istraced (namespace) {\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = process.env.TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}\n\n/**\n * Display deprecation message.\n */\n\nfunction log (message, site) {\n var haslisteners = eehaslisteners(process, 'deprecation')\n\n // abort early if no destination\n if (!haslisteners && this._ignored) {\n return\n }\n\n var caller\n var callFile\n var callSite\n var depSite\n var i = 0\n var seen = false\n var stack = getStack()\n var file = this._file\n\n if (site) {\n // provided site\n depSite = site\n callSite = callSiteLocation(stack[1])\n callSite.name = depSite.name\n file = callSite[0]\n } else {\n // get call site\n i = 2\n depSite = callSiteLocation(stack[i])\n callSite = depSite\n }\n\n // get caller of deprecated thing in relation to file\n for (; i < stack.length; i++) {\n caller = callSiteLocation(stack[i])\n callFile = caller[0]\n\n if (callFile === file) {\n seen = true\n } else if (callFile === this._file) {\n file = this._file\n } else if (seen) {\n break\n }\n }\n\n var key = caller\n ? depSite.join(':') + '__' + caller.join(':')\n : undefined\n\n if (key !== undefined && key in this._warned) {\n // already warned\n return\n }\n\n this._warned[key] = true\n\n // generate automatic message from call site\n var msg = message\n if (!msg) {\n msg = callSite === depSite || !callSite.name\n ? defaultMessage(depSite)\n : defaultMessage(callSite)\n }\n\n // emit deprecation if listeners exist\n if (haslisteners) {\n var err = DeprecationError(this._namespace, msg, stack.slice(i))\n process.emit('deprecation', err)\n return\n }\n\n // format and write message\n var format = process.stderr.isTTY\n ? formatColor\n : formatPlain\n var output = format.call(this, msg, caller, stack.slice(i))\n process.stderr.write(output + '\\n', 'utf8')\n}\n\n/**\n * Get call site location as array.\n */\n\nfunction callSiteLocation (callSite) {\n var file = callSite.getFileName() || ''\n var line = callSite.getLineNumber()\n var colm = callSite.getColumnNumber()\n\n if (callSite.isEval()) {\n file = callSite.getEvalOrigin() + ', ' + file\n }\n\n var site = [file, line, colm]\n\n site.callSite = callSite\n site.name = callSite.getFunctionName()\n\n return site\n}\n\n/**\n * Generate a default message from the site.\n */\n\nfunction defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = ''\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}\n\n/**\n * Format deprecation message without color.\n */\n\nfunction formatPlain (msg, caller, stack) {\n var timestamp = new Date().toUTCString()\n\n var formatted = timestamp +\n ' ' + this._namespace +\n ' deprecated ' + msg\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n at ' + stack[i].toString()\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' at ' + formatLocation(caller)\n }\n\n return formatted\n}\n\n/**\n * Format deprecation message with color.\n */\n\nfunction formatColor (msg, caller, stack) {\n var formatted = '\\x1b[36;1m' + this._namespace + '\\x1b[22;39m' + // bold cyan\n ' \\x1b[33;1mdeprecated\\x1b[22;39m' + // bold yellow\n ' \\x1b[0m' + msg + '\\x1b[39m' // reset\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n \\x1b[36mat ' + stack[i].toString() + '\\x1b[39m' // cyan\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' \\x1b[36m' + formatLocation(caller) + '\\x1b[39m' // cyan\n }\n\n return formatted\n}\n\n/**\n * Format call site location.\n */\n\nfunction formatLocation (callSite) {\n return relative(basePath, callSite[0]) +\n ':' + callSite[1] +\n ':' + callSite[2]\n}\n\n/**\n * Get the stack as array of call sites.\n */\n\nfunction getStack () {\n var limit = Error.stackTraceLimit\n var obj = {}\n var prep = Error.prepareStackTrace\n\n Error.prepareStackTrace = prepareObjectStackTrace\n Error.stackTraceLimit = Math.max(10, limit)\n\n // capture the stack\n Error.captureStackTrace(obj)\n\n // slice this function off the top\n var stack = obj.stack.slice(1)\n\n Error.prepareStackTrace = prep\n Error.stackTraceLimit = limit\n\n return stack\n}\n\n/**\n * Capture call site stack from v8.\n */\n\nfunction prepareObjectStackTrace (obj, stack) {\n return stack\n}\n\n/**\n * Return a wrapped function in a deprecation message.\n */\n\nfunction wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n var args = createArgumentsString(fn.length)\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n site.name = fn.name\n\n // eslint-disable-next-line no-new-func\n var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',\n '\"use strict\"\\n' +\n 'return function (' + args + ') {' +\n 'log.call(deprecate, message, site)\\n' +\n 'return fn.apply(this, arguments)\\n' +\n '}')(fn, log, this, message, site)\n\n return deprecatedfn\n}\n\n/**\n * Wrap property in a deprecation message.\n */\n\nfunction wrapproperty (obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n\n var deprecate = this\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n // set site name\n site.name = prop\n\n // convert data descriptor\n if ('value' in descriptor) {\n descriptor = convertDataDescriptorToAccessor(obj, prop, message)\n }\n\n var get = descriptor.get\n var set = descriptor.set\n\n // wrap getter\n if (typeof get === 'function') {\n descriptor.get = function getter () {\n log.call(deprecate, message, site)\n return get.apply(this, arguments)\n }\n }\n\n // wrap setter\n if (typeof set === 'function') {\n descriptor.set = function setter () {\n log.call(deprecate, message, site)\n return set.apply(this, arguments)\n }\n }\n\n Object.defineProperty(obj, prop, descriptor)\n}\n\n/**\n * Create DeprecationError for deprecation\n */\n\nfunction DeprecationError (namespace, message, stack) {\n var error = new Error()\n var stackString\n\n Object.defineProperty(error, 'constructor', {\n value: DeprecationError\n })\n\n Object.defineProperty(error, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true\n })\n\n Object.defineProperty(error, 'name', {\n enumerable: false,\n configurable: true,\n value: 'DeprecationError',\n writable: true\n })\n\n Object.defineProperty(error, 'namespace', {\n configurable: true,\n enumerable: false,\n value: namespace,\n writable: true\n })\n\n Object.defineProperty(error, 'stack', {\n configurable: true,\n enumerable: false,\n get: function () {\n if (stackString !== undefined) {\n return stackString\n }\n\n // prepare stack trace\n return (stackString = createStackString.call(this, stack))\n },\n set: function setter (val) {\n stackString = val\n }\n })\n\n return error\n}\n","/*!\n * destroy\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar EventEmitter = require('events').EventEmitter\nvar ReadStream = require('fs').ReadStream\nvar Stream = require('stream')\nvar Zlib = require('zlib')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = destroy\n\n/**\n * Destroy the given stream, and optionally suppress any future `error` events.\n *\n * @param {object} stream\n * @param {boolean} suppress\n * @public\n */\n\nfunction destroy (stream, suppress) {\n if (isFsReadStream(stream)) {\n destroyReadStream(stream)\n } else if (isZlibStream(stream)) {\n destroyZlibStream(stream)\n } else if (hasDestroy(stream)) {\n stream.destroy()\n }\n\n if (isEventEmitter(stream) && suppress) {\n stream.removeAllListeners('error')\n stream.addListener('error', noop)\n }\n\n return stream\n}\n\n/**\n * Destroy a ReadStream.\n *\n * @param {object} stream\n * @private\n */\n\nfunction destroyReadStream (stream) {\n stream.destroy()\n\n if (typeof stream.close === 'function') {\n // node.js core bug work-around\n stream.on('open', onOpenClose)\n }\n}\n\n/**\n * Close a Zlib stream.\n *\n * Zlib streams below Node.js 4.5.5 have a buggy implementation\n * of .close() when zlib encountered an error.\n *\n * @param {object} stream\n * @private\n */\n\nfunction closeZlibStream (stream) {\n if (stream._hadError === true) {\n var prop = stream._binding === null\n ? '_binding'\n : '_handle'\n\n stream[prop] = {\n close: function () { this[prop] = null }\n }\n }\n\n stream.close()\n}\n\n/**\n * Destroy a Zlib stream.\n *\n * Zlib streams don't have a destroy function in Node.js 6. On top of that\n * simply calling destroy on a zlib stream in Node.js 8+ will result in a\n * memory leak. So until that is fixed, we need to call both close AND destroy.\n *\n * PR to fix memory leak: https://github.com/nodejs/node/pull/23734\n *\n * In Node.js 6+8, it's important that destroy is called before close as the\n * stream would otherwise emit the error 'zlib binding closed'.\n *\n * @param {object} stream\n * @private\n */\n\nfunction destroyZlibStream (stream) {\n if (typeof stream.destroy === 'function') {\n // node.js core bug work-around\n // istanbul ignore if: node.js 0.8\n if (stream._binding) {\n // node.js < 0.10.0\n stream.destroy()\n if (stream._processing) {\n stream._needDrain = true\n stream.once('drain', onDrainClearBinding)\n } else {\n stream._binding.clear()\n }\n } else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) {\n // node.js >= 12, ^11.1.0, ^10.15.1\n stream.destroy()\n } else if (stream._destroy && typeof stream.close === 'function') {\n // node.js 7, 8\n stream.destroyed = true\n stream.close()\n } else {\n // fallback\n // istanbul ignore next\n stream.destroy()\n }\n } else if (typeof stream.close === 'function') {\n // node.js < 8 fallback\n closeZlibStream(stream)\n }\n}\n\n/**\n * Determine if stream has destroy.\n * @private\n */\n\nfunction hasDestroy (stream) {\n return stream instanceof Stream &&\n typeof stream.destroy === 'function'\n}\n\n/**\n * Determine if val is EventEmitter.\n * @private\n */\n\nfunction isEventEmitter (val) {\n return val instanceof EventEmitter\n}\n\n/**\n * Determine if stream is fs.ReadStream stream.\n * @private\n */\n\nfunction isFsReadStream (stream) {\n return stream instanceof ReadStream\n}\n\n/**\n * Determine if stream is Zlib stream.\n * @private\n */\n\nfunction isZlibStream (stream) {\n return stream instanceof Zlib.Gzip ||\n stream instanceof Zlib.Gunzip ||\n stream instanceof Zlib.Deflate ||\n stream instanceof Zlib.DeflateRaw ||\n stream instanceof Zlib.Inflate ||\n stream instanceof Zlib.InflateRaw ||\n stream instanceof Zlib.Unzip\n}\n\n/**\n * No-op function.\n * @private\n */\n\nfunction noop () {}\n\n/**\n * On drain handler to clear binding.\n * @private\n */\n\n// istanbul ignore next: node.js 0.8\nfunction onDrainClearBinding () {\n this._binding.clear()\n}\n\n/**\n * On open handler to close stream.\n * @private\n */\n\nfunction onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}\n","'use strict'\n\nexports.toString = function (klass) {\n switch (klass) {\n case 1: return 'IN'\n case 2: return 'CS'\n case 3: return 'CH'\n case 4: return 'HS'\n case 255: return 'ANY'\n }\n return 'UNKNOWN_' + klass\n}\n\nexports.toClass = function (name) {\n switch (name.toUpperCase()) {\n case 'IN': return 1\n case 'CS': return 2\n case 'CH': return 3\n case 'HS': return 4\n case 'ANY': return 255\n }\n return 0\n}\n","'use strict'\n\nconst Buffer = require('buffer').Buffer\nconst types = require('./types')\nconst rcodes = require('./rcodes')\nconst opcodes = require('./opcodes')\nconst classes = require('./classes')\nconst optioncodes = require('./optioncodes')\nconst ip = require('@leichtgewicht/ip-codec')\n\nconst QUERY_FLAG = 0\nconst RESPONSE_FLAG = 1 << 15\nconst FLUSH_MASK = 1 << 15\nconst NOT_FLUSH_MASK = ~FLUSH_MASK\nconst QU_MASK = 1 << 15\nconst NOT_QU_MASK = ~QU_MASK\n\nconst name = exports.name = {}\n\nname.encode = function (str, buf, offset) {\n if (!buf) buf = Buffer.alloc(name.encodingLength(str))\n if (!offset) offset = 0\n const oldOffset = offset\n\n // strip leading and trailing .\n const n = str.replace(/^\\.|\\.$/gm, '')\n if (n.length) {\n const list = n.split('.')\n\n for (let i = 0; i < list.length; i++) {\n const len = buf.write(list[i], offset + 1)\n buf[offset] = len\n offset += len + 1\n }\n }\n\n buf[offset++] = 0\n\n name.encode.bytes = offset - oldOffset\n return buf\n}\n\nname.encode.bytes = 0\n\nname.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const list = []\n let oldOffset = offset\n let totalLength = 0\n let consumedBytes = 0\n let jumped = false\n\n while (true) {\n if (offset >= buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n const len = buf[offset++]\n consumedBytes += jumped ? 0 : 1\n\n if (len === 0) {\n break\n } else if ((len & 0xc0) === 0) {\n if (offset + len > buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n totalLength += len + 1\n if (totalLength > 254) {\n throw new Error('Cannot decode name (name too long)')\n }\n list.push(buf.toString('utf-8', offset, offset + len))\n offset += len\n consumedBytes += jumped ? 0 : len\n } else if ((len & 0xc0) === 0xc0) {\n if (offset + 1 > buf.length) {\n throw new Error('Cannot decode name (buffer overflow)')\n }\n const jumpOffset = buf.readUInt16BE(offset - 1) - 0xc000\n if (jumpOffset >= oldOffset) {\n // Allow only pointers to prior data. RFC 1035, section 4.1.4 states:\n // \"[...] an entire domain name or a list of labels at the end of a domain name\n // is replaced with a pointer to a prior occurance (sic) of the same name.\"\n throw new Error('Cannot decode name (bad pointer)')\n }\n offset = jumpOffset\n oldOffset = jumpOffset\n consumedBytes += jumped ? 0 : 1\n jumped = true\n } else {\n throw new Error('Cannot decode name (bad label)')\n }\n }\n\n name.decode.bytes = consumedBytes\n return list.length === 0 ? '.' : list.join('.')\n}\n\nname.decode.bytes = 0\n\nname.encodingLength = function (n) {\n if (n === '.' || n === '..') return 1\n return Buffer.byteLength(n.replace(/^\\.|\\.$/gm, '')) + 2\n}\n\nconst string = {}\n\nstring.encode = function (s, buf, offset) {\n if (!buf) buf = Buffer.alloc(string.encodingLength(s))\n if (!offset) offset = 0\n\n const len = buf.write(s, offset + 1)\n buf[offset] = len\n string.encode.bytes = len + 1\n return buf\n}\n\nstring.encode.bytes = 0\n\nstring.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf[offset]\n const s = buf.toString('utf-8', offset + 1, offset + 1 + len)\n string.decode.bytes = len + 1\n return s\n}\n\nstring.decode.bytes = 0\n\nstring.encodingLength = function (s) {\n return Buffer.byteLength(s) + 1\n}\n\nconst header = {}\n\nheader.encode = function (h, buf, offset) {\n if (!buf) buf = header.encodingLength(h)\n if (!offset) offset = 0\n\n const flags = (h.flags || 0) & 32767\n const type = h.type === 'response' ? RESPONSE_FLAG : QUERY_FLAG\n\n buf.writeUInt16BE(h.id || 0, offset)\n buf.writeUInt16BE(flags | type, offset + 2)\n buf.writeUInt16BE(h.questions.length, offset + 4)\n buf.writeUInt16BE(h.answers.length, offset + 6)\n buf.writeUInt16BE(h.authorities.length, offset + 8)\n buf.writeUInt16BE(h.additionals.length, offset + 10)\n\n return buf\n}\n\nheader.encode.bytes = 12\n\nheader.decode = function (buf, offset) {\n if (!offset) offset = 0\n if (buf.length < 12) throw new Error('Header must be 12 bytes')\n const flags = buf.readUInt16BE(offset + 2)\n\n return {\n id: buf.readUInt16BE(offset),\n type: flags & RESPONSE_FLAG ? 'response' : 'query',\n flags: flags & 32767,\n flag_qr: ((flags >> 15) & 0x1) === 1,\n opcode: opcodes.toString((flags >> 11) & 0xf),\n flag_aa: ((flags >> 10) & 0x1) === 1,\n flag_tc: ((flags >> 9) & 0x1) === 1,\n flag_rd: ((flags >> 8) & 0x1) === 1,\n flag_ra: ((flags >> 7) & 0x1) === 1,\n flag_z: ((flags >> 6) & 0x1) === 1,\n flag_ad: ((flags >> 5) & 0x1) === 1,\n flag_cd: ((flags >> 4) & 0x1) === 1,\n rcode: rcodes.toString(flags & 0xf),\n questions: new Array(buf.readUInt16BE(offset + 4)),\n answers: new Array(buf.readUInt16BE(offset + 6)),\n authorities: new Array(buf.readUInt16BE(offset + 8)),\n additionals: new Array(buf.readUInt16BE(offset + 10))\n }\n}\n\nheader.decode.bytes = 12\n\nheader.encodingLength = function () {\n return 12\n}\n\nconst runknown = exports.unknown = {}\n\nrunknown.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(runknown.encodingLength(data))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(data.length, offset)\n data.copy(buf, offset + 2)\n\n runknown.encode.bytes = data.length + 2\n return buf\n}\n\nrunknown.encode.bytes = 0\n\nrunknown.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n const data = buf.slice(offset + 2, offset + 2 + len)\n runknown.decode.bytes = len + 2\n return data\n}\n\nrunknown.decode.bytes = 0\n\nrunknown.encodingLength = function (data) {\n return data.length + 2\n}\n\nconst rns = exports.ns = {}\n\nrns.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rns.encodingLength(data))\n if (!offset) offset = 0\n\n name.encode(data, buf, offset + 2)\n buf.writeUInt16BE(name.encode.bytes, offset)\n rns.encode.bytes = name.encode.bytes + 2\n return buf\n}\n\nrns.encode.bytes = 0\n\nrns.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n const dd = name.decode(buf, offset + 2)\n\n rns.decode.bytes = len + 2\n return dd\n}\n\nrns.decode.bytes = 0\n\nrns.encodingLength = function (data) {\n return name.encodingLength(data) + 2\n}\n\nconst rsoa = exports.soa = {}\n\nrsoa.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsoa.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n name.encode(data.mname, buf, offset)\n offset += name.encode.bytes\n name.encode(data.rname, buf, offset)\n offset += name.encode.bytes\n buf.writeUInt32BE(data.serial || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.refresh || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.retry || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.expire || 0, offset)\n offset += 4\n buf.writeUInt32BE(data.minimum || 0, offset)\n offset += 4\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rsoa.encode.bytes = offset - oldOffset\n return buf\n}\n\nrsoa.encode.bytes = 0\n\nrsoa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.mname = name.decode(buf, offset)\n offset += name.decode.bytes\n data.rname = name.decode(buf, offset)\n offset += name.decode.bytes\n data.serial = buf.readUInt32BE(offset)\n offset += 4\n data.refresh = buf.readUInt32BE(offset)\n offset += 4\n data.retry = buf.readUInt32BE(offset)\n offset += 4\n data.expire = buf.readUInt32BE(offset)\n offset += 4\n data.minimum = buf.readUInt32BE(offset)\n offset += 4\n\n rsoa.decode.bytes = offset - oldOffset\n return data\n}\n\nrsoa.decode.bytes = 0\n\nrsoa.encodingLength = function (data) {\n return 22 + name.encodingLength(data.mname) + name.encodingLength(data.rname)\n}\n\nconst rtxt = exports.txt = {}\n\nrtxt.encode = function (data, buf, offset) {\n if (!Array.isArray(data)) data = [data]\n for (let i = 0; i < data.length; i++) {\n if (typeof data[i] === 'string') {\n data[i] = Buffer.from(data[i])\n }\n if (!Buffer.isBuffer(data[i])) {\n throw new Error('Must be a Buffer')\n }\n }\n\n if (!buf) buf = Buffer.alloc(rtxt.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n\n data.forEach(function (d) {\n buf[offset++] = d.length\n d.copy(buf, offset, 0, d.length)\n offset += d.length\n })\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rtxt.encode.bytes = offset - oldOffset\n return buf\n}\n\nrtxt.encode.bytes = 0\n\nrtxt.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n let remaining = buf.readUInt16BE(offset)\n offset += 2\n\n let data = []\n while (remaining > 0) {\n const len = buf[offset++]\n --remaining\n if (remaining < len) {\n throw new Error('Buffer overflow')\n }\n data.push(buf.slice(offset, offset + len))\n offset += len\n remaining -= len\n }\n\n rtxt.decode.bytes = offset - oldOffset\n return data\n}\n\nrtxt.decode.bytes = 0\n\nrtxt.encodingLength = function (data) {\n if (!Array.isArray(data)) data = [data]\n let length = 2\n data.forEach(function (buf) {\n if (typeof buf === 'string') {\n length += Buffer.byteLength(buf) + 1\n } else {\n length += buf.length + 1\n }\n })\n return length\n}\n\nconst rnull = exports.null = {}\n\nrnull.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnull.encodingLength(data))\n if (!offset) offset = 0\n\n if (typeof data === 'string') data = Buffer.from(data)\n if (!data) data = Buffer.alloc(0)\n\n const oldOffset = offset\n offset += 2\n\n const len = data.length\n data.copy(buf, offset, 0, len)\n offset += len\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rnull.encode.bytes = offset - oldOffset\n return buf\n}\n\nrnull.encode.bytes = 0\n\nrnull.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n const len = buf.readUInt16BE(offset)\n\n offset += 2\n\n const data = buf.slice(offset, offset + len)\n offset += len\n\n rnull.decode.bytes = offset - oldOffset\n return data\n}\n\nrnull.decode.bytes = 0\n\nrnull.encodingLength = function (data) {\n if (!data) return 2\n return (Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)) + 2\n}\n\nconst rhinfo = exports.hinfo = {}\n\nrhinfo.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rhinfo.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n string.encode(data.cpu, buf, offset)\n offset += string.encode.bytes\n string.encode(data.os, buf, offset)\n offset += string.encode.bytes\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rhinfo.encode.bytes = offset - oldOffset\n return buf\n}\n\nrhinfo.encode.bytes = 0\n\nrhinfo.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.cpu = string.decode(buf, offset)\n offset += string.decode.bytes\n data.os = string.decode(buf, offset)\n offset += string.decode.bytes\n rhinfo.decode.bytes = offset - oldOffset\n return data\n}\n\nrhinfo.decode.bytes = 0\n\nrhinfo.encodingLength = function (data) {\n return string.encodingLength(data.cpu) + string.encodingLength(data.os) + 2\n}\n\nconst rptr = exports.ptr = {}\nconst rcname = exports.cname = rptr\nconst rdname = exports.dname = rptr\n\nrptr.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rptr.encodingLength(data))\n if (!offset) offset = 0\n\n name.encode(data, buf, offset + 2)\n buf.writeUInt16BE(name.encode.bytes, offset)\n rptr.encode.bytes = name.encode.bytes + 2\n return buf\n}\n\nrptr.encode.bytes = 0\n\nrptr.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const data = name.decode(buf, offset + 2)\n rptr.decode.bytes = name.decode.bytes + 2\n return data\n}\n\nrptr.decode.bytes = 0\n\nrptr.encodingLength = function (data) {\n return name.encodingLength(data) + 2\n}\n\nconst rsrv = exports.srv = {}\n\nrsrv.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsrv.encodingLength(data))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(data.priority || 0, offset + 2)\n buf.writeUInt16BE(data.weight || 0, offset + 4)\n buf.writeUInt16BE(data.port || 0, offset + 6)\n name.encode(data.target, buf, offset + 8)\n\n const len = name.encode.bytes + 6\n buf.writeUInt16BE(len, offset)\n\n rsrv.encode.bytes = len + 2\n return buf\n}\n\nrsrv.encode.bytes = 0\n\nrsrv.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n\n const data = {}\n data.priority = buf.readUInt16BE(offset + 2)\n data.weight = buf.readUInt16BE(offset + 4)\n data.port = buf.readUInt16BE(offset + 6)\n data.target = name.decode(buf, offset + 8)\n\n rsrv.decode.bytes = len + 2\n return data\n}\n\nrsrv.decode.bytes = 0\n\nrsrv.encodingLength = function (data) {\n return 8 + name.encodingLength(data.target)\n}\n\nconst rcaa = exports.caa = {}\n\nrcaa.ISSUER_CRITICAL = 1 << 7\n\nrcaa.encode = function (data, buf, offset) {\n const len = rcaa.encodingLength(data)\n\n if (!buf) buf = Buffer.alloc(rcaa.encodingLength(data))\n if (!offset) offset = 0\n\n if (data.issuerCritical) {\n data.flags = rcaa.ISSUER_CRITICAL\n }\n\n buf.writeUInt16BE(len - 2, offset)\n offset += 2\n buf.writeUInt8(data.flags || 0, offset)\n offset += 1\n string.encode(data.tag, buf, offset)\n offset += string.encode.bytes\n buf.write(data.value, offset)\n offset += Buffer.byteLength(data.value)\n\n rcaa.encode.bytes = len\n return buf\n}\n\nrcaa.encode.bytes = 0\n\nrcaa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const len = buf.readUInt16BE(offset)\n offset += 2\n\n const oldOffset = offset\n const data = {}\n data.flags = buf.readUInt8(offset)\n offset += 1\n data.tag = string.decode(buf, offset)\n offset += string.decode.bytes\n data.value = buf.toString('utf-8', offset, oldOffset + len)\n\n data.issuerCritical = !!(data.flags & rcaa.ISSUER_CRITICAL)\n\n rcaa.decode.bytes = len + 2\n\n return data\n}\n\nrcaa.decode.bytes = 0\n\nrcaa.encodingLength = function (data) {\n return string.encodingLength(data.tag) + string.encodingLength(data.value) + 2\n}\n\nconst rmx = exports.mx = {}\n\nrmx.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rmx.encodingLength(data))\n if (!offset) offset = 0\n\n const oldOffset = offset\n offset += 2\n buf.writeUInt16BE(data.preference || 0, offset)\n offset += 2\n name.encode(data.exchange, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)\n rmx.encode.bytes = offset - oldOffset\n return buf\n}\n\nrmx.encode.bytes = 0\n\nrmx.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.preference = buf.readUInt16BE(offset)\n offset += 2\n data.exchange = name.decode(buf, offset)\n offset += name.decode.bytes\n\n rmx.decode.bytes = offset - oldOffset\n return data\n}\n\nrmx.encodingLength = function (data) {\n return 4 + name.encodingLength(data.exchange)\n}\n\nconst ra = exports.a = {}\n\nra.encode = function (host, buf, offset) {\n if (!buf) buf = Buffer.alloc(ra.encodingLength(host))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(4, offset)\n offset += 2\n ip.v4.encode(host, buf, offset)\n ra.encode.bytes = 6\n return buf\n}\n\nra.encode.bytes = 0\n\nra.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n offset += 2\n const host = ip.v4.decode(buf, offset)\n ra.decode.bytes = 6\n return host\n}\n\nra.decode.bytes = 0\n\nra.encodingLength = function () {\n return 6\n}\n\nconst raaaa = exports.aaaa = {}\n\nraaaa.encode = function (host, buf, offset) {\n if (!buf) buf = Buffer.alloc(raaaa.encodingLength(host))\n if (!offset) offset = 0\n\n buf.writeUInt16BE(16, offset)\n offset += 2\n ip.v6.encode(host, buf, offset)\n raaaa.encode.bytes = 18\n return buf\n}\n\nraaaa.encode.bytes = 0\n\nraaaa.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n offset += 2\n const host = ip.v6.decode(buf, offset)\n raaaa.decode.bytes = 18\n return host\n}\n\nraaaa.decode.bytes = 0\n\nraaaa.encodingLength = function () {\n return 18\n}\n\nconst roption = exports.option = {}\n\nroption.encode = function (option, buf, offset) {\n if (!buf) buf = Buffer.alloc(roption.encodingLength(option))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const code = optioncodes.toCode(option.code)\n buf.writeUInt16BE(code, offset)\n offset += 2\n if (option.data) {\n buf.writeUInt16BE(option.data.length, offset)\n offset += 2\n option.data.copy(buf, offset)\n offset += option.data.length\n } else {\n switch (code) {\n // case 3: NSID. No encode makes sense.\n // case 5,6,7: Not implementable\n case 8: // ECS\n // note: do IP math before calling\n const spl = option.sourcePrefixLength || 0\n const fam = option.family || ip.familyOf(option.ip)\n const ipBuf = ip.encode(option.ip, Buffer.alloc)\n const ipLen = Math.ceil(spl / 8)\n buf.writeUInt16BE(ipLen + 4, offset)\n offset += 2\n buf.writeUInt16BE(fam, offset)\n offset += 2\n buf.writeUInt8(spl, offset++)\n buf.writeUInt8(option.scopePrefixLength || 0, offset++)\n\n ipBuf.copy(buf, offset, 0, ipLen)\n offset += ipLen\n break\n // case 9: EXPIRE (experimental)\n // case 10: COOKIE. No encode makes sense.\n case 11: // KEEP-ALIVE\n if (option.timeout) {\n buf.writeUInt16BE(2, offset)\n offset += 2\n buf.writeUInt16BE(option.timeout, offset)\n offset += 2\n } else {\n buf.writeUInt16BE(0, offset)\n offset += 2\n }\n break\n case 12: // PADDING\n const len = option.length || 0\n buf.writeUInt16BE(len, offset)\n offset += 2\n buf.fill(0, offset, offset + len)\n offset += len\n break\n // case 13: CHAIN. Experimental.\n case 14: // KEY-TAG\n const tagsLen = option.tags.length * 2\n buf.writeUInt16BE(tagsLen, offset)\n offset += 2\n for (const tag of option.tags) {\n buf.writeUInt16BE(tag, offset)\n offset += 2\n }\n break\n default:\n throw new Error(`Unknown roption code: ${option.code}`)\n }\n }\n\n roption.encode.bytes = offset - oldOffset\n return buf\n}\n\nroption.encode.bytes = 0\n\nroption.decode = function (buf, offset) {\n if (!offset) offset = 0\n const option = {}\n option.code = buf.readUInt16BE(offset)\n option.type = optioncodes.toString(option.code)\n offset += 2\n const len = buf.readUInt16BE(offset)\n offset += 2\n option.data = buf.slice(offset, offset + len)\n switch (option.code) {\n // case 3: NSID. No decode makes sense.\n case 8: // ECS\n option.family = buf.readUInt16BE(offset)\n offset += 2\n option.sourcePrefixLength = buf.readUInt8(offset++)\n option.scopePrefixLength = buf.readUInt8(offset++)\n const padded = Buffer.alloc((option.family === 1) ? 4 : 16)\n buf.copy(padded, 0, offset, offset + len - 4)\n option.ip = ip.decode(padded)\n break\n // case 12: Padding. No decode makes sense.\n case 11: // KEEP-ALIVE\n if (len > 0) {\n option.timeout = buf.readUInt16BE(offset)\n offset += 2\n }\n break\n case 14:\n option.tags = []\n for (let i = 0; i < len; i += 2) {\n option.tags.push(buf.readUInt16BE(offset))\n offset += 2\n }\n // don't worry about default. caller will use data if desired\n }\n\n roption.decode.bytes = len + 4\n return option\n}\n\nroption.decode.bytes = 0\n\nroption.encodingLength = function (option) {\n if (option.data) {\n return option.data.length + 4\n }\n const code = optioncodes.toCode(option.code)\n switch (code) {\n case 8: // ECS\n const spl = option.sourcePrefixLength || 0\n return Math.ceil(spl / 8) + 8\n case 11: // KEEP-ALIVE\n return (typeof option.timeout === 'number') ? 6 : 4\n case 12: // PADDING\n return option.length + 4\n case 14: // KEY-TAG\n return 4 + (option.tags.length * 2)\n }\n throw new Error(`Unknown roption code: ${option.code}`)\n}\n\nconst ropt = exports.opt = {}\n\nropt.encode = function (options, buf, offset) {\n if (!buf) buf = Buffer.alloc(ropt.encodingLength(options))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const rdlen = encodingLengthList(options, roption)\n buf.writeUInt16BE(rdlen, offset)\n offset = encodeList(options, roption, buf, offset + 2)\n\n ropt.encode.bytes = offset - oldOffset\n return buf\n}\n\nropt.encode.bytes = 0\n\nropt.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const options = []\n let rdlen = buf.readUInt16BE(offset)\n offset += 2\n let o = 0\n while (rdlen > 0) {\n options[o++] = roption.decode(buf, offset)\n offset += roption.decode.bytes\n rdlen -= roption.decode.bytes\n }\n ropt.decode.bytes = offset - oldOffset\n return options\n}\n\nropt.decode.bytes = 0\n\nropt.encodingLength = function (options) {\n return 2 + encodingLengthList(options || [], roption)\n}\n\nconst rdnskey = exports.dnskey = {}\n\nrdnskey.PROTOCOL_DNSSEC = 3\nrdnskey.ZONE_KEY = 0x80\nrdnskey.SECURE_ENTRYPOINT = 0x8000\n\nrdnskey.encode = function (key, buf, offset) {\n if (!buf) buf = Buffer.alloc(rdnskey.encodingLength(key))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const keydata = key.key\n if (!Buffer.isBuffer(keydata)) {\n throw new Error('Key must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(key.flags, offset)\n offset += 2\n buf.writeUInt8(rdnskey.PROTOCOL_DNSSEC, offset)\n offset += 1\n buf.writeUInt8(key.algorithm, offset)\n offset += 1\n keydata.copy(buf, offset, 0, keydata.length)\n offset += keydata.length\n\n rdnskey.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rdnskey.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrdnskey.encode.bytes = 0\n\nrdnskey.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var key = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n key.flags = buf.readUInt16BE(offset)\n offset += 2\n if (buf.readUInt8(offset) !== rdnskey.PROTOCOL_DNSSEC) {\n throw new Error('Protocol must be 3')\n }\n offset += 1\n key.algorithm = buf.readUInt8(offset)\n offset += 1\n key.key = buf.slice(offset, oldOffset + length + 2)\n offset += key.key.length\n rdnskey.decode.bytes = offset - oldOffset\n return key\n}\n\nrdnskey.decode.bytes = 0\n\nrdnskey.encodingLength = function (key) {\n return 6 + Buffer.byteLength(key.key)\n}\n\nconst rrrsig = exports.rrsig = {}\n\nrrrsig.encode = function (sig, buf, offset) {\n if (!buf) buf = Buffer.alloc(rrrsig.encodingLength(sig))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const signature = sig.signature\n if (!Buffer.isBuffer(signature)) {\n throw new Error('Signature must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(types.toType(sig.typeCovered), offset)\n offset += 2\n buf.writeUInt8(sig.algorithm, offset)\n offset += 1\n buf.writeUInt8(sig.labels, offset)\n offset += 1\n buf.writeUInt32BE(sig.originalTTL, offset)\n offset += 4\n buf.writeUInt32BE(sig.expiration, offset)\n offset += 4\n buf.writeUInt32BE(sig.inception, offset)\n offset += 4\n buf.writeUInt16BE(sig.keyTag, offset)\n offset += 2\n name.encode(sig.signersName, buf, offset)\n offset += name.encode.bytes\n signature.copy(buf, offset, 0, signature.length)\n offset += signature.length\n\n rrrsig.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rrrsig.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrrrsig.encode.bytes = 0\n\nrrrsig.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var sig = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n sig.typeCovered = types.toString(buf.readUInt16BE(offset))\n offset += 2\n sig.algorithm = buf.readUInt8(offset)\n offset += 1\n sig.labels = buf.readUInt8(offset)\n offset += 1\n sig.originalTTL = buf.readUInt32BE(offset)\n offset += 4\n sig.expiration = buf.readUInt32BE(offset)\n offset += 4\n sig.inception = buf.readUInt32BE(offset)\n offset += 4\n sig.keyTag = buf.readUInt16BE(offset)\n offset += 2\n sig.signersName = name.decode(buf, offset)\n offset += name.decode.bytes\n sig.signature = buf.slice(offset, oldOffset + length + 2)\n offset += sig.signature.length\n rrrsig.decode.bytes = offset - oldOffset\n return sig\n}\n\nrrrsig.decode.bytes = 0\n\nrrrsig.encodingLength = function (sig) {\n return 20 +\n name.encodingLength(sig.signersName) +\n Buffer.byteLength(sig.signature)\n}\n\nconst rrp = exports.rp = {}\n\nrrp.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rrp.encodingLength(data))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // Leave space for length\n name.encode(data.mbox || '.', buf, offset)\n offset += name.encode.bytes\n name.encode(data.txt || '.', buf, offset)\n offset += name.encode.bytes\n rrp.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rrp.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrrp.encode.bytes = 0\n\nrrp.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const data = {}\n offset += 2\n data.mbox = name.decode(buf, offset) || '.'\n offset += name.decode.bytes\n data.txt = name.decode(buf, offset) || '.'\n offset += name.decode.bytes\n rrp.decode.bytes = offset - oldOffset\n return data\n}\n\nrrp.decode.bytes = 0\n\nrrp.encodingLength = function (data) {\n return 2 + name.encodingLength(data.mbox || '.') + name.encodingLength(data.txt || '.')\n}\n\nconst typebitmap = {}\n\ntypebitmap.encode = function (typelist, buf, offset) {\n if (!buf) buf = Buffer.alloc(typebitmap.encodingLength(typelist))\n if (!offset) offset = 0\n const oldOffset = offset\n\n var typesByWindow = []\n for (var i = 0; i < typelist.length; i++) {\n var typeid = types.toType(typelist[i])\n if (typesByWindow[typeid >> 8] === undefined) {\n typesByWindow[typeid >> 8] = []\n }\n typesByWindow[typeid >> 8][(typeid >> 3) & 0x1F] |= 1 << (7 - (typeid & 0x7))\n }\n\n for (i = 0; i < typesByWindow.length; i++) {\n if (typesByWindow[i] !== undefined) {\n var windowBuf = Buffer.from(typesByWindow[i])\n buf.writeUInt8(i, offset)\n offset += 1\n buf.writeUInt8(windowBuf.length, offset)\n offset += 1\n windowBuf.copy(buf, offset)\n offset += windowBuf.length\n }\n }\n\n typebitmap.encode.bytes = offset - oldOffset\n return buf\n}\n\ntypebitmap.encode.bytes = 0\n\ntypebitmap.decode = function (buf, offset, length) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var typelist = []\n while (offset - oldOffset < length) {\n var window = buf.readUInt8(offset)\n offset += 1\n var windowLength = buf.readUInt8(offset)\n offset += 1\n for (var i = 0; i < windowLength; i++) {\n var b = buf.readUInt8(offset + i)\n for (var j = 0; j < 8; j++) {\n if (b & (1 << (7 - j))) {\n var typeid = types.toString((window << 8) | (i << 3) | j)\n typelist.push(typeid)\n }\n }\n }\n offset += windowLength\n }\n\n typebitmap.decode.bytes = offset - oldOffset\n return typelist\n}\n\ntypebitmap.decode.bytes = 0\n\ntypebitmap.encodingLength = function (typelist) {\n var extents = []\n for (var i = 0; i < typelist.length; i++) {\n var typeid = types.toType(typelist[i])\n extents[typeid >> 8] = Math.max(extents[typeid >> 8] || 0, typeid & 0xFF)\n }\n\n var len = 0\n for (i = 0; i < extents.length; i++) {\n if (extents[i] !== undefined) {\n len += 2 + Math.ceil((extents[i] + 1) / 8)\n }\n }\n\n return len\n}\n\nconst rnsec = exports.nsec = {}\n\nrnsec.encode = function (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnsec.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // Leave space for length\n name.encode(record.nextDomain, buf, offset)\n offset += name.encode.bytes\n typebitmap.encode(record.rrtypes, buf, offset)\n offset += typebitmap.encode.bytes\n\n rnsec.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnsec.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnsec.encode.bytes = 0\n\nrnsec.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var record = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n record.nextDomain = name.decode(buf, offset)\n offset += name.decode.bytes\n record.rrtypes = typebitmap.decode(buf, offset, length - (offset - oldOffset))\n offset += typebitmap.decode.bytes\n\n rnsec.decode.bytes = offset - oldOffset\n return record\n}\n\nrnsec.decode.bytes = 0\n\nrnsec.encodingLength = function (record) {\n return 2 +\n name.encodingLength(record.nextDomain) +\n typebitmap.encodingLength(record.rrtypes)\n}\n\nconst rnsec3 = exports.nsec3 = {}\n\nrnsec3.encode = function (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnsec3.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const salt = record.salt\n if (!Buffer.isBuffer(salt)) {\n throw new Error('salt must be a Buffer')\n }\n\n const nextDomain = record.nextDomain\n if (!Buffer.isBuffer(nextDomain)) {\n throw new Error('nextDomain must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt8(record.algorithm, offset)\n offset += 1\n buf.writeUInt8(record.flags, offset)\n offset += 1\n buf.writeUInt16BE(record.iterations, offset)\n offset += 2\n buf.writeUInt8(salt.length, offset)\n offset += 1\n salt.copy(buf, offset, 0, salt.length)\n offset += salt.length\n buf.writeUInt8(nextDomain.length, offset)\n offset += 1\n nextDomain.copy(buf, offset, 0, nextDomain.length)\n offset += nextDomain.length\n typebitmap.encode(record.rrtypes, buf, offset)\n offset += typebitmap.encode.bytes\n\n rnsec3.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnsec3.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnsec3.encode.bytes = 0\n\nrnsec3.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var record = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n record.algorithm = buf.readUInt8(offset)\n offset += 1\n record.flags = buf.readUInt8(offset)\n offset += 1\n record.iterations = buf.readUInt16BE(offset)\n offset += 2\n const saltLength = buf.readUInt8(offset)\n offset += 1\n record.salt = buf.slice(offset, offset + saltLength)\n offset += saltLength\n const hashLength = buf.readUInt8(offset)\n offset += 1\n record.nextDomain = buf.slice(offset, offset + hashLength)\n offset += hashLength\n record.rrtypes = typebitmap.decode(buf, offset, length - (offset - oldOffset))\n offset += typebitmap.decode.bytes\n\n rnsec3.decode.bytes = offset - oldOffset\n return record\n}\n\nrnsec3.decode.bytes = 0\n\nrnsec3.encodingLength = function (record) {\n return 8 +\n record.salt.length +\n record.nextDomain.length +\n typebitmap.encodingLength(record.rrtypes)\n}\n\nconst rds = exports.ds = {}\n\nrds.encode = function (digest, buf, offset) {\n if (!buf) buf = Buffer.alloc(rds.encodingLength(digest))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const digestdata = digest.digest\n if (!Buffer.isBuffer(digestdata)) {\n throw new Error('Digest must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt16BE(digest.keyTag, offset)\n offset += 2\n buf.writeUInt8(digest.algorithm, offset)\n offset += 1\n buf.writeUInt8(digest.digestType, offset)\n offset += 1\n digestdata.copy(buf, offset, 0, digestdata.length)\n offset += digestdata.length\n\n rds.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rds.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrds.encode.bytes = 0\n\nrds.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n var digest = {}\n var length = buf.readUInt16BE(offset)\n offset += 2\n digest.keyTag = buf.readUInt16BE(offset)\n offset += 2\n digest.algorithm = buf.readUInt8(offset)\n offset += 1\n digest.digestType = buf.readUInt8(offset)\n offset += 1\n digest.digest = buf.slice(offset, oldOffset + length + 2)\n offset += digest.digest.length\n rds.decode.bytes = offset - oldOffset\n return digest\n}\n\nrds.decode.bytes = 0\n\nrds.encodingLength = function (digest) {\n return 6 + Buffer.byteLength(digest.digest)\n}\n\nconst rsshfp = exports.sshfp = {}\n\nrsshfp.getFingerprintLengthForHashType = function getFingerprintLengthForHashType (hashType) {\n switch (hashType) {\n case 1: return 20\n case 2: return 32\n }\n}\n\nrsshfp.encode = function encode (record, buf, offset) {\n if (!buf) buf = Buffer.alloc(rsshfp.encodingLength(record))\n if (!offset) offset = 0\n const oldOffset = offset\n\n offset += 2 // The function call starts with the offset pointer at the RDLENGTH field, not the RDATA one\n buf[offset] = record.algorithm\n offset += 1\n buf[offset] = record.hash\n offset += 1\n\n const fingerprintBuf = Buffer.from(record.fingerprint.toUpperCase(), 'hex')\n if (fingerprintBuf.length !== rsshfp.getFingerprintLengthForHashType(record.hash)) {\n throw new Error('Invalid fingerprint length')\n }\n fingerprintBuf.copy(buf, offset)\n offset += fingerprintBuf.byteLength\n\n rsshfp.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rsshfp.encode.bytes - 2, oldOffset)\n\n return buf\n}\n\nrsshfp.encode.bytes = 0\n\nrsshfp.decode = function decode (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const record = {}\n offset += 2 // Account for the RDLENGTH field\n record.algorithm = buf[offset]\n offset += 1\n record.hash = buf[offset]\n offset += 1\n\n const fingerprintLength = rsshfp.getFingerprintLengthForHashType(record.hash)\n record.fingerprint = buf.slice(offset, offset + fingerprintLength).toString('hex').toUpperCase()\n offset += fingerprintLength\n rsshfp.decode.bytes = offset - oldOffset\n return record\n}\n\nrsshfp.decode.bytes = 0\n\nrsshfp.encodingLength = function (record) {\n return 4 + Buffer.from(record.fingerprint, 'hex').byteLength\n}\n\nconst rnaptr = exports.naptr = {}\n\nrnaptr.encode = function (data, buf, offset) {\n if (!buf) buf = Buffer.alloc(rnaptr.encodingLength(data))\n if (!offset) offset = 0\n const oldOffset = offset\n offset += 2\n buf.writeUInt16BE(data.order || 0, offset)\n offset += 2\n buf.writeUInt16BE(data.preference || 0, offset)\n offset += 2\n string.encode(data.flags, buf, offset)\n offset += string.encode.bytes\n string.encode(data.services, buf, offset)\n offset += string.encode.bytes\n string.encode(data.regexp, buf, offset)\n offset += string.encode.bytes\n name.encode(data.replacement, buf, offset)\n offset += name.encode.bytes\n rnaptr.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rnaptr.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrnaptr.encode.bytes = 0\n\nrnaptr.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n const data = {}\n offset += 2\n data.order = buf.readUInt16BE(offset)\n offset += 2\n data.preference = buf.readUInt16BE(offset)\n offset += 2\n data.flags = string.decode(buf, offset)\n offset += string.decode.bytes\n data.services = string.decode(buf, offset)\n offset += string.decode.bytes\n data.regexp = string.decode(buf, offset)\n offset += string.decode.bytes\n data.replacement = name.decode(buf, offset)\n offset += name.decode.bytes\n rnaptr.decode.bytes = offset - oldOffset\n return data\n}\n\nrnaptr.decode.bytes = 0\n\nrnaptr.encodingLength = function (data) {\n return string.encodingLength(data.flags) +\n string.encodingLength(data.services) +\n string.encodingLength(data.regexp) +\n name.encodingLength(data.replacement) + 6\n}\n\nconst rtlsa = exports.tlsa = {}\n\nrtlsa.encode = function (cert, buf, offset) {\n if (!buf) buf = Buffer.alloc(rtlsa.encodingLength(cert))\n if (!offset) offset = 0\n const oldOffset = offset\n\n const certdata = cert.certificate\n if (!Buffer.isBuffer(certdata)) {\n throw new Error('Certificate must be a Buffer')\n }\n\n offset += 2 // Leave space for length\n buf.writeUInt8(cert.usage, offset)\n offset += 1\n buf.writeUInt8(cert.selector, offset)\n offset += 1\n buf.writeUInt8(cert.matchingType, offset)\n offset += 1\n certdata.copy(buf, offset, 0, certdata.length)\n offset += certdata.length\n\n rtlsa.encode.bytes = offset - oldOffset\n buf.writeUInt16BE(rtlsa.encode.bytes - 2, oldOffset)\n return buf\n}\n\nrtlsa.encode.bytes = 0\n\nrtlsa.decode = function (buf, offset) {\n if (!offset) offset = 0\n const oldOffset = offset\n\n const cert = {}\n const length = buf.readUInt16BE(offset)\n offset += 2\n cert.usage = buf.readUInt8(offset)\n offset += 1\n cert.selector = buf.readUInt8(offset)\n offset += 1\n cert.matchingType = buf.readUInt8(offset)\n offset += 1\n cert.certificate = buf.slice(offset, oldOffset + length + 2)\n offset += cert.certificate.length\n rtlsa.decode.bytes = offset - oldOffset\n return cert\n}\n\nrtlsa.decode.bytes = 0\n\nrtlsa.encodingLength = function (cert) {\n return 5 + Buffer.byteLength(cert.certificate)\n}\n\nconst renc = exports.record = function (type) {\n switch (type.toUpperCase()) {\n case 'A': return ra\n case 'PTR': return rptr\n case 'CNAME': return rcname\n case 'DNAME': return rdname\n case 'TXT': return rtxt\n case 'NULL': return rnull\n case 'AAAA': return raaaa\n case 'SRV': return rsrv\n case 'HINFO': return rhinfo\n case 'CAA': return rcaa\n case 'NS': return rns\n case 'SOA': return rsoa\n case 'MX': return rmx\n case 'OPT': return ropt\n case 'DNSKEY': return rdnskey\n case 'RRSIG': return rrrsig\n case 'RP': return rrp\n case 'NSEC': return rnsec\n case 'NSEC3': return rnsec3\n case 'SSHFP': return rsshfp\n case 'DS': return rds\n case 'NAPTR': return rnaptr\n case 'TLSA': return rtlsa\n }\n return runknown\n}\n\nconst answer = exports.answer = {}\n\nanswer.encode = function (a, buf, offset) {\n if (!buf) buf = Buffer.alloc(answer.encodingLength(a))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n name.encode(a.name, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(types.toType(a.type), offset)\n\n if (a.type.toUpperCase() === 'OPT') {\n if (a.name !== '.') {\n throw new Error('OPT name must be root.')\n }\n buf.writeUInt16BE(a.udpPayloadSize || 4096, offset + 2)\n buf.writeUInt8(a.extendedRcode || 0, offset + 4)\n buf.writeUInt8(a.ednsVersion || 0, offset + 5)\n buf.writeUInt16BE(a.flags || 0, offset + 6)\n\n offset += 8\n ropt.encode(a.options || [], buf, offset)\n offset += ropt.encode.bytes\n } else {\n let klass = classes.toClass(a.class === undefined ? 'IN' : a.class)\n if (a.flush) klass |= FLUSH_MASK // the 1st bit of the class is the flush bit\n buf.writeUInt16BE(klass, offset + 2)\n buf.writeUInt32BE(a.ttl || 0, offset + 4)\n\n offset += 8\n const enc = renc(a.type)\n enc.encode(a.data, buf, offset)\n offset += enc.encode.bytes\n }\n\n answer.encode.bytes = offset - oldOffset\n return buf\n}\n\nanswer.encode.bytes = 0\n\nanswer.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const a = {}\n const oldOffset = offset\n\n a.name = name.decode(buf, offset)\n offset += name.decode.bytes\n a.type = types.toString(buf.readUInt16BE(offset))\n if (a.type === 'OPT') {\n a.udpPayloadSize = buf.readUInt16BE(offset + 2)\n a.extendedRcode = buf.readUInt8(offset + 4)\n a.ednsVersion = buf.readUInt8(offset + 5)\n a.flags = buf.readUInt16BE(offset + 6)\n a.flag_do = ((a.flags >> 15) & 0x1) === 1\n a.options = ropt.decode(buf, offset + 8)\n offset += 8 + ropt.decode.bytes\n } else {\n const klass = buf.readUInt16BE(offset + 2)\n a.ttl = buf.readUInt32BE(offset + 4)\n\n a.class = classes.toString(klass & NOT_FLUSH_MASK)\n a.flush = !!(klass & FLUSH_MASK)\n\n const enc = renc(a.type)\n a.data = enc.decode(buf, offset + 8)\n offset += 8 + enc.decode.bytes\n }\n\n answer.decode.bytes = offset - oldOffset\n return a\n}\n\nanswer.decode.bytes = 0\n\nanswer.encodingLength = function (a) {\n const data = (a.data !== null && a.data !== undefined) ? a.data : a.options\n return name.encodingLength(a.name) + 8 + renc(a.type).encodingLength(data)\n}\n\nconst question = exports.question = {}\n\nquestion.encode = function (q, buf, offset) {\n if (!buf) buf = Buffer.alloc(question.encodingLength(q))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n name.encode(q.name, buf, offset)\n offset += name.encode.bytes\n\n buf.writeUInt16BE(types.toType(q.type), offset)\n offset += 2\n\n buf.writeUInt16BE(classes.toClass(q.class === undefined ? 'IN' : q.class), offset)\n offset += 2\n\n question.encode.bytes = offset - oldOffset\n return q\n}\n\nquestion.encode.bytes = 0\n\nquestion.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n const q = {}\n\n q.name = name.decode(buf, offset)\n offset += name.decode.bytes\n\n q.type = types.toString(buf.readUInt16BE(offset))\n offset += 2\n\n q.class = classes.toString(buf.readUInt16BE(offset))\n offset += 2\n\n const qu = !!(q.class & QU_MASK)\n if (qu) q.class &= NOT_QU_MASK\n\n question.decode.bytes = offset - oldOffset\n return q\n}\n\nquestion.decode.bytes = 0\n\nquestion.encodingLength = function (q) {\n return name.encodingLength(q.name) + 4\n}\n\nexports.AUTHORITATIVE_ANSWER = 1 << 10\nexports.TRUNCATED_RESPONSE = 1 << 9\nexports.RECURSION_DESIRED = 1 << 8\nexports.RECURSION_AVAILABLE = 1 << 7\nexports.AUTHENTIC_DATA = 1 << 5\nexports.CHECKING_DISABLED = 1 << 4\nexports.DNSSEC_OK = 1 << 15\n\nexports.encode = function (result, buf, offset) {\n const allocing = !buf\n\n if (allocing) buf = Buffer.alloc(exports.encodingLength(result))\n if (!offset) offset = 0\n\n const oldOffset = offset\n\n if (!result.questions) result.questions = []\n if (!result.answers) result.answers = []\n if (!result.authorities) result.authorities = []\n if (!result.additionals) result.additionals = []\n\n header.encode(result, buf, offset)\n offset += header.encode.bytes\n\n offset = encodeList(result.questions, question, buf, offset)\n offset = encodeList(result.answers, answer, buf, offset)\n offset = encodeList(result.authorities, answer, buf, offset)\n offset = encodeList(result.additionals, answer, buf, offset)\n\n exports.encode.bytes = offset - oldOffset\n\n // just a quick sanity check\n if (allocing && exports.encode.bytes !== buf.length) {\n return buf.slice(0, exports.encode.bytes)\n }\n\n return buf\n}\n\nexports.encode.bytes = 0\n\nexports.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const oldOffset = offset\n const result = header.decode(buf, offset)\n offset += header.decode.bytes\n\n offset = decodeList(result.questions, question, buf, offset)\n offset = decodeList(result.answers, answer, buf, offset)\n offset = decodeList(result.authorities, answer, buf, offset)\n offset = decodeList(result.additionals, answer, buf, offset)\n\n exports.decode.bytes = offset - oldOffset\n\n return result\n}\n\nexports.decode.bytes = 0\n\nexports.encodingLength = function (result) {\n return header.encodingLength(result) +\n encodingLengthList(result.questions || [], question) +\n encodingLengthList(result.answers || [], answer) +\n encodingLengthList(result.authorities || [], answer) +\n encodingLengthList(result.additionals || [], answer)\n}\n\nexports.streamEncode = function (result) {\n const buf = exports.encode(result)\n const sbuf = Buffer.alloc(2)\n sbuf.writeUInt16BE(buf.byteLength)\n const combine = Buffer.concat([sbuf, buf])\n exports.streamEncode.bytes = combine.byteLength\n return combine\n}\n\nexports.streamEncode.bytes = 0\n\nexports.streamDecode = function (sbuf) {\n const len = sbuf.readUInt16BE(0)\n if (sbuf.byteLength < len + 2) {\n // not enough data\n return null\n }\n const result = exports.decode(sbuf.slice(2))\n exports.streamDecode.bytes = exports.decode.bytes\n return result\n}\n\nexports.streamDecode.bytes = 0\n\nfunction encodingLengthList (list, enc) {\n let len = 0\n for (let i = 0; i < list.length; i++) len += enc.encodingLength(list[i])\n return len\n}\n\nfunction encodeList (list, enc, buf, offset) {\n for (let i = 0; i < list.length; i++) {\n enc.encode(list[i], buf, offset)\n offset += enc.encode.bytes\n }\n return offset\n}\n\nfunction decodeList (list, enc, buf, offset) {\n for (let i = 0; i < list.length; i++) {\n list[i] = enc.decode(buf, offset)\n offset += enc.decode.bytes\n }\n return offset\n}\n","'use strict'\n\n/*\n * Traditional DNS header OPCODEs (4-bits) defined by IANA in\n * https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-5\n */\n\nexports.toString = function (opcode) {\n switch (opcode) {\n case 0: return 'QUERY'\n case 1: return 'IQUERY'\n case 2: return 'STATUS'\n case 3: return 'OPCODE_3'\n case 4: return 'NOTIFY'\n case 5: return 'UPDATE'\n case 6: return 'OPCODE_6'\n case 7: return 'OPCODE_7'\n case 8: return 'OPCODE_8'\n case 9: return 'OPCODE_9'\n case 10: return 'OPCODE_10'\n case 11: return 'OPCODE_11'\n case 12: return 'OPCODE_12'\n case 13: return 'OPCODE_13'\n case 14: return 'OPCODE_14'\n case 15: return 'OPCODE_15'\n }\n return 'OPCODE_' + opcode\n}\n\nexports.toOpcode = function (code) {\n switch (code.toUpperCase()) {\n case 'QUERY': return 0\n case 'IQUERY': return 1\n case 'STATUS': return 2\n case 'OPCODE_3': return 3\n case 'NOTIFY': return 4\n case 'UPDATE': return 5\n case 'OPCODE_6': return 6\n case 'OPCODE_7': return 7\n case 'OPCODE_8': return 8\n case 'OPCODE_9': return 9\n case 'OPCODE_10': return 10\n case 'OPCODE_11': return 11\n case 'OPCODE_12': return 12\n case 'OPCODE_13': return 13\n case 'OPCODE_14': return 14\n case 'OPCODE_15': return 15\n }\n return 0\n}\n","'use strict'\n\nexports.toString = function (type) {\n switch (type) {\n // list at\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-11\n case 1: return 'LLQ'\n case 2: return 'UL'\n case 3: return 'NSID'\n case 5: return 'DAU'\n case 6: return 'DHU'\n case 7: return 'N3U'\n case 8: return 'CLIENT_SUBNET'\n case 9: return 'EXPIRE'\n case 10: return 'COOKIE'\n case 11: return 'TCP_KEEPALIVE'\n case 12: return 'PADDING'\n case 13: return 'CHAIN'\n case 14: return 'KEY_TAG'\n case 26946: return 'DEVICEID'\n }\n if (type < 0) {\n return null\n }\n return `OPTION_${type}`\n}\n\nexports.toCode = function (name) {\n if (typeof name === 'number') {\n return name\n }\n if (!name) {\n return -1\n }\n switch (name.toUpperCase()) {\n case 'OPTION_0': return 0\n case 'LLQ': return 1\n case 'UL': return 2\n case 'NSID': return 3\n case 'OPTION_4': return 4\n case 'DAU': return 5\n case 'DHU': return 6\n case 'N3U': return 7\n case 'CLIENT_SUBNET': return 8\n case 'EXPIRE': return 9\n case 'COOKIE': return 10\n case 'TCP_KEEPALIVE': return 11\n case 'PADDING': return 12\n case 'CHAIN': return 13\n case 'KEY_TAG': return 14\n case 'DEVICEID': return 26946\n case 'OPTION_65535': return 65535\n }\n const m = name.match(/_(\\d+)$/)\n if (m) {\n return parseInt(m[1], 10)\n }\n return -1\n}\n","'use strict'\n\n/*\n * Traditional DNS header RCODEs (4-bits) defined by IANA in\n * https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml\n */\n\nexports.toString = function (rcode) {\n switch (rcode) {\n case 0: return 'NOERROR'\n case 1: return 'FORMERR'\n case 2: return 'SERVFAIL'\n case 3: return 'NXDOMAIN'\n case 4: return 'NOTIMP'\n case 5: return 'REFUSED'\n case 6: return 'YXDOMAIN'\n case 7: return 'YXRRSET'\n case 8: return 'NXRRSET'\n case 9: return 'NOTAUTH'\n case 10: return 'NOTZONE'\n case 11: return 'RCODE_11'\n case 12: return 'RCODE_12'\n case 13: return 'RCODE_13'\n case 14: return 'RCODE_14'\n case 15: return 'RCODE_15'\n }\n return 'RCODE_' + rcode\n}\n\nexports.toRcode = function (code) {\n switch (code.toUpperCase()) {\n case 'NOERROR': return 0\n case 'FORMERR': return 1\n case 'SERVFAIL': return 2\n case 'NXDOMAIN': return 3\n case 'NOTIMP': return 4\n case 'REFUSED': return 5\n case 'YXDOMAIN': return 6\n case 'YXRRSET': return 7\n case 'NXRRSET': return 8\n case 'NOTAUTH': return 9\n case 'NOTZONE': return 10\n case 'RCODE_11': return 11\n case 'RCODE_12': return 12\n case 'RCODE_13': return 13\n case 'RCODE_14': return 14\n case 'RCODE_15': return 15\n }\n return 0\n}\n","'use strict'\n\nexports.toString = function (type) {\n switch (type) {\n case 1: return 'A'\n case 10: return 'NULL'\n case 28: return 'AAAA'\n case 18: return 'AFSDB'\n case 42: return 'APL'\n case 257: return 'CAA'\n case 60: return 'CDNSKEY'\n case 59: return 'CDS'\n case 37: return 'CERT'\n case 5: return 'CNAME'\n case 49: return 'DHCID'\n case 32769: return 'DLV'\n case 39: return 'DNAME'\n case 48: return 'DNSKEY'\n case 43: return 'DS'\n case 55: return 'HIP'\n case 13: return 'HINFO'\n case 45: return 'IPSECKEY'\n case 25: return 'KEY'\n case 36: return 'KX'\n case 29: return 'LOC'\n case 15: return 'MX'\n case 35: return 'NAPTR'\n case 2: return 'NS'\n case 47: return 'NSEC'\n case 50: return 'NSEC3'\n case 51: return 'NSEC3PARAM'\n case 12: return 'PTR'\n case 46: return 'RRSIG'\n case 17: return 'RP'\n case 24: return 'SIG'\n case 6: return 'SOA'\n case 99: return 'SPF'\n case 33: return 'SRV'\n case 44: return 'SSHFP'\n case 32768: return 'TA'\n case 249: return 'TKEY'\n case 52: return 'TLSA'\n case 250: return 'TSIG'\n case 16: return 'TXT'\n case 252: return 'AXFR'\n case 251: return 'IXFR'\n case 41: return 'OPT'\n case 255: return 'ANY'\n }\n return 'UNKNOWN_' + type\n}\n\nexports.toType = function (name) {\n switch (name.toUpperCase()) {\n case 'A': return 1\n case 'NULL': return 10\n case 'AAAA': return 28\n case 'AFSDB': return 18\n case 'APL': return 42\n case 'CAA': return 257\n case 'CDNSKEY': return 60\n case 'CDS': return 59\n case 'CERT': return 37\n case 'CNAME': return 5\n case 'DHCID': return 49\n case 'DLV': return 32769\n case 'DNAME': return 39\n case 'DNSKEY': return 48\n case 'DS': return 43\n case 'HIP': return 55\n case 'HINFO': return 13\n case 'IPSECKEY': return 45\n case 'KEY': return 25\n case 'KX': return 36\n case 'LOC': return 29\n case 'MX': return 15\n case 'NAPTR': return 35\n case 'NS': return 2\n case 'NSEC': return 47\n case 'NSEC3': return 50\n case 'NSEC3PARAM': return 51\n case 'PTR': return 12\n case 'RRSIG': return 46\n case 'RP': return 17\n case 'SIG': return 24\n case 'SOA': return 6\n case 'SPF': return 99\n case 'SRV': return 33\n case 'SSHFP': return 44\n case 'TA': return 32768\n case 'TKEY': return 249\n case 'TLSA': return 52\n case 'TSIG': return 250\n case 'TXT': return 16\n case 'AXFR': return 252\n case 'IXFR': return 251\n case 'OPT': return 41\n case 'ANY': return 255\n case '*': return 255\n }\n if (name.toUpperCase().startsWith('UNKNOWN_')) return parseInt(name.slice(8))\n return 0\n}\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n const vaultPath = _vaultPath(options)\n\n // Parse .env.vault\n const result = DotenvModule.configDotenv({ path: vaultPath })\n if (!result.parsed) {\n throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}][INFO] ${message}`)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n throw new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development')\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n throw new Error('INVALID_DOTENV_KEY: Missing key part')\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n throw new Error('INVALID_DOTENV_KEY: Missing environment part')\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n\n if (options && options.path && options.path.length > 0) {\n dotenvPath = options.path\n }\n\n // Locate .env.vault\n return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n _log('Loading env from encrypted .env.vault')\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n let dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n\n if (options) {\n if (options.path != null) {\n dotenvPath = _resolveHome(options.path)\n }\n if (options.encoding != null) {\n encoding = options.encoding\n }\n }\n\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${dotenvPath} ${e.message}`)\n }\n\n return { error: e }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n const vaultPath = _vaultPath(options)\n\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n // dotenvKey exists but .env.vault file does not exist\n if (!fs.existsSync(vaultPath)) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.slice(0, 12)\n const authTag = ciphertext.slice(-16)\n ciphertext = ciphertext.slice(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const msg = 'INVALID_DOTENV_KEY: It must be 64 characters long (or more)'\n throw new Error(msg)\n } else if (decryptionFailed) {\n const msg = 'DECRYPTION_FAILED: Please check your DOTENV_KEY'\n throw new Error(msg)\n } else {\n console.error('Error: ', error.code)\n console.error('Error: ', error.message)\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n throw new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n","/*!\n * ee-first\n * Copyright(c) 2014 Jonathan Ong\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = first\n\n/**\n * Get the first event in a set of event emitters and event pairs.\n *\n * @param {array} stuff\n * @param {function} done\n * @public\n */\n\nfunction first(stuff, done) {\n if (!Array.isArray(stuff))\n throw new TypeError('arg must be an array of [ee, events...] arrays')\n\n var cleanups = []\n\n for (var i = 0; i < stuff.length; i++) {\n var arr = stuff[i]\n\n if (!Array.isArray(arr) || arr.length < 2)\n throw new TypeError('each array member must be [ee, events...]')\n\n var ee = arr[0]\n\n for (var j = 1; j < arr.length; j++) {\n var event = arr[j]\n var fn = listener(event, callback)\n\n // listen to the event\n ee.on(event, fn)\n // push this listener to the list of cleanups\n cleanups.push({\n ee: ee,\n event: event,\n fn: fn,\n })\n }\n }\n\n function callback() {\n cleanup()\n done.apply(null, arguments)\n }\n\n function cleanup() {\n var x\n for (var i = 0; i < cleanups.length; i++) {\n x = cleanups[i]\n x.ee.removeListener(x.event, x.fn)\n }\n }\n\n function thunk(fn) {\n done = fn\n }\n\n thunk.cancel = cleanup\n\n return thunk\n}\n\n/**\n * Create the event listener.\n * @private\n */\n\nfunction listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}\n","/*!\n * encodeurl\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = encodeUrl\n\n/**\n * RegExp to match non-URL code points, *after* encoding (i.e. not including \"%\")\n * and including invalid escape sequences.\n * @private\n */\n\nvar ENCODE_CHARS_REGEXP = /(?:[^\\x21\\x25\\x26-\\x3B\\x3D\\x3F-\\x5B\\x5D\\x5F\\x61-\\x7A\\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g\n\n/**\n * RegExp to match unmatched surrogate pair.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]([^\\uDC00-\\uDFFF]|$)/g\n\n/**\n * String to replace unmatched surrogate pair with.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\\uFFFD$2'\n\n/**\n * Encode a URL to a percent-encoded form, excluding already-encoded sequences.\n *\n * This function will take an already-encoded URL and encode all the non-URL\n * code points. This function will not encode the \"%\" character unless it is\n * not part of a valid sequence (`%20` will be left as-is, but `%foo` will\n * be encoded as `%25foo`).\n *\n * This encode is meant to be \"safe\" and does not throw errors. It will try as\n * hard as it can to properly encode the given URL, including replacing any raw,\n * unpaired surrogate pairs with the Unicode replacement character prior to\n * encoding.\n *\n * @param {string} url\n * @return {string}\n * @public\n */\n\nfunction encodeUrl (url) {\n return String(url)\n .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)\n .replace(ENCODE_CHARS_REGEXP, encodeURI)\n}\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","/*!\n * etag\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = etag\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar crypto = require('crypto')\nvar Stats = require('fs').Stats\n\n/**\n * Module variables.\n * @private\n */\n\nvar toString = Object.prototype.toString\n\n/**\n * Generate an entity tag.\n *\n * @param {Buffer|string} entity\n * @return {string}\n * @private\n */\n\nfunction entitytag (entity) {\n if (entity.length === 0) {\n // fast-path empty\n return '\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"'\n }\n\n // compute hash of entity\n var hash = crypto\n .createHash('sha1')\n .update(entity, 'utf8')\n .digest('base64')\n .substring(0, 27)\n\n // compute length of entity\n var len = typeof entity === 'string'\n ? Buffer.byteLength(entity, 'utf8')\n : entity.length\n\n return '\"' + len.toString(16) + '-' + hash + '\"'\n}\n\n/**\n * Create a simple ETag.\n *\n * @param {string|Buffer|Stats} entity\n * @param {object} [options]\n * @param {boolean} [options.weak]\n * @return {String}\n * @public\n */\n\nfunction etag (entity, options) {\n if (entity == null) {\n throw new TypeError('argument entity is required')\n }\n\n // support fs.Stats object\n var isStats = isstats(entity)\n var weak = options && typeof options.weak === 'boolean'\n ? options.weak\n : isStats\n\n // validate argument\n if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) {\n throw new TypeError('argument entity must be string, Buffer, or fs.Stats')\n }\n\n // generate entity tag\n var tag = isStats\n ? stattag(entity)\n : entitytag(entity)\n\n return weak\n ? 'W/' + tag\n : tag\n}\n\n/**\n * Determine if object is a Stats object.\n *\n * @param {object} obj\n * @return {boolean}\n * @api private\n */\n\nfunction isstats (obj) {\n // genuine fs.Stats\n if (typeof Stats === 'function' && obj instanceof Stats) {\n return true\n }\n\n // quack quack\n return obj && typeof obj === 'object' &&\n 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' &&\n 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' &&\n 'ino' in obj && typeof obj.ino === 'number' &&\n 'size' in obj && typeof obj.size === 'number'\n}\n\n/**\n * Generate a tag for a stat.\n *\n * @param {object} stat\n * @return {string}\n * @private\n */\n\nfunction stattag (stat) {\n var mtime = stat.mtime.getTime().toString(16)\n var size = stat.size.toString(16)\n\n return '\"' + size + '-' + mtime + '\"'\n}\n","/*!\n * express-session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar cookie = require('cookie');\nvar crypto = require('crypto')\nvar debug = require('debug')('express-session');\nvar deprecate = require('depd')('express-session');\nvar onHeaders = require('on-headers')\nvar parseUrl = require('parseurl');\nvar signature = require('cookie-signature')\nvar uid = require('uid-safe').sync\n\nvar Cookie = require('./session/cookie')\nvar MemoryStore = require('./session/memory')\nvar Session = require('./session/session')\nvar Store = require('./session/store')\n\n// environment\n\nvar env = process.env.NODE_ENV;\n\n/**\n * Expose the middleware.\n */\n\nexports = module.exports = session;\n\n/**\n * Expose constructors.\n */\n\nexports.Store = Store;\nexports.Cookie = Cookie;\nexports.Session = Session;\nexports.MemoryStore = MemoryStore;\n\n/**\n * Warning message for `MemoryStore` usage in production.\n * @private\n */\n\nvar warning = 'Warning: connect.session() MemoryStore is not\\n'\n + 'designed for a production environment, as it will leak\\n'\n + 'memory, and will not scale past a single process.';\n\n/**\n * Node.js 0.8+ async implementation.\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Setup session store with the given `options`.\n *\n * @param {Object} [options]\n * @param {Object} [options.cookie] Options for cookie\n * @param {Function} [options.genid]\n * @param {String} [options.name=connect.sid] Session ID cookie name\n * @param {Boolean} [options.proxy]\n * @param {Boolean} [options.resave] Resave unmodified sessions back to the store\n * @param {Boolean} [options.rolling] Enable/disable rolling session expiration\n * @param {Boolean} [options.saveUninitialized] Save uninitialized sessions to the store\n * @param {String|Array} [options.secret] Secret for signing session ID\n * @param {Object} [options.store=MemoryStore] Session store\n * @param {String} [options.unset]\n * @return {Function} middleware\n * @public\n */\n\nfunction session(options) {\n var opts = options || {}\n\n // get the cookie options\n var cookieOptions = opts.cookie || {}\n\n // get the session id generate function\n var generateId = opts.genid || generateSessionId\n\n // get the session cookie name\n var name = opts.name || opts.key || 'connect.sid'\n\n // get the session store\n var store = opts.store || new MemoryStore()\n\n // get the trust proxy setting\n var trustProxy = opts.proxy\n\n // get the resave session option\n var resaveSession = opts.resave;\n\n // get the rolling session option\n var rollingSessions = Boolean(opts.rolling)\n\n // get the save uninitialized session option\n var saveUninitializedSession = opts.saveUninitialized\n\n // get the cookie signing secret\n var secret = opts.secret\n\n if (typeof generateId !== 'function') {\n throw new TypeError('genid option must be a function');\n }\n\n if (resaveSession === undefined) {\n deprecate('undefined resave option; provide resave option');\n resaveSession = true;\n }\n\n if (saveUninitializedSession === undefined) {\n deprecate('undefined saveUninitialized option; provide saveUninitialized option');\n saveUninitializedSession = true;\n }\n\n if (opts.unset && opts.unset !== 'destroy' && opts.unset !== 'keep') {\n throw new TypeError('unset option must be \"destroy\" or \"keep\"');\n }\n\n // TODO: switch to \"destroy\" on next major\n var unsetDestroy = opts.unset === 'destroy'\n\n if (Array.isArray(secret) && secret.length === 0) {\n throw new TypeError('secret option array must contain one or more strings');\n }\n\n if (secret && !Array.isArray(secret)) {\n secret = [secret];\n }\n\n if (!secret) {\n deprecate('req.secret; provide secret option');\n }\n\n // notify user that this store is not\n // meant for a production environment\n /* istanbul ignore next: not tested */\n if (env === 'production' && store instanceof MemoryStore) {\n console.warn(warning);\n }\n\n // generates the new session\n store.generate = function(req){\n req.sessionID = generateId(req);\n req.session = new Session(req);\n req.session.cookie = new Cookie(cookieOptions);\n\n if (cookieOptions.secure === 'auto') {\n req.session.cookie.secure = issecure(req, trustProxy);\n }\n };\n\n var storeImplementsTouch = typeof store.touch === 'function';\n\n // register event listeners for the store to track readiness\n var storeReady = true\n store.on('disconnect', function ondisconnect() {\n storeReady = false\n })\n store.on('connect', function onconnect() {\n storeReady = true\n })\n\n return function session(req, res, next) {\n // self-awareness\n if (req.session) {\n next()\n return\n }\n\n // Handle connection as if there is no session if\n // the store has temporarily disconnected etc\n if (!storeReady) {\n debug('store is disconnected')\n next()\n return\n }\n\n // pathname mismatch\n var originalPath = parseUrl.original(req).pathname || '/'\n if (originalPath.indexOf(cookieOptions.path || '/') !== 0) return next();\n\n // ensure a secret is available or bail\n if (!secret && !req.secret) {\n next(new Error('secret option required for sessions'));\n return;\n }\n\n // backwards compatibility for signed cookies\n // req.secret is passed from the cookie parser middleware\n var secrets = secret || [req.secret];\n\n var originalHash;\n var originalId;\n var savedHash;\n var touched = false\n\n // expose store\n req.sessionStore = store;\n\n // get the session ID from the cookie\n var cookieId = req.sessionID = getcookie(req, name, secrets);\n\n // set-cookie\n onHeaders(res, function(){\n if (!req.session) {\n debug('no session');\n return;\n }\n\n if (!shouldSetCookie(req)) {\n return;\n }\n\n // only send secure cookies via https\n if (req.session.cookie.secure && !issecure(req, trustProxy)) {\n debug('not secured');\n return;\n }\n\n if (!touched) {\n // touch session\n req.session.touch()\n touched = true\n }\n\n // set cookie\n setcookie(res, name, req.sessionID, secrets[0], req.session.cookie.data);\n });\n\n // proxy end() to commit the session\n var _end = res.end;\n var _write = res.write;\n var ended = false;\n res.end = function end(chunk, encoding) {\n if (ended) {\n return false;\n }\n\n ended = true;\n\n var ret;\n var sync = true;\n\n function writeend() {\n if (sync) {\n ret = _end.call(res, chunk, encoding);\n sync = false;\n return;\n }\n\n _end.call(res);\n }\n\n function writetop() {\n if (!sync) {\n return ret;\n }\n\n if (!res._header) {\n res._implicitHeader()\n }\n\n if (chunk == null) {\n ret = true;\n return ret;\n }\n\n var contentLength = Number(res.getHeader('Content-Length'));\n\n if (!isNaN(contentLength) && contentLength > 0) {\n // measure chunk\n chunk = !Buffer.isBuffer(chunk)\n ? Buffer.from(chunk, encoding)\n : chunk;\n encoding = undefined;\n\n if (chunk.length !== 0) {\n debug('split response');\n ret = _write.call(res, chunk.slice(0, chunk.length - 1));\n chunk = chunk.slice(chunk.length - 1, chunk.length);\n return ret;\n }\n }\n\n ret = _write.call(res, chunk, encoding);\n sync = false;\n\n return ret;\n }\n\n if (shouldDestroy(req)) {\n // destroy session\n debug('destroying');\n store.destroy(req.sessionID, function ondestroy(err) {\n if (err) {\n defer(next, err);\n }\n\n debug('destroyed');\n writeend();\n });\n\n return writetop();\n }\n\n // no session to save\n if (!req.session) {\n debug('no session');\n return _end.call(res, chunk, encoding);\n }\n\n if (!touched) {\n // touch session\n req.session.touch()\n touched = true\n }\n\n if (shouldSave(req)) {\n req.session.save(function onsave(err) {\n if (err) {\n defer(next, err);\n }\n\n writeend();\n });\n\n return writetop();\n } else if (storeImplementsTouch && shouldTouch(req)) {\n // store implements touch method\n debug('touching');\n store.touch(req.sessionID, req.session, function ontouch(err) {\n if (err) {\n defer(next, err);\n }\n\n debug('touched');\n writeend();\n });\n\n return writetop();\n }\n\n return _end.call(res, chunk, encoding);\n };\n\n // generate the session\n function generate() {\n store.generate(req);\n originalId = req.sessionID;\n originalHash = hash(req.session);\n wrapmethods(req.session);\n }\n\n // inflate the session\n function inflate (req, sess) {\n store.createSession(req, sess)\n originalId = req.sessionID\n originalHash = hash(sess)\n\n if (!resaveSession) {\n savedHash = originalHash\n }\n\n wrapmethods(req.session)\n }\n\n function rewrapmethods (sess, callback) {\n return function () {\n if (req.session !== sess) {\n wrapmethods(req.session)\n }\n\n callback.apply(this, arguments)\n }\n }\n\n // wrap session methods\n function wrapmethods(sess) {\n var _reload = sess.reload\n var _save = sess.save;\n\n function reload(callback) {\n debug('reloading %s', this.id)\n _reload.call(this, rewrapmethods(this, callback))\n }\n\n function save() {\n debug('saving %s', this.id);\n savedHash = hash(this);\n _save.apply(this, arguments);\n }\n\n Object.defineProperty(sess, 'reload', {\n configurable: true,\n enumerable: false,\n value: reload,\n writable: true\n })\n\n Object.defineProperty(sess, 'save', {\n configurable: true,\n enumerable: false,\n value: save,\n writable: true\n });\n }\n\n // check if session has been modified\n function isModified(sess) {\n return originalId !== sess.id || originalHash !== hash(sess);\n }\n\n // check if session has been saved\n function isSaved(sess) {\n return originalId === sess.id && savedHash === hash(sess);\n }\n\n // determine if session should be destroyed\n function shouldDestroy(req) {\n return req.sessionID && unsetDestroy && req.session == null;\n }\n\n // determine if session should be saved to store\n function shouldSave(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n debug('session ignored because of bogus req.sessionID %o', req.sessionID);\n return false;\n }\n\n return !saveUninitializedSession && !savedHash && cookieId !== req.sessionID\n ? isModified(req.session)\n : !isSaved(req.session)\n }\n\n // determine if session should be touched\n function shouldTouch(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n debug('session ignored because of bogus req.sessionID %o', req.sessionID);\n return false;\n }\n\n return cookieId === req.sessionID && !shouldSave(req);\n }\n\n // determine if cookie should be set on response\n function shouldSetCookie(req) {\n // cannot set cookie without a session ID\n if (typeof req.sessionID !== 'string') {\n return false;\n }\n\n return cookieId !== req.sessionID\n ? saveUninitializedSession || isModified(req.session)\n : rollingSessions || req.session.cookie.expires != null && isModified(req.session);\n }\n\n // generate a session if the browser doesn't send a sessionID\n if (!req.sessionID) {\n debug('no SID sent, generating session');\n generate();\n next();\n return;\n }\n\n // generate the session object\n debug('fetching %s', req.sessionID);\n store.get(req.sessionID, function(err, sess){\n // error handling\n if (err && err.code !== 'ENOENT') {\n debug('error %j', err);\n next(err)\n return\n }\n\n try {\n if (err || !sess) {\n debug('no session found')\n generate()\n } else {\n debug('session found')\n inflate(req, sess)\n }\n } catch (e) {\n next(e)\n return\n }\n\n next()\n });\n };\n};\n\n/**\n * Generate a session ID for a new session.\n *\n * @return {String}\n * @private\n */\n\nfunction generateSessionId(sess) {\n return uid(24);\n}\n\n/**\n * Get the session ID cookie from request.\n *\n * @return {string}\n * @private\n */\n\nfunction getcookie(req, name, secrets) {\n var header = req.headers.cookie;\n var raw;\n var val;\n\n // read from cookie header\n if (header) {\n var cookies = cookie.parse(header);\n\n raw = cookies[name];\n\n if (raw) {\n if (raw.substr(0, 2) === 's:') {\n val = unsigncookie(raw.slice(2), secrets);\n\n if (val === false) {\n debug('cookie signature invalid');\n val = undefined;\n }\n } else {\n debug('cookie unsigned')\n }\n }\n }\n\n // back-compat read from cookieParser() signedCookies data\n if (!val && req.signedCookies) {\n val = req.signedCookies[name];\n\n if (val) {\n deprecate('cookie should be available in req.headers.cookie');\n }\n }\n\n // back-compat read from cookieParser() cookies data\n if (!val && req.cookies) {\n raw = req.cookies[name];\n\n if (raw) {\n if (raw.substr(0, 2) === 's:') {\n val = unsigncookie(raw.slice(2), secrets);\n\n if (val) {\n deprecate('cookie should be available in req.headers.cookie');\n }\n\n if (val === false) {\n debug('cookie signature invalid');\n val = undefined;\n }\n } else {\n debug('cookie unsigned')\n }\n }\n }\n\n return val;\n}\n\n/**\n * Hash the given `sess` object omitting changes to `.cookie`.\n *\n * @param {Object} sess\n * @return {String}\n * @private\n */\n\nfunction hash(sess) {\n // serialize\n var str = JSON.stringify(sess, function (key, val) {\n // ignore sess.cookie property\n if (this === sess && key === 'cookie') {\n return\n }\n\n return val\n })\n\n // hash\n return crypto\n .createHash('sha1')\n .update(str, 'utf8')\n .digest('hex')\n}\n\n/**\n * Determine if request is secure.\n *\n * @param {Object} req\n * @param {Boolean} [trustProxy]\n * @return {Boolean}\n * @private\n */\n\nfunction issecure(req, trustProxy) {\n // socket is https server\n if (req.connection && req.connection.encrypted) {\n return true;\n }\n\n // do not trust proxy\n if (trustProxy === false) {\n return false;\n }\n\n // no explicit trust; try req.secure from express\n if (trustProxy !== true) {\n return req.secure === true\n }\n\n // read the proto from x-forwarded-proto header\n var header = req.headers['x-forwarded-proto'] || '';\n var index = header.indexOf(',');\n var proto = index !== -1\n ? header.substr(0, index).toLowerCase().trim()\n : header.toLowerCase().trim()\n\n return proto === 'https';\n}\n\n/**\n * Set cookie on response.\n *\n * @private\n */\n\nfunction setcookie(res, name, val, secret, options) {\n var signed = 's:' + signature.sign(val, secret);\n var data = cookie.serialize(name, signed, options);\n\n debug('set-cookie %s', data);\n\n var prev = res.getHeader('Set-Cookie') || []\n var header = Array.isArray(prev) ? prev.concat(data) : [prev, data];\n\n res.setHeader('Set-Cookie', header)\n}\n\n/**\n * Verify and decode the given `val` with `secrets`.\n *\n * @param {String} val\n * @param {Array} secrets\n * @returns {String|Boolean}\n * @private\n */\nfunction unsigncookie(val, secrets) {\n for (var i = 0; i < secrets.length; i++) {\n var result = signature.unsign(val, secrets[i]);\n\n if (result !== false) {\n return result;\n }\n }\n\n return false;\n}\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/*!\n * Connect - session - Cookie\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar cookie = require('cookie')\nvar deprecate = require('depd')('express-session')\n\n/**\n * Initialize a new `Cookie` with the given `options`.\n *\n * @param {IncomingMessage} req\n * @param {Object} options\n * @api private\n */\n\nvar Cookie = module.exports = function Cookie(options) {\n this.path = '/';\n this.maxAge = null;\n this.httpOnly = true;\n\n if (options) {\n if (typeof options !== 'object') {\n throw new TypeError('argument options must be a object')\n }\n\n for (var key in options) {\n if (key !== 'data') {\n this[key] = options[key]\n }\n }\n }\n\n if (this.originalMaxAge === undefined || this.originalMaxAge === null) {\n this.originalMaxAge = this.maxAge\n }\n};\n\n/*!\n * Prototype.\n */\n\nCookie.prototype = {\n\n /**\n * Set expires `date`.\n *\n * @param {Date} date\n * @api public\n */\n\n set expires(date) {\n this._expires = date;\n this.originalMaxAge = this.maxAge;\n },\n\n /**\n * Get expires `date`.\n *\n * @return {Date}\n * @api public\n */\n\n get expires() {\n return this._expires;\n },\n\n /**\n * Set expires via max-age in `ms`.\n *\n * @param {Number} ms\n * @api public\n */\n\n set maxAge(ms) {\n if (ms && typeof ms !== 'number' && !(ms instanceof Date)) {\n throw new TypeError('maxAge must be a number or Date')\n }\n\n if (ms instanceof Date) {\n deprecate('maxAge as Date; pass number of milliseconds instead')\n }\n\n this.expires = typeof ms === 'number'\n ? new Date(Date.now() + ms)\n : ms;\n },\n\n /**\n * Get expires max-age in `ms`.\n *\n * @return {Number}\n * @api public\n */\n\n get maxAge() {\n return this.expires instanceof Date\n ? this.expires.valueOf() - Date.now()\n : this.expires;\n },\n\n /**\n * Return cookie data object.\n *\n * @return {Object}\n * @api private\n */\n\n get data() {\n return {\n originalMaxAge: this.originalMaxAge\n , expires: this._expires\n , secure: this.secure\n , httpOnly: this.httpOnly\n , domain: this.domain\n , path: this.path\n , sameSite: this.sameSite\n }\n },\n\n /**\n * Return a serialized cookie string.\n *\n * @return {String}\n * @api public\n */\n\n serialize: function(name, val){\n return cookie.serialize(name, val, this.data);\n },\n\n /**\n * Return JSON representation of this cookie.\n *\n * @return {Object}\n * @api private\n */\n\n toJSON: function(){\n return this.data;\n }\n};\n","/*!\n * express-session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Store = require('./store')\nvar util = require('util')\n\n/**\n * Shim setImmediate for node.js < 0.10\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Module exports.\n */\n\nmodule.exports = MemoryStore\n\n/**\n * A session store in memory.\n * @public\n */\n\nfunction MemoryStore() {\n Store.call(this)\n this.sessions = Object.create(null)\n}\n\n/**\n * Inherit from Store.\n */\n\nutil.inherits(MemoryStore, Store)\n\n/**\n * Get all active sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.all = function all(callback) {\n var sessionIds = Object.keys(this.sessions)\n var sessions = Object.create(null)\n\n for (var i = 0; i < sessionIds.length; i++) {\n var sessionId = sessionIds[i]\n var session = getSession.call(this, sessionId)\n\n if (session) {\n sessions[sessionId] = session;\n }\n }\n\n callback && defer(callback, null, sessions)\n}\n\n/**\n * Clear all sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.clear = function clear(callback) {\n this.sessions = Object.create(null)\n callback && defer(callback)\n}\n\n/**\n * Destroy the session associated with the given session ID.\n *\n * @param {string} sessionId\n * @public\n */\n\nMemoryStore.prototype.destroy = function destroy(sessionId, callback) {\n delete this.sessions[sessionId]\n callback && defer(callback)\n}\n\n/**\n * Fetch session by the given session ID.\n *\n * @param {string} sessionId\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.get = function get(sessionId, callback) {\n defer(callback, null, getSession.call(this, sessionId))\n}\n\n/**\n * Commit the given session associated with the given sessionId to the store.\n *\n * @param {string} sessionId\n * @param {object} session\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.set = function set(sessionId, session, callback) {\n this.sessions[sessionId] = JSON.stringify(session)\n callback && defer(callback)\n}\n\n/**\n * Get number of active sessions.\n *\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.length = function length(callback) {\n this.all(function (err, sessions) {\n if (err) return callback(err)\n callback(null, Object.keys(sessions).length)\n })\n}\n\n/**\n * Touch the given session object associated with the given session ID.\n *\n * @param {string} sessionId\n * @param {object} session\n * @param {function} callback\n * @public\n */\n\nMemoryStore.prototype.touch = function touch(sessionId, session, callback) {\n var currentSession = getSession.call(this, sessionId)\n\n if (currentSession) {\n // update expiration\n currentSession.cookie = session.cookie\n this.sessions[sessionId] = JSON.stringify(currentSession)\n }\n\n callback && defer(callback)\n}\n\n/**\n * Get session from the store.\n * @private\n */\n\nfunction getSession(sessionId) {\n var sess = this.sessions[sessionId]\n\n if (!sess) {\n return\n }\n\n // parse\n sess = JSON.parse(sess)\n\n if (sess.cookie) {\n var expires = typeof sess.cookie.expires === 'string'\n ? new Date(sess.cookie.expires)\n : sess.cookie.expires\n\n // destroy expired session\n if (expires && expires <= Date.now()) {\n delete this.sessions[sessionId]\n return\n }\n }\n\n return sess\n}\n","/*!\n * Connect - session - Session\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Expose Session.\n */\n\nmodule.exports = Session;\n\n/**\n * Create a new `Session` with the given request and `data`.\n *\n * @param {IncomingRequest} req\n * @param {Object} data\n * @api private\n */\n\nfunction Session(req, data) {\n Object.defineProperty(this, 'req', { value: req });\n Object.defineProperty(this, 'id', { value: req.sessionID });\n\n if (typeof data === 'object' && data !== null) {\n // merge data into this, ignoring prototype properties\n for (var prop in data) {\n if (!(prop in this)) {\n this[prop] = data[prop]\n }\n }\n }\n}\n\n/**\n * Update reset `.cookie.maxAge` to prevent\n * the cookie from expiring when the\n * session is still active.\n *\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'touch', function touch() {\n return this.resetMaxAge();\n});\n\n/**\n * Reset `.maxAge` to `.originalMaxAge`.\n *\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'resetMaxAge', function resetMaxAge() {\n this.cookie.maxAge = this.cookie.originalMaxAge;\n return this;\n});\n\n/**\n * Save the session data with optional callback `fn(err)`.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'save', function save(fn) {\n this.req.sessionStore.set(this.id, this, fn || function(){});\n return this;\n});\n\n/**\n * Re-loads the session data _without_ altering\n * the maxAge properties. Invokes the callback `fn(err)`,\n * after which time if no exception has occurred the\n * `req.session` property will be a new `Session` object,\n * although representing the same session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'reload', function reload(fn) {\n var req = this.req\n var store = this.req.sessionStore\n\n store.get(this.id, function(err, sess){\n if (err) return fn(err);\n if (!sess) return fn(new Error('failed to load session'));\n store.createSession(req, sess);\n fn();\n });\n return this;\n});\n\n/**\n * Destroy `this` session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'destroy', function destroy(fn) {\n delete this.req.session;\n this.req.sessionStore.destroy(this.id, fn);\n return this;\n});\n\n/**\n * Regenerate this request's session.\n *\n * @param {Function} fn\n * @return {Session} for chaining\n * @api public\n */\n\ndefineMethod(Session.prototype, 'regenerate', function regenerate(fn) {\n this.req.sessionStore.regenerate(this.req, fn);\n return this;\n});\n\n/**\n * Helper function for creating a method on a prototype.\n *\n * @param {Object} obj\n * @param {String} name\n * @param {Function} fn\n * @private\n */\nfunction defineMethod(obj, name, fn) {\n Object.defineProperty(obj, name, {\n configurable: true,\n enumerable: false,\n value: fn,\n writable: true\n });\n};\n","/*!\n * Connect - session - Store\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Cookie = require('./cookie')\nvar EventEmitter = require('events').EventEmitter\nvar Session = require('./session')\nvar util = require('util')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Store\n\n/**\n * Abstract base class for session stores.\n * @public\n */\n\nfunction Store () {\n EventEmitter.call(this)\n}\n\n/**\n * Inherit from EventEmitter.\n */\n\nutil.inherits(Store, EventEmitter)\n\n/**\n * Re-generate the given requests's session.\n *\n * @param {IncomingRequest} req\n * @return {Function} fn\n * @api public\n */\n\nStore.prototype.regenerate = function(req, fn){\n var self = this;\n this.destroy(req.sessionID, function(err){\n self.generate(req);\n fn(err);\n });\n};\n\n/**\n * Load a `Session` instance via the given `sid`\n * and invoke the callback `fn(err, sess)`.\n *\n * @param {String} sid\n * @param {Function} fn\n * @api public\n */\n\nStore.prototype.load = function(sid, fn){\n var self = this;\n this.get(sid, function(err, sess){\n if (err) return fn(err);\n if (!sess) return fn();\n var req = { sessionID: sid, sessionStore: self };\n fn(null, self.createSession(req, sess))\n });\n};\n\n/**\n * Create session from JSON `sess` data.\n *\n * @param {IncomingRequest} req\n * @param {Object} sess\n * @return {Session}\n * @api private\n */\n\nStore.prototype.createSession = function(req, sess){\n var expires = sess.cookie.expires\n var originalMaxAge = sess.cookie.originalMaxAge\n\n sess.cookie = new Cookie(sess.cookie);\n\n if (typeof expires === 'string') {\n // convert expires to a Date object\n sess.cookie.expires = new Date(expires)\n }\n\n // keep originalMaxAge intact\n sess.cookie.originalMaxAge = originalMaxAge\n\n req.session = new Session(req, sess);\n return req.session;\n};\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\nmodule.exports = require('./lib/express');\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar finalhandler = require('finalhandler');\nvar Router = require('./router');\nvar methods = require('methods');\nvar middleware = require('./middleware/init');\nvar query = require('./middleware/query');\nvar debug = require('debug')('express:application');\nvar View = require('./view');\nvar http = require('http');\nvar compileETag = require('./utils').compileETag;\nvar compileQueryParser = require('./utils').compileQueryParser;\nvar compileTrust = require('./utils').compileTrust;\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar merge = require('utils-merge');\nvar resolve = require('path').resolve;\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty\nvar slice = Array.prototype.slice;\n\n/**\n * Application prototype.\n */\n\nvar app = exports = module.exports = {};\n\n/**\n * Variable for trust proxy inheritance back-compat\n * @private\n */\n\nvar trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';\n\n/**\n * Initialize the server.\n *\n * - setup default configuration\n * - setup default middleware\n * - setup route reflection methods\n *\n * @private\n */\n\napp.init = function init() {\n this.cache = {};\n this.engines = {};\n this.settings = {};\n\n this.defaultConfiguration();\n};\n\n/**\n * Initialize application configuration.\n * @private\n */\n\napp.defaultConfiguration = function defaultConfiguration() {\n var env = process.env.NODE_ENV || 'development';\n\n // default settings\n this.enable('x-powered-by');\n this.set('etag', 'weak');\n this.set('env', env);\n this.set('query parser', 'extended');\n this.set('subdomain offset', 2);\n this.set('trust proxy', false);\n\n // trust proxy inherit back-compat\n Object.defineProperty(this.settings, trustProxyDefaultSymbol, {\n configurable: true,\n value: true\n });\n\n debug('booting in %s mode', env);\n\n this.on('mount', function onmount(parent) {\n // inherit trust proxy\n if (this.settings[trustProxyDefaultSymbol] === true\n && typeof parent.settings['trust proxy fn'] === 'function') {\n delete this.settings['trust proxy'];\n delete this.settings['trust proxy fn'];\n }\n\n // inherit protos\n setPrototypeOf(this.request, parent.request)\n setPrototypeOf(this.response, parent.response)\n setPrototypeOf(this.engines, parent.engines)\n setPrototypeOf(this.settings, parent.settings)\n });\n\n // setup locals\n this.locals = Object.create(null);\n\n // top-most app is mounted at /\n this.mountpath = '/';\n\n // default locals\n this.locals.settings = this.settings;\n\n // default configuration\n this.set('view', View);\n this.set('views', resolve('views'));\n this.set('jsonp callback name', 'callback');\n\n if (env === 'production') {\n this.enable('view cache');\n }\n\n Object.defineProperty(this, 'router', {\n get: function() {\n throw new Error('\\'app.router\\' is deprecated!\\nPlease see the 3.x to 4.x migration guide for details on how to update your app.');\n }\n });\n};\n\n/**\n * lazily adds the base router if it has not yet been added.\n *\n * We cannot add the base router in the defaultConfiguration because\n * it reads app settings which might be set after that has run.\n *\n * @private\n */\napp.lazyrouter = function lazyrouter() {\n if (!this._router) {\n this._router = new Router({\n caseSensitive: this.enabled('case sensitive routing'),\n strict: this.enabled('strict routing')\n });\n\n this._router.use(query(this.get('query parser fn')));\n this._router.use(middleware.init(this));\n }\n};\n\n/**\n * Dispatch a req, res pair into the application. Starts pipeline processing.\n *\n * If no callback is provided, then default error handlers will respond\n * in the event of an error bubbling through the stack.\n *\n * @private\n */\n\napp.handle = function handle(req, res, callback) {\n var router = this._router;\n\n // final handler\n var done = callback || finalhandler(req, res, {\n env: this.get('env'),\n onerror: logerror.bind(this)\n });\n\n // no routes\n if (!router) {\n debug('no routes defined on app');\n done();\n return;\n }\n\n router.handle(req, res, done);\n};\n\n/**\n * Proxy `Router#use()` to add middleware to the app router.\n * See Router#use() documentation for details.\n *\n * If the _fn_ parameter is an express app, then it will be\n * mounted at the _route_ specified.\n *\n * @public\n */\n\napp.use = function use(fn) {\n var offset = 0;\n var path = '/';\n\n // default path to '/'\n // disambiguate app.use([fn])\n if (typeof fn !== 'function') {\n var arg = fn;\n\n while (Array.isArray(arg) && arg.length !== 0) {\n arg = arg[0];\n }\n\n // first arg is the path\n if (typeof arg !== 'function') {\n offset = 1;\n path = fn;\n }\n }\n\n var fns = flatten(slice.call(arguments, offset));\n\n if (fns.length === 0) {\n throw new TypeError('app.use() requires a middleware function')\n }\n\n // setup router\n this.lazyrouter();\n var router = this._router;\n\n fns.forEach(function (fn) {\n // non-express app\n if (!fn || !fn.handle || !fn.set) {\n return router.use(path, fn);\n }\n\n debug('.use app under %s', path);\n fn.mountpath = path;\n fn.parent = this;\n\n // restore .app property on req and res\n router.use(path, function mounted_app(req, res, next) {\n var orig = req.app;\n fn.handle(req, res, function (err) {\n setPrototypeOf(req, orig.request)\n setPrototypeOf(res, orig.response)\n next(err);\n });\n });\n\n // mounted an app\n fn.emit('mount', this);\n }, this);\n\n return this;\n};\n\n/**\n * Proxy to the app `Router#route()`\n * Returns a new `Route` instance for the _path_.\n *\n * Routes are isolated middleware stacks for specific paths.\n * See the Route api docs for details.\n *\n * @public\n */\n\napp.route = function route(path) {\n this.lazyrouter();\n return this._router.route(path);\n};\n\n/**\n * Register the given template engine callback `fn`\n * as `ext`.\n *\n * By default will `require()` the engine based on the\n * file extension. For example if you try to render\n * a \"foo.ejs\" file Express will invoke the following internally:\n *\n * app.engine('ejs', require('ejs').__express);\n *\n * For engines that do not provide `.__express` out of the box,\n * or if you wish to \"map\" a different extension to the template engine\n * you may use this method. For example mapping the EJS template engine to\n * \".html\" files:\n *\n * app.engine('html', require('ejs').renderFile);\n *\n * In this case EJS provides a `.renderFile()` method with\n * the same signature that Express expects: `(path, options, callback)`,\n * though note that it aliases this method as `ejs.__express` internally\n * so if you're using \".ejs\" extensions you don't need to do anything.\n *\n * Some template engines do not follow this convention, the\n * [Consolidate.js](https://github.com/tj/consolidate.js)\n * library was created to map all of node's popular template\n * engines to follow this convention, thus allowing them to\n * work seamlessly within Express.\n *\n * @param {String} ext\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\napp.engine = function engine(ext, fn) {\n if (typeof fn !== 'function') {\n throw new Error('callback function required');\n }\n\n // get file extension\n var extension = ext[0] !== '.'\n ? '.' + ext\n : ext;\n\n // store engine\n this.engines[extension] = fn;\n\n return this;\n};\n\n/**\n * Proxy to `Router#param()` with one added api feature. The _name_ parameter\n * can be an array of names.\n *\n * See the Router#param() docs for more details.\n *\n * @param {String|Array} name\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\napp.param = function param(name, fn) {\n this.lazyrouter();\n\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; i++) {\n this.param(name[i], fn);\n }\n\n return this;\n }\n\n this._router.param(name, fn);\n\n return this;\n};\n\n/**\n * Assign `setting` to `val`, or return `setting`'s value.\n *\n * app.set('foo', 'bar');\n * app.set('foo');\n * // => \"bar\"\n *\n * Mounted servers inherit their parent server's settings.\n *\n * @param {String} setting\n * @param {*} [val]\n * @return {Server} for chaining\n * @public\n */\n\napp.set = function set(setting, val) {\n if (arguments.length === 1) {\n // app.get(setting)\n var settings = this.settings\n\n while (settings && settings !== Object.prototype) {\n if (hasOwnProperty.call(settings, setting)) {\n return settings[setting]\n }\n\n settings = Object.getPrototypeOf(settings)\n }\n\n return undefined\n }\n\n debug('set \"%s\" to %o', setting, val);\n\n // set value\n this.settings[setting] = val;\n\n // trigger matched settings\n switch (setting) {\n case 'etag':\n this.set('etag fn', compileETag(val));\n break;\n case 'query parser':\n this.set('query parser fn', compileQueryParser(val));\n break;\n case 'trust proxy':\n this.set('trust proxy fn', compileTrust(val));\n\n // trust proxy inherit back-compat\n Object.defineProperty(this.settings, trustProxyDefaultSymbol, {\n configurable: true,\n value: false\n });\n\n break;\n }\n\n return this;\n};\n\n/**\n * Return the app's absolute pathname\n * based on the parent(s) that have\n * mounted it.\n *\n * For example if the application was\n * mounted as \"/admin\", which itself\n * was mounted as \"/blog\" then the\n * return value would be \"/blog/admin\".\n *\n * @return {String}\n * @private\n */\n\napp.path = function path() {\n return this.parent\n ? this.parent.path() + this.mountpath\n : '';\n};\n\n/**\n * Check if `setting` is enabled (truthy).\n *\n * app.enabled('foo')\n * // => false\n *\n * app.enable('foo')\n * app.enabled('foo')\n * // => true\n *\n * @param {String} setting\n * @return {Boolean}\n * @public\n */\n\napp.enabled = function enabled(setting) {\n return Boolean(this.set(setting));\n};\n\n/**\n * Check if `setting` is disabled.\n *\n * app.disabled('foo')\n * // => true\n *\n * app.enable('foo')\n * app.disabled('foo')\n * // => false\n *\n * @param {String} setting\n * @return {Boolean}\n * @public\n */\n\napp.disabled = function disabled(setting) {\n return !this.set(setting);\n};\n\n/**\n * Enable `setting`.\n *\n * @param {String} setting\n * @return {app} for chaining\n * @public\n */\n\napp.enable = function enable(setting) {\n return this.set(setting, true);\n};\n\n/**\n * Disable `setting`.\n *\n * @param {String} setting\n * @return {app} for chaining\n * @public\n */\n\napp.disable = function disable(setting) {\n return this.set(setting, false);\n};\n\n/**\n * Delegate `.VERB(...)` calls to `router.VERB(...)`.\n */\n\nmethods.forEach(function(method){\n app[method] = function(path){\n if (method === 'get' && arguments.length === 1) {\n // app.get(setting)\n return this.set(path);\n }\n\n this.lazyrouter();\n\n var route = this._router.route(path);\n route[method].apply(route, slice.call(arguments, 1));\n return this;\n };\n});\n\n/**\n * Special-cased \"all\" method, applying the given route `path`,\n * middleware, and callback to _every_ HTTP method.\n *\n * @param {String} path\n * @param {Function} ...\n * @return {app} for chaining\n * @public\n */\n\napp.all = function all(path) {\n this.lazyrouter();\n\n var route = this._router.route(path);\n var args = slice.call(arguments, 1);\n\n for (var i = 0; i < methods.length; i++) {\n route[methods[i]].apply(route, args);\n }\n\n return this;\n};\n\n// del -> delete alias\n\napp.del = deprecate.function(app.delete, 'app.del: Use app.delete instead');\n\n/**\n * Render the given view `name` name with `options`\n * and a callback accepting an error and the\n * rendered template string.\n *\n * Example:\n *\n * app.render('email', { name: 'Tobi' }, function(err, html){\n * // ...\n * })\n *\n * @param {String} name\n * @param {Object|Function} options or fn\n * @param {Function} callback\n * @public\n */\n\napp.render = function render(name, options, callback) {\n var cache = this.cache;\n var done = callback;\n var engines = this.engines;\n var opts = options;\n var renderOptions = {};\n var view;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge app.locals\n merge(renderOptions, this.locals);\n\n // merge options._locals\n if (opts._locals) {\n merge(renderOptions, opts._locals);\n }\n\n // merge options\n merge(renderOptions, opts);\n\n // set .cache unless explicitly provided\n if (renderOptions.cache == null) {\n renderOptions.cache = this.enabled('view cache');\n }\n\n // primed cache\n if (renderOptions.cache) {\n view = cache[name];\n }\n\n // view\n if (!view) {\n var View = this.get('view');\n\n view = new View(name, {\n defaultEngine: this.get('view engine'),\n root: this.get('views'),\n engines: engines\n });\n\n if (!view.path) {\n var dirs = Array.isArray(view.root) && view.root.length > 1\n ? 'directories \"' + view.root.slice(0, -1).join('\", \"') + '\" or \"' + view.root[view.root.length - 1] + '\"'\n : 'directory \"' + view.root + '\"'\n var err = new Error('Failed to lookup view \"' + name + '\" in views ' + dirs);\n err.view = view;\n return done(err);\n }\n\n // prime the cache\n if (renderOptions.cache) {\n cache[name] = view;\n }\n }\n\n // render\n tryRender(view, renderOptions, done);\n};\n\n/**\n * Listen for connections.\n *\n * A node `http.Server` is returned, with this\n * application (which is a `Function`) as its\n * callback. If you wish to create both an HTTP\n * and HTTPS server you may do so with the \"http\"\n * and \"https\" modules as shown here:\n *\n * var http = require('http')\n * , https = require('https')\n * , express = require('express')\n * , app = express();\n *\n * http.createServer(app).listen(80);\n * https.createServer({ ... }, app).listen(443);\n *\n * @return {http.Server}\n * @public\n */\n\napp.listen = function listen() {\n var server = http.createServer(this);\n return server.listen.apply(server, arguments);\n};\n\n/**\n * Log error using console.error.\n *\n * @param {Error} err\n * @private\n */\n\nfunction logerror(err) {\n /* istanbul ignore next */\n if (this.get('env') !== 'test') console.error(err.stack || err.toString());\n}\n\n/**\n * Try rendering a view.\n * @private\n */\n\nfunction tryRender(view, options, callback) {\n try {\n view.render(options, callback);\n } catch (err) {\n callback(err);\n }\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar bodyParser = require('body-parser')\nvar EventEmitter = require('events').EventEmitter;\nvar mixin = require('merge-descriptors');\nvar proto = require('./application');\nvar Route = require('./router/route');\nvar Router = require('./router');\nvar req = require('./request');\nvar res = require('./response');\n\n/**\n * Expose `createApplication()`.\n */\n\nexports = module.exports = createApplication;\n\n/**\n * Create an express application.\n *\n * @return {Function}\n * @api public\n */\n\nfunction createApplication() {\n var app = function(req, res, next) {\n app.handle(req, res, next);\n };\n\n mixin(app, EventEmitter.prototype, false);\n mixin(app, proto, false);\n\n // expose the prototype that will get set on requests\n app.request = Object.create(req, {\n app: { configurable: true, enumerable: true, writable: true, value: app }\n })\n\n // expose the prototype that will get set on responses\n app.response = Object.create(res, {\n app: { configurable: true, enumerable: true, writable: true, value: app }\n })\n\n app.init();\n return app;\n}\n\n/**\n * Expose the prototypes.\n */\n\nexports.application = proto;\nexports.request = req;\nexports.response = res;\n\n/**\n * Expose constructors.\n */\n\nexports.Route = Route;\nexports.Router = Router;\n\n/**\n * Expose middleware\n */\n\nexports.json = bodyParser.json\nexports.query = require('./middleware/query');\nexports.raw = bodyParser.raw\nexports.static = require('serve-static');\nexports.text = bodyParser.text\nexports.urlencoded = bodyParser.urlencoded\n\n/**\n * Replace removed middleware with an appropriate error message.\n */\n\nvar removedMiddlewares = [\n 'bodyParser',\n 'compress',\n 'cookieSession',\n 'session',\n 'logger',\n 'cookieParser',\n 'favicon',\n 'responseTime',\n 'errorHandler',\n 'timeout',\n 'methodOverride',\n 'vhost',\n 'csrf',\n 'directory',\n 'limit',\n 'multipart',\n 'staticCache'\n]\n\nremovedMiddlewares.forEach(function (name) {\n Object.defineProperty(exports, name, {\n get: function () {\n throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');\n },\n configurable: true\n });\n});\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Initialization middleware, exposing the\n * request and response to each other, as well\n * as defaulting the X-Powered-By header field.\n *\n * @param {Function} app\n * @return {Function}\n * @api private\n */\n\nexports.init = function(app){\n return function expressInit(req, res, next){\n if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');\n req.res = res;\n res.req = req;\n req.next = next;\n\n setPrototypeOf(req, app.request)\n setPrototypeOf(res, app.response)\n\n res.locals = res.locals || Object.create(null);\n\n next();\n };\n};\n\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar merge = require('utils-merge')\nvar parseUrl = require('parseurl');\nvar qs = require('qs');\n\n/**\n * @param {Object} options\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function query(options) {\n var opts = merge({}, options)\n var queryparse = qs.parse;\n\n if (typeof options === 'function') {\n queryparse = options;\n opts = undefined;\n }\n\n if (opts !== undefined && opts.allowPrototypes === undefined) {\n // back-compat for qs module\n opts.allowPrototypes = true;\n }\n\n return function query(req, res, next){\n if (!req.query) {\n var val = parseUrl(req).query;\n req.query = queryparse(val, opts);\n }\n\n next();\n };\n};\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar accepts = require('accepts');\nvar deprecate = require('depd')('express');\nvar isIP = require('net').isIP;\nvar typeis = require('type-is');\nvar http = require('http');\nvar fresh = require('fresh');\nvar parseRange = require('range-parser');\nvar parse = require('parseurl');\nvar proxyaddr = require('proxy-addr');\n\n/**\n * Request prototype.\n * @public\n */\n\nvar req = Object.create(http.IncomingMessage.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = req\n\n/**\n * Return request header.\n *\n * The `Referrer` header field is special-cased,\n * both `Referrer` and `Referer` are interchangeable.\n *\n * Examples:\n *\n * req.get('Content-Type');\n * // => \"text/plain\"\n *\n * req.get('content-type');\n * // => \"text/plain\"\n *\n * req.get('Something');\n * // => undefined\n *\n * Aliased as `req.header()`.\n *\n * @param {String} name\n * @return {String}\n * @public\n */\n\nreq.get =\nreq.header = function header(name) {\n if (!name) {\n throw new TypeError('name argument is required to req.get');\n }\n\n if (typeof name !== 'string') {\n throw new TypeError('name must be a string to req.get');\n }\n\n var lc = name.toLowerCase();\n\n switch (lc) {\n case 'referer':\n case 'referrer':\n return this.headers.referrer\n || this.headers.referer;\n default:\n return this.headers[lc];\n }\n};\n\n/**\n * To do: update docs.\n *\n * Check if the given `type(s)` is acceptable, returning\n * the best match when true, otherwise `undefined`, in which\n * case you should respond with 406 \"Not Acceptable\".\n *\n * The `type` value may be a single MIME type string\n * such as \"application/json\", an extension name\n * such as \"json\", a comma-delimited list such as \"json, html, text/plain\",\n * an argument list such as `\"json\", \"html\", \"text/plain\"`,\n * or an array `[\"json\", \"html\", \"text/plain\"]`. When a list\n * or array is given, the _best_ match, if any is returned.\n *\n * Examples:\n *\n * // Accept: text/html\n * req.accepts('html');\n * // => \"html\"\n *\n * // Accept: text/*, application/json\n * req.accepts('html');\n * // => \"html\"\n * req.accepts('text/html');\n * // => \"text/html\"\n * req.accepts('json, text');\n * // => \"json\"\n * req.accepts('application/json');\n * // => \"application/json\"\n *\n * // Accept: text/*, application/json\n * req.accepts('image/png');\n * req.accepts('png');\n * // => undefined\n *\n * // Accept: text/*;q=.5, application/json\n * req.accepts(['html', 'json']);\n * req.accepts('html', 'json');\n * req.accepts('html, json');\n * // => \"json\"\n *\n * @param {String|Array} type(s)\n * @return {String|Array|Boolean}\n * @public\n */\n\nreq.accepts = function(){\n var accept = accepts(this);\n return accept.types.apply(accept, arguments);\n};\n\n/**\n * Check if the given `encoding`s are accepted.\n *\n * @param {String} ...encoding\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsEncodings = function(){\n var accept = accepts(this);\n return accept.encodings.apply(accept, arguments);\n};\n\nreq.acceptsEncoding = deprecate.function(req.acceptsEncodings,\n 'req.acceptsEncoding: Use acceptsEncodings instead');\n\n/**\n * Check if the given `charset`s are acceptable,\n * otherwise you should respond with 406 \"Not Acceptable\".\n *\n * @param {String} ...charset\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsCharsets = function(){\n var accept = accepts(this);\n return accept.charsets.apply(accept, arguments);\n};\n\nreq.acceptsCharset = deprecate.function(req.acceptsCharsets,\n 'req.acceptsCharset: Use acceptsCharsets instead');\n\n/**\n * Check if the given `lang`s are acceptable,\n * otherwise you should respond with 406 \"Not Acceptable\".\n *\n * @param {String} ...lang\n * @return {String|Array}\n * @public\n */\n\nreq.acceptsLanguages = function(){\n var accept = accepts(this);\n return accept.languages.apply(accept, arguments);\n};\n\nreq.acceptsLanguage = deprecate.function(req.acceptsLanguages,\n 'req.acceptsLanguage: Use acceptsLanguages instead');\n\n/**\n * Parse Range header field, capping to the given `size`.\n *\n * Unspecified ranges such as \"0-\" require knowledge of your resource length. In\n * the case of a byte range this is of course the total number of bytes. If the\n * Range header field is not given `undefined` is returned, `-1` when unsatisfiable,\n * and `-2` when syntactically invalid.\n *\n * When ranges are returned, the array has a \"type\" property which is the type of\n * range that is required (most commonly, \"bytes\"). Each array element is an object\n * with a \"start\" and \"end\" property for the portion of the range.\n *\n * The \"combine\" option can be set to `true` and overlapping & adjacent ranges\n * will be combined into a single range.\n *\n * NOTE: remember that ranges are inclusive, so for example \"Range: users=0-3\"\n * should respond with 4 users when available, not 3.\n *\n * @param {number} size\n * @param {object} [options]\n * @param {boolean} [options.combine=false]\n * @return {number|array}\n * @public\n */\n\nreq.range = function range(size, options) {\n var range = this.get('Range');\n if (!range) return;\n return parseRange(size, range, options);\n};\n\n/**\n * Return the value of param `name` when present or `defaultValue`.\n *\n * - Checks route placeholders, ex: _/user/:id_\n * - Checks body params, ex: id=12, {\"id\":12}\n * - Checks query string params, ex: ?id=12\n *\n * To utilize request bodies, `req.body`\n * should be an object. This can be done by using\n * the `bodyParser()` middleware.\n *\n * @param {String} name\n * @param {Mixed} [defaultValue]\n * @return {String}\n * @public\n */\n\nreq.param = function param(name, defaultValue) {\n var params = this.params || {};\n var body = this.body || {};\n var query = this.query || {};\n\n var args = arguments.length === 1\n ? 'name'\n : 'name, default';\n deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead');\n\n if (null != params[name] && params.hasOwnProperty(name)) return params[name];\n if (null != body[name]) return body[name];\n if (null != query[name]) return query[name];\n\n return defaultValue;\n};\n\n/**\n * Check if the incoming request contains the \"Content-Type\"\n * header field, and it contains the given mime `type`.\n *\n * Examples:\n *\n * // With Content-Type: text/html; charset=utf-8\n * req.is('html');\n * req.is('text/html');\n * req.is('text/*');\n * // => true\n *\n * // When Content-Type is application/json\n * req.is('json');\n * req.is('application/json');\n * req.is('application/*');\n * // => true\n *\n * req.is('html');\n * // => false\n *\n * @param {String|Array} types...\n * @return {String|false|null}\n * @public\n */\n\nreq.is = function is(types) {\n var arr = types;\n\n // support flattened arguments\n if (!Array.isArray(types)) {\n arr = new Array(arguments.length);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arguments[i];\n }\n }\n\n return typeis(this, arr);\n};\n\n/**\n * Return the protocol string \"http\" or \"https\"\n * when requested with TLS. When the \"trust proxy\"\n * setting trusts the socket address, the\n * \"X-Forwarded-Proto\" header field will be trusted\n * and used if present.\n *\n * If you're running behind a reverse proxy that\n * supplies https for you this may be enabled.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'protocol', function protocol(){\n var proto = this.connection.encrypted\n ? 'https'\n : 'http';\n var trust = this.app.get('trust proxy fn');\n\n if (!trust(this.connection.remoteAddress, 0)) {\n return proto;\n }\n\n // Note: X-Forwarded-Proto is normally only ever a\n // single value, but this is to be safe.\n var header = this.get('X-Forwarded-Proto') || proto\n var index = header.indexOf(',')\n\n return index !== -1\n ? header.substring(0, index).trim()\n : header.trim()\n});\n\n/**\n * Short-hand for:\n *\n * req.protocol === 'https'\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'secure', function secure(){\n return this.protocol === 'https';\n});\n\n/**\n * Return the remote address from the trusted proxy.\n *\n * The is the remote address on the socket unless\n * \"trust proxy\" is set.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'ip', function ip(){\n var trust = this.app.get('trust proxy fn');\n return proxyaddr(this, trust);\n});\n\n/**\n * When \"trust proxy\" is set, trusted proxy addresses + client.\n *\n * For example if the value were \"client, proxy1, proxy2\"\n * you would receive the array `[\"client\", \"proxy1\", \"proxy2\"]`\n * where \"proxy2\" is the furthest down-stream and \"proxy1\" and\n * \"proxy2\" were trusted.\n *\n * @return {Array}\n * @public\n */\n\ndefineGetter(req, 'ips', function ips() {\n var trust = this.app.get('trust proxy fn');\n var addrs = proxyaddr.all(this, trust);\n\n // reverse the order (to farthest -> closest)\n // and remove socket address\n addrs.reverse().pop()\n\n return addrs\n});\n\n/**\n * Return subdomains as an array.\n *\n * Subdomains are the dot-separated parts of the host before the main domain of\n * the app. By default, the domain of the app is assumed to be the last two\n * parts of the host. This can be changed by setting \"subdomain offset\".\n *\n * For example, if the domain is \"tobi.ferrets.example.com\":\n * If \"subdomain offset\" is not set, req.subdomains is `[\"ferrets\", \"tobi\"]`.\n * If \"subdomain offset\" is 3, req.subdomains is `[\"tobi\"]`.\n *\n * @return {Array}\n * @public\n */\n\ndefineGetter(req, 'subdomains', function subdomains() {\n var hostname = this.hostname;\n\n if (!hostname) return [];\n\n var offset = this.app.get('subdomain offset');\n var subdomains = !isIP(hostname)\n ? hostname.split('.').reverse()\n : [hostname];\n\n return subdomains.slice(offset);\n});\n\n/**\n * Short-hand for `url.parse(req.url).pathname`.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'path', function path() {\n return parse(this).pathname;\n});\n\n/**\n * Parse the \"Host\" header field to a hostname.\n *\n * When the \"trust proxy\" setting trusts the socket\n * address, the \"X-Forwarded-Host\" header field will\n * be trusted.\n *\n * @return {String}\n * @public\n */\n\ndefineGetter(req, 'hostname', function hostname(){\n var trust = this.app.get('trust proxy fn');\n var host = this.get('X-Forwarded-Host');\n\n if (!host || !trust(this.connection.remoteAddress, 0)) {\n host = this.get('Host');\n } else if (host.indexOf(',') !== -1) {\n // Note: X-Forwarded-Host is normally only ever a\n // single value, but this is to be safe.\n host = host.substring(0, host.indexOf(',')).trimRight()\n }\n\n if (!host) return;\n\n // IPv6 literal support\n var offset = host[0] === '['\n ? host.indexOf(']') + 1\n : 0;\n var index = host.indexOf(':', offset);\n\n return index !== -1\n ? host.substring(0, index)\n : host;\n});\n\n// TODO: change req.host to return host in next major\n\ndefineGetter(req, 'host', deprecate.function(function host(){\n return this.hostname;\n}, 'req.host: Use req.hostname instead'));\n\n/**\n * Check if the request is fresh, aka\n * Last-Modified and/or the ETag\n * still match.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'fresh', function(){\n var method = this.method;\n var res = this.res\n var status = res.statusCode\n\n // GET or HEAD for weak freshness validation only\n if ('GET' !== method && 'HEAD' !== method) return false;\n\n // 2xx or 304 as per rfc2616 14.26\n if ((status >= 200 && status < 300) || 304 === status) {\n return fresh(this.headers, {\n 'etag': res.get('ETag'),\n 'last-modified': res.get('Last-Modified')\n })\n }\n\n return false;\n});\n\n/**\n * Check if the request is stale, aka\n * \"Last-Modified\" and / or the \"ETag\" for the\n * resource has changed.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'stale', function stale(){\n return !this.fresh;\n});\n\n/**\n * Check if the request was an _XMLHttpRequest_.\n *\n * @return {Boolean}\n * @public\n */\n\ndefineGetter(req, 'xhr', function xhr(){\n var val = this.get('X-Requested-With') || '';\n return val.toLowerCase() === 'xmlhttprequest';\n});\n\n/**\n * Helper function for creating a getter on an object.\n *\n * @param {Object} obj\n * @param {String} name\n * @param {Function} getter\n * @private\n */\nfunction defineGetter(obj, name, getter) {\n Object.defineProperty(obj, name, {\n configurable: true,\n enumerable: true,\n get: getter\n });\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar contentDisposition = require('content-disposition');\nvar createError = require('http-errors')\nvar deprecate = require('depd')('express');\nvar encodeUrl = require('encodeurl');\nvar escapeHtml = require('escape-html');\nvar http = require('http');\nvar isAbsolute = require('./utils').isAbsolute;\nvar onFinished = require('on-finished');\nvar path = require('path');\nvar statuses = require('statuses')\nvar merge = require('utils-merge');\nvar sign = require('cookie-signature').sign;\nvar normalizeType = require('./utils').normalizeType;\nvar normalizeTypes = require('./utils').normalizeTypes;\nvar setCharset = require('./utils').setCharset;\nvar cookie = require('cookie');\nvar send = require('send');\nvar extname = path.extname;\nvar mime = send.mime;\nvar resolve = path.resolve;\nvar vary = require('vary');\n\n/**\n * Response prototype.\n * @public\n */\n\nvar res = Object.create(http.ServerResponse.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = res\n\n/**\n * Module variables.\n * @private\n */\n\nvar charsetRegExp = /;\\s*charset\\s*=/;\n\n/**\n * Set status `code`.\n *\n * @param {Number} code\n * @return {ServerResponse}\n * @public\n */\n\nres.status = function status(code) {\n if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) {\n deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead')\n }\n this.statusCode = code;\n return this;\n};\n\n/**\n * Set Link header field with the given `links`.\n *\n * Examples:\n *\n * res.links({\n * next: 'http://api.example.com/users?page=2',\n * last: 'http://api.example.com/users?page=5'\n * });\n *\n * @param {Object} links\n * @return {ServerResponse}\n * @public\n */\n\nres.links = function(links){\n var link = this.get('Link') || '';\n if (link) link += ', ';\n return this.set('Link', link + Object.keys(links).map(function(rel){\n return '<' + links[rel] + '>; rel=\"' + rel + '\"';\n }).join(', '));\n};\n\n/**\n * Send a response.\n *\n * Examples:\n *\n * res.send(Buffer.from('wahoo'));\n * res.send({ some: 'json' });\n * res.send('

some html

');\n *\n * @param {string|number|boolean|object|Buffer} body\n * @public\n */\n\nres.send = function send(body) {\n var chunk = body;\n var encoding;\n var req = this.req;\n var type;\n\n // settings\n var app = this.app;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.send(body, status) backwards compat\n if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') {\n deprecate('res.send(body, status): Use res.status(status).send(body) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.send(status, body): Use res.status(status).send(body) instead');\n this.statusCode = arguments[0];\n chunk = arguments[1];\n }\n }\n\n // disambiguate res.send(status) and res.send(status, num)\n if (typeof chunk === 'number' && arguments.length === 1) {\n // res.send(status) will set status message as text string\n if (!this.get('Content-Type')) {\n this.type('txt');\n }\n\n deprecate('res.send(status): Use res.sendStatus(status) instead');\n this.statusCode = chunk;\n chunk = statuses.message[chunk]\n }\n\n switch (typeof chunk) {\n // string defaulting to html\n case 'string':\n if (!this.get('Content-Type')) {\n this.type('html');\n }\n break;\n case 'boolean':\n case 'number':\n case 'object':\n if (chunk === null) {\n chunk = '';\n } else if (Buffer.isBuffer(chunk)) {\n if (!this.get('Content-Type')) {\n this.type('bin');\n }\n } else {\n return this.json(chunk);\n }\n break;\n }\n\n // write strings in utf-8\n if (typeof chunk === 'string') {\n encoding = 'utf8';\n type = this.get('Content-Type');\n\n // reflect this in content-type\n if (typeof type === 'string') {\n this.set('Content-Type', setCharset(type, 'utf-8'));\n }\n }\n\n // determine if ETag should be generated\n var etagFn = app.get('etag fn')\n var generateETag = !this.get('ETag') && typeof etagFn === 'function'\n\n // populate Content-Length\n var len\n if (chunk !== undefined) {\n if (Buffer.isBuffer(chunk)) {\n // get length of Buffer\n len = chunk.length\n } else if (!generateETag && chunk.length < 1000) {\n // just calculate length when no ETag + small chunk\n len = Buffer.byteLength(chunk, encoding)\n } else {\n // convert chunk to Buffer and calculate\n chunk = Buffer.from(chunk, encoding)\n encoding = undefined;\n len = chunk.length\n }\n\n this.set('Content-Length', len);\n }\n\n // populate ETag\n var etag;\n if (generateETag && len !== undefined) {\n if ((etag = etagFn(chunk, encoding))) {\n this.set('ETag', etag);\n }\n }\n\n // freshness\n if (req.fresh) this.statusCode = 304;\n\n // strip irrelevant headers\n if (204 === this.statusCode || 304 === this.statusCode) {\n this.removeHeader('Content-Type');\n this.removeHeader('Content-Length');\n this.removeHeader('Transfer-Encoding');\n chunk = '';\n }\n\n // alter headers for 205\n if (this.statusCode === 205) {\n this.set('Content-Length', '0')\n this.removeHeader('Transfer-Encoding')\n chunk = ''\n }\n\n if (req.method === 'HEAD') {\n // skip body for HEAD\n this.end();\n } else {\n // respond\n this.end(chunk, encoding);\n }\n\n return this;\n};\n\n/**\n * Send JSON response.\n *\n * Examples:\n *\n * res.json(null);\n * res.json({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.json = function json(obj) {\n var val = obj;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.json(body, status) backwards compat\n if (typeof arguments[1] === 'number') {\n deprecate('res.json(obj, status): Use res.status(status).json(obj) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.json(status, obj): Use res.status(status).json(obj) instead');\n this.statusCode = arguments[0];\n val = arguments[1];\n }\n }\n\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(val, replacer, spaces, escape)\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('Content-Type', 'application/json');\n }\n\n return this.send(body);\n};\n\n/**\n * Send JSON response with JSONP callback support.\n *\n * Examples:\n *\n * res.jsonp(null);\n * res.jsonp({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.jsonp = function jsonp(obj) {\n var val = obj;\n\n // allow status / body\n if (arguments.length === 2) {\n // res.jsonp(body, status) backwards compat\n if (typeof arguments[1] === 'number') {\n deprecate('res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead');\n this.statusCode = arguments[1];\n } else {\n deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead');\n this.statusCode = arguments[0];\n val = arguments[1];\n }\n }\n\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(val, replacer, spaces, escape)\n var callback = this.req.query[app.get('jsonp callback name')];\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'application/json');\n }\n\n // fixup callback\n if (Array.isArray(callback)) {\n callback = callback[0];\n }\n\n // jsonp\n if (typeof callback === 'string' && callback.length !== 0) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'text/javascript');\n\n // restrict callback charset\n callback = callback.replace(/[^\\[\\]\\w$.]/g, '');\n\n if (body === undefined) {\n // empty argument\n body = ''\n } else if (typeof body === 'string') {\n // replace chars not allowed in JavaScript that are in JSON\n body = body\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n }\n\n // the /**/ is a specific security mitigation for \"Rosetta Flash JSONP abuse\"\n // the typeof check is just to reduce client error noise\n body = '/**/ typeof ' + callback + ' === \\'function\\' && ' + callback + '(' + body + ');';\n }\n\n return this.send(body);\n};\n\n/**\n * Send given HTTP status code.\n *\n * Sets the response status to `statusCode` and the body of the\n * response to the standard description from node's http.STATUS_CODES\n * or the statusCode number if no description.\n *\n * Examples:\n *\n * res.sendStatus(200);\n *\n * @param {number} statusCode\n * @public\n */\n\nres.sendStatus = function sendStatus(statusCode) {\n var body = statuses.message[statusCode] || String(statusCode)\n\n this.statusCode = statusCode;\n this.type('txt');\n\n return this.send(body);\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendFile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendFile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendFile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendFile = function sendFile(path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n if (!path) {\n throw new TypeError('path argument is required to res.sendFile');\n }\n\n if (typeof path !== 'string') {\n throw new TypeError('path must be a string to res.sendFile')\n }\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n if (!opts.root && !isAbsolute(path)) {\n throw new TypeError('path must be absolute or specify root to res.sendFile');\n }\n\n // create file stream\n var pathname = encodeURI(path);\n var file = send(req, pathname, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendfile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendfile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendfile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendfile = function (path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // create file stream\n var file = send(req, path, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\nres.sendfile = deprecate.function(res.sendfile,\n 'res.sendfile: Use res.sendFile instead');\n\n/**\n * Transfer the file at the given `path` as an attachment.\n *\n * Optionally providing an alternate attachment `filename`,\n * and optional callback `callback(err)`. The callback is invoked\n * when the data transfer is complete, or when an error has\n * occurred. Be sure to check `res.headersSent` if you plan to respond.\n *\n * Optionally providing an `options` object to use with `res.sendFile()`.\n * This function will set the `Content-Disposition` header, overriding\n * any `Content-Disposition` header passed as header options in order\n * to set the attachment and filename.\n *\n * This method uses `res.sendFile()`.\n *\n * @public\n */\n\nres.download = function download (path, filename, options, callback) {\n var done = callback;\n var name = filename;\n var opts = options || null\n\n // support function as second or third arg\n if (typeof filename === 'function') {\n done = filename;\n name = null;\n opts = null\n } else if (typeof options === 'function') {\n done = options\n opts = null\n }\n\n // support optional filename, where options may be in it's place\n if (typeof filename === 'object' &&\n (typeof options === 'function' || options === undefined)) {\n name = null\n opts = filename\n }\n\n // set Content-Disposition when file is sent\n var headers = {\n 'Content-Disposition': contentDisposition(name || path)\n };\n\n // merge user-provided headers\n if (opts && opts.headers) {\n var keys = Object.keys(opts.headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key.toLowerCase() !== 'content-disposition') {\n headers[key] = opts.headers[key]\n }\n }\n }\n\n // merge user-provided options\n opts = Object.create(opts)\n opts.headers = headers\n\n // Resolve the full path for sendFile\n var fullPath = !opts.root\n ? resolve(path)\n : path\n\n // send file\n return this.sendFile(fullPath, opts, done)\n};\n\n/**\n * Set _Content-Type_ response header with `type` through `mime.lookup()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n *\n * @param {String} type\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.contentType =\nres.type = function contentType(type) {\n var ct = type.indexOf('/') === -1\n ? mime.lookup(type)\n : type;\n\n return this.set('Content-Type', ct);\n};\n\n/**\n * Respond to the Acceptable formats using an `obj`\n * of mime-type callbacks.\n *\n * This method uses `req.accepted`, an array of\n * acceptable types ordered by their quality values.\n * When \"Accept\" is not present the _first_ callback\n * is invoked, otherwise the first match is used. When\n * no match is performed the server responds with\n * 406 \"Not Acceptable\".\n *\n * Content-Type is set for you, however if you choose\n * you may alter this within the callback using `res.type()`\n * or `res.set('Content-Type', ...)`.\n *\n * res.format({\n * 'text/plain': function(){\n * res.send('hey');\n * },\n *\n * 'text/html': function(){\n * res.send('

hey

');\n * },\n *\n * 'application/json': function () {\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * In addition to canonicalized MIME types you may\n * also use extnames mapped to these types:\n *\n * res.format({\n * text: function(){\n * res.send('hey');\n * },\n *\n * html: function(){\n * res.send('

hey

');\n * },\n *\n * json: function(){\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * By default Express passes an `Error`\n * with a `.status` of 406 to `next(err)`\n * if a match is not made. If you provide\n * a `.default` callback it will be invoked\n * instead.\n *\n * @param {Object} obj\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.format = function(obj){\n var req = this.req;\n var next = req.next;\n\n var keys = Object.keys(obj)\n .filter(function (v) { return v !== 'default' })\n\n var key = keys.length > 0\n ? req.accepts(keys)\n : false;\n\n this.vary(\"Accept\");\n\n if (key) {\n this.set('Content-Type', normalizeType(key).value);\n obj[key](req, this, next);\n } else if (obj.default) {\n obj.default(req, this, next)\n } else {\n next(createError(406, {\n types: normalizeTypes(keys).map(function (o) { return o.value })\n }))\n }\n\n return this;\n};\n\n/**\n * Set _Content-Disposition_ header to _attachment_ with optional `filename`.\n *\n * @param {String} filename\n * @return {ServerResponse}\n * @public\n */\n\nres.attachment = function attachment(filename) {\n if (filename) {\n this.type(extname(filename));\n }\n\n this.set('Content-Disposition', contentDisposition(filename));\n\n return this;\n};\n\n/**\n * Append additional header `field` with value `val`.\n *\n * Example:\n *\n * res.append('Link', ['', '']);\n * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');\n * res.append('Warning', '199 Miscellaneous warning');\n *\n * @param {String} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.append = function append(field, val) {\n var prev = this.get(field);\n var value = val;\n\n if (prev) {\n // concat the new and prev vals\n value = Array.isArray(prev) ? prev.concat(val)\n : Array.isArray(val) ? [prev].concat(val)\n : [prev, val]\n }\n\n return this.set(field, value);\n};\n\n/**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n *\n * res.set('Foo', ['bar', 'baz']);\n * res.set('Accept', 'application/json');\n * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n *\n * Aliased as `res.header()`.\n *\n * @param {String|Object} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.set =\nres.header = function header(field, val) {\n if (arguments.length === 2) {\n var value = Array.isArray(val)\n ? val.map(String)\n : String(val);\n\n // add charset to content-type\n if (field.toLowerCase() === 'content-type') {\n if (Array.isArray(value)) {\n throw new TypeError('Content-Type cannot be set to an Array');\n }\n if (!charsetRegExp.test(value)) {\n var charset = mime.charsets.lookup(value.split(';')[0]);\n if (charset) value += '; charset=' + charset.toLowerCase();\n }\n }\n\n this.setHeader(field, value);\n } else {\n for (var key in field) {\n this.set(key, field[key]);\n }\n }\n return this;\n};\n\n/**\n * Get value for header `field`.\n *\n * @param {String} field\n * @return {String}\n * @public\n */\n\nres.get = function(field){\n return this.getHeader(field);\n};\n\n/**\n * Clear cookie `name`.\n *\n * @param {String} name\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.clearCookie = function clearCookie(name, options) {\n var opts = merge({ expires: new Date(1), path: '/' }, options);\n\n return this.cookie(name, '', opts);\n};\n\n/**\n * Set cookie `name` to `value`, with the given `options`.\n *\n * Options:\n *\n * - `maxAge` max-age in milliseconds, converted to `expires`\n * - `signed` sign the cookie\n * - `path` defaults to \"/\"\n *\n * Examples:\n *\n * // \"Remember Me\" for 15 minutes\n * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });\n *\n * // same as above\n * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })\n *\n * @param {String} name\n * @param {String|Object} value\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.cookie = function (name, value, options) {\n var opts = merge({}, options);\n var secret = this.req.secret;\n var signed = opts.signed;\n\n if (signed && !secret) {\n throw new Error('cookieParser(\"secret\") required for signed cookies');\n }\n\n var val = typeof value === 'object'\n ? 'j:' + JSON.stringify(value)\n : String(value);\n\n if (signed) {\n val = 's:' + sign(val, secret);\n }\n\n if (opts.maxAge != null) {\n var maxAge = opts.maxAge - 0\n\n if (!isNaN(maxAge)) {\n opts.expires = new Date(Date.now() + maxAge)\n opts.maxAge = Math.floor(maxAge / 1000)\n }\n }\n\n if (opts.path == null) {\n opts.path = '/';\n }\n\n this.append('Set-Cookie', cookie.serialize(name, String(val), opts));\n\n return this;\n};\n\n/**\n * Set the location header to `url`.\n *\n * The given `url` can also be \"back\", which redirects\n * to the _Referrer_ or _Referer_ headers or \"/\".\n *\n * Examples:\n *\n * res.location('/foo/bar').;\n * res.location('http://example.com');\n * res.location('../login');\n *\n * @param {String} url\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.location = function location(url) {\n var loc = url;\n\n // \"back\" is an alias for the referrer\n if (url === 'back') {\n loc = this.req.get('Referrer') || '/';\n }\n\n // set location\n return this.set('Location', encodeUrl(loc));\n};\n\n/**\n * Redirect to the given `url` with optional response `status`\n * defaulting to 302.\n *\n * The resulting `url` is determined by `res.location()`, so\n * it will play nicely with mounted apps, relative paths,\n * `\"back\"` etc.\n *\n * Examples:\n *\n * res.redirect('/foo/bar');\n * res.redirect('http://example.com');\n * res.redirect(301, 'http://example.com');\n * res.redirect('../login'); // /blog/post/1 -> /blog/login\n *\n * @public\n */\n\nres.redirect = function redirect(url) {\n var address = url;\n var body;\n var status = 302;\n\n // allow status / url\n if (arguments.length === 2) {\n if (typeof arguments[0] === 'number') {\n status = arguments[0];\n address = arguments[1];\n } else {\n deprecate('res.redirect(url, status): Use res.redirect(status, url) instead');\n status = arguments[1];\n }\n }\n\n // Set location header\n address = this.location(address).get('Location');\n\n // Support text/{plain,html} by default\n this.format({\n text: function(){\n body = statuses.message[status] + '. Redirecting to ' + address\n },\n\n html: function(){\n var u = escapeHtml(address);\n body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

'\n },\n\n default: function(){\n body = '';\n }\n });\n\n // Respond\n this.statusCode = status;\n this.set('Content-Length', Buffer.byteLength(body));\n\n if (this.req.method === 'HEAD') {\n this.end();\n } else {\n this.end(body);\n }\n};\n\n/**\n * Add `field` to Vary. If already present in the Vary set, then\n * this call is simply ignored.\n *\n * @param {Array|String} field\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.vary = function(field){\n // checks for back-compat\n if (!field || (Array.isArray(field) && !field.length)) {\n deprecate('res.vary(): Provide a field name');\n return this;\n }\n\n vary(this, field);\n\n return this;\n};\n\n/**\n * Render `view` with the given `options` and optional callback `fn`.\n * When a callback function is given a response will _not_ be made\n * automatically, otherwise a response of _200_ and _text/html_ is given.\n *\n * Options:\n *\n * - `cache` boolean hinting to the engine it should cache\n * - `filename` filename of the view being rendered\n *\n * @public\n */\n\nres.render = function render(view, options, callback) {\n var app = this.req.app;\n var done = callback;\n var opts = options || {};\n var req = this.req;\n var self = this;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge res.locals\n opts._locals = self.locals;\n\n // default callback to respond\n done = done || function (err, str) {\n if (err) return req.next(err);\n self.send(str);\n };\n\n // render\n app.render(view, opts, done);\n};\n\n// pipe the send file stream\nfunction sendfile(res, file, options, callback) {\n var done = false;\n var streaming;\n\n // request aborted\n function onaborted() {\n if (done) return;\n done = true;\n\n var err = new Error('Request aborted');\n err.code = 'ECONNABORTED';\n callback(err);\n }\n\n // directory\n function ondirectory() {\n if (done) return;\n done = true;\n\n var err = new Error('EISDIR, read');\n err.code = 'EISDIR';\n callback(err);\n }\n\n // errors\n function onerror(err) {\n if (done) return;\n done = true;\n callback(err);\n }\n\n // ended\n function onend() {\n if (done) return;\n done = true;\n callback();\n }\n\n // file\n function onfile() {\n streaming = false;\n }\n\n // finished\n function onfinish(err) {\n if (err && err.code === 'ECONNRESET') return onaborted();\n if (err) return onerror(err);\n if (done) return;\n\n setImmediate(function () {\n if (streaming !== false && !done) {\n onaborted();\n return;\n }\n\n if (done) return;\n done = true;\n callback();\n });\n }\n\n // streaming\n function onstream() {\n streaming = true;\n }\n\n file.on('directory', ondirectory);\n file.on('end', onend);\n file.on('error', onerror);\n file.on('file', onfile);\n file.on('stream', onstream);\n onFinished(res, onfinish);\n\n if (options.headers) {\n // set headers on successful transfer\n file.on('headers', function headers(res) {\n var obj = options.headers;\n var keys = Object.keys(obj);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n res.setHeader(k, obj[k]);\n }\n });\n }\n\n // pipe\n file.pipe(res);\n}\n\n/**\n * Stringify JSON, like JSON.stringify, but v8 optimized, with the\n * ability to escape characters that can trigger HTML sniffing.\n *\n * @param {*} value\n * @param {function} replacer\n * @param {number} spaces\n * @param {boolean} escape\n * @returns {string}\n * @private\n */\n\nfunction stringify (value, replacer, spaces, escape) {\n // v8 checks arguments.length for optimizing simple call\n // https://bugs.chromium.org/p/v8/issues/detail?id=4730\n var json = replacer || spaces\n ? JSON.stringify(value, replacer, spaces)\n : JSON.stringify(value);\n\n if (escape && typeof json === 'string') {\n json = json.replace(/[<>&]/g, function (c) {\n switch (c.charCodeAt(0)) {\n case 0x3c:\n return '\\\\u003c'\n case 0x3e:\n return '\\\\u003e'\n case 0x26:\n return '\\\\u0026'\n /* istanbul ignore next: unreachable default */\n default:\n return c\n }\n })\n }\n\n return json\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar Route = require('./route');\nvar Layer = require('./layer');\nvar methods = require('methods');\nvar mixin = require('utils-merge');\nvar debug = require('debug')('express:router');\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar parseUrl = require('parseurl');\nvar setPrototypeOf = require('setprototypeof')\n\n/**\n * Module variables.\n * @private\n */\n\nvar objectRegExp = /^\\[object (\\S+)\\]$/;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n/**\n * Initialize a new `Router` with the given `options`.\n *\n * @param {Object} [options]\n * @return {Router} which is an callable function\n * @public\n */\n\nvar proto = module.exports = function(options) {\n var opts = options || {};\n\n function router(req, res, next) {\n router.handle(req, res, next);\n }\n\n // mixin Router class functions\n setPrototypeOf(router, proto)\n\n router.params = {};\n router._params = [];\n router.caseSensitive = opts.caseSensitive;\n router.mergeParams = opts.mergeParams;\n router.strict = opts.strict;\n router.stack = [];\n\n return router;\n};\n\n/**\n * Map the given param placeholder `name`(s) to the given callback.\n *\n * Parameter mapping is used to provide pre-conditions to routes\n * which use normalized placeholders. For example a _:user_id_ parameter\n * could automatically load a user's information from the database without\n * any additional code,\n *\n * The callback uses the same signature as middleware, the only difference\n * being that the value of the placeholder is passed, in this case the _id_\n * of the user. Once the `next()` function is invoked, just like middleware\n * it will continue on to execute the route, or subsequent parameter functions.\n *\n * Just like in middleware, you must either respond to the request or call next\n * to avoid stalling the request.\n *\n * app.param('user_id', function(req, res, next, id){\n * User.find(id, function(err, user){\n * if (err) {\n * return next(err);\n * } else if (!user) {\n * return next(new Error('failed to load user'));\n * }\n * req.user = user;\n * next();\n * });\n * });\n *\n * @param {String} name\n * @param {Function} fn\n * @return {app} for chaining\n * @public\n */\n\nproto.param = function param(name, fn) {\n // param logic\n if (typeof name === 'function') {\n deprecate('router.param(fn): Refactor to use path params');\n this._params.push(name);\n return;\n }\n\n // apply param functions\n var params = this._params;\n var len = params.length;\n var ret;\n\n if (name[0] === ':') {\n deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead')\n name = name.slice(1)\n }\n\n for (var i = 0; i < len; ++i) {\n if (ret = params[i](name, fn)) {\n fn = ret;\n }\n }\n\n // ensure we end up with a\n // middleware function\n if ('function' !== typeof fn) {\n throw new Error('invalid param() call for ' + name + ', got ' + fn);\n }\n\n (this.params[name] = this.params[name] || []).push(fn);\n return this;\n};\n\n/**\n * Dispatch a req, res into the router.\n * @private\n */\n\nproto.handle = function handle(req, res, out) {\n var self = this;\n\n debug('dispatching %s %s', req.method, req.url);\n\n var idx = 0;\n var protohost = getProtohost(req.url) || ''\n var removed = '';\n var slashAdded = false;\n var sync = 0\n var paramcalled = {};\n\n // store options for OPTIONS request\n // only used if OPTIONS request\n var options = [];\n\n // middleware and routes\n var stack = self.stack;\n\n // manage inter-router variables\n var parentParams = req.params;\n var parentUrl = req.baseUrl || '';\n var done = restore(out, req, 'baseUrl', 'next', 'params');\n\n // setup next layer\n req.next = next;\n\n // for options requests, respond with a default if nothing else responds\n if (req.method === 'OPTIONS') {\n done = wrap(done, function(old, err) {\n if (err || options.length === 0) return old(err);\n sendOptionsResponse(res, options, old);\n });\n }\n\n // setup basic req values\n req.baseUrl = parentUrl;\n req.originalUrl = req.originalUrl || req.url;\n\n next();\n\n function next(err) {\n var layerError = err === 'route'\n ? null\n : err;\n\n // remove added slash\n if (slashAdded) {\n req.url = req.url.slice(1)\n slashAdded = false;\n }\n\n // restore altered req.url\n if (removed.length !== 0) {\n req.baseUrl = parentUrl;\n req.url = protohost + removed + req.url.slice(protohost.length)\n removed = '';\n }\n\n // signal to exit router\n if (layerError === 'router') {\n setImmediate(done, null)\n return\n }\n\n // no more matching layers\n if (idx >= stack.length) {\n setImmediate(done, layerError);\n return;\n }\n\n // max sync stack\n if (++sync > 100) {\n return setImmediate(next, err)\n }\n\n // get pathname of request\n var path = getPathname(req);\n\n if (path == null) {\n return done(layerError);\n }\n\n // find next matching layer\n var layer;\n var match;\n var route;\n\n while (match !== true && idx < stack.length) {\n layer = stack[idx++];\n match = matchLayer(layer, path);\n route = layer.route;\n\n if (typeof match !== 'boolean') {\n // hold on to layerError\n layerError = layerError || match;\n }\n\n if (match !== true) {\n continue;\n }\n\n if (!route) {\n // process non-route handlers normally\n continue;\n }\n\n if (layerError) {\n // routes do not match with a pending error\n match = false;\n continue;\n }\n\n var method = req.method;\n var has_method = route._handles_method(method);\n\n // build up automatic options response\n if (!has_method && method === 'OPTIONS') {\n appendMethods(options, route._options());\n }\n\n // don't even bother matching route\n if (!has_method && method !== 'HEAD') {\n match = false;\n }\n }\n\n // no match\n if (match !== true) {\n return done(layerError);\n }\n\n // store route for dispatch on change\n if (route) {\n req.route = route;\n }\n\n // Capture one-time layer values\n req.params = self.mergeParams\n ? mergeParams(layer.params, parentParams)\n : layer.params;\n var layerPath = layer.path;\n\n // this should be done for the layer\n self.process_params(layer, paramcalled, req, res, function (err) {\n if (err) {\n next(layerError || err)\n } else if (route) {\n layer.handle_request(req, res, next)\n } else {\n trim_prefix(layer, layerError, layerPath, path)\n }\n\n sync = 0\n });\n }\n\n function trim_prefix(layer, layerError, layerPath, path) {\n if (layerPath.length !== 0) {\n // Validate path is a prefix match\n if (layerPath !== path.slice(0, layerPath.length)) {\n next(layerError)\n return\n }\n\n // Validate path breaks on a path separator\n var c = path[layerPath.length]\n if (c && c !== '/' && c !== '.') return next(layerError)\n\n // Trim off the part of the url that matches the route\n // middleware (.use stuff) needs to have the path stripped\n debug('trim prefix (%s) from url %s', layerPath, req.url);\n removed = layerPath;\n req.url = protohost + req.url.slice(protohost.length + removed.length)\n\n // Ensure leading slash\n if (!protohost && req.url[0] !== '/') {\n req.url = '/' + req.url;\n slashAdded = true;\n }\n\n // Setup base URL (no trailing slash)\n req.baseUrl = parentUrl + (removed[removed.length - 1] === '/'\n ? removed.substring(0, removed.length - 1)\n : removed);\n }\n\n debug('%s %s : %s', layer.name, layerPath, req.originalUrl);\n\n if (layerError) {\n layer.handle_error(layerError, req, res, next);\n } else {\n layer.handle_request(req, res, next);\n }\n }\n};\n\n/**\n * Process any parameters for the layer.\n * @private\n */\n\nproto.process_params = function process_params(layer, called, req, res, done) {\n var params = this.params;\n\n // captured parameters from the layer, keys and values\n var keys = layer.keys;\n\n // fast track\n if (!keys || keys.length === 0) {\n return done();\n }\n\n var i = 0;\n var name;\n var paramIndex = 0;\n var key;\n var paramVal;\n var paramCallbacks;\n var paramCalled;\n\n // process params in order\n // param callbacks can be async\n function param(err) {\n if (err) {\n return done(err);\n }\n\n if (i >= keys.length ) {\n return done();\n }\n\n paramIndex = 0;\n key = keys[i++];\n name = key.name;\n paramVal = req.params[name];\n paramCallbacks = params[name];\n paramCalled = called[name];\n\n if (paramVal === undefined || !paramCallbacks) {\n return param();\n }\n\n // param previously called with same value or error occurred\n if (paramCalled && (paramCalled.match === paramVal\n || (paramCalled.error && paramCalled.error !== 'route'))) {\n // restore value\n req.params[name] = paramCalled.value;\n\n // next param\n return param(paramCalled.error);\n }\n\n called[name] = paramCalled = {\n error: null,\n match: paramVal,\n value: paramVal\n };\n\n paramCallback();\n }\n\n // single param callbacks\n function paramCallback(err) {\n var fn = paramCallbacks[paramIndex++];\n\n // store updated value\n paramCalled.value = req.params[key.name];\n\n if (err) {\n // store error\n paramCalled.error = err;\n param(err);\n return;\n }\n\n if (!fn) return param();\n\n try {\n fn(req, res, paramCallback, paramVal, key.name);\n } catch (e) {\n paramCallback(e);\n }\n }\n\n param();\n};\n\n/**\n * Use the given middleware function, with optional path, defaulting to \"/\".\n *\n * Use (like `.all`) will run for any http METHOD, but it will not add\n * handlers for those methods so OPTIONS requests will not consider `.use`\n * functions even if they could respond.\n *\n * The other difference is that _route_ path is stripped and not visible\n * to the handler function. The main effect of this feature is that mounted\n * handlers can operate without any code changes regardless of the \"prefix\"\n * pathname.\n *\n * @public\n */\n\nproto.use = function use(fn) {\n var offset = 0;\n var path = '/';\n\n // default path to '/'\n // disambiguate router.use([fn])\n if (typeof fn !== 'function') {\n var arg = fn;\n\n while (Array.isArray(arg) && arg.length !== 0) {\n arg = arg[0];\n }\n\n // first arg is the path\n if (typeof arg !== 'function') {\n offset = 1;\n path = fn;\n }\n }\n\n var callbacks = flatten(slice.call(arguments, offset));\n\n if (callbacks.length === 0) {\n throw new TypeError('Router.use() requires a middleware function')\n }\n\n for (var i = 0; i < callbacks.length; i++) {\n var fn = callbacks[i];\n\n if (typeof fn !== 'function') {\n throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))\n }\n\n // add the middleware\n debug('use %o %s', path, fn.name || '')\n\n var layer = new Layer(path, {\n sensitive: this.caseSensitive,\n strict: false,\n end: false\n }, fn);\n\n layer.route = undefined;\n\n this.stack.push(layer);\n }\n\n return this;\n};\n\n/**\n * Create a new Route for the given path.\n *\n * Each route contains a separate middleware stack and VERB handlers.\n *\n * See the Route api documentation for details on adding handlers\n * and middleware to routes.\n *\n * @param {String} path\n * @return {Route}\n * @public\n */\n\nproto.route = function route(path) {\n var route = new Route(path);\n\n var layer = new Layer(path, {\n sensitive: this.caseSensitive,\n strict: this.strict,\n end: true\n }, route.dispatch.bind(route));\n\n layer.route = route;\n\n this.stack.push(layer);\n return route;\n};\n\n// create Router#VERB functions\nmethods.concat('all').forEach(function(method){\n proto[method] = function(path){\n var route = this.route(path)\n route[method].apply(route, slice.call(arguments, 1));\n return this;\n };\n});\n\n// append methods to a list of methods\nfunction appendMethods(list, addition) {\n for (var i = 0; i < addition.length; i++) {\n var method = addition[i];\n if (list.indexOf(method) === -1) {\n list.push(method);\n }\n }\n}\n\n// get pathname of request\nfunction getPathname(req) {\n try {\n return parseUrl(req).pathname;\n } catch (err) {\n return undefined;\n }\n}\n\n// Get get protocol + host for a URL\nfunction getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.slice(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substring(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}\n\n// get type for error message\nfunction gettype(obj) {\n var type = typeof obj;\n\n if (type !== 'object') {\n return type;\n }\n\n // inspect [[Class]] for objects\n return toString.call(obj)\n .replace(objectRegExp, '$1');\n}\n\n/**\n * Match path to a layer.\n *\n * @param {Layer} layer\n * @param {string} path\n * @private\n */\n\nfunction matchLayer(layer, path) {\n try {\n return layer.match(path);\n } catch (err) {\n return err;\n }\n}\n\n// merge params with parent params\nfunction mergeParams(params, parent) {\n if (typeof parent !== 'object' || !parent) {\n return params;\n }\n\n // make copy of parent for base\n var obj = mixin({}, parent);\n\n // simple non-numeric merging\n if (!(0 in params) || !(0 in parent)) {\n return mixin(obj, params);\n }\n\n var i = 0;\n var o = 0;\n\n // determine numeric gaps\n while (i in params) {\n i++;\n }\n\n while (o in parent) {\n o++;\n }\n\n // offset numeric indices in params before merge\n for (i--; i >= 0; i--) {\n params[i + o] = params[i];\n\n // create holes for the merge when necessary\n if (i < o) {\n delete params[i];\n }\n }\n\n return mixin(obj, params);\n}\n\n// restore obj props after function\nfunction restore(fn, obj) {\n var props = new Array(arguments.length - 2);\n var vals = new Array(arguments.length - 2);\n\n for (var i = 0; i < props.length; i++) {\n props[i] = arguments[i + 2];\n vals[i] = obj[props[i]];\n }\n\n return function () {\n // restore vals\n for (var i = 0; i < props.length; i++) {\n obj[props[i]] = vals[i];\n }\n\n return fn.apply(this, arguments);\n };\n}\n\n// send an OPTIONS response\nfunction sendOptionsResponse(res, options, next) {\n try {\n var body = options.join(',');\n res.set('Allow', body);\n res.send(body);\n } catch (err) {\n next(err);\n }\n}\n\n// wrap a function\nfunction wrap(old, fn) {\n return function proxy() {\n var args = new Array(arguments.length + 1);\n\n args[0] = old;\n for (var i = 0, len = arguments.length; i < len; i++) {\n args[i + 1] = arguments[i];\n }\n\n fn.apply(this, args);\n };\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar pathRegexp = require('path-to-regexp');\nvar debug = require('debug')('express:router:layer');\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Layer;\n\nfunction Layer(path, options, fn) {\n if (!(this instanceof Layer)) {\n return new Layer(path, options, fn);\n }\n\n debug('new %o', path)\n var opts = options || {};\n\n this.handle = fn;\n this.name = fn.name || '';\n this.params = undefined;\n this.path = undefined;\n this.regexp = pathRegexp(path, this.keys = [], opts);\n\n // set fast path flags\n this.regexp.fast_star = path === '*'\n this.regexp.fast_slash = path === '/' && opts.end === false\n}\n\n/**\n * Handle the error for the layer.\n *\n * @param {Error} error\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handle_error = function handle_error(error, req, res, next) {\n var fn = this.handle;\n\n if (fn.length !== 4) {\n // not a standard error handler\n return next(error);\n }\n\n try {\n fn(error, req, res, next);\n } catch (err) {\n next(err);\n }\n};\n\n/**\n * Handle the request for the layer.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handle_request = function handle(req, res, next) {\n var fn = this.handle;\n\n if (fn.length > 3) {\n // not a standard request handler\n return next();\n }\n\n try {\n fn(req, res, next);\n } catch (err) {\n next(err);\n }\n};\n\n/**\n * Check if this route matches `path`, if so\n * populate `.params`.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nLayer.prototype.match = function match(path) {\n var match\n\n if (path != null) {\n // fast path non-ending match for / (any path matches)\n if (this.regexp.fast_slash) {\n this.params = {}\n this.path = ''\n return true\n }\n\n // fast path for * (everything matched in a param)\n if (this.regexp.fast_star) {\n this.params = {'0': decode_param(path)}\n this.path = path\n return true\n }\n\n // match the path\n match = this.regexp.exec(path)\n }\n\n if (!match) {\n this.params = undefined;\n this.path = undefined;\n return false;\n }\n\n // store values\n this.params = {};\n this.path = match[0]\n\n var keys = this.keys;\n var params = this.params;\n\n for (var i = 1; i < match.length; i++) {\n var key = keys[i - 1];\n var prop = key.name;\n var val = decode_param(match[i])\n\n if (val !== undefined || !(hasOwnProperty.call(params, prop))) {\n params[prop] = val;\n }\n }\n\n return true;\n};\n\n/**\n * Decode param value.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction decode_param(val) {\n if (typeof val !== 'string' || val.length === 0) {\n return val;\n }\n\n try {\n return decodeURIComponent(val);\n } catch (err) {\n if (err instanceof URIError) {\n err.message = 'Failed to decode param \\'' + val + '\\'';\n err.status = err.statusCode = 400;\n }\n\n throw err;\n }\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('express:router:route');\nvar flatten = require('array-flatten');\nvar Layer = require('./layer');\nvar methods = require('methods');\n\n/**\n * Module variables.\n * @private\n */\n\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Route;\n\n/**\n * Initialize `Route` with the given `path`,\n *\n * @param {String} path\n * @public\n */\n\nfunction Route(path) {\n this.path = path;\n this.stack = [];\n\n debug('new %o', path)\n\n // route handlers for various http methods\n this.methods = {};\n}\n\n/**\n * Determine if the route handles a given method.\n * @private\n */\n\nRoute.prototype._handles_method = function _handles_method(method) {\n if (this.methods._all) {\n return true;\n }\n\n var name = method.toLowerCase();\n\n if (name === 'head' && !this.methods['head']) {\n name = 'get';\n }\n\n return Boolean(this.methods[name]);\n};\n\n/**\n * @return {Array} supported HTTP methods\n * @private\n */\n\nRoute.prototype._options = function _options() {\n var methods = Object.keys(this.methods);\n\n // append automatic head\n if (this.methods.get && !this.methods.head) {\n methods.push('head');\n }\n\n for (var i = 0; i < methods.length; i++) {\n // make upper case\n methods[i] = methods[i].toUpperCase();\n }\n\n return methods;\n};\n\n/**\n * dispatch req, res into this route\n * @private\n */\n\nRoute.prototype.dispatch = function dispatch(req, res, done) {\n var idx = 0;\n var stack = this.stack;\n var sync = 0\n\n if (stack.length === 0) {\n return done();\n }\n\n var method = req.method.toLowerCase();\n if (method === 'head' && !this.methods['head']) {\n method = 'get';\n }\n\n req.route = this;\n\n next();\n\n function next(err) {\n // signal to exit route\n if (err && err === 'route') {\n return done();\n }\n\n // signal to exit router\n if (err && err === 'router') {\n return done(err)\n }\n\n // max sync stack\n if (++sync > 100) {\n return setImmediate(next, err)\n }\n\n var layer = stack[idx++]\n\n // end of layers\n if (!layer) {\n return done(err)\n }\n\n if (layer.method && layer.method !== method) {\n next(err)\n } else if (err) {\n layer.handle_error(err, req, res, next);\n } else {\n layer.handle_request(req, res, next);\n }\n\n sync = 0\n }\n};\n\n/**\n * Add a handler for all HTTP verbs to this route.\n *\n * Behaves just like middleware and can respond or call `next`\n * to continue processing.\n *\n * You can use multiple `.all` call to add multiple handlers.\n *\n * function check_something(req, res, next){\n * next();\n * };\n *\n * function validate_user(req, res, next){\n * next();\n * };\n *\n * route\n * .all(validate_user)\n * .all(check_something)\n * .get(function(req, res, next){\n * res.send('hello world');\n * });\n *\n * @param {function} handler\n * @return {Route} for chaining\n * @api public\n */\n\nRoute.prototype.all = function all() {\n var handles = flatten(slice.call(arguments));\n\n for (var i = 0; i < handles.length; i++) {\n var handle = handles[i];\n\n if (typeof handle !== 'function') {\n var type = toString.call(handle);\n var msg = 'Route.all() requires a callback function but got a ' + type\n throw new TypeError(msg);\n }\n\n var layer = Layer('/', {}, handle);\n layer.method = undefined;\n\n this.methods._all = true;\n this.stack.push(layer);\n }\n\n return this;\n};\n\nmethods.forEach(function(method){\n Route.prototype[method] = function(){\n var handles = flatten(slice.call(arguments));\n\n for (var i = 0; i < handles.length; i++) {\n var handle = handles[i];\n\n if (typeof handle !== 'function') {\n var type = toString.call(handle);\n var msg = 'Route.' + method + '() requires a callback function but got a ' + type\n throw new Error(msg);\n }\n\n debug('%s %o', method, this.path)\n\n var layer = Layer('/', {}, handle);\n layer.method = method;\n\n this.methods[method] = true;\n this.stack.push(layer);\n }\n\n return this;\n };\n});\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @api private\n */\n\nvar Buffer = require('safe-buffer').Buffer\nvar contentDisposition = require('content-disposition');\nvar contentType = require('content-type');\nvar deprecate = require('depd')('express');\nvar flatten = require('array-flatten');\nvar mime = require('send').mime;\nvar etag = require('etag');\nvar proxyaddr = require('proxy-addr');\nvar qs = require('qs');\nvar querystring = require('querystring');\n\n/**\n * Return strong ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.etag = createETagGenerator({ weak: false })\n\n/**\n * Return weak ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.wetag = createETagGenerator({ weak: true })\n\n/**\n * Check if `path` looks absolute.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nexports.isAbsolute = function(path){\n if ('/' === path[0]) return true;\n if (':' === path[1] && ('\\\\' === path[2] || '/' === path[2])) return true; // Windows device path\n if ('\\\\\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path\n};\n\n/**\n * Flatten the given `arr`.\n *\n * @param {Array} arr\n * @return {Array}\n * @api private\n */\n\nexports.flatten = deprecate.function(flatten,\n 'utils.flatten: use array-flatten npm module instead');\n\n/**\n * Normalize the given `type`, for example \"html\" becomes \"text/html\".\n *\n * @param {String} type\n * @return {Object}\n * @api private\n */\n\nexports.normalizeType = function(type){\n return ~type.indexOf('/')\n ? acceptParams(type)\n : { value: mime.lookup(type), params: {} };\n};\n\n/**\n * Normalize `types`, for example \"html\" becomes \"text/html\".\n *\n * @param {Array} types\n * @return {Array}\n * @api private\n */\n\nexports.normalizeTypes = function(types){\n var ret = [];\n\n for (var i = 0; i < types.length; ++i) {\n ret.push(exports.normalizeType(types[i]));\n }\n\n return ret;\n};\n\n/**\n * Generate Content-Disposition header appropriate for the filename.\n * non-ascii filenames are urlencoded and a filename* parameter is added\n *\n * @param {String} filename\n * @return {String}\n * @api private\n */\n\nexports.contentDisposition = deprecate.function(contentDisposition,\n 'utils.contentDisposition: use content-disposition npm module instead');\n\n/**\n * Parse accept params `str` returning an\n * object with `.value`, `.quality` and `.params`.\n * also includes `.originalIndex` for stable sorting\n *\n * @param {String} str\n * @param {Number} index\n * @return {Object}\n * @api private\n */\n\nfunction acceptParams(str, index) {\n var parts = str.split(/ *; */);\n var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index };\n\n for (var i = 1; i < parts.length; ++i) {\n var pms = parts[i].split(/ *= */);\n if ('q' === pms[0]) {\n ret.quality = parseFloat(pms[1]);\n } else {\n ret.params[pms[0]] = pms[1];\n }\n }\n\n return ret;\n}\n\n/**\n * Compile \"etag\" value to function.\n *\n * @param {Boolean|String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileETag = function(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'weak':\n fn = exports.wetag;\n break;\n case false:\n break;\n case 'strong':\n fn = exports.etag;\n break;\n default:\n throw new TypeError('unknown value for etag function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"query parser\" value to function.\n *\n * @param {String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileQueryParser = function compileQueryParser(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'simple':\n fn = querystring.parse;\n break;\n case false:\n fn = newObject;\n break;\n case 'extended':\n fn = parseExtendedQueryString;\n break;\n default:\n throw new TypeError('unknown value for query parser function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"proxy trust\" value to function.\n *\n * @param {Boolean|String|Number|Array|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileTrust = function(val) {\n if (typeof val === 'function') return val;\n\n if (val === true) {\n // Support plain true/false\n return function(){ return true };\n }\n\n if (typeof val === 'number') {\n // Support trusting hop count\n return function(a, i){ return i < val };\n }\n\n if (typeof val === 'string') {\n // Support comma-separated values\n val = val.split(',')\n .map(function (v) { return v.trim() })\n }\n\n return proxyaddr.compile(val || []);\n}\n\n/**\n * Set the charset in a given Content-Type string.\n *\n * @param {String} type\n * @param {String} charset\n * @return {String}\n * @api private\n */\n\nexports.setCharset = function setCharset(type, charset) {\n if (!type || !charset) {\n return type;\n }\n\n // parse type\n var parsed = contentType.parse(type);\n\n // set charset\n parsed.parameters.charset = charset;\n\n // format type\n return contentType.format(parsed);\n};\n\n/**\n * Create an ETag generator function, generating ETags with\n * the given options.\n *\n * @param {object} options\n * @return {function}\n * @private\n */\n\nfunction createETagGenerator (options) {\n return function generateETag (body, encoding) {\n var buf = !Buffer.isBuffer(body)\n ? Buffer.from(body, encoding)\n : body\n\n return etag(buf, options)\n }\n}\n\n/**\n * Parse an extended query string with qs.\n *\n * @return {Object}\n * @private\n */\n\nfunction parseExtendedQueryString(str) {\n return qs.parse(str, {\n allowPrototypes: true\n });\n}\n\n/**\n * Return new empty object.\n *\n * @return {Object}\n * @api private\n */\n\nfunction newObject() {\n return {};\n}\n","/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('express:view');\nvar path = require('path');\nvar fs = require('fs');\n\n/**\n * Module variables.\n * @private\n */\n\nvar dirname = path.dirname;\nvar basename = path.basename;\nvar extname = path.extname;\nvar join = path.join;\nvar resolve = path.resolve;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = View;\n\n/**\n * Initialize a new `View` with the given `name`.\n *\n * Options:\n *\n * - `defaultEngine` the default template engine name\n * - `engines` template engine require() cache\n * - `root` root path for view lookup\n *\n * @param {string} name\n * @param {object} options\n * @public\n */\n\nfunction View(name, options) {\n var opts = options || {};\n\n this.defaultEngine = opts.defaultEngine;\n this.ext = extname(name);\n this.name = name;\n this.root = opts.root;\n\n if (!this.ext && !this.defaultEngine) {\n throw new Error('No default engine was specified and no extension was provided.');\n }\n\n var fileName = name;\n\n if (!this.ext) {\n // get extension from default engine name\n this.ext = this.defaultEngine[0] !== '.'\n ? '.' + this.defaultEngine\n : this.defaultEngine;\n\n fileName += this.ext;\n }\n\n if (!opts.engines[this.ext]) {\n // load engine\n var mod = this.ext.slice(1)\n debug('require \"%s\"', mod)\n\n // default engine export\n var fn = require(mod).__express\n\n if (typeof fn !== 'function') {\n throw new Error('Module \"' + mod + '\" does not provide a view engine.')\n }\n\n opts.engines[this.ext] = fn\n }\n\n // store loaded engine\n this.engine = opts.engines[this.ext];\n\n // lookup path\n this.path = this.lookup(fileName);\n}\n\n/**\n * Lookup view by the given `name`\n *\n * @param {string} name\n * @private\n */\n\nView.prototype.lookup = function lookup(name) {\n var path;\n var roots = [].concat(this.root);\n\n debug('lookup \"%s\"', name);\n\n for (var i = 0; i < roots.length && !path; i++) {\n var root = roots[i];\n\n // resolve the path\n var loc = resolve(root, name);\n var dir = dirname(loc);\n var file = basename(loc);\n\n // resolve the file\n path = this.resolve(dir, file);\n }\n\n return path;\n};\n\n/**\n * Render with the given options.\n *\n * @param {object} options\n * @param {function} callback\n * @private\n */\n\nView.prototype.render = function render(options, callback) {\n debug('render \"%s\"', this.path);\n this.engine(this.path, options, callback);\n};\n\n/**\n * Resolve the file within the given directory.\n *\n * @param {string} dir\n * @param {string} file\n * @private\n */\n\nView.prototype.resolve = function resolve(dir, file) {\n var ext = this.ext;\n\n // .\n var path = join(dir, file);\n var stat = tryStat(path);\n\n if (stat && stat.isFile()) {\n return path;\n }\n\n // /index.\n path = join(dir, basename(file, ext), 'index' + ext);\n stat = tryStat(path);\n\n if (stat && stat.isFile()) {\n return path;\n }\n};\n\n/**\n * Return a stat, maybe.\n *\n * @param {string} path\n * @return {fs.Stats}\n * @private\n */\n\nfunction tryStat(path) {\n debug('stat \"%s\"', path);\n\n try {\n return fs.statSync(path);\n } catch (e) {\n return undefined;\n }\n}\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = \"./node_modules/express/lib sync recursive\";\nmodule.exports = webpackEmptyContext;","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/*!\n * finalhandler\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar debug = require('debug')('finalhandler')\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar onFinished = require('on-finished')\nvar parseUrl = require('parseurl')\nvar statuses = require('statuses')\nvar unpipe = require('unpipe')\n\n/**\n * Module variables.\n * @private\n */\n\nvar DOUBLE_SPACE_REGEXP = /\\x20{2}/g\nvar NEWLINE_REGEXP = /\\n/g\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }\nvar isFinished = onFinished.isFinished\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} message\n * @private\n */\n\nfunction createHtmlDocument (message) {\n var body = escapeHtml(message)\n .replace(NEWLINE_REGEXP, '
')\n .replace(DOUBLE_SPACE_REGEXP, '  ')\n\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n 'Error\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = finalhandler\n\n/**\n * Create a function to handle the final response.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {Object} [options]\n * @return {Function}\n * @public\n */\n\nfunction finalhandler (req, res, options) {\n var opts = options || {}\n\n // get environment\n var env = opts.env || process.env.NODE_ENV || 'development'\n\n // get error callback\n var onerror = opts.onerror\n\n return function (err) {\n var headers\n var msg\n var status\n\n // ignore 404 on in-flight response\n if (!err && headersSent(res)) {\n debug('cannot 404 after headers sent')\n return\n }\n\n // unhandled error\n if (err) {\n // respect status code from error\n status = getErrorStatusCode(err)\n\n if (status === undefined) {\n // fallback to status code on response\n status = getResponseStatusCode(res)\n } else {\n // respect headers from error\n headers = getErrorHeaders(err)\n }\n\n // get error message\n msg = getErrorMessage(err, status, env)\n } else {\n // not found\n status = 404\n msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req))\n }\n\n debug('default %s', status)\n\n // schedule onerror callback\n if (err && onerror) {\n defer(onerror, err, req, res)\n }\n\n // cannot actually respond\n if (headersSent(res)) {\n debug('cannot %d after headers sent', status)\n req.socket.destroy()\n return\n }\n\n // send response\n send(req, res, status, headers, msg)\n }\n}\n\n/**\n * Get headers from Error object.\n *\n * @param {Error} err\n * @return {object}\n * @private\n */\n\nfunction getErrorHeaders (err) {\n if (!err.headers || typeof err.headers !== 'object') {\n return undefined\n }\n\n var headers = Object.create(null)\n var keys = Object.keys(err.headers)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n headers[key] = err.headers[key]\n }\n\n return headers\n}\n\n/**\n * Get message from Error object, fallback to status message.\n *\n * @param {Error} err\n * @param {number} status\n * @param {string} env\n * @return {string}\n * @private\n */\n\nfunction getErrorMessage (err, status, env) {\n var msg\n\n if (env !== 'production') {\n // use err.stack, which typically includes err.message\n msg = err.stack\n\n // fallback to err.toString() when possible\n if (!msg && typeof err.toString === 'function') {\n msg = err.toString()\n }\n }\n\n return msg || statuses.message[status]\n}\n\n/**\n * Get status code from Error object.\n *\n * @param {Error} err\n * @return {number}\n * @private\n */\n\nfunction getErrorStatusCode (err) {\n // check err.status\n if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {\n return err.status\n }\n\n // check err.statusCode\n if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {\n return err.statusCode\n }\n\n return undefined\n}\n\n/**\n * Get resource name for the request.\n *\n * This is typically just the original pathname of the request\n * but will fallback to \"resource\" is that cannot be determined.\n *\n * @param {IncomingMessage} req\n * @return {string}\n * @private\n */\n\nfunction getResourceName (req) {\n try {\n return parseUrl.original(req).pathname\n } catch (e) {\n return 'resource'\n }\n}\n\n/**\n * Get status code from response.\n *\n * @param {OutgoingMessage} res\n * @return {number}\n * @private\n */\n\nfunction getResponseStatusCode (res) {\n var status = res.statusCode\n\n // default status code to 500 if outside valid range\n if (typeof status !== 'number' || status < 400 || status > 599) {\n status = 500\n }\n\n return status\n}\n\n/**\n * Determine if the response headers have been sent.\n *\n * @param {object} res\n * @returns {boolean}\n * @private\n */\n\nfunction headersSent (res) {\n return typeof res.headersSent !== 'boolean'\n ? Boolean(res._header)\n : res.headersSent\n}\n\n/**\n * Send response.\n *\n * @param {IncomingMessage} req\n * @param {OutgoingMessage} res\n * @param {number} status\n * @param {object} headers\n * @param {string} message\n * @private\n */\n\nfunction send (req, res, status, headers, message) {\n function write () {\n // response body\n var body = createHtmlDocument(message)\n\n // response status\n res.statusCode = status\n res.statusMessage = statuses.message[status]\n\n // remove any content headers\n res.removeHeader('Content-Encoding')\n res.removeHeader('Content-Language')\n res.removeHeader('Content-Range')\n\n // response headers\n setHeaders(res, headers)\n\n // security headers\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n\n // standard headers\n res.setHeader('Content-Type', 'text/html; charset=utf-8')\n res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))\n\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n\n res.end(body, 'utf8')\n }\n\n if (isFinished(req)) {\n write()\n return\n }\n\n // unpipe everything from the request\n unpipe(req)\n\n // flush the request\n onFinished(req, write)\n req.resume()\n}\n\n/**\n * Set response headers from an object.\n *\n * @param {OutgoingMessage} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeaders (res, headers) {\n if (!headers) {\n return\n }\n\n var keys = Object.keys(headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n res.setHeader(key, headers[key])\n }\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\nvar InvalidUrlError = createErrorType(\n \"ERR_INVALID_URL\",\n \"Invalid URL\",\n TypeError\n);\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!isString(data) && !isBuffer(data)) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (isFunction(data)) {\n callback = data;\n data = encoding = null;\n }\n else if (isFunction(encoding)) {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230§5.3.1: When making a request directly to an origin server, […]\n // a client MUST send only the absolute path […] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, […]\n // a client MUST send the target URI in absolute-form […].\n this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (isFunction(beforeRedirect)) {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError({ cause: cause }));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (isString(input)) {\n var parsed;\n try {\n parsed = urlToOptions(new URL(input));\n }\n catch (err) {\n /* istanbul ignore next */\n parsed = url.parse(input);\n }\n if (!isString(parsed.protocol)) {\n throw new InvalidUrlError({ input });\n }\n input = parsed;\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (isFunction(options)) {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n if (!isString(options.host) && !isString(options.hostname)) {\n options.hostname = \"::1\";\n }\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, message, baseClass) {\n // Create constructor\n function CustomError(properties) {\n Error.captureStackTrace(this, this.constructor);\n Object.assign(this, properties || {});\n this.code = code;\n this.message = this.cause ? message + \": \" + this.cause.message : message;\n }\n\n // Attach constructor and set default properties\n CustomError.prototype = new (baseClass || Error)();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n assert(isString(subdomain) && isString(domain));\n var dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\nfunction isString(value) {\n return typeof value === \"string\" || value instanceof String;\n}\n\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\nfunction isBuffer(value) {\n return typeof value === \"object\" && (\"length\" in value);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","/*!\n * forwarded\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = forwarded\n\n/**\n * Get all addresses in the request, using the `X-Forwarded-For` header.\n *\n * @param {object} req\n * @return {array}\n * @public\n */\n\nfunction forwarded (req) {\n if (!req) {\n throw new TypeError('argument req is required')\n }\n\n // simple header parsing\n var proxyAddrs = parse(req.headers['x-forwarded-for'] || '')\n var socketAddr = getSocketAddr(req)\n var addrs = [socketAddr].concat(proxyAddrs)\n\n // return all addresses\n return addrs\n}\n\n/**\n * Get the socket address for a request.\n *\n * @param {object} req\n * @return {string}\n * @private\n */\n\nfunction getSocketAddr (req) {\n return req.socket\n ? req.socket.remoteAddress\n : req.connection.remoteAddress\n}\n\n/**\n * Parse the X-Forwarded-For header.\n *\n * @param {string} header\n * @private\n */\n\nfunction parse (header) {\n var end = header.length\n var list = []\n var start = header.length\n\n // gather addresses, backwards\n for (var i = header.length - 1; i >= 0; i--) {\n switch (header.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i\n }\n break\n case 0x2c: /* , */\n if (start !== end) {\n list.push(header.substring(start, end))\n }\n start = end = i\n break\n default:\n start = i\n break\n }\n }\n\n // final address\n if (start !== end) {\n list.push(header.substring(start, end))\n }\n\n return list\n}\n","/*!\n * fresh\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2016-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * RegExp to check for no-cache token in Cache-Control.\n * @private\n */\n\nvar CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\\s*?no-cache\\s*?(?:,|$)/\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = fresh\n\n/**\n * Check freshness of the response using request and response headers.\n *\n * @param {Object} reqHeaders\n * @param {Object} resHeaders\n * @return {Boolean}\n * @public\n */\n\nfunction fresh (reqHeaders, resHeaders) {\n // fields\n var modifiedSince = reqHeaders['if-modified-since']\n var noneMatch = reqHeaders['if-none-match']\n\n // unconditional request\n if (!modifiedSince && !noneMatch) {\n return false\n }\n\n // Always return stale when Cache-Control: no-cache\n // to support end-to-end reload requests\n // https://tools.ietf.org/html/rfc2616#section-14.9.4\n var cacheControl = reqHeaders['cache-control']\n if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) {\n return false\n }\n\n // if-none-match\n if (noneMatch && noneMatch !== '*') {\n var etag = resHeaders['etag']\n\n if (!etag) {\n return false\n }\n\n var etagStale = true\n var matches = parseTokenList(noneMatch)\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i]\n if (match === etag || match === 'W/' + etag || 'W/' + match === etag) {\n etagStale = false\n break\n }\n }\n\n if (etagStale) {\n return false\n }\n }\n\n // if-modified-since\n if (modifiedSince) {\n var lastModified = resHeaders['last-modified']\n var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince))\n\n if (modifiedStale) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Parse an HTTP Date into a number.\n *\n * @param {string} date\n * @private\n */\n\nfunction parseHttpDate (date) {\n var timestamp = date && Date.parse(date)\n\n // istanbul ignore next: guard against date.js Date.parse patching\n return typeof timestamp === 'number'\n ? timestamp\n : NaN\n}\n\n/**\n * Parse a HTTP token list.\n *\n * @param {string} str\n * @private\n */\n\nfunction parseTokenList (str) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = str.length; i < len; i++) {\n switch (str.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n list.push(str.substring(start, end))\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n list.push(str.substring(start, end))\n\n return list\n}\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","/*!\n * http-errors\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar deprecate = require('depd')('http-errors')\nvar setPrototypeOf = require('setprototypeof')\nvar statuses = require('statuses')\nvar inherits = require('inherits')\nvar toIdentifier = require('toidentifier')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = createError\nmodule.exports.HttpError = createHttpErrorConstructor()\nmodule.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError)\n\n// Populate exports for all constructors\npopulateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)\n\n/**\n * Get the code class of a status code.\n * @private\n */\n\nfunction codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}\n\n/**\n * Create a new HTTP Error.\n *\n * @returns {Error}\n * @public\n */\n\nfunction createError () {\n // so much arity going on ~_~\n var err\n var msg\n var status = 500\n var props = {}\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i]\n var type = typeof arg\n if (type === 'object' && arg instanceof Error) {\n err = arg\n status = err.status || err.statusCode || status\n } else if (type === 'number' && i === 0) {\n status = arg\n } else if (type === 'string') {\n msg = arg\n } else if (type === 'object') {\n props = arg\n } else {\n throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type)\n }\n }\n\n if (typeof status === 'number' && (status < 400 || status >= 600)) {\n deprecate('non-error status code; use only 4xx or 5xx status codes')\n }\n\n if (typeof status !== 'number' ||\n (!statuses.message[status] && (status < 400 || status >= 600))) {\n status = 500\n }\n\n // constructor\n var HttpError = createError[status] || createError[codeClass(status)]\n\n if (!err) {\n // create error\n err = HttpError\n ? new HttpError(msg)\n : new Error(msg || statuses.message[status])\n Error.captureStackTrace(err, createError)\n }\n\n if (!HttpError || !(err instanceof HttpError) || err.status !== status) {\n // add properties to generic error\n err.expose = status < 500\n err.status = err.statusCode = status\n }\n\n for (var key in props) {\n if (key !== 'status' && key !== 'statusCode') {\n err[key] = props[key]\n }\n }\n\n return err\n}\n\n/**\n * Create HTTP error abstract base class.\n * @private\n */\n\nfunction createHttpErrorConstructor () {\n function HttpError () {\n throw new TypeError('cannot construct abstract class')\n }\n\n inherits(HttpError, Error)\n\n return HttpError\n}\n\n/**\n * Create a constructor for a client error.\n * @private\n */\n\nfunction createClientErrorConstructor (HttpError, name, code) {\n var className = toClassName(name)\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses.message[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}\n\n/**\n * Create function to test is a value is a HttpError.\n * @private\n */\n\nfunction createIsHttpErrorFunction (HttpError) {\n return function isHttpError (val) {\n if (!val || typeof val !== 'object') {\n return false\n }\n\n if (val instanceof HttpError) {\n return true\n }\n\n return val instanceof Error &&\n typeof val.expose === 'boolean' &&\n typeof val.statusCode === 'number' && val.status === val.statusCode\n }\n}\n\n/**\n * Create a constructor for a server error.\n * @private\n */\n\nfunction createServerErrorConstructor (HttpError, name, code) {\n var className = toClassName(name)\n\n function ServerError (message) {\n // create the error object\n var msg = message != null ? message : statuses.message[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ServerError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ServerError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ServerError, HttpError)\n nameFunc(ServerError, className)\n\n ServerError.prototype.status = code\n ServerError.prototype.statusCode = code\n ServerError.prototype.expose = false\n\n return ServerError\n}\n\n/**\n * Set the name of a function, if possible.\n * @private\n */\n\nfunction nameFunc (func, name) {\n var desc = Object.getOwnPropertyDescriptor(func, 'name')\n\n if (desc && desc.configurable) {\n desc.value = name\n Object.defineProperty(func, 'name', desc)\n }\n}\n\n/**\n * Populate the exports object with constructors for every error class.\n * @private\n */\n\nfunction populateConstructorExports (exports, codes, HttpError) {\n codes.forEach(function forEachCode (code) {\n var CodeError\n var name = toIdentifier(statuses.message[code])\n\n switch (codeClass(code)) {\n case 400:\n CodeError = createClientErrorConstructor(HttpError, name, code)\n break\n case 500:\n CodeError = createServerErrorConstructor(HttpError, name, code)\n break\n }\n\n if (CodeError) {\n // export the constructor\n exports[code] = CodeError\n exports[name] = CodeError\n }\n })\n}\n\n/**\n * Get a class name from a name identifier.\n * @private\n */\n\nfunction toClassName (name) {\n return name.substr(-5) !== 'Error'\n ? name + 'Error'\n : name\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.\n// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.\n// To save memory and loading time, we read table files only when requested.\n\nexports._dbcs = DBCSCodec;\n\nvar UNASSIGNED = -1,\n GB18030_CODE = -2,\n SEQ_START = -10,\n NODE_START = -1000,\n UNASSIGNED_NODE = new Array(0x100),\n DEF_CHAR = -1;\n\nfor (var i = 0; i < 0x100; i++)\n UNASSIGNED_NODE[i] = UNASSIGNED;\n\n\n// Class DBCSCodec reads and initializes mapping tables.\nfunction DBCSCodec(codecOptions, iconv) {\n this.encodingName = codecOptions.encodingName;\n if (!codecOptions)\n throw new Error(\"DBCS codec is called without the data.\")\n if (!codecOptions.table)\n throw new Error(\"Encoding '\" + this.encodingName + \"' has no data.\");\n\n // Load tables.\n var mappingTable = codecOptions.table();\n\n\n // Decode tables: MBCS -> Unicode.\n\n // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.\n // Trie root is decodeTables[0].\n // Values: >= 0 -> unicode character code. can be > 0xFFFF\n // == UNASSIGNED -> unknown/unassigned sequence.\n // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.\n // <= NODE_START -> index of the next node in our trie to process next byte.\n // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.\n this.decodeTables = [];\n this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.\n\n // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. \n this.decodeTableSeq = [];\n\n // Actual mapping tables consist of chunks. Use them to fill up decode tables.\n for (var i = 0; i < mappingTable.length; i++)\n this._addDecodeChunk(mappingTable[i]);\n\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n\n \n // Encode tables: Unicode -> DBCS.\n\n // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.\n // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.\n // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).\n // == UNASSIGNED -> no conversion found. Output a default char.\n // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.\n this.encodeTable = [];\n \n // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of\n // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key\n // means end of sequence (needed when one sequence is a strict subsequence of another).\n // Objects are kept separately from encodeTable to increase performance.\n this.encodeTableSeq = [];\n\n // Some chars can be decoded, but need not be encoded.\n var skipEncodeChars = {};\n if (codecOptions.encodeSkipVals)\n for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {\n var val = codecOptions.encodeSkipVals[i];\n if (typeof val === 'number')\n skipEncodeChars[val] = true;\n else\n for (var j = val.from; j <= val.to; j++)\n skipEncodeChars[j] = true;\n }\n \n // Use decode trie to recursively fill out encode tables.\n this._fillEncodeTable(0, 0, skipEncodeChars);\n\n // Add more encoding pairs when needed.\n if (codecOptions.encodeAdd) {\n for (var uChar in codecOptions.encodeAdd)\n if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))\n this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);\n }\n\n this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];\n if (this.defCharSB === UNASSIGNED) this.defCharSB = \"?\".charCodeAt(0);\n\n\n // Load & create GB18030 tables when needed.\n if (typeof codecOptions.gb18030 === 'function') {\n this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.\n\n // Add GB18030 decode tables.\n var thirdByteNodeIdx = this.decodeTables.length;\n var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n var fourthByteNodeIdx = this.decodeTables.length;\n var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);\n\n for (var i = 0x81; i <= 0xFE; i++) {\n var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];\n var secondByteNode = this.decodeTables[secondByteNodeIdx];\n for (var j = 0x30; j <= 0x39; j++)\n secondByteNode[j] = NODE_START - thirdByteNodeIdx;\n }\n for (var i = 0x81; i <= 0xFE; i++)\n thirdByteNode[i] = NODE_START - fourthByteNodeIdx;\n for (var i = 0x30; i <= 0x39; i++)\n fourthByteNode[i] = GB18030_CODE\n } \n}\n\nDBCSCodec.prototype.encoder = DBCSEncoder;\nDBCSCodec.prototype.decoder = DBCSDecoder;\n\n// Decoder helpers\nDBCSCodec.prototype._getDecodeTrieNode = function(addr) {\n var bytes = [];\n for (; addr > 0; addr >>= 8)\n bytes.push(addr & 0xFF);\n if (bytes.length == 0)\n bytes.push(0);\n\n var node = this.decodeTables[0];\n for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.\n var val = node[bytes[i]];\n\n if (val == UNASSIGNED) { // Create new node.\n node[bytes[i]] = NODE_START - this.decodeTables.length;\n this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));\n }\n else if (val <= NODE_START) { // Existing node.\n node = this.decodeTables[NODE_START - val];\n }\n else\n throw new Error(\"Overwrite byte in \" + this.encodingName + \", addr: \" + addr.toString(16));\n }\n return node;\n}\n\n\nDBCSCodec.prototype._addDecodeChunk = function(chunk) {\n // First element of chunk is the hex mbcs code where we start.\n var curAddr = parseInt(chunk[0], 16);\n\n // Choose the decoding node where we'll write our chars.\n var writeTable = this._getDecodeTrieNode(curAddr);\n curAddr = curAddr & 0xFF;\n\n // Write all other elements of the chunk to the table.\n for (var k = 1; k < chunk.length; k++) {\n var part = chunk[k];\n if (typeof part === \"string\") { // String, write as-is.\n for (var l = 0; l < part.length;) {\n var code = part.charCodeAt(l++);\n if (0xD800 <= code && code < 0xDC00) { // Decode surrogate\n var codeTrail = part.charCodeAt(l++);\n if (0xDC00 <= codeTrail && codeTrail < 0xE000)\n writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);\n else\n throw new Error(\"Incorrect surrogate pair in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)\n var len = 0xFFF - code + 2;\n var seq = [];\n for (var m = 0; m < len; m++)\n seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.\n\n writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;\n this.decodeTableSeq.push(seq);\n }\n else\n writeTable[curAddr++] = code; // Basic char\n }\n } \n else if (typeof part === \"number\") { // Integer, meaning increasing sequence starting with prev character.\n var charCode = writeTable[curAddr - 1] + 1;\n for (var l = 0; l < part; l++)\n writeTable[curAddr++] = charCode++;\n }\n else\n throw new Error(\"Incorrect type '\" + typeof part + \"' given in \" + this.encodingName + \" at chunk \" + chunk[0]);\n }\n if (curAddr > 0xFF)\n throw new Error(\"Incorrect chunk in \" + this.encodingName + \" at addr \" + chunk[0] + \": too long\" + curAddr);\n}\n\n// Encoder helpers\nDBCSCodec.prototype._getEncodeBucket = function(uCode) {\n var high = uCode >> 8; // This could be > 0xFF because of astral characters.\n if (this.encodeTable[high] === undefined)\n this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.\n return this.encodeTable[high];\n}\n\nDBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n if (bucket[low] <= SEQ_START)\n this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.\n else if (bucket[low] == UNASSIGNED)\n bucket[low] = dbcsCode;\n}\n\nDBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {\n \n // Get the root of character tree according to first character of the sequence.\n var uCode = seq[0];\n var bucket = this._getEncodeBucket(uCode);\n var low = uCode & 0xFF;\n\n var node;\n if (bucket[low] <= SEQ_START) {\n // There's already a sequence with - use it.\n node = this.encodeTableSeq[SEQ_START-bucket[low]];\n }\n else {\n // There was no sequence object - allocate a new one.\n node = {};\n if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.\n bucket[low] = SEQ_START - this.encodeTableSeq.length;\n this.encodeTableSeq.push(node);\n }\n\n // Traverse the character tree, allocating new nodes as needed.\n for (var j = 1; j < seq.length-1; j++) {\n var oldVal = node[uCode];\n if (typeof oldVal === 'object')\n node = oldVal;\n else {\n node = node[uCode] = {}\n if (oldVal !== undefined)\n node[DEF_CHAR] = oldVal\n }\n }\n\n // Set the leaf to given dbcsCode.\n uCode = seq[seq.length-1];\n node[uCode] = dbcsCode;\n}\n\nDBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {\n var node = this.decodeTables[nodeIdx];\n for (var i = 0; i < 0x100; i++) {\n var uCode = node[i];\n var mbCode = prefix + i;\n if (skipEncodeChars[mbCode])\n continue;\n\n if (uCode >= 0)\n this._setEncodeChar(uCode, mbCode);\n else if (uCode <= NODE_START)\n this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);\n else if (uCode <= SEQ_START)\n this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);\n }\n}\n\n\n\n// == Encoder ==================================================================\n\nfunction DBCSEncoder(options, codec) {\n // Encoder state\n this.leadSurrogate = -1;\n this.seqObj = undefined;\n \n // Static data\n this.encodeTable = codec.encodeTable;\n this.encodeTableSeq = codec.encodeTableSeq;\n this.defaultCharSingleByte = codec.defCharSB;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSEncoder.prototype.write = function(str) {\n var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),\n leadSurrogate = this.leadSurrogate,\n seqObj = this.seqObj, nextChar = -1,\n i = 0, j = 0;\n\n while (true) {\n // 0. Get next character.\n if (nextChar === -1) {\n if (i == str.length) break;\n var uCode = str.charCodeAt(i++);\n }\n else {\n var uCode = nextChar;\n nextChar = -1; \n }\n\n // 1. Handle surrogates.\n if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.\n if (uCode < 0xDC00) { // We've got lead surrogate.\n if (leadSurrogate === -1) {\n leadSurrogate = uCode;\n continue;\n } else {\n leadSurrogate = uCode;\n // Double lead surrogate found.\n uCode = UNASSIGNED;\n }\n } else { // We've got trail surrogate.\n if (leadSurrogate !== -1) {\n uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);\n leadSurrogate = -1;\n } else {\n // Incomplete surrogate pair - only trail surrogate found.\n uCode = UNASSIGNED;\n }\n \n }\n }\n else if (leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.\n leadSurrogate = -1;\n }\n\n // 2. Convert uCode character.\n var dbcsCode = UNASSIGNED;\n if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence\n var resCode = seqObj[uCode];\n if (typeof resCode === 'object') { // Sequence continues.\n seqObj = resCode;\n continue;\n\n } else if (typeof resCode == 'number') { // Sequence finished. Write it.\n dbcsCode = resCode;\n\n } else if (resCode == undefined) { // Current character is not part of the sequence.\n\n // Try default character for this sequence\n resCode = seqObj[DEF_CHAR];\n if (resCode !== undefined) {\n dbcsCode = resCode; // Found. Write it.\n nextChar = uCode; // Current character will be written too in the next iteration.\n\n } else {\n // TODO: What if we have no default? (resCode == undefined)\n // Then, we should write first char of the sequence as-is and try the rest recursively.\n // Didn't do it for now because no encoding has this situation yet.\n // Currently, just skip the sequence and write current char.\n }\n }\n seqObj = undefined;\n }\n else if (uCode >= 0) { // Regular character\n var subtable = this.encodeTable[uCode >> 8];\n if (subtable !== undefined)\n dbcsCode = subtable[uCode & 0xFF];\n \n if (dbcsCode <= SEQ_START) { // Sequence start\n seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];\n continue;\n }\n\n if (dbcsCode == UNASSIGNED && this.gb18030) {\n // Use GB18030 algorithm to find character(s) to write.\n var idx = findIdx(this.gb18030.uChars, uCode);\n if (idx != -1) {\n var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;\n newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;\n newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;\n newBuf[j++] = 0x30 + dbcsCode;\n continue;\n }\n }\n }\n\n // 3. Write dbcsCode character.\n if (dbcsCode === UNASSIGNED)\n dbcsCode = this.defaultCharSingleByte;\n \n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else if (dbcsCode < 0x10000) {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n else {\n newBuf[j++] = dbcsCode >> 16;\n newBuf[j++] = (dbcsCode >> 8) & 0xFF;\n newBuf[j++] = dbcsCode & 0xFF;\n }\n }\n\n this.seqObj = seqObj;\n this.leadSurrogate = leadSurrogate;\n return newBuf.slice(0, j);\n}\n\nDBCSEncoder.prototype.end = function() {\n if (this.leadSurrogate === -1 && this.seqObj === undefined)\n return; // All clean. Most often case.\n\n var newBuf = Buffer.alloc(10), j = 0;\n\n if (this.seqObj) { // We're in the sequence.\n var dbcsCode = this.seqObj[DEF_CHAR];\n if (dbcsCode !== undefined) { // Write beginning of the sequence.\n if (dbcsCode < 0x100) {\n newBuf[j++] = dbcsCode;\n }\n else {\n newBuf[j++] = dbcsCode >> 8; // high byte\n newBuf[j++] = dbcsCode & 0xFF; // low byte\n }\n } else {\n // See todo above.\n }\n this.seqObj = undefined;\n }\n\n if (this.leadSurrogate !== -1) {\n // Incomplete surrogate pair - only lead surrogate found.\n newBuf[j++] = this.defaultCharSingleByte;\n this.leadSurrogate = -1;\n }\n \n return newBuf.slice(0, j);\n}\n\n// Export for testing\nDBCSEncoder.prototype.findIdx = findIdx;\n\n\n// == Decoder ==================================================================\n\nfunction DBCSDecoder(options, codec) {\n // Decoder state\n this.nodeIdx = 0;\n this.prevBuf = Buffer.alloc(0);\n\n // Static data\n this.decodeTables = codec.decodeTables;\n this.decodeTableSeq = codec.decodeTableSeq;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n this.gb18030 = codec.gb18030;\n}\n\nDBCSDecoder.prototype.write = function(buf) {\n var newBuf = Buffer.alloc(buf.length*2),\n nodeIdx = this.nodeIdx, \n prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,\n seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.\n uCode;\n\n if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.\n prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);\n \n for (var i = 0, j = 0; i < buf.length; i++) {\n var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];\n\n // Lookup in current trie node.\n var uCode = this.decodeTables[nodeIdx][curByte];\n\n if (uCode >= 0) { \n // Normal character, just use it.\n }\n else if (uCode === UNASSIGNED) { // Unknown char.\n // TODO: Callback with seq.\n //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).\n uCode = this.defaultCharUnicode.charCodeAt(0);\n }\n else if (uCode === GB18030_CODE) {\n var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);\n var idx = findIdx(this.gb18030.gbChars, ptr);\n uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];\n }\n else if (uCode <= NODE_START) { // Go to next trie node.\n nodeIdx = NODE_START - uCode;\n continue;\n }\n else if (uCode <= SEQ_START) { // Output a sequence of chars.\n var seq = this.decodeTableSeq[SEQ_START - uCode];\n for (var k = 0; k < seq.length - 1; k++) {\n uCode = seq[k];\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n }\n uCode = seq[seq.length-1];\n }\n else\n throw new Error(\"iconv-lite internal error: invalid decoding table value \" + uCode + \" at \" + nodeIdx + \"/\" + curByte);\n\n // Write the character to buffer, handling higher planes using surrogate pair.\n if (uCode > 0xFFFF) { \n uCode -= 0x10000;\n var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);\n newBuf[j++] = uCodeLead & 0xFF;\n newBuf[j++] = uCodeLead >> 8;\n\n uCode = 0xDC00 + uCode % 0x400;\n }\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n\n // Reset trie node.\n nodeIdx = 0; seqStart = i+1;\n }\n\n this.nodeIdx = nodeIdx;\n this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);\n return newBuf.slice(0, j).toString('ucs2');\n}\n\nDBCSDecoder.prototype.end = function() {\n var ret = '';\n\n // Try to parse all remaining chars.\n while (this.prevBuf.length > 0) {\n // Skip 1 character in the buffer.\n ret += this.defaultCharUnicode;\n var buf = this.prevBuf.slice(1);\n\n // Parse remaining as usual.\n this.prevBuf = Buffer.alloc(0);\n this.nodeIdx = 0;\n if (buf.length > 0)\n ret += this.write(buf);\n }\n\n this.nodeIdx = 0;\n return ret;\n}\n\n// Binary search for GB18030. Returns largest i such that table[i] <= val.\nfunction findIdx(table, val) {\n if (table[0] > val)\n return -1;\n\n var l = 0, r = table.length;\n while (l < r-1) { // always table[l] <= val < table[r]\n var mid = l + Math.floor((r-l+1)/2);\n if (table[mid] <= val)\n l = mid;\n else\n r = mid;\n }\n return l;\n}\n\n","\"use strict\";\n\n// Description of supported double byte encodings and aliases.\n// Tables are not require()-d until they are needed to speed up library load.\n// require()-s are direct to support Browserify.\n\nmodule.exports = {\n \n // == Japanese/ShiftJIS ====================================================\n // All japanese encodings are based on JIS X set of standards:\n // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.\n // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. \n // Has several variations in 1978, 1983, 1990 and 1997.\n // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.\n // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.\n // 2 planes, first is superset of 0208, second - revised 0212.\n // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)\n\n // Byte encodings are:\n // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte\n // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.\n // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.\n // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.\n // 0x00-0x7F - lower part of 0201\n // 0x8E, 0xA1-0xDF - upper part of 0201\n // (0xA1-0xFE)x2 - 0208 plane (94x94).\n // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).\n // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.\n // Used as-is in ISO2022 family.\n // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, \n // 0201-1976 Roman, 0208-1978, 0208-1983.\n // * ISO2022-JP-1: Adds esc seq for 0212-1990.\n // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.\n // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.\n // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.\n //\n // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.\n //\n // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html\n\n 'shiftjis': {\n type: '_dbcs',\n table: function() { return require('./tables/shiftjis.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n encodeSkipVals: [{from: 0xED40, to: 0xF940}],\n },\n 'csshiftjis': 'shiftjis',\n 'mskanji': 'shiftjis',\n 'sjis': 'shiftjis',\n 'windows31j': 'shiftjis',\n 'ms31j': 'shiftjis',\n 'xsjis': 'shiftjis',\n 'windows932': 'shiftjis',\n 'ms932': 'shiftjis',\n '932': 'shiftjis',\n 'cp932': 'shiftjis',\n\n 'eucjp': {\n type: '_dbcs',\n table: function() { return require('./tables/eucjp.json') },\n encodeAdd: {'\\u00a5': 0x5C, '\\u203E': 0x7E},\n },\n\n // TODO: KDDI extension to Shift_JIS\n // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.\n // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.\n\n\n // == Chinese/GBK ==========================================================\n // http://en.wikipedia.org/wiki/GBK\n // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder\n\n // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936\n 'gb2312': 'cp936',\n 'gb231280': 'cp936',\n 'gb23121980': 'cp936',\n 'csgb2312': 'cp936',\n 'csiso58gb231280': 'cp936',\n 'euccn': 'cp936',\n\n // Microsoft's CP936 is a subset and approximation of GBK.\n 'windows936': 'cp936',\n 'ms936': 'cp936',\n '936': 'cp936',\n 'cp936': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json') },\n },\n\n // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.\n 'gbk': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n },\n 'xgbk': 'gbk',\n 'isoir58': 'gbk',\n\n // GB18030 is an algorithmic extension of GBK.\n // Main source: https://www.w3.org/TR/encoding/#gbk-encoder\n // http://icu-project.org/docs/papers/gb18030.html\n // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml\n // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0\n 'gb18030': {\n type: '_dbcs',\n table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },\n gb18030: function() { return require('./tables/gb18030-ranges.json') },\n encodeSkipVals: [0x80],\n encodeAdd: {'€': 0xA2E3},\n },\n\n 'chinese': 'gb18030',\n\n\n // == Korean ===============================================================\n // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.\n 'windows949': 'cp949',\n 'ms949': 'cp949',\n '949': 'cp949',\n 'cp949': {\n type: '_dbcs',\n table: function() { return require('./tables/cp949.json') },\n },\n\n 'cseuckr': 'cp949',\n 'csksc56011987': 'cp949',\n 'euckr': 'cp949',\n 'isoir149': 'cp949',\n 'korean': 'cp949',\n 'ksc56011987': 'cp949',\n 'ksc56011989': 'cp949',\n 'ksc5601': 'cp949',\n\n\n // == Big5/Taiwan/Hong Kong ================================================\n // There are lots of tables for Big5 and cp950. Please see the following links for history:\n // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html\n // Variations, in roughly number of defined chars:\n // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT\n // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/\n // * Big5-2003 (Taiwan standard) almost superset of cp950.\n // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.\n // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. \n // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.\n // Plus, it has 4 combining sequences.\n // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299\n // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.\n // Implementations are not consistent within browsers; sometimes labeled as just big5.\n // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.\n // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31\n // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.\n // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt\n // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt\n // \n // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder\n // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.\n\n 'windows950': 'cp950',\n 'ms950': 'cp950',\n '950': 'cp950',\n 'cp950': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json') },\n },\n\n // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.\n 'big5': 'big5hkscs',\n 'big5hkscs': {\n type: '_dbcs',\n table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },\n encodeSkipVals: [0xa2cc],\n },\n\n 'cnbig5': 'big5hkscs',\n 'csbig5': 'big5hkscs',\n 'xxbig5': 'big5hkscs',\n};\n","\"use strict\";\n\n// Update this array if you add/rename/remove files in this directory.\n// We support Browserify by skipping automatic module discovery and requiring modules directly.\nvar modules = [\n require(\"./internal\"),\n require(\"./utf16\"),\n require(\"./utf7\"),\n require(\"./sbcs-codec\"),\n require(\"./sbcs-data\"),\n require(\"./sbcs-data-generated\"),\n require(\"./dbcs-codec\"),\n require(\"./dbcs-data\"),\n];\n\n// Put all encoding/alias/codec definitions to single object and export it. \nfor (var i = 0; i < modules.length; i++) {\n var module = modules[i];\n for (var enc in module)\n if (Object.prototype.hasOwnProperty.call(module, enc))\n exports[enc] = module[enc];\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Export Node.js internal encodings.\n\nmodule.exports = {\n // Encodings\n utf8: { type: \"_internal\", bomAware: true},\n cesu8: { type: \"_internal\", bomAware: true},\n unicode11utf8: \"utf8\",\n\n ucs2: { type: \"_internal\", bomAware: true},\n utf16le: \"ucs2\",\n\n binary: { type: \"_internal\" },\n base64: { type: \"_internal\" },\n hex: { type: \"_internal\" },\n\n // Codec.\n _internal: InternalCodec,\n};\n\n//------------------------------------------------------------------------------\n\nfunction InternalCodec(codecOptions, iconv) {\n this.enc = codecOptions.encodingName;\n this.bomAware = codecOptions.bomAware;\n\n if (this.enc === \"base64\")\n this.encoder = InternalEncoderBase64;\n else if (this.enc === \"cesu8\") {\n this.enc = \"utf8\"; // Use utf8 for decoding.\n this.encoder = InternalEncoderCesu8;\n\n // Add decoder for versions of Node not supporting CESU-8\n if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {\n this.decoder = InternalDecoderCesu8;\n this.defaultCharUnicode = iconv.defaultCharUnicode;\n }\n }\n}\n\nInternalCodec.prototype.encoder = InternalEncoder;\nInternalCodec.prototype.decoder = InternalDecoder;\n\n//------------------------------------------------------------------------------\n\n// We use node.js internal decoder. Its signature is the same as ours.\nvar StringDecoder = require('string_decoder').StringDecoder;\n\nif (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.\n StringDecoder.prototype.end = function() {};\n\n\nfunction InternalDecoder(options, codec) {\n StringDecoder.call(this, codec.enc);\n}\n\nInternalDecoder.prototype = StringDecoder.prototype;\n\n\n//------------------------------------------------------------------------------\n// Encoder is mostly trivial\n\nfunction InternalEncoder(options, codec) {\n this.enc = codec.enc;\n}\n\nInternalEncoder.prototype.write = function(str) {\n return Buffer.from(str, this.enc);\n}\n\nInternalEncoder.prototype.end = function() {\n}\n\n\n//------------------------------------------------------------------------------\n// Except base64 encoder, which must keep its state.\n\nfunction InternalEncoderBase64(options, codec) {\n this.prevStr = '';\n}\n\nInternalEncoderBase64.prototype.write = function(str) {\n str = this.prevStr + str;\n var completeQuads = str.length - (str.length % 4);\n this.prevStr = str.slice(completeQuads);\n str = str.slice(0, completeQuads);\n\n return Buffer.from(str, \"base64\");\n}\n\nInternalEncoderBase64.prototype.end = function() {\n return Buffer.from(this.prevStr, \"base64\");\n}\n\n\n//------------------------------------------------------------------------------\n// CESU-8 encoder is also special.\n\nfunction InternalEncoderCesu8(options, codec) {\n}\n\nInternalEncoderCesu8.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length * 3), bufIdx = 0;\n for (var i = 0; i < str.length; i++) {\n var charCode = str.charCodeAt(i);\n // Naive implementation, but it works because CESU-8 is especially easy\n // to convert from UTF-16 (which all JS strings are encoded in).\n if (charCode < 0x80)\n buf[bufIdx++] = charCode;\n else if (charCode < 0x800) {\n buf[bufIdx++] = 0xC0 + (charCode >>> 6);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n else { // charCode will always be < 0x10000 in javascript.\n buf[bufIdx++] = 0xE0 + (charCode >>> 12);\n buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);\n buf[bufIdx++] = 0x80 + (charCode & 0x3f);\n }\n }\n return buf.slice(0, bufIdx);\n}\n\nInternalEncoderCesu8.prototype.end = function() {\n}\n\n//------------------------------------------------------------------------------\n// CESU-8 decoder is not implemented in Node v4.0+\n\nfunction InternalDecoderCesu8(options, codec) {\n this.acc = 0;\n this.contBytes = 0;\n this.accBytes = 0;\n this.defaultCharUnicode = codec.defaultCharUnicode;\n}\n\nInternalDecoderCesu8.prototype.write = function(buf) {\n var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, \n res = '';\n for (var i = 0; i < buf.length; i++) {\n var curByte = buf[i];\n if ((curByte & 0xC0) !== 0x80) { // Leading byte\n if (contBytes > 0) { // Previous code is invalid\n res += this.defaultCharUnicode;\n contBytes = 0;\n }\n\n if (curByte < 0x80) { // Single-byte code\n res += String.fromCharCode(curByte);\n } else if (curByte < 0xE0) { // Two-byte code\n acc = curByte & 0x1F;\n contBytes = 1; accBytes = 1;\n } else if (curByte < 0xF0) { // Three-byte code\n acc = curByte & 0x0F;\n contBytes = 2; accBytes = 1;\n } else { // Four or more are not supported for CESU-8.\n res += this.defaultCharUnicode;\n }\n } else { // Continuation byte\n if (contBytes > 0) { // We're waiting for it.\n acc = (acc << 6) | (curByte & 0x3f);\n contBytes--; accBytes++;\n if (contBytes === 0) {\n // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)\n if (accBytes === 2 && acc < 0x80 && acc > 0)\n res += this.defaultCharUnicode;\n else if (accBytes === 3 && acc < 0x800)\n res += this.defaultCharUnicode;\n else\n // Actually add character.\n res += String.fromCharCode(acc);\n }\n } else { // Unexpected continuation byte\n res += this.defaultCharUnicode;\n }\n }\n }\n this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;\n return res;\n}\n\nInternalDecoderCesu8.prototype.end = function() {\n var res = 0;\n if (this.contBytes > 0)\n res += this.defaultCharUnicode;\n return res;\n}\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that\n// correspond to encoded bytes (if 128 - then lower half is ASCII). \n\nexports._sbcs = SBCSCodec;\nfunction SBCSCodec(codecOptions, iconv) {\n if (!codecOptions)\n throw new Error(\"SBCS codec is called without the data.\")\n \n // Prepare char buffer for decoding.\n if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))\n throw new Error(\"Encoding '\"+codecOptions.type+\"' has incorrect 'chars' (must be of len 128 or 256)\");\n \n if (codecOptions.chars.length === 128) {\n var asciiString = \"\";\n for (var i = 0; i < 128; i++)\n asciiString += String.fromCharCode(i);\n codecOptions.chars = asciiString + codecOptions.chars;\n }\n\n this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');\n \n // Encoding buffer.\n var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));\n\n for (var i = 0; i < codecOptions.chars.length; i++)\n encodeBuf[codecOptions.chars.charCodeAt(i)] = i;\n\n this.encodeBuf = encodeBuf;\n}\n\nSBCSCodec.prototype.encoder = SBCSEncoder;\nSBCSCodec.prototype.decoder = SBCSDecoder;\n\n\nfunction SBCSEncoder(options, codec) {\n this.encodeBuf = codec.encodeBuf;\n}\n\nSBCSEncoder.prototype.write = function(str) {\n var buf = Buffer.alloc(str.length);\n for (var i = 0; i < str.length; i++)\n buf[i] = this.encodeBuf[str.charCodeAt(i)];\n \n return buf;\n}\n\nSBCSEncoder.prototype.end = function() {\n}\n\n\nfunction SBCSDecoder(options, codec) {\n this.decodeBuf = codec.decodeBuf;\n}\n\nSBCSDecoder.prototype.write = function(buf) {\n // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.\n var decodeBuf = this.decodeBuf;\n var newBuf = Buffer.alloc(buf.length*2);\n var idx1 = 0, idx2 = 0;\n for (var i = 0; i < buf.length; i++) {\n idx1 = buf[i]*2; idx2 = i*2;\n newBuf[idx2] = decodeBuf[idx1];\n newBuf[idx2+1] = decodeBuf[idx1+1];\n }\n return newBuf.toString('ucs2');\n}\n\nSBCSDecoder.prototype.end = function() {\n}\n","\"use strict\";\n\n// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.\nmodule.exports = {\n \"437\": \"cp437\",\n \"737\": \"cp737\",\n \"775\": \"cp775\",\n \"850\": \"cp850\",\n \"852\": \"cp852\",\n \"855\": \"cp855\",\n \"856\": \"cp856\",\n \"857\": \"cp857\",\n \"858\": \"cp858\",\n \"860\": \"cp860\",\n \"861\": \"cp861\",\n \"862\": \"cp862\",\n \"863\": \"cp863\",\n \"864\": \"cp864\",\n \"865\": \"cp865\",\n \"866\": \"cp866\",\n \"869\": \"cp869\",\n \"874\": \"windows874\",\n \"922\": \"cp922\",\n \"1046\": \"cp1046\",\n \"1124\": \"cp1124\",\n \"1125\": \"cp1125\",\n \"1129\": \"cp1129\",\n \"1133\": \"cp1133\",\n \"1161\": \"cp1161\",\n \"1162\": \"cp1162\",\n \"1163\": \"cp1163\",\n \"1250\": \"windows1250\",\n \"1251\": \"windows1251\",\n \"1252\": \"windows1252\",\n \"1253\": \"windows1253\",\n \"1254\": \"windows1254\",\n \"1255\": \"windows1255\",\n \"1256\": \"windows1256\",\n \"1257\": \"windows1257\",\n \"1258\": \"windows1258\",\n \"28591\": \"iso88591\",\n \"28592\": \"iso88592\",\n \"28593\": \"iso88593\",\n \"28594\": \"iso88594\",\n \"28595\": \"iso88595\",\n \"28596\": \"iso88596\",\n \"28597\": \"iso88597\",\n \"28598\": \"iso88598\",\n \"28599\": \"iso88599\",\n \"28600\": \"iso885910\",\n \"28601\": \"iso885911\",\n \"28603\": \"iso885913\",\n \"28604\": \"iso885914\",\n \"28605\": \"iso885915\",\n \"28606\": \"iso885916\",\n \"windows874\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"win874\": \"windows874\",\n \"cp874\": \"windows874\",\n \"windows1250\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"win1250\": \"windows1250\",\n \"cp1250\": \"windows1250\",\n \"windows1251\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"win1251\": \"windows1251\",\n \"cp1251\": \"windows1251\",\n \"windows1252\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"win1252\": \"windows1252\",\n \"cp1252\": \"windows1252\",\n \"windows1253\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"win1253\": \"windows1253\",\n \"cp1253\": \"windows1253\",\n \"windows1254\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"win1254\": \"windows1254\",\n \"cp1254\": \"windows1254\",\n \"windows1255\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"win1255\": \"windows1255\",\n \"cp1255\": \"windows1255\",\n \"windows1256\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے\"\n },\n \"win1256\": \"windows1256\",\n \"cp1256\": \"windows1256\",\n \"windows1257\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙\"\n },\n \"win1257\": \"windows1257\",\n \"cp1257\": \"windows1257\",\n \"windows1258\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"win1258\": \"windows1258\",\n \"cp1258\": \"windows1258\",\n \"iso88591\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28591\": \"iso88591\",\n \"iso88592\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙\"\n },\n \"cp28592\": \"iso88592\",\n \"iso88593\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙\"\n },\n \"cp28593\": \"iso88593\",\n \"iso88594\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙\"\n },\n \"cp28594\": \"iso88594\",\n \"iso88595\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ\"\n },\n \"cp28595\": \"iso88595\",\n \"iso88596\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������\"\n },\n \"cp28596\": \"iso88596\",\n \"iso88597\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�\"\n },\n \"cp28597\": \"iso88597\",\n \"iso88598\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�\"\n },\n \"cp28598\": \"iso88598\",\n \"iso88599\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ\"\n },\n \"cp28599\": \"iso88599\",\n \"iso885910\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ\"\n },\n \"cp28600\": \"iso885910\",\n \"iso885911\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"cp28601\": \"iso885911\",\n \"iso885913\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’\"\n },\n \"cp28603\": \"iso885913\",\n \"iso885914\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ\"\n },\n \"cp28604\": \"iso885914\",\n \"iso885915\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"cp28605\": \"iso885915\",\n \"iso885916\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ\"\n },\n \"cp28606\": \"iso885916\",\n \"cp437\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm437\": \"cp437\",\n \"csibm437\": \"cp437\",\n \"cp737\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ \"\n },\n \"ibm737\": \"cp737\",\n \"csibm737\": \"cp737\",\n \"cp775\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ \"\n },\n \"ibm775\": \"cp775\",\n \"csibm775\": \"cp775\",\n \"cp850\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm850\": \"cp850\",\n \"csibm850\": \"cp850\",\n \"cp852\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ \"\n },\n \"ibm852\": \"cp852\",\n \"csibm852\": \"cp852\",\n \"cp855\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ \"\n },\n \"ibm855\": \"cp855\",\n \"csibm855\": \"cp855\",\n \"cp856\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm856\": \"cp856\",\n \"csibm856\": \"cp856\",\n \"cp857\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm857\": \"cp857\",\n \"csibm857\": \"cp857\",\n \"cp858\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ \"\n },\n \"ibm858\": \"cp858\",\n \"csibm858\": \"cp858\",\n \"cp860\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm860\": \"cp860\",\n \"csibm860\": \"cp860\",\n \"cp861\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm861\": \"cp861\",\n \"csibm861\": \"cp861\",\n \"cp862\": {\n \"type\": \"_sbcs\",\n \"chars\": \"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm862\": \"cp862\",\n \"csibm862\": \"cp862\",\n \"cp863\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm863\": \"cp863\",\n \"csibm863\": \"cp863\",\n \"cp864\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�\"\n },\n \"ibm864\": \"cp864\",\n \"csibm864\": \"cp864\",\n \"cp865\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n \"ibm865\": \"cp865\",\n \"csibm865\": \"cp865\",\n \"cp866\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ \"\n },\n \"ibm866\": \"cp866\",\n \"csibm866\": \"cp866\",\n \"cp869\": {\n \"type\": \"_sbcs\",\n \"chars\": \"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ \"\n },\n \"ibm869\": \"cp869\",\n \"csibm869\": \"cp869\",\n \"cp922\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ\"\n },\n \"ibm922\": \"cp922\",\n \"csibm922\": \"cp922\",\n \"cp1046\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�\"\n },\n \"ibm1046\": \"cp1046\",\n \"csibm1046\": \"cp1046\",\n \"cp1124\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ\"\n },\n \"ibm1124\": \"cp1124\",\n \"csibm1124\": \"cp1124\",\n \"cp1125\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ \"\n },\n \"ibm1125\": \"cp1125\",\n \"csibm1125\": \"cp1125\",\n \"cp1129\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1129\": \"cp1129\",\n \"csibm1129\": \"cp1129\",\n \"cp1133\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�\"\n },\n \"ibm1133\": \"cp1133\",\n \"csibm1133\": \"cp1133\",\n \"cp1161\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ \"\n },\n \"ibm1161\": \"cp1161\",\n \"csibm1161\": \"cp1161\",\n \"cp1162\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n },\n \"ibm1162\": \"cp1162\",\n \"csibm1162\": \"cp1162\",\n \"cp1163\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ\"\n },\n \"ibm1163\": \"cp1163\",\n \"csibm1163\": \"cp1163\",\n \"maccroatian\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ\"\n },\n \"maccyrillic\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"macgreek\": {\n \"type\": \"_sbcs\",\n \"chars\": \"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�\"\n },\n \"maciceland\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macroman\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macromania\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macthai\": {\n \"type\": \"_sbcs\",\n \"chars\": \"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����\"\n },\n \"macturkish\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"macukraine\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤\"\n },\n \"koi8r\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8u\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8ru\": {\n \"type\": \"_sbcs\",\n \"chars\": \"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"koi8t\": {\n \"type\": \"_sbcs\",\n \"chars\": \"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ\"\n },\n \"armscii8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�\"\n },\n \"rk1048\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"tcvn\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000ÚỤ\\u0003ỪỬỮ\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010ỨỰỲỶỸÝỴ\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ\"\n },\n \"georgianacademy\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"georgianps\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\"\n },\n \"pt154\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\"\n },\n \"viscii\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001Ẳ\\u0003\\u0004ẴẪ\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013Ỷ\\u0015\\u0016\\u0017\\u0018Ỹ\\u001a\\u001b\\u001c\\u001dỴ\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ\"\n },\n \"iso646cn\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"iso646jp\": {\n \"type\": \"_sbcs\",\n \"chars\": \"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"hproman8\": {\n \"type\": \"_sbcs\",\n \"chars\": \"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�\"\n },\n \"macintosh\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ\"\n },\n \"ascii\": {\n \"type\": \"_sbcs\",\n \"chars\": \"��������������������������������������������������������������������������������������������������������������������������������\"\n },\n \"tis620\": {\n \"type\": \"_sbcs\",\n \"chars\": \"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����\"\n }\n}","\"use strict\";\n\n// Manually added data to be used by sbcs codec in addition to generated one.\n\nmodule.exports = {\n // Not supported by iconv, not sure why.\n \"10029\": \"maccenteuro\",\n \"maccenteuro\": {\n \"type\": \"_sbcs\",\n \"chars\": \"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ\"\n },\n\n \"808\": \"cp808\",\n \"ibm808\": \"cp808\",\n \"cp808\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ \"\n },\n\n \"mik\": {\n \"type\": \"_sbcs\",\n \"chars\": \"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \"\n },\n\n // Aliases of generated encodings.\n \"ascii8bit\": \"ascii\",\n \"usascii\": \"ascii\",\n \"ansix34\": \"ascii\",\n \"ansix341968\": \"ascii\",\n \"ansix341986\": \"ascii\",\n \"csascii\": \"ascii\",\n \"cp367\": \"ascii\",\n \"ibm367\": \"ascii\",\n \"isoir6\": \"ascii\",\n \"iso646us\": \"ascii\",\n \"iso646irv\": \"ascii\",\n \"us\": \"ascii\",\n\n \"latin1\": \"iso88591\",\n \"latin2\": \"iso88592\",\n \"latin3\": \"iso88593\",\n \"latin4\": \"iso88594\",\n \"latin5\": \"iso88599\",\n \"latin6\": \"iso885910\",\n \"latin7\": \"iso885913\",\n \"latin8\": \"iso885914\",\n \"latin9\": \"iso885915\",\n \"latin10\": \"iso885916\",\n\n \"csisolatin1\": \"iso88591\",\n \"csisolatin2\": \"iso88592\",\n \"csisolatin3\": \"iso88593\",\n \"csisolatin4\": \"iso88594\",\n \"csisolatincyrillic\": \"iso88595\",\n \"csisolatinarabic\": \"iso88596\",\n \"csisolatingreek\" : \"iso88597\",\n \"csisolatinhebrew\": \"iso88598\",\n \"csisolatin5\": \"iso88599\",\n \"csisolatin6\": \"iso885910\",\n\n \"l1\": \"iso88591\",\n \"l2\": \"iso88592\",\n \"l3\": \"iso88593\",\n \"l4\": \"iso88594\",\n \"l5\": \"iso88599\",\n \"l6\": \"iso885910\",\n \"l7\": \"iso885913\",\n \"l8\": \"iso885914\",\n \"l9\": \"iso885915\",\n \"l10\": \"iso885916\",\n\n \"isoir14\": \"iso646jp\",\n \"isoir57\": \"iso646cn\",\n \"isoir100\": \"iso88591\",\n \"isoir101\": \"iso88592\",\n \"isoir109\": \"iso88593\",\n \"isoir110\": \"iso88594\",\n \"isoir144\": \"iso88595\",\n \"isoir127\": \"iso88596\",\n \"isoir126\": \"iso88597\",\n \"isoir138\": \"iso88598\",\n \"isoir148\": \"iso88599\",\n \"isoir157\": \"iso885910\",\n \"isoir166\": \"tis620\",\n \"isoir179\": \"iso885913\",\n \"isoir199\": \"iso885914\",\n \"isoir203\": \"iso885915\",\n \"isoir226\": \"iso885916\",\n\n \"cp819\": \"iso88591\",\n \"ibm819\": \"iso88591\",\n\n \"cyrillic\": \"iso88595\",\n\n \"arabic\": \"iso88596\",\n \"arabic8\": \"iso88596\",\n \"ecma114\": \"iso88596\",\n \"asmo708\": \"iso88596\",\n\n \"greek\" : \"iso88597\",\n \"greek8\" : \"iso88597\",\n \"ecma118\" : \"iso88597\",\n \"elot928\" : \"iso88597\",\n\n \"hebrew\": \"iso88598\",\n \"hebrew8\": \"iso88598\",\n\n \"turkish\": \"iso88599\",\n \"turkish8\": \"iso88599\",\n\n \"thai\": \"iso885911\",\n \"thai8\": \"iso885911\",\n\n \"celtic\": \"iso885914\",\n \"celtic8\": \"iso885914\",\n \"isoceltic\": \"iso885914\",\n\n \"tis6200\": \"tis620\",\n \"tis62025291\": \"tis620\",\n \"tis62025330\": \"tis620\",\n\n \"10000\": \"macroman\",\n \"10006\": \"macgreek\",\n \"10007\": \"maccyrillic\",\n \"10079\": \"maciceland\",\n \"10081\": \"macturkish\",\n\n \"cspc8codepage437\": \"cp437\",\n \"cspc775baltic\": \"cp775\",\n \"cspc850multilingual\": \"cp850\",\n \"cspcp852\": \"cp852\",\n \"cspc862latinhebrew\": \"cp862\",\n \"cpgr\": \"cp869\",\n\n \"msee\": \"cp1250\",\n \"mscyrl\": \"cp1251\",\n \"msansi\": \"cp1252\",\n \"msgreek\": \"cp1253\",\n \"msturk\": \"cp1254\",\n \"mshebr\": \"cp1255\",\n \"msarab\": \"cp1256\",\n \"winbaltrim\": \"cp1257\",\n\n \"cp20866\": \"koi8r\",\n \"20866\": \"koi8r\",\n \"ibm878\": \"koi8r\",\n \"cskoi8r\": \"koi8r\",\n\n \"cp21866\": \"koi8u\",\n \"21866\": \"koi8u\",\n \"ibm1168\": \"koi8u\",\n\n \"strk10482002\": \"rk1048\",\n\n \"tcvn5712\": \"tcvn\",\n \"tcvn57121\": \"tcvn\",\n\n \"gb198880\": \"iso646cn\",\n \"cn\": \"iso646cn\",\n\n \"csiso14jisc6220ro\": \"iso646jp\",\n \"jisc62201969ro\": \"iso646jp\",\n \"jp\": \"iso646jp\",\n\n \"cshproman8\": \"hproman8\",\n \"r8\": \"hproman8\",\n \"roman8\": \"hproman8\",\n \"xroman8\": \"hproman8\",\n \"ibm1051\": \"hproman8\",\n\n \"mac\": \"macintosh\",\n \"csmacintosh\": \"macintosh\",\n};\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js\n\n// == UTF16-BE codec. ==========================================================\n\nexports.utf16be = Utf16BECodec;\nfunction Utf16BECodec() {\n}\n\nUtf16BECodec.prototype.encoder = Utf16BEEncoder;\nUtf16BECodec.prototype.decoder = Utf16BEDecoder;\nUtf16BECodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf16BEEncoder() {\n}\n\nUtf16BEEncoder.prototype.write = function(str) {\n var buf = Buffer.from(str, 'ucs2');\n for (var i = 0; i < buf.length; i += 2) {\n var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;\n }\n return buf;\n}\n\nUtf16BEEncoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf16BEDecoder() {\n this.overflowByte = -1;\n}\n\nUtf16BEDecoder.prototype.write = function(buf) {\n if (buf.length == 0)\n return '';\n\n var buf2 = Buffer.alloc(buf.length + 1),\n i = 0, j = 0;\n\n if (this.overflowByte !== -1) {\n buf2[0] = buf[0];\n buf2[1] = this.overflowByte;\n i = 1; j = 2;\n }\n\n for (; i < buf.length-1; i += 2, j+= 2) {\n buf2[j] = buf[i+1];\n buf2[j+1] = buf[i];\n }\n\n this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;\n\n return buf2.slice(0, j).toString('ucs2');\n}\n\nUtf16BEDecoder.prototype.end = function() {\n}\n\n\n// == UTF-16 codec =============================================================\n// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.\n// Defaults to UTF-16LE, as it's prevalent and default in Node.\n// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le\n// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});\n\n// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).\n\nexports.utf16 = Utf16Codec;\nfunction Utf16Codec(codecOptions, iconv) {\n this.iconv = iconv;\n}\n\nUtf16Codec.prototype.encoder = Utf16Encoder;\nUtf16Codec.prototype.decoder = Utf16Decoder;\n\n\n// -- Encoding (pass-through)\n\nfunction Utf16Encoder(options, codec) {\n options = options || {};\n if (options.addBOM === undefined)\n options.addBOM = true;\n this.encoder = codec.iconv.getEncoder('utf-16le', options);\n}\n\nUtf16Encoder.prototype.write = function(str) {\n return this.encoder.write(str);\n}\n\nUtf16Encoder.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n// -- Decoding\n\nfunction Utf16Decoder(options, codec) {\n this.decoder = null;\n this.initialBytes = [];\n this.initialBytesLen = 0;\n\n this.options = options || {};\n this.iconv = codec.iconv;\n}\n\nUtf16Decoder.prototype.write = function(buf) {\n if (!this.decoder) {\n // Codec is not chosen yet. Accumulate initial bytes.\n this.initialBytes.push(buf);\n this.initialBytesLen += buf.length;\n \n if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)\n return '';\n\n // We have enough bytes -> detect endianness.\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n this.initialBytes.length = this.initialBytesLen = 0;\n }\n\n return this.decoder.write(buf);\n}\n\nUtf16Decoder.prototype.end = function() {\n if (!this.decoder) {\n var buf = Buffer.concat(this.initialBytes),\n encoding = detectEncoding(buf, this.options.defaultEncoding);\n this.decoder = this.iconv.getDecoder(encoding, this.options);\n\n var res = this.decoder.write(buf),\n trail = this.decoder.end();\n\n return trail ? (res + trail) : res;\n }\n return this.decoder.end();\n}\n\nfunction detectEncoding(buf, defaultEncoding) {\n var enc = defaultEncoding || 'utf-16le';\n\n if (buf.length >= 2) {\n // Check BOM.\n if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM\n enc = 'utf-16be';\n else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM\n enc = 'utf-16le';\n else {\n // No BOM found. Try to deduce encoding from initial content.\n // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.\n // So, we count ASCII as if it was LE or BE, and decide from that.\n var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions\n _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.\n\n for (var i = 0; i < _len; i += 2) {\n if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;\n if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;\n }\n\n if (asciiCharsBE > asciiCharsLE)\n enc = 'utf-16be';\n else if (asciiCharsBE < asciiCharsLE)\n enc = 'utf-16le';\n }\n }\n\n return enc;\n}\n\n\n","\"use strict\";\nvar Buffer = require(\"safer-buffer\").Buffer;\n\n// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152\n// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3\n\nexports.utf7 = Utf7Codec;\nexports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7\nfunction Utf7Codec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7Codec.prototype.encoder = Utf7Encoder;\nUtf7Codec.prototype.decoder = Utf7Decoder;\nUtf7Codec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nvar nonDirectChars = /[^A-Za-z0-9'\\(\\),-\\.\\/:\\? \\n\\r\\t]+/g;\n\nfunction Utf7Encoder(options, codec) {\n this.iconv = codec.iconv;\n}\n\nUtf7Encoder.prototype.write = function(str) {\n // Naive implementation.\n // Non-direct chars are encoded as \"+-\"; single \"+\" char is encoded as \"+-\".\n return Buffer.from(str.replace(nonDirectChars, function(chunk) {\n return \"+\" + (chunk === '+' ? '' : \n this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) \n + \"-\";\n }.bind(this)));\n}\n\nUtf7Encoder.prototype.end = function() {\n}\n\n\n// -- Decoding\n\nfunction Utf7Decoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64Regex = /[A-Za-z0-9\\/+]/;\nvar base64Chars = [];\nfor (var i = 0; i < 256; i++)\n base64Chars[i] = base64Regex.test(String.fromCharCode(i));\n\nvar plusChar = '+'.charCodeAt(0), \n minusChar = '-'.charCodeAt(0),\n andChar = '&'.charCodeAt(0);\n\nUtf7Decoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '+'\n if (buf[i] == plusChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64Chars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) {// \"+-\" -> \"+\"\n res += \"+\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString();\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus is absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString();\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7Decoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n// UTF-7-IMAP codec.\n// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)\n// Differences:\n// * Base64 part is started by \"&\" instead of \"+\"\n// * Direct characters are 0x20-0x7E, except \"&\" (0x26)\n// * In Base64, \",\" is used instead of \"/\"\n// * Base64 must not be used to represent direct characters.\n// * No implicit shift back from Base64 (should always end with '-')\n// * String must end in non-shifted position.\n// * \"-&\" while in base64 is not allowed.\n\n\nexports.utf7imap = Utf7IMAPCodec;\nfunction Utf7IMAPCodec(codecOptions, iconv) {\n this.iconv = iconv;\n};\n\nUtf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;\nUtf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;\nUtf7IMAPCodec.prototype.bomAware = true;\n\n\n// -- Encoding\n\nfunction Utf7IMAPEncoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = Buffer.alloc(6);\n this.base64AccumIdx = 0;\n}\n\nUtf7IMAPEncoder.prototype.write = function(str) {\n var inBase64 = this.inBase64,\n base64Accum = this.base64Accum,\n base64AccumIdx = this.base64AccumIdx,\n buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;\n\n for (var i = 0; i < str.length; i++) {\n var uChar = str.charCodeAt(i);\n if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.\n if (inBase64) {\n if (base64AccumIdx > 0) {\n bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n inBase64 = false;\n }\n\n if (!inBase64) {\n buf[bufIdx++] = uChar; // Write direct character\n\n if (uChar === andChar) // Ampersand -> '&-'\n buf[bufIdx++] = minusChar;\n }\n\n } else { // Non-direct character\n if (!inBase64) {\n buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.\n inBase64 = true;\n }\n if (inBase64) {\n base64Accum[base64AccumIdx++] = uChar >> 8;\n base64Accum[base64AccumIdx++] = uChar & 0xFF;\n\n if (base64AccumIdx == base64Accum.length) {\n bufIdx += buf.write(base64Accum.toString('base64').replace(/\\//g, ','), bufIdx);\n base64AccumIdx = 0;\n }\n }\n }\n }\n\n this.inBase64 = inBase64;\n this.base64AccumIdx = base64AccumIdx;\n\n return buf.slice(0, bufIdx);\n}\n\nUtf7IMAPEncoder.prototype.end = function() {\n var buf = Buffer.alloc(10), bufIdx = 0;\n if (this.inBase64) {\n if (this.base64AccumIdx > 0) {\n bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\\//g, ',').replace(/=+$/, ''), bufIdx);\n this.base64AccumIdx = 0;\n }\n\n buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.\n this.inBase64 = false;\n }\n\n return buf.slice(0, bufIdx);\n}\n\n\n// -- Decoding\n\nfunction Utf7IMAPDecoder(options, codec) {\n this.iconv = codec.iconv;\n this.inBase64 = false;\n this.base64Accum = '';\n}\n\nvar base64IMAPChars = base64Chars.slice();\nbase64IMAPChars[','.charCodeAt(0)] = true;\n\nUtf7IMAPDecoder.prototype.write = function(buf) {\n var res = \"\", lastI = 0,\n inBase64 = this.inBase64,\n base64Accum = this.base64Accum;\n\n // The decoder is more involved as we must handle chunks in stream.\n // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).\n\n for (var i = 0; i < buf.length; i++) {\n if (!inBase64) { // We're in direct mode.\n // Write direct chars until '&'\n if (buf[i] == andChar) {\n res += this.iconv.decode(buf.slice(lastI, i), \"ascii\"); // Write direct chars.\n lastI = i+1;\n inBase64 = true;\n }\n } else { // We decode base64.\n if (!base64IMAPChars[buf[i]]) { // Base64 ended.\n if (i == lastI && buf[i] == minusChar) { // \"&-\" -> \"&\"\n res += \"&\";\n } else {\n var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n if (buf[i] != minusChar) // Minus may be absorbed after base64.\n i--;\n\n lastI = i+1;\n inBase64 = false;\n base64Accum = '';\n }\n }\n }\n\n if (!inBase64) {\n res += this.iconv.decode(buf.slice(lastI), \"ascii\"); // Write direct chars.\n } else {\n var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');\n\n var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.\n base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.\n b64str = b64str.slice(0, canBeDecoded);\n\n res += this.iconv.decode(Buffer.from(b64str, 'base64'), \"utf16-be\");\n }\n\n this.inBase64 = inBase64;\n this.base64Accum = base64Accum;\n\n return res;\n}\n\nUtf7IMAPDecoder.prototype.end = function() {\n var res = \"\";\n if (this.inBase64 && this.base64Accum.length > 0)\n res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), \"utf16-be\");\n\n this.inBase64 = false;\n this.base64Accum = '';\n return res;\n}\n\n\n","\"use strict\";\n\nvar BOMChar = '\\uFEFF';\n\nexports.PrependBOM = PrependBOMWrapper\nfunction PrependBOMWrapper(encoder, options) {\n this.encoder = encoder;\n this.addBOM = true;\n}\n\nPrependBOMWrapper.prototype.write = function(str) {\n if (this.addBOM) {\n str = BOMChar + str;\n this.addBOM = false;\n }\n\n return this.encoder.write(str);\n}\n\nPrependBOMWrapper.prototype.end = function() {\n return this.encoder.end();\n}\n\n\n//------------------------------------------------------------------------------\n\nexports.StripBOM = StripBOMWrapper;\nfunction StripBOMWrapper(decoder, options) {\n this.decoder = decoder;\n this.pass = false;\n this.options = options || {};\n}\n\nStripBOMWrapper.prototype.write = function(buf) {\n var res = this.decoder.write(buf);\n if (this.pass || !res)\n return res;\n\n if (res[0] === BOMChar) {\n res = res.slice(1);\n if (typeof this.options.stripBOM === 'function')\n this.options.stripBOM();\n }\n\n this.pass = true;\n return res;\n}\n\nStripBOMWrapper.prototype.end = function() {\n return this.decoder.end();\n}\n\n","\"use strict\";\nvar Buffer = require(\"buffer\").Buffer;\n// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer\n\n// == Extend Node primitives to use iconv-lite =================================\n\nmodule.exports = function (iconv) {\n var original = undefined; // Place to keep original methods.\n\n // Node authors rewrote Buffer internals to make it compatible with\n // Uint8Array and we cannot patch key functions since then.\n // Note: this does use older Buffer API on a purpose\n iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);\n\n iconv.extendNodeEncodings = function extendNodeEncodings() {\n if (original) return;\n original = {};\n\n if (!iconv.supportsNodeEncodingsExtension) {\n console.error(\"ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node\");\n console.error(\"See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility\");\n return;\n }\n\n var nodeNativeEncodings = {\n 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, \n 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,\n };\n\n Buffer.isNativeEncoding = function(enc) {\n return enc && nodeNativeEncodings[enc.toLowerCase()];\n }\n\n // -- SlowBuffer -----------------------------------------------------------\n var SlowBuffer = require('buffer').SlowBuffer;\n\n original.SlowBufferToString = SlowBuffer.prototype.toString;\n SlowBuffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.SlowBufferWrite = SlowBuffer.prototype.write;\n SlowBuffer.prototype.write = function(string, offset, length, encoding) {\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.SlowBufferWrite.call(this, string, offset, length, encoding);\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n }\n\n // -- Buffer ---------------------------------------------------------------\n\n original.BufferIsEncoding = Buffer.isEncoding;\n Buffer.isEncoding = function(encoding) {\n return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);\n }\n\n original.BufferByteLength = Buffer.byteLength;\n Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferByteLength.call(this, str, encoding);\n\n // Slow, I know, but we don't have a better way yet.\n return iconv.encode(str, encoding).length;\n }\n\n original.BufferToString = Buffer.prototype.toString;\n Buffer.prototype.toString = function(encoding, start, end) {\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferToString.call(this, encoding, start, end);\n\n // Otherwise, use our decoding method.\n if (typeof start == 'undefined') start = 0;\n if (typeof end == 'undefined') end = this.length;\n return iconv.decode(this.slice(start, end), encoding);\n }\n\n original.BufferWrite = Buffer.prototype.write;\n Buffer.prototype.write = function(string, offset, length, encoding) {\n var _offset = offset, _length = length, _encoding = encoding;\n // Support both (string, offset, length, encoding)\n // and the legacy (string, encoding, offset, length)\n if (isFinite(offset)) {\n if (!isFinite(length)) {\n encoding = length;\n length = undefined;\n }\n } else { // legacy\n var swap = encoding;\n encoding = offset;\n offset = length;\n length = swap;\n }\n\n encoding = String(encoding || 'utf8').toLowerCase();\n\n // Use native conversion when possible\n if (Buffer.isNativeEncoding(encoding))\n return original.BufferWrite.call(this, string, _offset, _length, _encoding);\n\n offset = +offset || 0;\n var remaining = this.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = +length;\n if (length > remaining) {\n length = remaining;\n }\n }\n\n if (string.length > 0 && (length < 0 || offset < 0))\n throw new RangeError('attempt to write beyond buffer bounds');\n\n // Otherwise, use our encoding method.\n var buf = iconv.encode(string, encoding);\n if (buf.length < length) length = buf.length;\n buf.copy(this, offset, 0, length);\n return length;\n\n // TODO: Set _charsWritten.\n }\n\n\n // -- Readable -------------------------------------------------------------\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n original.ReadableSetEncoding = Readable.prototype.setEncoding;\n Readable.prototype.setEncoding = function setEncoding(enc, options) {\n // Use our own decoder, it has the same interface.\n // We cannot use original function as it doesn't handle BOM-s.\n this._readableState.decoder = iconv.getDecoder(enc, options);\n this._readableState.encoding = enc;\n }\n\n Readable.prototype.collect = iconv._collect;\n }\n }\n\n // Remove iconv-lite Node primitive extensions.\n iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {\n if (!iconv.supportsNodeEncodingsExtension)\n return;\n if (!original)\n throw new Error(\"require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.\")\n\n delete Buffer.isNativeEncoding;\n\n var SlowBuffer = require('buffer').SlowBuffer;\n\n SlowBuffer.prototype.toString = original.SlowBufferToString;\n SlowBuffer.prototype.write = original.SlowBufferWrite;\n\n Buffer.isEncoding = original.BufferIsEncoding;\n Buffer.byteLength = original.BufferByteLength;\n Buffer.prototype.toString = original.BufferToString;\n Buffer.prototype.write = original.BufferWrite;\n\n if (iconv.supportsStreams) {\n var Readable = require('stream').Readable;\n\n Readable.prototype.setEncoding = original.ReadableSetEncoding;\n delete Readable.prototype.collect;\n }\n\n original = undefined;\n }\n}\n","\"use strict\";\n\n// Some environments don't have global Buffer (e.g. React Native).\n// Solution would be installing npm modules \"buffer\" and \"stream\" explicitly.\nvar Buffer = require(\"safer-buffer\").Buffer;\n\nvar bomHandling = require(\"./bom-handling\"),\n iconv = module.exports;\n\n// All codecs and aliases are kept here, keyed by encoding name/alias.\n// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.\niconv.encodings = null;\n\n// Characters emitted in case of error.\niconv.defaultCharUnicode = '�';\niconv.defaultCharSingleByte = '?';\n\n// Public API.\niconv.encode = function encode(str, encoding, options) {\n str = \"\" + (str || \"\"); // Ensure string.\n\n var encoder = iconv.getEncoder(encoding, options);\n\n var res = encoder.write(str);\n var trail = encoder.end();\n \n return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;\n}\n\niconv.decode = function decode(buf, encoding, options) {\n if (typeof buf === 'string') {\n if (!iconv.skipDecodeWarning) {\n console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');\n iconv.skipDecodeWarning = true;\n }\n\n buf = Buffer.from(\"\" + (buf || \"\"), \"binary\"); // Ensure buffer.\n }\n\n var decoder = iconv.getDecoder(encoding, options);\n\n var res = decoder.write(buf);\n var trail = decoder.end();\n\n return trail ? (res + trail) : res;\n}\n\niconv.encodingExists = function encodingExists(enc) {\n try {\n iconv.getCodec(enc);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n// Legacy aliases to convert functions\niconv.toEncoding = iconv.encode;\niconv.fromEncoding = iconv.decode;\n\n// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.\niconv._codecDataCache = {};\niconv.getCodec = function getCodec(encoding) {\n if (!iconv.encodings)\n iconv.encodings = require(\"../encodings\"); // Lazy load all encoding definitions.\n \n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n var enc = iconv._canonicalizeEncoding(encoding);\n\n // Traverse iconv.encodings to find actual codec.\n var codecOptions = {};\n while (true) {\n var codec = iconv._codecDataCache[enc];\n if (codec)\n return codec;\n\n var codecDef = iconv.encodings[enc];\n\n switch (typeof codecDef) {\n case \"string\": // Direct alias to other encoding.\n enc = codecDef;\n break;\n\n case \"object\": // Alias with options. Can be layered.\n for (var key in codecDef)\n codecOptions[key] = codecDef[key];\n\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n \n enc = codecDef.type;\n break;\n\n case \"function\": // Codec itself.\n if (!codecOptions.encodingName)\n codecOptions.encodingName = enc;\n\n // The codec function must load all tables and return object with .encoder and .decoder methods.\n // It'll be called only once (for each different options object).\n codec = new codecDef(codecOptions, iconv);\n\n iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.\n return codec;\n\n default:\n throw new Error(\"Encoding not recognized: '\" + encoding + \"' (searched as: '\"+enc+\"')\");\n }\n }\n}\n\niconv._canonicalizeEncoding = function(encoding) {\n // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.\n return (''+encoding).toLowerCase().replace(/:\\d{4}$|[^0-9a-z]/g, \"\");\n}\n\niconv.getEncoder = function getEncoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n encoder = new codec.encoder(options, codec);\n\n if (codec.bomAware && options && options.addBOM)\n encoder = new bomHandling.PrependBOM(encoder, options);\n\n return encoder;\n}\n\niconv.getDecoder = function getDecoder(encoding, options) {\n var codec = iconv.getCodec(encoding),\n decoder = new codec.decoder(options, codec);\n\n if (codec.bomAware && !(options && options.stripBOM === false))\n decoder = new bomHandling.StripBOM(decoder, options);\n\n return decoder;\n}\n\n\n// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.\nvar nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;\nif (nodeVer) {\n\n // Load streaming support in Node v0.10+\n var nodeVerArr = nodeVer.split(\".\").map(Number);\n if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {\n require(\"./streams\")(iconv);\n }\n\n // Load Node primitive extensions.\n require(\"./extend-node\")(iconv);\n}\n\nif (\"Ā\" != \"\\u0100\") {\n console.error(\"iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.\");\n}\n","\"use strict\";\n\nvar Buffer = require(\"buffer\").Buffer,\n Transform = require(\"stream\").Transform;\n\n\n// == Exports ==================================================================\nmodule.exports = function(iconv) {\n \n // Additional Public API.\n iconv.encodeStream = function encodeStream(encoding, options) {\n return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);\n }\n\n iconv.decodeStream = function decodeStream(encoding, options) {\n return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);\n }\n\n iconv.supportsStreams = true;\n\n\n // Not published yet.\n iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;\n iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;\n iconv._collect = IconvLiteDecoderStream.prototype.collect;\n};\n\n\n// == Encoder stream =======================================================\nfunction IconvLiteEncoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.decodeStrings = false; // We accept only strings, so we don't need to decode them.\n Transform.call(this, options);\n}\n\nIconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteEncoderStream }\n});\n\nIconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {\n if (typeof chunk != 'string')\n return done(new Error(\"Iconv encoding stream needs strings as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteEncoderStream.prototype.collect = function(cb) {\n var chunks = [];\n this.on('error', cb);\n this.on('data', function(chunk) { chunks.push(chunk); });\n this.on('end', function() {\n cb(null, Buffer.concat(chunks));\n });\n return this;\n}\n\n\n// == Decoder stream =======================================================\nfunction IconvLiteDecoderStream(conv, options) {\n this.conv = conv;\n options = options || {};\n options.encoding = this.encoding = 'utf8'; // We output strings.\n Transform.call(this, options);\n}\n\nIconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {\n constructor: { value: IconvLiteDecoderStream }\n});\n\nIconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {\n if (!Buffer.isBuffer(chunk))\n return done(new Error(\"Iconv decoding stream needs buffers as its input.\"));\n try {\n var res = this.conv.write(chunk);\n if (res && res.length) this.push(res, this.encoding);\n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype._flush = function(done) {\n try {\n var res = this.conv.end();\n if (res && res.length) this.push(res, this.encoding); \n done();\n }\n catch (e) {\n done(e);\n }\n}\n\nIconvLiteDecoderStream.prototype.collect = function(cb) {\n var res = '';\n this.on('error', cb);\n this.on('data', function(chunk) { res += chunk; });\n this.on('end', function() {\n cb(null, res);\n });\n return this;\n}\n\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","(function() {\n var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;\n\n ipaddr = {};\n\n root = this;\n\n if ((typeof module !== \"undefined\" && module !== null) && module.exports) {\n module.exports = ipaddr;\n } else {\n root['ipaddr'] = ipaddr;\n }\n\n matchCIDR = function(first, second, partSize, cidrBits) {\n var part, shift;\n if (first.length !== second.length) {\n throw new Error(\"ipaddr: cannot match CIDR for objects with different lengths\");\n }\n part = 0;\n while (cidrBits > 0) {\n shift = partSize - cidrBits;\n if (shift < 0) {\n shift = 0;\n }\n if (first[part] >> shift !== second[part] >> shift) {\n return false;\n }\n cidrBits -= partSize;\n part += 1;\n }\n return true;\n };\n\n ipaddr.subnetMatch = function(address, rangeList, defaultName) {\n var k, len, rangeName, rangeSubnets, subnet;\n if (defaultName == null) {\n defaultName = 'unicast';\n }\n for (rangeName in rangeList) {\n rangeSubnets = rangeList[rangeName];\n if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) {\n rangeSubnets = [rangeSubnets];\n }\n for (k = 0, len = rangeSubnets.length; k < len; k++) {\n subnet = rangeSubnets[k];\n if (address.kind() === subnet[0].kind()) {\n if (address.match.apply(address, subnet)) {\n return rangeName;\n }\n }\n }\n }\n return defaultName;\n };\n\n ipaddr.IPv4 = (function() {\n function IPv4(octets) {\n var k, len, octet;\n if (octets.length !== 4) {\n throw new Error(\"ipaddr: ipv4 octet count should be 4\");\n }\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n throw new Error(\"ipaddr: ipv4 octet should fit in 8 bits\");\n }\n }\n this.octets = octets;\n }\n\n IPv4.prototype.kind = function() {\n return 'ipv4';\n };\n\n IPv4.prototype.toString = function() {\n return this.octets.join(\".\");\n };\n\n IPv4.prototype.toNormalizedString = function() {\n return this.toString();\n };\n\n IPv4.prototype.toByteArray = function() {\n return this.octets.slice(0);\n };\n\n IPv4.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv4') {\n throw new Error(\"ipaddr: cannot match ipv4 address with non-ipv4 one\");\n }\n return matchCIDR(this.octets, other.octets, 8, cidrRange);\n };\n\n IPv4.prototype.SpecialRanges = {\n unspecified: [[new IPv4([0, 0, 0, 0]), 8]],\n broadcast: [[new IPv4([255, 255, 255, 255]), 32]],\n multicast: [[new IPv4([224, 0, 0, 0]), 4]],\n linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],\n loopback: [[new IPv4([127, 0, 0, 0]), 8]],\n carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],\n \"private\": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],\n reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]\n };\n\n IPv4.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv4.prototype.toIPv4MappedAddress = function() {\n return ipaddr.IPv6.parse(\"::ffff:\" + (this.toString()));\n };\n\n IPv4.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, octet, stop, zeros, zerotable;\n zerotable = {\n 0: 8,\n 128: 7,\n 192: 6,\n 224: 5,\n 240: 4,\n 248: 3,\n 252: 2,\n 254: 1,\n 255: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 3; k >= 0; i = k += -1) {\n octet = this.octets[i];\n if (octet in zerotable) {\n zeros = zerotable[octet];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 8) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 32 - cidr;\n };\n\n return IPv4;\n\n })();\n\n ipv4Part = \"(0?\\\\d+|0x[a-f0-9]+)\";\n\n ipv4Regexes = {\n fourOctet: new RegExp(\"^\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"$\", 'i'),\n longValue: new RegExp(\"^\" + ipv4Part + \"$\", 'i')\n };\n\n ipaddr.IPv4.parser = function(string) {\n var match, parseIntAuto, part, shift, value;\n parseIntAuto = function(string) {\n if (string[0] === \"0\" && string[1] !== \"x\") {\n return parseInt(string, 8);\n } else {\n return parseInt(string);\n }\n };\n if (match = string.match(ipv4Regexes.fourOctet)) {\n return (function() {\n var k, len, ref, results;\n ref = match.slice(1, 6);\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseIntAuto(part));\n }\n return results;\n })();\n } else if (match = string.match(ipv4Regexes.longValue)) {\n value = parseIntAuto(match[1]);\n if (value > 0xffffffff || value < 0) {\n throw new Error(\"ipaddr: address outside defined range\");\n }\n return ((function() {\n var k, results;\n results = [];\n for (shift = k = 0; k <= 24; shift = k += 8) {\n results.push((value >> shift) & 0xff);\n }\n return results;\n })()).reverse();\n } else {\n return null;\n }\n };\n\n ipaddr.IPv6 = (function() {\n function IPv6(parts, zoneId) {\n var i, k, l, len, part, ref;\n if (parts.length === 16) {\n this.parts = [];\n for (i = k = 0; k <= 14; i = k += 2) {\n this.parts.push((parts[i] << 8) | parts[i + 1]);\n }\n } else if (parts.length === 8) {\n this.parts = parts;\n } else {\n throw new Error(\"ipaddr: ipv6 part count should be 8 or 16\");\n }\n ref = this.parts;\n for (l = 0, len = ref.length; l < len; l++) {\n part = ref[l];\n if (!((0 <= part && part <= 0xffff))) {\n throw new Error(\"ipaddr: ipv6 part should fit in 16 bits\");\n }\n }\n if (zoneId) {\n this.zoneId = zoneId;\n }\n }\n\n IPv6.prototype.kind = function() {\n return 'ipv6';\n };\n\n IPv6.prototype.toString = function() {\n return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::');\n };\n\n IPv6.prototype.toRFC5952String = function() {\n var bestMatchIndex, bestMatchLength, match, regex, string;\n regex = /((^|:)(0(:|$)){2,})/g;\n string = this.toNormalizedString();\n bestMatchIndex = 0;\n bestMatchLength = -1;\n while ((match = regex.exec(string))) {\n if (match[0].length > bestMatchLength) {\n bestMatchIndex = match.index;\n bestMatchLength = match[0].length;\n }\n }\n if (bestMatchLength < 0) {\n return string;\n }\n return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength);\n };\n\n IPv6.prototype.toByteArray = function() {\n var bytes, k, len, part, ref;\n bytes = [];\n ref = this.parts;\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n bytes.push(part >> 8);\n bytes.push(part & 0xff);\n }\n return bytes;\n };\n\n IPv6.prototype.toNormalizedString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.toFixedLengthString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16).padStart(4, '0'));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv6') {\n throw new Error(\"ipaddr: cannot match ipv6 address with non-ipv6 one\");\n }\n return matchCIDR(this.parts, other.parts, 16, cidrRange);\n };\n\n IPv6.prototype.SpecialRanges = {\n unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],\n linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],\n multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],\n loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],\n uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],\n ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],\n rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],\n rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],\n '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],\n teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],\n reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]\n };\n\n IPv6.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv6.prototype.isIPv4MappedAddress = function() {\n return this.range() === 'ipv4Mapped';\n };\n\n IPv6.prototype.toIPv4Address = function() {\n var high, low, ref;\n if (!this.isIPv4MappedAddress()) {\n throw new Error(\"ipaddr: trying to convert a generic ipv6 address to ipv4\");\n }\n ref = this.parts.slice(-2), high = ref[0], low = ref[1];\n return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);\n };\n\n IPv6.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, part, stop, zeros, zerotable;\n zerotable = {\n 0: 16,\n 32768: 15,\n 49152: 14,\n 57344: 13,\n 61440: 12,\n 63488: 11,\n 64512: 10,\n 65024: 9,\n 65280: 8,\n 65408: 7,\n 65472: 6,\n 65504: 5,\n 65520: 4,\n 65528: 3,\n 65532: 2,\n 65534: 1,\n 65535: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 7; k >= 0; i = k += -1) {\n part = this.parts[i];\n if (part in zerotable) {\n zeros = zerotable[part];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 16) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 128 - cidr;\n };\n\n return IPv6;\n\n })();\n\n ipv6Part = \"(?:[0-9a-f]+::?)+\";\n\n zoneIndex = \"%[0-9a-z]{1,}\";\n\n ipv6Regexes = {\n zoneIndex: new RegExp(zoneIndex, 'i'),\n \"native\": new RegExp(\"^(::)?(\" + ipv6Part + \")?([0-9a-f]+)?(::)?(\" + zoneIndex + \")?$\", 'i'),\n transitional: new RegExp((\"^((?:\" + ipv6Part + \")|(?:::)(?:\" + ipv6Part + \")?)\") + (ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part) + (\"(\" + zoneIndex + \")?$\"), 'i')\n };\n\n expandIPv6 = function(string, parts) {\n var colonCount, lastColon, part, replacement, replacementCount, zoneId;\n if (string.indexOf('::') !== string.lastIndexOf('::')) {\n return null;\n }\n zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0];\n if (zoneId) {\n zoneId = zoneId.substring(1);\n string = string.replace(/%.+$/, '');\n }\n colonCount = 0;\n lastColon = -1;\n while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {\n colonCount++;\n }\n if (string.substr(0, 2) === '::') {\n colonCount--;\n }\n if (string.substr(-2, 2) === '::') {\n colonCount--;\n }\n if (colonCount > parts) {\n return null;\n }\n replacementCount = parts - colonCount;\n replacement = ':';\n while (replacementCount--) {\n replacement += '0:';\n }\n string = string.replace('::', replacement);\n if (string[0] === ':') {\n string = string.slice(1);\n }\n if (string[string.length - 1] === ':') {\n string = string.slice(0, -1);\n }\n parts = (function() {\n var k, len, ref, results;\n ref = string.split(\":\");\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseInt(part, 16));\n }\n return results;\n })();\n return {\n parts: parts,\n zoneId: zoneId\n };\n };\n\n ipaddr.IPv6.parser = function(string) {\n var addr, k, len, match, octet, octets, zoneId;\n if (ipv6Regexes['native'].test(string)) {\n return expandIPv6(string, 8);\n } else if (match = string.match(ipv6Regexes['transitional'])) {\n zoneId = match[6] || '';\n addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6);\n if (addr.parts) {\n octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])];\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n return null;\n }\n }\n addr.parts.push(octets[0] << 8 | octets[1]);\n addr.parts.push(octets[2] << 8 | octets[3]);\n return {\n parts: addr.parts,\n zoneId: addr.zoneId\n };\n }\n }\n return null;\n };\n\n ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {\n return this.parser(string) !== null;\n };\n\n ipaddr.IPv4.isValid = function(string) {\n var e;\n try {\n new this(this.parser(string));\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.isValidFourPartDecimal = function(string) {\n if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){3}$/)) {\n return true;\n } else {\n return false;\n }\n };\n\n ipaddr.IPv6.isValid = function(string) {\n var addr, e;\n if (typeof string === \"string\" && string.indexOf(\":\") === -1) {\n return false;\n }\n try {\n addr = this.parser(string);\n new this(addr.parts, addr.zoneId);\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.parse = function(string) {\n var parts;\n parts = this.parser(string);\n if (parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(parts);\n };\n\n ipaddr.IPv6.parse = function(string) {\n var addr;\n addr = this.parser(string);\n if (addr.parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(addr.parts, addr.zoneId);\n };\n\n ipaddr.IPv4.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 32) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv4 CIDR range\");\n };\n\n ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {\n var filledOctetCount, j, octets;\n prefix = parseInt(prefix);\n if (prefix < 0 || prefix > 32) {\n throw new Error('ipaddr: invalid IPv4 prefix length');\n }\n octets = [0, 0, 0, 0];\n j = 0;\n filledOctetCount = Math.floor(prefix / 8);\n while (j < filledOctetCount) {\n octets[j] = 255;\n j++;\n }\n if (filledOctetCount < 4) {\n octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);\n }\n return new this(octets);\n };\n\n ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv4.networkAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv6.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 128) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv6 CIDR range\");\n };\n\n ipaddr.isValid = function(string) {\n return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);\n };\n\n ipaddr.parse = function(string) {\n if (ipaddr.IPv6.isValid(string)) {\n return ipaddr.IPv6.parse(string);\n } else if (ipaddr.IPv4.isValid(string)) {\n return ipaddr.IPv4.parse(string);\n } else {\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 format\");\n }\n };\n\n ipaddr.parseCIDR = function(string) {\n var e;\n try {\n return ipaddr.IPv6.parseCIDR(string);\n } catch (error1) {\n e = error1;\n try {\n return ipaddr.IPv4.parseCIDR(string);\n } catch (error1) {\n e = error1;\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 CIDR format\");\n }\n }\n };\n\n ipaddr.fromByteArray = function(bytes) {\n var length;\n length = bytes.length;\n if (length === 4) {\n return new ipaddr.IPv4(bytes);\n } else if (length === 16) {\n return new ipaddr.IPv6(bytes);\n } else {\n throw new Error(\"ipaddr: the binary input is neither an IPv6 nor IPv4 address\");\n }\n };\n\n ipaddr.process = function(string) {\n var addr;\n addr = this.parse(string);\n if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {\n return addr.toIPv4Address();\n } else {\n return addr;\n }\n };\n\n}).call(this);\n","'use strict';\n\nvar WHITELIST = [\n\t'ETIMEDOUT',\n\t'ECONNRESET',\n\t'EADDRINUSE',\n\t'ESOCKETTIMEDOUT',\n\t'ECONNREFUSED',\n\t'EPIPE',\n\t'EHOSTUNREACH',\n\t'EAI_AGAIN'\n];\n\nvar BLACKLIST = [\n\t'ENOTFOUND',\n\t'ENETUNREACH',\n\n\t// SSL errors from https://github.com/nodejs/node/blob/ed3d8b13ee9a705d89f9e0397d9e96519e7e47ac/src/node_crypto.cc#L1950\n\t'UNABLE_TO_GET_ISSUER_CERT',\n\t'UNABLE_TO_GET_CRL',\n\t'UNABLE_TO_DECRYPT_CERT_SIGNATURE',\n\t'UNABLE_TO_DECRYPT_CRL_SIGNATURE',\n\t'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',\n\t'CERT_SIGNATURE_FAILURE',\n\t'CRL_SIGNATURE_FAILURE',\n\t'CERT_NOT_YET_VALID',\n\t'CERT_HAS_EXPIRED',\n\t'CRL_NOT_YET_VALID',\n\t'CRL_HAS_EXPIRED',\n\t'ERROR_IN_CERT_NOT_BEFORE_FIELD',\n\t'ERROR_IN_CERT_NOT_AFTER_FIELD',\n\t'ERROR_IN_CRL_LAST_UPDATE_FIELD',\n\t'ERROR_IN_CRL_NEXT_UPDATE_FIELD',\n\t'OUT_OF_MEM',\n\t'DEPTH_ZERO_SELF_SIGNED_CERT',\n\t'SELF_SIGNED_CERT_IN_CHAIN',\n\t'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',\n\t'UNABLE_TO_VERIFY_LEAF_SIGNATURE',\n\t'CERT_CHAIN_TOO_LONG',\n\t'CERT_REVOKED',\n\t'INVALID_CA',\n\t'PATH_LENGTH_EXCEEDED',\n\t'INVALID_PURPOSE',\n\t'CERT_UNTRUSTED',\n\t'CERT_REJECTED'\n];\n\nmodule.exports = function (err) {\n\tif (!err || !err.code) {\n\t\treturn true;\n\t}\n\n\tif (WHITELIST.indexOf(err.code) !== -1) {\n\t\treturn true;\n\t}\n\n\tif (BLACKLIST.indexOf(err.code) !== -1) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","const Kafka = require('./src')\nconst PartitionAssigners = require('./src/consumer/assigners')\nconst AssignerProtocol = require('./src/consumer/assignerProtocol')\nconst Partitioners = require('./src/producer/partitioners')\nconst Compression = require('./src/protocol/message/compression')\nconst ResourceTypes = require('./src/protocol/resourceTypes')\nconst ConfigResourceTypes = require('./src/protocol/configResourceTypes')\nconst ConfigSource = require('./src/protocol/configSource')\nconst AclResourceTypes = require('./src/protocol/aclResourceTypes')\nconst AclOperationTypes = require('./src/protocol/aclOperationTypes')\nconst AclPermissionTypes = require('./src/protocol/aclPermissionTypes')\nconst ResourcePatternTypes = require('./src/protocol/resourcePatternTypes')\nconst Errors = require('./src/errors')\nconst { LEVELS } = require('./src/loggers')\n\nmodule.exports = {\n Kafka,\n PartitionAssigners,\n AssignerProtocol,\n Partitioners,\n logLevel: LEVELS,\n CompressionTypes: Compression.Types,\n CompressionCodecs: Compression.Codecs,\n /**\n * @deprecated\n * @see https://github.com/tulios/kafkajs/issues/649\n *\n * Use ConfigResourceTypes or AclResourceTypes instead.\n */\n ResourceTypes,\n ConfigResourceTypes,\n AclResourceTypes,\n AclOperationTypes,\n AclPermissionTypes,\n ResourcePatternTypes,\n ConfigSource,\n ...Errors,\n}\n","const createRetry = require('../retry')\nconst flatten = require('../utils/flatten')\nconst waitFor = require('../utils/waitFor')\nconst groupBy = require('../utils/groupBy')\nconst createConsumer = require('../consumer')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst { LEVELS } = require('../loggers')\nconst {\n KafkaJSNonRetriableError,\n KafkaJSDeleteGroupsError,\n KafkaJSBrokerNotFound,\n KafkaJSDeleteTopicRecordsError,\n KafkaJSAggregateError,\n} = require('../errors')\nconst { staleMetadata } = require('../protocol/error')\nconst CONFIG_RESOURCE_TYPES = require('../protocol/configResourceTypes')\nconst ACL_RESOURCE_TYPES = require('../protocol/aclResourceTypes')\nconst ACL_OPERATION_TYPES = require('../protocol/aclOperationTypes')\nconst ACL_PERMISSION_TYPES = require('../protocol/aclPermissionTypes')\nconst RESOURCE_PATTERN_TYPES = require('../protocol/resourcePatternTypes')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\n\nconst { CONNECT, DISCONNECT } = events\n\nconst NO_CONTROLLER_ID = -1\n\nconst { values, keys, entries } = Object\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `admin.events.${key}`)\n .join(', ')\n\nconst retryOnLeaderNotAvailable = (fn, opts = {}) => {\n const callback = async () => {\n try {\n return await fn()\n } catch (e) {\n if (e.type !== 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n return false\n }\n }\n\n return waitFor(callback, opts)\n}\n\nconst isConsumerGroupRunning = description => ['Empty', 'Dead'].includes(description.state)\nconst findTopicPartitions = async (cluster, topic) => {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n return cluster\n .findTopicPartitionMetadata(topic)\n .map(({ partitionId }) => partitionId)\n .sort()\n}\nconst indexByPartition = array =>\n array.reduce(\n (obj, { partition, ...props }) => Object.assign(obj, { [partition]: { ...props } }),\n {}\n )\n\n/**\n *\n * @param {Object} params\n * @param {import(\"../../types\").Logger} params.logger\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n * @param {import('../../types').RetryOptions} params.retry\n * @param {import(\"../../types\").Cluster} params.cluster\n *\n * @returns {import(\"../../types\").Admin}\n */\nmodule.exports = ({\n logger: rootLogger,\n instrumentationEmitter: rootInstrumentationEmitter,\n retry,\n cluster,\n}) => {\n const logger = rootLogger.namespace('Admin')\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n\n /**\n * @returns {Promise}\n */\n const connect = async () => {\n await cluster.connect()\n instrumentationEmitter.emit(CONNECT)\n }\n\n /**\n * @return {Promise}\n */\n const disconnect = async () => {\n await cluster.disconnect()\n instrumentationEmitter.emit(DISCONNECT)\n }\n\n /**\n * @return {Promise}\n */\n const listTopics = async () => {\n const { topicMetadata } = await cluster.metadata()\n const topics = topicMetadata.map(t => t.topic)\n return topics\n }\n\n /**\n * @param {Object} request\n * @param {array} request.topics\n * @param {boolean} [request.validateOnly=false]\n * @param {number} [request.timeout=5000]\n * @param {boolean} [request.waitForLeaders=true]\n * @return {Promise}\n */\n const createTopics = async ({ topics, validateOnly, timeout, waitForLeaders = true }) => {\n if (!topics || !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Invalid topics array ${topics}`)\n }\n\n if (topics.filter(({ topic }) => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topics array, the topic names have to be a valid string'\n )\n }\n\n const topicNames = new Set(topics.map(({ topic }) => topic))\n if (topicNames.size < topics.length) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topics array, it cannot have multiple entries for the same topic'\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createTopics({ topics, validateOnly, timeout })\n\n if (waitForLeaders) {\n const topicNamesArray = Array.from(topicNames.values())\n await retryOnLeaderNotAvailable(async () => await broker.metadata(topicNamesArray), {\n delay: 100,\n maxWait: timeout,\n timeoutMessage: 'Timed out while waiting for topic leaders',\n })\n }\n\n return true\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n if (e instanceof KafkaJSAggregateError) {\n if (e.errors.every(error => error.type === 'TOPIC_ALREADY_EXISTS')) {\n return false\n }\n }\n\n bail(e)\n }\n })\n }\n /**\n * @param {array} topicPartitions\n * @param {boolean} [validateOnly=false]\n * @param {number} [timeout=5000]\n * @return {Promise}\n */\n const createPartitions = async ({ topicPartitions, validateOnly, timeout }) => {\n if (!topicPartitions || !Array.isArray(topicPartitions)) {\n throw new KafkaJSNonRetriableError(`Invalid topic partitions array ${topicPartitions}`)\n }\n if (topicPartitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Empty topic partitions array`)\n }\n\n if (topicPartitions.filter(({ topic }) => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topic partitions array, the topic names have to be a valid string'\n )\n }\n\n const topicNames = new Set(topicPartitions.map(({ topic }) => topic))\n if (topicNames.size < topicPartitions.length) {\n throw new KafkaJSNonRetriableError(\n 'Invalid topic partitions array, it cannot have multiple entries for the same topic'\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createPartitions({ topicPartitions, validateOnly, timeout })\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string[]} topics\n * @param {number} [timeout=5000]\n * @return {Promise}\n */\n const deleteTopics = async ({ topics, timeout }) => {\n if (!topics || !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Invalid topics array ${topics}`)\n }\n\n if (topics.filter(topic => typeof topic !== 'string').length > 0) {\n throw new KafkaJSNonRetriableError('Invalid topics array, the names must be a valid string')\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.deleteTopics({ topics, timeout })\n\n // Remove deleted topics\n for (const topic of topics) {\n cluster.targetTopics.delete(topic)\n }\n\n await cluster.refreshMetadata()\n } catch (e) {\n if (['NOT_CONTROLLER', 'UNKNOWN_TOPIC_OR_PARTITION'].includes(e.type)) {\n logger.warn('Could not delete topics', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n if (e.type === 'REQUEST_TIMED_OUT') {\n logger.error(\n 'Could not delete topics, check if \"delete.topic.enable\" is set to \"true\" (the default value is \"false\") or increase the timeout',\n {\n error: e.message,\n retryCount,\n retryTime,\n }\n )\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string} topic\n */\n\n const fetchTopicOffsets = async topic => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n const metadata = cluster.findTopicPartitionMetadata(topic)\n const high = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: false,\n partitions: metadata.map(p => ({ partition: p.partitionId })),\n },\n ])\n\n const low = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: true,\n partitions: metadata.map(p => ({ partition: p.partitionId })),\n },\n ])\n\n const { partitions: highPartitions } = high.pop()\n const { partitions: lowPartitions } = low.pop()\n return highPartitions.map(({ partition, offset }) => ({\n partition,\n offset,\n high: offset,\n low: lowPartitions.find(({ partition: lowPartition }) => lowPartition === partition)\n .offset,\n }))\n } catch (e) {\n if (e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n await cluster.refreshMetadata()\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {string} topic\n * @param {number} [timestamp]\n */\n\n const fetchTopicOffsetsByTimestamp = async (topic, timestamp) => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.addTargetTopic(topic)\n await cluster.refreshMetadataIfNecessary()\n\n const metadata = cluster.findTopicPartitionMetadata(topic)\n const partitions = metadata.map(p => ({ partition: p.partitionId }))\n\n const high = await cluster.fetchTopicsOffset([\n {\n topic,\n fromBeginning: false,\n partitions,\n },\n ])\n const { partitions: highPartitions } = high.pop()\n\n const offsets = await cluster.fetchTopicsOffset([\n {\n topic,\n fromTimestamp: timestamp,\n partitions,\n },\n ])\n const { partitions: lowPartitions } = offsets.pop()\n\n return lowPartitions.map(({ partition, offset }) => ({\n partition,\n offset:\n parseInt(offset, 10) >= 0\n ? offset\n : highPartitions.find(({ partition: highPartition }) => highPartition === partition)\n .offset,\n }))\n } catch (e) {\n if (e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n await cluster.refreshMetadata()\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Fetch offsets for a topic or multiple topics\n *\n * Note: set either topic or topics but not both.\n *\n * @param {string} groupId\n * @param {string} topic - deprecated, use the `topics` parameter. Topic to fetch offsets for.\n * @param {string[]} topics - list of topics to fetch offsets for, defaults to `[]` which fetches all topics for `groupId`.\n * @param {boolean} [resolveOffsets=false]\n * @return {Promise}\n */\n const fetchOffsets = async ({ groupId, topic, topics, resolveOffsets = false }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic && !topics) {\n topics = []\n }\n\n if (!topic && !Array.isArray(topics)) {\n throw new KafkaJSNonRetriableError(`Expected topic or topics array to be set`)\n }\n\n if (topic && topics) {\n throw new KafkaJSNonRetriableError(`Either topic or topics must be set, not both`)\n }\n\n if (topic) {\n topics = [topic]\n }\n\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n const topicsToFetch = await Promise.all(\n topics.map(async topic => {\n const partitions = await findTopicPartitions(cluster, topic)\n const partitionsToFetch = partitions.map(partition => ({ partition }))\n return { topic, partitions: partitionsToFetch }\n })\n )\n let { responses: consumerOffsets } = await coordinator.offsetFetch({\n groupId,\n topics: topicsToFetch,\n })\n\n if (resolveOffsets) {\n consumerOffsets = await Promise.all(\n consumerOffsets.map(async ({ topic, partitions }) => {\n const indexedOffsets = indexByPartition(await fetchTopicOffsets(topic))\n const recalculatedPartitions = partitions.map(({ offset, partition, ...props }) => {\n let resolvedOffset = offset\n if (Number(offset) === EARLIEST_OFFSET) {\n resolvedOffset = indexedOffsets[partition].low\n }\n if (Number(offset) === LATEST_OFFSET) {\n resolvedOffset = indexedOffsets[partition].high\n }\n return {\n partition,\n offset: resolvedOffset,\n ...props,\n }\n })\n\n await setOffsets({ groupId, topic, partitions: recalculatedPartitions })\n\n return {\n topic,\n partitions: recalculatedPartitions,\n }\n })\n )\n }\n\n const result = consumerOffsets.map(({ topic, partitions }) => {\n const completePartitions = partitions.map(({ partition, offset, metadata }) => ({\n partition,\n offset,\n metadata: metadata || null,\n }))\n\n return { topic, partitions: completePartitions }\n })\n\n if (topic) {\n return result.pop().partitions\n } else {\n return result\n }\n }\n\n /**\n * @param {string} groupId\n * @param {string} topic\n * @param {boolean} [earliest=false]\n * @return {Promise}\n */\n const resetOffsets = async ({ groupId, topic, earliest = false }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const partitions = await findTopicPartitions(cluster, topic)\n const partitionsToSeek = partitions.map(partition => ({\n partition,\n offset: cluster.defaultOffset({ fromBeginning: earliest }),\n }))\n\n return setOffsets({ groupId, topic, partitions: partitionsToSeek })\n }\n\n /**\n * @param {string} groupId\n * @param {string} topic\n * @param {Array} partitions\n * @return {Promise}\n *\n * @typedef {Object} SeekEntry\n * @property {number} partition\n * @property {string} offset\n */\n const setOffsets = async ({ groupId, topic, partitions }) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId ${groupId}`)\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (!partitions || partitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Invalid partitions`)\n }\n\n const consumer = createConsumer({\n logger: rootLogger.namespace('Admin', LEVELS.NOTHING),\n cluster,\n groupId,\n })\n\n await consumer.subscribe({ topic, fromBeginning: true })\n const description = await consumer.describeGroup()\n\n if (!isConsumerGroupRunning(description)) {\n throw new KafkaJSNonRetriableError(\n `The consumer group must have no running instances, current state: ${description.state}`\n )\n }\n\n return new Promise((resolve, reject) => {\n consumer.on(consumer.events.FETCH, async () =>\n consumer\n .stop()\n .then(resolve)\n .catch(reject)\n )\n\n consumer\n .run({\n eachBatchAutoResolve: false,\n eachBatch: async () => true,\n })\n .catch(reject)\n\n // This consumer doesn't need to consume any data\n consumer.pause([{ topic }])\n\n for (const seekData of partitions) {\n consumer.seek({ topic, ...seekData })\n }\n })\n }\n\n const isBrokerConfig = type =>\n [CONFIG_RESOURCE_TYPES.BROKER, CONFIG_RESOURCE_TYPES.BROKER_LOGGER].includes(type)\n\n /**\n * Broker configs can only be returned by the target broker\n *\n * @see\n * https://github.com/apache/kafka/blob/821c1ac6641845aeca96a43bc2b946ecec5cba4f/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L3783\n * https://github.com/apache/kafka/blob/821c1ac6641845aeca96a43bc2b946ecec5cba4f/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L2027\n *\n * @param {Broker} defaultBroker. Broker used in case the configuration is not a broker config\n */\n const groupResourcesByBroker = ({ resources, defaultBroker }) =>\n groupBy(resources, async ({ type, name: nodeId }) => {\n return isBrokerConfig(type)\n ? await cluster.findBroker({ nodeId: String(nodeId) })\n : defaultBroker\n })\n\n /**\n * @param {Array} resources\n * @param {boolean} [includeSynonyms=false]\n * @return {Promise}\n *\n * @typedef {Object} ResourceConfigQuery\n * @property {ConfigResourceType} type\n * @property {string} name\n * @property {Array} [configNames=[]]\n */\n const describeConfigs = async ({ resources, includeSynonyms }) => {\n if (!resources || !Array.isArray(resources)) {\n throw new KafkaJSNonRetriableError(`Invalid resources array ${resources}`)\n }\n\n if (resources.length === 0) {\n throw new KafkaJSNonRetriableError('Resources array cannot be empty')\n }\n\n const validResourceTypes = Object.values(CONFIG_RESOURCE_TYPES)\n const invalidType = resources.find(r => !validResourceTypes.includes(r.type))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.type}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const invalidName = resources.find(r => !r.name || typeof r.name !== 'string')\n\n if (invalidName) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource name ${invalidName.name}: ${JSON.stringify(invalidName)}`\n )\n }\n\n const invalidConfigs = resources.find(\n r => !Array.isArray(r.configNames) && r.configNames != null\n )\n\n if (invalidConfigs) {\n const { configNames } = invalidConfigs\n throw new KafkaJSNonRetriableError(\n `Invalid resource configNames ${configNames}: ${JSON.stringify(invalidConfigs)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const controller = await cluster.findControllerBroker()\n const resourcerByBroker = await groupResourcesByBroker({\n resources,\n defaultBroker: controller,\n })\n\n const describeConfigsAction = async broker => {\n const targetBroker = broker || controller\n return targetBroker.describeConfigs({\n resources: resourcerByBroker.get(targetBroker),\n includeSynonyms,\n })\n }\n\n const brokers = Array.from(resourcerByBroker.keys())\n const responses = await Promise.all(brokers.map(describeConfigsAction))\n const responseResources = responses.reduce(\n (result, { resources }) => [...result, ...resources],\n []\n )\n\n return { resources: responseResources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not describe configs', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {Array} resources\n * @param {boolean} [validateOnly=false]\n * @return {Promise}\n *\n * @typedef {Object} ResourceConfig\n * @property {ConfigResourceType} type\n * @property {string} name\n * @property {Array} configEntries\n *\n * @typedef {Object} ResourceConfigEntry\n * @property {string} name\n * @property {string} value\n */\n const alterConfigs = async ({ resources, validateOnly }) => {\n if (!resources || !Array.isArray(resources)) {\n throw new KafkaJSNonRetriableError(`Invalid resources array ${resources}`)\n }\n\n if (resources.length === 0) {\n throw new KafkaJSNonRetriableError('Resources array cannot be empty')\n }\n\n const validResourceTypes = Object.values(CONFIG_RESOURCE_TYPES)\n const invalidType = resources.find(r => !validResourceTypes.includes(r.type))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.type}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const invalidName = resources.find(r => !r.name || typeof r.name !== 'string')\n\n if (invalidName) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource name ${invalidName.name}: ${JSON.stringify(invalidName)}`\n )\n }\n\n const invalidConfigs = resources.find(r => !Array.isArray(r.configEntries))\n\n if (invalidConfigs) {\n const { configEntries } = invalidConfigs\n throw new KafkaJSNonRetriableError(\n `Invalid resource configEntries ${configEntries}: ${JSON.stringify(invalidConfigs)}`\n )\n }\n\n const invalidConfigValue = resources.find(r =>\n r.configEntries.some(e => typeof e.name !== 'string' || typeof e.value !== 'string')\n )\n\n if (invalidConfigValue) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource config value: ${JSON.stringify(invalidConfigValue)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const controller = await cluster.findControllerBroker()\n const resourcerByBroker = await groupResourcesByBroker({\n resources,\n defaultBroker: controller,\n })\n\n const alterConfigsAction = async broker => {\n const targetBroker = broker || controller\n return targetBroker.alterConfigs({\n resources: resourcerByBroker.get(targetBroker),\n validateOnly: !!validateOnly,\n })\n }\n\n const brokers = Array.from(resourcerByBroker.keys())\n const responses = await Promise.all(brokers.map(alterConfigsAction))\n const responseResources = responses.reduce(\n (result, { resources }) => [...result, ...resources],\n []\n )\n\n return { resources: responseResources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not alter configs', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @deprecated - This method was replaced by `fetchTopicMetadata`. This implementation\n * is limited by the topics in the target group, so it can't fetch all topics when\n * necessary.\n *\n * Fetch metadata for provided topics.\n *\n * If no topics are provided fetch metadata for all topics of which we are aware.\n * @see https://kafka.apache.org/protocol#The_Messages_Metadata\n *\n * @param {Object} [options]\n * @param {string[]} [options.topics]\n * @return {Promise}\n *\n * @typedef {Object} TopicsMetadata\n * @property {Array} topics\n *\n * @typedef {Object} TopicMetadata\n * @property {String} name\n * @property {Array} partitions\n *\n * @typedef {Object} PartitionMetadata\n * @property {number} partitionErrorCode Response error code\n * @property {number} partitionId Topic partition id\n * @property {number} leader The id of the broker acting as leader for this partition.\n * @property {Array} replicas The set of all nodes that host this partition.\n * @property {Array} isr The set of nodes that are in sync with the leader for this partition.\n */\n const getTopicMetadata = async options => {\n const { topics } = options || {}\n\n if (topics) {\n await Promise.all(\n topics.map(async topic => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n try {\n await cluster.addTargetTopic(topic)\n } catch (e) {\n e.message = `Failed to add target topic ${topic}: ${e.message}`\n throw e\n }\n })\n )\n }\n\n await cluster.refreshMetadataIfNecessary()\n const targetTopics = topics || [...cluster.targetTopics]\n\n return {\n topics: await Promise.all(\n targetTopics.map(async topic => ({\n name: topic,\n partitions: cluster.findTopicPartitionMetadata(topic),\n }))\n ),\n }\n }\n\n /**\n * Fetch metadata for provided topics.\n *\n * If no topics are provided fetch metadata for all topics.\n * @see https://kafka.apache.org/protocol#The_Messages_Metadata\n *\n * @param {Object} [options]\n * @param {string[]} [options.topics]\n * @return {Promise}\n *\n * @typedef {Object} TopicsMetadata\n * @property {Array} topics\n *\n * @typedef {Object} TopicMetadata\n * @property {String} name\n * @property {Array} partitions\n *\n * @typedef {Object} PartitionMetadata\n * @property {number} partitionErrorCode Response error code\n * @property {number} partitionId Topic partition id\n * @property {number} leader The id of the broker acting as leader for this partition.\n * @property {Array} replicas The set of all nodes that host this partition.\n * @property {Array} isr The set of nodes that are in sync with the leader for this partition.\n */\n const fetchTopicMetadata = async ({ topics = [] } = {}) => {\n if (topics) {\n topics.forEach(topic => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n })\n }\n\n const metadata = await cluster.metadata({ topics })\n\n return {\n topics: metadata.topicMetadata.map(topicMetadata => ({\n name: topicMetadata.topic,\n partitions: topicMetadata.partitionMetadata,\n })),\n }\n }\n\n /**\n * Describe cluster\n *\n * @return {Promise}\n *\n * @typedef {Object} ClusterMetadata\n * @property {Array} brokers\n * @property {Number} controller Current controller id. Returns null if unknown.\n * @property {String} clusterId\n *\n * @typedef {Object} Broker\n * @property {Number} nodeId\n * @property {String} host\n * @property {Number} port\n */\n const describeCluster = async () => {\n const { brokers: nodes, clusterId, controllerId } = await cluster.metadata({ topics: [] })\n const brokers = nodes.map(({ nodeId, host, port }) => ({\n nodeId,\n host,\n port,\n }))\n const controller =\n controllerId == null || controllerId === NO_CONTROLLER_ID ? null : controllerId\n\n return {\n brokers,\n controller,\n clusterId,\n }\n }\n\n /**\n * List groups in a broker\n *\n * @return {Promise}\n *\n * @typedef {Object} ListGroups\n * @property {Array} groups\n *\n * @typedef {Object} ListGroup\n * @property {string} groupId\n * @property {string} protocolType\n */\n const listGroups = async () => {\n await cluster.refreshMetadata()\n let groups = []\n for (var nodeId in cluster.brokerPool.brokers) {\n const broker = await cluster.findBroker({ nodeId })\n const response = await broker.listGroups()\n groups = groups.concat(response.groups)\n }\n\n return { groups }\n }\n\n /**\n * Describe groups by group ids\n * @param {Array} groupIds\n *\n * @typedef {Object} GroupDescriptions\n * @property {Array} groups\n *\n * @return {Promise}\n */\n const describeGroups = async groupIds => {\n const coordinatorsForGroup = await Promise.all(\n groupIds.map(async groupId => {\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n return {\n coordinator,\n groupId,\n }\n })\n )\n\n const groupsByCoordinator = Object.values(\n coordinatorsForGroup.reduce((coordinators, { coordinator, groupId }) => {\n const group = coordinators[coordinator.nodeId]\n\n if (group) {\n coordinators[coordinator.nodeId] = {\n ...group,\n groupIds: [...group.groupIds, groupId],\n }\n } else {\n coordinators[coordinator.nodeId] = { coordinator, groupIds: [groupId] }\n }\n return coordinators\n }, {})\n )\n\n const responses = await Promise.all(\n groupsByCoordinator.map(async ({ coordinator, groupIds }) => {\n const retrier = createRetry(retry)\n const { groups } = await retrier(() => coordinator.describeGroups({ groupIds }))\n return groups\n })\n )\n\n const groups = [].concat.apply([], responses)\n\n return { groups }\n }\n\n /**\n * Delete groups in a broker\n *\n * @param {string[]} [groupIds]\n * @return {Promise}\n *\n * @typedef {Array} DeleteGroups\n * @property {string} groupId\n * @property {number} errorCode\n */\n const deleteGroups = async groupIds => {\n if (!groupIds || !Array.isArray(groupIds)) {\n throw new KafkaJSNonRetriableError(`Invalid groupIds array ${groupIds}`)\n }\n\n const invalidGroupId = groupIds.some(g => typeof g !== 'string')\n\n if (invalidGroupId) {\n throw new KafkaJSNonRetriableError(`Invalid groupId name: ${JSON.stringify(invalidGroupId)}`)\n }\n\n const retrier = createRetry(retry)\n\n let results = []\n\n let clonedGroupIds = groupIds.slice()\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n if (clonedGroupIds.length === 0) return []\n\n await cluster.refreshMetadata()\n\n const brokersPerGroups = {}\n const brokersPerNode = {}\n for (const groupId of clonedGroupIds) {\n const broker = await cluster.findGroupCoordinator({ groupId })\n if (brokersPerGroups[broker.nodeId] === undefined) brokersPerGroups[broker.nodeId] = []\n brokersPerGroups[broker.nodeId].push(groupId)\n brokersPerNode[broker.nodeId] = broker\n }\n\n const res = await Promise.all(\n Object.keys(brokersPerNode).map(\n async nodeId => await brokersPerNode[nodeId].deleteGroups(brokersPerGroups[nodeId])\n )\n )\n\n const errors = flatten(\n res.map(({ results }) =>\n results.map(({ groupId, errorCode, error }) => {\n return { groupId, errorCode, error }\n })\n )\n ).filter(({ errorCode }) => errorCode !== 0)\n\n clonedGroupIds = errors.map(({ groupId }) => groupId)\n\n if (errors.length > 0) throw new KafkaJSDeleteGroupsError('Error in DeleteGroups', errors)\n\n results = flatten(res.map(({ results }) => results))\n\n return results\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER' || e.type === 'COORDINATOR_NOT_AVAILABLE') {\n logger.warn('Could not delete groups', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Delete topic records up to the selected partition offsets\n *\n * @param {string} topic\n * @param {Array} partitions\n * @return {Promise}\n *\n * @typedef {Object} SeekEntry\n * @property {number} partition\n * @property {string} offset\n */\n const deleteTopicRecords = async ({ topic, partitions }) => {\n if (!topic || typeof topic !== 'string') {\n throw new KafkaJSNonRetriableError(`Invalid topic \"${topic}\"`)\n }\n\n if (!partitions || partitions.length === 0) {\n throw new KafkaJSNonRetriableError(`Invalid partitions`)\n }\n\n const partitionsByBroker = cluster.findLeaderForPartitions(\n topic,\n partitions.map(p => p.partition)\n )\n\n const partitionsFound = flatten(values(partitionsByBroker))\n const topicOffsets = await fetchTopicOffsets(topic)\n\n const leaderNotFoundErrors = []\n partitions.forEach(({ partition, offset }) => {\n // throw if no leader found for partition\n if (!partitionsFound.includes(partition)) {\n leaderNotFoundErrors.push({\n partition,\n offset,\n error: new KafkaJSBrokerNotFound('Could not find the leader for the partition', {\n retriable: false,\n }),\n })\n return\n }\n const { low } = topicOffsets.find(p => p.partition === partition) || {\n high: undefined,\n low: undefined,\n }\n // warn in case of offset below low watermark\n if (parseInt(offset) < parseInt(low) && parseInt(offset) !== -1) {\n logger.warn(\n 'The requested offset is before the earliest offset maintained on the partition - no records will be deleted from this partition',\n {\n topic,\n partition,\n offset,\n }\n )\n }\n })\n\n if (leaderNotFoundErrors.length > 0) {\n throw new KafkaJSDeleteTopicRecordsError({ topic, partitions: leaderNotFoundErrors })\n }\n\n const seekEntriesByBroker = entries(partitionsByBroker).reduce(\n (obj, [nodeId, nodePartitions]) => {\n obj[nodeId] = {\n topic,\n partitions: partitions.filter(p => nodePartitions.includes(p.partition)),\n }\n return obj\n },\n {}\n )\n\n const retrier = createRetry(retry)\n return retrier(async bail => {\n try {\n const partitionErrors = []\n\n const brokerRequests = entries(seekEntriesByBroker).map(\n ([nodeId, { topic, partitions }]) => async () => {\n const broker = await cluster.findBroker({ nodeId })\n await broker.deleteRecords({ topics: [{ topic, partitions }] })\n // remove successful entry so it's ignored on retry\n delete seekEntriesByBroker[nodeId]\n }\n )\n\n await Promise.all(\n brokerRequests.map(request =>\n request().catch(e => {\n if (e.name === 'KafkaJSDeleteTopicRecordsError') {\n e.partitions.forEach(({ partition, offset, error }) => {\n partitionErrors.push({\n partition,\n offset,\n error,\n })\n })\n } else {\n // then it's an unknown error, not from the broker response\n throw e\n }\n })\n )\n )\n\n if (partitionErrors.length > 0) {\n throw new KafkaJSDeleteTopicRecordsError({\n topic,\n partitions: partitionErrors,\n })\n }\n } catch (e) {\n if (\n e.retriable &&\n e.partitions.some(\n ({ error }) => staleMetadata(error) || error.name === 'KafkaJSMetadataNotLoaded'\n )\n ) {\n await cluster.refreshMetadata()\n }\n throw e\n }\n })\n }\n\n /**\n * @param {Array} acl\n * @return {Promise}\n *\n * @typedef {Object} ACLEntry\n */\n const createAcls = async ({ acl }) => {\n if (!acl || !Array.isArray(acl)) {\n throw new KafkaJSNonRetriableError(`Invalid ACL array ${acl}`)\n }\n if (acl.length === 0) {\n throw new KafkaJSNonRetriableError('Empty ACL array')\n }\n\n // Validate principal\n if (acl.some(({ principal }) => typeof principal !== 'string')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL array, the principals have to be a valid string'\n )\n }\n\n // Validate host\n if (acl.some(({ host }) => typeof host !== 'string')) {\n throw new KafkaJSNonRetriableError('Invalid ACL array, the hosts have to be a valid string')\n }\n\n // Validate resourceName\n if (acl.some(({ resourceName }) => typeof resourceName !== 'string')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL array, the resourceNames have to be a valid string'\n )\n }\n\n let invalidType\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n invalidType = acl.find(i => !validOperationTypes.includes(i.operation))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid operation type ${invalidType.operation}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourcePatternTypes\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n invalidType = acl.find(i => !validResourcePatternTypes.includes(i.resourcePatternType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern type ${invalidType.resourcePatternType}: ${JSON.stringify(\n invalidType\n )}`\n )\n }\n\n // Validate permissionTypes\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n invalidType = acl.find(i => !validPermissionTypes.includes(i.permissionType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid permission type ${invalidType.permissionType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourceTypes\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n invalidType = acl.find(i => !validResourceTypes.includes(i.resourceType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.resourceType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n await broker.createAcls({ acl })\n\n return true\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not create ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {ACLResourceTypes} resourceType The type of resource\n * @param {string} resourceName The name of the resource\n * @param {ACLResourcePatternTypes} resourcePatternType The resource pattern type filter\n * @param {string} principal The principal name\n * @param {string} host The hostname\n * @param {ACLOperationTypes} operation The type of operation\n * @param {ACLPermissionTypes} permissionType The type of permission\n * @return {Promise}\n *\n * @typedef {number} ACLResourceTypes\n * @typedef {number} ACLResourcePatternTypes\n * @typedef {number} ACLOperationTypes\n * @typedef {number} ACLPermissionTypes\n */\n const describeAcls = async ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) => {\n // Validate principal\n if (typeof principal !== 'string' && typeof principal !== 'undefined') {\n throw new KafkaJSNonRetriableError(\n 'Invalid principal, the principal have to be a valid string'\n )\n }\n\n // Validate host\n if (typeof host !== 'string' && typeof host !== 'undefined') {\n throw new KafkaJSNonRetriableError('Invalid host, the host have to be a valid string')\n }\n\n // Validate resourceName\n if (typeof resourceName !== 'string' && typeof resourceName !== 'undefined') {\n throw new KafkaJSNonRetriableError(\n 'Invalid resourceName, the resourceName have to be a valid string'\n )\n }\n\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n if (!validOperationTypes.includes(operation)) {\n throw new KafkaJSNonRetriableError(`Invalid operation type ${operation}`)\n }\n\n // Validate resourcePatternType\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n if (!validResourcePatternTypes.includes(resourcePatternType)) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern filter type ${resourcePatternType}`\n )\n }\n\n // Validate permissionType\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n if (!validPermissionTypes.includes(permissionType)) {\n throw new KafkaJSNonRetriableError(`Invalid permission type ${permissionType}`)\n }\n\n // Validate resourceType\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n if (!validResourceTypes.includes(resourceType)) {\n throw new KafkaJSNonRetriableError(`Invalid resource type ${resourceType}`)\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n const { resources } = await broker.describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n })\n return { resources }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not describe ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {Array} filters\n * @return {Promise}\n *\n * @typedef {Object} ACLFilter\n */\n const deleteAcls = async ({ filters }) => {\n if (!filters || !Array.isArray(filters)) {\n throw new KafkaJSNonRetriableError(`Invalid ACL Filter array ${filters}`)\n }\n\n if (filters.length === 0) {\n throw new KafkaJSNonRetriableError('Empty ACL Filter array')\n }\n\n // Validate principal\n if (\n filters.some(\n ({ principal }) => typeof principal !== 'string' && typeof principal !== 'undefined'\n )\n ) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the principals have to be a valid string'\n )\n }\n\n // Validate host\n if (filters.some(({ host }) => typeof host !== 'string' && typeof host !== 'undefined')) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the hosts have to be a valid string'\n )\n }\n\n // Validate resourceName\n if (\n filters.some(\n ({ resourceName }) =>\n typeof resourceName !== 'string' && typeof resourceName !== 'undefined'\n )\n ) {\n throw new KafkaJSNonRetriableError(\n 'Invalid ACL Filter array, the resourceNames have to be a valid string'\n )\n }\n\n let invalidType\n // Validate operation\n const validOperationTypes = Object.values(ACL_OPERATION_TYPES)\n invalidType = filters.find(i => !validOperationTypes.includes(i.operation))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid operation type ${invalidType.operation}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourcePatternTypes\n const validResourcePatternTypes = Object.values(RESOURCE_PATTERN_TYPES)\n invalidType = filters.find(i => !validResourcePatternTypes.includes(i.resourcePatternType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource pattern type ${invalidType.resourcePatternType}: ${JSON.stringify(\n invalidType\n )}`\n )\n }\n\n // Validate permissionTypes\n const validPermissionTypes = Object.values(ACL_PERMISSION_TYPES)\n invalidType = filters.find(i => !validPermissionTypes.includes(i.permissionType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid permission type ${invalidType.permissionType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n // Validate resourceTypes\n const validResourceTypes = Object.values(ACL_RESOURCE_TYPES)\n invalidType = filters.find(i => !validResourceTypes.includes(i.resourceType))\n\n if (invalidType) {\n throw new KafkaJSNonRetriableError(\n `Invalid resource type ${invalidType.resourceType}: ${JSON.stringify(invalidType)}`\n )\n }\n\n const retrier = createRetry(retry)\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadata()\n const broker = await cluster.findControllerBroker()\n const { filterResponses } = await broker.deleteAcls({ filters })\n return { filterResponses }\n } catch (e) {\n if (e.type === 'NOT_CONTROLLER') {\n logger.warn('Could not delete ACL', { error: e.message, retryCount, retryTime })\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /** @type {import(\"../../types\").Admin[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * @return {Object} logger\n */\n const getLogger = () => logger\n\n return {\n connect,\n disconnect,\n listTopics,\n createTopics,\n deleteTopics,\n createPartitions,\n getTopicMetadata,\n fetchTopicMetadata,\n describeCluster,\n events,\n fetchOffsets,\n fetchTopicOffsets,\n fetchTopicOffsetsByTimestamp,\n setOffsets,\n resetOffsets,\n describeConfigs,\n alterConfigs,\n on,\n logger: getLogger,\n listGroups,\n describeGroups,\n deleteGroups,\n describeAcls,\n deleteAcls,\n createAcls,\n deleteTopicRecords,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst networkEvents = require('../network/instrumentationEvents')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst adminType = InstrumentationEventType('admin')\n\nconst events = {\n CONNECT: adminType('connect'),\n DISCONNECT: adminType('disconnect'),\n REQUEST: adminType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: adminType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: adminType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const Long = require('../utils/long')\nconst Lock = require('../utils/lock')\nconst { Types: Compression } = require('../protocol/message/compression')\nconst { requests, lookup } = require('../protocol/requests')\nconst { KafkaJSNonRetriableError } = require('../errors')\nconst apiKeys = require('../protocol/requests/apiKeys')\nconst SASLAuthenticator = require('./saslAuthenticator')\nconst shuffle = require('../utils/shuffle')\nconst { ApiVersions: apiVersionsApiKey } = require('../protocol/requests/apiKeys')\nconst sharedPromiseTo = require('../utils/sharedPromiseTo')\n\nconst PRIVATE = {\n SHOULD_REAUTHENTICATE: Symbol('private:Broker:shouldReauthenticate'),\n SEND_REQUEST: Symbol('private:Broker:sendRequest'),\n AUTHENTICATE: Symbol('private:Broker:authenticate'),\n}\n\n/** @type {import(\"../protocol/requests\").Lookup} */\nconst notInitializedLookup = () => {\n throw new Error('Broker not connected')\n}\n\n/**\n * @param request - request from protocol\n * @returns {boolean}\n */\nconst isAuthenticatedRequest = request => {\n return request.apiKey !== apiVersionsApiKey\n}\n\n/**\n * Each node in a Kafka cluster is called broker. This class contains\n * the high-level operations a node can perform.\n *\n * @type {import(\"../../types\").Broker}\n */\nmodule.exports = class Broker {\n /**\n * @param {Object} options\n * @param {import(\"../network/connection\")} options.connection\n * @param {import(\"../../types\").Logger} options.logger\n * @param {number} [options.nodeId]\n * @param {import(\"../../types\").ApiVersions} [options.versions=null] The object with all available versions and APIs\n * supported by this cluster. The output of broker#apiVersions\n * @param {number} [options.authenticationTimeout=1000]\n * @param {number} [options.reauthenticationThreshold=10000]\n * @param {boolean} [options.allowAutoTopicCreation=true] If this and the broker config 'auto.create.topics.enable'\n * are true, topics that don't exist will be created when\n * fetching metadata.\n * @param {boolean} [options.supportAuthenticationProtocol=null] If the server supports the SASLAuthenticate protocol\n */\n constructor({\n connection,\n logger,\n nodeId = null,\n versions = null,\n authenticationTimeout = 1000,\n reauthenticationThreshold = 10000,\n allowAutoTopicCreation = true,\n supportAuthenticationProtocol = null,\n }) {\n this.connection = connection\n this.nodeId = nodeId\n this.rootLogger = logger\n this.logger = logger.namespace('Broker')\n this.versions = versions\n this.authenticationTimeout = authenticationTimeout\n this.reauthenticationThreshold = reauthenticationThreshold\n this.allowAutoTopicCreation = allowAutoTopicCreation\n this.supportAuthenticationProtocol = supportAuthenticationProtocol\n\n this.authenticatedAt = null\n this.sessionLifetime = Long.ZERO\n\n // The lock timeout has twice the connectionTimeout because the same timeout is used\n // for the first apiVersions call\n const lockTimeout = 2 * this.connection.connectionTimeout + this.authenticationTimeout\n this.brokerAddress = `${this.connection.host}:${this.connection.port}`\n\n this.lock = new Lock({\n timeout: lockTimeout,\n description: `connect to broker ${this.brokerAddress}`,\n })\n\n this.lookupRequest = notInitializedLookup\n\n /**\n * @private\n * @returns {Promise}\n */\n this[PRIVATE.AUTHENTICATE] = sharedPromiseTo(async () => {\n if (this.connection.sasl && !this.isAuthenticated()) {\n const authenticator = new SASLAuthenticator(\n this.connection,\n this.rootLogger,\n this.versions,\n this.supportAuthenticationProtocol\n )\n\n await authenticator.authenticate()\n this.authenticatedAt = process.hrtime()\n this.sessionLifetime = Long.fromValue(authenticator.sessionLifetime)\n }\n })\n }\n\n /**\n * @public\n * @returns {boolean}\n */\n isAuthenticated() {\n return this.authenticatedAt != null && !this[PRIVATE.SHOULD_REAUTHENTICATE]()\n }\n\n /**\n * @public\n * @returns {boolean}\n */\n isConnected() {\n const { connected, sasl } = this.connection\n return sasl ? connected && this.isAuthenticated() : connected\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n try {\n await this.lock.acquire()\n if (this.isConnected()) {\n return\n }\n\n this.authenticatedAt = null\n await this.connection.connect()\n\n if (!this.versions) {\n this.versions = await this.apiVersions()\n }\n\n this.lookupRequest = lookup(this.versions)\n\n if (this.supportAuthenticationProtocol === null) {\n try {\n this.lookupRequest(apiKeys.SaslAuthenticate, requests.SaslAuthenticate)\n this.supportAuthenticationProtocol = true\n } catch (_) {\n this.supportAuthenticationProtocol = false\n }\n\n this.logger.debug(`Verified support for SaslAuthenticate`, {\n broker: this.brokerAddress,\n supportAuthenticationProtocol: this.supportAuthenticationProtocol,\n })\n }\n\n await this[PRIVATE.AUTHENTICATE]()\n } finally {\n await this.lock.release()\n }\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.authenticatedAt = null\n await this.connection.disconnect()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async apiVersions() {\n let response\n const availableVersions = requests.ApiVersions.versions\n .map(Number)\n .sort()\n .reverse()\n\n // Find the best version implemented by the server\n for (const candidateVersion of availableVersions) {\n try {\n const apiVersions = requests.ApiVersions.protocol({ version: candidateVersion })\n response = await this[PRIVATE.SEND_REQUEST]({\n ...apiVersions(),\n requestTimeout: this.connection.connectionTimeout,\n })\n break\n } catch (e) {\n if (e.type !== 'UNSUPPORTED_VERSION') {\n throw e\n }\n }\n }\n\n if (!response) {\n throw new KafkaJSNonRetriableError('API Versions not supported')\n }\n\n return response.apiVersions.reduce(\n (obj, version) =>\n Object.assign(obj, {\n [version.apiKey]: {\n minVersion: version.minVersion,\n maxVersion: version.maxVersion,\n },\n }),\n {}\n )\n }\n\n /**\n * @public\n * @type {import(\"../../types\").Broker['metadata']}\n * @param {string[]} [topics=[]] An array of topics to fetch metadata for.\n * If no topics are specified fetch metadata for all topics\n */\n async metadata(topics = []) {\n const metadata = this.lookupRequest(apiKeys.Metadata, requests.Metadata)\n const shuffledTopics = shuffle(topics)\n return await this[PRIVATE.SEND_REQUEST](\n metadata({ topics: shuffledTopics, allowAutoTopicCreation: this.allowAutoTopicCreation })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {Array} request.topicData An array of messages per topic and per partition, example:\n * [\n * {\n * topic: 'test-topic-1',\n * partitions: [\n * {\n * partition: 0,\n * firstSequence: 0,\n * messages: [\n * { key: '1', value: 'A' },\n * { key: '2', value: 'B' },\n * ]\n * },\n * {\n * partition: 1,\n * firstSequence: 0,\n * messages: [\n * { key: '3', value: 'C' },\n * ]\n * }\n * ]\n * },\n * {\n * topic: 'test-topic-2',\n * partitions: [\n * {\n * partition: 4,\n * firstSequence: 0,\n * messages: [\n * { key: '32', value: 'E' },\n * ]\n * },\n * ]\n * },\n * ]\n * @param {number} [request.acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n * @param {number} [request.timeout=30000] The time to await a response in ms\n * @param {string} [request.transactionalId=null]\n * @param {number} [request.producerId=-1] Broker assigned producerId\n * @param {number} [request.producerEpoch=0] Broker assigned producerEpoch\n * @param {import(\"../../types\").CompressionTypes} [request.compression=CompressionTypes.None] Compression codec\n * @returns {Promise}\n */\n async produce({\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n acks = -1,\n timeout = 30000,\n compression = Compression.None,\n }) {\n const produce = this.lookupRequest(apiKeys.Produce, requests.Produce)\n return await this[PRIVATE.SEND_REQUEST](\n produce({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {number} [request.replicaId=-1] Broker id of the follower. For normal consumers, use -1\n * @param {number} [request.isolationLevel=1] This setting controls the visibility of transactional records. Default READ_COMMITTED.\n * @param {number} [request.maxWaitTime=5000] Maximum time in ms to wait for the response\n * @param {number} [request.minBytes=1] Minimum bytes to accumulate in the response\n * @param {number} [request.maxBytes=10485760] Maximum bytes to accumulate in the response. Note that this is\n * not an absolute maximum, if the first message in the first non-empty\n * partition of the fetch is larger than this value, the message will still\n * be returned to ensure that progress can be made. Default 10MB.\n * @param {Array} request.topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n * @param {string} [request.rackId=''] A rack identifier for this client. This can be any string value which indicates where this\n * client is physically located. It corresponds with the broker config `broker.rack`.\n * @returns {Promise}\n */\n async fetch({\n replicaId,\n isolationLevel,\n maxWaitTime = 5000,\n minBytes = 1,\n maxBytes = 10485760,\n topics,\n rackId = '',\n }) {\n // TODO: validate topics not null/empty\n const fetch = this.lookupRequest(apiKeys.Fetch, requests.Fetch)\n\n // Shuffle topic-partitions to ensure fair response allocation across partitions (KIP-74)\n const flattenedTopicPartitions = topics.reduce((topicPartitions, { topic, partitions }) => {\n partitions.forEach(partition => {\n topicPartitions.push({ topic, partition })\n })\n return topicPartitions\n }, [])\n\n const shuffledTopicPartitions = shuffle(flattenedTopicPartitions)\n\n // Consecutive partitions for the same topic can be combined into a single `topic` entry\n const consolidatedTopicPartitions = shuffledTopicPartitions.reduce(\n (topicPartitions, { topic, partition }) => {\n const last = topicPartitions[topicPartitions.length - 1]\n\n if (last != null && last.topic === topic) {\n topicPartitions[topicPartitions.length - 1].partitions.push(partition)\n } else {\n topicPartitions.push({ topic, partitions: [partition] })\n }\n\n return topicPartitions\n },\n []\n )\n\n return await this[PRIVATE.SEND_REQUEST](\n fetch({\n replicaId,\n isolationLevel,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics: consolidatedTopicPartitions,\n rackId,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The group id\n * @param {number} request.groupGenerationId The generation of the group\n * @param {string} request.memberId The member id assigned by the group coordinator\n * @returns {Promise}\n */\n async heartbeat({ groupId, groupGenerationId, memberId }) {\n const heartbeat = this.lookupRequest(apiKeys.Heartbeat, requests.Heartbeat)\n return await this[PRIVATE.SEND_REQUEST](heartbeat({ groupId, groupGenerationId, memberId }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The unique group id\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} request.coordinatorType The type of coordinator to find\n * @returns {Promise}\n */\n async findGroupCoordinator({ groupId, coordinatorType }) {\n // TODO: validate groupId, mandatory\n const findCoordinator = this.lookupRequest(apiKeys.GroupCoordinator, requests.GroupCoordinator)\n return await this[PRIVATE.SEND_REQUEST](findCoordinator({ groupId, coordinatorType }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId The unique group id\n * @param {number} request.sessionTimeout The coordinator considers the consumer dead if it receives\n * no heartbeat after this timeout in ms\n * @param {number} request.rebalanceTimeout The maximum time that the coordinator will wait for each member\n * to rejoin when rebalancing the group\n * @param {string} [request.memberId=\"\"] The assigned consumer id or an empty string for a new consumer\n * @param {string} [request.protocolType=\"consumer\"] Unique name for class of protocols implemented by group\n * @param {Array} request.groupProtocols List of protocols that the member supports (assignment strategy)\n * [{ name: 'AssignerName', metadata: '{\"version\": 1, \"topics\": []}' }]\n * @returns {Promise}\n */\n async joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId = '',\n protocolType = 'consumer',\n groupProtocols,\n }) {\n const joinGroup = this.lookupRequest(apiKeys.JoinGroup, requests.JoinGroup)\n const makeRequest = (assignedMemberId = memberId) =>\n this[PRIVATE.SEND_REQUEST](\n joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId: assignedMemberId,\n protocolType,\n groupProtocols,\n })\n )\n\n try {\n return await makeRequest()\n } catch (error) {\n if (error.name === 'KafkaJSMemberIdRequired') {\n return makeRequest(error.memberId)\n }\n\n throw error\n }\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {string} request.memberId\n * @returns {Promise}\n */\n async leaveGroup({ groupId, memberId }) {\n const leaveGroup = this.lookupRequest(apiKeys.LeaveGroup, requests.LeaveGroup)\n return await this[PRIVATE.SEND_REQUEST](leaveGroup({ groupId, memberId }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {number} request.generationId\n * @param {string} request.memberId\n * @param {object} request.groupAssignment\n * @returns {Promise}\n */\n async syncGroup({ groupId, generationId, memberId, groupAssignment }) {\n const syncGroup = this.lookupRequest(apiKeys.SyncGroup, requests.SyncGroup)\n return await this[PRIVATE.SEND_REQUEST](\n syncGroup({\n groupId,\n generationId,\n memberId,\n groupAssignment,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {number} request.replicaId=-1 Broker id of the follower. For normal consumers, use -1\n * @param {number} request.isolationLevel=1 This setting controls the visibility of transactional records (default READ_COMMITTED, Kafka >0.11 only)\n * @param {TopicPartitionOffset[]} request.topics e.g:\n *\n * @typedef {Object} TopicPartitionOffset\n * @property {string} topic\n * @property {PartitionOffset[]} partitions\n *\n * @typedef {Object} PartitionOffset\n * @property {number} partition\n * @property {number} [timestamp=-1]\n *\n *\n * @returns {Promise}\n */\n async listOffsets({ replicaId, isolationLevel, topics }) {\n const listOffsets = this.lookupRequest(apiKeys.ListOffsets, requests.ListOffsets)\n const result = await this[PRIVATE.SEND_REQUEST](\n listOffsets({ replicaId, isolationLevel, topics })\n )\n\n // ListOffsets >= v1 will return a single `offset` rather than an array of `offsets` (ListOffsets V0).\n // Normalize to just return `offset`.\n for (const response of result.responses) {\n response.partitions = response.partitions.map(({ offsets, ...partitionData }) => {\n return offsets ? { ...partitionData, offset: offsets.pop() } : partitionData\n })\n }\n\n return result\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {number} request.groupGenerationId\n * @param {string} request.memberId\n * @param {number} [request.retentionTime=-1] -1 signals to the broker that its default configuration\n * should be used.\n * @param {object} request.topics Topics to commit offsets, e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * { partition: 0, offset: '11' }\n * ]\n * }\n * ]\n * @returns {Promise}\n */\n async offsetCommit({ groupId, groupGenerationId, memberId, retentionTime, topics }) {\n const offsetCommit = this.lookupRequest(apiKeys.OffsetCommit, requests.OffsetCommit)\n return await this[PRIVATE.SEND_REQUEST](\n offsetCommit({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string} request.groupId\n * @param {object} request.topics - If the topic array is null fetch offsets for all topics. e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * { partition: 0 }\n * ]\n * }\n * ]\n * @returns {Promise}\n */\n async offsetFetch({ groupId, topics }) {\n const offsetFetch = this.lookupRequest(apiKeys.OffsetFetch, requests.OffsetFetch)\n return await this[PRIVATE.SEND_REQUEST](offsetFetch({ groupId, topics }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.groupIds\n * @returns {Promise}\n */\n async describeGroups({ groupIds }) {\n const describeGroups = this.lookupRequest(apiKeys.DescribeGroups, requests.DescribeGroups)\n return await this[PRIVATE.SEND_REQUEST](describeGroups({ groupIds }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.topics e.g:\n * [\n * {\n * topic: 'topic-name',\n * numPartitions: 1,\n * replicationFactor: 1\n * }\n * ]\n * @param {boolean} [request.validateOnly=false] If this is true, the request will be validated, but the topic\n * won't be created\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely created\n * on the controller node\n * @returns {Promise}\n */\n async createTopics({ topics, validateOnly = false, timeout = 5000 }) {\n const createTopics = this.lookupRequest(apiKeys.CreateTopics, requests.CreateTopics)\n return await this[PRIVATE.SEND_REQUEST](createTopics({ topics, validateOnly, timeout }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {Array} request.topicPartitions e.g:\n * [\n * {\n * topic: 'topic-name',\n * count: 3,\n * assignments: []\n * }\n * ]\n * @param {boolean} [request.validateOnly=false] If this is true, the request will be validated, but the topic\n * won't be created\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely created\n * on the controller node\n * @returns {Promise}\n */\n async createPartitions({ topicPartitions, validateOnly = false, timeout = 5000 }) {\n const createPartitions = this.lookupRequest(apiKeys.CreatePartitions, requests.CreatePartitions)\n return await this[PRIVATE.SEND_REQUEST](\n createPartitions({ topicPartitions, validateOnly, timeout })\n )\n }\n\n /**\n * @public\n * @param {object} request\n * @param {string[]} request.topics An array of topics to be deleted\n * @param {number} [request.timeout=5000] The time in ms to wait for a topic to be completely deleted on the\n * controller node. Values <= 0 will trigger topic deletion and return\n * immediately\n * @returns {Promise}\n */\n async deleteTopics({ topics, timeout = 5000 }) {\n const deleteTopics = this.lookupRequest(apiKeys.DeleteTopics, requests.DeleteTopics)\n return await this[PRIVATE.SEND_REQUEST](deleteTopics({ topics, timeout }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").ResourceConfigQuery[]} request.resources\n * [{\n * type: RESOURCE_TYPES.TOPIC,\n * name: 'topic-name',\n * configNames: ['compression.type', 'retention.ms']\n * }]\n * @param {boolean} [request.includeSynonyms=false]\n * @returns {Promise}\n */\n async describeConfigs({ resources, includeSynonyms = false }) {\n const describeConfigs = this.lookupRequest(apiKeys.DescribeConfigs, requests.DescribeConfigs)\n return await this[PRIVATE.SEND_REQUEST](describeConfigs({ resources, includeSynonyms }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").IResourceConfig[]} request.resources\n * [{\n * type: RESOURCE_TYPES.TOPIC,\n * name: 'topic-name',\n * configEntries: [\n * {\n * name: 'cleanup.policy',\n * value: 'compact'\n * }\n * ]\n * }]\n * @param {boolean} [request.validateOnly=false]\n * @returns {Promise}\n */\n async alterConfigs({ resources, validateOnly = false }) {\n const alterConfigs = this.lookupRequest(apiKeys.AlterConfigs, requests.AlterConfigs)\n return await this[PRIVATE.SEND_REQUEST](alterConfigs({ resources, validateOnly }))\n }\n\n /**\n * Send an `InitProducerId` request to fetch a PID and bump the producer epoch.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {number} request.transactionTimeout The time in ms to wait for before aborting idle transactions\n * @param {number} [request.transactionalId] The transactional id or null if the producer is not transactional\n * @returns {Promise}\n */\n async initProducerId({ transactionalId, transactionTimeout }) {\n const initProducerId = this.lookupRequest(apiKeys.InitProducerId, requests.InitProducerId)\n return await this[PRIVATE.SEND_REQUEST](initProducerId({ transactionalId, transactionTimeout }))\n }\n\n /**\n * Send an `AddPartitionsToTxn` request to mark a TopicPartition as participating in the transaction.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {object[]} request.topics e.g:\n * [\n * {\n * topic: 'topic-name',\n * partitions: [ 0, 1]\n * }\n * ]\n * @returns {Promise}\n */\n async addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics }) {\n const addPartitionsToTxn = this.lookupRequest(\n apiKeys.AddPartitionsToTxn,\n requests.AddPartitionsToTxn\n )\n return await this[PRIVATE.SEND_REQUEST](\n addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics })\n )\n }\n\n /**\n * Send an `AddOffsetsToTxn` request.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {string} request.groupId The unique group identifier (for the consumer group)\n * @returns {Promise}\n */\n async addOffsetsToTxn({ transactionalId, producerId, producerEpoch, groupId }) {\n const addOffsetsToTxn = this.lookupRequest(apiKeys.AddOffsetsToTxn, requests.AddOffsetsToTxn)\n return await this[PRIVATE.SEND_REQUEST](\n addOffsetsToTxn({ transactionalId, producerId, producerEpoch, groupId })\n )\n }\n\n /**\n * Send a `TxnOffsetCommit` request to persist the offsets in the `__consumer_offsets` topics.\n *\n * Request should be made to the consumer coordinator.\n * @public\n * @param {object} request\n * @param {OffsetCommitTopic[]} request.topics\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {string} request.groupId The unique group identifier (for the consumer group)\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {OffsetCommitTopic[]} request.topics\n *\n * @typedef {Object} OffsetCommitTopic\n * @property {string} topic\n * @property {OffsetCommitTopicPartition[]} partitions\n *\n * @typedef {Object} OffsetCommitTopicPartition\n * @property {number} partition\n * @property {number} offset\n * @property {string} [metadata]\n *\n * @returns {Promise}\n */\n async txnOffsetCommit({ transactionalId, groupId, producerId, producerEpoch, topics }) {\n const txnOffsetCommit = this.lookupRequest(apiKeys.TxnOffsetCommit, requests.TxnOffsetCommit)\n return await this[PRIVATE.SEND_REQUEST](\n txnOffsetCommit({ transactionalId, groupId, producerId, producerEpoch, topics })\n )\n }\n\n /**\n * Send an `EndTxn` request to indicate transaction should be committed or aborted.\n *\n * Request should be made to the transaction coordinator.\n * @public\n * @param {object} request\n * @param {string} request.transactionalId The transactional id corresponding to the transaction.\n * @param {number} request.producerId Current producer id in use by the transactional id.\n * @param {number} request.producerEpoch Current epoch associated with the producer id.\n * @param {boolean} request.transactionResult The result of the transaction (false = ABORT, true = COMMIT)\n * @returns {Promise}\n */\n async endTxn({ transactionalId, producerId, producerEpoch, transactionResult }) {\n const endTxn = this.lookupRequest(apiKeys.EndTxn, requests.EndTxn)\n return await this[PRIVATE.SEND_REQUEST](\n endTxn({ transactionalId, producerId, producerEpoch, transactionResult })\n )\n }\n\n /**\n * Send request for list of groups\n * @public\n * @returns {Promise}\n */\n async listGroups() {\n const listGroups = this.lookupRequest(apiKeys.ListGroups, requests.ListGroups)\n return await this[PRIVATE.SEND_REQUEST](listGroups())\n }\n\n /**\n * Send request to delete groups\n * @param {string[]} groupIds\n * @public\n * @returns {Promise}\n */\n async deleteGroups(groupIds) {\n const deleteGroups = this.lookupRequest(apiKeys.DeleteGroups, requests.DeleteGroups)\n return await this[PRIVATE.SEND_REQUEST](deleteGroups(groupIds))\n }\n\n /**\n * Send request to delete records\n * @public\n * @param {object} request\n * @param {TopicPartitionRecords[]} request.topics\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, offset 2 },\n * { partition: 1, offset 4 },\n * ],\n * }\n * ]\n * @returns {Promise} example:\n * {\n * throttleTime: 0\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, lowWatermark: '2n', errorCode: 0 },\n * { partition: 1, lowWatermark: '4n', errorCode: 0 },\n * ],\n * },\n * ]\n * }\n *\n * @typedef {object} TopicPartitionRecords\n * @property {string} topic\n * @property {PartitionRecord[]} partitions\n *\n * @typedef {object} PartitionRecord\n * @property {number} partition\n * @property {number} offset\n */\n async deleteRecords({ topics }) {\n const deleteRecords = this.lookupRequest(apiKeys.DeleteRecords, requests.DeleteRecords)\n return await this[PRIVATE.SEND_REQUEST](deleteRecords({ topics }))\n }\n\n /**\n * @public\n * @param {object} request\n * @param {import(\"../../types\").AclEntry[]} request.acl e.g:\n * [\n * {\n * resourceType: AclResourceTypes.TOPIC,\n * resourceName: 'topic-name',\n * resourcePatternType: ResourcePatternTypes.LITERAL,\n * principal: 'User:bob',\n * host: '*',\n * operation: AclOperationTypes.ALL,\n * permissionType: AclPermissionTypes.DENY,\n * }\n * ]\n * @returns {Promise}\n */\n async createAcls({ acl }) {\n const createAcls = this.lookupRequest(apiKeys.CreateAcls, requests.CreateAcls)\n return await this[PRIVATE.SEND_REQUEST](createAcls({ creations: acl }))\n }\n\n /**\n * @public\n * @param {import(\"../../types\").AclEntry} aclEntry\n * @returns {Promise}\n */\n async describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) {\n const describeAcls = this.lookupRequest(apiKeys.DescribeAcls, requests.DescribeAcls)\n return await this[PRIVATE.SEND_REQUEST](\n describeAcls({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n })\n )\n }\n\n /**\n * @public\n * @param {Object} request\n * @param {import(\"../../types\").AclEntry[]} request.filters\n * @returns {Promise}\n */\n async deleteAcls({ filters }) {\n const deleteAcls = this.lookupRequest(apiKeys.DeleteAcls, requests.DeleteAcls)\n return await this[PRIVATE.SEND_REQUEST](deleteAcls({ filters }))\n }\n\n /***\n * @private\n */\n [PRIVATE.SHOULD_REAUTHENTICATE]() {\n if (this.sessionLifetime.equals(Long.ZERO)) {\n return false\n }\n\n if (this.authenticatedAt == null) {\n return true\n }\n\n const [secondsSince, remainingNanosSince] = process.hrtime(this.authenticatedAt)\n const millisSince = Long.fromValue(secondsSince)\n .multiply(1000)\n .add(Long.fromValue(remainingNanosSince).divide(1000000))\n\n const reauthenticateAt = millisSince.add(this.reauthenticationThreshold)\n return reauthenticateAt.greaterThanOrEqual(this.sessionLifetime)\n }\n\n /**\n * @private\n */\n async [PRIVATE.SEND_REQUEST](protocolRequest) {\n if (!this.isAuthenticated() && isAuthenticatedRequest(protocolRequest.request)) {\n await this[PRIVATE.AUTHENTICATE]()\n }\n try {\n return await this.connection.send(protocolRequest)\n } catch (e) {\n if (e.name === 'KafkaJSConnectionClosedError') {\n await this.disconnect()\n }\n\n throw e\n }\n }\n}\n","const awsIam = require('../../protocol/sasl/awsIam')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class AWSIAMAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLAWSIAMAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (!sasl.authorizationIdentity) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing authorizationIdentity')\n }\n if (!sasl.accessKeyId) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing accessKeyId')\n }\n if (!sasl.secretAccessKey) {\n throw new KafkaJSSASLAuthenticationError('SASL AWS-IAM: Missing secretAccessKey')\n }\n if (!sasl.sessionToken) {\n sasl.sessionToken = ''\n }\n\n const request = awsIam.request(sasl)\n const response = awsIam.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL AWS-IAM', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL AWS-IAM authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL AWS-IAM authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const { requests, lookup } = require('../../protocol/requests')\nconst apiKeys = require('../../protocol/requests/apiKeys')\nconst PlainAuthenticator = require('./plain')\nconst SCRAM256Authenticator = require('./scram256')\nconst SCRAM512Authenticator = require('./scram512')\nconst AWSIAMAuthenticator = require('./awsIam')\nconst OAuthBearerAuthenticator = require('./oauthBearer')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nconst AUTHENTICATORS = {\n PLAIN: PlainAuthenticator,\n 'SCRAM-SHA-256': SCRAM256Authenticator,\n 'SCRAM-SHA-512': SCRAM512Authenticator,\n AWS: AWSIAMAuthenticator,\n OAUTHBEARER: OAuthBearerAuthenticator,\n}\n\nconst SUPPORTED_MECHANISMS = Object.keys(AUTHENTICATORS)\nconst UNLIMITED_SESSION_LIFETIME = '0'\n\nmodule.exports = class SASLAuthenticator {\n constructor(connection, logger, versions, supportAuthenticationProtocol) {\n this.connection = connection\n this.logger = logger\n this.sessionLifetime = UNLIMITED_SESSION_LIFETIME\n\n const lookupRequest = lookup(versions)\n this.saslHandshake = lookupRequest(apiKeys.SaslHandshake, requests.SaslHandshake)\n this.protocolAuthentication = supportAuthenticationProtocol\n ? lookupRequest(apiKeys.SaslAuthenticate, requests.SaslAuthenticate)\n : null\n }\n\n async authenticate() {\n const mechanism = this.connection.sasl.mechanism.toUpperCase()\n if (!SUPPORTED_MECHANISMS.includes(mechanism)) {\n throw new KafkaJSSASLAuthenticationError(\n `SASL ${mechanism} mechanism is not supported by the client`\n )\n }\n\n const handshake = await this.connection.send(this.saslHandshake({ mechanism }))\n if (!handshake.enabledMechanisms.includes(mechanism)) {\n throw new KafkaJSSASLAuthenticationError(\n `SASL ${mechanism} mechanism is not supported by the server`\n )\n }\n\n const saslAuthenticate = async ({ request, response, authExpectResponse }) => {\n if (this.protocolAuthentication) {\n const { buffer: requestAuthBytes } = await request.encode()\n const authResponse = await this.connection.send(\n this.protocolAuthentication({ authBytes: requestAuthBytes })\n )\n\n // `0` is a string because `sessionLifetimeMs` is an int64 encoded as string.\n // This is not present in SaslAuthenticateV0, so we default to `\"0\"`\n this.sessionLifetime = authResponse.sessionLifetimeMs || UNLIMITED_SESSION_LIFETIME\n\n if (!authExpectResponse) {\n return\n }\n\n const { authBytes: responseAuthBytes } = authResponse\n const payloadDecoded = await response.decode(responseAuthBytes)\n return response.parse(payloadDecoded)\n }\n\n return this.connection.authenticate({ request, response, authExpectResponse })\n }\n\n const Authenticator = AUTHENTICATORS[mechanism]\n await new Authenticator(this.connection, this.logger, saslAuthenticate).authenticate()\n }\n}\n","/**\n * The sasl object must include a property named oauthBearerProvider, an\n * async function that is used to return the OAuth bearer token.\n *\n * The OAuth bearer token must be an object with properties value and\n * (optionally) extensions, that will be sent during the SASL/OAUTHBEARER\n * request.\n *\n * The implementation of the oauthBearerProvider must take care that tokens are\n * reused and refreshed when appropriate.\n */\n\nconst oauthBearer = require('../../protocol/sasl/oauthBearer')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class OAuthBearerAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLOAuthBearerAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (sasl.oauthBearerProvider == null) {\n throw new KafkaJSSASLAuthenticationError(\n 'SASL OAUTHBEARER: Missing OAuth bearer token provider'\n )\n }\n\n const { oauthBearerProvider } = sasl\n\n const oauthBearerToken = await oauthBearerProvider()\n\n if (oauthBearerToken.value == null) {\n throw new KafkaJSSASLAuthenticationError('SASL OAUTHBEARER: Invalid OAuth bearer token')\n }\n\n const request = await oauthBearer.request(sasl, oauthBearerToken)\n const response = oauthBearer.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL OAUTHBEARER', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL OAUTHBEARER authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL OAUTHBEARER authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const plain = require('../../protocol/sasl/plain')\nconst { KafkaJSSASLAuthenticationError } = require('../../errors')\n\nmodule.exports = class PlainAuthenticator {\n constructor(connection, logger, saslAuthenticate) {\n this.connection = connection\n this.logger = logger.namespace('SASLPlainAuthenticator')\n this.saslAuthenticate = saslAuthenticate\n }\n\n async authenticate() {\n const { sasl } = this.connection\n if (sasl.username == null || sasl.password == null) {\n throw new KafkaJSSASLAuthenticationError('SASL Plain: Invalid username or password')\n }\n\n const request = plain.request(sasl)\n const response = plain.response\n const { host, port } = this.connection\n const broker = `${host}:${port}`\n\n try {\n this.logger.debug('Authenticate with SASL PLAIN', { broker })\n await this.saslAuthenticate({ request, response })\n this.logger.debug('SASL PLAIN authentication successful', { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(\n `SASL PLAIN authentication failed: ${e.message}`\n )\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n}\n","const crypto = require('crypto')\nconst scram = require('../../protocol/sasl/scram')\nconst { KafkaJSSASLAuthenticationError, KafkaJSNonRetriableError } = require('../../errors')\n\nconst GS2_HEADER = 'n,,'\n\nconst EQUAL_SIGN_REGEX = /=/g\nconst COMMA_SIGN_REGEX = /,/g\n\nconst URLSAFE_BASE64_PLUS_REGEX = /\\+/g\nconst URLSAFE_BASE64_SLASH_REGEX = /\\//g\nconst URLSAFE_BASE64_TRAILING_EQUAL_REGEX = /=+$/\n\nconst HMAC_CLIENT_KEY = 'Client Key'\nconst HMAC_SERVER_KEY = 'Server Key'\n\nconst DIGESTS = {\n SHA256: {\n length: 32,\n type: 'sha256',\n minIterations: 4096,\n },\n SHA512: {\n length: 64,\n type: 'sha512',\n minIterations: 4096,\n },\n}\n\nconst encode64 = str => Buffer.from(str).toString('base64')\n\nclass SCRAM {\n /**\n * From https://tools.ietf.org/html/rfc5802#section-5.1\n *\n * The characters ',' or '=' in usernames are sent as '=2C' and\n * '=3D' respectively. If the server receives a username that\n * contains '=' not followed by either '2C' or '3D', then the\n * server MUST fail the authentication.\n *\n * @returns {String}\n */\n static sanitizeString(str) {\n return str.replace(EQUAL_SIGN_REGEX, '=3D').replace(COMMA_SIGN_REGEX, '=2C')\n }\n\n /**\n * In cryptography, a nonce is an arbitrary number that can be used just once.\n * It is similar in spirit to a nonce * word, hence the name. It is often a random or pseudo-random\n * number issued in an authentication protocol to * ensure that old communications cannot be reused\n * in replay attacks.\n *\n * @returns {String}\n */\n static nonce() {\n return crypto\n .randomBytes(16)\n .toString('base64')\n .replace(URLSAFE_BASE64_PLUS_REGEX, '-') // make it url safe\n .replace(URLSAFE_BASE64_SLASH_REGEX, '_')\n .replace(URLSAFE_BASE64_TRAILING_EQUAL_REGEX, '')\n .toString('ascii')\n }\n\n /**\n * Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the\n * pseudorandom function (PRF) and with dkLen == output length of\n * HMAC() == output length of H()\n *\n * @returns {Promise}\n */\n static hi(password, salt, iterations, digestDefinition) {\n return new Promise((resolve, reject) => {\n crypto.pbkdf2(\n password,\n salt,\n iterations,\n digestDefinition.length,\n digestDefinition.type,\n (err, derivedKey) => (err ? reject(err) : resolve(derivedKey))\n )\n })\n }\n\n /**\n * Apply the exclusive-or operation to combine the octet string\n * on the left of this operator with the octet string on the right of\n * this operator. The length of the output and each of the two\n * inputs will be the same for this use\n *\n * @returns {Buffer}\n */\n static xor(left, right) {\n const bufferA = Buffer.from(left)\n const bufferB = Buffer.from(right)\n const length = Buffer.byteLength(bufferA)\n\n if (length !== Buffer.byteLength(bufferB)) {\n throw new KafkaJSNonRetriableError('Buffers must be of the same length')\n }\n\n const result = []\n for (let i = 0; i < length; i++) {\n result.push(bufferA[i] ^ bufferB[i])\n }\n\n return Buffer.from(result)\n }\n\n /**\n * @param {Connection} connection\n * @param {Logger} logger\n * @param {Function} saslAuthenticate\n * @param {DigestDefinition} digestDefinition\n */\n constructor(connection, logger, saslAuthenticate, digestDefinition) {\n this.connection = connection\n this.logger = logger\n this.saslAuthenticate = saslAuthenticate\n this.digestDefinition = digestDefinition\n\n const digestType = digestDefinition.type.toUpperCase()\n this.PREFIX = `SASL SCRAM ${digestType} authentication`\n\n this.currentNonce = SCRAM.nonce()\n }\n\n async authenticate() {\n const { PREFIX } = this\n const { host, port, sasl } = this.connection\n const broker = `${host}:${port}`\n\n if (sasl.username == null || sasl.password == null) {\n throw new KafkaJSSASLAuthenticationError(`${this.PREFIX}: Invalid username or password`)\n }\n\n try {\n this.logger.debug('Exchanging first client message', { broker })\n const clientMessageResponse = await this.sendClientFirstMessage()\n\n this.logger.debug('Sending final message', { broker })\n const finalResponse = await this.sendClientFinalMessage(clientMessageResponse)\n\n if (finalResponse.e) {\n throw new Error(finalResponse.e)\n }\n\n const serverKey = await this.serverKey(clientMessageResponse)\n const serverSignature = this.serverSignature(serverKey, clientMessageResponse)\n\n if (finalResponse.v !== serverSignature) {\n throw new Error('Invalid server signature in server final message')\n }\n\n this.logger.debug(`${PREFIX} successful`, { broker })\n } catch (e) {\n const error = new KafkaJSSASLAuthenticationError(`${PREFIX} failed: ${e.message}`)\n this.logger.error(error.message, { broker })\n throw error\n }\n }\n\n /**\n * @private\n */\n async sendClientFirstMessage() {\n const clientFirstMessage = `${GS2_HEADER}${this.firstMessageBare()}`\n const request = scram.firstMessage.request({ clientFirstMessage })\n const response = scram.firstMessage.response\n\n return this.saslAuthenticate({\n authExpectResponse: true,\n request,\n response,\n })\n }\n\n /**\n * @private\n */\n async sendClientFinalMessage(clientMessageResponse) {\n const { PREFIX } = this\n const iterations = parseInt(clientMessageResponse.i, 10)\n const { minIterations } = this.digestDefinition\n\n if (!clientMessageResponse.r.startsWith(this.currentNonce)) {\n throw new KafkaJSSASLAuthenticationError(\n `${PREFIX} failed: Invalid server nonce, it does not start with the client nonce`\n )\n }\n\n if (iterations < minIterations) {\n throw new KafkaJSSASLAuthenticationError(\n `${PREFIX} failed: Requested iterations ${iterations} is less than the minimum ${minIterations}`\n )\n }\n\n const finalMessageWithoutProof = this.finalMessageWithoutProof(clientMessageResponse)\n const clientProof = await this.clientProof(clientMessageResponse)\n const finalMessage = `${finalMessageWithoutProof},p=${clientProof}`\n const request = scram.finalMessage.request({ finalMessage })\n const response = scram.finalMessage.response\n\n return this.saslAuthenticate({\n authExpectResponse: true,\n request,\n response,\n })\n }\n\n /**\n * @private\n */\n async clientProof(clientMessageResponse) {\n const clientKey = await this.clientKey(clientMessageResponse)\n const storedKey = this.H(clientKey)\n const clientSignature = this.clientSignature(storedKey, clientMessageResponse)\n return encode64(SCRAM.xor(clientKey, clientSignature))\n }\n\n /**\n * @private\n */\n async clientKey(clientMessageResponse) {\n const saltedPassword = await this.saltPassword(clientMessageResponse)\n return this.HMAC(saltedPassword, HMAC_CLIENT_KEY)\n }\n\n /**\n * @private\n */\n async serverKey(clientMessageResponse) {\n const saltedPassword = await this.saltPassword(clientMessageResponse)\n return this.HMAC(saltedPassword, HMAC_SERVER_KEY)\n }\n\n /**\n * @private\n */\n clientSignature(storedKey, clientMessageResponse) {\n return this.HMAC(storedKey, this.authMessage(clientMessageResponse))\n }\n\n /**\n * @private\n */\n serverSignature(serverKey, clientMessageResponse) {\n return encode64(this.HMAC(serverKey, this.authMessage(clientMessageResponse)))\n }\n\n /**\n * @private\n */\n authMessage(clientMessageResponse) {\n return [\n this.firstMessageBare(),\n clientMessageResponse.original,\n this.finalMessageWithoutProof(clientMessageResponse),\n ].join(',')\n }\n\n /**\n * @private\n */\n async saltPassword(clientMessageResponse) {\n const salt = Buffer.from(clientMessageResponse.s, 'base64')\n const iterations = parseInt(clientMessageResponse.i, 10)\n return SCRAM.hi(this.encodedPassword(), salt, iterations, this.digestDefinition)\n }\n\n /**\n * @private\n */\n firstMessageBare() {\n return `n=${this.encodedUsername()},r=${this.currentNonce}`\n }\n\n /**\n * @private\n */\n finalMessageWithoutProof(clientMessageResponse) {\n const rnonce = clientMessageResponse.r\n return `c=${encode64(GS2_HEADER)},r=${rnonce}`\n }\n\n /**\n * @private\n */\n encodedUsername() {\n const { username } = this.connection.sasl\n return SCRAM.sanitizeString(username).toString('utf-8')\n }\n\n /**\n * @private\n */\n encodedPassword() {\n const { password } = this.connection.sasl\n return password.toString('utf-8')\n }\n\n /**\n * @private\n */\n H(data) {\n return crypto\n .createHash(this.digestDefinition.type)\n .update(data)\n .digest()\n }\n\n /**\n * @private\n */\n HMAC(key, data) {\n return crypto\n .createHmac(this.digestDefinition.type, key)\n .update(data)\n .digest()\n }\n}\n\nmodule.exports = {\n DIGESTS,\n SCRAM,\n}\n","const { SCRAM, DIGESTS } = require('./scram')\n\nmodule.exports = class SCRAM256Authenticator extends SCRAM {\n constructor(connection, logger, saslAuthenticate) {\n super(connection, logger.namespace('SCRAM256Authenticator'), saslAuthenticate, DIGESTS.SHA256)\n }\n}\n","const { SCRAM, DIGESTS } = require('./scram')\n\nmodule.exports = class SCRAM512Authenticator extends SCRAM {\n constructor(connection, logger, saslAuthenticate) {\n super(connection, logger.namespace('SCRAM512Authenticator'), saslAuthenticate, DIGESTS.SHA512)\n }\n}\n","const Broker = require('../broker')\nconst createRetry = require('../retry')\nconst shuffle = require('../utils/shuffle')\nconst arrayDiff = require('../utils/arrayDiff')\nconst { KafkaJSBrokerNotFound, KafkaJSProtocolError } = require('../errors')\n\nconst { keys, assign, values } = Object\nconst hasBrokerBeenReplaced = (broker, { host, port, rack }) =>\n broker.connection.host !== host ||\n broker.connection.port !== port ||\n broker.connection.rack !== rack\n\nmodule.exports = class BrokerPool {\n /**\n * @param {object} options\n * @param {import(\"./connectionBuilder\").ConnectionBuilder} options.connectionBuilder\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {boolean} [options.allowAutoTopicCreation]\n * @param {number} [options.authenticationTimeout]\n * @param {number} [options.reauthenticationThreshold]\n * @param {number} [options.metadataMaxAge]\n */\n constructor({\n connectionBuilder,\n logger,\n retry,\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n metadataMaxAge,\n }) {\n this.rootLogger = logger\n this.connectionBuilder = connectionBuilder\n this.metadataMaxAge = metadataMaxAge || 0\n this.logger = logger.namespace('BrokerPool')\n this.retrier = createRetry(assign({}, retry))\n\n this.createBroker = options =>\n new Broker({\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n ...options,\n })\n\n this.brokers = {}\n /** @type {Broker | undefined} */\n this.seedBroker = undefined\n /** @type {import(\"../../types\").BrokerMetadata | null} */\n this.metadata = null\n this.metadataExpireAt = null\n this.versions = null\n this.supportAuthenticationProtocol = null\n }\n\n /**\n * @public\n * @returns {Boolean}\n */\n hasConnectedBrokers() {\n const brokers = values(this.brokers)\n return (\n !!brokers.find(broker => broker.isConnected()) ||\n (this.seedBroker ? this.seedBroker.isConnected() : false)\n )\n }\n\n async createSeedBroker() {\n if (this.seedBroker) {\n await this.seedBroker.disconnect()\n }\n\n this.seedBroker = this.createBroker({\n connection: await this.connectionBuilder.build(),\n logger: this.rootLogger,\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n if (this.hasConnectedBrokers()) {\n return\n }\n\n if (!this.seedBroker) {\n await this.createSeedBroker()\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.seedBroker.connect()\n this.versions = this.seedBroker.versions\n } catch (e) {\n if (e.name === 'KafkaJSConnectionError' || e.type === 'ILLEGAL_SASL_STATE') {\n // Connection builder will always rotate the seed broker\n await this.createSeedBroker()\n this.logger.error(\n `Failed to connect to seed broker, trying another broker from the list: ${e.message}`,\n { retryCount, retryTime }\n )\n } else {\n this.logger.error(e.message, { retryCount, retryTime })\n }\n\n if (e.retriable) throw e\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.seedBroker && (await this.seedBroker.disconnect())\n await Promise.all(values(this.brokers).map(broker => broker.disconnect()))\n\n this.brokers = {}\n this.metadata = null\n this.versions = null\n this.supportAuthenticationProtocol = null\n }\n\n /**\n * @public\n * @param {Object} destination\n * @param {string} destination.host\n * @param {number} destination.port\n */\n removeBroker({ host, port }) {\n const removedBroker = values(this.brokers).find(\n broker => broker.connection.host === host && broker.connection.port === port\n )\n\n if (removedBroker) {\n delete this.brokers[removedBroker.nodeId]\n this.metadataExpireAt = null\n\n if (this.seedBroker.nodeId === removedBroker.nodeId) {\n this.seedBroker = shuffle(values(this.brokers))[0]\n }\n }\n }\n\n /**\n * @public\n * @param {Array} topics\n * @returns {Promise}\n */\n async refreshMetadata(topics) {\n const broker = await this.findConnectedBroker()\n const { host: seedHost, port: seedPort } = this.seedBroker.connection\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n this.metadata = await broker.metadata(topics)\n this.metadataExpireAt = Date.now() + this.metadataMaxAge\n\n const replacedBrokers = []\n\n this.brokers = await this.metadata.brokers.reduce(\n async (resultPromise, { nodeId, host, port, rack }) => {\n const result = await resultPromise\n\n if (result[nodeId]) {\n if (!hasBrokerBeenReplaced(result[nodeId], { host, port, rack })) {\n return result\n }\n\n replacedBrokers.push(result[nodeId])\n }\n\n if (host === seedHost && port === seedPort) {\n this.seedBroker.nodeId = nodeId\n this.seedBroker.connection.rack = rack\n return assign(result, {\n [nodeId]: this.seedBroker,\n })\n }\n\n return assign(result, {\n [nodeId]: this.createBroker({\n logger: this.rootLogger,\n versions: this.versions,\n supportAuthenticationProtocol: this.supportAuthenticationProtocol,\n connection: await this.connectionBuilder.build({ host, port, rack }),\n nodeId,\n }),\n })\n },\n this.brokers\n )\n\n const freshBrokerIds = this.metadata.brokers.map(({ nodeId }) => `${nodeId}`).sort()\n const currentBrokerIds = keys(this.brokers).sort()\n const unusedBrokerIds = arrayDiff(currentBrokerIds, freshBrokerIds)\n\n const brokerDisconnects = unusedBrokerIds.map(nodeId => {\n const broker = this.brokers[nodeId]\n return broker.disconnect().then(() => {\n delete this.brokers[nodeId]\n })\n })\n\n const replacedBrokersDisconnects = replacedBrokers.map(broker => broker.disconnect())\n await Promise.all([...brokerDisconnects, ...replacedBrokersDisconnects])\n } catch (e) {\n if (e.type === 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * Only refreshes metadata if the data is stale according to the `metadataMaxAge` param or does not contain information about the provided topics\n *\n * @public\n * @param {Array} topics\n * @returns {Promise}\n */\n async refreshMetadataIfNecessary(topics) {\n const shouldRefresh =\n this.metadata == null ||\n this.metadataExpireAt == null ||\n Date.now() > this.metadataExpireAt ||\n !topics.every(topic =>\n this.metadata.topicMetadata.some(topicMetadata => topicMetadata.topic === topic)\n )\n\n if (shouldRefresh) {\n return this.refreshMetadata(topics)\n }\n }\n\n /**\n * @public\n * @param {object} options\n * @param {string} options.nodeId\n * @returns {Promise}\n */\n async findBroker({ nodeId }) {\n const broker = this.brokers[nodeId]\n\n if (!broker) {\n throw new KafkaJSBrokerNotFound(`Broker ${nodeId} not found in the cached metadata`)\n }\n\n await this.connectBroker(broker)\n return broker\n }\n\n /**\n * @public\n * @param {(params: { nodeId: string, broker: Broker }) => Promise} callback\n * @returns {Promise}\n * @template T\n */\n async withBroker(callback) {\n const brokers = shuffle(keys(this.brokers))\n if (brokers.length === 0) {\n throw new KafkaJSBrokerNotFound('No brokers in the broker pool')\n }\n\n for (const nodeId of brokers) {\n const broker = await this.findBroker({ nodeId })\n try {\n return await callback({ nodeId, broker })\n } catch (e) {}\n }\n\n return null\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async findConnectedBroker() {\n const nodeIds = shuffle(keys(this.brokers))\n const connectedBrokerId = nodeIds.find(nodeId => this.brokers[nodeId].isConnected())\n\n if (connectedBrokerId) {\n return await this.findBroker({ nodeId: connectedBrokerId })\n }\n\n // Cycle through the nodes until one connects\n for (const nodeId of nodeIds) {\n try {\n return await this.findBroker({ nodeId })\n } catch (e) {}\n }\n\n // Failed to connect to all known brokers, metadata might be old\n await this.connect()\n return this.seedBroker\n }\n\n /**\n * @private\n * @param {Broker} broker\n * @returns {Promise}\n */\n async connectBroker(broker) {\n if (broker.isConnected()) {\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await broker.connect()\n } catch (e) {\n if (e.name === 'KafkaJSConnectionError' || e.type === 'ILLEGAL_SASL_STATE') {\n await broker.disconnect()\n }\n\n // To avoid reconnecting to an unavailable host, we bail on connection errors\n // and refresh metadata on a higher level before reconnecting\n if (e.name === 'KafkaJSConnectionError') {\n return bail(e)\n }\n\n if (e.type === 'ILLEGAL_SASL_STATE') {\n // Rebuild the connection since it can't recover from illegal SASL state\n broker.connection = await this.connectionBuilder.build({\n host: broker.connection.host,\n port: broker.connection.port,\n rack: broker.connection.rack,\n })\n\n this.logger.error(`Failed to connect to broker, reconnecting`, { retryCount, retryTime })\n throw new KafkaJSProtocolError(e, { retriable: true })\n }\n\n if (e.retriable) throw e\n this.logger.error(e, { retryCount, retryTime, stack: e.stack })\n bail(e)\n }\n })\n }\n}\n","const Connection = require('../network/connection')\nconst { KafkaJSConnectionError, KafkaJSNonRetriableError } = require('../errors')\n\n/**\n * @typedef {Object} ConnectionBuilder\n * @property {(destination?: { host?: string, port?: number, rack?: string }) => Promise} build\n */\n\n/**\n * @param {Object} options\n * @param {import(\"../../types\").ISocketFactory} [options.socketFactory]\n * @param {string[]|(() => string[])} options.brokers\n * @param {Object} [options.ssl]\n * @param {Object} [options.sasl]\n * @param {string} options.clientId\n * @param {number} options.requestTimeout\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} [options.connectionTimeout]\n * @param {number} [options.maxInFlightRequests]\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter]\n * @returns {ConnectionBuilder}\n */\nmodule.exports = ({\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n requestTimeout,\n enforceRequestTimeout,\n connectionTimeout,\n maxInFlightRequests,\n logger,\n instrumentationEmitter = null,\n}) => {\n let index = 0\n\n const isValidBroker = broker => {\n return broker && typeof broker === 'string' && broker.length > 0\n }\n\n const validateBrokers = brokers => {\n if (!brokers) {\n throw new KafkaJSNonRetriableError(`Failed to connect: brokers should not be null`)\n }\n\n if (Array.isArray(brokers)) {\n if (!brokers.length) {\n throw new KafkaJSNonRetriableError(`Failed to connect: brokers array is empty`)\n }\n\n brokers.forEach((broker, index) => {\n if (!isValidBroker(broker)) {\n throw new KafkaJSNonRetriableError(\n `Failed to connect: broker at index ${index} is invalid \"${typeof broker}\"`\n )\n }\n })\n }\n }\n\n const getBrokers = async () => {\n let list\n\n if (typeof brokers === 'function') {\n try {\n list = await brokers()\n } catch (e) {\n const wrappedError = new KafkaJSConnectionError(\n `Failed to connect: \"config.brokers\" threw: ${e.message}`\n )\n wrappedError.stack = `${wrappedError.name}\\n Caused by: ${e.stack}`\n throw wrappedError\n }\n } else {\n list = brokers\n }\n\n validateBrokers(list)\n\n return list\n }\n\n return {\n build: async ({ host, port, rack } = {}) => {\n if (!host) {\n const list = await getBrokers()\n\n const randomBroker = list[index++ % list.length]\n\n host = randomBroker.split(':')[0]\n port = Number(randomBroker.split(':')[1])\n }\n\n return new Connection({\n host,\n port,\n rack,\n sasl,\n ssl,\n clientId,\n socketFactory,\n connectionTimeout,\n requestTimeout,\n enforceRequestTimeout,\n maxInFlightRequests,\n instrumentationEmitter,\n logger,\n })\n },\n }\n}\n","const BrokerPool = require('./brokerPool')\nconst Lock = require('../utils/lock')\nconst createRetry = require('../retry')\nconst connectionBuilder = require('./connectionBuilder')\nconst flatten = require('../utils/flatten')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\nconst {\n KafkaJSError,\n KafkaJSBrokerNotFound,\n KafkaJSMetadataNotLoaded,\n KafkaJSTopicMetadataNotLoaded,\n KafkaJSGroupCoordinatorNotFound,\n} = require('../errors')\nconst COORDINATOR_TYPES = require('../protocol/coordinatorTypes')\n\nconst { keys } = Object\n\nconst mergeTopics = (obj, { topic, partitions }) => ({\n ...obj,\n [topic]: [...(obj[topic] || []), ...partitions],\n})\n\nmodule.exports = class Cluster {\n /**\n * @param {Object} options\n * @param {Array} options.brokers example: ['127.0.0.1:9092', '127.0.0.1:9094']\n * @param {Object} options.ssl\n * @param {Object} options.sasl\n * @param {string} options.clientId\n * @param {number} options.connectionTimeout - in milliseconds\n * @param {number} options.authenticationTimeout - in milliseconds\n * @param {number} options.reauthenticationThreshold - in milliseconds\n * @param {number} [options.requestTimeout=30000] - in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} options.metadataMaxAge - in milliseconds\n * @param {boolean} options.allowAutoTopicCreation\n * @param {number} options.maxInFlightRequests\n * @param {number} options.isolationLevel\n * @param {import(\"../../types\").RetryOptions} options.retry\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {Map} [options.offsets]\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n logger: rootLogger,\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout = 30000,\n enforceRequestTimeout,\n metadataMaxAge,\n retry,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n instrumentationEmitter = null,\n offsets = new Map(),\n }) {\n this.rootLogger = rootLogger\n this.logger = rootLogger.namespace('Cluster')\n this.retrier = createRetry(retry)\n this.connectionBuilder = connectionBuilder({\n logger: rootLogger,\n instrumentationEmitter,\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n requestTimeout,\n enforceRequestTimeout,\n maxInFlightRequests,\n })\n\n this.targetTopics = new Set()\n this.mutatingTargetTopics = new Lock({\n description: `updating target topics`,\n timeout: requestTimeout,\n })\n this.isolationLevel = isolationLevel\n this.brokerPool = new BrokerPool({\n connectionBuilder: this.connectionBuilder,\n logger: this.rootLogger,\n retry,\n allowAutoTopicCreation,\n authenticationTimeout,\n reauthenticationThreshold,\n metadataMaxAge,\n })\n this.committedOffsetsByGroup = offsets\n }\n\n isConnected() {\n return this.brokerPool.hasConnectedBrokers()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async connect() {\n await this.brokerPool.connect()\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n await this.brokerPool.disconnect()\n }\n\n /**\n * @public\n * @param {object} destination\n * @param {String} destination.host\n * @param {Number} destination.port\n */\n removeBroker({ host, port }) {\n this.brokerPool.removeBroker({ host, port })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async refreshMetadata() {\n await this.brokerPool.refreshMetadata(Array.from(this.targetTopics))\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async refreshMetadataIfNecessary() {\n await this.brokerPool.refreshMetadataIfNecessary(Array.from(this.targetTopics))\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async metadata({ topics = [] } = {}) {\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.brokerPool.refreshMetadataIfNecessary(topics)\n return this.brokerPool.withBroker(async ({ broker }) => broker.metadata(topics))\n } catch (e) {\n if (e.type === 'LEADER_NOT_AVAILABLE') {\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @param {string} topic\n * @return {Promise}\n */\n async addTargetTopic(topic) {\n return this.addMultipleTargetTopics([topic])\n }\n\n /**\n * @public\n * @param {string[]} topics\n * @return {Promise}\n */\n async addMultipleTargetTopics(topics) {\n await this.mutatingTargetTopics.acquire()\n\n try {\n const previousSize = this.targetTopics.size\n const previousTopics = new Set(this.targetTopics)\n for (const topic of topics) {\n this.targetTopics.add(topic)\n }\n\n const hasChanged = previousSize !== this.targetTopics.size || !this.brokerPool.metadata\n\n if (hasChanged) {\n try {\n await this.refreshMetadata()\n } catch (e) {\n if (e.type === 'INVALID_TOPIC_EXCEPTION' || e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {\n this.targetTopics = previousTopics\n }\n\n throw e\n }\n }\n } finally {\n await this.mutatingTargetTopics.release()\n }\n }\n\n /**\n * @public\n * @param {object} options\n * @param {string} options.nodeId\n * @returns {Promise}\n */\n async findBroker({ nodeId }) {\n try {\n return await this.brokerPool.findBroker({ nodeId })\n } catch (e) {\n // The client probably has stale metadata\n if (\n e.name === 'KafkaJSBrokerNotFound' ||\n e.name === 'KafkaJSLockTimeout' ||\n e.name === 'KafkaJSConnectionError'\n ) {\n await this.refreshMetadata()\n }\n\n throw e\n }\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async findControllerBroker() {\n const { metadata } = this.brokerPool\n\n if (!metadata || metadata.controllerId == null) {\n throw new KafkaJSMetadataNotLoaded('Topic metadata not loaded')\n }\n\n const broker = await this.findBroker({ nodeId: metadata.controllerId })\n\n if (!broker) {\n throw new KafkaJSBrokerNotFound(\n `Controller broker with id ${metadata.controllerId} not found in the cached metadata`\n )\n }\n\n return broker\n }\n\n /**\n * @public\n * @param {string} topic\n * @returns {import(\"../../types\").PartitionMetadata[]} Example:\n * [{\n * isr: [2],\n * leader: 2,\n * partitionErrorCode: 0,\n * partitionId: 0,\n * replicas: [2],\n * }]\n */\n findTopicPartitionMetadata(topic) {\n const { metadata } = this.brokerPool\n if (!metadata || !metadata.topicMetadata) {\n throw new KafkaJSTopicMetadataNotLoaded('Topic metadata not loaded', { topic })\n }\n\n const topicMetadata = metadata.topicMetadata.find(t => t.topic === topic)\n return topicMetadata ? topicMetadata.partitionMetadata : []\n }\n\n /**\n * @public\n * @param {string} topic\n * @param {(number|string)[]} partitions\n * @returns {Object} Object with leader and partitions. For partitions 0 and 5\n * the result could be:\n * { '0': [0], '2': [5] }\n *\n * where the key is the nodeId.\n */\n findLeaderForPartitions(topic, partitions) {\n const partitionMetadata = this.findTopicPartitionMetadata(topic)\n return partitions.reduce((result, id) => {\n const partitionId = parseInt(id, 10)\n const metadata = partitionMetadata.find(p => p.partitionId === partitionId)\n\n if (!metadata) {\n return result\n }\n\n if (metadata.leader === null || metadata.leader === undefined) {\n throw new KafkaJSError('Invalid partition metadata', { topic, partitionId, metadata })\n }\n\n const { leader } = metadata\n const current = result[leader] || []\n return { ...result, [leader]: [...current, partitionId] }\n }, {})\n }\n\n /**\n * @public\n * @param {object} params\n * @param {string} params.groupId\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} [params.coordinatorType=0]\n * @returns {Promise}\n */\n async findGroupCoordinator({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) {\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n const { coordinator } = await this.findGroupCoordinatorMetadata({\n groupId,\n coordinatorType,\n })\n return await this.findBroker({ nodeId: coordinator.nodeId })\n } catch (e) {\n // A new broker can join the cluster before we have the chance\n // to refresh metadata\n if (e.name === 'KafkaJSBrokerNotFound' || e.type === 'GROUP_COORDINATOR_NOT_AVAILABLE') {\n this.logger.debug(`${e.message}, refreshing metadata and trying again...`, {\n groupId,\n retryCount,\n retryTime,\n })\n\n await this.refreshMetadata()\n throw e\n }\n\n if (e.code === 'ECONNREFUSED') {\n // During maintenance the current coordinator can go down; findBroker will\n // refresh metadata and re-throw the error. findGroupCoordinator has to re-throw\n // the error to go through the retry cycle.\n throw e\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @public\n * @param {object} params\n * @param {string} params.groupId\n * @param {import(\"../protocol/coordinatorTypes\").CoordinatorType} [params.coordinatorType=0]\n * @returns {Promise}\n */\n async findGroupCoordinatorMetadata({ groupId, coordinatorType }) {\n const brokerMetadata = await this.brokerPool.withBroker(async ({ nodeId, broker }) => {\n return await this.retrier(async (bail, retryCount, retryTime) => {\n try {\n const brokerMetadata = await broker.findGroupCoordinator({ groupId, coordinatorType })\n this.logger.debug('Found group coordinator', {\n broker: brokerMetadata.host,\n nodeId: brokerMetadata.coordinator.nodeId,\n })\n return brokerMetadata\n } catch (e) {\n this.logger.debug('Tried to find group coordinator', {\n nodeId,\n error: e,\n })\n\n if (e.type === 'GROUP_COORDINATOR_NOT_AVAILABLE') {\n this.logger.debug('Group coordinator not available, retrying...', {\n nodeId,\n retryCount,\n retryTime,\n })\n\n throw e\n }\n\n bail(e)\n }\n })\n })\n\n if (brokerMetadata) {\n return brokerMetadata\n }\n\n throw new KafkaJSGroupCoordinatorNotFound('Failed to find group coordinator')\n }\n\n /**\n * @param {object} topicConfiguration\n * @returns {number}\n */\n defaultOffset({ fromBeginning }) {\n return fromBeginning ? EARLIEST_OFFSET : LATEST_OFFSET\n }\n\n /**\n * @public\n * @param {Array} topics\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [{ partition: 0 }],\n * fromBeginning: false\n * }\n * ]\n * @returns {Promise} example:\n * [\n * {\n * topic: 'my-topic-name',\n * partitions: [\n * { partition: 0, offset: '1' },\n * { partition: 1, offset: '2' },\n * { partition: 2, offset: '1' },\n * ],\n * },\n * ]\n */\n async fetchTopicsOffset(topics) {\n const partitionsPerBroker = {}\n const topicConfigurations = {}\n\n const addDefaultOffset = topic => partition => {\n const { timestamp } = topicConfigurations[topic]\n return { ...partition, timestamp }\n }\n\n // Index all topics and partitions per leader (nodeId)\n for (const topicData of topics) {\n const { topic, partitions, fromBeginning, fromTimestamp } = topicData\n const partitionsPerLeader = this.findLeaderForPartitions(\n topic,\n partitions.map(p => p.partition)\n )\n const timestamp =\n fromTimestamp != null ? fromTimestamp : this.defaultOffset({ fromBeginning })\n\n topicConfigurations[topic] = { timestamp }\n\n keys(partitionsPerLeader).forEach(nodeId => {\n partitionsPerBroker[nodeId] = partitionsPerBroker[nodeId] || {}\n partitionsPerBroker[nodeId][topic] = partitions.filter(p =>\n partitionsPerLeader[nodeId].includes(p.partition)\n )\n })\n }\n\n // Create a list of requests to fetch the offset of all partitions\n const requests = keys(partitionsPerBroker).map(async nodeId => {\n const broker = await this.findBroker({ nodeId })\n const partitions = partitionsPerBroker[nodeId]\n\n const { responses: topicOffsets } = await broker.listOffsets({\n isolationLevel: this.isolationLevel,\n topics: keys(partitions).map(topic => ({\n topic,\n partitions: partitions[topic].map(addDefaultOffset(topic)),\n })),\n })\n\n return topicOffsets\n })\n\n // Execute all requests, merge and normalize the responses\n const responses = await Promise.all(requests)\n const partitionsPerTopic = flatten(responses).reduce(mergeTopics, {})\n\n return keys(partitionsPerTopic).map(topic => ({\n topic,\n partitions: partitionsPerTopic[topic].map(({ partition, offset }) => ({\n partition,\n offset,\n })),\n }))\n }\n\n /**\n * Retrieve the object mapping for committed offsets for a single consumer group\n * @param {object} options\n * @param {string} options.groupId\n * @returns {Object}\n */\n committedOffsets({ groupId }) {\n if (!this.committedOffsetsByGroup.has(groupId)) {\n this.committedOffsetsByGroup.set(groupId, {})\n }\n\n return this.committedOffsetsByGroup.get(groupId)\n }\n\n /**\n * Mark offset as committed for a single consumer group's topic-partition\n * @param {object} options\n * @param {string} options.groupId\n * @param {string} options.topic\n * @param {string|number} options.partition\n * @param {string} options.offset\n */\n markOffsetAsCommitted({ groupId, topic, partition, offset }) {\n const committedOffsets = this.committedOffsets({ groupId })\n\n committedOffsets[topic] = committedOffsets[topic] || {}\n committedOffsets[topic][partition] = offset\n }\n}\n","const EARLIEST_OFFSET = -2\nconst LATEST_OFFSET = -1\nconst INT_32_MAX_VALUE = Math.pow(2, 32)\n\nmodule.exports = {\n EARLIEST_OFFSET,\n LATEST_OFFSET,\n INT_32_MAX_VALUE,\n}\n","const Encoder = require('../protocol/encoder')\nconst Decoder = require('../protocol/decoder')\n\nconst MemberMetadata = {\n /**\n * @param {Object} metadata\n * @param {number} metadata.version\n * @param {Array} metadata.topics\n * @param {Buffer} [metadata.userData=Buffer.alloc(0)]\n *\n * @returns Buffer\n */\n encode({ version, topics, userData = Buffer.alloc(0) }) {\n return new Encoder()\n .writeInt16(version)\n .writeArray(topics)\n .writeBytes(userData).buffer\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Object}\n */\n decode(buffer) {\n const decoder = new Decoder(buffer)\n return {\n version: decoder.readInt16(),\n topics: decoder.readArray(d => d.readString()),\n userData: decoder.readBytes(),\n }\n },\n}\n\nconst MemberAssignment = {\n /**\n * @param {number} version\n * @param {Object} assignment, example:\n * {\n * 'topic-A': [0, 2, 4, 6],\n * 'topic-B': [0, 2],\n * }\n * @param {Buffer} [userData=Buffer.alloc(0)]\n *\n * @returns Buffer\n */\n encode({ version, assignment, userData = Buffer.alloc(0) }) {\n return new Encoder()\n .writeInt16(version)\n .writeArray(\n Object.keys(assignment).map(topic =>\n new Encoder().writeString(topic).writeArray(assignment[topic])\n )\n )\n .writeBytes(userData).buffer\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Object|null}\n */\n decode(buffer) {\n const decoder = new Decoder(buffer)\n const decodePartitions = d => d.readInt32()\n const decodeAssignment = d => ({\n topic: d.readString(),\n partitions: d.readArray(decodePartitions),\n })\n const indexAssignment = (obj, { topic, partitions }) =>\n Object.assign(obj, { [topic]: partitions })\n\n if (!decoder.canReadInt16()) {\n return null\n }\n\n return {\n version: decoder.readInt16(),\n assignment: decoder.readArray(decodeAssignment).reduce(indexAssignment, {}),\n userData: decoder.readBytes(),\n }\n },\n}\n\nmodule.exports = {\n MemberMetadata,\n MemberAssignment,\n}\n","const roundRobin = require('./roundRobinAssigner')\n\nmodule.exports = {\n roundRobin,\n}\n","const { MemberMetadata, MemberAssignment } = require('../../assignerProtocol')\nconst flatten = require('../../../utils/flatten')\n\n/**\n * RoundRobinAssigner\n * @param {Cluster} cluster\n * @returns {function}\n */\nmodule.exports = ({ cluster }) => ({\n name: 'RoundRobinAssigner',\n version: 1,\n\n /**\n * Assign the topics to the provided members.\n *\n * The members array contains information about each member, `memberMetadata` is the result of the\n * `protocol` operation.\n *\n * @param {array} members array of members, e.g:\n [{ memberId: 'test-5f93f5a3', memberMetadata: Buffer }]\n * @param {array} topics\n * @returns {array} object partitions per topic per member, e.g:\n * [\n * {\n * memberId: 'test-5f93f5a3',\n * memberAssignment: {\n * 'topic-A': [0, 2, 4, 6],\n * 'topic-B': [1],\n * },\n * },\n * {\n * memberId: 'test-3d3d5341',\n * memberAssignment: {\n * 'topic-A': [1, 3, 5],\n * 'topic-B': [0, 2],\n * },\n * }\n * ]\n */\n async assign({ members, topics }) {\n const membersCount = members.length\n const sortedMembers = members.map(({ memberId }) => memberId).sort()\n const assignment = {}\n\n const topicsPartionArrays = topics.map(topic => {\n const partitionMetadata = cluster.findTopicPartitionMetadata(topic)\n return partitionMetadata.map(m => ({ topic: topic, partitionId: m.partitionId }))\n })\n const topicsPartitions = flatten(topicsPartionArrays)\n\n topicsPartitions.forEach((topicPartition, i) => {\n const assignee = sortedMembers[i % membersCount]\n\n if (!assignment[assignee]) {\n assignment[assignee] = Object.create(null)\n }\n\n if (!assignment[assignee][topicPartition.topic]) {\n assignment[assignee][topicPartition.topic] = []\n }\n\n assignment[assignee][topicPartition.topic].push(topicPartition.partitionId)\n })\n\n return Object.keys(assignment).map(memberId => ({\n memberId,\n memberAssignment: MemberAssignment.encode({\n version: this.version,\n assignment: assignment[memberId],\n }),\n }))\n },\n\n protocol({ topics }) {\n return {\n name: this.name,\n metadata: MemberMetadata.encode({\n version: this.version,\n topics,\n }),\n }\n },\n})\n","/**\n * @template T\n * @return {{lock: Promise, unlock: (v?: T) => void, unlockWithError: (e: Error) => void}}\n */\nmodule.exports = () => {\n let unlock\n let unlockWithError\n const lock = new Promise(resolve => {\n unlock = resolve\n unlockWithError = resolve\n })\n\n return { lock, unlock, unlockWithError }\n}\n","const Long = require('../utils/long')\nconst filterAbortedMessages = require('./filterAbortedMessages')\n\n/**\n * A batch collects messages returned from a single fetch call.\n *\n * A batch could contain _multiple_ Kafka RecordBatches.\n */\nmodule.exports = class Batch {\n constructor(topic, fetchedOffset, partitionData) {\n this.fetchedOffset = fetchedOffset\n const longFetchedOffset = Long.fromValue(this.fetchedOffset)\n const { abortedTransactions, messages } = partitionData\n\n this.topic = topic\n this.partition = partitionData.partition\n this.highWatermark = partitionData.highWatermark\n\n this.rawMessages = messages\n // Apparently fetch can return different offsets than the target offset provided to the fetch API.\n // Discard messages that are not in the requested offset\n // https://github.com/apache/kafka/blob/bf237fa7c576bd141d78fdea9f17f65ea269c290/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L912\n this.messagesWithinOffset = this.rawMessages.filter(message =>\n Long.fromValue(message.offset).gte(longFetchedOffset)\n )\n\n // 1. Don't expose aborted messages\n // 2. Don't expose control records\n // @see https://kafka.apache.org/documentation/#controlbatch\n this.messages = filterAbortedMessages({\n messages: this.messagesWithinOffset,\n abortedTransactions,\n }).filter(message => !message.isControlRecord)\n }\n\n isEmpty() {\n return this.messages.length === 0\n }\n\n isEmptyIncludingFiltered() {\n return this.messagesWithinOffset.length === 0\n }\n\n /**\n * If the batch contained raw messages (i.e was not truely empty) but all messages were filtered out due to\n * log compaction, control records or other reasons\n */\n isEmptyDueToFiltering() {\n return this.isEmpty() && this.rawMessages.length > 0\n }\n\n isEmptyControlRecord() {\n return (\n this.isEmpty() && this.messagesWithinOffset.some(({ isControlRecord }) => isControlRecord)\n )\n }\n\n /**\n * With compressed messages, it's possible for the returned messages to have offsets smaller than the starting offset.\n * These messages will be filtered out (i.e. they are not even included in this.messagesWithinOffset)\n * If these are the only messages, the batch will appear as an empty batch.\n *\n * isEmpty() and isEmptyIncludingFiltered() will always return true if the batch is empty,\n * but this method will only return true if the batch is empty due to log compacted messages.\n *\n * @returns boolean True if the batch is empty, because of log compacted messages in the partition.\n */\n isEmptyDueToLogCompactedMessages() {\n const hasMessages = this.rawMessages.length > 0\n return hasMessages && this.isEmptyIncludingFiltered()\n }\n\n firstOffset() {\n return this.isEmptyIncludingFiltered() ? null : this.messagesWithinOffset[0].offset\n }\n\n lastOffset() {\n if (this.isEmptyDueToLogCompactedMessages()) {\n return this.fetchedOffset\n }\n\n if (this.isEmptyIncludingFiltered()) {\n return Long.fromValue(this.highWatermark)\n .add(-1)\n .toString()\n }\n\n return this.messagesWithinOffset[this.messagesWithinOffset.length - 1].offset\n }\n\n /**\n * Returns the lag based on the last offset in the batch (also known as \"high\")\n */\n offsetLag() {\n const lastOffsetOfPartition = Long.fromValue(this.highWatermark).add(-1)\n const lastConsumedOffset = Long.fromValue(this.lastOffset())\n return lastOffsetOfPartition.add(lastConsumedOffset.multiply(-1)).toString()\n }\n\n /**\n * Returns the lag based on the first offset in the batch\n */\n offsetLagLow() {\n if (this.isEmptyIncludingFiltered()) {\n return '0'\n }\n\n const lastOffsetOfPartition = Long.fromValue(this.highWatermark).add(-1)\n const firstConsumedOffset = Long.fromValue(this.firstOffset())\n return lastOffsetOfPartition.add(firstConsumedOffset.multiply(-1)).toString()\n }\n}\n","const flatten = require('../utils/flatten')\nconst sleep = require('../utils/sleep')\nconst BufferedAsyncIterator = require('../utils/bufferedAsyncIterator')\nconst websiteUrl = require('../utils/websiteUrl')\nconst arrayDiff = require('../utils/arrayDiff')\nconst createRetry = require('../retry')\nconst sharedPromiseTo = require('../utils/sharedPromiseTo')\n\nconst OffsetManager = require('./offsetManager')\nconst Batch = require('./batch')\nconst SeekOffsets = require('./seekOffsets')\nconst SubscriptionState = require('./subscriptionState')\nconst {\n events: { GROUP_JOIN, HEARTBEAT, CONNECT, RECEIVED_UNSUBSCRIBED_TOPICS },\n} = require('./instrumentationEvents')\nconst { MemberAssignment } = require('./assignerProtocol')\nconst {\n KafkaJSError,\n KafkaJSNonRetriableError,\n KafkaJSStaleTopicMetadataAssignment,\n} = require('../errors')\n\nconst { keys } = Object\n\nconst STALE_METADATA_ERRORS = [\n 'LEADER_NOT_AVAILABLE',\n // Fetch before v9 uses NOT_LEADER_FOR_PARTITION\n 'NOT_LEADER_FOR_PARTITION',\n // Fetch after v9 uses {FENCED,UNKNOWN}_LEADER_EPOCH\n 'FENCED_LEADER_EPOCH',\n 'UNKNOWN_LEADER_EPOCH',\n 'UNKNOWN_TOPIC_OR_PARTITION',\n]\n\nconst isRebalancing = e =>\n e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP'\n\nconst PRIVATE = {\n JOIN: Symbol('private:ConsumerGroup:join'),\n SYNC: Symbol('private:ConsumerGroup:sync'),\n HEARTBEAT: Symbol('private:ConsumerGroup:heartbeat'),\n SHAREDHEARTBEAT: Symbol('private:ConsumerGroup:sharedHeartbeat'),\n}\n\nmodule.exports = class ConsumerGroup {\n constructor({\n retry,\n cluster,\n groupId,\n topics,\n topicConfigurations,\n logger,\n instrumentationEmitter,\n assigners,\n sessionTimeout,\n rebalanceTimeout,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n isolationLevel,\n rackId,\n metadataMaxAge,\n }) {\n /** @type {import(\"../../types\").Cluster} */\n this.cluster = cluster\n this.groupId = groupId\n this.topics = topics\n this.topicsSubscribed = topics\n this.topicConfigurations = topicConfigurations\n this.logger = logger.namespace('ConsumerGroup')\n this.instrumentationEmitter = instrumentationEmitter\n this.retrier = createRetry(Object.assign({}, retry))\n this.assigners = assigners\n this.sessionTimeout = sessionTimeout\n this.rebalanceTimeout = rebalanceTimeout\n this.maxBytesPerPartition = maxBytesPerPartition\n this.minBytes = minBytes\n this.maxBytes = maxBytes\n this.maxWaitTime = maxWaitTimeInMs\n this.autoCommit = autoCommit\n this.autoCommitInterval = autoCommitInterval\n this.autoCommitThreshold = autoCommitThreshold\n this.isolationLevel = isolationLevel\n this.rackId = rackId\n this.metadataMaxAge = metadataMaxAge\n\n this.seekOffset = new SeekOffsets()\n this.coordinator = null\n this.generationId = null\n this.leaderId = null\n this.memberId = null\n this.members = null\n this.groupProtocol = null\n\n this.partitionsPerSubscribedTopic = null\n /**\n * Preferred read replica per topic and partition\n *\n * Each of the partitions tracks the preferred read replica (`nodeId`) and a timestamp\n * until when that preference is valid.\n *\n * @type {{[topicName: string]: {[partition: number]: {nodeId: number, expireAt: number}}}}\n */\n this.preferredReadReplicasPerTopicPartition = {}\n this.offsetManager = null\n this.subscriptionState = new SubscriptionState()\n\n this.lastRequest = Date.now()\n\n this[PRIVATE.SHAREDHEARTBEAT] = sharedPromiseTo(async ({ interval }) => {\n const { groupId, generationId, memberId } = this\n const now = Date.now()\n\n if (memberId && now >= this.lastRequest + interval) {\n const payload = {\n groupId,\n memberId,\n groupGenerationId: generationId,\n }\n\n await this.coordinator.heartbeat(payload)\n this.instrumentationEmitter.emit(HEARTBEAT, payload)\n this.lastRequest = Date.now()\n }\n })\n }\n\n isLeader() {\n return this.leaderId && this.memberId === this.leaderId\n }\n\n async connect() {\n await this.cluster.connect()\n this.instrumentationEmitter.emit(CONNECT)\n await this.cluster.refreshMetadataIfNecessary()\n }\n\n async [PRIVATE.JOIN]() {\n const { groupId, sessionTimeout, rebalanceTimeout } = this\n\n this.coordinator = await this.cluster.findGroupCoordinator({ groupId })\n\n const groupData = await this.coordinator.joinGroup({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId: this.memberId || '',\n groupProtocols: this.assigners.map(assigner =>\n assigner.protocol({\n topics: this.topicsSubscribed,\n })\n ),\n })\n\n this.generationId = groupData.generationId\n this.leaderId = groupData.leaderId\n this.memberId = groupData.memberId\n this.members = groupData.members\n this.groupProtocol = groupData.groupProtocol\n }\n\n async leave() {\n const { groupId, memberId } = this\n if (memberId) {\n await this.coordinator.leaveGroup({ groupId, memberId })\n this.memberId = null\n }\n }\n\n async [PRIVATE.SYNC]() {\n let assignment = []\n const {\n groupId,\n generationId,\n memberId,\n members,\n groupProtocol,\n topics,\n topicsSubscribed,\n coordinator,\n } = this\n\n if (this.isLeader()) {\n this.logger.debug('Chosen as group leader', { groupId, generationId, memberId, topics })\n const assigner = this.assigners.find(({ name }) => name === groupProtocol)\n\n if (!assigner) {\n throw new KafkaJSNonRetriableError(\n `Unsupported partition assigner \"${groupProtocol}\", the assigner wasn't found in the assigners list`\n )\n }\n\n await this.cluster.refreshMetadata()\n assignment = await assigner.assign({ members, topics: topicsSubscribed })\n\n this.logger.debug('Group assignment', {\n groupId,\n generationId,\n groupProtocol,\n assignment,\n topics: topicsSubscribed,\n })\n }\n\n // Keep track of the partitions for the subscribed topics\n this.partitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n const { memberAssignment } = await this.coordinator.syncGroup({\n groupId,\n generationId,\n memberId,\n groupAssignment: assignment,\n })\n\n const decodedMemberAssignment = MemberAssignment.decode(memberAssignment)\n const decodedAssignment =\n decodedMemberAssignment != null ? decodedMemberAssignment.assignment : {}\n\n this.logger.debug('Received assignment', {\n groupId,\n generationId,\n memberId,\n memberAssignment: decodedAssignment,\n })\n\n const assignedTopics = keys(decodedAssignment)\n const topicsNotSubscribed = arrayDiff(assignedTopics, topicsSubscribed)\n\n if (topicsNotSubscribed.length > 0) {\n const payload = {\n groupId,\n generationId,\n memberId,\n assignedTopics,\n topicsSubscribed,\n topicsNotSubscribed,\n }\n\n this.instrumentationEmitter.emit(RECEIVED_UNSUBSCRIBED_TOPICS, payload)\n this.logger.warn('Consumer group received unsubscribed topics', {\n ...payload,\n helpUrl: websiteUrl(\n 'docs/faq',\n 'why-am-i-receiving-messages-for-topics-i-m-not-subscribed-to'\n ),\n })\n }\n\n // Remove unsubscribed topics from the list\n const safeAssignment = arrayDiff(assignedTopics, topicsNotSubscribed)\n const currentMemberAssignment = safeAssignment.map(topic => ({\n topic,\n partitions: decodedAssignment[topic],\n }))\n\n // Check if the consumer is aware of all assigned partitions\n for (const assignment of currentMemberAssignment) {\n const { topic, partitions: assignedPartitions } = assignment\n const knownPartitions = this.partitionsPerSubscribedTopic.get(topic)\n const isAwareOfAllAssignedPartitions = assignedPartitions.every(partition =>\n knownPartitions.includes(partition)\n )\n\n if (!isAwareOfAllAssignedPartitions) {\n this.logger.warn('Consumer is not aware of all assigned partitions, refreshing metadata', {\n groupId,\n generationId,\n memberId,\n topic,\n knownPartitions,\n assignedPartitions,\n })\n\n // If the consumer is not aware of all assigned partitions, refresh metadata\n // and update the list of partitions per subscribed topic. It's enough to perform\n // this operation once since refresh metadata will update metadata for all topics\n await this.cluster.refreshMetadata()\n this.partitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n break\n }\n }\n\n this.topics = currentMemberAssignment.map(({ topic }) => topic)\n this.subscriptionState.assign(currentMemberAssignment)\n this.offsetManager = new OffsetManager({\n cluster: this.cluster,\n topicConfigurations: this.topicConfigurations,\n instrumentationEmitter: this.instrumentationEmitter,\n memberAssignment: currentMemberAssignment.reduce(\n (partitionsByTopic, { topic, partitions }) => ({\n ...partitionsByTopic,\n [topic]: partitions,\n }),\n {}\n ),\n autoCommit: this.autoCommit,\n autoCommitInterval: this.autoCommitInterval,\n autoCommitThreshold: this.autoCommitThreshold,\n coordinator,\n groupId,\n generationId,\n memberId,\n })\n }\n\n joinAndSync() {\n const startJoin = Date.now()\n return this.retrier(async bail => {\n try {\n await this[PRIVATE.JOIN]()\n await this[PRIVATE.SYNC]()\n\n const memberAssignment = this.assigned().reduce(\n (result, { topic, partitions }) => ({ ...result, [topic]: partitions }),\n {}\n )\n\n const payload = {\n groupId: this.groupId,\n memberId: this.memberId,\n leaderId: this.leaderId,\n isLeader: this.isLeader(),\n memberAssignment,\n groupProtocol: this.groupProtocol,\n duration: Date.now() - startJoin,\n }\n\n this.instrumentationEmitter.emit(GROUP_JOIN, payload)\n this.logger.info('Consumer has joined the group', payload)\n } catch (e) {\n if (isRebalancing(e)) {\n // Rebalance in progress isn't a retriable protocol error since the consumer\n // has to go through find coordinator and join again before it can\n // actually retry the operation. We wrap the original error in a retriable error\n // here instead in order to restart the join + sync sequence using the retrier.\n throw new KafkaJSError(e)\n }\n\n bail(e)\n }\n })\n }\n\n /**\n * @param {import(\"../../types\").TopicPartition} topicPartition\n */\n resetOffset({ topic, partition }) {\n this.offsetManager.resetOffset({ topic, partition })\n }\n\n /**\n * @param {import(\"../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n resolveOffset({ topic, partition, offset }) {\n this.offsetManager.resolveOffset({ topic, partition, offset })\n }\n\n /**\n * Update the consumer offset for the given topic/partition. This will be used\n * on the next fetch. If this API is invoked for the same topic/partition more\n * than once, the latest offset will be used on the next fetch.\n *\n * @param {import(\"../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n seek({ topic, partition, offset }) {\n this.seekOffset.set(topic, partition, offset)\n }\n\n pause(topicPartitions) {\n this.logger.info(`Pausing fetching from ${topicPartitions.length} topics`, {\n topicPartitions,\n })\n this.subscriptionState.pause(topicPartitions)\n }\n\n resume(topicPartitions) {\n this.logger.info(`Resuming fetching from ${topicPartitions.length} topics`, {\n topicPartitions,\n })\n this.subscriptionState.resume(topicPartitions)\n }\n\n assigned() {\n return this.subscriptionState.assigned()\n }\n\n paused() {\n return this.subscriptionState.paused()\n }\n\n async commitOffsetsIfNecessary() {\n await this.offsetManager.commitOffsetsIfNecessary()\n }\n\n async commitOffsets(offsets) {\n await this.offsetManager.commitOffsets(offsets)\n }\n\n uncommittedOffsets() {\n return this.offsetManager.uncommittedOffsets()\n }\n\n async heartbeat({ interval }) {\n return this[PRIVATE.SHAREDHEARTBEAT]({ interval })\n }\n\n async fetch() {\n try {\n const { topics, maxBytesPerPartition, maxWaitTime, minBytes, maxBytes } = this\n /** @type {{[nodeId: string]: {topic: string, partitions: { partition: number; fetchOffset: string; maxBytes: number }[]}[]}} */\n const requestsPerNode = {}\n\n await this.cluster.refreshMetadataIfNecessary()\n this.checkForStaleAssignment()\n\n while (this.seekOffset.size > 0) {\n const seekEntry = this.seekOffset.pop()\n this.logger.debug('Seek offset', {\n groupId: this.groupId,\n memberId: this.memberId,\n seek: seekEntry,\n })\n await this.offsetManager.seek(seekEntry)\n }\n\n const pausedTopicPartitions = this.subscriptionState.paused()\n const activeTopicPartitions = this.subscriptionState.active()\n\n const activePartitions = flatten(activeTopicPartitions.map(({ partitions }) => partitions))\n const activeTopics = activeTopicPartitions\n .filter(({ partitions }) => partitions.length > 0)\n .map(({ topic }) => topic)\n\n if (activePartitions.length === 0) {\n this.logger.debug(`No active topic partitions, sleeping for ${this.maxWaitTime}ms`, {\n topics,\n activeTopicPartitions,\n pausedTopicPartitions,\n })\n\n await sleep(this.maxWaitTime)\n return BufferedAsyncIterator([])\n }\n\n await this.offsetManager.resolveOffsets()\n\n this.logger.debug(\n `Fetching from ${activePartitions.length} partitions for ${activeTopics.length} out of ${topics.length} topics`,\n {\n topics,\n activeTopicPartitions,\n pausedTopicPartitions,\n }\n )\n\n for (const topicPartition of activeTopicPartitions) {\n const partitionsPerNode = this.findReadReplicaForPartitions(\n topicPartition.topic,\n topicPartition.partitions\n )\n\n const nodeIds = keys(partitionsPerNode)\n const committedOffsets = this.offsetManager.committedOffsets()\n\n for (const nodeId of nodeIds) {\n const partitions = partitionsPerNode[nodeId]\n .filter(partition => {\n /**\n * When recovering from OffsetOutOfRange, each partition can recover\n * concurrently, which invalidates resolved and committed offsets as part\n * of the recovery mechanism (see OffsetManager.clearOffsets). In concurrent\n * scenarios this can initiate a new fetch with invalid offsets.\n *\n * This was further highlighted by https://github.com/tulios/kafkajs/pull/570,\n * which increased concurrency, making this more likely to happen.\n *\n * This is solved by only making requests for partitions with initialized offsets.\n *\n * See the following pull request which explains the context of the problem:\n * @issue https://github.com/tulios/kafkajs/pull/578\n */\n return committedOffsets[topicPartition.topic][partition] != null\n })\n .map(partition => ({\n partition,\n fetchOffset: this.offsetManager\n .nextOffset(topicPartition.topic, partition)\n .toString(),\n maxBytes: maxBytesPerPartition,\n }))\n\n requestsPerNode[nodeId] = requestsPerNode[nodeId] || []\n requestsPerNode[nodeId].push({ topic: topicPartition.topic, partitions })\n }\n }\n\n const requests = keys(requestsPerNode).map(async nodeId => {\n const broker = await this.cluster.findBroker({ nodeId })\n const { responses } = await broker.fetch({\n maxWaitTime,\n minBytes,\n maxBytes,\n isolationLevel: this.isolationLevel,\n topics: requestsPerNode[nodeId],\n rackId: this.rackId,\n })\n\n const batchesPerPartition = responses.map(({ topicName, partitions }) => {\n const topicRequestData = requestsPerNode[nodeId].find(({ topic }) => topic === topicName)\n let preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[topicName]\n if (!preferredReadReplicas) {\n this.preferredReadReplicasPerTopicPartition[topicName] = preferredReadReplicas = {}\n }\n\n return partitions\n .filter(\n partitionData =>\n !this.seekOffset.has(topicName, partitionData.partition) &&\n !this.subscriptionState.isPaused(topicName, partitionData.partition)\n )\n .map(partitionData => {\n const { partition, preferredReadReplica } = partitionData\n if (preferredReadReplica != null && preferredReadReplica !== -1) {\n const { nodeId: currentPreferredReadReplica } =\n preferredReadReplicas[partition] || {}\n if (currentPreferredReadReplica !== preferredReadReplica) {\n this.logger.info(`Preferred read replica is now ${preferredReadReplica}`, {\n groupId: this.groupId,\n memberId: this.memberId,\n topic: topicName,\n partition,\n })\n }\n preferredReadReplicas[partition] = {\n nodeId: preferredReadReplica,\n expireAt: Date.now() + this.metadataMaxAge,\n }\n }\n\n const partitionRequestData = topicRequestData.partitions.find(\n ({ partition }) => partition === partitionData.partition\n )\n\n const fetchedOffset = partitionRequestData.fetchOffset\n return new Batch(topicName, fetchedOffset, partitionData)\n })\n })\n\n return flatten(batchesPerPartition)\n })\n\n // fetch can generate empty requests when the consumer group receives an assignment\n // with more topics than the subscribed, so to prevent a busy loop we wait the\n // configured max wait time\n if (requests.length === 0) {\n await sleep(this.maxWaitTime)\n return BufferedAsyncIterator([])\n }\n\n return BufferedAsyncIterator(requests, e => this.recoverFromFetch(e))\n } catch (e) {\n await this.recoverFromFetch(e)\n }\n }\n\n async recoverFromFetch(e) {\n if (STALE_METADATA_ERRORS.includes(e.type) || e.name === 'KafkaJSTopicMetadataNotLoaded') {\n this.logger.debug('Stale cluster metadata, refreshing...', {\n groupId: this.groupId,\n memberId: this.memberId,\n error: e.message,\n })\n\n await this.cluster.refreshMetadata()\n await this.joinAndSync()\n throw new KafkaJSError(e.message)\n }\n\n if (e.name === 'KafkaJSStaleTopicMetadataAssignment') {\n this.logger.warn(`${e.message}, resync group`, {\n groupId: this.groupId,\n memberId: this.memberId,\n topic: e.topic,\n unknownPartitions: e.unknownPartitions,\n })\n\n await this.joinAndSync()\n }\n\n if (e.name === 'KafkaJSOffsetOutOfRange') {\n await this.recoverFromOffsetOutOfRange(e)\n }\n\n if (e.name === 'KafkaJSConnectionClosedError') {\n this.cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n if (e.name === 'KafkaJSBrokerNotFound' || e.name === 'KafkaJSConnectionClosedError') {\n this.logger.debug(`${e.message}, refreshing metadata and retrying...`)\n await this.cluster.refreshMetadata()\n }\n\n throw e\n }\n\n async recoverFromOffsetOutOfRange(e) {\n // If we are fetching from a follower try with the leader before resetting offsets\n const preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[e.topic]\n if (preferredReadReplicas && typeof preferredReadReplicas[e.partition] === 'number') {\n this.logger.info('Offset out of range while fetching from follower, retrying with leader', {\n topic: e.topic,\n partition: e.partition,\n groupId: this.groupId,\n memberId: this.memberId,\n })\n delete preferredReadReplicas[e.partition]\n } else {\n this.logger.error('Offset out of range, resetting to default offset', {\n topic: e.topic,\n partition: e.partition,\n groupId: this.groupId,\n memberId: this.memberId,\n })\n\n await this.offsetManager.setDefaultOffset({\n topic: e.topic,\n partition: e.partition,\n })\n }\n }\n\n generatePartitionsPerSubscribedTopic() {\n const map = new Map()\n\n for (const topic of this.topicsSubscribed) {\n const partitions = this.cluster\n .findTopicPartitionMetadata(topic)\n .map(m => m.partitionId)\n .sort()\n\n map.set(topic, partitions)\n }\n\n return map\n }\n\n checkForStaleAssignment() {\n if (!this.partitionsPerSubscribedTopic) {\n return\n }\n\n const newPartitionsPerSubscribedTopic = this.generatePartitionsPerSubscribedTopic()\n\n for (const [topic, partitions] of newPartitionsPerSubscribedTopic) {\n const diff = arrayDiff(partitions, this.partitionsPerSubscribedTopic.get(topic))\n\n if (diff.length > 0) {\n throw new KafkaJSStaleTopicMetadataAssignment('Topic has been updated', {\n topic,\n unknownPartitions: diff,\n })\n }\n }\n }\n\n hasSeekOffset({ topic, partition }) {\n return this.seekOffset.has(topic, partition)\n }\n\n /**\n * For each of the partitions find the best nodeId to read it from\n *\n * @param {string} topic\n * @param {number[]} partitions\n * @returns {{[nodeId: number]: number[]}} per-node assignment of partitions\n * @see Cluster~findLeaderForPartitions\n */\n // Invariant: The resulting object has each partition referenced exactly once\n findReadReplicaForPartitions(topic, partitions) {\n const partitionMetadata = this.cluster.findTopicPartitionMetadata(topic)\n const preferredReadReplicas = this.preferredReadReplicasPerTopicPartition[topic]\n return partitions.reduce((result, id) => {\n const partitionId = parseInt(id, 10)\n const metadata = partitionMetadata.find(p => p.partitionId === partitionId)\n if (!metadata) {\n return result\n }\n\n if (metadata.leader == null) {\n throw new KafkaJSError('Invalid partition metadata', { topic, partitionId, metadata })\n }\n\n // Pick the preferred replica if there is one, and it isn't known to be offline, otherwise the leader.\n let nodeId = metadata.leader\n if (preferredReadReplicas) {\n const { nodeId: preferredReadReplica, expireAt } = preferredReadReplicas[partitionId] || {}\n if (Date.now() >= expireAt) {\n this.logger.debug('Preferred read replica information has expired, using leader', {\n topic,\n partitionId,\n groupId: this.groupId,\n memberId: this.memberId,\n preferredReadReplica,\n leader: metadata.leader,\n })\n // Drop the entry\n delete preferredReadReplicas[partitionId]\n } else if (preferredReadReplica != null) {\n // Valid entry, check whether it is not offline\n // Note that we don't delete the preference here, and rather hope that eventually that replica comes online again\n const offlineReplicas = metadata.offlineReplicas\n if (Array.isArray(offlineReplicas) && offlineReplicas.includes(nodeId)) {\n this.logger.debug('Preferred read replica is offline, using leader', {\n topic,\n partitionId,\n groupId: this.groupId,\n memberId: this.memberId,\n preferredReadReplica,\n leader: metadata.leader,\n })\n } else {\n nodeId = preferredReadReplica\n }\n }\n }\n const current = result[nodeId] || []\n return { ...result, [nodeId]: [...current, partitionId] }\n }, {})\n }\n}\n","const Long = require('../utils/long')\nconst ABORTED_MESSAGE_KEY = Buffer.from([0, 0, 0, 0])\n\nconst isAbortMarker = ({ key }) => {\n // Handle null/undefined keys.\n if (!key) return false\n // Cast key to buffer defensively\n return Buffer.from(key).equals(ABORTED_MESSAGE_KEY)\n}\n\n/**\n * Remove messages marked as aborted according to the aborted transactions list.\n *\n * Start of an aborted transaction is determined by message offset.\n * End of an aborted transaction is determined by control messages.\n * @param {Message[]} messages\n * @param {Transaction[]} [abortedTransactions]\n * @returns {Message[]} Messages which did not participate in an aborted transaction\n *\n * @typedef {object} Message\n * @param {Buffer} key\n * @param {lastOffset} key Int64\n * @param {RecordBatch} batchContext\n *\n * @typedef {object} Transaction\n * @param {string} firstOffset Int64\n * @param {string} producerId Int64\n *\n * @typedef {object} RecordBatch\n * @param {string} producerId Int64\n * @param {boolean} inTransaction\n */\nmodule.exports = ({ messages, abortedTransactions }) => {\n const currentAbortedTransactions = new Map()\n\n if (!abortedTransactions || !abortedTransactions.length) {\n return messages\n }\n\n const remainingAbortedTransactions = [...abortedTransactions]\n\n return messages.filter(message => {\n // If the message offset is GTE the first offset of the next aborted transaction\n // then we have stepped into an aborted transaction.\n if (\n remainingAbortedTransactions.length &&\n Long.fromValue(message.offset).gte(remainingAbortedTransactions[0].firstOffset)\n ) {\n const { producerId } = remainingAbortedTransactions.shift()\n currentAbortedTransactions.set(producerId, true)\n }\n\n const { producerId, inTransaction } = message.batchContext\n\n if (isAbortMarker(message)) {\n // Transaction is over, we no longer need to ignore messages from this producer\n currentAbortedTransactions.delete(producerId)\n } else if (currentAbortedTransactions.has(producerId) && inTransaction) {\n return false\n }\n\n return true\n })\n}\n","const Long = require('../utils/long')\nconst createRetry = require('../retry')\nconst { initialRetryTime } = require('../retry/defaults')\nconst ConsumerGroup = require('./consumerGroup')\nconst Runner = require('./runner')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst { KafkaJSNonRetriableError } = require('../errors')\nconst { roundRobin } = require('./assigners')\nconst { EARLIEST_OFFSET, LATEST_OFFSET } = require('../constants')\nconst ISOLATION_LEVEL = require('../protocol/isolationLevel')\n\nconst { keys, values } = Object\nconst { CONNECT, DISCONNECT, STOP, CRASH } = events\n\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `consumer.events.${key}`)\n .join(', ')\n\nconst specialOffsets = [\n Long.fromValue(EARLIEST_OFFSET).toString(),\n Long.fromValue(LATEST_OFFSET).toString(),\n]\n\n/**\n * @param {Object} params\n * @param {import(\"../../types\").Cluster} params.cluster\n * @param {String} params.groupId\n * @param {import('../../types').RetryOptions} [params.retry]\n * @param {import('../../types').Logger} params.logger\n * @param {import('../../types').PartitionAssigner[]} [params.partitionAssigners]\n * @param {number} [params.sessionTimeout]\n * @param {number} [params.rebalanceTimeout]\n * @param {number} [params.heartbeatInterval]\n * @param {number} [params.maxBytesPerPartition]\n * @param {number} [params.minBytes]\n * @param {number} [params.maxBytes]\n * @param {number} [params.maxWaitTimeInMs]\n * @param {number} [params.isolationLevel]\n * @param {string} [params.rackId]\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n * @param {number} params.metadataMaxAge\n *\n * @returns {import(\"../../types\").Consumer}\n */\nmodule.exports = ({\n cluster,\n groupId,\n retry,\n logger: rootLogger,\n partitionAssigners = [roundRobin],\n sessionTimeout = 30000,\n rebalanceTimeout = 60000,\n heartbeatInterval = 3000,\n maxBytesPerPartition = 1048576, // 1MB\n minBytes = 1,\n maxBytes = 10485760, // 10MB\n maxWaitTimeInMs = 5000,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n rackId = '',\n instrumentationEmitter: rootInstrumentationEmitter,\n metadataMaxAge,\n}) => {\n if (!groupId) {\n throw new KafkaJSNonRetriableError('Consumer groupId must be a non-empty string.')\n }\n\n const logger = rootLogger.namespace('Consumer')\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n const assigners = partitionAssigners.map(createAssigner =>\n createAssigner({ groupId, logger, cluster })\n )\n\n const topics = {}\n let runner = null\n let consumerGroup = null\n\n if (heartbeatInterval >= sessionTimeout) {\n throw new KafkaJSNonRetriableError(\n `Consumer heartbeatInterval (${heartbeatInterval}) must be lower than sessionTimeout (${sessionTimeout}). It is recommended to set heartbeatInterval to approximately a third of the sessionTimeout.`\n )\n }\n\n const createConsumerGroup = ({ autoCommit, autoCommitInterval, autoCommitThreshold }) => {\n return new ConsumerGroup({\n logger: rootLogger,\n topics: keys(topics),\n topicConfigurations: topics,\n retry,\n cluster,\n groupId,\n assigners,\n sessionTimeout,\n rebalanceTimeout,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n instrumentationEmitter,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n isolationLevel,\n rackId,\n metadataMaxAge,\n })\n }\n\n const createRunner = ({\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n onCrash,\n autoCommit,\n partitionsConsumedConcurrently,\n }) => {\n return new Runner({\n autoCommit,\n logger: rootLogger,\n consumerGroup,\n instrumentationEmitter,\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n heartbeatInterval,\n retry,\n onCrash,\n partitionsConsumedConcurrently,\n })\n }\n\n /** @type {import(\"../../types\").Consumer[\"connect\"]} */\n const connect = async () => {\n await cluster.connect()\n instrumentationEmitter.emit(CONNECT)\n }\n\n /** @type {import(\"../../types\").Consumer[\"disconnect\"]} */\n const disconnect = async () => {\n try {\n await stop()\n logger.debug('consumer has stopped, disconnecting', { groupId })\n await cluster.disconnect()\n instrumentationEmitter.emit(DISCONNECT)\n } catch (e) {\n logger.error(`Caught error when disconnecting the consumer: ${e.message}`, {\n stack: e.stack,\n groupId,\n })\n throw e\n }\n }\n\n /** @type {import(\"../../types\").Consumer[\"stop\"]} */\n const stop = async () => {\n try {\n if (runner) {\n await runner.stop()\n runner = null\n consumerGroup = null\n instrumentationEmitter.emit(STOP)\n }\n\n logger.info('Stopped', { groupId })\n } catch (e) {\n logger.error(`Caught error when stopping the consumer: ${e.message}`, {\n stack: e.stack,\n groupId,\n })\n\n throw e\n }\n }\n\n /** @type {import(\"../../types\").Consumer[\"subscribe\"]} */\n const subscribe = async ({ topic, fromBeginning = false }) => {\n if (consumerGroup) {\n throw new KafkaJSNonRetriableError('Cannot subscribe to topic while consumer is running')\n }\n\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n const isRegExp = topic instanceof RegExp\n if (typeof topic !== 'string' && !isRegExp) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${topic} (${typeof topic}), the topic name has to be a String or a RegExp`\n )\n }\n\n const topicsToSubscribe = []\n if (isRegExp) {\n const topicRegExp = topic\n const metadata = await cluster.metadata()\n const matchedTopics = metadata.topicMetadata\n .map(({ topic: topicName }) => topicName)\n .filter(topicName => topicRegExp.test(topicName))\n\n logger.debug('Subscription based on RegExp', {\n groupId,\n topicRegExp: topicRegExp.toString(),\n matchedTopics,\n })\n\n topicsToSubscribe.push(...matchedTopics)\n } else {\n topicsToSubscribe.push(topic)\n }\n\n for (const t of topicsToSubscribe) {\n topics[t] = { fromBeginning }\n }\n\n await cluster.addMultipleTargetTopics(topicsToSubscribe)\n }\n\n /** @type {import(\"../../types\").Consumer[\"run\"]} */\n const run = async ({\n autoCommit = true,\n autoCommitInterval = null,\n autoCommitThreshold = null,\n eachBatchAutoResolve = true,\n partitionsConsumedConcurrently = 1,\n eachBatch = null,\n eachMessage = null,\n } = {}) => {\n if (consumerGroup) {\n logger.warn('consumer#run was called, but the consumer is already running', { groupId })\n return\n }\n\n consumerGroup = createConsumerGroup({\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n })\n\n const start = async onCrash => {\n logger.info('Starting', { groupId })\n runner = createRunner({\n autoCommit,\n eachBatchAutoResolve,\n eachBatch,\n eachMessage,\n onCrash,\n partitionsConsumedConcurrently,\n })\n\n await runner.start()\n }\n\n const restart = onCrash => {\n consumerGroup = createConsumerGroup({\n autoCommitInterval,\n autoCommitThreshold,\n })\n\n start(onCrash)\n }\n\n const onCrash = async e => {\n logger.error(`Crash: ${e.name}: ${e.message}`, {\n groupId,\n retryCount: e.retryCount,\n stack: e.stack,\n })\n\n if (e.name === 'KafkaJSConnectionClosedError') {\n cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n await disconnect()\n\n const isErrorRetriable = e.name === 'KafkaJSNumberOfRetriesExceeded' || e.retriable === true\n const shouldRestart =\n isErrorRetriable &&\n (!retry ||\n !retry.restartOnFailure ||\n (await retry.restartOnFailure(e).catch(error => {\n logger.error(\n 'Caught error when invoking user-provided \"restartOnFailure\" callback. Defaulting to restarting.',\n {\n error: error.message || error,\n originalError: e.message || e,\n groupId,\n }\n )\n\n return true\n })))\n\n instrumentationEmitter.emit(CRASH, {\n error: e,\n groupId,\n restart: shouldRestart,\n })\n\n if (shouldRestart) {\n const retryTime = e.retryTime || (retry && retry.initialRetryTime) || initialRetryTime\n logger.error(`Restarting the consumer in ${retryTime}ms`, {\n retryCount: e.retryCount,\n retryTime,\n groupId,\n })\n\n setTimeout(() => restart(onCrash), retryTime)\n }\n }\n\n await start(onCrash)\n }\n\n /** @type {import(\"../../types\").Consumer[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"commitOffsets\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partition: 0, offset: '1', metadata: 'event-id-3' }]\n */\n const commitOffsets = async (topicPartitions = []) => {\n const commitsByTopic = topicPartitions.reduce(\n (payload, { topic, partition, offset, metadata = null }) => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (isNaN(partition)) {\n throw new KafkaJSNonRetriableError(\n `Invalid partition, expected a number received ${partition}`\n )\n }\n\n let commitOffset\n try {\n commitOffset = Long.fromValue(offset)\n } catch (_) {\n throw new KafkaJSNonRetriableError(`Invalid offset, expected a long received ${offset}`)\n }\n\n if (commitOffset.lessThan(0)) {\n throw new KafkaJSNonRetriableError('Offset must not be a negative number')\n }\n\n if (metadata !== null && typeof metadata !== 'string') {\n throw new KafkaJSNonRetriableError(\n `Invalid offset metadata, expected string or null, received ${metadata}`\n )\n }\n\n const topicCommits = payload[topic] || []\n\n topicCommits.push({ partition, offset: commitOffset, metadata })\n\n return { ...payload, [topic]: topicCommits }\n },\n {}\n )\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n const topics = Object.keys(commitsByTopic)\n\n return runner.commitOffsets({\n topics: topics.map(topic => {\n return {\n topic,\n partitions: commitsByTopic[topic],\n }\n }),\n })\n }\n\n /** @type {import(\"../../types\").Consumer[\"seek\"]} */\n const seek = ({ topic, partition, offset }) => {\n if (!topic) {\n throw new KafkaJSNonRetriableError(`Invalid topic ${topic}`)\n }\n\n if (isNaN(partition)) {\n throw new KafkaJSNonRetriableError(\n `Invalid partition, expected a number received ${partition}`\n )\n }\n\n let seekOffset\n try {\n seekOffset = Long.fromValue(offset)\n } catch (_) {\n throw new KafkaJSNonRetriableError(`Invalid offset, expected a long received ${offset}`)\n }\n\n if (seekOffset.lessThan(0) && !specialOffsets.includes(seekOffset.toString())) {\n throw new KafkaJSNonRetriableError('Offset must not be a negative number')\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.seek({ topic, partition, offset: seekOffset.toString() })\n }\n\n /** @type {import(\"../../types\").Consumer[\"describeGroup\"]} */\n const describeGroup = async () => {\n const coordinator = await cluster.findGroupCoordinator({ groupId })\n const retrier = createRetry(retry)\n return retrier(async () => {\n const { groups } = await coordinator.describeGroups({ groupIds: [groupId] })\n return groups.find(group => group.groupId === groupId)\n })\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"pause\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n const pause = (topicPartitions = []) => {\n for (const topicPartition of topicPartitions) {\n if (!topicPartition || !topicPartition.topic) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${(topicPartition && topicPartition.topic) || topicPartition}`\n )\n } else if (\n typeof topicPartition.partitions !== 'undefined' &&\n (!Array.isArray(topicPartition.partitions) || topicPartition.partitions.some(isNaN))\n ) {\n throw new KafkaJSNonRetriableError(\n `Array of valid partitions required to pause specific partitions instead of ${topicPartition.partitions}`\n )\n }\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.pause(topicPartitions)\n }\n\n /**\n * Returns the list of topic partitions paused on this consumer\n *\n * @type {import(\"../../types\").Consumer[\"paused\"]}\n */\n const paused = () => {\n if (!consumerGroup) {\n return []\n }\n\n return consumerGroup.paused()\n }\n\n /**\n * @type {import(\"../../types\").Consumer[\"resume\"]}\n * @param topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n const resume = (topicPartitions = []) => {\n for (const topicPartition of topicPartitions) {\n if (!topicPartition || !topicPartition.topic) {\n throw new KafkaJSNonRetriableError(\n `Invalid topic ${(topicPartition && topicPartition.topic) || topicPartition}`\n )\n } else if (\n typeof topicPartition.partitions !== 'undefined' &&\n (!Array.isArray(topicPartition.partitions) || topicPartition.partitions.some(isNaN))\n ) {\n throw new KafkaJSNonRetriableError(\n `Array of valid partitions required to resume specific partitions instead of ${topicPartition.partitions}`\n )\n }\n }\n\n if (!consumerGroup) {\n throw new KafkaJSNonRetriableError(\n 'Consumer group was not initialized, consumer#run must be called first'\n )\n }\n\n consumerGroup.resume(topicPartitions)\n }\n\n /**\n * @return {Object} logger\n */\n const getLogger = () => logger\n\n return {\n connect,\n disconnect,\n subscribe,\n stop,\n run,\n commitOffsets,\n seek,\n describeGroup,\n pause,\n paused,\n resume,\n on,\n events,\n logger: getLogger,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst networkEvents = require('../network/instrumentationEvents')\nconst consumerType = InstrumentationEventType('consumer')\n\nconst events = {\n HEARTBEAT: consumerType('heartbeat'),\n COMMIT_OFFSETS: consumerType('commit_offsets'),\n GROUP_JOIN: consumerType('group_join'),\n FETCH: consumerType('fetch'),\n FETCH_START: consumerType('fetch_start'),\n START_BATCH_PROCESS: consumerType('start_batch_process'),\n END_BATCH_PROCESS: consumerType('end_batch_process'),\n CONNECT: consumerType('connect'),\n DISCONNECT: consumerType('disconnect'),\n STOP: consumerType('stop'),\n CRASH: consumerType('crash'),\n REBALANCING: consumerType('rebalancing'),\n RECEIVED_UNSUBSCRIBED_TOPICS: consumerType('received_unsubscribed_topics'),\n REQUEST: consumerType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: consumerType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: consumerType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const Long = require('../../utils/long')\nconst flatten = require('../../utils/flatten')\nconst isInvalidOffset = require('./isInvalidOffset')\nconst initializeConsumerOffsets = require('./initializeConsumerOffsets')\nconst {\n events: { COMMIT_OFFSETS },\n} = require('../instrumentationEvents')\n\nconst { keys, assign } = Object\nconst indexTopics = topics => topics.reduce((obj, topic) => assign(obj, { [topic]: {} }), {})\n\nconst PRIVATE = {\n COMMITTED_OFFSETS: Symbol('private:OffsetManager:committedOffsets'),\n}\nmodule.exports = class OffsetManager {\n /**\n * @param {Object} options\n * @param {import(\"../../../types\").Cluster} options.cluster\n * @param {import(\"../../../types\").Broker} options.coordinator\n * @param {import(\"../../../types\").IMemberAssignment} options.memberAssignment\n * @param {boolean} options.autoCommit\n * @param {number | null} options.autoCommitInterval\n * @param {number | null} options.autoCommitThreshold\n * @param {{[topic: string]: { fromBeginning: boolean }}} options.topicConfigurations\n * @param {import(\"../../instrumentation/emitter\")} options.instrumentationEmitter\n * @param {string} options.groupId\n * @param {number} options.generationId\n * @param {string} options.memberId\n */\n constructor({\n cluster,\n coordinator,\n memberAssignment,\n autoCommit,\n autoCommitInterval,\n autoCommitThreshold,\n topicConfigurations,\n instrumentationEmitter,\n groupId,\n generationId,\n memberId,\n }) {\n this.cluster = cluster\n this.coordinator = coordinator\n\n // memberAssignment format:\n // {\n // 'topic1': [0, 1, 2, 3],\n // 'topic2': [0, 1, 2, 3, 4, 5],\n // }\n this.memberAssignment = memberAssignment\n\n this.topicConfigurations = topicConfigurations\n this.instrumentationEmitter = instrumentationEmitter\n this.groupId = groupId\n this.generationId = generationId\n this.memberId = memberId\n\n this.autoCommit = autoCommit\n this.autoCommitInterval = autoCommitInterval\n this.autoCommitThreshold = autoCommitThreshold\n this.lastCommit = Date.now()\n\n this.topics = keys(memberAssignment)\n this.clearAllOffsets()\n }\n\n /**\n * @param {string} topic\n * @param {number} partition\n * @returns {Long}\n */\n nextOffset(topic, partition) {\n if (!this.resolvedOffsets[topic][partition]) {\n this.resolvedOffsets[topic][partition] = this.committedOffsets()[topic][partition]\n }\n\n let offset = this.resolvedOffsets[topic][partition]\n if (isInvalidOffset(offset)) {\n offset = '0'\n }\n\n return Long.fromValue(offset)\n }\n\n /**\n * @returns {Promise}\n */\n async getCoordinator() {\n if (!this.coordinator.isConnected()) {\n this.coordinator = await this.cluster.findBroker(this.coordinator)\n }\n\n return this.coordinator\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n resetOffset({ topic, partition }) {\n this.resolvedOffsets[topic][partition] = this.committedOffsets()[topic][partition]\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n resolveOffset({ topic, partition, offset }) {\n this.resolvedOffsets[topic][partition] = Long.fromValue(offset)\n .add(1)\n .toString()\n }\n\n /**\n * @returns {Long}\n */\n countResolvedOffsets() {\n const committedOffsets = this.committedOffsets()\n\n const subtractOffsets = (resolvedOffset, committedOffset) => {\n const resolvedOffsetLong = Long.fromValue(resolvedOffset)\n return isInvalidOffset(committedOffset)\n ? resolvedOffsetLong\n : resolvedOffsetLong.subtract(Long.fromValue(committedOffset))\n }\n\n const subtractPartitionOffsets = (resolvedTopicOffsets, committedTopicOffsets) =>\n keys(resolvedTopicOffsets).map(partition =>\n subtractOffsets(resolvedTopicOffsets[partition], committedTopicOffsets[partition])\n )\n\n const subtractTopicOffsets = topic =>\n subtractPartitionOffsets(this.resolvedOffsets[topic], committedOffsets[topic])\n\n const offsetsDiff = this.topics.map(subtractTopicOffsets)\n return flatten(offsetsDiff).reduce((sum, offset) => sum.add(offset), Long.fromValue(0))\n }\n\n /**\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n async setDefaultOffset({ topic, partition }) {\n const { groupId, generationId, memberId } = this\n const defaultOffset = this.cluster.defaultOffset(this.topicConfigurations[topic])\n const coordinator = await this.getCoordinator()\n\n await coordinator.offsetCommit({\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics: [\n {\n topic,\n partitions: [{ partition, offset: defaultOffset }],\n },\n ],\n })\n\n this.clearOffsets({ topic, partition })\n }\n\n /**\n * Commit the given offset to the topic/partition. If the consumer isn't assigned to the given\n * topic/partition this method will be a NO-OP.\n *\n * @param {import(\"../../../types\").TopicPartitionOffset} topicPartitionOffset\n */\n async seek({ topic, partition, offset }) {\n if (!this.memberAssignment[topic] || !this.memberAssignment[topic].includes(partition)) {\n return\n }\n\n if (!this.autoCommit) {\n this.resolveOffset({\n topic,\n partition,\n offset: Long.fromValue(offset)\n .subtract(1)\n .toString(),\n })\n return\n }\n\n const { groupId, generationId, memberId } = this\n const coordinator = await this.getCoordinator()\n\n await coordinator.offsetCommit({\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics: [\n {\n topic,\n partitions: [{ partition, offset }],\n },\n ],\n })\n\n this.clearOffsets({ topic, partition })\n }\n\n async commitOffsetsIfNecessary() {\n const now = Date.now()\n\n const timeoutReached =\n this.autoCommitInterval != null && now >= this.lastCommit + this.autoCommitInterval\n\n const thresholdReached =\n this.autoCommitThreshold != null &&\n this.countResolvedOffsets().gte(Long.fromValue(this.autoCommitThreshold))\n\n if (timeoutReached || thresholdReached) {\n return this.commitOffsets()\n }\n }\n\n /**\n * Return all locally resolved offsets which are not marked as committed, by topic-partition.\n * @returns {OffsetsByTopicPartition}\n *\n * @typedef {Object} OffsetsByTopicPartition\n * @property {TopicOffsets[]} topics\n *\n * @typedef {Object} TopicOffsets\n * @property {PartitionOffset[]} partitions\n *\n * @typedef {Object} PartitionOffset\n * @property {string} partition\n * @property {string} offset\n */\n uncommittedOffsets() {\n const offsets = topic => keys(this.resolvedOffsets[topic])\n const emptyPartitions = ({ partitions }) => partitions.length > 0\n const toPartitions = topic => partition => ({\n partition,\n offset: this.resolvedOffsets[topic][partition],\n })\n const changedOffsets = topic => ({ partition, offset }) => {\n return (\n offset !== this.committedOffsets()[topic][partition] &&\n Long.fromValue(offset).greaterThanOrEqual(0)\n )\n }\n\n // Select and format updated partitions\n const topicsWithPartitionsToCommit = this.topics\n .map(topic => ({\n topic,\n partitions: offsets(topic)\n .map(toPartitions(topic))\n .filter(changedOffsets(topic)),\n }))\n .filter(emptyPartitions)\n\n return { topics: topicsWithPartitionsToCommit }\n }\n\n async commitOffsets(offsets = {}) {\n const { groupId, generationId, memberId } = this\n const { topics = this.uncommittedOffsets().topics } = offsets\n\n if (topics.length === 0) {\n this.lastCommit = Date.now()\n return\n }\n\n const payload = {\n groupId,\n memberId,\n groupGenerationId: generationId,\n topics,\n }\n\n try {\n const coordinator = await this.getCoordinator()\n await coordinator.offsetCommit(payload)\n this.instrumentationEmitter.emit(COMMIT_OFFSETS, payload)\n\n // Update local reference of committed offsets\n topics.forEach(({ topic, partitions }) => {\n const updatedOffsets = partitions.reduce(\n (obj, { partition, offset }) => assign(obj, { [partition]: offset }),\n {}\n )\n\n this[PRIVATE.COMMITTED_OFFSETS][topic] = assign(\n {},\n this.committedOffsets()[topic],\n updatedOffsets\n )\n })\n\n this.lastCommit = Date.now()\n } catch (e) {\n // metadata is stale, the coordinator has changed due to a restart or\n // broker reassignment\n if (e.type === 'NOT_COORDINATOR_FOR_GROUP') {\n await this.cluster.refreshMetadata()\n }\n\n throw e\n }\n }\n\n async resolveOffsets() {\n const { groupId } = this\n const invalidOffset = topic => partition => {\n return isInvalidOffset(this.committedOffsets()[topic][partition])\n }\n\n const pendingPartitions = this.topics\n .map(topic => ({\n topic,\n partitions: this.memberAssignment[topic]\n .filter(invalidOffset(topic))\n .map(partition => ({ partition })),\n }))\n .filter(t => t.partitions.length > 0)\n\n if (pendingPartitions.length === 0) {\n return\n }\n\n const coordinator = await this.getCoordinator()\n const { responses: consumerOffsets } = await coordinator.offsetFetch({\n groupId,\n topics: pendingPartitions,\n })\n\n const unresolvedPartitions = consumerOffsets.map(({ topic, partitions }) =>\n assign(\n {\n topic,\n partitions: partitions\n .filter(({ offset }) => isInvalidOffset(offset))\n .map(({ partition }) => assign({ partition })),\n },\n this.topicConfigurations[topic]\n )\n )\n\n const indexPartitions = (obj, { partition, offset }) => {\n return assign(obj, { [partition]: offset })\n }\n\n const hasUnresolvedPartitions = () => unresolvedPartitions.some(t => t.partitions.length > 0)\n\n let offsets = consumerOffsets\n if (hasUnresolvedPartitions()) {\n const topicOffsets = await this.cluster.fetchTopicsOffset(unresolvedPartitions)\n offsets = initializeConsumerOffsets(consumerOffsets, topicOffsets)\n }\n\n offsets.forEach(({ topic, partitions }) => {\n this.committedOffsets()[topic] = partitions.reduce(indexPartitions, {\n ...this.committedOffsets()[topic],\n })\n })\n }\n\n /**\n * @private\n * @param {import(\"../../../types\").TopicPartition} topicPartition\n */\n clearOffsets({ topic, partition }) {\n delete this.committedOffsets()[topic][partition]\n delete this.resolvedOffsets[topic][partition]\n }\n\n /**\n * @private\n */\n clearAllOffsets() {\n const committedOffsets = this.committedOffsets()\n\n for (const topic in committedOffsets) {\n delete committedOffsets[topic]\n }\n\n for (const topic of this.topics) {\n committedOffsets[topic] = {}\n }\n\n this.resolvedOffsets = indexTopics(this.topics)\n }\n\n committedOffsets() {\n if (!this[PRIVATE.COMMITTED_OFFSETS]) {\n this[PRIVATE.COMMITTED_OFFSETS] = this.groupId\n ? this.cluster.committedOffsets({ groupId: this.groupId })\n : {}\n }\n\n return this[PRIVATE.COMMITTED_OFFSETS]\n }\n}\n","const isInvalidOffset = require('./isInvalidOffset')\nconst { keys, assign } = Object\n\nconst indexPartitions = (obj, { partition, offset }) => assign(obj, { [partition]: offset })\nconst indexTopics = (obj, { topic, partitions }) =>\n assign(obj, { [topic]: partitions.reduce(indexPartitions, {}) })\n\nmodule.exports = (consumerOffsets, topicOffsets) => {\n const indexedConsumerOffsets = consumerOffsets.reduce(indexTopics, {})\n const indexedTopicOffsets = topicOffsets.reduce(indexTopics, {})\n\n return keys(indexedConsumerOffsets).map(topic => {\n const partitions = indexedConsumerOffsets[topic]\n return {\n topic,\n partitions: keys(partitions).map(partition => {\n const offset = partitions[partition]\n const resolvedOffset = isInvalidOffset(offset)\n ? indexedTopicOffsets[topic][partition]\n : offset\n\n return { partition: Number(partition), offset: resolvedOffset }\n }),\n }\n })\n}\n","const Long = require('../../utils/long')\n\nmodule.exports = offset => (!offset && offset !== 0) || Long.fromValue(offset).isNegative()\n","const { EventEmitter } = require('events')\nconst Long = require('../utils/long')\nconst createRetry = require('../retry')\nconst limitConcurrency = require('../utils/concurrency')\nconst { KafkaJSError } = require('../errors')\nconst barrier = require('./barrier')\n\nconst {\n events: { FETCH, FETCH_START, START_BATCH_PROCESS, END_BATCH_PROCESS, REBALANCING },\n} = require('./instrumentationEvents')\n\nconst isRebalancing = e =>\n e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP'\n\nconst isKafkaJSError = e => e instanceof KafkaJSError\nconst isSameOffset = (offsetA, offsetB) => Long.fromValue(offsetA).equals(Long.fromValue(offsetB))\nconst CONSUMING_START = 'consuming-start'\nconst CONSUMING_STOP = 'consuming-stop'\n\nmodule.exports = class Runner extends EventEmitter {\n /**\n * @param {object} options\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"./consumerGroup\")} options.consumerGroup\n * @param {import(\"../instrumentation/emitter\")} options.instrumentationEmitter\n * @param {boolean} [options.eachBatchAutoResolve=true]\n * @param {number} [options.partitionsConsumedConcurrently]\n * @param {(payload: import(\"../../types\").EachBatchPayload) => Promise} options.eachBatch\n * @param {(payload: import(\"../../types\").EachMessagePayload) => Promise} options.eachMessage\n * @param {number} [options.heartbeatInterval]\n * @param {(reason: Error) => void} options.onCrash\n * @param {import(\"../../types\").RetryOptions} [options.retry]\n * @param {boolean} [options.autoCommit=true]\n */\n constructor({\n logger,\n consumerGroup,\n instrumentationEmitter,\n eachBatchAutoResolve = true,\n partitionsConsumedConcurrently,\n eachBatch,\n eachMessage,\n heartbeatInterval,\n onCrash,\n retry,\n autoCommit = true,\n }) {\n super()\n this.logger = logger.namespace('Runner')\n this.consumerGroup = consumerGroup\n this.instrumentationEmitter = instrumentationEmitter\n this.eachBatchAutoResolve = eachBatchAutoResolve\n this.eachBatch = eachBatch\n this.eachMessage = eachMessage\n this.heartbeatInterval = heartbeatInterval\n this.retrier = createRetry(Object.assign({}, retry))\n this.onCrash = onCrash\n this.autoCommit = autoCommit\n this.partitionsConsumedConcurrently = partitionsConsumedConcurrently\n\n this.running = false\n this.consuming = false\n }\n\n get consuming() {\n return this._consuming\n }\n\n set consuming(value) {\n if (this._consuming !== value) {\n this._consuming = value\n this.emit(value ? CONSUMING_START : CONSUMING_STOP)\n }\n }\n\n async join() {\n await this.consumerGroup.joinAndSync()\n this.running = true\n }\n\n async scheduleJoin() {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n return\n }\n\n return this.join().catch(this.onCrash)\n }\n\n async start() {\n if (this.running) {\n return\n }\n\n try {\n await this.consumerGroup.connect()\n await this.join()\n\n this.running = true\n this.scheduleFetch()\n } catch (e) {\n this.onCrash(e)\n }\n }\n\n async stop() {\n if (!this.running) {\n return\n }\n\n this.logger.debug('stop consumer group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n this.running = false\n\n try {\n await this.waitForConsumer()\n await this.consumerGroup.leave()\n } catch (e) {}\n }\n\n waitForConsumer() {\n return new Promise(resolve => {\n if (!this.consuming) {\n return resolve()\n }\n\n this.logger.debug('waiting for consumer to finish...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n this.once(CONSUMING_STOP, () => resolve())\n })\n }\n\n async processEachMessage(batch) {\n const { topic, partition } = batch\n\n for (const message of batch.messages) {\n if (!this.running || this.consumerGroup.hasSeekOffset({ topic, partition })) {\n break\n }\n\n try {\n await this.eachMessage({\n topic,\n partition,\n message,\n heartbeat: async () => {\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n },\n })\n } catch (e) {\n if (!isKafkaJSError(e)) {\n this.logger.error(`Error when calling eachMessage`, {\n topic,\n partition,\n offset: message.offset,\n stack: e.stack,\n error: e,\n })\n }\n\n // In case of errors, commit the previously consumed offsets unless autoCommit is disabled\n await this.autoCommitOffsets()\n throw e\n }\n\n this.consumerGroup.resolveOffset({ topic, partition, offset: message.offset })\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n await this.autoCommitOffsetsIfNecessary()\n }\n }\n\n async processEachBatch(batch) {\n const { topic, partition } = batch\n const lastFilteredMessage = batch.messages[batch.messages.length - 1]\n\n try {\n await this.eachBatch({\n batch,\n resolveOffset: offset => {\n /**\n * The transactional producer generates a control record after committing the transaction.\n * The control record is the last record on the RecordBatch, and it is filtered before it\n * reaches the eachBatch callback. When disabling auto-resolve, the user-land code won't\n * be able to resolve the control record offset, since it never reaches the callback,\n * causing stuck consumers as the consumer will never move the offset marker.\n *\n * When the last offset of the batch is resolved, we should automatically resolve\n * the control record offset as this entry doesn't have any meaning to the user-land code,\n * and won't interfere with the stream processing.\n *\n * @see https://github.com/apache/kafka/blob/9aa660786e46c1efbf5605a6a69136a1dac6edb9/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L1499-L1505\n */\n const offsetToResolve =\n lastFilteredMessage && isSameOffset(offset, lastFilteredMessage.offset)\n ? batch.lastOffset()\n : offset\n\n this.consumerGroup.resolveOffset({ topic, partition, offset: offsetToResolve })\n },\n heartbeat: async () => {\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n },\n /**\n * Commit offsets if provided. Otherwise commit most recent resolved offsets\n * if the autoCommit conditions are met.\n *\n * @param {OffsetsByTopicPartition} [offsets] Optional.\n */\n commitOffsetsIfNecessary: async offsets => {\n return offsets\n ? this.consumerGroup.commitOffsets(offsets)\n : this.consumerGroup.commitOffsetsIfNecessary()\n },\n uncommittedOffsets: () => this.consumerGroup.uncommittedOffsets(),\n isRunning: () => this.running,\n isStale: () => this.consumerGroup.hasSeekOffset({ topic, partition }),\n })\n } catch (e) {\n if (!isKafkaJSError(e)) {\n this.logger.error(`Error when calling eachBatch`, {\n topic,\n partition,\n offset: batch.firstOffset(),\n stack: e.stack,\n error: e,\n })\n }\n\n // eachBatch has a special resolveOffset which can be used\n // to keep track of the messages\n await this.autoCommitOffsets()\n throw e\n }\n\n // resolveOffset for the last offset can be disabled to allow the users of eachBatch to\n // stop their consumers without resolving unprocessed offsets (issues/18)\n if (this.eachBatchAutoResolve) {\n this.consumerGroup.resolveOffset({ topic, partition, offset: batch.lastOffset() })\n }\n }\n\n async fetch() {\n const startFetch = Date.now()\n\n this.instrumentationEmitter.emit(FETCH_START, {})\n\n const iterator = await this.consumerGroup.fetch()\n\n this.instrumentationEmitter.emit(FETCH, {\n /**\n * PR #570 removed support for the number of batches in this instrumentation event;\n * The new implementation uses an async generation to deliver the batches, which makes\n * this number impossible to get. The number is set to 0 to keep the event backward\n * compatible until we bump KafkaJS to version 2, following the end of node 8 LTS.\n *\n * @since 2019-11-29\n */\n numberOfBatches: 0,\n duration: Date.now() - startFetch,\n })\n\n const onBatch = async batch => {\n const startBatchProcess = Date.now()\n const payload = {\n topic: batch.topic,\n partition: batch.partition,\n highWatermark: batch.highWatermark,\n offsetLag: batch.offsetLag(),\n /**\n * @since 2019-06-24 (>= 1.8.0)\n *\n * offsetLag returns the lag based on the latest offset in the batch, to\n * keep the event backward compatible we just introduced \"offsetLagLow\"\n * which calculates the lag based on the first offset in the batch\n */\n offsetLagLow: batch.offsetLagLow(),\n batchSize: batch.messages.length,\n firstOffset: batch.firstOffset(),\n lastOffset: batch.lastOffset(),\n }\n\n /**\n * If the batch contained only control records or only aborted messages then we still\n * need to resolve and auto-commit to ensure the consumer can move forward.\n *\n * We also need to emit batch instrumentation events to allow any listeners keeping\n * track of offsets to know about the latest point of consumption.\n *\n * Added in #1256\n *\n * @see https://github.com/apache/kafka/blob/9aa660786e46c1efbf5605a6a69136a1dac6edb9/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L1499-L1505\n */\n if (batch.isEmptyDueToFiltering()) {\n this.instrumentationEmitter.emit(START_BATCH_PROCESS, payload)\n\n this.consumerGroup.resolveOffset({\n topic: batch.topic,\n partition: batch.partition,\n offset: batch.lastOffset(),\n })\n await this.autoCommitOffsetsIfNecessary()\n\n this.instrumentationEmitter.emit(END_BATCH_PROCESS, {\n ...payload,\n duration: Date.now() - startBatchProcess,\n })\n return\n }\n\n if (batch.isEmpty()) {\n return\n }\n\n this.instrumentationEmitter.emit(START_BATCH_PROCESS, payload)\n\n if (this.eachMessage) {\n await this.processEachMessage(batch)\n } else if (this.eachBatch) {\n await this.processEachBatch(batch)\n }\n\n this.instrumentationEmitter.emit(END_BATCH_PROCESS, {\n ...payload,\n duration: Date.now() - startBatchProcess,\n })\n\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n }\n\n const { lock, unlock, unlockWithError } = barrier()\n const concurrently = limitConcurrency({ limit: this.partitionsConsumedConcurrently })\n\n let requestsCompleted = false\n let numberOfExecutions = 0\n let expectedNumberOfExecutions = 0\n const enqueuedTasks = []\n\n while (true) {\n const result = iterator.next()\n\n if (result.done) {\n break\n }\n\n if (!this.running) {\n result.value.catch(error => {\n this.logger.debug('Ignoring error in fetch request while stopping runner', {\n error: error.message || error,\n stack: error.stack,\n })\n })\n\n continue\n }\n\n enqueuedTasks.push(async () => {\n const batches = await result.value\n expectedNumberOfExecutions += batches.length\n\n batches.map(batch =>\n concurrently(async () => {\n try {\n if (!this.running) {\n return\n }\n\n await onBatch(batch)\n } catch (e) {\n unlockWithError(e)\n } finally {\n numberOfExecutions++\n if (requestsCompleted && numberOfExecutions === expectedNumberOfExecutions) {\n unlock()\n }\n }\n }).catch(unlockWithError)\n )\n })\n }\n\n await Promise.all(enqueuedTasks.map(fn => fn()))\n requestsCompleted = true\n\n if (expectedNumberOfExecutions === numberOfExecutions) {\n unlock()\n }\n\n const error = await lock\n if (error) {\n throw error\n }\n\n await this.autoCommitOffsets()\n await this.consumerGroup.heartbeat({ interval: this.heartbeatInterval })\n }\n\n async scheduleFetch() {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n this.consuming = true\n await this.fetch()\n this.consuming = false\n\n if (this.running) {\n setImmediate(() => this.scheduleFetch())\n }\n } catch (e) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n error: e.message,\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n return\n }\n\n if (isRebalancing(e)) {\n this.logger.warn('The group is rebalancing, re-joining', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.instrumentationEmitter.emit(REBALANCING, {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n await this.join()\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.type === 'UNKNOWN_MEMBER_ID') {\n this.logger.error('The coordinator is not aware of this member, re-joining the group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.consumerGroup.memberId = null\n await this.join()\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.name === 'KafkaJSOffsetOutOfRange') {\n setImmediate(() => this.scheduleFetch())\n return\n }\n\n if (e.name === 'KafkaJSNotImplemented') {\n return bail(e)\n }\n\n this.logger.debug('Error while fetching data, trying again...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n stack: e.stack,\n retryCount,\n retryTime,\n })\n\n throw e\n } finally {\n this.consuming = false\n }\n }).catch(this.onCrash)\n }\n\n autoCommitOffsets() {\n if (this.autoCommit) {\n return this.consumerGroup.commitOffsets()\n }\n }\n\n autoCommitOffsetsIfNecessary() {\n if (this.autoCommit) {\n return this.consumerGroup.commitOffsetsIfNecessary()\n }\n }\n\n commitOffsets(offsets) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n offsets,\n })\n return\n }\n\n return this.retrier(async (bail, retryCount, retryTime) => {\n try {\n await this.consumerGroup.commitOffsets(offsets)\n } catch (e) {\n if (!this.running) {\n this.logger.debug('consumer not running, exiting', {\n error: e.message,\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n offsets,\n })\n return\n }\n\n if (isRebalancing(e)) {\n this.logger.warn('The group is rebalancing, re-joining', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.instrumentationEmitter.emit(REBALANCING, {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n })\n\n setImmediate(() => this.scheduleJoin())\n\n bail(new KafkaJSError(e))\n }\n\n if (e.type === 'UNKNOWN_MEMBER_ID') {\n this.logger.error('The coordinator is not aware of this member, re-joining the group', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n retryCount,\n retryTime,\n })\n\n this.consumerGroup.memberId = null\n setImmediate(() => this.scheduleJoin())\n\n bail(new KafkaJSError(e))\n }\n\n if (e.name === 'KafkaJSNotImplemented') {\n return bail(e)\n }\n\n this.logger.debug('Error while committing offsets, trying again...', {\n groupId: this.consumerGroup.groupId,\n memberId: this.consumerGroup.memberId,\n error: e.message,\n stack: e.stack,\n retryCount,\n retryTime,\n offsets,\n })\n\n throw e\n }\n })\n }\n}\n","module.exports = class SeekOffsets extends Map {\n set(topic, partition, offset) {\n super.set([topic, partition], offset)\n }\n\n has(topic, partition) {\n return Array.from(this.keys()).some(([t, p]) => t === topic && p === partition)\n }\n\n pop() {\n if (this.size === 0) {\n return\n }\n\n const [key, offset] = this.entries().next().value\n this.delete(key)\n const [topic, partition] = key\n return { topic, partition, offset }\n }\n}\n","const createState = topic => ({\n topic,\n paused: new Set(),\n pauseAll: false,\n resumed: new Set(),\n})\n\nmodule.exports = class SubscriptionState {\n constructor() {\n this.assignedPartitionsByTopic = {}\n this.subscriptionStatesByTopic = {}\n }\n\n /**\n * Replace the current assignment with a new set of assignments\n *\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n assign(topicPartitions = []) {\n this.assignedPartitionsByTopic = topicPartitions.reduce(\n (assigned, { topic, partitions = [] }) => {\n return { ...assigned, [topic]: { topic, partitions } }\n },\n {}\n )\n }\n\n /**\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n pause(topicPartitions = []) {\n topicPartitions.forEach(({ topic, partitions }) => {\n const state = this.subscriptionStatesByTopic[topic] || createState(topic)\n\n if (typeof partitions === 'undefined') {\n state.paused.clear()\n state.resumed.clear()\n state.pauseAll = true\n } else if (Array.isArray(partitions)) {\n partitions.forEach(partition => {\n state.paused.add(partition)\n state.resumed.delete(partition)\n })\n state.pauseAll = false\n }\n\n this.subscriptionStatesByTopic[topic] = state\n })\n }\n\n /**\n * @param {Array} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n resume(topicPartitions = []) {\n topicPartitions.forEach(({ topic, partitions }) => {\n const state = this.subscriptionStatesByTopic[topic] || createState(topic)\n\n if (typeof partitions === 'undefined') {\n state.paused.clear()\n state.resumed.clear()\n state.pauseAll = false\n } else if (Array.isArray(partitions)) {\n partitions.forEach(partition => {\n state.paused.delete(partition)\n\n if (state.pauseAll) {\n state.resumed.add(partition)\n }\n })\n }\n\n this.subscriptionStatesByTopic[topic] = state\n })\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n assigned() {\n return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.sort(),\n }))\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n active() {\n return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.filter(partition => !this.isPaused(topic, partition)).sort(),\n }))\n }\n\n /**\n * @returns {Array} topicPartitions\n * Example: [{ topic: 'topic-name', partitions: [1, 2] }]\n */\n paused() {\n return Object.values(this.assignedPartitionsByTopic)\n .map(({ topic, partitions }) => ({\n topic,\n partitions: partitions.filter(partition => this.isPaused(topic, partition)).sort(),\n }))\n .filter(({ partitions }) => partitions.length !== 0)\n }\n\n isPaused(topic, partition) {\n const state = this.subscriptionStatesByTopic[topic]\n\n if (!state) {\n return false\n }\n\n const partitionResumed = state.resumed.has(partition)\n const partitionPaused = state.paused.has(partition)\n\n return (state.pauseAll && !partitionResumed) || partitionPaused\n }\n}\n","module.exports = () => ({\n KAFKAJS_DEBUG_PROTOCOL_BUFFERS: process.env.KAFKAJS_DEBUG_PROTOCOL_BUFFERS,\n KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS: process.env.KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS,\n})\n","const pkgJson = require('../package.json')\nconst { bugs } = pkgJson\n\nclass KafkaJSError extends Error {\n constructor(e, { retriable = true } = {}) {\n super(e)\n Error.captureStackTrace(this, this.constructor)\n this.message = e.message || e\n this.name = 'KafkaJSError'\n this.retriable = retriable\n this.helpUrl = e.helpUrl\n }\n}\n\nclass KafkaJSNonRetriableError extends KafkaJSError {\n constructor(e) {\n super(e, { retriable: false })\n this.name = 'KafkaJSNonRetriableError'\n this.originalError = e\n }\n}\n\nclass KafkaJSProtocolError extends KafkaJSError {\n constructor(e, { retriable = e.retriable } = {}) {\n super(e, { retriable })\n this.type = e.type\n this.code = e.code\n this.name = 'KafkaJSProtocolError'\n }\n}\n\nclass KafkaJSOffsetOutOfRange extends KafkaJSProtocolError {\n constructor(e, { topic, partition }) {\n super(e)\n this.topic = topic\n this.partition = partition\n this.name = 'KafkaJSOffsetOutOfRange'\n }\n}\n\nclass KafkaJSMemberIdRequired extends KafkaJSProtocolError {\n constructor(e, { memberId }) {\n super(e)\n this.memberId = memberId\n this.name = 'KafkaJSMemberIdRequired'\n }\n}\n\nclass KafkaJSNumberOfRetriesExceeded extends KafkaJSNonRetriableError {\n constructor(e, { retryCount, retryTime }) {\n super(e)\n this.stack = `${this.name}\\n Caused by: ${e.stack}`\n this.originalError = e\n this.retryCount = retryCount\n this.retryTime = retryTime\n this.name = 'KafkaJSNumberOfRetriesExceeded'\n }\n}\n\nclass KafkaJSConnectionError extends KafkaJSError {\n constructor(e, { broker, code } = {}) {\n super(e)\n this.broker = broker\n this.code = code\n this.name = 'KafkaJSConnectionError'\n }\n}\n\nclass KafkaJSConnectionClosedError extends KafkaJSConnectionError {\n constructor(e, { host, port } = {}) {\n super(e, { broker: `${host}:${port}` })\n this.host = host\n this.port = port\n this.name = 'KafkaJSConnectionClosedError'\n }\n}\n\nclass KafkaJSRequestTimeoutError extends KafkaJSError {\n constructor(e, { broker, correlationId, createdAt, sentAt, pendingDuration } = {}) {\n super(e)\n this.broker = broker\n this.correlationId = correlationId\n this.createdAt = createdAt\n this.sentAt = sentAt\n this.pendingDuration = pendingDuration\n this.name = 'KafkaJSRequestTimeoutError'\n }\n}\n\nclass KafkaJSMetadataNotLoaded extends KafkaJSError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSMetadataNotLoaded'\n }\n}\nclass KafkaJSTopicMetadataNotLoaded extends KafkaJSMetadataNotLoaded {\n constructor(e, { topic } = {}) {\n super(e)\n this.topic = topic\n this.name = 'KafkaJSTopicMetadataNotLoaded'\n }\n}\nclass KafkaJSStaleTopicMetadataAssignment extends KafkaJSError {\n constructor(e, { topic, unknownPartitions } = {}) {\n super(e)\n this.topic = topic\n this.unknownPartitions = unknownPartitions\n this.name = 'KafkaJSStaleTopicMetadataAssignment'\n }\n}\n\nclass KafkaJSDeleteGroupsError extends KafkaJSError {\n constructor(e, groups = []) {\n super(e)\n this.groups = groups\n this.name = 'KafkaJSDeleteGroupsError'\n }\n}\n\nclass KafkaJSServerDoesNotSupportApiKey extends KafkaJSNonRetriableError {\n constructor(e, { apiKey, apiName } = {}) {\n super(e)\n this.apiKey = apiKey\n this.apiName = apiName\n this.name = 'KafkaJSServerDoesNotSupportApiKey'\n }\n}\n\nclass KafkaJSBrokerNotFound extends KafkaJSError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSBrokerNotFound'\n }\n}\n\nclass KafkaJSPartialMessageError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSPartialMessageError'\n }\n}\n\nclass KafkaJSSASLAuthenticationError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSSASLAuthenticationError'\n }\n}\n\nclass KafkaJSGroupCoordinatorNotFound extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSGroupCoordinatorNotFound'\n }\n}\n\nclass KafkaJSNotImplemented extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNotImplemented'\n }\n}\n\nclass KafkaJSTimeout extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSTimeout'\n }\n}\n\nclass KafkaJSLockTimeout extends KafkaJSTimeout {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSLockTimeout'\n }\n}\n\nclass KafkaJSUnsupportedMagicByteInMessageSet extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSUnsupportedMagicByteInMessageSet'\n }\n}\n\nclass KafkaJSDeleteTopicRecordsError extends KafkaJSError {\n constructor({ partitions }) {\n /*\n * This error is retriable if all the errors were retriable\n */\n const retriable = partitions\n .filter(({ error }) => error != null)\n .every(({ error }) => error.retriable === true)\n\n super('Error while deleting records', { retriable })\n this.name = 'KafkaJSDeleteTopicRecordsError'\n this.partitions = partitions\n }\n}\n\nconst issueUrl = bugs ? bugs.url : null\n\nclass KafkaJSInvariantViolation extends KafkaJSNonRetriableError {\n constructor(e) {\n const message = e.message || e\n super(`Invariant violated: ${message}. This is likely a bug and should be reported.`)\n this.name = 'KafkaJSInvariantViolation'\n\n if (issueUrl !== null) {\n const issueTitle = encodeURIComponent(`Invariant violation: ${message}`)\n this.helpUrl = `${issueUrl}/new?assignees=&labels=bug&template=bug_report.md&title=${issueTitle}`\n }\n }\n}\n\nclass KafkaJSInvalidVarIntError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNonRetriableError'\n }\n}\n\nclass KafkaJSInvalidLongError extends KafkaJSNonRetriableError {\n constructor() {\n super(...arguments)\n this.name = 'KafkaJSNonRetriableError'\n }\n}\n\nclass KafkaJSCreateTopicError extends KafkaJSProtocolError {\n constructor(e, topicName) {\n super(e)\n this.topic = topicName\n this.name = 'KafkaJSCreateTopicError'\n }\n}\nclass KafkaJSAggregateError extends Error {\n constructor(message, errors) {\n super(message)\n this.errors = errors\n this.name = 'KafkaJSAggregateError'\n }\n}\n\nmodule.exports = {\n KafkaJSError,\n KafkaJSNonRetriableError,\n KafkaJSPartialMessageError,\n KafkaJSBrokerNotFound,\n KafkaJSProtocolError,\n KafkaJSConnectionError,\n KafkaJSConnectionClosedError,\n KafkaJSRequestTimeoutError,\n KafkaJSSASLAuthenticationError,\n KafkaJSNumberOfRetriesExceeded,\n KafkaJSOffsetOutOfRange,\n KafkaJSMemberIdRequired,\n KafkaJSGroupCoordinatorNotFound,\n KafkaJSNotImplemented,\n KafkaJSMetadataNotLoaded,\n KafkaJSTopicMetadataNotLoaded,\n KafkaJSStaleTopicMetadataAssignment,\n KafkaJSDeleteGroupsError,\n KafkaJSTimeout,\n KafkaJSLockTimeout,\n KafkaJSServerDoesNotSupportApiKey,\n KafkaJSUnsupportedMagicByteInMessageSet,\n KafkaJSDeleteTopicRecordsError,\n KafkaJSInvariantViolation,\n KafkaJSInvalidVarIntError,\n KafkaJSInvalidLongError,\n KafkaJSCreateTopicError,\n KafkaJSAggregateError,\n}\n","const {\n createLogger,\n LEVELS: { INFO },\n} = require('./loggers')\n\nconst InstrumentationEventEmitter = require('./instrumentation/emitter')\nconst LoggerConsole = require('./loggers/console')\nconst Cluster = require('./cluster')\nconst createProducer = require('./producer')\nconst createConsumer = require('./consumer')\nconst createAdmin = require('./admin')\nconst ISOLATION_LEVEL = require('./protocol/isolationLevel')\nconst defaultSocketFactory = require('./network/socketFactory')\n\nconst PRIVATE = {\n CREATE_CLUSTER: Symbol('private:Kafka:createCluster'),\n CLUSTER_RETRY: Symbol('private:Kafka:clusterRetry'),\n LOGGER: Symbol('private:Kafka:logger'),\n OFFSETS: Symbol('private:Kafka:offsets'),\n}\n\nconst DEFAULT_METADATA_MAX_AGE = 300000\n\nmodule.exports = class Client {\n /**\n * @param {Object} options\n * @param {Array} options.brokers example: ['127.0.0.1:9092', '127.0.0.1:9094']\n * @param {Object} options.ssl\n * @param {Object} options.sasl\n * @param {string} options.clientId\n * @param {number} options.connectionTimeout - in milliseconds\n * @param {number} options.authenticationTimeout - in milliseconds\n * @param {number} options.reauthenticationThreshold - in milliseconds\n * @param {number} [options.requestTimeout=30000] - in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {import(\"../types\").RetryOptions} [options.retry]\n * @param {import(\"../types\").ISocketFactory} [options.socketFactory]\n */\n constructor({\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout,\n enforceRequestTimeout = false,\n retry,\n socketFactory = defaultSocketFactory(),\n logLevel = INFO,\n logCreator = LoggerConsole,\n }) {\n this[PRIVATE.OFFSETS] = new Map()\n this[PRIVATE.LOGGER] = createLogger({ level: logLevel, logCreator })\n this[PRIVATE.CLUSTER_RETRY] = retry\n this[PRIVATE.CREATE_CLUSTER] = ({\n metadataMaxAge,\n allowAutoTopicCreation = true,\n maxInFlightRequests = null,\n instrumentationEmitter = null,\n isolationLevel,\n }) =>\n new Cluster({\n logger: this[PRIVATE.LOGGER],\n retry: this[PRIVATE.CLUSTER_RETRY],\n offsets: this[PRIVATE.OFFSETS],\n socketFactory,\n brokers,\n ssl,\n sasl,\n clientId,\n connectionTimeout,\n authenticationTimeout,\n reauthenticationThreshold,\n requestTimeout,\n enforceRequestTimeout,\n metadataMaxAge,\n instrumentationEmitter,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n })\n }\n\n /**\n * @public\n */\n producer({\n createPartitioner,\n retry,\n metadataMaxAge = DEFAULT_METADATA_MAX_AGE,\n allowAutoTopicCreation,\n idempotent,\n transactionalId,\n transactionTimeout,\n maxInFlightRequests,\n } = {}) {\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n metadataMaxAge,\n allowAutoTopicCreation,\n maxInFlightRequests,\n instrumentationEmitter,\n })\n\n return createProducer({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n cluster,\n createPartitioner,\n idempotent,\n transactionalId,\n transactionTimeout,\n instrumentationEmitter,\n })\n }\n\n /**\n * @public\n */\n consumer({\n groupId,\n partitionAssigners,\n metadataMaxAge = DEFAULT_METADATA_MAX_AGE,\n sessionTimeout,\n rebalanceTimeout,\n heartbeatInterval,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n retry = { retries: 5 },\n allowAutoTopicCreation,\n maxInFlightRequests,\n readUncommitted = false,\n rackId = '',\n } = {}) {\n const isolationLevel = readUncommitted\n ? ISOLATION_LEVEL.READ_UNCOMMITTED\n : ISOLATION_LEVEL.READ_COMMITTED\n\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n metadataMaxAge,\n allowAutoTopicCreation,\n maxInFlightRequests,\n isolationLevel,\n instrumentationEmitter,\n })\n\n return createConsumer({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n cluster,\n groupId,\n partitionAssigners,\n sessionTimeout,\n rebalanceTimeout,\n heartbeatInterval,\n maxBytesPerPartition,\n minBytes,\n maxBytes,\n maxWaitTimeInMs,\n isolationLevel,\n instrumentationEmitter,\n rackId,\n metadataMaxAge,\n })\n }\n\n /**\n * @public\n */\n admin({ retry } = {}) {\n const instrumentationEmitter = new InstrumentationEventEmitter()\n const cluster = this[PRIVATE.CREATE_CLUSTER]({\n allowAutoTopicCreation: false,\n instrumentationEmitter,\n })\n\n return createAdmin({\n retry: { ...this[PRIVATE.CLUSTER_RETRY], ...retry },\n logger: this[PRIVATE.LOGGER],\n instrumentationEmitter,\n cluster,\n })\n }\n\n /**\n * @public\n */\n logger() {\n return this[PRIVATE.LOGGER]\n }\n}\n","const { EventEmitter } = require('events')\nconst InstrumentationEvent = require('./event')\nconst { KafkaJSError } = require('../errors')\n\nmodule.exports = class InstrumentationEventEmitter {\n constructor() {\n this.emitter = new EventEmitter()\n }\n\n /**\n * @param {string} eventName\n * @param {Object} payload\n */\n emit(eventName, payload) {\n if (!eventName) {\n throw new KafkaJSError('Invalid event name', { retriable: false })\n }\n\n if (this.emitter.listenerCount(eventName) > 0) {\n const event = new InstrumentationEvent(eventName, payload)\n this.emitter.emit(eventName, event)\n }\n }\n\n /**\n * @param {string} eventName\n * @param {(...args: any[]) => void} listener\n * @returns {import(\"../../types\").RemoveInstrumentationEventListener} removeListener\n */\n addListener(eventName, listener) {\n this.emitter.addListener(eventName, listener)\n return () => this.emitter.removeListener(eventName, listener)\n }\n}\n","let id = 0\nconst nextId = () => {\n if (id === Number.MAX_VALUE) {\n id = 0\n }\n\n return id++\n}\n\nclass InstrumentationEvent {\n /**\n * @param {String} type\n * @param {Object} payload\n */\n constructor(type, payload) {\n this.id = nextId()\n this.type = type\n this.timestamp = Date.now()\n this.payload = payload\n }\n}\n\nmodule.exports = InstrumentationEvent\n","module.exports = namespace => type => `${namespace}.${type}`\n","const { LEVELS: logLevel } = require('./index')\n\nmodule.exports = () => ({ namespace, level, label, log }) => {\n const prefix = namespace ? `[${namespace}] ` : ''\n const message = JSON.stringify(\n Object.assign({ level: label }, log, {\n message: `${prefix}${log.message}`,\n })\n )\n\n switch (level) {\n case logLevel.INFO:\n return console.info(message)\n case logLevel.ERROR:\n return console.error(message)\n case logLevel.WARN:\n return console.warn(message)\n case logLevel.DEBUG:\n return console.log(message)\n }\n}\n","const { assign } = Object\n\nconst LEVELS = {\n NOTHING: 0,\n ERROR: 1,\n WARN: 2,\n INFO: 4,\n DEBUG: 5,\n}\n\nconst createLevel = (label, level, currentLevel, namespace, logFunction) => (\n message,\n extra = {}\n) => {\n if (level > currentLevel()) return\n logFunction({\n namespace,\n level,\n label,\n log: assign(\n {\n timestamp: new Date().toISOString(),\n logger: 'kafkajs',\n message,\n },\n extra\n ),\n })\n}\n\nconst evaluateLogLevel = logLevel => {\n const envLogLevel = (process.env.KAFKAJS_LOG_LEVEL || '').toUpperCase()\n return LEVELS[envLogLevel] == null ? logLevel : LEVELS[envLogLevel]\n}\n\nconst createLogger = ({ level = LEVELS.INFO, logCreator } = {}) => {\n let logLevel = evaluateLogLevel(level)\n const logFunction = logCreator(logLevel)\n\n const createNamespace = (namespace, logLevel = null) => {\n const namespaceLogLevel = evaluateLogLevel(logLevel)\n return createLogFunctions(namespace, namespaceLogLevel)\n }\n\n const createLogFunctions = (namespace, namespaceLogLevel = null) => {\n const currentLogLevel = () => (namespaceLogLevel == null ? logLevel : namespaceLogLevel)\n const logger = {\n info: createLevel('INFO', LEVELS.INFO, currentLogLevel, namespace, logFunction),\n error: createLevel('ERROR', LEVELS.ERROR, currentLogLevel, namespace, logFunction),\n warn: createLevel('WARN', LEVELS.WARN, currentLogLevel, namespace, logFunction),\n debug: createLevel('DEBUG', LEVELS.DEBUG, currentLogLevel, namespace, logFunction),\n }\n\n return assign(logger, {\n namespace: createNamespace,\n setLogLevel: newLevel => {\n logLevel = newLevel\n },\n })\n }\n\n return createLogFunctions()\n}\n\nmodule.exports = {\n LEVELS,\n createLogger,\n}\n","const createSocket = require('./socket')\nconst createRequest = require('../protocol/request')\nconst Decoder = require('../protocol/decoder')\nconst { KafkaJSConnectionError, KafkaJSConnectionClosedError } = require('../errors')\nconst { INT_32_MAX_VALUE } = require('../constants')\nconst getEnv = require('../env')\nconst RequestQueue = require('./requestQueue')\nconst { CONNECTION_STATUS, CONNECTED_STATUS } = require('./connectionStatus')\n\nconst requestInfo = ({ apiName, apiKey, apiVersion }) =>\n `${apiName}(key: ${apiKey}, version: ${apiVersion})`\n\nmodule.exports = class Connection {\n /**\n * @param {Object} options\n * @param {string} options.host\n * @param {number} options.port\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {string} [options.clientId='kafkajs']\n * @param {number} options.requestTimeout The maximum amount of time the client will wait for the response of a request,\n * in milliseconds\n * @param {string} [options.rack=null]\n * @param {Object} [options.ssl=null] Options for the TLS Secure Context. It accepts all options,\n * usually \"cert\", \"key\" and \"ca\". More information at\n * https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options\n * @param {Object} [options.sasl=null] Attributes used for SASL authentication. Options based on the\n * key \"mechanism\". Connection is not actively using the SASL attributes\n * but acting as a data object for this information\n * @param {number} [options.connectionTimeout=1000] The connection timeout, in milliseconds\n * @param {boolean} [options.enforceRequestTimeout]\n * @param {number} [options.maxInFlightRequests=null] The maximum number of unacknowledged requests on a connection before\n * enqueuing\n * @param {import(\"../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n host,\n port,\n logger,\n socketFactory,\n requestTimeout,\n rack = null,\n ssl = null,\n sasl = null,\n clientId = 'kafkajs',\n connectionTimeout = 1000,\n enforceRequestTimeout = false,\n maxInFlightRequests = null,\n instrumentationEmitter = null,\n }) {\n this.host = host\n this.port = port\n this.rack = rack\n this.clientId = clientId\n this.broker = `${this.host}:${this.port}`\n this.logger = logger.namespace('Connection')\n\n this.socketFactory = socketFactory\n this.ssl = ssl\n this.sasl = sasl\n\n this.requestTimeout = requestTimeout\n this.connectionTimeout = connectionTimeout\n\n this.bytesBuffered = 0\n this.bytesNeeded = Decoder.int32Size()\n this.chunks = []\n\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTED\n this.correlationId = 0\n this.requestQueue = new RequestQueue({\n instrumentationEmitter,\n maxInFlightRequests,\n requestTimeout,\n enforceRequestTimeout,\n clientId,\n broker: this.broker,\n logger: logger.namespace('RequestQueue'),\n isConnected: () => this.connected,\n })\n\n this.authHandlers = null\n this.authExpectResponse = false\n\n const log = level => (message, extra = {}) => {\n const logFn = this.logger[level]\n logFn(message, { broker: this.broker, clientId, ...extra })\n }\n\n this.logDebug = log('debug')\n this.logError = log('error')\n\n const env = getEnv()\n this.shouldLogBuffers = env.KAFKAJS_DEBUG_PROTOCOL_BUFFERS === '1'\n this.shouldLogFetchBuffer =\n this.shouldLogBuffers && env.KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS === '1'\n }\n\n get connected() {\n return CONNECTED_STATUS.includes(this.connectionStatus)\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n connect() {\n return new Promise((resolve, reject) => {\n if (this.connected) {\n return resolve(true)\n }\n\n let timeoutId\n\n const onConnect = () => {\n clearTimeout(timeoutId)\n this.connectionStatus = CONNECTION_STATUS.CONNECTED\n this.requestQueue.scheduleRequestTimeoutCheck()\n resolve(true)\n }\n\n const onData = data => {\n this.processData(data)\n }\n\n const onEnd = async () => {\n clearTimeout(timeoutId)\n\n const wasConnected = this.connected\n\n if (this.authHandlers) {\n this.authHandlers.onError()\n } else if (wasConnected) {\n this.logDebug('Kafka server has closed connection')\n this.rejectRequests(\n new KafkaJSConnectionClosedError('Closed connection', {\n host: this.host,\n port: this.port,\n })\n )\n }\n\n await this.disconnect()\n }\n\n const onError = async e => {\n clearTimeout(timeoutId)\n\n const error = new KafkaJSConnectionError(`Connection error: ${e.message}`, {\n broker: `${this.host}:${this.port}`,\n code: e.code,\n })\n\n this.logError(error.message, { stack: e.stack })\n this.rejectRequests(error)\n await this.disconnect()\n\n reject(error)\n }\n\n const onTimeout = async () => {\n const error = new KafkaJSConnectionError('Connection timeout', {\n broker: `${this.host}:${this.port}`,\n })\n\n this.logError(error.message)\n this.rejectRequests(error)\n await this.disconnect()\n reject(error)\n }\n\n this.logDebug(`Connecting`, {\n ssl: !!this.ssl,\n sasl: !!this.sasl,\n })\n\n try {\n timeoutId = setTimeout(onTimeout, this.connectionTimeout)\n this.socket = createSocket({\n socketFactory: this.socketFactory,\n host: this.host,\n port: this.port,\n ssl: this.ssl,\n onConnect,\n onData,\n onEnd,\n onError,\n onTimeout,\n })\n } catch (e) {\n clearTimeout(timeoutId)\n reject(\n new KafkaJSConnectionError(`Failed to connect: ${e.message}`, {\n broker: `${this.host}:${this.port}`,\n })\n )\n }\n })\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n async disconnect() {\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTING\n this.logDebug('disconnecting...')\n\n await this.requestQueue.waitForPendingRequests()\n this.requestQueue.destroy()\n\n if (this.socket) {\n this.socket.end()\n this.socket.unref()\n }\n\n this.connectionStatus = CONNECTION_STATUS.DISCONNECTED\n this.logDebug('disconnected')\n return true\n }\n\n /**\n * @public\n * @returns {Promise}\n */\n authenticate({ authExpectResponse = false, request, response }) {\n this.authExpectResponse = authExpectResponse\n\n /**\n * TODO: rewrite removing the async promise executor\n */\n\n /* eslint-disable no-async-promise-executor */\n return new Promise(async (resolve, reject) => {\n this.authHandlers = {\n onSuccess: rawData => {\n this.authHandlers = null\n this.authExpectResponse = false\n\n response\n .decode(rawData)\n .then(data => response.parse(data))\n .then(resolve)\n .catch(reject)\n },\n onError: () => {\n this.authHandlers = null\n this.authExpectResponse = false\n\n reject(\n new KafkaJSConnectionError('Connection closed by the server', {\n broker: `${this.host}:${this.port}`,\n })\n )\n },\n }\n\n try {\n const requestPayload = await request.encode()\n\n this.failIfNotConnected()\n this.socket.write(requestPayload.buffer, 'binary')\n } catch (e) {\n reject(e)\n }\n })\n }\n\n /**\n * @public\n * @param {object} protocol\n * @param {object} protocol.request It is defined by the protocol and consists of an object with \"apiKey\",\n * \"apiVersion\", \"apiName\" and an \"encode\" function. The encode function\n * must return an instance of Encoder\n *\n * @param {object} protocol.response It is defined by the protocol and consists of an object with two functions:\n * \"decode\" and \"parse\"\n *\n * @param {number} [protocol.requestTimeout=null] Override for the default requestTimeout\n * @param {boolean} [protocol.logResponseError=true] Whether to log errors\n * @returns {Promise} where data is the return of \"response#parse\"\n */\n async send({ request, response, requestTimeout = null, logResponseError = true }) {\n this.failIfNotConnected()\n\n const expectResponse = !request.expectResponse || request.expectResponse()\n const sendRequest = async () => {\n const { clientId } = this\n const correlationId = this.nextCorrelationId()\n\n const requestPayload = await createRequest({ request, correlationId, clientId })\n const { apiKey, apiName, apiVersion } = request\n this.logDebug(`Request ${requestInfo(request)}`, {\n correlationId,\n expectResponse,\n size: Buffer.byteLength(requestPayload.buffer),\n })\n\n return new Promise((resolve, reject) => {\n try {\n this.failIfNotConnected()\n const entry = { apiKey, apiName, apiVersion, correlationId, resolve, reject }\n\n this.requestQueue.push({\n entry,\n expectResponse,\n requestTimeout,\n sendRequest: () => {\n this.socket.write(requestPayload.buffer, 'binary')\n },\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n const { correlationId, size, entry, payload } = await sendRequest()\n\n if (!expectResponse) {\n return\n }\n\n try {\n const payloadDecoded = await response.decode(payload)\n\n /**\n * @see KIP-219\n * If the response indicates that the client-side needs to throttle, do that.\n */\n this.requestQueue.maybeThrottle(payloadDecoded.clientSideThrottleTime)\n\n const data = await response.parse(payloadDecoded)\n const isFetchApi = entry.apiName === 'Fetch'\n this.logDebug(`Response ${requestInfo(entry)}`, {\n correlationId,\n size,\n data: isFetchApi && !this.shouldLogFetchBuffer ? '[filtered]' : data,\n })\n\n return data\n } catch (e) {\n if (logResponseError) {\n this.logError(`Response ${requestInfo(entry)}`, {\n error: e.message,\n correlationId,\n size,\n })\n }\n\n const isBuffer = Buffer.isBuffer(payload)\n this.logDebug(`Response ${requestInfo(entry)}`, {\n error: e.message,\n correlationId,\n payload:\n isBuffer && !this.shouldLogBuffers ? { type: 'Buffer', data: '[filtered]' } : payload,\n })\n\n throw e\n }\n }\n\n /**\n * @private\n */\n failIfNotConnected() {\n if (!this.connected) {\n throw new KafkaJSConnectionError('Not connected', {\n broker: `${this.host}:${this.port}`,\n })\n }\n }\n\n /**\n * @private\n */\n nextCorrelationId() {\n if (this.correlationId >= INT_32_MAX_VALUE) {\n this.correlationId = 0\n }\n\n return this.correlationId++\n }\n\n /**\n * @private\n */\n processData(rawData) {\n if (this.authHandlers && !this.authExpectResponse) {\n return this.authHandlers.onSuccess(rawData)\n }\n\n // Accumulate the new chunk\n this.chunks.push(rawData)\n this.bytesBuffered += Buffer.byteLength(rawData)\n\n // Process data if there are enough bytes to read the expected response size,\n // otherwise keep buffering\n while (this.bytesNeeded <= this.bytesBuffered) {\n const buffer = this.chunks.length > 1 ? Buffer.concat(this.chunks) : this.chunks[0]\n const decoder = new Decoder(buffer)\n const expectedResponseSize = decoder.readInt32()\n\n // Return early if not enough bytes to read the full response\n if (!decoder.canReadBytes(expectedResponseSize)) {\n this.chunks = [buffer]\n this.bytesBuffered = Buffer.byteLength(buffer)\n this.bytesNeeded = Decoder.int32Size() + expectedResponseSize\n return\n }\n\n const response = new Decoder(decoder.readBytes(expectedResponseSize))\n\n // Reset the buffered chunks as the rest of the bytes\n const remainderBuffer = decoder.readAll()\n this.chunks = [remainderBuffer]\n this.bytesBuffered = Buffer.byteLength(remainderBuffer)\n this.bytesNeeded = Decoder.int32Size()\n\n if (this.authHandlers) {\n const rawResponseSize = Decoder.int32Size() + expectedResponseSize\n const rawResponseBuffer = buffer.slice(0, rawResponseSize)\n return this.authHandlers.onSuccess(rawResponseBuffer)\n }\n\n const correlationId = response.readInt32()\n const payload = response.readAll()\n\n this.requestQueue.fulfillRequest({\n size: expectedResponseSize,\n correlationId,\n payload,\n })\n }\n }\n\n /**\n * @private\n */\n rejectRequests(error) {\n this.requestQueue.rejectAll(error)\n }\n}\n","const CONNECTION_STATUS = {\n CONNECTED: 'connected',\n DISCONNECTING: 'disconnecting',\n DISCONNECTED: 'disconnected',\n}\n\nconst CONNECTED_STATUS = [CONNECTION_STATUS.CONNECTED, CONNECTION_STATUS.DISCONNECTING]\n\nmodule.exports = {\n CONNECTION_STATUS,\n CONNECTED_STATUS,\n}\n","const InstrumentationEventType = require('../instrumentation/eventType')\nconst eventType = InstrumentationEventType('network')\n\nmodule.exports = {\n NETWORK_REQUEST: eventType('request'),\n NETWORK_REQUEST_TIMEOUT: eventType('request_timeout'),\n NETWORK_REQUEST_QUEUE_SIZE: eventType('request_queue_size'),\n}\n","const { EventEmitter } = require('events')\nconst SocketRequest = require('./socketRequest')\nconst events = require('../instrumentationEvents')\nconst { KafkaJSInvariantViolation } = require('../../errors')\n\nconst PRIVATE = {\n EMIT_QUEUE_SIZE_EVENT: Symbol('private:RequestQueue:emitQueueSizeEvent'),\n EMIT_REQUEST_QUEUE_EMPTY: Symbol('private:RequestQueue:emitQueueEmpty'),\n}\n\nconst REQUEST_QUEUE_EMPTY = 'requestQueueEmpty'\n\nmodule.exports = class RequestQueue extends EventEmitter {\n /**\n * @param {Object} options\n * @param {number} options.maxInFlightRequests\n * @param {number} options.requestTimeout\n * @param {boolean} options.enforceRequestTimeout\n * @param {string} options.clientId\n * @param {string} options.broker\n * @param {import(\"../../../types\").Logger} options.logger\n * @param {import(\"../../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n * @param {() => boolean} [options.isConnected]\n */\n constructor({\n instrumentationEmitter = null,\n maxInFlightRequests,\n requestTimeout,\n enforceRequestTimeout,\n clientId,\n broker,\n logger,\n isConnected = () => true,\n }) {\n super()\n this.instrumentationEmitter = instrumentationEmitter\n this.maxInFlightRequests = maxInFlightRequests\n this.requestTimeout = requestTimeout\n this.enforceRequestTimeout = enforceRequestTimeout\n this.clientId = clientId\n this.broker = broker\n this.logger = logger\n this.isConnected = isConnected\n\n this.inflight = new Map()\n this.pending = []\n\n /**\n * Until when this request queue is throttled and shouldn't send requests\n *\n * The value represents the timestamp of the end of the throttling in ms-since-epoch. If the value\n * is smaller than the current timestamp no throttling is active.\n *\n * @type {number}\n */\n this.throttledUntil = -1\n\n /**\n * Timeout id if we have scheduled a check for pending requests due to client-side throttling\n *\n * @type {null|NodeJS.Timeout}\n */\n this.throttleCheckTimeoutId = null\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY] = () => {\n if (this.pending.length === 0 && this.inflight.size === 0) {\n this.emit(REQUEST_QUEUE_EMPTY)\n }\n }\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT] = () => {\n instrumentationEmitter &&\n instrumentationEmitter.emit(events.NETWORK_REQUEST_QUEUE_SIZE, {\n broker: this.broker,\n clientId: this.clientId,\n queueSize: this.pending.length,\n })\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n }\n }\n\n /**\n * @public\n */\n scheduleRequestTimeoutCheck() {\n if (this.enforceRequestTimeout) {\n this.destroy()\n\n this.requestTimeoutIntervalId = setInterval(() => {\n this.inflight.forEach(request => {\n if (Date.now() - request.sentAt > request.requestTimeout) {\n request.timeoutRequest()\n }\n })\n\n if (!this.isConnected()) {\n this.destroy()\n }\n }, Math.min(this.requestTimeout, 100))\n }\n }\n\n maybeThrottle(clientSideThrottleTime) {\n if (clientSideThrottleTime) {\n const minimumThrottledUntil = Date.now() + clientSideThrottleTime\n this.throttledUntil = Math.max(minimumThrottledUntil, this.throttledUntil)\n }\n }\n\n /**\n * @typedef {Object} PushedRequest\n * @property {import(\"./socketRequest\").RequestEntry} entry\n * @property {boolean} expectResponse\n * @property {Function} sendRequest\n * @property {number} [requestTimeout]\n *\n * @public\n * @param {PushedRequest} pushedRequest\n */\n push(pushedRequest) {\n const { correlationId } = pushedRequest.entry\n const defaultRequestTimeout = this.requestTimeout\n const customRequestTimeout = pushedRequest.requestTimeout\n\n // Some protocol requests have custom request timeouts (e.g JoinGroup, Fetch, etc). The custom\n // timeouts are influenced by user configurations, which can be lower than the default requestTimeout\n const requestTimeout = Math.max(defaultRequestTimeout, customRequestTimeout || 0)\n\n const socketRequest = new SocketRequest({\n entry: pushedRequest.entry,\n expectResponse: pushedRequest.expectResponse,\n broker: this.broker,\n clientId: this.clientId,\n instrumentationEmitter: this.instrumentationEmitter,\n requestTimeout,\n send: () => {\n if (this.inflight.has(correlationId)) {\n throw new KafkaJSInvariantViolation('Correlation id already exists')\n }\n this.inflight.set(correlationId, socketRequest)\n pushedRequest.sendRequest()\n },\n timeout: () => {\n this.inflight.delete(correlationId)\n this.checkPendingRequests()\n // Try to emit REQUEST_QUEUE_EMPTY. Otherwise, waitForPendingRequests may stuck forever\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n },\n })\n\n if (this.canSendSocketRequestImmediately()) {\n this.sendSocketRequest(socketRequest)\n return\n }\n\n this.pending.push(socketRequest)\n this.scheduleCheckPendingRequests()\n\n this.logger.debug(`Request enqueued`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId,\n })\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n /**\n * @param {SocketRequest} socketRequest\n */\n sendSocketRequest(socketRequest) {\n socketRequest.send()\n\n if (!socketRequest.expectResponse) {\n this.logger.debug(`Request does not expect a response, resolving immediately`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId: socketRequest.correlationId,\n })\n\n this.inflight.delete(socketRequest.correlationId)\n socketRequest.completed({ size: 0, payload: null })\n }\n }\n\n /**\n * @public\n * @param {object} response\n * @param {number} response.correlationId\n * @param {Buffer} response.payload\n * @param {number} response.size\n */\n fulfillRequest({ correlationId, payload, size }) {\n const socketRequest = this.inflight.get(correlationId)\n this.inflight.delete(correlationId)\n this.checkPendingRequests()\n\n if (socketRequest) {\n socketRequest.completed({ size, payload })\n } else {\n this.logger.warn(`Response without match`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId,\n })\n }\n\n this[PRIVATE.EMIT_REQUEST_QUEUE_EMPTY]()\n }\n\n /**\n * @public\n * @param {Error} error\n */\n rejectAll(error) {\n const requests = [...this.inflight.values(), ...this.pending]\n\n for (const socketRequest of requests) {\n socketRequest.rejected(error)\n this.inflight.delete(socketRequest.correlationId)\n }\n\n this.pending = []\n this.inflight.clear()\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n /**\n * @public\n */\n waitForPendingRequests() {\n return new Promise(resolve => {\n if (this.pending.length === 0 && this.inflight.size === 0) {\n return resolve()\n }\n\n this.logger.debug('Waiting for pending requests', {\n clientId: this.clientId,\n broker: this.broker,\n currentInflightRequests: this.inflight.size,\n currentPendingQueueSize: this.pending.length,\n })\n\n this.once(REQUEST_QUEUE_EMPTY, () => resolve())\n })\n }\n\n /**\n * @public\n */\n destroy() {\n clearInterval(this.requestTimeoutIntervalId)\n clearTimeout(this.throttleCheckTimeoutId)\n this.throttleCheckTimeoutId = null\n }\n\n canSendSocketRequestImmediately() {\n const shouldEnqueue =\n (this.maxInFlightRequests != null && this.inflight.size >= this.maxInFlightRequests) ||\n this.throttledUntil > Date.now()\n\n return !shouldEnqueue\n }\n\n /**\n * Check and process pending requests either now or in the future\n *\n * This function will send out as many pending requests as possible taking throttling and\n * in-flight limits into account.\n */\n checkPendingRequests() {\n while (this.pending.length > 0 && this.canSendSocketRequestImmediately()) {\n const pendingRequest = this.pending.shift() // first in first out\n this.sendSocketRequest(pendingRequest)\n\n this.logger.debug(`Consumed pending request`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId: pendingRequest.correlationId,\n pendingDuration: pendingRequest.pendingDuration,\n currentPendingQueueSize: this.pending.length,\n })\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n this.scheduleCheckPendingRequests()\n }\n\n /**\n * Ensure that pending requests will be checked in the future\n *\n * If there is a client-side throttling in place this will ensure that we will check\n * the pending request queue eventually.\n */\n scheduleCheckPendingRequests() {\n // If we're throttled: Schedule checkPendingRequests when the throttle\n // should be resolved. If there is already something scheduled we assume that that\n // will be fine, and potentially fix up a new timeout if needed at that time.\n // Note that if we're merely \"overloaded\" by having too many inflight requests\n // we will anyways check the queue when one of them gets fulfilled.\n const timeUntilUnthrottled = this.throttledUntil - Date.now()\n if (timeUntilUnthrottled > 0 && !this.throttleCheckTimeoutId) {\n this.throttleCheckTimeoutId = setTimeout(() => {\n this.throttleCheckTimeoutId = null\n this.checkPendingRequests()\n }, timeUntilUnthrottled)\n }\n }\n}\n","const { KafkaJSRequestTimeoutError, KafkaJSNonRetriableError } = require('../../errors')\nconst events = require('../instrumentationEvents')\n\nconst PRIVATE = {\n STATE: Symbol('private:SocketRequest:state'),\n EMIT_EVENT: Symbol('private:SocketRequest:emitEvent'),\n}\n\nconst REQUEST_STATE = {\n PENDING: Symbol('PENDING'),\n SENT: Symbol('SENT'),\n COMPLETED: Symbol('COMPLETED'),\n REJECTED: Symbol('REJECTED'),\n}\n\n/**\n * SocketRequest abstracts the life cycle of a socket request, making it easier to track\n * request durations and to have individual timeouts per request.\n *\n * @typedef {Object} SocketRequest\n * @property {number} createdAt\n * @property {number} sentAt\n * @property {number} pendingDuration\n * @property {number} duration\n * @property {number} requestTimeout\n * @property {string} broker\n * @property {string} clientId\n * @property {RequestEntry} entry\n * @property {boolean} expectResponse\n * @property {Function} send\n * @property {Function} timeout\n *\n * @typedef {Object} RequestEntry\n * @property {string} apiKey\n * @property {string} apiName\n * @property {number} apiVersion\n * @property {number} correlationId\n * @property {Function} resolve\n * @property {Function} reject\n */\nmodule.exports = class SocketRequest {\n /**\n * @param {Object} options\n * @param {number} options.requestTimeout\n * @param {string} options.broker - e.g: 127.0.0.1:9092\n * @param {string} options.clientId\n * @param {RequestEntry} options.entry\n * @param {boolean} options.expectResponse\n * @param {Function} options.send\n * @param {() => void} options.timeout\n * @param {import(\"../../instrumentation/emitter\")} [options.instrumentationEmitter=null]\n */\n constructor({\n requestTimeout,\n broker,\n clientId,\n entry,\n expectResponse,\n send,\n timeout,\n instrumentationEmitter = null,\n }) {\n this.createdAt = Date.now()\n this.requestTimeout = requestTimeout\n this.broker = broker\n this.clientId = clientId\n this.entry = entry\n this.correlationId = entry.correlationId\n this.expectResponse = expectResponse\n this.sendRequest = send\n this.timeoutHandler = timeout\n\n this.sentAt = null\n this.duration = null\n this.pendingDuration = null\n\n this[PRIVATE.STATE] = REQUEST_STATE.PENDING\n this[PRIVATE.EMIT_EVENT] = (eventName, payload) =>\n instrumentationEmitter && instrumentationEmitter.emit(eventName, payload)\n }\n\n send() {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.PENDING],\n next: REQUEST_STATE.SENT,\n })\n\n this.sendRequest()\n this.sentAt = Date.now()\n this.pendingDuration = this.sentAt - this.createdAt\n this[PRIVATE.STATE] = REQUEST_STATE.SENT\n }\n\n timeoutRequest() {\n const { apiName, apiKey, apiVersion } = this.entry\n const requestInfo = `${apiName}(key: ${apiKey}, version: ${apiVersion})`\n const eventData = {\n broker: this.broker,\n clientId: this.clientId,\n correlationId: this.correlationId,\n createdAt: this.createdAt,\n sentAt: this.sentAt,\n pendingDuration: this.pendingDuration,\n }\n\n this.timeoutHandler()\n this.rejected(new KafkaJSRequestTimeoutError(`Request ${requestInfo} timed out`, eventData))\n this[PRIVATE.EMIT_EVENT](events.NETWORK_REQUEST_TIMEOUT, {\n ...eventData,\n apiName,\n apiKey,\n apiVersion,\n })\n }\n\n completed({ size, payload }) {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.SENT],\n next: REQUEST_STATE.COMPLETED,\n })\n\n const { entry, correlationId, broker, clientId, createdAt, sentAt, pendingDuration } = this\n\n this[PRIVATE.STATE] = REQUEST_STATE.COMPLETED\n this.duration = Date.now() - this.sentAt\n entry.resolve({ correlationId, entry, size, payload })\n\n this[PRIVATE.EMIT_EVENT](events.NETWORK_REQUEST, {\n broker,\n clientId,\n correlationId,\n size,\n createdAt,\n sentAt,\n pendingDuration,\n duration: this.duration,\n apiName: entry.apiName,\n apiKey: entry.apiKey,\n apiVersion: entry.apiVersion,\n })\n }\n\n rejected(error) {\n this.throwIfInvalidState({\n accepted: [REQUEST_STATE.PENDING, REQUEST_STATE.SENT],\n next: REQUEST_STATE.REJECTED,\n })\n\n this[PRIVATE.STATE] = REQUEST_STATE.REJECTED\n this.duration = Date.now() - this.sentAt\n this.entry.reject(error)\n }\n\n /**\n * @private\n */\n throwIfInvalidState({ accepted, next }) {\n if (accepted.includes(this[PRIVATE.STATE])) {\n return\n }\n\n const current = this[PRIVATE.STATE].toString()\n\n throw new KafkaJSNonRetriableError(\n `Invalid state, can't transition from ${current} to ${next.toString()}`\n )\n }\n}\n","/**\n * @param {Object} options\n * @param {import(\"../../types\").ISocketFactory} options.socketFactory\n * @param {string} options.host\n * @param {number} options.port\n * @param {Object} options.ssl\n * @param {() => void} options.onConnect\n * @param {(data: Buffer) => void} options.onData\n * @param {() => void} options.onEnd\n * @param {(err: Error) => void} options.onError\n * @param {() => void} options.onTimeout\n */\nmodule.exports = ({\n socketFactory,\n host,\n port,\n ssl,\n onConnect,\n onData,\n onEnd,\n onError,\n onTimeout,\n}) => {\n const socket = socketFactory({ host, port, ssl, onConnect })\n\n socket.on('data', onData)\n socket.on('end', onEnd)\n socket.on('error', onError)\n socket.on('timeout', onTimeout)\n\n return socket\n}\n","const KEEP_ALIVE_DELAY = 60000 // in ms\n\n/**\n * @returns {import(\"../../types\").ISocketFactory}\n */\nmodule.exports = () => {\n const net = require('net')\n const tls = require('tls')\n\n return ({ host, port, ssl, onConnect }) => {\n const socket = ssl\n ? tls.connect(Object.assign({ host, port, servername: host }, ssl), onConnect)\n : net.connect({ host, port }, onConnect)\n\n socket.setKeepAlive(true, KEEP_ALIVE_DELAY)\n\n return socket\n }\n}\n","module.exports = topicDataForBroker => {\n return topicDataForBroker.map(\n ({ topic, partitions, messagesPerPartition, sequencePerPartition }) => ({\n topic,\n partitions: partitions.map(partition => ({\n partition,\n firstSequence: sequencePerPartition[partition],\n messages: messagesPerPartition[partition],\n })),\n })\n )\n}\n","const createRetry = require('../../retry')\nconst { KafkaJSNonRetriableError } = require('../../errors')\nconst COORDINATOR_TYPES = require('../../protocol/coordinatorTypes')\nconst createStateMachine = require('./transactionStateMachine')\nconst assert = require('assert')\n\nconst STATES = require('./transactionStates')\nconst NO_PRODUCER_ID = -1\nconst SEQUENCE_START = 0\nconst INT_32_MAX_VALUE = Math.pow(2, 32)\nconst INIT_PRODUCER_RETRIABLE_PROTOCOL_ERRORS = [\n 'NOT_COORDINATOR_FOR_GROUP',\n 'GROUP_COORDINATOR_NOT_AVAILABLE',\n 'GROUP_LOAD_IN_PROGRESS',\n /**\n * The producer might have crashed and never committed the transaction; retry the\n * request so Kafka can abort the current transaction\n * @see https://github.com/apache/kafka/blob/201da0542726472d954080d54bc585b111aaf86f/clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java#L1001-L1002\n */\n 'CONCURRENT_TRANSACTIONS',\n]\nconst COMMIT_RETRIABLE_PROTOCOL_ERRORS = [\n 'UNKNOWN_TOPIC_OR_PARTITION',\n 'COORDINATOR_LOAD_IN_PROGRESS',\n]\nconst COMMIT_STALE_COORDINATOR_PROTOCOL_ERRORS = ['COORDINATOR_NOT_AVAILABLE', 'NOT_COORDINATOR']\n\n/**\n * @typedef {Object} EosManager\n */\n\n/**\n * Manage behavior for an idempotent producer and transactions.\n *\n * @returns {EosManager}\n */\nmodule.exports = ({\n logger,\n cluster,\n transactionTimeout = 60000,\n transactional,\n transactionalId,\n}) => {\n if (transactional && !transactionalId) {\n throw new KafkaJSNonRetriableError('Cannot manage transactions without a transactionalId')\n }\n\n const retrier = createRetry(cluster.retry)\n\n /**\n * Current producer ID\n */\n let producerId = NO_PRODUCER_ID\n\n /**\n * Current producer epoch\n */\n let producerEpoch = 0\n\n /**\n * Idempotent production requires that the producer track the sequence number of messages.\n *\n * Sequences are sent with every Record Batch and tracked per Topic-Partition\n */\n let producerSequence = {}\n\n /**\n * Topic partitions already participating in the transaction\n */\n let transactionTopicPartitions = {}\n\n const stateMachine = createStateMachine({ logger })\n stateMachine.on('transition', ({ to }) => {\n if (to === STATES.READY) {\n transactionTopicPartitions = {}\n }\n })\n\n const findTransactionCoordinator = () => {\n return cluster.findGroupCoordinator({\n groupId: transactionalId,\n coordinatorType: COORDINATOR_TYPES.TRANSACTION,\n })\n }\n\n const transactionalGuard = () => {\n if (!transactional) {\n throw new KafkaJSNonRetriableError('Method unavailable if non-transactional')\n }\n }\n\n const eosManager = stateMachine.createGuarded(\n {\n /**\n * Get the current producer id\n * @returns {number}\n */\n getProducerId() {\n return producerId\n },\n\n /**\n * Get the current producer epoch\n * @returns {number}\n */\n getProducerEpoch() {\n return producerEpoch\n },\n\n getTransactionalId() {\n return transactionalId\n },\n\n /**\n * Initialize the idempotent producer by making an `InitProducerId` request.\n * Overwrites any existing state in this transaction manager\n */\n async initProducerId() {\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await cluster.refreshMetadataIfNecessary()\n\n // If non-transactional we can request the PID from any broker\n const broker = await (transactional\n ? findTransactionCoordinator()\n : cluster.findControllerBroker())\n\n const result = await broker.initProducerId({\n transactionalId: transactional ? transactionalId : undefined,\n transactionTimeout,\n })\n\n stateMachine.transitionTo(STATES.READY)\n producerId = result.producerId\n producerEpoch = result.producerEpoch\n producerSequence = {}\n\n logger.debug('Initialized producer id & epoch', { producerId, producerEpoch })\n } catch (e) {\n if (INIT_PRODUCER_RETRIABLE_PROTOCOL_ERRORS.includes(e.type)) {\n if (e.type === 'CONCURRENT_TRANSACTIONS') {\n logger.debug('There is an ongoing transaction on this transactionId, retrying', {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n })\n }\n\n throw e\n }\n\n bail(e)\n }\n })\n },\n\n /**\n * Get the current sequence for a given Topic-Partition. Defaults to 0.\n *\n * @param {string} topic\n * @param {string} partition\n * @returns {number}\n */\n getSequence(topic, partition) {\n if (!eosManager.isInitialized()) {\n return SEQUENCE_START\n }\n\n producerSequence[topic] = producerSequence[topic] || {}\n producerSequence[topic][partition] = producerSequence[topic][partition] || SEQUENCE_START\n\n return producerSequence[topic][partition]\n },\n\n /**\n * Update the sequence for a given Topic-Partition.\n *\n * Do nothing if not yet initialized (not idempotent)\n * @param {string} topic\n * @param {string} partition\n * @param {number} increment\n */\n updateSequence(topic, partition, increment) {\n if (!eosManager.isInitialized()) {\n return\n }\n\n const previous = eosManager.getSequence(topic, partition)\n let sequence = previous + increment\n\n // Sequence is defined as Int32 in the Record Batch,\n // so theoretically should need to rotate here\n if (sequence >= INT_32_MAX_VALUE) {\n logger.debug(\n `Sequence for ${topic} ${partition} exceeds max value (${sequence}). Rotating to 0.`\n )\n sequence = 0\n }\n\n producerSequence[topic][partition] = sequence\n },\n\n /**\n * Begin a transaction\n */\n beginTransaction() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.TRANSACTING)\n },\n\n /**\n * Add partitions to a transaction if they are not already marked as participating.\n *\n * Should be called prior to sending any messages during a transaction\n * @param {TopicData[]} topicData\n *\n * @typedef {Object} TopicData\n * @property {string} topic\n * @property {object[]} partitions\n * @property {number} partitions[].partition\n */\n async addPartitionsToTransaction(topicData) {\n transactionalGuard()\n const newTopicPartitions = {}\n\n topicData.forEach(({ topic, partitions }) => {\n transactionTopicPartitions[topic] = transactionTopicPartitions[topic] || {}\n\n partitions.forEach(({ partition }) => {\n if (!transactionTopicPartitions[topic][partition]) {\n newTopicPartitions[topic] = newTopicPartitions[topic] || []\n newTopicPartitions[topic].push(partition)\n }\n })\n })\n\n const topics = Object.keys(newTopicPartitions).map(topic => ({\n topic,\n partitions: newTopicPartitions[topic],\n }))\n\n if (topics.length) {\n const broker = await findTransactionCoordinator()\n await broker.addPartitionsToTxn({ transactionalId, producerId, producerEpoch, topics })\n }\n\n topics.forEach(({ topic, partitions }) => {\n partitions.forEach(partition => {\n transactionTopicPartitions[topic][partition] = true\n })\n })\n },\n\n /**\n * Commit the ongoing transaction\n */\n async commit() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.COMMITTING)\n\n const broker = await findTransactionCoordinator()\n await broker.endTxn({\n producerId,\n producerEpoch,\n transactionalId,\n transactionResult: true,\n })\n\n stateMachine.transitionTo(STATES.READY)\n },\n\n /**\n * Abort the ongoing transaction\n */\n async abort() {\n transactionalGuard()\n stateMachine.transitionTo(STATES.ABORTING)\n\n const broker = await findTransactionCoordinator()\n await broker.endTxn({\n producerId,\n producerEpoch,\n transactionalId,\n transactionResult: false,\n })\n\n stateMachine.transitionTo(STATES.READY)\n },\n\n /**\n * Whether the producer id has already been initialized\n */\n isInitialized() {\n return producerId !== NO_PRODUCER_ID\n },\n\n isTransactional() {\n return transactional\n },\n\n isInTransaction() {\n return stateMachine.state() === STATES.TRANSACTING\n },\n\n /**\n * Mark the provided offsets as participating in the transaction for the given consumer group.\n *\n * This allows us to commit an offset as consumed only if the transaction passes.\n * @param {string} consumerGroupId The unique group identifier\n * @param {OffsetCommitTopic[]} topics The unique group identifier\n * @returns {Promise}\n *\n * @typedef {Object} OffsetCommitTopic\n * @property {string} topic\n * @property {OffsetCommitTopicPartition[]} partitions\n *\n * @typedef {Object} OffsetCommitTopicPartition\n * @property {number} partition\n * @property {number} offset\n */\n async sendOffsets({ consumerGroupId, topics }) {\n assert(consumerGroupId, 'Missing consumerGroupId')\n assert(topics, 'Missing offset topics')\n\n const transactionCoordinator = await findTransactionCoordinator()\n\n // Do we need to add offsets if we've already done so for this consumer group?\n await transactionCoordinator.addOffsetsToTxn({\n transactionalId,\n producerId,\n producerEpoch,\n groupId: consumerGroupId,\n })\n\n let groupCoordinator = await cluster.findGroupCoordinator({\n groupId: consumerGroupId,\n coordinatorType: COORDINATOR_TYPES.GROUP,\n })\n\n return retrier(async (bail, retryCount, retryTime) => {\n try {\n await groupCoordinator.txnOffsetCommit({\n transactionalId,\n producerId,\n producerEpoch,\n groupId: consumerGroupId,\n topics,\n })\n } catch (e) {\n if (COMMIT_RETRIABLE_PROTOCOL_ERRORS.includes(e.type)) {\n logger.debug('Group coordinator is not ready yet, retrying', {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n })\n\n throw e\n }\n\n if (\n COMMIT_STALE_COORDINATOR_PROTOCOL_ERRORS.includes(e.type) ||\n e.code === 'ECONNREFUSED'\n ) {\n logger.debug(\n 'Invalid group coordinator, finding new group coordinator and retrying',\n {\n error: e.message,\n stack: e.stack,\n transactionalId,\n retryCount,\n retryTime,\n }\n )\n\n groupCoordinator = await cluster.findGroupCoordinator({\n groupId: consumerGroupId,\n coordinatorType: COORDINATOR_TYPES.GROUP,\n })\n\n throw e\n }\n\n bail(e)\n }\n })\n },\n },\n\n /**\n * Transaction state guards\n */\n {\n initProducerId: { legalStates: [STATES.UNINITIALIZED, STATES.READY] },\n beginTransaction: { legalStates: [STATES.READY], async: false },\n addPartitionsToTransaction: { legalStates: [STATES.TRANSACTING] },\n sendOffsets: { legalStates: [STATES.TRANSACTING] },\n commit: { legalStates: [STATES.TRANSACTING] },\n abort: { legalStates: [STATES.TRANSACTING] },\n }\n )\n\n return eosManager\n}\n","const { EventEmitter } = require('events')\nconst { KafkaJSNonRetriableError } = require('../../errors')\nconst STATES = require('./transactionStates')\n\nconst VALID_STATE_TRANSITIONS = {\n [STATES.UNINITIALIZED]: [STATES.READY],\n [STATES.READY]: [STATES.READY, STATES.TRANSACTING],\n [STATES.TRANSACTING]: [STATES.COMMITTING, STATES.ABORTING],\n [STATES.COMMITTING]: [STATES.READY],\n [STATES.ABORTING]: [STATES.READY],\n}\n\nmodule.exports = ({ logger, initialState = STATES.UNINITIALIZED }) => {\n let currentState = initialState\n\n const guard = (object, method, { legalStates, async: isAsync = true }) => {\n if (!object[method]) {\n throw new KafkaJSNonRetriableError(`Cannot add guard on missing method \"${method}\"`)\n }\n\n return (...args) => {\n const fn = object[method]\n\n if (!legalStates.includes(currentState)) {\n const error = new KafkaJSNonRetriableError(\n `Transaction state exception: Cannot call \"${method}\" in state \"${currentState}\"`\n )\n\n if (isAsync) {\n return Promise.reject(error)\n } else {\n throw error\n }\n }\n\n return fn.apply(object, args)\n }\n }\n\n const stateMachine = Object.assign(new EventEmitter(), {\n /**\n * Create a clone of \"object\" where we ensure state machine is in correct state\n * prior to calling any of the configured methods\n * @param {Object} object The object whose methods we will guard\n * @param {Object} methodStateMapping Keys are method names on \"object\"\n * @param {string[]} methodStateMapping.legalStates Legal states for this method\n * @param {boolean=true} methodStateMapping.async Whether this method is async (throw vs reject)\n */\n createGuarded(object, methodStateMapping) {\n const guardedMethods = Object.keys(methodStateMapping).reduce((guards, method) => {\n guards[method] = guard(object, method, methodStateMapping[method])\n return guards\n }, {})\n\n return { ...object, ...guardedMethods }\n },\n /**\n * Transition safely to a new state\n */\n transitionTo(state) {\n logger.debug(`Transaction state transition ${currentState} --> ${state}`)\n\n if (!VALID_STATE_TRANSITIONS[currentState].includes(state)) {\n throw new KafkaJSNonRetriableError(\n `Transaction state exception: Invalid transition ${currentState} --> ${state}`\n )\n }\n\n stateMachine.emit('transition', { to: state, from: currentState })\n currentState = state\n },\n\n state() {\n return currentState\n },\n })\n\n return stateMachine\n}\n","module.exports = {\n UNINITIALIZED: 'UNINITIALIZED',\n READY: 'READY',\n TRANSACTING: 'TRANSACTING',\n COMMITTING: 'COMMITTING',\n ABORTING: 'ABORTING',\n}\n","module.exports = ({ topic, partitionMetadata, messages, partitioner }) => {\n if (partitionMetadata.length === 0) {\n return {}\n }\n\n return messages.reduce((result, message) => {\n const partition = partitioner({ topic, partitionMetadata, message })\n const current = result[partition] || []\n return Object.assign(result, { [partition]: [...current, message] })\n }, {})\n}\n","const createRetry = require('../retry')\nconst { CONNECTION_STATUS } = require('../network/connectionStatus')\nconst { DefaultPartitioner } = require('./partitioners/')\nconst InstrumentationEventEmitter = require('../instrumentation/emitter')\nconst createEosManager = require('./eosManager')\nconst createMessageProducer = require('./messageProducer')\nconst { events, wrap: wrapEvent, unwrap: unwrapEvent } = require('./instrumentationEvents')\nconst { KafkaJSNonRetriableError } = require('../errors')\n\nconst { values, keys } = Object\nconst eventNames = values(events)\nconst eventKeys = keys(events)\n .map(key => `producer.events.${key}`)\n .join(', ')\n\nconst { CONNECT, DISCONNECT } = events\n\n/**\n *\n * @param {Object} params\n * @param {import('../../types').Cluster} params.cluster\n * @param {import('../../types').Logger} params.logger\n * @param {import('../../types').ICustomPartitioner} [params.createPartitioner]\n * @param {import('../../types').RetryOptions} [params.retry]\n * @param {boolean} [params.idempotent]\n * @param {string} [params.transactionalId]\n * @param {number} [params.transactionTimeout]\n * @param {InstrumentationEventEmitter} [params.instrumentationEmitter]\n *\n * @returns {import('../../types').Producer}\n */\nmodule.exports = ({\n cluster,\n logger: rootLogger,\n createPartitioner = DefaultPartitioner,\n retry,\n idempotent = false,\n transactionalId,\n transactionTimeout,\n instrumentationEmitter: rootInstrumentationEmitter,\n}) => {\n let connectionStatus = CONNECTION_STATUS.DISCONNECTED\n retry = retry || { retries: idempotent ? Number.MAX_SAFE_INTEGER : 5 }\n\n if (idempotent && retry.retries < 1) {\n throw new KafkaJSNonRetriableError(\n 'Idempotent producer must allow retries to protect against transient errors'\n )\n }\n\n const logger = rootLogger.namespace('Producer')\n\n if (idempotent && retry.retries < Number.MAX_SAFE_INTEGER) {\n logger.warn('Limiting retries for the idempotent producer may invalidate EoS guarantees')\n }\n\n const partitioner = createPartitioner()\n const retrier = createRetry(Object.assign({}, cluster.retry, retry))\n const instrumentationEmitter = rootInstrumentationEmitter || new InstrumentationEventEmitter()\n const idempotentEosManager = createEosManager({\n logger,\n cluster,\n transactionTimeout,\n transactional: false,\n transactionalId,\n })\n\n const { send, sendBatch } = createMessageProducer({\n logger,\n cluster,\n partitioner,\n eosManager: idempotentEosManager,\n idempotent,\n retrier,\n getConnectionStatus: () => connectionStatus,\n })\n\n let transactionalEosManager\n\n /** @type {import(\"../../types\").Producer[\"on\"]} */\n const on = (eventName, listener) => {\n if (!eventNames.includes(eventName)) {\n throw new KafkaJSNonRetriableError(`Event name should be one of ${eventKeys}`)\n }\n\n return instrumentationEmitter.addListener(unwrapEvent(eventName), event => {\n event.type = wrapEvent(event.type)\n Promise.resolve(listener(event)).catch(e => {\n logger.error(`Failed to execute listener: ${e.message}`, {\n eventName,\n stack: e.stack,\n })\n })\n })\n }\n\n /**\n * Begin a transaction. The returned object contains methods to send messages\n * to the transaction and end the transaction by committing or aborting.\n *\n * Only messages sent on the transaction object will participate in the transaction.\n *\n * Calling any of the transactional methods after the transaction has ended\n * will raise an exception (use `isActive` to ascertain if ended).\n * @returns {Promise}\n *\n * @typedef {Object} Transaction\n * @property {Function} send Identical to the producer \"send\" method\n * @property {Function} sendBatch Identical to the producer \"sendBatch\" method\n * @property {Function} abort Abort the transaction\n * @property {Function} commit Commit the transaction\n * @property {Function} isActive Whether the transaction is active\n */\n const transaction = async () => {\n if (!transactionalId) {\n throw new KafkaJSNonRetriableError('Must provide transactional id for transactional producer')\n }\n\n let transactionDidEnd = false\n transactionalEosManager =\n transactionalEosManager ||\n createEosManager({\n logger,\n cluster,\n transactionTimeout,\n transactional: true,\n transactionalId,\n })\n\n if (transactionalEosManager.isInTransaction()) {\n throw new KafkaJSNonRetriableError(\n 'There is already an ongoing transaction for this producer. Please end the transaction before beginning another.'\n )\n }\n\n // We only initialize the producer id once\n if (!transactionalEosManager.isInitialized()) {\n await transactionalEosManager.initProducerId()\n }\n transactionalEosManager.beginTransaction()\n\n const { send: sendTxn, sendBatch: sendBatchTxn } = createMessageProducer({\n logger,\n cluster,\n partitioner,\n retrier,\n eosManager: transactionalEosManager,\n idempotent: true,\n getConnectionStatus: () => connectionStatus,\n })\n\n const isActive = () => transactionalEosManager.isInTransaction() && !transactionDidEnd\n\n const transactionGuard = fn => (...args) => {\n if (!isActive()) {\n return Promise.reject(\n new KafkaJSNonRetriableError('Cannot continue to use transaction once ended')\n )\n }\n\n return fn(...args)\n }\n\n return {\n sendBatch: transactionGuard(sendBatchTxn),\n send: transactionGuard(sendTxn),\n /**\n * Abort the ongoing transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n abort: transactionGuard(async () => {\n await transactionalEosManager.abort()\n transactionDidEnd = true\n }),\n /**\n * Commit the ongoing transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n commit: transactionGuard(async () => {\n await transactionalEosManager.commit()\n transactionDidEnd = true\n }),\n /**\n * Sends a list of specified offsets to the consumer group coordinator, and also marks those offsets as part of the current transaction.\n *\n * @throws {KafkaJSNonRetriableError} If transaction has ended\n */\n sendOffsets: transactionGuard(async ({ consumerGroupId, topics }) => {\n await transactionalEosManager.sendOffsets({ consumerGroupId, topics })\n\n for (const topicOffsets of topics) {\n const { topic, partitions } = topicOffsets\n for (const { partition, offset } of partitions) {\n cluster.markOffsetAsCommitted({\n groupId: consumerGroupId,\n topic,\n partition,\n offset,\n })\n }\n }\n }),\n isActive,\n }\n }\n\n /**\n * @returns {Object} logger\n */\n const getLogger = () => logger\n\n return {\n /**\n * @returns {Promise}\n */\n connect: async () => {\n await cluster.connect()\n connectionStatus = CONNECTION_STATUS.CONNECTED\n instrumentationEmitter.emit(CONNECT)\n\n if (idempotent && !idempotentEosManager.isInitialized()) {\n await idempotentEosManager.initProducerId()\n }\n },\n /**\n * @return {Promise}\n */\n disconnect: async () => {\n connectionStatus = CONNECTION_STATUS.DISCONNECTING\n await cluster.disconnect()\n connectionStatus = CONNECTION_STATUS.DISCONNECTED\n instrumentationEmitter.emit(DISCONNECT)\n },\n isIdempotent: () => {\n return idempotent\n },\n events,\n on,\n send,\n sendBatch,\n transaction,\n logger: getLogger,\n }\n}\n","const swapObject = require('../utils/swapObject')\nconst networkEvents = require('../network/instrumentationEvents')\nconst InstrumentationEventType = require('../instrumentation/eventType')\nconst producerType = InstrumentationEventType('producer')\n\nconst events = {\n CONNECT: producerType('connect'),\n DISCONNECT: producerType('disconnect'),\n REQUEST: producerType(networkEvents.NETWORK_REQUEST),\n REQUEST_TIMEOUT: producerType(networkEvents.NETWORK_REQUEST_TIMEOUT),\n REQUEST_QUEUE_SIZE: producerType(networkEvents.NETWORK_REQUEST_QUEUE_SIZE),\n}\n\nconst wrappedEvents = {\n [events.REQUEST]: networkEvents.NETWORK_REQUEST,\n [events.REQUEST_TIMEOUT]: networkEvents.NETWORK_REQUEST_TIMEOUT,\n [events.REQUEST_QUEUE_SIZE]: networkEvents.NETWORK_REQUEST_QUEUE_SIZE,\n}\n\nconst reversedWrappedEvents = swapObject(wrappedEvents)\nconst unwrap = eventName => wrappedEvents[eventName] || eventName\nconst wrap = eventName => reversedWrappedEvents[eventName] || eventName\n\nmodule.exports = {\n events,\n wrap,\n unwrap,\n}\n","const createSendMessages = require('./sendMessages')\nconst { KafkaJSError, KafkaJSNonRetriableError } = require('../errors')\nconst { CONNECTION_STATUS } = require('../network/connectionStatus')\n\nmodule.exports = ({\n logger,\n cluster,\n partitioner,\n eosManager,\n idempotent,\n retrier,\n getConnectionStatus,\n}) => {\n const sendMessages = createSendMessages({\n logger,\n cluster,\n retrier,\n partitioner,\n eosManager,\n })\n\n const validateConnectionStatus = () => {\n const connectionStatus = getConnectionStatus()\n\n switch (connectionStatus) {\n case CONNECTION_STATUS.DISCONNECTING:\n throw new KafkaJSNonRetriableError(\n `The producer is disconnecting; therefore, it can't safely accept messages anymore`\n )\n case CONNECTION_STATUS.DISCONNECTED:\n throw new KafkaJSError('The producer is disconnected')\n }\n }\n\n /**\n * @typedef {Object} TopicMessages\n * @property {string} topic\n * @property {Array} messages An array of objects with \"key\" and \"value\", example:\n * [{ key: 'my-key', value: 'my-value'}]\n *\n * @typedef {Object} SendBatchRequest\n * @property {Array} topicMessages\n * @property {number} [acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n *\n * @property {number} [timeout=30000] The time to await a response in ms\n * @property {Compression.Types} [compression=Compression.Types.None] Compression codec\n *\n * @param {SendBatchRequest}\n * @returns {Promise}\n */\n const sendBatch = async ({ acks = -1, timeout, compression, topicMessages = [] }) => {\n if (topicMessages.some(({ topic }) => !topic)) {\n throw new KafkaJSNonRetriableError(`Invalid topic`)\n }\n\n if (idempotent && acks !== -1) {\n throw new KafkaJSNonRetriableError(\n `Not requiring ack for all messages invalidates the idempotent producer's EoS guarantees`\n )\n }\n\n for (const { topic, messages } of topicMessages) {\n if (!messages) {\n throw new KafkaJSNonRetriableError(\n `Invalid messages array [${messages}] for topic \"${topic}\"`\n )\n }\n\n const messageWithoutValue = messages.find(message => message.value === undefined)\n if (messageWithoutValue) {\n throw new KafkaJSNonRetriableError(\n `Invalid message without value for topic \"${topic}\": ${JSON.stringify(\n messageWithoutValue\n )}`\n )\n }\n }\n\n validateConnectionStatus()\n const mergedTopicMessages = topicMessages.reduce((merged, { topic, messages }) => {\n const index = merged.findIndex(({ topic: mergedTopic }) => topic === mergedTopic)\n\n if (index === -1) {\n merged.push({ topic, messages })\n } else {\n merged[index].messages = [...merged[index].messages, ...messages]\n }\n\n return merged\n }, [])\n\n return await sendMessages({\n acks,\n timeout,\n compression,\n topicMessages: mergedTopicMessages,\n })\n }\n\n /**\n * @param {ProduceRequest} ProduceRequest\n * @returns {Promise}\n *\n * @typedef {Object} ProduceRequest\n * @property {string} topic\n * @property {Array} messages An array of objects with \"key\" and \"value\", example:\n * [{ key: 'my-key', value: 'my-value'}]\n * @property {number} [acks=-1] Control the number of required acks.\n * -1 = all replicas must acknowledge\n * 0 = no acknowledgments\n * 1 = only waits for the leader to acknowledge\n * @property {number} [timeout=30000] The time to await a response in ms\n * @property {Compression.Types} [compression=Compression.Types.None] Compression codec\n */\n const send = async ({ acks, timeout, compression, topic, messages }) => {\n const topicMessage = { topic, messages }\n return sendBatch({\n acks,\n timeout,\n compression,\n topicMessages: [topicMessage],\n })\n }\n\n return {\n send,\n sendBatch,\n }\n}\n","const murmur2 = require('./murmur2')\nconst createDefaultPartitioner = require('./partitioner')\n\nmodule.exports = createDefaultPartitioner(murmur2)\n","/* eslint-disable */\n\n// Based on the kafka client 0.10.2 murmur2 implementation\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L364\n\nconst SEED = 0x9747b28c\n\n// 'm' and 'r' are mixing constants generated offline.\n// They're not really 'magic', they just happen to work well.\nconst M = 0x5bd1e995\nconst R = 24\n\nmodule.exports = key => {\n const data = Buffer.isBuffer(key) ? key : Buffer.from(String(key))\n const length = data.length\n\n // Initialize the hash to a random value\n let h = SEED ^ length\n let length4 = length / 4\n\n for (let i = 0; i < length4; i++) {\n const i4 = i * 4\n let k =\n (data[i4 + 0] & 0xff) +\n ((data[i4 + 1] & 0xff) << 8) +\n ((data[i4 + 2] & 0xff) << 16) +\n ((data[i4 + 3] & 0xff) << 24)\n k *= M\n k ^= k >>> R\n k *= M\n h *= M\n h ^= k\n }\n\n // Handle the last few bytes of the input array\n switch (length % 4) {\n case 3:\n h ^= (data[(length & ~3) + 2] & 0xff) << 16\n case 2:\n h ^= (data[(length & ~3) + 1] & 0xff) << 8\n case 1:\n h ^= data[length & ~3] & 0xff\n h *= M\n }\n\n h ^= h >>> 13\n h *= M\n h ^= h >>> 15\n\n return h\n}\n","const randomBytes = require('./randomBytes')\n\n// Based on the java client 0.10.2\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/clients/producer/internals/DefaultPartitioner.java\n\n/**\n * A cheap way to deterministically convert a number to a positive value. When the input is\n * positive, the original value is returned. When the input number is negative, the returned\n * positive value is the original value bit AND against 0x7fffffff which is not its absolutely\n * value.\n */\nconst toPositive = x => x & 0x7fffffff\n\n/**\n * The default partitioning strategy:\n * - If a partition is specified in the message, use it\n * - If no partition is specified but a key is present choose a partition based on a hash of the key\n * - If no partition or key is present choose a partition in a round-robin fashion\n */\nmodule.exports = murmur2 => () => {\n const counters = {}\n\n return ({ topic, partitionMetadata, message }) => {\n if (!(topic in counters)) {\n counters[topic] = randomBytes(32).readUInt32BE(0)\n }\n const numPartitions = partitionMetadata.length\n const availablePartitions = partitionMetadata.filter(p => p.leader >= 0)\n const numAvailablePartitions = availablePartitions.length\n\n if (message.partition !== null && message.partition !== undefined) {\n return message.partition\n }\n\n if (message.key !== null && message.key !== undefined) {\n return toPositive(murmur2(message.key)) % numPartitions\n }\n\n if (numAvailablePartitions > 0) {\n const i = toPositive(++counters[topic]) % numAvailablePartitions\n return availablePartitions[i].partitionId\n }\n\n // no partitions are available, give a non-available partition\n return toPositive(++counters[topic]) % numPartitions\n }\n}\n","const { KafkaJSNonRetriableError } = require('../../../errors')\n\nconst toNodeCompatible = crypto => ({\n randomBytes: size => crypto.getRandomValues(Buffer.allocUnsafe(size)),\n})\n\nlet cryptoImplementation = null\nif (global && global.crypto) {\n cryptoImplementation =\n global.crypto.randomBytes === undefined ? toNodeCompatible(global.crypto) : global.crypto\n} else if (global && global.msCrypto) {\n cryptoImplementation = toNodeCompatible(global.msCrypto)\n} else if (global && !global.crypto) {\n cryptoImplementation = require('crypto')\n}\n\nconst MAX_BYTES = 65536\n\nmodule.exports = size => {\n if (size > MAX_BYTES) {\n throw new KafkaJSNonRetriableError(\n `Byte length (${size}) exceeds the max number of bytes of entropy available (${MAX_BYTES})`\n )\n }\n\n if (!cryptoImplementation) {\n throw new KafkaJSNonRetriableError('No available crypto implementation')\n }\n\n return cryptoImplementation.randomBytes(size)\n}\n","const murmur2 = require('./murmur2')\nconst createDefaultPartitioner = require('../default/partitioner')\n\nmodule.exports = createDefaultPartitioner(murmur2)\n","/* eslint-disable */\nconst Long = require('../../../utils/long')\n\n// Based on the kafka client 0.10.2 murmur2 implementation\n// https://github.com/apache/kafka/blob/0.10.2/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L364\n\nconst SEED = Long.fromValue(0x9747b28c)\n\n// 'm' and 'r' are mixing constants generated offline.\n// They're not really 'magic', they just happen to work well.\nconst M = Long.fromValue(0x5bd1e995)\nconst R = Long.fromValue(24)\n\nmodule.exports = key => {\n const data = Buffer.isBuffer(key) ? key : Buffer.from(String(key))\n const length = data.length\n\n // Initialize the hash to a random value\n let h = Long.fromValue(SEED.xor(length))\n let length4 = Math.floor(length / 4)\n\n for (let i = 0; i < length4; i++) {\n const i4 = i * 4\n let k =\n (data[i4 + 0] & 0xff) +\n ((data[i4 + 1] & 0xff) << 8) +\n ((data[i4 + 2] & 0xff) << 16) +\n ((data[i4 + 3] & 0xff) << 24)\n k = Long.fromValue(k)\n k = k.multiply(M)\n k = k.xor(k.toInt() >>> R)\n k = Long.fromValue(k).multiply(M)\n h = h.multiply(M)\n h = h.xor(k)\n }\n\n // Handle the last few bytes of the input array\n switch (length % 4) {\n case 3:\n h = h.xor((data[(length & ~3) + 2] & 0xff) << 16)\n case 2:\n h = h.xor((data[(length & ~3) + 1] & 0xff) << 8)\n case 1:\n h = h.xor(data[length & ~3] & 0xff)\n h = h.multiply(M)\n }\n\n h = h.xor(h.toInt() >>> 13)\n h = h.multiply(M)\n h = h.xor(h.toInt() >>> 15)\n\n return h.toInt()\n}\n","const DefaultPartitioner = require('./default')\nconst JavaCompatiblePartitioner = require('./defaultJava')\n\nmodule.exports = {\n DefaultPartitioner,\n JavaCompatiblePartitioner,\n}\n","const flatten = require('../utils/flatten')\n\nmodule.exports = ({ topics }) => {\n const partitions = topics.map(({ topicName, partitions }) =>\n partitions.map(partition => ({ topicName, ...partition }))\n )\n\n return flatten(partitions)\n}\n","const flatten = require('../utils/flatten')\nconst { KafkaJSMetadataNotLoaded } = require('../errors')\nconst { staleMetadata } = require('../protocol/error')\nconst groupMessagesPerPartition = require('./groupMessagesPerPartition')\nconst createTopicData = require('./createTopicData')\nconst responseSerializer = require('./responseSerializer')\n\nconst { keys } = Object\n\n/**\n * @param {Object} options\n * @param {import(\"../../types\").Logger} options.logger\n * @param {import(\"../../types\").Cluster} options.cluster\n * @param {ReturnType} options.partitioner\n * @param {import(\"./eosManager\").EosManager} options.eosManager\n * @param {import(\"../retry\").Retrier} options.retrier\n */\nmodule.exports = ({ logger, cluster, partitioner, eosManager, retrier }) => {\n return async ({ acks, timeout, compression, topicMessages }) => {\n /** @type {Map} */\n const responsePerBroker = new Map()\n\n /** @param {Map} responsePerBroker */\n const createProducerRequests = async responsePerBroker => {\n const topicMetadata = new Map()\n\n await cluster.refreshMetadataIfNecessary()\n\n for (const { topic, messages } of topicMessages) {\n const partitionMetadata = cluster.findTopicPartitionMetadata(topic)\n\n if (partitionMetadata.length === 0) {\n logger.debug('Producing to topic without metadata', {\n topic,\n targetTopics: Array.from(cluster.targetTopics),\n })\n\n throw new KafkaJSMetadataNotLoaded('Producing to topic without metadata')\n }\n\n const messagesPerPartition = groupMessagesPerPartition({\n topic,\n partitionMetadata,\n messages,\n partitioner,\n })\n\n const partitions = keys(messagesPerPartition)\n const sequencePerPartition = partitions.reduce((result, partition) => {\n result[partition] = eosManager.getSequence(topic, partition)\n return result\n }, {})\n\n const partitionsPerLeader = cluster.findLeaderForPartitions(topic, partitions)\n const leaders = keys(partitionsPerLeader)\n\n topicMetadata.set(topic, {\n partitionsPerLeader,\n messagesPerPartition,\n sequencePerPartition,\n })\n\n for (const nodeId of leaders) {\n const broker = await cluster.findBroker({ nodeId })\n if (!responsePerBroker.has(broker)) {\n responsePerBroker.set(broker, null)\n }\n }\n }\n\n const brokers = Array.from(responsePerBroker.keys())\n const brokersWithoutResponse = brokers.filter(broker => !responsePerBroker.get(broker))\n\n return brokersWithoutResponse.map(async broker => {\n const entries = Array.from(topicMetadata.entries())\n const topicDataForBroker = entries\n .filter(([_, { partitionsPerLeader }]) => !!partitionsPerLeader[broker.nodeId])\n .map(([topic, { partitionsPerLeader, messagesPerPartition, sequencePerPartition }]) => ({\n topic,\n partitions: partitionsPerLeader[broker.nodeId],\n sequencePerPartition,\n messagesPerPartition,\n }))\n\n const topicData = createTopicData(topicDataForBroker)\n\n try {\n if (eosManager.isTransactional()) {\n await eosManager.addPartitionsToTransaction(topicData)\n }\n\n const response = await broker.produce({\n transactionalId: eosManager.isTransactional()\n ? eosManager.getTransactionalId()\n : undefined,\n producerId: eosManager.getProducerId(),\n producerEpoch: eosManager.getProducerEpoch(),\n acks,\n timeout,\n compression,\n topicData,\n })\n\n const expectResponse = acks !== 0\n const formattedResponse = expectResponse ? responseSerializer(response) : []\n\n formattedResponse.forEach(({ topicName, partition }) => {\n const increment = topicMetadata.get(topicName).messagesPerPartition[partition].length\n\n eosManager.updateSequence(topicName, partition, increment)\n })\n\n responsePerBroker.set(broker, formattedResponse)\n } catch (e) {\n responsePerBroker.delete(broker)\n throw e\n }\n })\n }\n\n return retrier(async (bail, retryCount, retryTime) => {\n const topics = topicMessages.map(({ topic }) => topic)\n await cluster.addMultipleTargetTopics(topics)\n\n try {\n const requests = await createProducerRequests(responsePerBroker)\n await Promise.all(requests)\n const responses = Array.from(responsePerBroker.values())\n return flatten(responses)\n } catch (e) {\n if (e.name === 'KafkaJSConnectionClosedError') {\n cluster.removeBroker({ host: e.host, port: e.port })\n }\n\n if (!cluster.isConnected()) {\n logger.debug(`Cluster has disconnected, reconnecting: ${e.message}`, {\n retryCount,\n retryTime,\n })\n await cluster.connect()\n await cluster.refreshMetadata()\n throw e\n }\n\n // This is necessary in case the metadata is stale and the number of partitions\n // for this topic has increased in the meantime\n if (\n staleMetadata(e) ||\n e.name === 'KafkaJSMetadataNotLoaded' ||\n e.name === 'KafkaJSConnectionError' ||\n e.name === 'KafkaJSConnectionClosedError' ||\n (e.name === 'KafkaJSProtocolError' && e.retriable)\n ) {\n logger.error(`Failed to send messages: ${e.message}`, { retryCount, retryTime })\n await cluster.refreshMetadata()\n throw e\n }\n\n logger.error(`${e.message}`, { retryCount, retryTime })\n if (e.retriable) throw e\n bail(e)\n }\n })\n }\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/acl/AclOperation.java#L44\n\n/**\n * @typedef {number} ACLOperationTypes\n *\n * Enum for ACL Operations Types\n * @readonly\n * @enum {ACLOperationTypes}\n */\nmodule.exports = {\n /**\n * Represents any AclOperation which this client cannot understand, perhaps because this\n * client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any AclOperation.\n */\n ANY: 1,\n /**\n * ALL operation.\n */\n ALL: 2,\n /**\n * READ operation.\n */\n READ: 3,\n /**\n * WRITE operation.\n */\n WRITE: 4,\n /**\n * CREATE operation.\n */\n CREATE: 5,\n /**\n * DELETE operation.\n */\n DELETE: 6,\n /**\n * ALTER operation.\n */\n ALTER: 7,\n /**\n * DESCRIBE operation.\n */\n DESCRIBE: 8,\n /**\n * CLUSTER_ACTION operation.\n */\n CLUSTER_ACTION: 9,\n /**\n * DESCRIBE_CONFIGS operation.\n */\n DESCRIBE_CONFIGS: 10,\n /**\n * ALTER_CONFIGS operation.\n */\n ALTER_CONFIGS: 11,\n /**\n * IDEMPOTENT_WRITE operation.\n */\n IDEMPOTENT_WRITE: 12,\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/acl/AclPermissionType.java/#L31\n\n/**\n * @typedef {number} ACLPermissionTypes\n *\n * Enum for Permission Types\n * @readonly\n * @enum {ACLPermissionTypes}\n */\nmodule.exports = {\n /**\n * Represents any AclPermissionType which this client cannot understand,\n * perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any AclPermissionType.\n */\n ANY: 1,\n /**\n * Disallows access.\n */\n DENY: 2,\n /**\n * Grants access.\n */\n ALLOW: 3,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/a15387f34d142684859c2a57fcbef25edcdce25a/clients/src/main/java/org/apache/kafka/common/resource/ResourceType.java#L25-L31\n * @typedef {number} ACLResourceTypes\n *\n * Enum for ACL Resource Types\n * @readonly\n * @enum {ACLResourceTypes}\n */\n\nmodule.exports = {\n /**\n * Represents any ResourceType which this client cannot understand,\n * perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any ResourceType.\n */\n ANY: 1,\n /**\n * A Kafka topic.\n * @see http://kafka.apache.org/documentation/#topicconfigs\n */\n TOPIC: 2,\n /**\n * A consumer group.\n * @see http://kafka.apache.org/documentation/#consumerconfigs\n */\n GROUP: 3,\n /**\n * The cluster as a whole.\n */\n CLUSTER: 4,\n /**\n * A transactional ID.\n */\n TRANSACTIONAL_ID: 5,\n /**\n * A token ID.\n */\n DELEGATION_TOKEN: 6,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/config/ConfigResource.java\n */\nmodule.exports = {\n UNKNOWN: 0,\n TOPIC: 2,\n BROKER: 4,\n BROKER_LOGGER: 8,\n}\n","/**\n * @see https://github.com/apache/kafka/blob/1f240ce1793cab09e1c4823e17436d2b030df2bc/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java#L115-L122\n */\nmodule.exports = {\n UNKNOWN: 0,\n TOPIC_CONFIG: 1,\n DYNAMIC_BROKER_CONFIG: 2,\n DYNAMIC_DEFAULT_BROKER_CONFIG: 3,\n STATIC_BROKER_CONFIG: 4,\n DEFAULT_CONFIG: 5,\n DYNAMIC_BROKER_LOGGER_CONFIG: 6,\n}\n","// From: https://kafka.apache.org/protocol.html#The_Messages_FindCoordinator\n\n/**\n * @typedef {number} CoordinatorType\n *\n * Enum for the types of coordinator to find.\n * @enum {CoordinatorType}\n */\nmodule.exports = {\n GROUP: 0,\n TRANSACTION: 1,\n}\n","// Based on https://github.com/brianloveswords/buffer-crc32/blob/master/index.js\n\nvar CRC_TABLE = new Int32Array([\n 0x00000000,\n 0x77073096,\n 0xee0e612c,\n 0x990951ba,\n 0x076dc419,\n 0x706af48f,\n 0xe963a535,\n 0x9e6495a3,\n 0x0edb8832,\n 0x79dcb8a4,\n 0xe0d5e91e,\n 0x97d2d988,\n 0x09b64c2b,\n 0x7eb17cbd,\n 0xe7b82d07,\n 0x90bf1d91,\n 0x1db71064,\n 0x6ab020f2,\n 0xf3b97148,\n 0x84be41de,\n 0x1adad47d,\n 0x6ddde4eb,\n 0xf4d4b551,\n 0x83d385c7,\n 0x136c9856,\n 0x646ba8c0,\n 0xfd62f97a,\n 0x8a65c9ec,\n 0x14015c4f,\n 0x63066cd9,\n 0xfa0f3d63,\n 0x8d080df5,\n 0x3b6e20c8,\n 0x4c69105e,\n 0xd56041e4,\n 0xa2677172,\n 0x3c03e4d1,\n 0x4b04d447,\n 0xd20d85fd,\n 0xa50ab56b,\n 0x35b5a8fa,\n 0x42b2986c,\n 0xdbbbc9d6,\n 0xacbcf940,\n 0x32d86ce3,\n 0x45df5c75,\n 0xdcd60dcf,\n 0xabd13d59,\n 0x26d930ac,\n 0x51de003a,\n 0xc8d75180,\n 0xbfd06116,\n 0x21b4f4b5,\n 0x56b3c423,\n 0xcfba9599,\n 0xb8bda50f,\n 0x2802b89e,\n 0x5f058808,\n 0xc60cd9b2,\n 0xb10be924,\n 0x2f6f7c87,\n 0x58684c11,\n 0xc1611dab,\n 0xb6662d3d,\n 0x76dc4190,\n 0x01db7106,\n 0x98d220bc,\n 0xefd5102a,\n 0x71b18589,\n 0x06b6b51f,\n 0x9fbfe4a5,\n 0xe8b8d433,\n 0x7807c9a2,\n 0x0f00f934,\n 0x9609a88e,\n 0xe10e9818,\n 0x7f6a0dbb,\n 0x086d3d2d,\n 0x91646c97,\n 0xe6635c01,\n 0x6b6b51f4,\n 0x1c6c6162,\n 0x856530d8,\n 0xf262004e,\n 0x6c0695ed,\n 0x1b01a57b,\n 0x8208f4c1,\n 0xf50fc457,\n 0x65b0d9c6,\n 0x12b7e950,\n 0x8bbeb8ea,\n 0xfcb9887c,\n 0x62dd1ddf,\n 0x15da2d49,\n 0x8cd37cf3,\n 0xfbd44c65,\n 0x4db26158,\n 0x3ab551ce,\n 0xa3bc0074,\n 0xd4bb30e2,\n 0x4adfa541,\n 0x3dd895d7,\n 0xa4d1c46d,\n 0xd3d6f4fb,\n 0x4369e96a,\n 0x346ed9fc,\n 0xad678846,\n 0xda60b8d0,\n 0x44042d73,\n 0x33031de5,\n 0xaa0a4c5f,\n 0xdd0d7cc9,\n 0x5005713c,\n 0x270241aa,\n 0xbe0b1010,\n 0xc90c2086,\n 0x5768b525,\n 0x206f85b3,\n 0xb966d409,\n 0xce61e49f,\n 0x5edef90e,\n 0x29d9c998,\n 0xb0d09822,\n 0xc7d7a8b4,\n 0x59b33d17,\n 0x2eb40d81,\n 0xb7bd5c3b,\n 0xc0ba6cad,\n 0xedb88320,\n 0x9abfb3b6,\n 0x03b6e20c,\n 0x74b1d29a,\n 0xead54739,\n 0x9dd277af,\n 0x04db2615,\n 0x73dc1683,\n 0xe3630b12,\n 0x94643b84,\n 0x0d6d6a3e,\n 0x7a6a5aa8,\n 0xe40ecf0b,\n 0x9309ff9d,\n 0x0a00ae27,\n 0x7d079eb1,\n 0xf00f9344,\n 0x8708a3d2,\n 0x1e01f268,\n 0x6906c2fe,\n 0xf762575d,\n 0x806567cb,\n 0x196c3671,\n 0x6e6b06e7,\n 0xfed41b76,\n 0x89d32be0,\n 0x10da7a5a,\n 0x67dd4acc,\n 0xf9b9df6f,\n 0x8ebeeff9,\n 0x17b7be43,\n 0x60b08ed5,\n 0xd6d6a3e8,\n 0xa1d1937e,\n 0x38d8c2c4,\n 0x4fdff252,\n 0xd1bb67f1,\n 0xa6bc5767,\n 0x3fb506dd,\n 0x48b2364b,\n 0xd80d2bda,\n 0xaf0a1b4c,\n 0x36034af6,\n 0x41047a60,\n 0xdf60efc3,\n 0xa867df55,\n 0x316e8eef,\n 0x4669be79,\n 0xcb61b38c,\n 0xbc66831a,\n 0x256fd2a0,\n 0x5268e236,\n 0xcc0c7795,\n 0xbb0b4703,\n 0x220216b9,\n 0x5505262f,\n 0xc5ba3bbe,\n 0xb2bd0b28,\n 0x2bb45a92,\n 0x5cb36a04,\n 0xc2d7ffa7,\n 0xb5d0cf31,\n 0x2cd99e8b,\n 0x5bdeae1d,\n 0x9b64c2b0,\n 0xec63f226,\n 0x756aa39c,\n 0x026d930a,\n 0x9c0906a9,\n 0xeb0e363f,\n 0x72076785,\n 0x05005713,\n 0x95bf4a82,\n 0xe2b87a14,\n 0x7bb12bae,\n 0x0cb61b38,\n 0x92d28e9b,\n 0xe5d5be0d,\n 0x7cdcefb7,\n 0x0bdbdf21,\n 0x86d3d2d4,\n 0xf1d4e242,\n 0x68ddb3f8,\n 0x1fda836e,\n 0x81be16cd,\n 0xf6b9265b,\n 0x6fb077e1,\n 0x18b74777,\n 0x88085ae6,\n 0xff0f6a70,\n 0x66063bca,\n 0x11010b5c,\n 0x8f659eff,\n 0xf862ae69,\n 0x616bffd3,\n 0x166ccf45,\n 0xa00ae278,\n 0xd70dd2ee,\n 0x4e048354,\n 0x3903b3c2,\n 0xa7672661,\n 0xd06016f7,\n 0x4969474d,\n 0x3e6e77db,\n 0xaed16a4a,\n 0xd9d65adc,\n 0x40df0b66,\n 0x37d83bf0,\n 0xa9bcae53,\n 0xdebb9ec5,\n 0x47b2cf7f,\n 0x30b5ffe9,\n 0xbdbdf21c,\n 0xcabac28a,\n 0x53b39330,\n 0x24b4a3a6,\n 0xbad03605,\n 0xcdd70693,\n 0x54de5729,\n 0x23d967bf,\n 0xb3667a2e,\n 0xc4614ab8,\n 0x5d681b02,\n 0x2a6f2b94,\n 0xb40bbe37,\n 0xc30c8ea1,\n 0x5a05df1b,\n 0x2d02ef8d,\n])\n\nmodule.exports = encoder => {\n const { buffer } = encoder\n const l = buffer.length\n let crc = -1\n for (let n = 0; n < l; n++) {\n crc = CRC_TABLE[(crc ^ buffer[n]) & 0xff] ^ (crc >>> 8)\n }\n return crc ^ -1\n}\n","const { KafkaJSInvalidVarIntError, KafkaJSInvalidLongError } = require('../errors')\nconst Long = require('../utils/long')\n\nconst INT8_SIZE = 1\nconst INT16_SIZE = 2\nconst INT32_SIZE = 4\nconst INT64_SIZE = 8\nconst DOUBLE_SIZE = 8\n\nconst MOST_SIGNIFICANT_BIT = 0x80 // 128\nconst OTHER_BITS = 0x7f // 127\n\nmodule.exports = class Decoder {\n static int32Size() {\n return INT32_SIZE\n }\n\n static decodeZigZag(value) {\n return (value >>> 1) ^ -(value & 1)\n }\n\n static decodeZigZag64(longValue) {\n return longValue.shiftRightUnsigned(1).xor(longValue.and(Long.fromInt(1)).negate())\n }\n\n constructor(buffer) {\n this.buffer = buffer\n this.offset = 0\n }\n\n readInt8() {\n const value = this.buffer.readInt8(this.offset)\n this.offset += INT8_SIZE\n return value\n }\n\n canReadInt16() {\n return this.canReadBytes(INT16_SIZE)\n }\n\n readInt16() {\n const value = this.buffer.readInt16BE(this.offset)\n this.offset += INT16_SIZE\n return value\n }\n\n canReadInt32() {\n return this.canReadBytes(INT32_SIZE)\n }\n\n readInt32() {\n const value = this.buffer.readInt32BE(this.offset)\n this.offset += INT32_SIZE\n return value\n }\n\n canReadInt64() {\n return this.canReadBytes(INT64_SIZE)\n }\n\n readInt64() {\n const first = this.buffer[this.offset]\n const last = this.buffer[this.offset + 7]\n\n const low =\n (first << 24) + // Overflow\n this.buffer[this.offset + 1] * 2 ** 16 +\n this.buffer[this.offset + 2] * 2 ** 8 +\n this.buffer[this.offset + 3]\n const high =\n this.buffer[this.offset + 4] * 2 ** 24 +\n this.buffer[this.offset + 5] * 2 ** 16 +\n this.buffer[this.offset + 6] * 2 ** 8 +\n last\n this.offset += INT64_SIZE\n\n return (BigInt(low) << 32n) + BigInt(high)\n }\n\n readDouble() {\n const value = this.buffer.readDoubleBE(this.offset)\n this.offset += DOUBLE_SIZE\n return value\n }\n\n readString() {\n const byteLength = this.readInt16()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n readVarIntString() {\n const byteLength = this.readVarInt()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n readUVarIntString() {\n const byteLength = this.readUVarInt()\n\n if (byteLength === 0) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n const value = stringBuffer.toString('utf8')\n this.offset += byteLength\n return value\n }\n\n canReadBytes(length) {\n return Buffer.byteLength(this.buffer) - this.offset >= length\n }\n\n readBytes(byteLength = this.readInt32()) {\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readVarIntBytes() {\n const byteLength = this.readVarInt()\n\n if (byteLength === -1) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readUVarIntBytes() {\n const byteLength = this.readUVarInt()\n\n if (byteLength === 0) {\n return null\n }\n\n const stringBuffer = this.buffer.slice(this.offset, this.offset + byteLength)\n this.offset += byteLength\n return stringBuffer\n }\n\n readBoolean() {\n return this.readInt8() === 1\n }\n\n readAll() {\n const result = this.buffer.slice(this.offset)\n this.offset += Buffer.byteLength(this.buffer)\n return result\n }\n\n readArray(reader) {\n const length = this.readInt32()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n readVarIntArray(reader) {\n const length = this.readVarInt()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n readUVarIntArray(reader) {\n const length = this.readUVarInt()\n\n if (length === 0) {\n return []\n }\n\n const array = new Array(length - 1)\n for (let i = 0; i < length - 1; i++) {\n array[i] = reader(this)\n }\n\n return array\n }\n\n async readArrayAsync(reader) {\n const length = this.readInt32()\n\n if (length === -1) {\n return []\n }\n\n const array = new Array(length)\n for (let i = 0; i < length; i++) {\n array[i] = await reader(this)\n }\n\n return array\n }\n\n readVarInt() {\n let currentByte\n let result = 0\n let i = 0\n\n do {\n currentByte = this.buffer[this.offset++]\n result += (currentByte & OTHER_BITS) << i\n i += 7\n } while (currentByte >= MOST_SIGNIFICANT_BIT)\n\n return Decoder.decodeZigZag(result)\n }\n\n // By default JavaScript's numbers are of type float64, performing bitwise operations converts the numbers to a signed 32-bit integer\n // Unsigned Right Shift Operator >>> ensures the returned value is an unsigned 32-bit integer\n readUVarInt() {\n let currentByte\n let result = 0\n let i = 0\n while (((currentByte = this.buffer[this.offset++]) & MOST_SIGNIFICANT_BIT) !== 0) {\n result |= (currentByte & OTHER_BITS) << i\n i += 7\n if (i > 28) {\n throw new KafkaJSInvalidVarIntError('Invalid VarInt, must contain 5 bytes or less')\n }\n }\n result |= currentByte << i\n return result >>> 0\n }\n\n readVarLong() {\n let currentByte\n let result = Long.fromInt(0)\n let i = 0\n\n do {\n if (i > 63) {\n throw new KafkaJSInvalidLongError('Invalid Long, must contain 9 bytes or less')\n }\n currentByte = this.buffer[this.offset++]\n result = result.add(Long.fromInt(currentByte & OTHER_BITS).shiftLeft(i))\n i += 7\n } while (currentByte >= MOST_SIGNIFICANT_BIT)\n\n return Decoder.decodeZigZag64(result)\n }\n\n slice(size) {\n return new Decoder(this.buffer.slice(this.offset, this.offset + size))\n }\n\n forward(size) {\n this.offset += size\n }\n}\n","const Long = require('../utils/long')\n\nconst INT8_SIZE = 1\nconst INT16_SIZE = 2\nconst INT32_SIZE = 4\nconst INT64_SIZE = 8\nconst DOUBLE_SIZE = 8\n\nconst MOST_SIGNIFICANT_BIT = 0x80 // 128\nconst OTHER_BITS = 0x7f // 127\nconst UNSIGNED_INT32_MAX_NUMBER = 0xffffff80\nconst UNSIGNED_INT64_MAX_NUMBER = 0xffffffffffffff80n\n\nmodule.exports = class Encoder {\n static encodeZigZag(value) {\n return (value << 1) ^ (value >> 31)\n }\n\n static encodeZigZag64(value) {\n const longValue = Long.fromValue(value)\n return longValue.shiftLeft(1).xor(longValue.shiftRight(63))\n }\n\n static sizeOfVarInt(value) {\n let encodedValue = this.encodeZigZag(value)\n let bytes = 1\n\n while ((encodedValue & UNSIGNED_INT32_MAX_NUMBER) !== 0) {\n bytes += 1\n encodedValue >>>= 7\n }\n\n return bytes\n }\n\n static sizeOfVarLong(value) {\n let longValue = Encoder.encodeZigZag64(value)\n let bytes = 1\n\n while (longValue.and(UNSIGNED_INT64_MAX_NUMBER).notEquals(Long.fromInt(0))) {\n bytes += 1\n longValue = longValue.shiftRightUnsigned(7)\n }\n\n return bytes\n }\n\n static sizeOfVarIntBytes(value) {\n const size = value == null ? -1 : Buffer.byteLength(value)\n\n if (size < 0) {\n return Encoder.sizeOfVarInt(-1)\n }\n\n return Encoder.sizeOfVarInt(size) + size\n }\n\n static nextPowerOfTwo(value) {\n return 1 << (31 - Math.clz32(value) + 1)\n }\n\n /**\n * Construct a new encoder with the given initial size\n *\n * @param {number} [initialSize] initial size\n */\n constructor(initialSize = 511) {\n this.buf = Buffer.alloc(Encoder.nextPowerOfTwo(initialSize))\n this.offset = 0\n }\n\n /**\n * @param {Buffer} buffer\n */\n writeBufferInternal(buffer) {\n const bufferLength = buffer.length\n this.ensureAvailable(bufferLength)\n buffer.copy(this.buf, this.offset, 0)\n this.offset += bufferLength\n }\n\n ensureAvailable(length) {\n if (this.offset + length > this.buf.length) {\n const newLength = Encoder.nextPowerOfTwo(this.offset + length)\n const newBuffer = Buffer.alloc(newLength)\n this.buf.copy(newBuffer, 0, 0, this.offset)\n this.buf = newBuffer\n }\n }\n\n get buffer() {\n return this.buf.slice(0, this.offset)\n }\n\n writeInt8(value) {\n this.ensureAvailable(INT8_SIZE)\n this.buf.writeInt8(value, this.offset)\n this.offset += INT8_SIZE\n return this\n }\n\n writeInt16(value) {\n this.ensureAvailable(INT16_SIZE)\n this.buf.writeInt16BE(value, this.offset)\n this.offset += INT16_SIZE\n return this\n }\n\n writeInt32(value) {\n this.ensureAvailable(INT32_SIZE)\n this.buf.writeInt32BE(value, this.offset)\n this.offset += INT32_SIZE\n return this\n }\n\n writeUInt32(value) {\n this.ensureAvailable(INT32_SIZE)\n this.buf.writeUInt32BE(value, this.offset)\n this.offset += INT32_SIZE\n return this\n }\n\n writeInt64(value) {\n this.ensureAvailable(INT64_SIZE)\n const longValue = Long.fromValue(value)\n this.buf.writeInt32BE(longValue.getHighBits(), this.offset)\n this.buf.writeInt32BE(longValue.getLowBits(), this.offset + INT32_SIZE)\n this.offset += INT64_SIZE\n return this\n }\n\n writeDouble(value) {\n this.ensureAvailable(DOUBLE_SIZE)\n this.buf.writeDoubleBE(value, this.offset)\n this.offset += DOUBLE_SIZE\n return this\n }\n\n writeBoolean(value) {\n value ? this.writeInt8(1) : this.writeInt8(0)\n return this\n }\n\n writeString(value) {\n if (value == null) {\n this.writeInt16(-1)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.ensureAvailable(INT16_SIZE + byteLength)\n this.writeInt16(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeVarIntString(value) {\n if (value == null) {\n this.writeVarInt(-1)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.writeVarInt(byteLength)\n this.ensureAvailable(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeUVarIntString(value) {\n if (value == null) {\n this.writeUVarInt(0)\n return this\n }\n\n const byteLength = Buffer.byteLength(value, 'utf8')\n this.writeUVarInt(byteLength + 1)\n this.ensureAvailable(byteLength)\n this.buf.write(value, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n return this\n }\n\n writeBytes(value) {\n if (value == null) {\n this.writeInt32(-1)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.ensureAvailable(INT32_SIZE + value.length)\n this.writeInt32(value.length)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.ensureAvailable(INT32_SIZE + byteLength)\n this.writeInt32(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeVarIntBytes(value) {\n if (value == null) {\n this.writeVarInt(-1)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.writeVarInt(value.length)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.writeVarInt(byteLength)\n this.ensureAvailable(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeUVarIntBytes(value) {\n if (value == null) {\n this.writeVarInt(0)\n return this\n }\n\n if (Buffer.isBuffer(value)) {\n // raw bytes\n this.writeUVarInt(value.length + 1)\n this.writeBufferInternal(value)\n } else {\n const valueToWrite = String(value)\n const byteLength = Buffer.byteLength(valueToWrite, 'utf8')\n this.writeUVarInt(byteLength + 1)\n this.ensureAvailable(byteLength)\n this.buf.write(valueToWrite, this.offset, byteLength, 'utf8')\n this.offset += byteLength\n }\n\n return this\n }\n\n writeEncoder(value) {\n if (value == null || !Buffer.isBuffer(value.buf)) {\n throw new Error('value should be an instance of Encoder')\n }\n\n this.writeBufferInternal(value.buffer)\n return this\n }\n\n writeEncoderArray(value) {\n if (!Array.isArray(value) || value.some(v => v == null || !Buffer.isBuffer(v.buf))) {\n throw new Error('all values should be an instance of Encoder[]')\n }\n\n value.forEach(v => {\n this.writeBufferInternal(v.buffer)\n })\n return this\n }\n\n writeBuffer(value) {\n if (!Buffer.isBuffer(value)) {\n throw new Error('value should be an instance of Buffer')\n }\n\n this.writeBufferInternal(value)\n return this\n }\n\n /**\n * @param {any[]} array\n * @param {'int32'|'number'|'string'|'object'} [type]\n */\n writeNullableArray(array, type) {\n // A null value is encoded with length of -1 and there are no following bytes\n // On the context of this library, empty array and null are the same thing\n const length = array.length !== 0 ? array.length : -1\n this.writeArray(array, type, length)\n return this\n }\n\n /**\n * @param {any[]} array\n * @param {'int32'|'number'|'string'|'object'} [type]\n * @param {number} [length]\n */\n writeArray(array, type, length) {\n const arrayLength = length == null ? array.length : length\n this.writeInt32(arrayLength)\n if (type !== undefined) {\n switch (type) {\n case 'int32':\n case 'number':\n array.forEach(value => this.writeInt32(value))\n break\n case 'string':\n array.forEach(value => this.writeString(value))\n break\n case 'object':\n this.writeEncoderArray(array)\n break\n }\n } else {\n array.forEach(value => {\n switch (typeof value) {\n case 'number':\n this.writeInt32(value)\n break\n case 'string':\n this.writeString(value)\n break\n case 'object':\n this.writeEncoder(value)\n break\n }\n })\n }\n return this\n }\n\n writeVarIntArray(array, type) {\n if (type === 'object') {\n this.writeVarInt(array.length)\n this.writeEncoderArray(array)\n } else {\n const objectArray = array.filter(v => typeof v === 'object')\n this.writeVarInt(objectArray.length)\n this.writeEncoderArray(objectArray)\n }\n return this\n }\n\n writeUVarIntArray(array, type) {\n if (type === 'object') {\n this.writeUVarInt(array.length + 1)\n this.writeEncoderArray(array)\n } else {\n const objectArray = array.filter(v => typeof v === 'object')\n this.writeUVarInt(objectArray.length + 1)\n this.writeEncoderArray(objectArray)\n }\n return this\n }\n\n // Based on:\n // https://en.wikipedia.org/wiki/LEB128 Using LEB128 format similar to VLQ.\n // https://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/util/Varint.java#L106\n writeVarInt(value) {\n return this.writeUVarInt(Encoder.encodeZigZag(value))\n }\n\n writeUVarInt(value) {\n const byteArray = []\n while ((value & UNSIGNED_INT32_MAX_NUMBER) !== 0) {\n byteArray.push((value & OTHER_BITS) | MOST_SIGNIFICANT_BIT)\n value >>>= 7\n }\n byteArray.push(value & OTHER_BITS)\n this.writeBufferInternal(Buffer.from(byteArray))\n return this\n }\n\n writeVarLong(value) {\n const byteArray = []\n let longValue = Encoder.encodeZigZag64(value)\n\n while (longValue.and(UNSIGNED_INT64_MAX_NUMBER).notEquals(Long.fromInt(0))) {\n byteArray.push(\n longValue\n .and(OTHER_BITS)\n .or(MOST_SIGNIFICANT_BIT)\n .toInt()\n )\n longValue = longValue.shiftRightUnsigned(7)\n }\n\n byteArray.push(longValue.toInt())\n\n this.writeBufferInternal(Buffer.from(byteArray))\n return this\n }\n\n size() {\n // We can use the offset here directly, because we anyways will not re-encode the buffer when writing\n return this.offset\n }\n\n toJSON() {\n return this.buffer.toJSON()\n }\n}\n","const { KafkaJSProtocolError } = require('../errors')\nconst websiteUrl = require('../utils/websiteUrl')\n\nconst errorCodes = [\n {\n type: 'UNKNOWN',\n code: -1,\n retriable: false,\n message: 'The server experienced an unexpected error when processing the request',\n },\n {\n type: 'OFFSET_OUT_OF_RANGE',\n code: 1,\n retriable: false,\n message: 'The requested offset is not within the range of offsets maintained by the server',\n },\n {\n type: 'CORRUPT_MESSAGE',\n code: 2,\n retriable: true,\n message:\n 'This message has failed its CRC checksum, exceeds the valid size, or is otherwise corrupt',\n },\n {\n type: 'UNKNOWN_TOPIC_OR_PARTITION',\n code: 3,\n retriable: true,\n message: 'This server does not host this topic-partition',\n },\n {\n type: 'INVALID_FETCH_SIZE',\n code: 4,\n retriable: false,\n message: 'The requested fetch size is invalid',\n },\n {\n type: 'LEADER_NOT_AVAILABLE',\n code: 5,\n retriable: true,\n message:\n 'There is no leader for this topic-partition as we are in the middle of a leadership election',\n },\n {\n type: 'NOT_LEADER_FOR_PARTITION',\n code: 6,\n retriable: true,\n message: 'This server is not the leader for that topic-partition',\n },\n {\n type: 'REQUEST_TIMED_OUT',\n code: 7,\n retriable: true,\n message: 'The request timed out',\n },\n {\n type: 'BROKER_NOT_AVAILABLE',\n code: 8,\n retriable: false,\n message: 'The broker is not available',\n },\n {\n type: 'REPLICA_NOT_AVAILABLE',\n code: 9,\n retriable: false,\n message: 'The replica is not available for the requested topic-partition',\n },\n {\n type: 'MESSAGE_TOO_LARGE',\n code: 10,\n retriable: false,\n message:\n 'The request included a message larger than the max message size the server will accept',\n },\n {\n type: 'STALE_CONTROLLER_EPOCH',\n code: 11,\n retriable: false,\n message: 'The controller moved to another broker',\n },\n {\n type: 'OFFSET_METADATA_TOO_LARGE',\n code: 12,\n retriable: false,\n message: 'The metadata field of the offset request was too large',\n },\n {\n type: 'NETWORK_EXCEPTION',\n code: 13,\n retriable: true,\n message: 'The server disconnected before a response was received',\n },\n {\n type: 'GROUP_LOAD_IN_PROGRESS',\n code: 14,\n retriable: true,\n message: \"The coordinator is loading and hence can't process requests for this group\",\n },\n {\n type: 'GROUP_COORDINATOR_NOT_AVAILABLE',\n code: 15,\n retriable: true,\n message: 'The group coordinator is not available',\n },\n {\n type: 'NOT_COORDINATOR_FOR_GROUP',\n code: 16,\n retriable: true,\n message: 'This is not the correct coordinator for this group',\n },\n {\n type: 'INVALID_TOPIC_EXCEPTION',\n code: 17,\n retriable: false,\n message: 'The request attempted to perform an operation on an invalid topic',\n },\n {\n type: 'RECORD_LIST_TOO_LARGE',\n code: 18,\n retriable: false,\n message:\n 'The request included message batch larger than the configured segment size on the server',\n },\n {\n type: 'NOT_ENOUGH_REPLICAS',\n code: 19,\n retriable: true,\n message: 'Messages are rejected since there are fewer in-sync replicas than required',\n },\n {\n type: 'NOT_ENOUGH_REPLICAS_AFTER_APPEND',\n code: 20,\n retriable: true,\n message: 'Messages are written to the log, but to fewer in-sync replicas than required',\n },\n {\n type: 'INVALID_REQUIRED_ACKS',\n code: 21,\n retriable: false,\n message: 'Produce request specified an invalid value for required acks',\n },\n {\n type: 'ILLEGAL_GENERATION',\n code: 22,\n retriable: false,\n message: 'Specified group generation id is not valid',\n },\n {\n type: 'INCONSISTENT_GROUP_PROTOCOL',\n code: 23,\n retriable: false,\n message:\n \"The group member's supported protocols are incompatible with those of existing members\",\n },\n {\n type: 'INVALID_GROUP_ID',\n code: 24,\n retriable: false,\n message: 'The configured groupId is invalid',\n },\n {\n type: 'UNKNOWN_MEMBER_ID',\n code: 25,\n retriable: false,\n message: 'The coordinator is not aware of this member',\n },\n {\n type: 'INVALID_SESSION_TIMEOUT',\n code: 26,\n retriable: false,\n message:\n 'The session timeout is not within the range allowed by the broker (as configured by group.min.session.timeout.ms and group.max.session.timeout.ms)',\n },\n {\n type: 'REBALANCE_IN_PROGRESS',\n code: 27,\n retriable: false,\n message: 'The group is rebalancing, so a rejoin is needed',\n helpUrl: websiteUrl('docs/faq', 'what-does-it-mean-to-get-rebalance-in-progress-errors'),\n },\n {\n type: 'INVALID_COMMIT_OFFSET_SIZE',\n code: 28,\n retriable: false,\n message: 'The committing offset data size is not valid',\n },\n {\n type: 'TOPIC_AUTHORIZATION_FAILED',\n code: 29,\n retriable: false,\n message: 'Not authorized to access topics: [Topic authorization failed]',\n },\n {\n type: 'GROUP_AUTHORIZATION_FAILED',\n code: 30,\n retriable: false,\n message: 'Not authorized to access group: Group authorization failed',\n },\n {\n type: 'CLUSTER_AUTHORIZATION_FAILED',\n code: 31,\n retriable: false,\n message: 'Cluster authorization failed',\n },\n {\n type: 'INVALID_TIMESTAMP',\n code: 32,\n retriable: false,\n message: 'The timestamp of the message is out of acceptable range',\n },\n {\n type: 'UNSUPPORTED_SASL_MECHANISM',\n code: 33,\n retriable: false,\n message: 'The broker does not support the requested SASL mechanism',\n },\n {\n type: 'ILLEGAL_SASL_STATE',\n code: 34,\n retriable: false,\n message: 'Request is not valid given the current SASL state',\n },\n {\n type: 'UNSUPPORTED_VERSION',\n code: 35,\n retriable: false,\n message: 'The version of API is not supported',\n },\n {\n type: 'TOPIC_ALREADY_EXISTS',\n code: 36,\n retriable: false,\n message: 'Topic with this name already exists',\n },\n {\n type: 'INVALID_PARTITIONS',\n code: 37,\n retriable: false,\n message: 'Number of partitions is invalid',\n },\n {\n type: 'INVALID_REPLICATION_FACTOR',\n code: 38,\n retriable: false,\n message: 'Replication-factor is invalid',\n },\n {\n type: 'INVALID_REPLICA_ASSIGNMENT',\n code: 39,\n retriable: false,\n message: 'Replica assignment is invalid',\n },\n {\n type: 'INVALID_CONFIG',\n code: 40,\n retriable: false,\n message: 'Configuration is invalid',\n },\n {\n type: 'NOT_CONTROLLER',\n code: 41,\n retriable: true,\n message: 'This is not the correct controller for this cluster',\n },\n {\n type: 'INVALID_REQUEST',\n code: 42,\n retriable: false,\n message:\n 'This most likely occurs because of a request being malformed by the client library or the message was sent to an incompatible broker. See the broker logs for more details',\n },\n {\n type: 'UNSUPPORTED_FOR_MESSAGE_FORMAT',\n code: 43,\n retriable: false,\n message: 'The message format version on the broker does not support the request',\n },\n {\n type: 'POLICY_VIOLATION',\n code: 44,\n retriable: false,\n message: 'Request parameters do not satisfy the configured policy',\n },\n {\n type: 'OUT_OF_ORDER_SEQUENCE_NUMBER',\n code: 45,\n retriable: false,\n message: 'The broker received an out of order sequence number',\n },\n {\n type: 'DUPLICATE_SEQUENCE_NUMBER',\n code: 46,\n retriable: false,\n message: 'The broker received a duplicate sequence number',\n },\n {\n type: 'INVALID_PRODUCER_EPOCH',\n code: 47,\n retriable: false,\n message:\n \"Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker\",\n },\n {\n type: 'INVALID_TXN_STATE',\n code: 48,\n retriable: false,\n message: 'The producer attempted a transactional operation in an invalid state',\n },\n {\n type: 'INVALID_PRODUCER_ID_MAPPING',\n code: 49,\n retriable: false,\n message:\n 'The producer attempted to use a producer id which is not currently assigned to its transactional id',\n },\n {\n type: 'INVALID_TRANSACTION_TIMEOUT',\n code: 50,\n retriable: false,\n message:\n 'The transaction timeout is larger than the maximum value allowed by the broker (as configured by max.transaction.timeout.ms)',\n },\n {\n type: 'CONCURRENT_TRANSACTIONS',\n code: 51,\n /**\n * The concurrent transactions error has \"retriable\" set to false on the protocol documentation (https://kafka.apache.org/protocol.html#protocol_error_codes)\n * but the server expects the clients to retry. PR #223\n * @see https://github.com/apache/kafka/blob/12f310d50e7f5b1c18c4f61a119a6cd830da3bc0/core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala#L153\n */\n retriable: true,\n message:\n 'The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing',\n },\n {\n type: 'TRANSACTION_COORDINATOR_FENCED',\n code: 52,\n retriable: false,\n message:\n 'Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer',\n },\n {\n type: 'TRANSACTIONAL_ID_AUTHORIZATION_FAILED',\n code: 53,\n retriable: false,\n message: 'Transactional Id authorization failed',\n },\n {\n type: 'SECURITY_DISABLED',\n code: 54,\n retriable: false,\n message: 'Security features are disabled',\n },\n {\n type: 'OPERATION_NOT_ATTEMPTED',\n code: 55,\n retriable: false,\n message:\n 'The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest',\n },\n {\n type: 'KAFKA_STORAGE_ERROR',\n code: 56,\n retriable: true,\n message: 'Disk error when trying to access log file on the disk',\n },\n {\n type: 'LOG_DIR_NOT_FOUND',\n code: 57,\n retriable: false,\n message: 'The user-specified log directory is not found in the broker config',\n },\n {\n type: 'SASL_AUTHENTICATION_FAILED',\n code: 58,\n retriable: false,\n message: 'SASL Authentication failed',\n helpUrl: websiteUrl('docs/configuration', 'sasl'),\n },\n {\n type: 'UNKNOWN_PRODUCER_ID',\n code: 59,\n retriable: false,\n message:\n \"This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer's records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer's metadata is removed from the broker, and future appends by the producer will return this exception\",\n },\n {\n type: 'REASSIGNMENT_IN_PROGRESS',\n code: 60,\n retriable: false,\n message: 'A partition reassignment is in progress',\n },\n {\n type: 'DELEGATION_TOKEN_AUTH_DISABLED',\n code: 61,\n retriable: false,\n message: 'Delegation Token feature is not enabled',\n },\n {\n type: 'DELEGATION_TOKEN_NOT_FOUND',\n code: 62,\n retriable: false,\n message: 'Delegation Token is not found on server',\n },\n {\n type: 'DELEGATION_TOKEN_OWNER_MISMATCH',\n code: 63,\n retriable: false,\n message: 'Specified Principal is not valid Owner/Renewer',\n },\n {\n type: 'DELEGATION_TOKEN_REQUEST_NOT_ALLOWED',\n code: 64,\n retriable: false,\n message:\n 'Delegation Token requests are not allowed on PLAINTEXT/1-way SSL channels and on delegation token authenticated channels',\n },\n {\n type: 'DELEGATION_TOKEN_AUTHORIZATION_FAILED',\n code: 65,\n retriable: false,\n message: 'Delegation Token authorization failed',\n },\n {\n type: 'DELEGATION_TOKEN_EXPIRED',\n code: 66,\n retriable: false,\n message: 'Delegation Token is expired',\n },\n {\n type: 'INVALID_PRINCIPAL_TYPE',\n code: 67,\n retriable: false,\n message: 'Supplied principalType is not supported',\n },\n {\n type: 'NON_EMPTY_GROUP',\n code: 68,\n retriable: false,\n message: 'The group is not empty',\n },\n {\n type: 'GROUP_ID_NOT_FOUND',\n code: 69,\n retriable: false,\n message: 'The group id was not found',\n },\n {\n type: 'FETCH_SESSION_ID_NOT_FOUND',\n code: 70,\n retriable: true,\n message: 'The fetch session ID was not found',\n },\n {\n type: 'INVALID_FETCH_SESSION_EPOCH',\n code: 71,\n retriable: true,\n message: 'The fetch session epoch is invalid',\n },\n {\n type: 'LISTENER_NOT_FOUND',\n code: 72,\n retriable: true,\n message:\n 'There is no listener on the leader broker that matches the listener on which metadata request was processed',\n },\n {\n type: 'TOPIC_DELETION_DISABLED',\n code: 73,\n retriable: false,\n message: 'Topic deletion is disabled',\n },\n {\n type: 'FENCED_LEADER_EPOCH',\n code: 74,\n retriable: true,\n message: 'The leader epoch in the request is older than the epoch on the broker',\n },\n {\n type: 'UNKNOWN_LEADER_EPOCH',\n code: 75,\n retriable: true,\n message: 'The leader epoch in the request is newer than the epoch on the broker',\n },\n {\n type: 'UNSUPPORTED_COMPRESSION_TYPE',\n code: 76,\n retriable: false,\n message: 'The requesting client does not support the compression type of given partition',\n },\n {\n type: 'STALE_BROKER_EPOCH',\n code: 77,\n retriable: false,\n message: 'Broker epoch has changed',\n },\n {\n type: 'OFFSET_NOT_AVAILABLE',\n code: 78,\n retriable: true,\n message:\n 'The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing',\n },\n {\n type: 'MEMBER_ID_REQUIRED',\n code: 79,\n retriable: false,\n message:\n 'The group member needs to have a valid member id before actually entering a consumer group',\n },\n {\n type: 'PREFERRED_LEADER_NOT_AVAILABLE',\n code: 80,\n retriable: true,\n message: 'The preferred leader was not available',\n },\n {\n type: 'GROUP_MAX_SIZE_REACHED',\n code: 81,\n retriable: false,\n message:\n 'The consumer group has reached its max size. It already has the configured maximum number of members',\n },\n {\n type: 'FENCED_INSTANCE_ID',\n code: 82,\n retriable: false,\n message:\n 'The broker rejected this static consumer since another consumer with the same group instance id has registered with a different member id',\n },\n {\n type: 'ELIGIBLE_LEADERS_NOT_AVAILABLE',\n code: 83,\n retriable: true,\n message: 'Eligible topic partition leaders are not available',\n },\n {\n type: 'ELECTION_NOT_NEEDED',\n code: 84,\n retriable: true,\n message: 'Leader election not needed for topic partition',\n },\n {\n type: 'NO_REASSIGNMENT_IN_PROGRESS',\n code: 85,\n retriable: false,\n message: 'No partition reassignment is in progress',\n },\n {\n type: 'GROUP_SUBSCRIBED_TO_TOPIC',\n code: 86,\n retriable: false,\n message:\n 'Deleting offsets of a topic is forbidden while the consumer group is actively subscribed to it',\n },\n {\n type: 'INVALID_RECORD',\n code: 87,\n retriable: false,\n message: 'This record has failed the validation on broker and hence be rejected',\n },\n {\n type: 'UNSTABLE_OFFSET_COMMIT',\n code: 88,\n retriable: true,\n message: 'There are unstable offsets that need to be cleared',\n },\n]\n\nconst unknownErrorCode = errorCode => ({\n type: 'KAFKAJS_UNKNOWN_ERROR_CODE',\n code: -99,\n retriable: false,\n message: `Unknown error code ${errorCode}`,\n})\n\nconst SUCCESS_CODE = 0\nconst UNSUPPORTED_VERSION_CODE = 35\n\nconst failure = code => code !== SUCCESS_CODE\nconst createErrorFromCode = code => {\n return new KafkaJSProtocolError(errorCodes.find(e => e.code === code) || unknownErrorCode(code))\n}\n\nconst failIfVersionNotSupported = code => {\n if (code === UNSUPPORTED_VERSION_CODE) {\n throw createErrorFromCode(UNSUPPORTED_VERSION_CODE)\n }\n}\n\nconst staleMetadata = e =>\n ['UNKNOWN_TOPIC_OR_PARTITION', 'LEADER_NOT_AVAILABLE', 'NOT_LEADER_FOR_PARTITION'].includes(\n e.type\n )\n\nmodule.exports = {\n failure,\n errorCodes,\n createErrorFromCode,\n failIfVersionNotSupported,\n staleMetadata,\n}\n","/**\n * Enum for isolation levels\n * @readonly\n * @enum {number}\n */\nmodule.exports = {\n // Makes all records visible\n READ_UNCOMMITTED: 0,\n\n // non-transactional and COMMITTED transactional records are visible. It returns all data\n // from offsets smaller than the current LSO (last stable offset), and enables the inclusion of\n // the list of aborted transactions in the result, which allows consumers to discard ABORTED\n // transactional records\n READ_COMMITTED: 1,\n}\n","const { promisify } = require('util')\nconst zlib = require('zlib')\n\nconst gzip = promisify(zlib.gzip)\nconst unzip = promisify(zlib.unzip)\n\nmodule.exports = {\n /**\n * @param {Encoder} encoder\n * @returns {Promise}\n */\n async compress(encoder) {\n return await gzip(encoder.buffer)\n },\n\n /**\n * @param {Buffer} buffer\n * @returns {Promise}\n */\n async decompress(buffer) {\n return await unzip(buffer)\n },\n}\n","const { KafkaJSNotImplemented } = require('../../../errors')\n\nconst COMPRESSION_CODEC_MASK = 0x07\n\nconst Types = {\n None: 0,\n GZIP: 1,\n Snappy: 2,\n LZ4: 3,\n ZSTD: 4,\n}\n\nconst Codecs = {\n [Types.GZIP]: () => require('./gzip'),\n [Types.Snappy]: () => {\n throw new KafkaJSNotImplemented('Snappy compression not implemented')\n },\n [Types.LZ4]: () => {\n throw new KafkaJSNotImplemented('LZ4 compression not implemented')\n },\n [Types.ZSTD]: () => {\n throw new KafkaJSNotImplemented('ZSTD compression not implemented')\n },\n}\n\nconst lookupCodec = type => (Codecs[type] ? Codecs[type]() : null)\nconst lookupCodecByAttributes = attributes => {\n const codec = Codecs[attributes & COMPRESSION_CODEC_MASK]\n return codec ? codec() : null\n}\n\nmodule.exports = {\n Types,\n Codecs,\n lookupCodec,\n lookupCodecByAttributes,\n COMPRESSION_CODEC_MASK,\n}\n","const {\n KafkaJSPartialMessageError,\n KafkaJSUnsupportedMagicByteInMessageSet,\n} = require('../../errors')\n\nconst V0Decoder = require('./v0/decoder')\nconst V1Decoder = require('./v1/decoder')\n\nconst decodeMessage = (decoder, magicByte) => {\n switch (magicByte) {\n case 0:\n return V0Decoder(decoder)\n case 1:\n return V1Decoder(decoder)\n default:\n throw new KafkaJSUnsupportedMagicByteInMessageSet(\n `Unsupported MessageSet message version, magic byte: ${magicByte}`\n )\n }\n}\n\nmodule.exports = (offset, size, decoder) => {\n // Don't decrement decoder.offset because slice is already considering the current\n // offset of the decoder\n const remainingBytes = Buffer.byteLength(decoder.slice(size).buffer)\n\n if (remainingBytes < size) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: remainingBytes(${remainingBytes}) < messageSize(${size})`\n )\n }\n\n const crc = decoder.readInt32()\n const magicByte = decoder.readInt8()\n const message = decodeMessage(decoder, magicByte)\n return Object.assign({ offset, size, crc, magicByte }, message)\n}\n","const versions = {\n 0: require('./v0'),\n 1: require('./v1'),\n}\n\nmodule.exports = ({ version = 0 }) => versions[version]\n","module.exports = decoder => ({\n attributes: decoder.readInt8(),\n key: decoder.readBytes(),\n value: decoder.readBytes(),\n})\n","const Encoder = require('../../encoder')\nconst crc32 = require('../../crc32')\nconst { Types: Compression, COMPRESSION_CODEC_MASK } = require('../compression')\n\n/**\n * v0\n * Message => Crc MagicByte Attributes Key Value\n * Crc => int32\n * MagicByte => int8\n * Attributes => int8\n * Key => bytes\n * Value => bytes\n */\n\nmodule.exports = ({ compression = Compression.None, key, value }) => {\n const content = new Encoder()\n .writeInt8(0) // magicByte\n .writeInt8(compression & COMPRESSION_CODEC_MASK)\n .writeBytes(key)\n .writeBytes(value)\n\n const crc = crc32(content)\n return new Encoder().writeInt32(crc).writeEncoder(content)\n}\n","module.exports = decoder => ({\n attributes: decoder.readInt8(),\n timestamp: decoder.readInt64().toString(),\n key: decoder.readBytes(),\n value: decoder.readBytes(),\n})\n","const Encoder = require('../../encoder')\nconst crc32 = require('../../crc32')\nconst { Types: Compression, COMPRESSION_CODEC_MASK } = require('../compression')\n\n/**\n * v1 (supported since 0.10.0)\n * Message => Crc MagicByte Attributes Key Value\n * Crc => int32\n * MagicByte => int8\n * Attributes => int8\n * Timestamp => int64\n * Key => bytes\n * Value => bytes\n */\n\nmodule.exports = ({ compression = Compression.None, timestamp = Date.now(), key, value }) => {\n const content = new Encoder()\n .writeInt8(1) // magicByte\n .writeInt8(compression & COMPRESSION_CODEC_MASK)\n .writeInt64(timestamp)\n .writeBytes(key)\n .writeBytes(value)\n\n const crc = crc32(content)\n return new Encoder().writeInt32(crc).writeEncoder(content)\n}\n","const Long = require('../../utils/long')\nconst Decoder = require('../decoder')\nconst MessageDecoder = require('../message/decoder')\nconst { lookupCodecByAttributes } = require('../message/compression')\nconst { KafkaJSPartialMessageError } = require('../../errors')\n\n/**\n * MessageSet => [Offset MessageSize Message]\n * Offset => int64\n * MessageSize => int32\n * Message => Bytes\n */\n\nmodule.exports = async (primaryDecoder, size = null) => {\n const messages = []\n const messageSetSize = size || primaryDecoder.readInt32()\n const messageSetDecoder = primaryDecoder.slice(messageSetSize)\n\n while (messageSetDecoder.offset < messageSetSize) {\n try {\n const message = EntryDecoder(messageSetDecoder)\n const codec = lookupCodecByAttributes(message.attributes)\n\n if (codec) {\n const buffer = await codec.decompress(message.value)\n messages.push(...EntriesDecoder(new Decoder(buffer), message))\n } else {\n messages.push(message)\n }\n } catch (e) {\n if (e.name === 'KafkaJSPartialMessageError') {\n // We tried to decode a partial message, it means that minBytes\n // is probably too low\n break\n }\n\n if (e.name === 'KafkaJSUnsupportedMagicByteInMessageSet') {\n // Received a MessageSet and a RecordBatch on the same response, the cluster is probably\n // upgrading the message format from 0.10 to 0.11. Stop processing this message set to\n // receive the full record batch on the next request\n break\n }\n\n throw e\n }\n }\n\n primaryDecoder.forward(messageSetSize)\n return messages\n}\n\nconst EntriesDecoder = (decoder, compressedMessage) => {\n const messages = []\n\n while (decoder.offset < decoder.buffer.length) {\n messages.push(EntryDecoder(decoder))\n }\n\n if (compressedMessage.magicByte > 0 && compressedMessage.offset >= 0) {\n const compressedOffset = Long.fromValue(compressedMessage.offset)\n const lastMessageOffset = Long.fromValue(messages[messages.length - 1].offset)\n const baseOffset = compressedOffset - lastMessageOffset\n\n for (const message of messages) {\n message.offset = Long.fromValue(message.offset)\n .add(baseOffset)\n .toString()\n }\n }\n\n return messages\n}\n\nconst EntryDecoder = decoder => {\n if (!decoder.canReadInt64()) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: There isn't enough bytes to read the offset`\n )\n }\n\n const offset = decoder.readInt64().toString()\n\n if (!decoder.canReadInt32()) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial message: There isn't enough bytes to read the message size`\n )\n }\n\n const size = decoder.readInt32()\n return MessageDecoder(offset, size, decoder)\n}\n","const Encoder = require('../encoder')\nconst MessageProtocol = require('../message')\nconst { Types } = require('../message/compression')\n\n/**\n * MessageSet => [Offset MessageSize Message]\n * Offset => int64\n * MessageSize => int32\n * Message => Bytes\n */\n\n/**\n * [\n * { key: \"\", value: \"\" },\n * { key: \"\", value: \"\" },\n * ]\n */\nmodule.exports = ({ messageVersion = 0, compression, entries }) => {\n const isCompressed = compression !== Types.None\n const Message = MessageProtocol({ version: messageVersion })\n const encoder = new Encoder()\n\n // Messages in a message set are __not__ encoded as an array.\n // They are written in sequence.\n // https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Messagesets\n\n entries.forEach((entry, i) => {\n const message = Message(entry)\n\n // This is the offset used in kafka as the log sequence number.\n // When the producer is sending non compressed messages, it can set the offsets to anything\n // When the producer is sending compressed messages, to avoid server side recompression, each compressed message\n // should have offset starting from 0 and increasing by one for each inner message in the compressed message\n encoder.writeInt64(isCompressed ? i : -1)\n encoder.writeInt32(message.size())\n\n encoder.writeEncoder(message)\n })\n\n return encoder\n}\n","/**\n * A javascript implementation of the CRC32 checksum that uses\n * the CRC32-C polynomial, the same polynomial used by iSCSI\n *\n * also known as CRC32 Castagnoli\n * based on: https://github.com/ashi009/node-fast-crc32c/blob/master/impls/js_crc32c.js\n */\nconst crc32C = buffer => {\n let crc = 0 ^ -1\n for (let i = 0; i < buffer.length; i++) {\n crc = T[(crc ^ buffer[i]) & 0xff] ^ (crc >>> 8)\n }\n\n return (crc ^ -1) >>> 0\n}\n\nmodule.exports = crc32C\n\n// prettier-ignore\nvar T = new Int32Array([\n 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,\n 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,\n 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,\n 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,\n 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,\n 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,\n 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,\n 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,\n 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,\n 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,\n 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,\n 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,\n 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,\n 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,\n 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,\n 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,\n 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,\n 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,\n 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,\n 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,\n 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,\n 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,\n 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,\n 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,\n 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,\n 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,\n 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,\n 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,\n 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,\n 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,\n 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,\n 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,\n 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,\n 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,\n 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,\n 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,\n 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,\n 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,\n 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,\n 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,\n 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,\n 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,\n 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,\n 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,\n 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,\n 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,\n 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,\n 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,\n 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,\n 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,\n 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,\n 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,\n 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,\n 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,\n 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,\n 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,\n 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,\n 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,\n 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,\n 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,\n 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,\n 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,\n 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,\n 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351\n]);\n","const crc32C = require('./crc32C')\nconst unsigned = value => Uint32Array.from([value])[0]\n\nmodule.exports = buffer => unsigned(crc32C(buffer))\n","module.exports = decoder => ({\n key: decoder.readVarIntString(),\n value: decoder.readVarIntBytes(),\n})\n","const Encoder = require('../../../encoder')\n\n/**\n * v0\n * Header => Key Value\n * Key => varInt|string\n * Value => varInt|bytes\n */\n\nmodule.exports = ({ key, value }) => {\n return new Encoder().writeVarIntString(key).writeVarIntBytes(value)\n}\n","const Long = require('../../../../utils/long')\nconst HeaderDecoder = require('../../header/v0/decoder')\nconst TimestampTypes = require('../../../timestampTypes')\n\n/**\n * v0\n * Record =>\n * Length => Varint\n * Attributes => Int8\n * TimestampDelta => Varlong\n * OffsetDelta => Varint\n * Key => varInt|Bytes\n * Value => varInt|Bytes\n * Headers => [HeaderKey HeaderValue]\n * HeaderKey => VarInt|String\n * HeaderValue => VarInt|Bytes\n */\n\nmodule.exports = (decoder, batchContext = {}) => {\n const {\n firstOffset,\n firstTimestamp,\n magicByte,\n isControlBatch = false,\n timestampType,\n maxTimestamp,\n } = batchContext\n const attributes = decoder.readInt8()\n\n const timestampDelta = decoder.readVarLong()\n const timestamp =\n timestampType === TimestampTypes.LOG_APPEND_TIME && maxTimestamp\n ? maxTimestamp\n : Long.fromValue(firstTimestamp)\n .add(timestampDelta)\n .toString()\n\n const offsetDelta = decoder.readVarInt()\n const offset = Long.fromValue(firstOffset)\n .add(offsetDelta)\n .toString()\n\n const key = decoder.readVarIntBytes()\n const value = decoder.readVarIntBytes()\n const headers = decoder\n .readVarIntArray(HeaderDecoder)\n .reduce((obj, { key, value }) => ({ ...obj, [key]: value }), {})\n\n return {\n magicByte,\n attributes, // Record level attributes are presently unused\n timestamp,\n offset,\n key,\n value,\n headers,\n isControlRecord: isControlBatch,\n batchContext,\n }\n}\n","const Encoder = require('../../../encoder')\nconst Header = require('../../header/v0')\n\n/**\n * v0\n * Record =>\n * Length => Varint\n * Attributes => Int8\n * TimestampDelta => Varlong\n * OffsetDelta => Varint\n * Key => varInt|Bytes\n * Value => varInt|Bytes\n * Headers => [HeaderKey HeaderValue]\n * HeaderKey => VarInt|String\n * HeaderValue => VarInt|Bytes\n */\n\n/**\n * @param [offsetDelta=0] {Integer}\n * @param [timestampDelta=0] {Long}\n * @param key {Buffer}\n * @param value {Buffer}\n * @param [headers={}] {Object}\n */\nmodule.exports = ({ offsetDelta = 0, timestampDelta = 0, key, value, headers = {} }) => {\n const headersArray = Object.keys(headers).map(headerKey => ({\n key: headerKey,\n value: headers[headerKey],\n }))\n\n const sizeOfBody =\n 1 + // always one byte for attributes\n Encoder.sizeOfVarLong(timestampDelta) +\n Encoder.sizeOfVarInt(offsetDelta) +\n Encoder.sizeOfVarIntBytes(key) +\n Encoder.sizeOfVarIntBytes(value) +\n sizeOfHeaders(headersArray)\n\n return new Encoder()\n .writeVarInt(sizeOfBody)\n .writeInt8(0) // no used record attributes at the moment\n .writeVarLong(timestampDelta)\n .writeVarInt(offsetDelta)\n .writeVarIntBytes(key)\n .writeVarIntBytes(value)\n .writeVarIntArray(headersArray.map(Header))\n}\n\nconst sizeOfHeaders = headersArray => {\n let size = Encoder.sizeOfVarInt(headersArray.length)\n\n for (const header of headersArray) {\n const keySize = Buffer.byteLength(header.key)\n const valueSize = Buffer.byteLength(header.value)\n\n size += Encoder.sizeOfVarInt(keySize) + keySize\n\n if (header.value === null) {\n size += Encoder.sizeOfVarInt(-1)\n } else {\n size += Encoder.sizeOfVarInt(valueSize) + valueSize\n }\n }\n\n return size\n}\n","const Decoder = require('../../decoder')\nconst { KafkaJSPartialMessageError } = require('../../../errors')\nconst { lookupCodecByAttributes } = require('../../message/compression')\nconst RecordDecoder = require('../record/v0/decoder')\nconst TimestampTypes = require('../../timestampTypes')\n\nconst TIMESTAMP_TYPE_FLAG_MASK = 0x8\nconst TRANSACTIONAL_FLAG_MASK = 0x10\nconst CONTROL_FLAG_MASK = 0x20\n\n/**\n * v0\n * RecordBatch =>\n * FirstOffset => int64\n * Length => int32\n * PartitionLeaderEpoch => int32\n * Magic => int8\n * CRC => int32\n * Attributes => int16\n * LastOffsetDelta => int32\n * FirstTimestamp => int64\n * MaxTimestamp => int64\n * ProducerId => int64\n * ProducerEpoch => int16\n * FirstSequence => int32\n * Records => [Record]\n */\n\nmodule.exports = async fetchDecoder => {\n const firstOffset = fetchDecoder.readInt64().toString()\n const length = fetchDecoder.readInt32()\n const decoder = fetchDecoder.slice(length)\n fetchDecoder.forward(length)\n\n const remainingBytes = Buffer.byteLength(decoder.buffer)\n\n if (remainingBytes < length) {\n throw new KafkaJSPartialMessageError(\n `Tried to decode a partial record batch: remainingBytes(${remainingBytes}) < recordBatchLength(${length})`\n )\n }\n\n const partitionLeaderEpoch = decoder.readInt32()\n\n // The magic byte was read by the Fetch protocol to distinguish between\n // the record batch and the legacy message set. It's not used here but\n // it has to be read.\n const magicByte = decoder.readInt8() // eslint-disable-line no-unused-vars\n\n // The library is currently not performing CRC validations\n const crc = decoder.readInt32() // eslint-disable-line no-unused-vars\n\n const attributes = decoder.readInt16()\n const lastOffsetDelta = decoder.readInt32()\n const firstTimestamp = decoder.readInt64().toString()\n const maxTimestamp = decoder.readInt64().toString()\n const producerId = decoder.readInt64().toString()\n const producerEpoch = decoder.readInt16()\n const firstSequence = decoder.readInt32()\n\n const inTransaction = (attributes & TRANSACTIONAL_FLAG_MASK) > 0\n const isControlBatch = (attributes & CONTROL_FLAG_MASK) > 0\n const timestampType =\n (attributes & TIMESTAMP_TYPE_FLAG_MASK) > 0\n ? TimestampTypes.LOG_APPEND_TIME\n : TimestampTypes.CREATE_TIME\n\n const codec = lookupCodecByAttributes(attributes)\n\n const recordContext = {\n firstOffset,\n firstTimestamp,\n partitionLeaderEpoch,\n inTransaction,\n isControlBatch,\n lastOffsetDelta,\n producerId,\n producerEpoch,\n firstSequence,\n maxTimestamp,\n timestampType,\n }\n\n const records = await decodeRecords(codec, decoder, { ...recordContext, magicByte })\n\n return {\n ...recordContext,\n records,\n }\n}\n\nconst decodeRecords = async (codec, recordsDecoder, recordContext) => {\n if (!codec) {\n return recordsDecoder.readArray(decoder => decodeRecord(decoder, recordContext))\n }\n\n const length = recordsDecoder.readInt32()\n\n if (length <= 0) {\n return []\n }\n\n const compressedRecordsBuffer = recordsDecoder.readAll()\n const decompressedRecordBuffer = await codec.decompress(compressedRecordsBuffer)\n const decompressedRecordDecoder = new Decoder(decompressedRecordBuffer)\n const records = new Array(length)\n\n for (let i = 0; i < length; i++) {\n records[i] = decodeRecord(decompressedRecordDecoder, recordContext)\n }\n\n return records\n}\n\nconst decodeRecord = (decoder, recordContext) => {\n const recordBuffer = decoder.readVarIntBytes()\n return RecordDecoder(new Decoder(recordBuffer), recordContext)\n}\n","const Long = require('../../../utils/long')\nconst Encoder = require('../../encoder')\nconst crc32C = require('../crc32C')\nconst {\n Types: Compression,\n lookupCodec,\n COMPRESSION_CODEC_MASK,\n} = require('../../message/compression')\n\nconst MAGIC_BYTE = 2\nconst TIMESTAMP_MASK = 0 // The fourth lowest bit, always set this bit to 0 (since 0.10.0)\nconst TRANSACTIONAL_MASK = 16 // The fifth lowest bit\n\n/**\n * v0\n * RecordBatch =>\n * FirstOffset => int64\n * Length => int32\n * PartitionLeaderEpoch => int32\n * Magic => int8\n * CRC => int32\n * Attributes => int16\n * LastOffsetDelta => int32\n * FirstTimestamp => int64\n * MaxTimestamp => int64\n * ProducerId => int64\n * ProducerEpoch => int16\n * FirstSequence => int32\n * Records => [Record]\n */\n\nconst RecordBatch = async ({\n compression = Compression.None,\n firstOffset = Long.fromInt(0),\n firstTimestamp = Date.now(),\n maxTimestamp = Date.now(),\n partitionLeaderEpoch = 0,\n lastOffsetDelta = 0,\n transactional = false,\n producerId = Long.fromValue(-1), // for idempotent messages\n producerEpoch = 0, // for idempotent messages\n firstSequence = 0, // for idempotent messages\n records = [],\n}) => {\n const COMPRESSION_CODEC = compression & COMPRESSION_CODEC_MASK\n const IN_TRANSACTION = transactional ? TRANSACTIONAL_MASK : 0\n const attributes = COMPRESSION_CODEC | TIMESTAMP_MASK | IN_TRANSACTION\n\n const batchBody = new Encoder()\n .writeInt16(attributes)\n .writeInt32(lastOffsetDelta)\n .writeInt64(firstTimestamp)\n .writeInt64(maxTimestamp)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeInt32(firstSequence)\n\n if (compression === Compression.None) {\n if (records.every(v => typeof v === typeof records[0])) {\n batchBody.writeArray(records, typeof records[0])\n } else {\n batchBody.writeArray(records)\n }\n } else {\n const compressedRecords = await compressRecords(compression, records)\n batchBody.writeInt32(records.length).writeBuffer(compressedRecords)\n }\n\n // CRC32C validation is happening here:\n // https://github.com/apache/kafka/blob/0.11.0.1/clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java#L148\n\n const batch = new Encoder()\n .writeInt32(partitionLeaderEpoch)\n .writeInt8(MAGIC_BYTE)\n .writeUInt32(crc32C(batchBody.buffer))\n .writeEncoder(batchBody)\n\n return new Encoder().writeInt64(firstOffset).writeBytes(batch.buffer)\n}\n\nconst compressRecords = async (compression, records) => {\n const codec = lookupCodec(compression)\n const recordsEncoder = new Encoder()\n\n recordsEncoder.writeEncoderArray(records)\n\n return codec.compress(recordsEncoder)\n}\n\nmodule.exports = {\n RecordBatch,\n MAGIC_BYTE,\n}\n","const Encoder = require('./encoder')\n\nmodule.exports = async ({ correlationId, clientId, request: { apiKey, apiVersion, encode } }) => {\n const payload = await encode()\n const requestPayload = new Encoder()\n .writeInt16(apiKey)\n .writeInt16(apiVersion)\n .writeInt32(correlationId)\n .writeString(clientId)\n .writeEncoder(payload)\n\n return new Encoder().writeInt32(requestPayload.size()).writeEncoder(requestPayload)\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, groupId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, producerId, producerEpoch, groupId }), response }\n },\n 1: ({ transactionalId, producerId, producerEpoch, groupId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, producerId, producerEpoch, groupId }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AddOffsetsToTxn: apiKey } = require('../../apiKeys')\n\n/**\n * AddOffsetsToTxn Request (Version: 0) => transactional_id producer_id producer_epoch group_id\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * group_id => STRING\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, groupId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AddOffsetsToTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeString(groupId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * AddOffsetsToTxn Response (Version: 0) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AddOffsetsToTxn Request (Version: 1) => transactional_id producer_id producer_epoch group_id\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * group_id => STRING\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, groupId }) =>\n Object.assign(\n requestV0({\n transactionalId,\n producerId,\n producerEpoch,\n groupId,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AddOffsetsToTxn Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, producerId, producerEpoch, topics }), response }\n },\n 1: ({ transactionalId, producerId, producerEpoch, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, producerId, producerEpoch, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AddPartitionsToTxn: apiKey } = require('../../apiKeys')\n\n/**\n * AddPartitionsToTxn Request (Version: 0) => transactional_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AddPartitionsToTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = partition => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * AddPartitionsToTxn Response (Version: 0) => throttle_time_ms [errors]\n * throttle_time_ms => INT32\n * errors => topic [partition_errors]\n * topic => STRING\n * partition_errors => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errors = await decoder.readArrayAsync(decodeError)\n\n return {\n throttleTime,\n errors,\n }\n}\n\nconst decodeError = async decoder => ({\n topic: decoder.readString(),\n partitionErrors: await decoder.readArrayAsync(decodePartitionError),\n})\n\nconst decodePartitionError = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const topicsWithErrors = data.errors\n .map(({ partitionErrors }) => ({\n partitionsWithErrors: partitionErrors.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n throw createErrorFromCode(topicsWithErrors[0].partitionsWithErrors[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AddPartitionsToTxn Request (Version: 1) => transactional_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, topics }) =>\n Object.assign(\n requestV0({\n transactionalId,\n producerId,\n producerEpoch,\n topics,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AddPartitionsToTxn Response (Version: 1) => throttle_time_ms [errors]\n * throttle_time_ms => INT32\n * errors => topic [partition_errors]\n * topic => STRING\n * partition_errors => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ resources, validateOnly }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ resources, validateOnly }), response }\n },\n 1: ({ resources, validateOnly }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ resources, validateOnly }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { AlterConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * AlterConfigs Request (Version: 0) => [resources] validate_only\n * resources => resource_type resource_name [config_entries]\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * validate_only => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of resources to change\n * @param {boolean} [validateOnly=false]\n */\nmodule.exports = ({ resources, validateOnly = false }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'AlterConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource)).writeBoolean(validateOnly)\n },\n})\n\nconst encodeResource = ({ type, name, configEntries }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * AlterConfigs Response (Version: 0) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n */\n\nconst decodeResources = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nconst parse = async data => {\n const resourcesWithError = data.resources.filter(({ errorCode }) => failure(errorCode))\n if (resourcesWithError.length > 0) {\n throw createErrorFromCode(resourcesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * AlterConfigs Request (Version: 1) => [resources] validate_only\n * resources => resource_type resource_name [config_entries]\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * validate_only => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of resources to change\n * @param {boolean} [validateOnly=false]\n */\nmodule.exports = ({ resources, validateOnly }) =>\n Object.assign(\n requestV0({\n resources,\n validateOnly,\n }),\n { apiVersion: 1 }\n )\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * AlterConfigs Response (Version: 1) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","module.exports = {\n Produce: 0,\n Fetch: 1,\n ListOffsets: 2,\n Metadata: 3,\n LeaderAndIsr: 4,\n StopReplica: 5,\n UpdateMetadata: 6,\n ControlledShutdown: 7,\n OffsetCommit: 8,\n OffsetFetch: 9,\n GroupCoordinator: 10,\n JoinGroup: 11,\n Heartbeat: 12,\n LeaveGroup: 13,\n SyncGroup: 14,\n DescribeGroups: 15,\n ListGroups: 16,\n SaslHandshake: 17,\n ApiVersions: 18, // ApiVersions v0 on Kafka 0.10\n CreateTopics: 19,\n DeleteTopics: 20,\n DeleteRecords: 21,\n InitProducerId: 22,\n OffsetForLeaderEpoch: 23,\n AddPartitionsToTxn: 24,\n AddOffsetsToTxn: 25,\n EndTxn: 26,\n WriteTxnMarkers: 27,\n TxnOffsetCommit: 28,\n DescribeAcls: 29,\n CreateAcls: 30,\n DeleteAcls: 31,\n DescribeConfigs: 32,\n AlterConfigs: 33, // ApiVersions v0 and v1 on Kafka 0.11\n AlterReplicaLogDirs: 34,\n DescribeLogDirs: 35,\n SaslAuthenticate: 36,\n CreatePartitions: 37,\n CreateDelegationToken: 38,\n RenewDelegationToken: 39,\n ExpireDelegationToken: 40,\n DescribeDelegationToken: 41,\n DeleteGroups: 42, // ApiVersions v2 on Kafka 1.0\n ElectPreferredLeaders: 43,\n}\n","const logResponseError = false\n\nconst versions = {\n 0: () => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(), response, logResponseError: true }\n },\n 1: () => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(), response, logResponseError }\n },\n 2: () => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request(), response, logResponseError }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ApiVersions: apiKey } = require('../../apiKeys')\n\n/**\n * ApiVersionRequest => ApiKeys\n */\n\nmodule.exports = () => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ApiVersions',\n encode: async () => new Encoder(),\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * ApiVersionResponse => ApiVersions\n * ErrorCode = INT16\n * ApiVersions = [ApiVersion]\n * ApiVersion = ApiKey MinVersion MaxVersion\n * ApiKey = INT16\n * MinVersion = INT16\n * MaxVersion = INT16\n */\n\nconst apiVersion = decoder => ({\n apiKey: decoder.readInt16(),\n minVersion: decoder.readInt16(),\n maxVersion: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n apiVersions: decoder.readArray(apiVersion),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n// ApiVersions Request after v1 indicates the client can parse throttle_time_ms\n\nmodule.exports = () => ({ ...requestV0(), apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * ApiVersions Response (Version: 1) => error_code [api_versions] throttle_time_ms\n * error_code => INT16\n * api_versions => api_key min_version max_version\n * api_key => INT16\n * min_version => INT16\n * max_version => INT16\n * throttle_time_ms => INT32\n */\n\nconst apiVersion = decoder => ({\n apiKey: decoder.readInt16(),\n minVersion: decoder.readInt16(),\n maxVersion: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const apiVersions = decoder.readArray(apiVersion)\n\n /**\n * The Java client defaults this value to 0 if not present,\n * even though it is required in the protocol. This is to\n * work around https://github.com/tulios/kafkajs/issues/491\n *\n * See:\n * https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/protocol/CommonFields.java#L23-L25\n */\n const throttleTime = decoder.canReadInt32() ? decoder.readInt32() : 0\n\n return {\n errorCode,\n apiVersions,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV0 = require('../v0/request')\n\n// ApiVersions Request after v1 indicates the client can parse throttle_time_ms\n\nmodule.exports = () => ({ ...requestV0(), apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ApiVersions Response (Version: 2) => error_code [api_versions] throttle_time_ms\n * error_code => INT16\n * api_versions => api_key min_version max_version\n * api_key => INT16\n * min_version => INT16\n * max_version => INT16\n * throttle_time_ms => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ creations }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ creations }), response }\n },\n 1: ({ creations }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ creations }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreateAcls: apiKey } = require('../../apiKeys')\n\n/**\n * CreateAcls Request (Version: 0) => [creations]\n * creations => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => STRING\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeCreations = ({\n resourceType,\n resourceName,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ creations }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreateAcls',\n encode: async () => {\n return new Encoder().writeArray(creations.map(encodeCreations))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * CreateAcls Response (Version: 0) => throttle_time_ms [creation_responses]\n * throttle_time_ms => INT32\n * creation_responses => error_code error_message\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decodeCreationResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const creationResponses = decoder.readArray(decodeCreationResponse)\n\n return {\n throttleTime,\n creationResponses,\n }\n}\n\nconst parse = async data => {\n const creationResponsesWithError = data.creationResponses.filter(({ errorCode }) =>\n failure(errorCode)\n )\n\n if (creationResponsesWithError.length > 0) {\n throw createErrorFromCode(creationResponsesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { CreateAcls: apiKey } = require('../../apiKeys')\n\n/**\n * CreateAcls Request (Version: 1) => [creations]\n * creations => resource_type resource_name resource_pattern_type principal host operation permission_type\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeCreations = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ creations }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'CreateAcls',\n encode: async () => {\n return new Encoder().writeArray(creations.map(encodeCreations))\n },\n})\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreateAcls Response (Version: 1) => throttle_time_ms [creation_responses]\n * throttle_time_ms => INT32\n * creation_responses => error_code error_message\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topicPartitions, timeout, validateOnly }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topicPartitions, timeout, validateOnly }), response }\n },\n 1: ({ topicPartitions, validateOnly, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topicPartitions, validateOnly, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreatePartitions: apiKey } = require('../../apiKeys')\n\n/**\n * CreatePartitions Request (Version: 0) => [topic_partitions] timeout validate_only\n * topic_partitions => topic new_partitions\n * topic => STRING\n * new_partitions => count [assignment]\n * count => INT32\n * assignment => ARRAY(INT32)\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topicPartitions, validateOnly = false, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreatePartitions',\n encode: async () => {\n return new Encoder()\n .writeArray(topicPartitions.map(encodeTopicPartitions))\n .writeInt32(timeout)\n .writeBoolean(validateOnly)\n },\n})\n\nconst encodeTopicPartitions = ({ topic, count, assignments = [] }) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(count)\n .writeNullableArray(assignments.map(encodeAssignments))\n}\n\nconst encodeAssignments = brokerIds => {\n return new Encoder().writeNullableArray(brokerIds)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/*\n * CreatePartitions Response (Version: 0) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n return {\n throttleTime,\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw createErrorFromCode(topicsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * CreatePartitions Request (Version: 1) => [topic_partitions] timeout validate_only\n * topic_partitions => topic new_partitions\n * topic => STRING\n * new_partitions => count [assignment]\n * count => INT32\n * assignment => ARRAY(INT32)\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topicPartitions, validateOnly, timeout }) =>\n Object.assign(requestV0({ topicPartitions, validateOnly, timeout }), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreatePartitions Response (Version: 0) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response }\n },\n 1: ({ topics, validateOnly, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n 2: ({ topics, validateOnly, timeout }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n 3: ({ topics, validateOnly, timeout }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ topics, validateOnly, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { CreateTopics: apiKey } = require('../../apiKeys')\n\n/**\n * CreateTopics Request (Version: 0) => [create_topic_requests] timeout\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n */\n\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'CreateTopics',\n encode: async () => {\n return new Encoder().writeArray(topics.map(encodeTopics)).writeInt32(timeout)\n },\n})\n\nconst encodeTopics = ({\n topic,\n numPartitions = 1,\n replicationFactor = 1,\n replicaAssignment = [],\n configEntries = [],\n}) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(numPartitions)\n .writeInt16(replicationFactor)\n .writeArray(replicaAssignment.map(encodeReplicaAssignment))\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeReplicaAssignment = ({ partition, replicas }) => {\n return new Encoder().writeInt32(partition).writeArray(replicas)\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst { KafkaJSAggregateError, KafkaJSCreateTopicError } = require('../../../../errors')\n\n/**\n * CreateTopics Response (Version: 0) => [topic_errors]\n * topic_errors => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw new KafkaJSAggregateError(\n 'Topic creation errors',\n topicsWithError.map(\n error => new KafkaJSCreateTopicError(createErrorFromCode(error.errorCode), error.topic)\n )\n )\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { CreateTopics: apiKey } = require('../../apiKeys')\n\n/**\n *CreateTopics Request (Version: 1) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly = false, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'CreateTopics',\n encode: async () => {\n return new Encoder()\n .writeArray(topics.map(encodeTopics))\n .writeInt32(timeout)\n .writeBoolean(validateOnly)\n },\n})\n\nconst encodeTopics = ({\n topic,\n numPartitions = 1,\n replicationFactor = 1,\n replicaAssignment = [],\n configEntries = [],\n}) => {\n return new Encoder()\n .writeString(topic)\n .writeInt32(numPartitions)\n .writeInt16(replicationFactor)\n .writeArray(replicaAssignment.map(encodeReplicaAssignment))\n .writeArray(configEntries.map(encodeConfigEntries))\n}\n\nconst encodeReplicaAssignment = ({ partition, replicas }) => {\n return new Encoder().writeInt32(partition).writeArray(replicas)\n}\n\nconst encodeConfigEntries = ({ name, value }) => {\n return new Encoder().writeString(name).writeString(value)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * CreateTopics Response (Version: 1) => [topic_errors]\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * CreateTopics Request (Version: 2) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly, timeout }) =>\n Object.assign(requestV1({ topics, validateOnly, timeout }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\n\n/**\n * CreateTopics Response (Version: 2) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * CreateTopics Request (Version: 3) => [create_topic_requests] timeout validate_only\n * create_topic_requests => topic num_partitions replication_factor [replica_assignment] [config_entries]\n * topic => STRING\n * num_partitions => INT32\n * replication_factor => INT16\n * replica_assignment => partition [replicas]\n * partition => INT32\n * replicas => INT32\n * config_entries => config_name config_value\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * timeout => INT32\n * validate_only => BOOLEAN\n */\n\nmodule.exports = ({ topics, validateOnly, timeout }) =>\n Object.assign(requestV2({ topics, validateOnly, timeout }), { apiVersion: 3 })\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * Starting in version 3, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * CreateTopics Response (Version: 3) => throttle_time_ms [topic_errors]\n * throttle_time_ms => INT32\n * topic_errors => topic error_code error_message\n * topic => STRING\n * error_code => INT16\n * error_message => NULLABLE_STRING\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ filters }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ filters }), response }\n },\n 1: ({ filters }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ filters }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteAcls Request (Version: 0) => [filters]\n * filters => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeFilters = ({\n resourceType,\n resourceName,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ filters }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteAcls',\n encode: async () => {\n return new Encoder().writeArray(filters.map(encodeFilters))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteAcls Response (Version: 0) => throttle_time_ms [filter_responses]\n * throttle_time_ms => INT32\n * filter_responses => error_code error_message [matching_acls]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * matching_acls => error_code error_message resource_type resource_name principal host operation permission_type\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeMatchingAcls = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeFilterResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n matchingAcls: decoder.readArray(decodeMatchingAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const filterResponses = decoder.readArray(decodeFilterResponse)\n\n return {\n throttleTime,\n filterResponses,\n }\n}\n\nconst parse = async data => {\n const filterResponsesWithError = data.filterResponses.filter(({ errorCode }) =>\n failure(errorCode)\n )\n\n if (filterResponsesWithError.length > 0) {\n throw createErrorFromCode(filterResponsesWithError[0].errorCode)\n }\n\n for (const filterResponse of data.filterResponses) {\n const matchingAcls = filterResponse.matchingAcls\n const matchingAclsWithError = matchingAcls.filter(({ errorCode }) => failure(errorCode))\n\n if (matchingAclsWithError.length > 0) {\n throw createErrorFromCode(matchingAclsWithError[0].errorCode)\n }\n }\n\n return data\n}\n\nmodule.exports = {\n decodeMatchingAcls,\n decodeFilterResponse,\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteAcls Request (Version: 1) => [filters]\n * filters => resource_type resource_name resource_pattern_type_filter principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * resource_pattern_type_filter => INT8\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst encodeFilters = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n}\n\nmodule.exports = ({ filters }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DeleteAcls',\n encode: async () => {\n return new Encoder().writeArray(filters.map(encodeFilters))\n },\n})\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n * Version 1 also introduces a new resource pattern type field.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-290%3A+Support+for+Prefixed+ACLs\n *\n * DeleteAcls Response (Version: 1) => throttle_time_ms [filter_responses]\n * throttle_time_ms => INT32\n * filter_responses => error_code error_message [matching_acls]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * matching_acls => error_code error_message resource_type resource_name resource_pattern_type principal host operation permission_type\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeMatchingAcls = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n resourcePatternType: decoder.readInt8(),\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeFilterResponse = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n matchingAcls: decoder.readArray(decodeMatchingAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const filterResponses = decoder.readArray(decodeFilterResponse)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n filterResponses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: groupIds => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(groupIds), response }\n },\n 1: groupIds => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(groupIds), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteGroups: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteGroups Request (Version: 0) => [groups_names]\n * groups_names => STRING\n */\n\n/**\n */\nmodule.exports = groupIds => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteGroups',\n encode: async () => {\n return new Encoder().writeArray(groupIds.map(encodeGroups))\n },\n})\n\nconst encodeGroups = group => {\n return new Encoder().writeString(group)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n/**\n * DeleteGroups Response (Version: 0) => throttle_time_ms [results]\n * throttle_time_ms => INT32\n * results => group_id error_code\n * group_id => STRING\n * error_code => INT16\n */\n\nconst decodeGroup = decoder => ({\n groupId: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTimeMs = decoder.readInt32()\n const results = decoder.readArray(decodeGroup)\n\n for (const result of results) {\n if (failure(result.errorCode)) {\n result.error = createErrorFromCode(result.errorCode)\n }\n }\n return {\n throttleTimeMs,\n results,\n }\n}\n\nconst parse = async data => {\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteGroups Request (Version: 1)\n */\n\nmodule.exports = groupIds => Object.assign(requestV0(groupIds), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteGroups Response (Version: 1) => throttle_time_ms [results]\n * throttle_time_ms => INT32\n * results => group_id error_code\n * group_id => STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response: response({ topics }) }\n },\n 1: ({ topics, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, timeout }), response: response({ topics }) }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteRecords: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteRecords Request (Version: 0) => [topics] timeout_ms\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset\n * partition => INT32\n * offset => INT64\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteRecords',\n encode: async () => {\n return new Encoder()\n .writeArray(\n topics.map(({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(\n partitions.map(({ partition, offset }) => {\n return new Encoder().writeInt32(partition).writeInt64(offset)\n })\n )\n })\n )\n .writeInt32(timeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { KafkaJSDeleteTopicRecordsError } = require('../../../../errors')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteRecords Response (Version: 0) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => name [partitions]\n * name => STRING\n * partitions => partition low_watermark error_code\n * partition => INT32\n * low_watermark => INT64\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n topics: decoder\n .readArray(decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decoder => ({\n partition: decoder.readInt32(),\n lowWatermark: decoder.readInt64(),\n errorCode: decoder.readInt16(),\n })),\n }))\n .sort(topicNameComparator),\n }\n}\n\nconst parse = requestTopics => async data => {\n const topicsWithErrors = data.topics\n .map(({ partitions }) => ({\n partitionsWithErrors: partitions.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n // at present we only ever request one topic at a time, so can destructure the arrays\n const [{ topic }] = data.topics // topic name\n const [{ partitions: requestPartitions }] = requestTopics // requested offset(s)\n const [{ partitionsWithErrors }] = topicsWithErrors // partition(s) + error(s)\n\n throw new KafkaJSDeleteTopicRecordsError({\n topic,\n partitions: partitionsWithErrors.map(({ partition, errorCode }) => ({\n partition,\n error: createErrorFromCode(errorCode),\n // attach the original offset from the request, onto the error response\n offset: requestPartitions.find(p => p.partition === partition).offset,\n })),\n })\n }\n\n return data\n}\n\nmodule.exports = ({ topics }) => ({\n decode,\n parse: parse(topics),\n})\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteRecords Request (Version: 1) => [topics] timeout_ms\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset\n * partition => INT32\n * offset => INT64\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout }) =>\n Object.assign(requestV0({ topics, timeout }), { apiVersion: 1 })\n","const responseV0 = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteRecords Response (Version: 1) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => name [partitions]\n * name => STRING\n * partitions => partition_index low_watermark error_code\n * partition_index => INT32\n * low_watermark => INT64\n * error_code => INT16\n */\n\nmodule.exports = ({ topics }) => {\n const { parse, decode: decodeV0 } = responseV0({ topics })\n\n const decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n }\n\n return {\n decode,\n parse,\n }\n}\n","const versions = {\n 0: ({ topics, timeout }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics, timeout }), response }\n },\n 1: ({ topics, timeout }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics, timeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DeleteTopics: apiKey } = require('../../apiKeys')\n\n/**\n * DeleteTopics Request (Version: 0) => [topics] timeout\n * topics => STRING\n * timeout => INT32\n */\nmodule.exports = ({ topics, timeout = 5000 }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DeleteTopics',\n encode: async () => {\n return new Encoder().writeArray(topics).writeInt32(timeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DeleteTopics Response (Version: 0) => [topic_error_codes]\n * topic_error_codes => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nconst parse = async data => {\n const topicsWithError = data.topicErrors.filter(({ errorCode }) => failure(errorCode))\n if (topicsWithError.length > 0) {\n throw createErrorFromCode(topicsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DeleteTopics Request (Version: 1) => [topics] timeout\n * topics => STRING\n * timeout => INT32\n */\n\nmodule.exports = ({ topics, timeout }) =>\n Object.assign(requestV0({ topics, timeout }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DeleteTopics Response (Version: 1) => throttle_time_ms [topic_error_codes]\n * throttle_time_ms => INT32\n * topic_error_codes => topic error_code\n * topic => STRING\n * error_code => INT16\n */\n\nconst topicNameComparator = (a, b) => a.topic.localeCompare(b.topic)\n\nconst topicErrors = decoder => ({\n topic: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n topicErrors: decoder.readArray(topicErrors).sort(topicNameComparator),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ resourceType, resourceName, principal, host, operation, permissionType }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ resourceType, resourceName, principal, host, operation, permissionType }),\n response,\n }\n },\n 1: ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeAcls Request (Version: 0) => resource_type resource_name principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nmodule.exports = ({ resourceType, resourceName, principal, host, operation, permissionType }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeAcls',\n encode: async () => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DescribeAcls Response (Version: 0) => throttle_time_ms error_code error_message [resources]\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resources => resource_type resource_name [acls]\n * resource_type => INT8\n * resource_name => STRING\n * acls => principal host operation permission_type\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nconst decodeAcls = decoder => ({\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeResources = decoder => ({\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n acls: decoder.readArray(decodeAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n errorCode,\n errorMessage,\n resources,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeAcls: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeAcls Request (Version: 1) => resource_type resource_name resource_pattern_type_filter principal host operation permission_type\n * resource_type => INT8\n * resource_name => NULLABLE_STRING\n * resource_pattern_type_filter => INT8\n * principal => NULLABLE_STRING\n * host => NULLABLE_STRING\n * operation => INT8\n * permission_type => INT8\n */\n\nmodule.exports = ({\n resourceType,\n resourceName,\n resourcePatternType,\n principal,\n host,\n operation,\n permissionType,\n}) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DescribeAcls',\n encode: async () => {\n return new Encoder()\n .writeInt8(resourceType)\n .writeString(resourceName)\n .writeInt8(resourcePatternType)\n .writeString(principal)\n .writeString(host)\n .writeInt8(operation)\n .writeInt8(permissionType)\n },\n})\n","const { parse } = require('../v0/response')\nconst Decoder = require('../../../decoder')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n * Version 1 also introduces a new resource pattern type field.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-290%3A+Support+for+Prefixed+ACLs\n *\n * DescribeAcls Response (Version: 1) => throttle_time_ms error_code error_message [resources]\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resources => resource_type resource_name resource_pattern_type [acls]\n * resource_type => INT8\n * resource_name => STRING\n * resource_pattern_type => INT8\n * acls => principal host operation permission_type\n * principal => STRING\n * host => STRING\n * operation => INT8\n * permission_type => INT8\n */\nconst decodeAcls = decoder => ({\n principal: decoder.readString(),\n host: decoder.readString(),\n operation: decoder.readInt8(),\n permissionType: decoder.readInt8(),\n})\n\nconst decodeResources = decoder => ({\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n resourcePatternType: decoder.readInt8(),\n acls: decoder.readArray(decodeAcls),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n errorCode,\n errorMessage,\n resources,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ resources }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ resources }), response }\n },\n 1: ({ resources, includeSynonyms }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ resources, includeSynonyms }), response }\n },\n 2: ({ resources, includeSynonyms }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ resources, includeSynonyms }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeConfigs Request (Version: 0) => [resources]\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n */\nmodule.exports = ({ resources }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource))\n },\n})\n\nconst encodeResource = ({ type, name, configNames = [] }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeNullableArray(configNames)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst ConfigSource = require('../../../configSource')\nconst ConfigResourceTypes = require('../../../configResourceTypes')\n\n/**\n * DescribeConfigs Response (Version: 0) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only is_default is_sensitive\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * is_default => BOOLEAN\n * is_sensitive => BOOLEAN\n */\n\nconst decodeConfigEntries = (decoder, resourceType) => {\n const configName = decoder.readString()\n const configValue = decoder.readString()\n const readOnly = decoder.readBoolean()\n const isDefault = decoder.readBoolean()\n const isSensitive = decoder.readBoolean()\n\n /**\n * Backporting ConfigSource value to v0\n * @see https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/DescribeConfigsResponse.java#L232-L242\n */\n let configSource\n if (isDefault) {\n configSource = ConfigSource.DEFAULT_CONFIG\n } else {\n switch (resourceType) {\n case ConfigResourceTypes.BROKER:\n configSource = ConfigSource.STATIC_BROKER_CONFIG\n break\n case ConfigResourceTypes.TOPIC:\n configSource = ConfigSource.TOPIC_CONFIG\n break\n default:\n configSource = ConfigSource.UNKNOWN\n }\n }\n\n return {\n configName,\n configValue,\n readOnly,\n isDefault,\n configSource,\n isSensitive,\n }\n}\n\nconst decodeResources = decoder => {\n const errorCode = decoder.readInt16()\n const errorMessage = decoder.readString()\n const resourceType = decoder.readInt8()\n const resourceName = decoder.readString()\n const configEntries = decoder.readArray(decoder => decodeConfigEntries(decoder, resourceType))\n\n return {\n errorCode,\n errorMessage,\n resourceType,\n resourceName,\n configEntries,\n }\n}\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nconst parse = async data => {\n const resourcesWithError = data.resources.filter(({ errorCode }) => failure(errorCode))\n if (resourcesWithError.length > 0) {\n throw createErrorFromCode(resourcesWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeConfigs: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeConfigs Request (Version: 1) => [resources] include_synonyms\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n * include_synonyms => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n * @param [includeSynonyms=false]\n */\nmodule.exports = ({ resources, includeSynonyms = false }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'DescribeConfigs',\n encode: async () => {\n return new Encoder().writeArray(resources.map(encodeResource)).writeBoolean(includeSynonyms)\n },\n})\n\nconst encodeResource = ({ type, name, configNames = [] }) => {\n return new Encoder()\n .writeInt8(type)\n .writeString(name)\n .writeNullableArray(configNames)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst { DEFAULT_CONFIG } = require('../../../configSource')\n\n/**\n * DescribeConfigs Response (Version: 1) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only config_source is_sensitive [config_synonyms]\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * config_source => INT8\n * is_sensitive => BOOLEAN\n * config_synonyms => config_name config_value config_source\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * config_source => INT8\n */\n\nconst decodeSynonyms = decoder => ({\n configName: decoder.readString(),\n configValue: decoder.readString(),\n configSource: decoder.readInt8(),\n})\n\nconst decodeConfigEntries = decoder => {\n const configName = decoder.readString()\n const configValue = decoder.readString()\n const readOnly = decoder.readBoolean()\n const configSource = decoder.readInt8()\n const isSensitive = decoder.readBoolean()\n const configSynonyms = decoder.readArray(decodeSynonyms)\n\n return {\n configName,\n configValue,\n readOnly,\n isDefault: configSource === DEFAULT_CONFIG,\n configSource,\n isSensitive,\n configSynonyms,\n }\n}\n\nconst decodeResources = decoder => ({\n errorCode: decoder.readInt16(),\n errorMessage: decoder.readString(),\n resourceType: decoder.readInt8(),\n resourceName: decoder.readString(),\n configEntries: decoder.readArray(decodeConfigEntries),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const resources = decoder.readArray(decodeResources)\n\n return {\n throttleTime,\n resources,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * DescribeConfigs Request (Version: 1) => [resources] include_synonyms\n * resources => resource_type resource_name [config_names]\n * resource_type => INT8\n * resource_name => STRING\n * config_names => STRING\n * include_synonyms => BOOLEAN\n */\n\n/**\n * @param {Array} resources An array of config resources to be returned\n * @param [includeSynonyms=false]\n */\nmodule.exports = ({ resources, includeSynonyms }) =>\n Object.assign(requestV1({ resources, includeSynonyms }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DescribeConfigs Response (Version: 2) => throttle_time_ms [resources]\n * throttle_time_ms => INT32\n * resources => error_code error_message resource_type resource_name [config_entries]\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * resource_type => INT8\n * resource_name => STRING\n * config_entries => config_name config_value read_only config_source is_sensitive [config_synonyms]\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * read_only => BOOLEAN\n * config_source => INT8\n * is_sensitive => BOOLEAN\n * config_synonyms => config_name config_value config_source\n * config_name => STRING\n * config_value => NULLABLE_STRING\n * config_source => INT8\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupIds }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupIds }), response }\n },\n 1: ({ groupIds }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupIds }), response }\n },\n 2: ({ groupIds }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ groupIds }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { DescribeGroups: apiKey } = require('../../apiKeys')\n\n/**\n * DescribeGroups Request (Version: 0) => [group_ids]\n * group_ids => STRING\n */\n\n/**\n * @param {Array} groupIds List of groupIds to request metadata for (an empty groupId array will return empty group metadata)\n */\nmodule.exports = ({ groupIds }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'DescribeGroups',\n encode: async () => {\n return new Encoder().writeArray(groupIds)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * DescribeGroups Response (Version: 0) => [groups]\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decoderMember = decoder => ({\n memberId: decoder.readString(),\n clientId: decoder.readString(),\n clientHost: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n memberAssignment: decoder.readBytes(),\n})\n\nconst decodeGroup = decoder => ({\n errorCode: decoder.readInt16(),\n groupId: decoder.readString(),\n state: decoder.readString(),\n protocolType: decoder.readString(),\n protocol: decoder.readString(),\n members: decoder.readArray(decoderMember),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const groups = decoder.readArray(decodeGroup)\n\n return {\n groups,\n }\n}\n\nconst parse = async data => {\n const groupsWithError = data.groups.filter(({ errorCode }) => failure(errorCode))\n if (groupsWithError.length > 0) {\n throw createErrorFromCode(groupsWithError[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * DescribeGroups Request (Version: 1) => [group_ids]\n * group_ids => STRING\n */\n\nmodule.exports = ({ groupIds }) => Object.assign(requestV0({ groupIds }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * DescribeGroups Response (Version: 1) => throttle_time_ms [groups]\n * throttle_time_ms => INT32\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decoderMember = decoder => ({\n memberId: decoder.readString(),\n clientId: decoder.readString(),\n clientHost: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n memberAssignment: decoder.readBytes(),\n})\n\nconst decodeGroup = decoder => ({\n errorCode: decoder.readInt16(),\n groupId: decoder.readString(),\n state: decoder.readString(),\n protocolType: decoder.readString(),\n protocol: decoder.readString(),\n members: decoder.readArray(decoderMember),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const groups = decoder.readArray(decodeGroup)\n\n return {\n throttleTime,\n groups,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * DescribeGroups Request (Version: 2) => [group_ids]\n * group_ids => STRING\n */\n\nmodule.exports = ({ groupIds }) => Object.assign(requestV1({ groupIds }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * DescribeGroups Response (Version: 2) => throttle_time_ms [groups]\n * throttle_time_ms => INT32\n * groups => error_code group_id state protocol_type protocol [members]\n * error_code => INT16\n * group_id => STRING\n * state => STRING\n * protocol_type => STRING\n * protocol => STRING\n * members => member_id client_id client_host member_metadata member_assignment\n * member_id => STRING\n * client_id => STRING\n * client_host => STRING\n * member_metadata => BYTES\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, producerId, producerEpoch, transactionResult }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ transactionalId, producerId, producerEpoch, transactionResult }),\n response,\n }\n },\n 1: ({ transactionalId, producerId, producerEpoch, transactionResult }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ transactionalId, producerId, producerEpoch, transactionResult }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { EndTxn: apiKey } = require('../../apiKeys')\n\n/**\n * EndTxn Request (Version: 0) => transactional_id producer_id producer_epoch transaction_result\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * transaction_result => BOOLEAN\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, transactionResult }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'EndTxn',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeBoolean(transactionResult)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * EndTxn Response (Version: 0) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * EndTxn Request (Version: 1) => transactional_id producer_id producer_epoch transaction_result\n * transactional_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * transaction_result => BOOLEAN\n */\n\nmodule.exports = ({ transactionalId, producerId, producerEpoch, transactionResult }) =>\n Object.assign(requestV0({ transactionalId, producerId, producerEpoch, transactionResult }), {\n apiVersion: 1,\n })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * EndTxn Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const ISOLATION_LEVEL = require('../../isolationLevel')\n\n// For normal consumers, use -1\nconst REPLICA_ID = -1\nconst NETWORK_DELAY = 100\n\n/**\n * The FETCH request can block up to maxWaitTime, which can be bigger than the configured\n * request timeout. It's safer to always use the maxWaitTime\n **/\nconst requestTimeout = timeout =>\n Number.isSafeInteger(timeout + NETWORK_DELAY) ? timeout + NETWORK_DELAY : timeout\n\nconst versions = {\n 0: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 1: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 2: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 3: ({ replicaId = REPLICA_ID, maxWaitTime, minBytes, maxBytes, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ replicaId, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 4: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 5: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 6: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return {\n request: request({ replicaId, isolationLevel, maxWaitTime, minBytes, maxBytes, topics }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 7: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v7/request')\n const response = require('./v7/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 8: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v8/request')\n const response = require('./v8/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 9: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v9/request')\n const response = require('./v9/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 10: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }) => {\n const request = require('./v10/request')\n const response = require('./v10/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n 11: ({\n replicaId = REPLICA_ID,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [],\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId,\n }) => {\n const request = require('./v11/request')\n const response = require('./v11/response')\n return {\n request: request({\n replicaId,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId,\n }),\n response,\n requestTimeout: requestTimeout(maxWaitTime),\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\n\n/**\n * Fetch Request (Version: 0) => replica_id max_wait_time min_bytes [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\n/**\n * @param {number} replicaId Broker id of the follower\n * @param {number} maxWaitTime Maximum time in ms to wait for the response\n * @param {number} minBytes Minimum bytes to accumulate in the response.\n * @param {Array} topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n */\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { KafkaJSOffsetOutOfRange } = require('../../../../errors')\nconst { failure, createErrorFromCode, errorCodes } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\n\n/**\n * Fetch Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n messages: await MessageSetDecoder(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n responses,\n }\n}\n\nconst { code: OFFSET_OUT_OF_RANGE_ERROR_CODE } = errorCodes.find(\n e => e.type === 'OFFSET_OUT_OF_RANGE'\n)\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(({ topicName, partitions }) => {\n return partitions\n .filter(partition => failure(partition.errorCode))\n .map(partition => Object.assign({}, partition, { topic: topicName }))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode, topic, partition } = errors[0]\n if (errorCode === OFFSET_OUT_OF_RANGE_ERROR_CODE) {\n throw new KafkaJSOffsetOutOfRange(createErrorFromCode(errorCode), { topic, partition })\n }\n\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => {\n return Object.assign(requestV0({ replicaId, maxWaitTime, minBytes, topics }), { apiVersion: 1 })\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\n\n/**\n * Fetch Response (Version: 1) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n messages: await MessageSetDecoder(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV9 = require('../v9/request')\n\n/**\n * ZStd Compression\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-110%3A+Add+Codec+for+ZStandard+Compression\n */\n\n/**\n * Fetch Request (Version: 10) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) =>\n Object.assign(\n requestV9({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n }),\n { apiVersion: 10 }\n )\n","const { decode, parse } = require('../v9/response')\n\n/**\n * Fetch Response (Version: 10) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Allow consumers to fetch from closest replica\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+fetch+from+closest+replica\n */\n\n/**\n * Fetch Request (Version: 11) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n * rack_id => STRING\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n rackId = '',\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 11,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n .writeString(rackId)\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({\n partition,\n currentLeaderEpoch = -1,\n fetchOffset,\n logStartOffset = -1,\n maxBytes,\n}) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(currentLeaderEpoch)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 11) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * preferred_read_replica => INT32\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n preferredReadReplica: decoder.readInt32(),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const clientSideThrottleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n // Report a `throttleTime` of 0: The broker will not have throttled\n // this request, but if the `clientSideThrottleTime` is >0 then it\n // expects us to do that -- and it will ignore requests.\n return {\n throttleTime: 0,\n clientSideThrottleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, topics }) => {\n return Object.assign(requestV0({ replicaId, maxWaitTime, minBytes, topics }), { apiVersion: 2 })\n}\n","const { decode, parse } = require('../v1/response')\n\n/**\n * Fetch Response (Version: 2) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\n\n/**\n * Fetch Request (Version: 3) => replica_id max_wait_time min_bytes max_bytes [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\n/**\n * @param {number} replicaId Broker id of the follower\n * @param {number} maxWaitTime Maximum time in ms to wait for the response\n * @param {number} minBytes Minimum bytes to accumulate in the response.\n * @param {number} maxBytes Maximum bytes to accumulate in the response. Note that this is not an absolute maximum,\n * if the first message in the first non-empty partition of the fetch is larger than this value,\n * the message will still be returned to ensure that progress can be made.\n * @param {Array} topics Topics to fetch\n * [\n * {\n * topic: 'topic-name',\n * partitions: [\n * {\n * partition: 0,\n * fetchOffset: '4124',\n * maxBytes: 2048\n * }\n * ]\n * }\n * ]\n */\nmodule.exports = ({ replicaId, maxWaitTime, minBytes, maxBytes, topics }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const { decode, parse } = require('../v1/response')\n\n/**\n * Fetch Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Decoder = require('../../../decoder')\nconst MessageSetDecoder = require('../../../messageSet/decoder')\nconst RecordBatchDecoder = require('../../../recordBatch/v0/decoder')\nconst { MAGIC_BYTE } = require('../../../recordBatch/v0')\n\n// the magic offset is at the same offset for all current message formats, but the 4 bytes\n// between the size and the magic is dependent on the version.\nconst MAGIC_OFFSET = 16\nconst RECORD_BATCH_OVERHEAD = 49\n\nconst decodeMessages = async decoder => {\n const messagesSize = decoder.readInt32()\n\n if (messagesSize <= 0 || !decoder.canReadBytes(messagesSize)) {\n return []\n }\n\n const messagesBuffer = decoder.readBytes(messagesSize)\n const messagesDecoder = new Decoder(messagesBuffer)\n const magicByte = messagesBuffer.slice(MAGIC_OFFSET).readInt8(0)\n\n if (magicByte === MAGIC_BYTE) {\n const records = []\n\n while (messagesDecoder.canReadBytes(RECORD_BATCH_OVERHEAD)) {\n try {\n const recordBatch = await RecordBatchDecoder(messagesDecoder)\n records.push(...recordBatch.records)\n } catch (e) {\n // The tail of the record batches can have incomplete records\n // due to how maxBytes works. See https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-FetchAPI\n if (e.name === 'KafkaJSPartialMessageError') {\n break\n }\n\n throw e\n }\n }\n\n return records\n }\n\n return MessageSetDecoder(messagesDecoder, messagesSize)\n}\n\nmodule.exports = decodeMessages\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Fetch Request (Version: 4) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) => ({\n apiKey,\n apiVersion: 4,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('./decodeMessages')\n\n/**\n * Fetch Response (Version: 4) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Fetch Request (Version: 5) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, logStartOffset = -1, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 5) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV5 = require('../v5/request')\n\n/**\n * Fetch Request (Version: 6) => replica_id max_wait_time min_bytes max_bytes isolation_level [topics]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n}) =>\n Object.assign(\n requestV5({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n }),\n { apiVersion: 6 }\n )\n","const { decode, parse } = require('../v5/response')\n\n/**\n * Fetch Response (Version: 6) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Sessions are only used by followers\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-227%3A+Introduce+Incremental+FetchRequests+to+Increase+Partition+Scalability\n */\n\n/**\n * Fetch Request (Version: 7) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 7,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, fetchOffset, logStartOffset = -1, maxBytes }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 7) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n return {\n throttleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const ISOLATION_LEVEL = require('../../../isolationLevel')\nconst requestV7 = require('../v7/request')\n\n/**\n * Quota violation brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n */\n\n/**\n * Fetch Request (Version: 8) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) =>\n Object.assign(\n requestV7({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel,\n sessionId,\n sessionEpoch,\n forgottenTopics,\n }),\n { apiVersion: 8 }\n )\n","const Decoder = require('../../../decoder')\nconst { parse: parseV1 } = require('../v1/response')\nconst decodeMessages = require('../v4/decodeMessages')\n\n/**\n * Fetch Response (Version: 8) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nconst decodeAbortedTransactions = decoder => ({\n producerId: decoder.readInt64().toString(),\n firstOffset: decoder.readInt64().toString(),\n})\n\nconst decodePartition = async decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n highWatermark: decoder.readInt64().toString(),\n lastStableOffset: decoder.readInt64().toString(),\n lastStartOffset: decoder.readInt64().toString(),\n abortedTransactions: decoder.readArray(decodeAbortedTransactions),\n messages: await decodeMessages(decoder),\n})\n\nconst decodeResponse = async decoder => ({\n topicName: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const clientSideThrottleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const sessionId = decoder.readInt32()\n const responses = await decoder.readArrayAsync(decodeResponse)\n\n // Report a `throttleTime` of 0: The broker will not have throttled\n // this request, but if the `clientSideThrottleTime` is >0 then it\n // expects us to do that -- and it will ignore requests.\n return {\n throttleTime: 0,\n clientSideThrottleTime,\n errorCode,\n sessionId,\n responses,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV1,\n}\n","const Encoder = require('../../../encoder')\nconst { Fetch: apiKey } = require('../../apiKeys')\nconst ISOLATION_LEVEL = require('../../../isolationLevel')\n\n/**\n * Allow fetchers to detect and handle log truncation\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-320%3A+Allow+fetchers+to+detect+and+handle+log+truncation\n */\n\n/**\n * Fetch Request (Version: 9) => replica_id max_wait_time min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data]\n * replica_id => INT32\n * max_wait_time => INT32\n * min_bytes => INT32\n * max_bytes => INT32\n * isolation_level => INT8\n * session_id => INT32\n * session_epoch => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition current_leader_epoch fetch_offset log_start_offset partition_max_bytes\n * partition => INT32\n * current_leader_epoch => INT32\n * fetch_offset => INT64\n * log_start_offset => INT64\n * partition_max_bytes => INT32\n * forgotten_topics_data => topic [partitions]\n * topic => STRING\n * partitions => INT32\n */\n\nmodule.exports = ({\n replicaId,\n maxWaitTime,\n minBytes,\n maxBytes,\n topics,\n isolationLevel = ISOLATION_LEVEL.READ_COMMITTED,\n sessionId = 0,\n sessionEpoch = -1,\n forgottenTopics = [], // Topics to remove from the fetch session\n}) => ({\n apiKey,\n apiVersion: 9,\n apiName: 'Fetch',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt32(maxWaitTime)\n .writeInt32(minBytes)\n .writeInt32(maxBytes)\n .writeInt8(isolationLevel)\n .writeInt32(sessionId)\n .writeInt32(sessionEpoch)\n .writeArray(topics.map(encodeTopic))\n .writeArray(forgottenTopics.map(encodeForgottenTopics))\n },\n})\n\nconst encodeForgottenTopics = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions)\n}\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({\n partition,\n currentLeaderEpoch = -1,\n fetchOffset,\n logStartOffset = -1,\n maxBytes,\n}) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(currentLeaderEpoch)\n .writeInt64(fetchOffset)\n .writeInt64(logStartOffset)\n .writeInt32(maxBytes)\n}\n","const { decode, parse } = require('../v8/response')\n\n/**\n * Fetch Response (Version: 9) => throttle_time_ms error_code session_id [responses]\n * throttle_time_ms => INT32\n * error_code => INT16\n * session_id => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition_header record_set\n * partition_header => partition error_code high_watermark last_stable_offset log_start_offset [aborted_transactions]\n * partition => INT32\n * error_code => INT16\n * high_watermark => INT64\n * last_stable_offset => INT64\n * log_start_offset => INT64\n * aborted_transactions => producer_id first_offset\n * producer_id => INT64\n * first_offset => INT64\n * record_set => RECORDS\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const COORDINATOR_TYPES = require('../../coordinatorTypes')\n\nconst versions = {\n 0: ({ groupId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupId }), response }\n },\n 1: ({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ coordinatorKey: groupId, coordinatorType }), response }\n },\n 2: ({ groupId, coordinatorType = COORDINATOR_TYPES.GROUP }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ coordinatorKey: groupId, coordinatorType }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { GroupCoordinator: apiKey } = require('../../apiKeys')\n\n/**\n * FindCoordinator Request (Version: 0) => group_id\n * group_id => STRING\n */\n\nmodule.exports = ({ groupId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'GroupCoordinator',\n encode: async () => {\n return new Encoder().writeString(groupId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * FindCoordinator Response (Version: 0) => error_code coordinator\n * error_code => INT16\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const coordinator = {\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n }\n\n return {\n errorCode,\n coordinator,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { GroupCoordinator: apiKey } = require('../../apiKeys')\n\n/**\n * FindCoordinator Request (Version: 1) => coordinator_key coordinator_type\n * coordinator_key => STRING\n * coordinator_type => INT8\n */\n\nmodule.exports = ({ coordinatorKey, coordinatorType }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'GroupCoordinator',\n encode: async () => {\n return new Encoder().writeString(coordinatorKey).writeInt8(coordinatorType)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * FindCoordinator Response (Version: 1) => throttle_time_ms error_code error_message coordinator\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n const errorMessage = decoder.readString()\n const coordinator = {\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n }\n\n return {\n throttleTime,\n errorCode,\n errorMessage,\n coordinator,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * FindCoordinator Request (Version: 2) => coordinator_key coordinator_type\n * coordinator_key => STRING\n * coordinator_type => INT8\n */\n\nmodule.exports = ({ coordinatorKey, coordinatorType }) =>\n Object.assign(requestV1({ coordinatorKey, coordinatorType }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * Starting in version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * FindCoordinator Response (Version: 1) => throttle_time_ms error_code error_message coordinator\n * throttle_time_ms => INT32\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * coordinator => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 1: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 2: ({ groupId, groupGenerationId, memberId }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, groupGenerationId, memberId }),\n response,\n }\n },\n 3: ({ groupId, groupGenerationId, memberId, groupInstanceId }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, groupGenerationId, memberId, groupInstanceId }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Heartbeat: apiKey } = require('../../apiKeys')\n\n/**\n * Heartbeat Request (Version: 0) => group_id group_generation_id member_id\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Heartbeat',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * Heartbeat Response (Version: 0) => error_code\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { errorCode }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * Heartbeat Request (Version: 1) => group_id generation_id member_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) =>\n Object.assign(requestV0({ groupId, groupGenerationId, memberId }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Heartbeat Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime, errorCode }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Heartbeat Request (Version: 2) => group_id generation_id member_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId }) =>\n Object.assign(requestV1({ groupId, groupGenerationId, memberId }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * Heartbeat Response (Version: 2) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Heartbeat: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 adds group_instance_id to indicate member identity across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * Heartbeat Request (Version: 3) => group_id generation_id member_id group_instance_id\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, groupInstanceId }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Heartbeat',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeString(groupInstanceId)\n },\n})\n","const { parse, decode } = require('../v2/response')\n\n/**\n * Heartbeat Response (Version: 3) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const apiKeys = require('./apiKeys')\nconst { KafkaJSServerDoesNotSupportApiKey, KafkaJSNotImplemented } = require('../../errors')\n\n/**\n * @typedef {(options?: Object) => { request: any, response: any, logResponseErrors?: boolean }} Request\n */\n\n/**\n * @typedef {Object} RequestDefinitions\n * @property {string[]} versions\n * @property {({ version: number }) => Request} protocol\n */\n\n/**\n * @typedef {(apiKey: number, definitions: RequestDefinitions) => Request} Lookup\n */\n\n/** @type {RequestDefinitions} */\nconst noImplementedRequestDefinitions = {\n versions: [],\n protocol: () => {\n throw new KafkaJSNotImplemented()\n },\n}\n\n/**\n * @type {{[apiName: string]: RequestDefinitions}}\n */\nconst requests = {\n Produce: require('./produce'),\n Fetch: require('./fetch'),\n ListOffsets: require('./listOffsets'),\n Metadata: require('./metadata'),\n LeaderAndIsr: noImplementedRequestDefinitions,\n StopReplica: noImplementedRequestDefinitions,\n UpdateMetadata: noImplementedRequestDefinitions,\n ControlledShutdown: noImplementedRequestDefinitions,\n OffsetCommit: require('./offsetCommit'),\n OffsetFetch: require('./offsetFetch'),\n GroupCoordinator: require('./findCoordinator'),\n JoinGroup: require('./joinGroup'),\n Heartbeat: require('./heartbeat'),\n LeaveGroup: require('./leaveGroup'),\n SyncGroup: require('./syncGroup'),\n DescribeGroups: require('./describeGroups'),\n ListGroups: require('./listGroups'),\n SaslHandshake: require('./saslHandshake'),\n ApiVersions: require('./apiVersions'),\n CreateTopics: require('./createTopics'),\n DeleteTopics: require('./deleteTopics'),\n DeleteRecords: require('./deleteRecords'),\n InitProducerId: require('./initProducerId'),\n OffsetForLeaderEpoch: noImplementedRequestDefinitions,\n AddPartitionsToTxn: require('./addPartitionsToTxn'),\n AddOffsetsToTxn: require('./addOffsetsToTxn'),\n EndTxn: require('./endTxn'),\n WriteTxnMarkers: noImplementedRequestDefinitions,\n TxnOffsetCommit: require('./txnOffsetCommit'),\n DescribeAcls: require('./describeAcls'),\n CreateAcls: require('./createAcls'),\n DeleteAcls: require('./deleteAcls'),\n DescribeConfigs: require('./describeConfigs'),\n AlterConfigs: require('./alterConfigs'),\n AlterReplicaLogDirs: noImplementedRequestDefinitions,\n DescribeLogDirs: noImplementedRequestDefinitions,\n SaslAuthenticate: require('./saslAuthenticate'),\n CreatePartitions: require('./createPartitions'),\n CreateDelegationToken: noImplementedRequestDefinitions,\n RenewDelegationToken: noImplementedRequestDefinitions,\n ExpireDelegationToken: noImplementedRequestDefinitions,\n DescribeDelegationToken: noImplementedRequestDefinitions,\n DeleteGroups: require('./deleteGroups'),\n}\n\nconst names = Object.keys(apiKeys)\nconst keys = Object.values(apiKeys)\nconst findApiName = apiKey => names[keys.indexOf(apiKey)]\n\n/**\n * @param {import(\"../../../types\").ApiVersions} versions\n * @returns {Lookup}\n */\nconst lookup = versions => (apiKey, definition) => {\n const version = versions[apiKey]\n const availableVersions = definition.versions.map(Number)\n const bestImplementedVersion = Math.max(...availableVersions)\n\n if (!version || version.maxVersion == null) {\n throw new KafkaJSServerDoesNotSupportApiKey(\n `The Kafka server does not support the requested API version`,\n { apiKey, apiName: findApiName(apiKey) }\n )\n }\n\n const bestSupportedVersion = Math.min(bestImplementedVersion, version.maxVersion)\n return definition.protocol({ version: bestSupportedVersion })\n}\n\nmodule.exports = {\n requests,\n lookup,\n}\n","const versions = {\n 0: ({ transactionalId, transactionTimeout = 5000 }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ transactionalId, transactionTimeout }), response }\n },\n 1: ({ transactionalId, transactionTimeout = 5000 }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ transactionalId, transactionTimeout }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { InitProducerId: apiKey } = require('../../apiKeys')\n\n/**\n * InitProducerId Request (Version: 0) => transactional_id transaction_timeout_ms\n * transactional_id => NULLABLE_STRING\n * transaction_timeout_ms => INT32\n */\n\nmodule.exports = ({ transactionalId, transactionTimeout }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'InitProducerId',\n encode: async () => {\n return new Encoder().writeString(transactionalId).writeInt32(transactionTimeout)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * InitProducerId Response (Version: 0) => throttle_time_ms error_code producer_id producer_epoch\n * throttle_time_ms => INT32\n * error_code => INT16\n * producer_id => INT64\n * producer_epoch => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n producerId: decoder.readInt64().toString(),\n producerEpoch: decoder.readInt16(),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * InitProducerId Request (Version: 1) => transactional_id transaction_timeout_ms\n * transactional_id => NULLABLE_STRING\n * transaction_timeout_ms => INT32\n */\n\nmodule.exports = ({ transactionalId, transactionTimeout }) =>\n Object.assign(requestV0({ transactionalId, transactionTimeout }), { apiVersion: 1 })\n","const { parse, decode: decodeV0 } = require('../v0/response')\n\n/**\n * Starting in version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * InitProducerId Response (Version: 0) => throttle_time_ms error_code producer_id producer_epoch\n * throttle_time_ms => INT32\n * error_code => INT16\n * producer_id => INT64\n * producer_epoch => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV0(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const NETWORK_DELAY = 5000\n\n/**\n * @see https://github.com/apache/kafka/pull/5203\n * The JOIN_GROUP request may block up to sessionTimeout (or rebalanceTimeout in JoinGroupV1),\n * so we should override the requestTimeout to be a bit more than the sessionTimeout\n * NOTE: the sessionTimeout can be configured as Number.MAX_SAFE_INTEGER and overflow when\n * increased, so we have to check for potential overflows\n **/\nconst requestTimeout = ({ rebalanceTimeout, sessionTimeout }) => {\n const timeout = rebalanceTimeout || sessionTimeout\n return Number.isSafeInteger(timeout + NETWORK_DELAY) ? timeout + NETWORK_DELAY : timeout\n}\n\nconst logResponseError = memberId => memberId != null && memberId !== ''\n\nconst versions = {\n 0: ({ groupId, sessionTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout: null, sessionTimeout }),\n }\n },\n 1: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 2: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 3: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n }\n },\n 4: ({ groupId, sessionTimeout, rebalanceTimeout, memberId, protocolType, groupProtocols }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n logResponseError: logResponseError(memberId),\n }\n },\n 5: ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId,\n protocolType,\n groupProtocols,\n }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n\n return {\n request: request({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId,\n protocolType,\n groupProtocols,\n }),\n response,\n requestTimeout: requestTimeout({ rebalanceTimeout, sessionTimeout }),\n logResponseError: logResponseError(memberId),\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * JoinGroup Request (Version: 0) => group_id session_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({ groupId, sessionTimeout, memberId, protocolType, groupProtocols }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeString(memberId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 0) => error_code generation_id group_protocol leader_id member_id [members]\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * JoinGroup Request (Version: 1) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeInt32(rebalanceTimeout)\n .writeString(memberId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * JoinGroup Response (Version: 1) => error_code generation_id group_protocol leader_id member_id [members]\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * JoinGroup Request (Version: 2) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV1({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 2 }\n )\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * JoinGroup Response (Version: 2) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * JoinGroup Request (Version: 3) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV2({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 3 }\n )\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * Starting in version 3, on quota violation, brokers send out responses\n * before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * JoinGroup Response (Version: 3) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Starting in version 4, the client needs to issue a second request to join group\n * with assigned id.\n *\n * JoinGroup Request (Version: 4) => group_id session_timeout rebalance_timeout member_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n}) =>\n Object.assign(\n requestV3({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n protocolType,\n groupProtocols,\n }),\n { apiVersion: 4 }\n )\n","const { decode } = require('../v3/response')\nconst { KafkaJSMemberIdRequired } = require('../../../../errors')\nconst { failure, createErrorFromCode, errorCodes } = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 4) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id member_metadata\n * member_id => STRING\n * member_metadata => BYTES\n */\n\nconst { code: MEMBER_ID_REQUIRED_ERROR_CODE } = errorCodes.find(\n e => e.type === 'MEMBER_ID_REQUIRED'\n)\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n if (data.errorCode === MEMBER_ID_REQUIRED_ERROR_CODE) {\n throw new KafkaJSMemberIdRequired(createErrorFromCode(data.errorCode), {\n memberId: data.memberId,\n })\n }\n\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 5 adds group_instance_id to identify members across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * JoinGroup Request (Version: 5) => group_id session_timeout rebalance_timeout member_id group_instance_id protocol_type [group_protocols]\n * group_id => STRING\n * session_timeout => INT32\n * rebalance_timeout => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * protocol_type => STRING\n * group_protocols => protocol_name protocol_metadata\n * protocol_name => STRING\n * protocol_metadata => BYTES\n */\n\nmodule.exports = ({\n groupId,\n sessionTimeout,\n rebalanceTimeout,\n memberId,\n groupInstanceId = null,\n protocolType,\n groupProtocols,\n}) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'JoinGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(sessionTimeout)\n .writeInt32(rebalanceTimeout)\n .writeString(memberId)\n .writeString(groupInstanceId)\n .writeString(protocolType)\n .writeArray(groupProtocols.map(encodeGroupProtocols))\n },\n})\n\nconst encodeGroupProtocols = ({ name, metadata = Buffer.alloc(0) }) => {\n return new Encoder().writeString(name).writeBytes(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { KafkaJSMemberIdRequired } = require('../../../../errors')\nconst {\n failure,\n createErrorFromCode,\n errorCodes,\n failIfVersionNotSupported,\n} = require('../../../error')\n\n/**\n * JoinGroup Response (Version: 5) => throttle_time_ms error_code generation_id group_protocol leader_id member_id [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * generation_id => INT32\n * group_protocol => STRING\n * leader_id => STRING\n * member_id => STRING\n * members => member_id group_instance_id metadata\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * member_metadata => BYTES\n */\nconst { code: MEMBER_ID_REQUIRED_ERROR_CODE } = errorCodes.find(\n e => e.type === 'MEMBER_ID_REQUIRED'\n)\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n if (data.errorCode === MEMBER_ID_REQUIRED_ERROR_CODE) {\n throw new KafkaJSMemberIdRequired(createErrorFromCode(data.errorCode), {\n memberId: data.memberId,\n })\n }\n\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime: 0,\n clientSideThrottleTime: throttleTime,\n errorCode,\n generationId: decoder.readInt32(),\n groupProtocol: decoder.readString(),\n leaderId: decoder.readString(),\n memberId: decoder.readString(),\n members: decoder.readArray(decoder => ({\n memberId: decoder.readString(),\n groupInstanceId: decoder.readString(),\n memberMetadata: decoder.readBytes(),\n })),\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ groupId, memberId }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 1: ({ groupId, memberId }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 2: ({ groupId, memberId }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, memberId }),\n response,\n }\n },\n 3: ({ groupId, memberId, groupInstanceId }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, members: [{ memberId, groupInstanceId }] }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { LeaveGroup: apiKey } = require('../../apiKeys')\n\n/**\n * LeaveGroup Request (Version: 0) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'LeaveGroup',\n encode: async () => {\n return new Encoder().writeString(groupId).writeString(memberId)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * LeaveGroup Response (Version: 0) => error_code\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { errorCode }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * LeaveGroup Request (Version: 1) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) =>\n Object.assign(requestV0({ groupId, memberId }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * LeaveGroup Response (Version: 1) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime, errorCode }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * LeaveGroup Request (Version: 2) => group_id member_id\n * group_id => STRING\n * member_id => STRING\n */\n\nmodule.exports = ({ groupId, memberId }) =>\n Object.assign(requestV1({ groupId, memberId }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * LeaveGroup Response (Version: 2) => throttle_time_ms error_code\n * throttle_time_ms => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { LeaveGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 changes leavegroup to operate on a batch of members\n * and adds group_instance_id to identify members across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * LeaveGroup Request (Version: 3) => group_id [members]\n * group_id => STRING\n * members => member_id group_instance_id\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, members }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'LeaveGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeArray(members.map(member => encodeMember(member)))\n },\n})\n\nconst encodeMember = ({ memberId, groupInstanceId = null }) => {\n return new Encoder().writeString(memberId).writeString(groupInstanceId)\n}\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported, failure, createErrorFromCode } = require('../../../error')\nconst { parse: parseV2 } = require('../v2/response')\n\n/**\n * LeaveGroup Response (Version: 3) => throttle_time_ms error_code [members]\n * throttle_time_ms => INT32\n * error_code => INT16\n * members => member_id group_instance_id error_code\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const members = decoder.readArray(decodeMembers)\n\n failIfVersionNotSupported(errorCode)\n\n return { throttleTime: 0, clientSideThrottleTime: throttleTime, errorCode, members }\n}\n\nconst decodeMembers = decoder => ({\n memberId: decoder.readString(),\n groupInstanceId: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const parsed = parseV2(data)\n\n const memberWithError = data.members.find(member => failure(member.errorCode))\n if (memberWithError) {\n throw createErrorFromCode(memberWithError.errorCode)\n }\n\n return parsed\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: () => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request(), response }\n },\n 1: () => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request(), response }\n },\n 2: () => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request(), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ListGroups: apiKey } = require('../../apiKeys')\n\n/**\n * ListGroups Request (Version: 0)\n */\n\n/**\n */\nmodule.exports = () => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ListGroups',\n encode: async () => {\n return new Encoder()\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * ListGroups Response (Version: 0) => error_code [groups]\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\n\nconst decodeGroup = decoder => ({\n groupId: decoder.readString(),\n protocolType: decoder.readString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n const groups = decoder.readArray(decodeGroup)\n\n return {\n errorCode,\n groups,\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decodeGroup,\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * ListGroups Request (Version: 1)\n */\n\nmodule.exports = () => Object.assign(requestV0(), { apiVersion: 1 })\n","const responseV0 = require('../v0/response')\n\nconst Decoder = require('../../../decoder')\n\n/**\n * ListGroups Response (Version: 1) => error_code [groups]\n * throttle_time_ms => INT32\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n const groups = decoder.readArray(responseV0.decodeGroup)\n\n return {\n throttleTime,\n errorCode,\n groups,\n }\n}\n\nmodule.exports = {\n decode,\n parse: responseV0.parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * ListGroups Request (Version: 2)\n */\n\nmodule.exports = () => Object.assign(requestV1(), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ListGroups Response (Version: 2) => error_code [groups]\n * throttle_time_ms => INT32\n * error_code => INT16\n * groups => group_id protocol_type\n * group_id => STRING\n * protocol_type => STRING\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const ISOLATION_LEVEL = require('../../isolationLevel')\n\n// For normal consumers, use -1\nconst REPLICA_ID = -1\n\nconst versions = {\n 0: ({ replicaId = REPLICA_ID, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ replicaId, topics }), response }\n },\n 1: ({ replicaId = REPLICA_ID, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ replicaId, topics }), response }\n },\n 2: ({ replicaId = REPLICA_ID, isolationLevel = ISOLATION_LEVEL.READ_COMMITTED, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ replicaId, isolationLevel, topics }), response }\n },\n 3: ({ replicaId = REPLICA_ID, isolationLevel = ISOLATION_LEVEL.READ_COMMITTED, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ replicaId, isolationLevel, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 0) => replica_id [topics]\n * replica_id => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp max_num_offsets\n * partition => INT32\n * timestamp => INT64\n * max_num_offsets => INT32\n */\n\n/**\n * @param {number} replicaId\n * @param {object} topics use timestamp=-1 for latest offsets and timestamp=-2 for earliest.\n * Default timestamp=-1. Example:\n * {\n * topics: [\n * {\n * topic: 'topic-name',\n * partitions: [{ partition: 0, timestamp: -1 }]\n * }\n * ]\n * }\n */\nmodule.exports = ({ replicaId, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder().writeInt32(replicaId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1, maxNumOffsets = 1 }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(timestamp)\n .writeInt32(maxNumOffsets)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Offsets Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code [offsets]\n * partition => INT32\n * error_code => INT16\n * offsets => INT64\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offsets: decoder.readArray(decodeOffsets),\n})\n\nconst decodeOffsets = decoder => decoder.readInt64().toString()\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 1) => replica_id [topics]\n * replica_id => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder().writeInt32(replicaId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1 }) => {\n return new Encoder().writeInt32(partition).writeInt64(timestamp)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * ListOffsets Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n timestamp: decoder.readInt64().toString(),\n offset: decoder.readInt64().toString(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { ListOffsets: apiKey } = require('../../apiKeys')\n\n/**\n * ListOffsets Request (Version: 2) => replica_id isolation_level [topics]\n * replica_id => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, isolationLevel, topics }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'ListOffsets',\n encode: async () => {\n return new Encoder()\n .writeInt32(replicaId)\n .writeInt8(isolationLevel)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, timestamp = -1 }) => {\n return new Encoder().writeInt32(partition).writeInt64(timestamp)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * ListOffsets Response (Version: 2) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n timestamp: decoder.readInt64().toString(),\n offset: decoder.readInt64().toString(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * ListOffsets Request (Version: 3) => replica_id isolation_level [topics]\n * replica_id => INT32\n * isolation_level => INT8\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition timestamp\n * partition => INT32\n * timestamp => INT64\n */\nmodule.exports = ({ replicaId, isolationLevel, topics }) =>\n Object.assign(requestV2({ replicaId, isolationLevel, topics }), { apiVersion: 3 })\n","const { parse, decode: decodeV2 } = require('../v2/response')\n\n/**\n * In version 3 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * ListOffsets Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code timestamp offset\n * partition => INT32\n * error_code => INT16\n * timestamp => INT64\n * offset => INT64\n */\nconst decode = async rawData => {\n const decoded = await decodeV2(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ topics }), response }\n },\n 1: ({ topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ topics }), response }\n },\n 2: ({ topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ topics }), response }\n },\n 3: ({ topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ topics }), response }\n },\n 4: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n 5: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n 6: ({ topics, allowAutoTopicCreation }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return { request: request({ topics, allowAutoTopicCreation }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 0) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeArray(topics)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Metadata Response (Version: 0) => [brokers] [topic_metadata]\n * brokers => node_id host port\n * node_id => INT32\n * host => STRING\n * port => INT32\n * topic_metadata => topic_error_code topic [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n // leader: The node id for the kafka broker currently acting as leader\n // for this partition\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nconst parse = async data => {\n const topicsWithErrors = data.topicMetadata.filter(topic => failure(topic.topicErrorCode))\n if (topicsWithErrors.length > 0) {\n const { topicErrorCode } = topicsWithErrors[0]\n throw createErrorFromCode(topicErrorCode)\n }\n\n const partitionsWithErrors = data.topicMetadata.map(topic => {\n return topic.partitionMetadata.filter(partition => failure(partition.partitionErrorCode))\n })\n\n const errors = flatten(partitionsWithErrors)\n if (errors.length > 0) {\n const { partitionErrorCode } = errors[0]\n throw createErrorFromCode(partitionErrorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 1) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeNullableArray(topics)\n },\n})\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 1) => [brokers] controller_id [topic_metadata]\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => topic_error_code topic is_internal [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Metadata Request (Version: 2) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 2) => [brokers] cluster_id controller_id [topic_metadata]\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => topic_error_code topic is_internal [partition_metadata]\n * topic_error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => partition_error_code partition_id leader [replicas] [isr]\n * partition_error_code => INT16\n * partition_id => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * Metadata Request (Version: 3) => [topics]\n * topics => STRING\n */\n\nmodule.exports = ({ topics }) => Object.assign(requestV1({ topics }), { apiVersion: 3 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 3) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Encoder = require('../../../encoder')\nconst { Metadata: apiKey } = require('../../apiKeys')\n\n/**\n * Metadata Request (Version: 4) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) => ({\n apiKey,\n apiVersion: 4,\n apiName: 'Metadata',\n encode: async () => {\n return new Encoder().writeNullableArray(topics).writeBoolean(allowAutoTopicCreation)\n },\n})\n","const { parse: parseV3, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Metadata Response (Version: 4) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n */\n\nmodule.exports = {\n parse: parseV3,\n decode: decodeV3,\n}\n","const requestV4 = require('../v4/request')\n\n/**\n * Metadata Request (Version: 5) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) =>\n Object.assign(requestV4({ topics, allowAutoTopicCreation }), { apiVersion: 5 })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * Metadata Response (Version: 5) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr] [offline_replicas]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n * offline_replicas => INT32\n */\n\nconst broker = decoder => ({\n nodeId: decoder.readInt32(),\n host: decoder.readString(),\n port: decoder.readInt32(),\n rack: decoder.readString(),\n})\n\nconst topicMetadata = decoder => ({\n topicErrorCode: decoder.readInt16(),\n topic: decoder.readString(),\n isInternal: decoder.readBoolean(),\n partitionMetadata: decoder.readArray(partitionMetadata),\n})\n\nconst partitionMetadata = decoder => ({\n partitionErrorCode: decoder.readInt16(),\n partitionId: decoder.readInt32(),\n leader: decoder.readInt32(),\n replicas: decoder.readArray(d => d.readInt32()),\n isr: decoder.readArray(d => d.readInt32()),\n offlineReplicas: decoder.readArray(d => d.readInt32()),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n brokers: decoder.readArray(broker),\n clusterId: decoder.readString(),\n controllerId: decoder.readInt32(),\n topicMetadata: decoder.readArray(topicMetadata),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV5 = require('../v5/request')\n\n/**\n * Metadata Request (Version: 6) => [topics] allow_auto_topic_creation\n * topics => STRING\n * allow_auto_topic_creation => BOOLEAN\n */\n\nmodule.exports = ({ topics, allowAutoTopicCreation = true }) =>\n Object.assign(requestV5({ topics, allowAutoTopicCreation }), { apiVersion: 6 })\n","const { parse, decode: decodeV1 } = require('../v5/response')\n\n/**\n * In version 6 on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * Metadata Response (Version: 6) => throttle_time_ms [brokers] cluster_id controller_id [topic_metadata]\n * throttle_time_ms => INT32\n * brokers => node_id host port rack\n * node_id => INT32\n * host => STRING\n * port => INT32\n * rack => NULLABLE_STRING\n * cluster_id => NULLABLE_STRING\n * controller_id => INT32\n * topic_metadata => error_code topic is_internal [partition_metadata]\n * error_code => INT16\n * topic => STRING\n * is_internal => BOOLEAN\n * partition_metadata => error_code partition leader [replicas] [isr] [offline_replicas]\n * error_code => INT16\n * partition => INT32\n * leader => INT32\n * replicas => INT32\n * isr => INT32\n * offline_replicas => INT32\n */\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","// This value signals to the broker that its default configuration should be used.\nconst RETENTION_TIME = -1\n\nconst versions = {\n 0: ({ groupId, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ groupId, topics }), response }\n },\n 1: ({ groupId, groupGenerationId, memberId, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupId, groupGenerationId, memberId, topics }), response }\n },\n 2: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 3: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 4: ({ groupId, groupGenerationId, memberId, retentionTime = RETENTION_TIME, topics }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n retentionTime,\n topics,\n }),\n response,\n }\n },\n 5: ({ groupId, groupGenerationId, memberId, topics }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({\n groupId,\n groupGenerationId,\n memberId,\n topics,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 0) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder().writeString(groupId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetCommit Response (Version: 0) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 1) => group_id group_generation_id member_id [topics]\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset timestamp metadata\n * partition => INT32\n * offset => INT64\n * timestamp => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, timestamp = Date.now(), metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeInt64(timestamp)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetCommit Request (Version: 2) => group_id group_generation_id member_id retention_time [topics]\n * group_id => STRING\n * group_generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeInt64(retentionTime)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV2 = require('../v2/request')\n\n/**\n * OffsetCommit Request (Version: 3) => group_id generation_id member_id retention_time [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) =>\n Object.assign(requestV2({ groupId, groupGenerationId, memberId, retentionTime, topics }), {\n apiVersion: 3,\n })\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * OffsetCommit Response (Version: 3) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * OffsetCommit Request (Version: 4) => group_id generation_id member_id retention_time [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * retention_time => INT64\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, retentionTime, topics }) =>\n Object.assign(requestV3({ groupId, groupGenerationId, memberId, retentionTime, topics }), {\n apiVersion: 4,\n })\n","const { parse, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Starting in version 4, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * OffsetCommit Response (Version: 4) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV3(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * Version 5 removes retention_time, as this is controlled by a broker setting\n *\n * OffsetCommit Request (Version: 4) => group_id generation_id member_id [topics]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ groupId, groupGenerationId, memberId, topics }) => ({\n apiKey,\n apiVersion: 5,\n apiName: 'OffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(groupGenerationId)\n .writeString(memberId)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata = null }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const { parse, decode } = require('../v4/response')\n\n/**\n * OffsetCommit Response (Version: 5) => throttle_time_ms [responses]\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 1: ({ groupId, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ groupId, topics }), response }\n },\n 2: ({ groupId, topics }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ groupId, topics }), response }\n },\n 3: ({ groupId, topics }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return { request: request({ groupId, topics }), response }\n },\n 4: ({ groupId, topics }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return { request: request({ groupId, topics }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetFetch: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetFetch Request (Version: 1) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 1,\n apiName: 'OffsetFetch',\n encode: async () => {\n return new Encoder().writeString(groupId).writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition }) => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetFetch Response (Version: 1) => [responses]\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * OffsetFetch Request (Version: 2) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) =>\n Object.assign(requestV1({ groupId, topics }), { apiVersion: 2 })\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * OffsetFetch Response (Version: 2) => [responses] error_code\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n responses: decoder.readArray(decodeResponses),\n errorCode: decoder.readInt16(),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n const partitionsWithError = data.responses.map(response =>\n response.partitions.filter(partition => failure(partition.errorCode))\n )\n const partitionWithError = flatten(partitionsWithError)[0]\n if (partitionWithError) {\n throw createErrorFromCode(partitionWithError.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { OffsetFetch: apiKey } = require('../../apiKeys')\n\n/**\n * OffsetFetch Request (Version: 3) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'OffsetFetch',\n encode: async () => {\n return new Encoder().writeString(groupId).writeNullableArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition }) => {\n return new Encoder().writeInt32(partition)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV2 } = require('../v2/response')\n\n/**\n * OffsetFetch Response (Version: 3) => throttle_time_ms [responses] error_code\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n return {\n throttleTime: decoder.readInt32(),\n responses: decoder.readArray(decodeResponses),\n errorCode: decoder.readInt16(),\n }\n}\n\nconst decodeResponses = decoder => ({\n topic: decoder.readString(),\n partitions: decoder.readArray(decodePartitions),\n})\n\nconst decodePartitions = decoder => ({\n partition: decoder.readInt32(),\n offset: decoder.readInt64().toString(),\n metadata: decoder.readString(),\n errorCode: decoder.readInt16(),\n})\n\nmodule.exports = {\n decode,\n parse: parseV2,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * OffsetFetch Request (Version: 4) => group_id [topics]\n * group_id => STRING\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition\n * partition => INT32\n */\n\nmodule.exports = ({ groupId, topics }) =>\n Object.assign(requestV3({ groupId, topics }), { apiVersion: 4 })\n","const { parse, decode: decodeV3 } = require('../v3/response')\n\n/**\n * Starting in version 4, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * OffsetFetch Response (Version: 4) => throttle_time_ms [responses] error_code\n * throttle_time_ms => INT32\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition offset metadata error_code\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n * error_code => INT16\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV3(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ acks, timeout, topicData }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ acks, timeout, topicData }), response }\n },\n 1: ({ acks, timeout, topicData }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ acks, timeout, topicData }), response }\n },\n 2: ({ acks, timeout, topicData, compression }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return { request: request({ acks, timeout, compression, topicData }), response }\n },\n 3: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 4: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v4/request')\n const response = require('./v4/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 5: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v5/request')\n const response = require('./v5/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 6: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v6/request')\n const response = require('./v6/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n 7: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {\n const request = require('./v7/request')\n const response = require('./v7/response')\n return {\n request: request({\n acks,\n timeout,\n compression,\n topicData,\n transactionalId,\n producerId,\n producerEpoch,\n }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst MessageSet = require('../../../messageSet')\n\n/**\n * Produce Request (Version: 0) => acks timeout [topic_data]\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set record_set_size\n * partition => INT32\n * record_set_size => INT32\n * record_set => RECORDS\n */\n\n/**\n * MessageV0:\n * {\n * key: bytes,\n * value: bytes\n * }\n *\n * MessageSet:\n * [\n * { key: \"\", value: \"\" },\n * { key: \"\", value: \"\" },\n * ]\n *\n * TopicData:\n * [\n * {\n * topic: 'name1',\n * partitions: [\n * {\n * partition: 0,\n * messages: []\n * }\n * ]\n * }\n * ]\n */\n\n/**\n * @param acks {Integer} This field indicates how many acknowledgements the servers should receive before\n * responding to the request. If it is 0 the server will not send any response\n * (this is the only case where the server will not reply to a request). If it is 1,\n * the server will wait the data is written to the local log before sending a response.\n * If it is -1 the server will block until the message is committed by all in sync replicas\n * before sending a response.\n *\n * @param timeout {Integer} This provides a maximum time in milliseconds the server can await the receipt of the number\n * of acknowledgements in RequiredAcks. The timeout is not an exact limit on the request time\n * for a few reasons:\n * (1) it does not include network latency,\n * (2) the timer begins at the beginning of the processing of this request so if many requests are\n * queued due to server overload that wait time will not be included,\n * (3) we will not terminate a local write so if the local write time exceeds this timeout it will not\n * be respected. To get a hard timeout of this type the client should use the socket timeout.\n *\n * @param topicData {Array}\n */\nmodule.exports = ({ acks, timeout, topicData }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n return new Encoder()\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(topicData.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartitions))\n}\n\nconst encodePartitions = ({ partition, messages }) => {\n const messageSet = MessageSet({ messageVersion: 0, entries: messages })\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(messageSet.size())\n .writeEncoder(messageSet)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * v0\n * ProduceResponse => [TopicName [Partition ErrorCode Offset]]\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n return {\n topics,\n }\n}\n\nconst parse = async data => {\n const partitionsWithError = data.topics.map(topic => {\n return topic.partitions.filter(partition => failure(partition.errorCode))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode } = errors[0]\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n// Produce Request on or after v1 indicates the client can parse the quota throttle time\n// in the Produce Response.\n\nmodule.exports = ({ acks, timeout, topicData }) => {\n return Object.assign(requestV0({ acks, timeout, topicData }), { apiVersion: 1 })\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * v1 (supported in 0.9.0 or later)\n * ProduceResponse => [TopicName [Partition ErrorCode Offset]] ThrottleTime\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n * ThrottleTime => int32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst MessageSet = require('../../../messageSet')\nconst { Types, lookupCodec } = require('../../../message/compression')\n\n// Produce Request on or after v2 indicates the client can parse the timestamp field\n// in the produce Response.\n\nmodule.exports = ({ acks, timeout, compression = Types.None, topicData }) => ({\n apiKey,\n apiVersion: 2,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n const encodeTopic = topicEncoder(compression)\n const encodedTopicData = []\n\n for (const data of topicData) {\n encodedTopicData.push(await encodeTopic(data))\n }\n\n return new Encoder()\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(encodedTopicData)\n },\n})\n\nconst topicEncoder = compression => {\n const encodePartitions = partitionsEncoder(compression)\n\n return async ({ topic, partitions }) => {\n const encodedPartitions = []\n\n for (const data of partitions) {\n encodedPartitions.push(await encodePartitions(data))\n }\n\n return new Encoder().writeString(topic).writeArray(encodedPartitions)\n }\n}\n\nconst partitionsEncoder = compression => async ({ partition, messages }) => {\n const messageSet = MessageSet({ messageVersion: 1, compression, entries: messages })\n\n if (compression === Types.None) {\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(messageSet.size())\n .writeEncoder(messageSet)\n }\n\n const timestamp = messages[0].timestamp || Date.now()\n\n const codec = lookupCodec(compression)\n const compressedValue = await codec.compress(messageSet)\n const compressedMessageSet = MessageSet({\n messageVersion: 1,\n entries: [{ compression, timestamp, value: compressedValue }],\n })\n\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(compressedMessageSet.size())\n .writeEncoder(compressedMessageSet)\n}\n","const Decoder = require('../../../decoder')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * v2 (supported in 0.10.0 or later)\n * ProduceResponse => [TopicName [Partition ErrorCode Offset Timestamp]] ThrottleTime\n * TopicName => string\n * Partition => int32\n * ErrorCode => int16\n * Offset => int64\n * Timestamp => int64\n * ThrottleTime => int32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n offset: decoder.readInt64().toString(),\n timestamp: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const Long = require('../../../../utils/long')\nconst Encoder = require('../../../encoder')\nconst { Produce: apiKey } = require('../../apiKeys')\nconst { Types } = require('../../../message/compression')\nconst Record = require('../../../recordBatch/record/v0')\nconst { RecordBatch } = require('../../../recordBatch/v0')\n\n/**\n * Produce Request (Version: 3) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\n/**\n * @param [transactionalId=null] {String} The transactional id or null if the producer is not transactional\n * @param acks {Integer} See producer request v0\n * @param timeout {Integer} See producer request v0\n * @param [compression=CompressionTypes.None] {CompressionTypes}\n * @param topicData {Array}\n */\nmodule.exports = ({\n acks,\n timeout,\n transactionalId = null,\n producerId = Long.fromInt(-1),\n producerEpoch = 0,\n compression = Types.None,\n topicData,\n}) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'Produce',\n expectResponse: () => acks !== 0,\n encode: async () => {\n const encodeTopic = topicEncoder(compression)\n const encodedTopicData = []\n\n for (const data of topicData) {\n encodedTopicData.push(\n await encodeTopic({ ...data, transactionalId, producerId, producerEpoch })\n )\n }\n\n return new Encoder()\n .writeString(transactionalId)\n .writeInt16(acks)\n .writeInt32(timeout)\n .writeArray(encodedTopicData)\n },\n})\n\nconst topicEncoder = compression => async ({\n topic,\n partitions,\n transactionalId,\n producerId,\n producerEpoch,\n}) => {\n const encodePartitions = partitionsEncoder(compression)\n const encodedPartitions = []\n\n for (const data of partitions) {\n encodedPartitions.push(\n await encodePartitions({ ...data, transactionalId, producerId, producerEpoch })\n )\n }\n\n return new Encoder().writeString(topic).writeArray(encodedPartitions)\n}\n\nconst partitionsEncoder = compression => async ({\n partition,\n messages,\n transactionalId,\n firstSequence,\n producerId,\n producerEpoch,\n}) => {\n const dateNow = Date.now()\n const messageTimestamps = messages\n .map(m => m.timestamp)\n .filter(timestamp => timestamp != null)\n .sort()\n\n const timestamps = messageTimestamps.length === 0 ? [dateNow] : messageTimestamps\n const firstTimestamp = timestamps[0]\n const maxTimestamp = timestamps[timestamps.length - 1]\n\n const records = messages.map((message, i) =>\n Record({\n ...message,\n offsetDelta: i,\n timestampDelta: (message.timestamp || dateNow) - firstTimestamp,\n })\n )\n\n const recordBatch = await RecordBatch({\n compression,\n records,\n firstTimestamp,\n maxTimestamp,\n producerId,\n producerEpoch,\n firstSequence,\n transactional: !!transactionalId,\n lastOffsetDelta: records.length - 1,\n })\n\n return new Encoder()\n .writeInt32(partition)\n .writeInt32(recordBatch.size())\n .writeEncoder(recordBatch)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\nconst flatten = require('../../../../utils/flatten')\n\n/**\n * Produce Response (Version: 3) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * throttle_time_ms => INT32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n baseOffset: decoder.readInt64().toString(),\n logAppendTime: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nconst parse = async data => {\n const partitionsWithError = data.topics.map(response => {\n return response.partitions.filter(partition => failure(partition.errorCode))\n })\n\n const errors = flatten(partitionsWithError)\n if (errors.length > 0) {\n const { errorCode } = errors[0]\n throw createErrorFromCode(errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Produce Request (Version: 4) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV3({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 4 }\n )\n","const { decode, parse } = require('../v3/response')\n\n/**\n * Produce Response (Version: 4) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * throttle_time_ms => INT32\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV3 = require('../v3/request')\n\n/**\n * Produce Request (Version: 5) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV3({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 5 }\n )\n","const Decoder = require('../../../decoder')\nconst { parse: parseV3 } = require('../v3/response')\n\n/**\n * Produce Response (Version: 5) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nconst partition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n baseOffset: decoder.readInt64().toString(),\n logAppendTime: decoder.readInt64().toString(),\n logStartOffset: decoder.readInt64().toString(),\n})\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const topics = decoder.readArray(decoder => ({\n topicName: decoder.readString(),\n partitions: decoder.readArray(partition),\n }))\n\n const throttleTime = decoder.readInt32()\n\n return {\n topics,\n throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV3,\n}\n","const requestV5 = require('../v5/request')\n\n/**\n * The version number is bumped to indicate that on quota violation brokers send out responses before throttling.\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java#L113-L117\n *\n * Produce Request (Version: 6) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV5({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 6 }\n )\n","const { parse, decode: decodeV5 } = require('../v5/response')\n\n/**\n * The version number is bumped to indicate that on quota violation brokers send out responses before throttling.\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java#L152-L156\n *\n * Produce Response (Version: 6) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV5(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV6 = require('../v6/request')\n\n/**\n * V7 indicates ZStandard capability (see KIP-110)\n * @see https://github.com/apache/kafka/blob/9c8f75c4b624084c954b4da69f092211a9ac4689/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java#L118-L121\n *\n * Produce Request (Version: 7) => transactional_id acks timeout [topic_data]\n * transactional_id => NULLABLE_STRING\n * acks => INT16\n * timeout => INT32\n * topic_data => topic [data]\n * topic => STRING\n * data => partition record_set\n * partition => INT32\n * record_set => RECORDS\n */\n\nmodule.exports = ({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n}) =>\n Object.assign(\n requestV6({\n acks,\n timeout,\n transactionalId,\n producerId,\n producerEpoch,\n compression,\n topicData,\n }),\n { apiVersion: 7 }\n )\n","const { decode, parse } = require('../v6/response')\n\n/**\n * Produce Response (Version: 7) => [responses] throttle_time_ms\n * responses => topic [partition_responses]\n * topic => STRING\n * partition_responses => partition error_code base_offset log_append_time log_start_offset\n * partition => INT32\n * error_code => INT16\n * base_offset => INT64\n * log_append_time => INT64\n * log_start_offset => INT64\n * throttle_time_ms => INT32\n */\n\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ authBytes }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ authBytes }), response }\n },\n 1: ({ authBytes }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ authBytes }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SaslAuthenticate: apiKey } = require('../../apiKeys')\n\n/**\n * SaslAuthenticate Request (Version: 0) => sasl_auth_bytes\n * sasl_auth_bytes => BYTES\n */\n\n/**\n * @param {Buffer} authBytes - SASL authentication bytes from client as defined by the SASL mechanism\n */\nmodule.exports = ({ authBytes }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SaslAuthenticate',\n encode: async () => {\n return new Encoder().writeBuffer(authBytes)\n },\n})\n","const Decoder = require('../../../decoder')\nconst Encoder = require('../../../encoder')\nconst {\n failure,\n createErrorFromCode,\n failIfVersionNotSupported,\n errorCodes,\n} = require('../../../error')\n\nconst { KafkaJSProtocolError } = require('../../../../errors')\nconst SASL_AUTHENTICATION_FAILED = 58\nconst protocolAuthError = errorCodes.find(e => e.code === SASL_AUTHENTICATION_FAILED)\n\n/**\n * SaslAuthenticate Response (Version: 0) => error_code error_message sasl_auth_bytes\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * sasl_auth_bytes => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n const errorMessage = decoder.readString()\n\n // This is necessary to make the response compatible with the original\n // mechanism protocols. They expect a byte response, which starts with\n // the size\n const authBytesEncoder = new Encoder().writeBytes(decoder.readBytes())\n const authBytes = authBytesEncoder.buffer\n\n return {\n errorCode,\n errorMessage,\n authBytes,\n }\n}\n\nconst parse = async data => {\n if (data.errorCode === SASL_AUTHENTICATION_FAILED && data.errorMessage) {\n throw new KafkaJSProtocolError({\n ...protocolAuthError,\n message: data.errorMessage,\n })\n }\n\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * SaslAuthenticate Request (Version: 1) => sasl_auth_bytes\n * sasl_auth_bytes => BYTES\n */\n\n/**\n * @param {Buffer} authBytes - SASL authentication bytes from client as defined by the SASL mechanism\n */\nmodule.exports = ({ authBytes }) => Object.assign(requestV0({ authBytes }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst Encoder = require('../../../encoder')\nconst { parse: parseV0 } = require('../v0/response')\nconst { failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SaslAuthenticate Response (Version: 1) => error_code error_message sasl_auth_bytes\n * error_code => INT16\n * error_message => NULLABLE_STRING\n * sasl_auth_bytes => BYTES\n * session_lifetime_ms => INT64\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n const errorMessage = decoder.readString()\n\n // This is necessary to make the response compatible with the original\n // mechanism protocols. They expect a byte response, which starts with\n // the size\n const authBytesEncoder = new Encoder().writeBytes(decoder.readBytes())\n const authBytes = authBytesEncoder.buffer\n const sessionLifetimeMs = decoder.readInt64().toString()\n\n return {\n errorCode,\n errorMessage,\n authBytes,\n sessionLifetimeMs,\n }\n}\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ mechanism }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return { request: request({ mechanism }), response }\n },\n 1: ({ mechanism }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return { request: request({ mechanism }), response }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SaslHandshake: apiKey } = require('../../apiKeys')\n\n/**\n * SaslHandshake Request (Version: 0) => mechanism\n * mechanism => STRING\n */\n\n/**\n * @param {string} mechanism - SASL Mechanism chosen by the client\n */\nmodule.exports = ({ mechanism }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SaslHandshake',\n encode: async () => new Encoder().writeString(mechanism),\n})\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SaslHandshake Response (Version: 0) => error_code [enabled_mechanisms]\n * error_code => INT16\n * enabled_mechanisms => STRING\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n enabledMechanisms: decoder.readArray(decoder => decoder.readString()),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\nmodule.exports = ({ mechanism }) => ({ ...requestV0({ mechanism }), apiVersion: 1 })\n","const { decode: decodeV0, parse: parseV0 } = require('../v0/response')\n\nmodule.exports = {\n decode: decodeV0,\n parse: parseV0,\n}\n","const versions = {\n 0: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 1: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 2: ({ groupId, generationId, memberId, groupAssignment }) => {\n const request = require('./v2/request')\n const response = require('./v2/response')\n return {\n request: request({ groupId, generationId, memberId, groupAssignment }),\n response,\n }\n },\n 3: ({ groupId, generationId, memberId, groupInstanceId, groupAssignment }) => {\n const request = require('./v3/request')\n const response = require('./v3/response')\n return {\n request: request({ groupId, generationId, memberId, groupInstanceId, groupAssignment }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { SyncGroup: apiKey } = require('../../apiKeys')\n\n/**\n * SyncGroup Request (Version: 0) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'SyncGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(generationId)\n .writeString(memberId)\n .writeArray(groupAssignment.map(encodeGroupAssignment))\n },\n})\n\nconst encodeGroupAssignment = ({ memberId, memberAssignment }) => {\n return new Encoder().writeString(memberId).writeBytes(memberAssignment)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode, failIfVersionNotSupported } = require('../../../error')\n\n/**\n * SyncGroup Response (Version: 0) => error_code member_assignment\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n errorCode,\n memberAssignment: decoder.readBytes(),\n }\n}\n\nconst parse = async data => {\n if (failure(data.errorCode)) {\n throw createErrorFromCode(data.errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * SyncGroup Request (Version: 1) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) =>\n Object.assign(requestV0({ groupId, generationId, memberId, groupAssignment }), { apiVersion: 1 })\n","const Decoder = require('../../../decoder')\nconst { failIfVersionNotSupported } = require('../../../error')\nconst { parse: parseV0 } = require('../v0/response')\n\n/**\n * SyncGroup Response (Version: 1) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const errorCode = decoder.readInt16()\n\n failIfVersionNotSupported(errorCode)\n\n return {\n throttleTime,\n errorCode,\n memberAssignment: decoder.readBytes(),\n }\n}\n\nmodule.exports = {\n decode,\n parse: parseV0,\n}\n","const requestV1 = require('../v1/request')\n\n/**\n * SyncGroup Request (Version: 2) => group_id generation_id member_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({ groupId, generationId, memberId, groupAssignment }) =>\n Object.assign(requestV1({ groupId, generationId, memberId, groupAssignment }), { apiVersion: 2 })\n","const { parse, decode: decodeV1 } = require('../v1/response')\n\n/**\n * In version 2, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * SyncGroup Response (Version: 2) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const Encoder = require('../../../encoder')\nconst { SyncGroup: apiKey } = require('../../apiKeys')\n\n/**\n * Version 3 adds group_instance_id to indicate member identity across restarts.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances\n *\n * SyncGroup Request (Version: 3) => group_id generation_id member_id group_instance_id [group_assignment]\n * group_id => STRING\n * generation_id => INT32\n * member_id => STRING\n * group_instance_id => NULLABLE_STRING\n * group_assignment => member_id member_assignment\n * member_id => STRING\n * member_assignment => BYTES\n */\n\nmodule.exports = ({\n groupId,\n generationId,\n memberId,\n groupInstanceId = null,\n groupAssignment,\n}) => ({\n apiKey,\n apiVersion: 3,\n apiName: 'SyncGroup',\n encode: async () => {\n return new Encoder()\n .writeString(groupId)\n .writeInt32(generationId)\n .writeString(memberId)\n .writeString(groupInstanceId)\n .writeArray(groupAssignment.map(encodeGroupAssignment))\n },\n})\n\nconst encodeGroupAssignment = ({ memberId, memberAssignment }) => {\n return new Encoder().writeString(memberId).writeBytes(memberAssignment)\n}\n","const { decode, parse } = require('../v2/response')\n\n/**\n * SyncGroup Response (Version: 2) => throttle_time_ms error_code member_assignment\n * throttle_time_ms => INT32\n * error_code => INT16\n * member_assignment => BYTES\n */\nmodule.exports = {\n decode,\n parse,\n}\n","const versions = {\n 0: ({ transactionalId, groupId, producerId, producerEpoch, topics }) => {\n const request = require('./v0/request')\n const response = require('./v0/response')\n return {\n request: request({ transactionalId, groupId, producerId, producerEpoch, topics }),\n response,\n }\n },\n 1: ({ transactionalId, groupId, producerId, producerEpoch, topics }) => {\n const request = require('./v1/request')\n const response = require('./v1/response')\n return {\n request: request({ transactionalId, groupId, producerId, producerEpoch, topics }),\n response,\n }\n },\n}\n\nmodule.exports = {\n versions: Object.keys(versions),\n protocol: ({ version }) => versions[version],\n}\n","const Encoder = require('../../../encoder')\nconst { TxnOffsetCommit: apiKey } = require('../../apiKeys')\n\n/**\n * TxnOffsetCommit Request (Version: 0) => transactional_id group_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * group_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ transactionalId, groupId, producerId, producerEpoch, topics }) => ({\n apiKey,\n apiVersion: 0,\n apiName: 'TxnOffsetCommit',\n encode: async () => {\n return new Encoder()\n .writeString(transactionalId)\n .writeString(groupId)\n .writeInt64(producerId)\n .writeInt16(producerEpoch)\n .writeArray(topics.map(encodeTopic))\n },\n})\n\nconst encodeTopic = ({ topic, partitions }) => {\n return new Encoder().writeString(topic).writeArray(partitions.map(encodePartition))\n}\n\nconst encodePartition = ({ partition, offset, metadata }) => {\n return new Encoder()\n .writeInt32(partition)\n .writeInt64(offset)\n .writeString(metadata)\n}\n","const Decoder = require('../../../decoder')\nconst { failure, createErrorFromCode } = require('../../../error')\n\n/**\n * TxnOffsetCommit Response (Version: 0) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition error_code\n * partition => INT32\n * error_code => INT16\n */\nconst decode = async rawData => {\n const decoder = new Decoder(rawData)\n const throttleTime = decoder.readInt32()\n const topics = await decoder.readArrayAsync(decodeTopic)\n\n return {\n throttleTime,\n topics,\n }\n}\n\nconst decodeTopic = async decoder => ({\n topic: decoder.readString(),\n partitions: await decoder.readArrayAsync(decodePartition),\n})\n\nconst decodePartition = decoder => ({\n partition: decoder.readInt32(),\n errorCode: decoder.readInt16(),\n})\n\nconst parse = async data => {\n const topicsWithErrors = data.topics\n .map(({ partitions }) => ({\n partitionsWithErrors: partitions.filter(({ errorCode }) => failure(errorCode)),\n }))\n .filter(({ partitionsWithErrors }) => partitionsWithErrors.length)\n\n if (topicsWithErrors.length > 0) {\n throw createErrorFromCode(topicsWithErrors[0].partitionsWithErrors[0].errorCode)\n }\n\n return data\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","const requestV0 = require('../v0/request')\n\n/**\n * TxnOffsetCommit Request (Version: 1) => transactional_id group_id producer_id producer_epoch [topics]\n * transactional_id => STRING\n * group_id => STRING\n * producer_id => INT64\n * producer_epoch => INT16\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition offset metadata\n * partition => INT32\n * offset => INT64\n * metadata => NULLABLE_STRING\n */\n\nmodule.exports = ({ transactionalId, groupId, producerId, producerEpoch, topics }) =>\n Object.assign(requestV0({ transactionalId, groupId, producerId, producerEpoch, topics }), {\n apiVersion: 1,\n })\n","const { parse, decode: decodeV1 } = require('../v0/response')\n\n/**\n * In version 1, on quota violation, brokers send out responses before throttling.\n * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication\n *\n * TxnOffsetCommit Response (Version: 1) => throttle_time_ms [topics]\n * throttle_time_ms => INT32\n * topics => topic [partitions]\n * topic => STRING\n * partitions => partition error_code\n * partition => INT32\n * error_code => INT16\n */\n\nconst decode = async rawData => {\n const decoded = await decodeV1(rawData)\n\n return {\n ...decoded,\n throttleTime: 0,\n clientSideThrottleTime: decoded.throttleTime,\n }\n}\n\nmodule.exports = {\n decode,\n parse,\n}\n","// From:\n// https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/resource/PatternType.java#L32\n\n/**\n * @typedef {number} ACLResourcePatternTypes\n *\n * Enum for ACL Resource Pattern Type\n * @readonly\n * @enum {ACLResourcePatternTypes}\n */\nmodule.exports = {\n /**\n * Represents any PatternType which this client cannot understand, perhaps because this client is too old.\n */\n UNKNOWN: 0,\n /**\n * In a filter, matches any resource pattern type.\n */\n ANY: 1,\n /**\n * In a filter, will perform pattern matching.\n *\n * e.g. Given a filter of {@code ResourcePatternFilter(TOPIC, \"payments.received\", MATCH)`}, the filter match\n * any {@link ResourcePattern} that matches topic 'payments.received'. This might include:\n *
    \n *
  • A Literal pattern with the same type and name, e.g. {@code ResourcePattern(TOPIC, \"payments.received\", LITERAL)}
  • \n *
  • A Wildcard pattern with the same type, e.g. {@code ResourcePattern(TOPIC, \"*\", LITERAL)}
  • \n *
  • A Prefixed pattern with the same type and where the name is a matching prefix, e.g. {@code ResourcePattern(TOPIC, \"payments.\", PREFIXED)}
  • \n *
\n */\n MATCH: 2,\n /**\n * A literal resource name.\n *\n * A literal name defines the full name of a resource, e.g. topic with name 'foo', or group with name 'bob'.\n *\n * The special wildcard character {@code *} can be used to represent a resource with any name.\n */\n LITERAL: 3,\n /**\n * A prefixed resource name.\n *\n * A prefixed name defines a prefix for a resource, e.g. topics with names that start with 'foo'.\n */\n PREFIXED: 4,\n}\n","const ACLResourceTypes = require('./aclResourceTypes')\n\n/**\n * @deprecated\n * @see https://github.com/tulios/kafkajs/issues/649\n *\n * Use ConfigResourceTypes or AclResourceTypes instead.\n */\nmodule.exports = ACLResourceTypes\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","const Encoder = require('../../encoder')\n\nconst US_ASCII_NULL_CHAR = '\\u0000'\n\nmodule.exports = ({ authorizationIdentity, accessKeyId, secretAccessKey, sessionToken = '' }) => ({\n encode: async () => {\n return new Encoder().writeBytes(\n [authorizationIdentity, accessKeyId, secretAccessKey, sessionToken].join(US_ASCII_NULL_CHAR)\n )\n },\n})\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","/**\n * http://www.ietf.org/rfc/rfc5801.txt\n *\n * See org.apache.kafka.common.security.oauthbearer.internals.OAuthBearerClientInitialResponse\n * for official Java client implementation.\n *\n * The mechanism consists of a message from the client to the server.\n * The client sends the \"n,\"\" GS header, followed by the authorizationIdentitty\n * prefixed by \"a=\" (if present), followed by \",\", followed by a US-ASCII SOH\n * character, followed by \"auth=Bearer \", followed by the token value, followed\n * by US-ASCII SOH character, followed by SASL extensions in OAuth \"friendly\"\n * format and then closed by two additionals US-ASCII SOH characters.\n *\n * SASL extensions are optional an must be expressed as key-value pairs in an\n * object. Each expression is converted as, the extension entry key, followed\n * by \"=\", followed by extension entry value. Each extension is separated by a\n * US-ASCII SOH character. If extensions are not present, their relative part\n * in the message, including the US-ASCII SOH character, is omitted.\n *\n * The client may leave the authorization identity empty to\n * indicate that it is the same as the authentication identity.\n *\n * The server will verify the authentication token and verify that the\n * authentication credentials permit the client to login as the authorization\n * identity. If both steps succeed, the user is logged in.\n */\n\nconst Encoder = require('../../encoder')\n\nconst SEPARATOR = '\\u0001' // SOH - Start Of Header ASCII\n\nfunction formatExtensions(extensions) {\n let msg = ''\n\n if (extensions == null) {\n return msg\n }\n\n let prefix = ''\n for (const k in extensions) {\n msg += `${prefix}${k}=${extensions[k]}`\n prefix = SEPARATOR\n }\n\n return msg\n}\n\nmodule.exports = async ({ authorizationIdentity = null }, oauthBearerToken) => {\n const authzid = authorizationIdentity == null ? '' : `\"a=${authorizationIdentity}`\n let ext = formatExtensions(oauthBearerToken.extensions)\n if (ext.length > 0) {\n ext = `${SEPARATOR}${ext}`\n }\n\n const oauthMsg = `n,${authzid},${SEPARATOR}auth=Bearer ${oauthBearerToken.value}${ext}${SEPARATOR}${SEPARATOR}`\n\n return {\n encode: async () => {\n return new Encoder().writeBytes(Buffer.from(oauthMsg))\n },\n }\n}\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","module.exports = {\n request: require('./request'),\n response: require('./response'),\n}\n","/**\n * http://www.ietf.org/rfc/rfc2595.txt\n *\n * The mechanism consists of a single message from the client to the\n * server. The client sends the authorization identity (identity to\n * login as), followed by a US-ASCII NUL character, followed by the\n * authentication identity (identity whose password will be used),\n * followed by a US-ASCII NUL character, followed by the clear-text\n * password. The client may leave the authorization identity empty to\n * indicate that it is the same as the authentication identity.\n *\n * The server will verify the authentication identity and password with\n * the system authentication database and verify that the authentication\n * credentials permit the client to login as the authorization identity.\n * If both steps succeed, the user is logged in.\n */\n\nconst Encoder = require('../../encoder')\n\nconst US_ASCII_NULL_CHAR = '\\u0000'\n\nmodule.exports = ({ authorizationIdentity = null, username, password }) => ({\n encode: async () => {\n return new Encoder().writeBytes(\n [authorizationIdentity, username, password].join(US_ASCII_NULL_CHAR)\n )\n },\n})\n","module.exports = {\n decode: async () => true,\n parse: async () => true,\n}\n","const Encoder = require('../../../encoder')\n\nmodule.exports = ({ finalMessage }) => ({\n encode: async () => new Encoder().writeBytes(finalMessage),\n})\n","module.exports = require('../firstMessage/response')\n","/**\n * https://tools.ietf.org/html/rfc5802\n *\n * First, the client sends the \"client-first-message\" containing:\n *\n * -> a GS2 header consisting of a flag indicating whether channel\n * binding is supported-but-not-used, not supported, or used, and an\n * optional SASL authorization identity;\n *\n * -> SCRAM username and a random, unique nonce attributes.\n *\n * Note that the client's first message will always start with \"n\", \"y\",\n * or \"p\"; otherwise, the message is invalid and authentication MUST\n * fail. This is important, as it allows for GS2 extensibility (e.g.,\n * to add support for security layers).\n */\n\nconst Encoder = require('../../../encoder')\n\nmodule.exports = ({ clientFirstMessage }) => ({\n encode: async () => new Encoder().writeBytes(clientFirstMessage),\n})\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"_\" }] */\n\nconst Decoder = require('../../../decoder')\n\nconst ENTRY_REGEX = /^([rsiev])=(.*)$/\n\nmodule.exports = {\n decode: async rawData => {\n return new Decoder(rawData).readBytes()\n },\n parse: async data => {\n const processed = data\n .toString()\n .split(',')\n .map(str => {\n const [_, key, value] = str.match(ENTRY_REGEX)\n return [key, value]\n })\n .reduce((obj, entry) => ({ ...obj, [entry[0]]: entry[1] }), {})\n\n return { original: data.toString(), ...processed }\n },\n}\n","module.exports = {\n firstMessage: {\n request: require('./firstMessage/request'),\n response: require('./firstMessage/response'),\n },\n finalMessage: {\n request: require('./finalMessage/request'),\n response: require('./finalMessage/response'),\n },\n}\n","/**\n * Enum for timestamp types\n * @readonly\n * @enum {TimestampType}\n */\nmodule.exports = {\n // Timestamp type is unknown\n NO_TIMESTAMP: -1,\n\n // Timestamp relates to message creation time as set by a Kafka client\n CREATE_TIME: 0,\n\n // Timestamp relates to the time a message was appended to a Kafka log\n LOG_APPEND_TIME: 1,\n}\n","module.exports = {\n maxRetryTime: 30 * 1000,\n initialRetryTime: 300,\n factor: 0.2, // randomization factor\n multiplier: 2, // exponential factor\n retries: 5, // max retries\n}\n","module.exports = {\n maxRetryTime: 1000,\n initialRetryTime: 50,\n factor: 0.02, // randomization factor\n multiplier: 1.5, // exponential factor\n retries: 15, // max retries\n}\n","const { KafkaJSNumberOfRetriesExceeded, KafkaJSNonRetriableError } = require('../errors')\n\nconst isTestMode = process.env.NODE_ENV === 'test'\nconst RETRY_DEFAULT = isTestMode ? require('./defaults.test') : require('./defaults')\n\nconst random = (min, max) => {\n return Math.random() * (max - min) + min\n}\n\nconst randomFromRetryTime = (factor, retryTime) => {\n const delta = factor * retryTime\n return Math.ceil(random(retryTime - delta, retryTime + delta))\n}\n\nconst UNRECOVERABLE_ERRORS = ['RangeError', 'ReferenceError', 'SyntaxError', 'TypeError']\nconst isErrorUnrecoverable = e => UNRECOVERABLE_ERRORS.includes(e.name)\nconst isErrorRetriable = error =>\n (error.retriable || error.retriable !== false) && !isErrorUnrecoverable(error)\n\nconst createRetriable = (configs, resolve, reject, fn) => {\n let aborted = false\n const { factor, multiplier, maxRetryTime, retries } = configs\n\n const bail = error => {\n aborted = true\n reject(error || new Error('Aborted'))\n }\n\n const calculateExponentialRetryTime = retryTime => {\n return Math.min(randomFromRetryTime(factor, retryTime) * multiplier, maxRetryTime)\n }\n\n const retry = (retryTime, retryCount = 0) => {\n if (aborted) return\n\n const nextRetryTime = calculateExponentialRetryTime(retryTime)\n const shouldRetry = retryCount < retries\n\n const scheduleRetry = () => {\n setTimeout(() => retry(nextRetryTime, retryCount + 1), retryTime)\n }\n\n fn(bail, retryCount, retryTime)\n .then(resolve)\n .catch(e => {\n if (isErrorRetriable(e)) {\n if (shouldRetry) {\n scheduleRetry()\n } else {\n reject(new KafkaJSNumberOfRetriesExceeded(e, { retryCount, retryTime }))\n }\n } else {\n reject(new KafkaJSNonRetriableError(e))\n }\n })\n }\n\n return retry\n}\n\n/**\n * @typedef {(fn: (bail: (err: Error) => void, retryCount: number, retryTime: number) => any) => Promise>} Retrier\n */\n\n/**\n * @param {import(\"../../types\").RetryOptions} [opts]\n * @returns {Retrier}\n */\nmodule.exports = (opts = {}) => fn => {\n return new Promise((resolve, reject) => {\n const configs = Object.assign({}, RETRY_DEFAULT, opts)\n const start = createRetriable(configs, resolve, reject, fn)\n start(randomFromRetryTime(configs.factor, configs.initialRetryTime))\n })\n}\n","module.exports = (a, b) => {\n const result = []\n const length = a.length\n let i = 0\n\n while (i < length) {\n if (b.indexOf(a[i]) === -1) {\n result.push(a[i])\n }\n i += 1\n }\n\n return result\n}\n","const defaultErrorHandler = e => {\n throw e\n}\n\n/**\n * Generator that processes the given promises, and yields their result in the order of them resolving.\n *\n * @template T\n * @param {Promise[]} promises promises to process\n * @param {(err: Error) => any} [handleError] optional error handler\n * @returns {Generator>}\n */\nfunction* BufferedAsyncIterator(promises, handleError = defaultErrorHandler) {\n /** Queue of promises in order of resolution */\n const promisesQueue = []\n /** Queue of {resolve, reject} in the same order as `promisesQueue` */\n const resolveRejectQueue = []\n\n promises.forEach(promise => {\n // Create a new promise into the promises queue, and keep the {resolve,reject}\n // in the resolveRejectQueue\n let resolvePromise\n let rejectPromise\n promisesQueue.push(\n new Promise((resolve, reject) => {\n resolvePromise = resolve\n rejectPromise = reject\n })\n )\n resolveRejectQueue.push({ resolve: resolvePromise, reject: rejectPromise })\n\n // When the promise resolves pick the next available {resolve, reject}, and\n // through that resolve the next promise in the queue\n promise.then(\n result => {\n const { resolve } = resolveRejectQueue.pop()\n resolve(result)\n },\n async err => {\n const { reject } = resolveRejectQueue.pop()\n try {\n await handleError(err)\n reject(err)\n } catch (newError) {\n reject(newError)\n }\n }\n )\n })\n\n // While there are promises left pick the next one to yield\n // The caller will then wait for the value to resolve.\n while (promisesQueue.length > 0) {\n const nextPromise = promisesQueue.pop()\n yield nextPromise\n }\n}\n\nmodule.exports = BufferedAsyncIterator\n","const { KafkaJSNonRetriableError } = require('../errors')\n\nconst REJECTED_ERROR = new KafkaJSNonRetriableError(\n 'Queued function aborted due to earlier promise rejection'\n)\nfunction NOOP() {}\n\nconst concurrency = ({ limit, onChange = NOOP } = {}) => {\n if (isNaN(limit) || typeof limit !== 'number' || limit < 1) {\n throw new KafkaJSNonRetriableError(`\"limit\" cannot be less than 1`)\n }\n\n let waiting = []\n let semaphore = 0\n\n const clear = () => {\n for (const lazyAction of waiting) {\n lazyAction((_1, _2, reject) => reject(REJECTED_ERROR))\n }\n waiting = []\n semaphore = 0\n }\n\n const next = () => {\n semaphore--\n onChange(semaphore)\n\n if (waiting.length > 0) {\n const lazyAction = waiting.shift()\n lazyAction()\n }\n }\n\n const invoke = (action, resolve, reject) => {\n semaphore++\n onChange(semaphore)\n\n action()\n .then(result => {\n resolve(result)\n next()\n })\n .catch(error => {\n reject(error)\n clear()\n })\n }\n\n const push = (action, resolve, reject) => {\n if (semaphore < limit) {\n invoke(action, resolve, reject)\n } else {\n waiting.push(override => {\n const execute = override || invoke\n execute(action, resolve, reject)\n })\n }\n }\n\n return action => new Promise((resolve, reject) => push(action, resolve, reject))\n}\n\nmodule.exports = concurrency\n","/**\n * Flatten the given arrays into a new array\n *\n * @param {Array>} arrays\n * @returns {Array}\n * @template T\n */\nfunction flatten(arrays) {\n return [].concat.apply([], arrays)\n}\n\nmodule.exports = flatten\n","module.exports = async (array, groupFn) => {\n const result = new Map()\n\n for (const item of array) {\n const group = await Promise.resolve(groupFn(item))\n result.set(group, result.has(group) ? [...result.get(group), item] : [item])\n }\n\n return result\n}\n","const { format } = require('util')\nconst { KafkaJSLockTimeout } = require('../errors')\n\nconst PRIVATE = {\n LOCKED: Symbol('private:Lock:locked'),\n TIMEOUT: Symbol('private:Lock:timeout'),\n WAITING: Symbol('private:Lock:waiting'),\n TIMEOUT_ERROR_MESSAGE: Symbol('private:Lock:timeoutErrorMessage'),\n}\n\nconst TIMEOUT_MESSAGE = 'Timeout while acquiring lock (%d waiting locks)'\n\nmodule.exports = class Lock {\n constructor({ timeout, description = null } = {}) {\n if (typeof timeout !== 'number') {\n throw new TypeError(`'timeout' is not a number, received '${typeof timeout}'`)\n }\n\n this[PRIVATE.LOCKED] = false\n this[PRIVATE.TIMEOUT] = timeout\n this[PRIVATE.WAITING] = new Set()\n this[PRIVATE.TIMEOUT_ERROR_MESSAGE] = () => {\n const timeoutMessage = format(TIMEOUT_MESSAGE, this[PRIVATE.WAITING].size)\n return description ? `${timeoutMessage}: \"${description}\"` : timeoutMessage\n }\n }\n\n async acquire() {\n return new Promise((resolve, reject) => {\n if (!this[PRIVATE.LOCKED]) {\n this[PRIVATE.LOCKED] = true\n return resolve()\n }\n\n let timeoutId = null\n const tryToAcquire = async () => {\n if (!this[PRIVATE.LOCKED]) {\n this[PRIVATE.LOCKED] = true\n clearTimeout(timeoutId)\n this[PRIVATE.WAITING].delete(tryToAcquire)\n return resolve()\n }\n }\n\n this[PRIVATE.WAITING].add(tryToAcquire)\n timeoutId = setTimeout(() => {\n // The message should contain the number of waiters _including_ this one\n const error = new KafkaJSLockTimeout(this[PRIVATE.TIMEOUT_ERROR_MESSAGE]())\n this[PRIVATE.WAITING].delete(tryToAcquire)\n reject(error)\n }, this[PRIVATE.TIMEOUT])\n })\n }\n\n async release() {\n this[PRIVATE.LOCKED] = false\n const waitingLock = this[PRIVATE.WAITING].values().next().value\n\n if (waitingLock) {\n return waitingLock()\n }\n }\n}\n","/**\n * @exports Long\n * @class A Long class for representing a 64 bit int (BigInt)\n * @param {bigint} value The value of the 64 bit int\n * @constructor\n */\nclass Long {\n constructor(value) {\n this.value = value\n }\n\n /**\n * @function isLong\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\n static isLong(obj) {\n return typeof obj.value === 'bigint'\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromBits(value) {\n return new Long(BigInt(value))\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromInt(value) {\n if (isNaN(value)) return Long.ZERO\n\n return new Long(BigInt.asIntN(64, BigInt(value)))\n }\n\n /**\n * @param {number} value\n * @returns {!Long}\n * @inner\n */\n static fromNumber(value) {\n if (isNaN(value)) return Long.ZERO\n\n return new Long(BigInt(value))\n }\n\n /**\n * @function\n * @param {bigint|number|string|Long} val\n * @returns {!Long}\n * @inner\n */\n static fromValue(val) {\n if (typeof val === 'number') return this.fromNumber(val)\n if (typeof val === 'string') return this.fromString(val)\n if (typeof val === 'bigint') return new Long(val)\n if (this.isLong(val)) return new Long(BigInt(val.value))\n\n return new Long(BigInt(val))\n }\n\n /**\n * @param {string} str\n * @returns {!Long}\n * @inner\n */\n static fromString(str) {\n if (str.length === 0) throw Error('empty string')\n if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity')\n return Long.ZERO\n return new Long(BigInt(str))\n }\n\n /**\n * Tests if this Long's value equals zero.\n * @returns {boolean}\n */\n isZero() {\n return this.value === BigInt(0)\n }\n\n /**\n * Tests if this Long's value is negative.\n * @returns {boolean}\n */\n isNegative() {\n return this.value < BigInt(0)\n }\n\n /**\n * Converts the Long to a string.\n * @returns {string}\n * @override\n */\n toString() {\n return String(this.value)\n }\n\n /**\n * Converts the Long to the nearest floating-point representation (double, 53-bit mantissa)\n * @returns {number}\n * @override\n */\n toNumber() {\n return Number(this.value)\n }\n\n /**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @returns {number}\n */\n toInt() {\n return Number(BigInt.asIntN(32, this.value))\n }\n\n /**\n * Converts the Long to JSON\n * @returns {string}\n * @override\n */\n toJSON() {\n return this.toString()\n }\n\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftLeft(numBits) {\n return new Long(this.value << BigInt(numBits))\n }\n\n /**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftRight(numBits) {\n return new Long(this.value >> BigInt(numBits))\n }\n\n /**\n * Returns the bitwise OR of this Long and the specified.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n or(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return Long.fromBits(this.value | other.value)\n }\n\n /**\n * Returns the bitwise XOR of this Long and the given one.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n xor(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return new Long(this.value ^ other.value)\n }\n\n /**\n * Returns the bitwise AND of this Long and the specified.\n * @param {bigint|number|string} other Other Long\n * @returns {!Long}\n */\n and(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return new Long(this.value & other.value)\n }\n\n /**\n * Returns the bitwise NOT of this Long.\n * @returns {!Long}\n */\n not() {\n return new Long(~this.value)\n }\n\n /**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @param {number|bigint} numBits Number of bits\n * @returns {!Long} Shifted bigint\n */\n shiftRightUnsigned(numBits) {\n return new Long(this.value >> BigInt.asUintN(64, BigInt(numBits)))\n }\n\n /**\n * Tests if this Long's value equals the specified's.\n * @param {bigint|number|string} other Other value\n * @returns {boolean}\n */\n equals(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value === other.value\n }\n\n /**\n * Tests if this Long's value is greater than or equal the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n greaterThanOrEqual(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value >= other.value\n }\n\n gte(other) {\n return this.greaterThanOrEqual(other)\n }\n\n notEquals(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return !this.equals(/* validates */ other)\n }\n\n /**\n * Returns the sum of this and the specified Long.\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\n add(addend) {\n if (!Long.isLong(addend)) addend = Long.fromValue(addend)\n return new Long(this.value + addend.value)\n }\n\n /**\n * Returns the difference of this and the specified Long.\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n subtract(subtrahend) {\n if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend)\n return this.add(subtrahend.negate())\n }\n\n /**\n * Returns the product of this and the specified Long.\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n multiply(multiplier) {\n if (this.isZero()) return Long.ZERO\n if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier)\n return new Long(this.value * multiplier.value)\n }\n\n /**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n divide(divisor) {\n if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor)\n if (divisor.isZero()) throw Error('division by zero')\n return new Long(this.value / divisor.value)\n }\n\n /**\n * Compares this Long's value with the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n compare(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n if (this.value === other.value) return 0\n if (this.value > other.value) return 1\n if (other.value > this.value) return -1\n }\n\n /**\n * Tests if this Long's value is less than the specified's.\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n lessThan(other) {\n if (!Long.isLong(other)) other = Long.fromValue(other)\n return this.value < other.value\n }\n\n /**\n * Negates this Long's value.\n * @returns {!Long} Negated Long\n */\n negate() {\n if (this.equals(Long.MIN_VALUE)) {\n return Long.MIN_VALUE\n }\n return this.not().add(Long.ONE)\n }\n\n /**\n * Gets the high 32 bits as a signed integer.\n * @returns {number} Signed high bits\n */\n getHighBits() {\n return Number(BigInt.asIntN(32, this.value >> BigInt(32)))\n }\n\n /**\n * Gets the low 32 bits as a signed integer.\n * @returns {number} Signed low bits\n */\n getLowBits() {\n return Number(BigInt.asIntN(32, this.value))\n }\n}\n\n/**\n * Minimum signed value.\n * @type {bigint}\n */\nLong.MIN_VALUE = new Long(BigInt('-9223372036854775808'))\n\n/**\n * Maximum signed value.\n * @type {bigint}\n */\nLong.MAX_VALUE = new Long(BigInt('9223372036854775807'))\n\n/**\n * Signed zero.\n * @type {Long}\n */\nLong.ZERO = Long.fromInt(0)\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = Long.fromInt(1)\n\nmodule.exports = Long\n","/**\n * @template T\n * @param { (...args: any) => Promise } [asyncFunction]\n * Promise returning function that will only ever be invoked sequentially.\n * @returns { (...args: any) => Promise }\n * Function that may invoke asyncFunction if there is not a currently executing invocation.\n * Returns promise from the currently executing invocation.\n */\nmodule.exports = asyncFunction => {\n let promise = null\n\n return (...args) => {\n if (promise == null) {\n promise = asyncFunction(...args).finally(() => (promise = null))\n }\n return promise\n }\n}\n","/**\n * @param {T[]} array\n * @returns T[]\n * @template T\n */\nmodule.exports = array => {\n if (!Array.isArray(array)) {\n throw new TypeError(\"'array' is not an array\")\n }\n\n if (array.length < 2) {\n return array\n }\n\n const copy = array.slice()\n\n for (let i = copy.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1))\n const temp = copy[i]\n copy[i] = copy[j]\n copy[j] = temp\n }\n\n return copy\n}\n","module.exports = timeInMs =>\n new Promise(resolve => {\n setTimeout(resolve, timeInMs)\n })\n","const { keys } = Object\nmodule.exports = object =>\n keys(object).reduce((result, key) => ({ ...result, [object[key]]: key }), {})\n","const sleep = require('./sleep')\nconst { KafkaJSTimeout } = require('../errors')\n\nmodule.exports = (\n fn,\n { delay = 50, maxWait = 10000, timeoutMessage = 'Timeout', ignoreTimeout = false } = {}\n) => {\n let timeoutId\n let totalWait = 0\n let fulfilled = false\n\n const checkCondition = async (resolve, reject) => {\n totalWait += delay\n await sleep(delay)\n\n try {\n const result = await fn(totalWait)\n if (result) {\n fulfilled = true\n clearTimeout(timeoutId)\n return resolve(result)\n }\n\n checkCondition(resolve, reject)\n } catch (e) {\n fulfilled = true\n clearTimeout(timeoutId)\n reject(e)\n }\n }\n\n return new Promise((resolve, reject) => {\n checkCondition(resolve, reject)\n\n if (ignoreTimeout) {\n return\n }\n\n timeoutId = setTimeout(() => {\n if (!fulfilled) {\n return reject(new KafkaJSTimeout(timeoutMessage))\n }\n }, maxWait)\n })\n}\n","const BASE_URL = 'https://kafka.js.org'\n\nmodule.exports = (path, hash) => `${BASE_URL}/${path}${hash ? '#' + hash : ''}`\n","/*!\n * media-typer\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * RegExp to match *( \";\" parameter ) in RFC 2616 sec 3.7\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = >\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n * TEXT = \n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = \n * LF = \n * SP = \n * SHT = \n * CTL = \n * OCTET = \n */\nvar paramRegExp = /; *([!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+) *= *(\"(?:[ !\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u0020-\\u007e])*\"|[!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+) */g;\nvar textRegExp = /^[\\u0020-\\u007e\\u0080-\\u00ff]+$/\nvar tokenRegExp = /^[!#$%&'\\*\\+\\-\\.0-9A-Z\\^_`a-z\\|~]+$/\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = \n */\nvar qescRegExp = /\\\\([\\u0000-\\u007f])/g;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n */\nvar quoteRegExp = /([\\\\\"])/g;\n\n/**\n * RegExp to match type in RFC 6838\n *\n * type-name = restricted-name\n * subtype-name = restricted-name\n * restricted-name = restricted-name-first *126restricted-name-chars\n * restricted-name-first = ALPHA / DIGIT\n * restricted-name-chars = ALPHA / DIGIT / \"!\" / \"#\" /\n * \"$\" / \"&\" / \"-\" / \"^\" / \"_\"\n * restricted-name-chars =/ \".\" ; Characters before first dot always\n * ; specify a facet name\n * restricted-name-chars =/ \"+\" ; Characters after last plus always\n * ; specify a structured syntax suffix\n * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n * DIGIT = %x30-39 ; 0-9\n */\nvar subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/\nvar typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/\nvar typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;\n\n/**\n * Module exports.\n */\n\nexports.format = format\nexports.parse = parse\n\n/**\n * Format object to media type.\n *\n * @param {object} obj\n * @return {string}\n * @api public\n */\n\nfunction format(obj) {\n if (!obj || typeof obj !== 'object') {\n throw new TypeError('argument obj is required')\n }\n\n var parameters = obj.parameters\n var subtype = obj.subtype\n var suffix = obj.suffix\n var type = obj.type\n\n if (!type || !typeNameRegExp.test(type)) {\n throw new TypeError('invalid type')\n }\n\n if (!subtype || !subtypeNameRegExp.test(subtype)) {\n throw new TypeError('invalid subtype')\n }\n\n // format as type/subtype\n var string = type + '/' + subtype\n\n // append +suffix\n if (suffix) {\n if (!typeNameRegExp.test(suffix)) {\n throw new TypeError('invalid suffix')\n }\n\n string += '+' + suffix\n }\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n if (!tokenRegExp.test(param)) {\n throw new TypeError('invalid parameter name')\n }\n\n string += '; ' + param + '=' + qstring(parameters[param])\n }\n }\n\n return string\n}\n\n/**\n * Parse media type to object.\n *\n * @param {string|object} string\n * @return {Object}\n * @api public\n */\n\nfunction parse(string) {\n if (!string) {\n throw new TypeError('argument string is required')\n }\n\n // support req/res-like objects as argument\n if (typeof string === 'object') {\n string = getcontenttype(string)\n }\n\n if (typeof string !== 'string') {\n throw new TypeError('argument string is required to be a string')\n }\n\n var index = string.indexOf(';')\n var type = index !== -1\n ? string.substr(0, index)\n : string\n\n var key\n var match\n var obj = splitType(type)\n var params = {}\n var value\n\n paramRegExp.lastIndex = index\n\n while (match = paramRegExp.exec(string)) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .substr(1, value.length - 2)\n .replace(qescRegExp, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n obj.parameters = params\n\n return obj\n}\n\n/**\n * Get content-type from req/res objects.\n *\n * @param {object}\n * @return {Object}\n * @api private\n */\n\nfunction getcontenttype(obj) {\n if (typeof obj.getHeader === 'function') {\n // res-like\n return obj.getHeader('content-type')\n }\n\n if (typeof obj.headers === 'object') {\n // req-like\n return obj.headers && obj.headers['content-type']\n }\n}\n\n/**\n * Quote a string if necessary.\n *\n * @param {string} val\n * @return {string}\n * @api private\n */\n\nfunction qstring(val) {\n var str = String(val)\n\n // no need to quote tokens\n if (tokenRegExp.test(str)) {\n return str\n }\n\n if (str.length > 0 && !textRegExp.test(str)) {\n throw new TypeError('invalid parameter value')\n }\n\n return '\"' + str.replace(quoteRegExp, '\\\\$1') + '\"'\n}\n\n/**\n * Simply \"type/subtype+siffx\" into parts.\n *\n * @param {string} string\n * @return {Object}\n * @api private\n */\n\nfunction splitType(string) {\n var match = typeRegExp.exec(string.toLowerCase())\n\n if (!match) {\n throw new TypeError('invalid media type')\n }\n\n var type = match[1]\n var subtype = match[2]\n var suffix\n\n // suffix after last +\n var index = subtype.lastIndexOf('+')\n if (index !== -1) {\n suffix = subtype.substr(index + 1)\n subtype = subtype.substr(0, index)\n }\n\n var obj = {\n type: type,\n subtype: subtype,\n suffix: suffix\n }\n\n return obj\n}\n","/*!\n * merge-descriptors\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = merge\n\n/**\n * Module variables.\n * @private\n */\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n\n/**\n * Merge the property descriptors of `src` into `dest`\n *\n * @param {object} dest Object to add descriptors to\n * @param {object} src Object to clone descriptors from\n * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties\n * @returns {object} Reference to dest\n * @public\n */\n\nfunction merge(dest, src, redefine) {\n if (!dest) {\n throw new TypeError('argument dest is required')\n }\n\n if (!src) {\n throw new TypeError('argument src is required')\n }\n\n if (redefine === undefined) {\n // Default to true\n redefine = true\n }\n\n Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {\n if (!redefine && hasOwnProperty.call(dest, name)) {\n // Skip desriptor\n return\n }\n\n // Copy descriptor\n var descriptor = Object.getOwnPropertyDescriptor(src, name)\n Object.defineProperty(dest, name, descriptor)\n })\n\n return dest\n}\n","/*!\n * methods\n * Copyright(c) 2013-2014 TJ Holowaychuk\n * Copyright(c) 2015-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar http = require('http');\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = getCurrentNodeMethods() || getBasicNodeMethods();\n\n/**\n * Get the current Node.js methods.\n * @private\n */\n\nfunction getCurrentNodeMethods() {\n return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) {\n return method.toLowerCase();\n });\n}\n\n/**\n * Get the \"basic\" Node.js methods, a snapshot from Node.js 0.10.\n * @private\n */\n\nfunction getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","var path = require('path');\nvar fs = require('fs');\n\nfunction Mime() {\n // Map of extension -> mime type\n this.types = Object.create(null);\n\n // Map of mime type -> extension\n this.extensions = Object.create(null);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * @param map (Object) type definitions\n */\nMime.prototype.define = function (map) {\n for (var type in map) {\n var exts = map[type];\n for (var i = 0; i < exts.length; i++) {\n if (process.env.DEBUG_MIME && this.types[exts[i]]) {\n console.warn((this._loading || \"define()\").replace(/.*\\//, ''), 'changes \"' + exts[i] + '\" extension type from ' +\n this.types[exts[i]] + ' to ' + type);\n }\n\n this.types[exts[i]] = type;\n }\n\n // Default extension is the first one we encounter\n if (!this.extensions[type]) {\n this.extensions[type] = exts[0];\n }\n }\n};\n\n/**\n * Load an Apache2-style \".types\" file\n *\n * This may be called multiple times (it's expected). Where files declare\n * overlapping types/extensions, the last file wins.\n *\n * @param file (String) path of file to load.\n */\nMime.prototype.load = function(file) {\n this._loading = file;\n // Read file and split into lines\n var map = {},\n content = fs.readFileSync(file, 'ascii'),\n lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(function(line) {\n // Clean up whitespace/comments, and split into fields\n var fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.lookup = function(path, fallback) {\n var ext = path.replace(/^.*[\\.\\/\\\\]/, '').toLowerCase();\n\n return this.types[ext] || fallback || this.default_type;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.extension = function(mimeType) {\n var type = mimeType.match(/^\\s*([^;\\s]*)(?:;|\\s|$)/)[1].toLowerCase();\n return this.extensions[type];\n};\n\n// Default instance\nvar mime = new Mime();\n\n// Define built-in types\nmime.define(require('./types.json'));\n\n// Default type\nmime.default_type = mime.lookup('bin');\n\n//\n// Additional API specific to the default instance\n//\n\nmime.Mime = Mime;\n\n/**\n * Lookup a charset based on mime type.\n */\nmime.charsets = {\n lookup: function(mimeType, fallback) {\n // Assume text types are utf8\n return (/^text\\/|^application\\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback;\n }\n};\n\nmodule.exports = mime;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","var packet = require('dns-packet')\nvar dgram = require('dgram')\nvar thunky = require('thunky')\nvar events = require('events')\nvar os = require('os')\n\nvar noop = function () {}\n\nmodule.exports = function (opts) {\n if (!opts) opts = {}\n\n var that = new events.EventEmitter()\n var port = typeof opts.port === 'number' ? opts.port : 5353\n var type = opts.type || 'udp4'\n var ip = opts.ip || opts.host || (type === 'udp4' ? '224.0.0.251' : null)\n var me = {address: ip, port: port}\n var memberships = {}\n var destroyed = false\n var interval = null\n\n if (type === 'udp6' && (!ip || !opts.interface)) {\n throw new Error('For IPv6 multicast you must specify `ip` and `interface`')\n }\n\n var socket = opts.socket || dgram.createSocket({\n type: type,\n reuseAddr: opts.reuseAddr !== false,\n toString: function () {\n return type\n }\n })\n\n socket.on('error', function (err) {\n if (err.code === 'EACCES' || err.code === 'EADDRINUSE') that.emit('error', err)\n else that.emit('warning', err)\n })\n\n socket.on('message', function (message, rinfo) {\n try {\n message = packet.decode(message)\n } catch (err) {\n that.emit('warning', err)\n return\n }\n\n that.emit('packet', message, rinfo)\n\n if (message.type === 'query') that.emit('query', message, rinfo)\n if (message.type === 'response') that.emit('response', message, rinfo)\n })\n\n socket.on('listening', function () {\n if (!port) port = me.port = socket.address().port\n if (opts.multicast !== false) {\n that.update()\n interval = setInterval(that.update, 5000)\n socket.setMulticastTTL(opts.ttl || 255)\n socket.setMulticastLoopback(opts.loopback !== false)\n }\n })\n\n var bind = thunky(function (cb) {\n if (!port || opts.bind === false) return cb(null)\n socket.once('error', cb)\n socket.bind(port, opts.bind || opts.interface, function () {\n socket.removeListener('error', cb)\n cb(null)\n })\n })\n\n bind(function (err) {\n if (err) return that.emit('error', err)\n that.emit('ready')\n })\n\n that.send = function (value, rinfo, cb) {\n if (typeof rinfo === 'function') return that.send(value, null, rinfo)\n if (!cb) cb = noop\n if (!rinfo) rinfo = me\n else if (!rinfo.host && !rinfo.address) rinfo.address = me.address\n\n bind(onbind)\n\n function onbind (err) {\n if (destroyed) return cb()\n if (err) return cb(err)\n var message = packet.encode(value)\n socket.send(message, 0, message.length, rinfo.port, rinfo.address || rinfo.host, cb)\n }\n }\n\n that.response =\n that.respond = function (res, rinfo, cb) {\n if (Array.isArray(res)) res = {answers: res}\n\n res.type = 'response'\n res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER\n that.send(res, rinfo, cb)\n }\n\n that.query = function (q, type, rinfo, cb) {\n if (typeof type === 'function') return that.query(q, null, null, type)\n if (typeof type === 'object' && type && type.port) return that.query(q, null, type, rinfo)\n if (typeof rinfo === 'function') return that.query(q, type, null, rinfo)\n if (!cb) cb = noop\n\n if (typeof q === 'string') q = [{name: q, type: type || 'ANY'}]\n if (Array.isArray(q)) q = {type: 'query', questions: q}\n\n q.type = 'query'\n that.send(q, rinfo, cb)\n }\n\n that.destroy = function (cb) {\n if (!cb) cb = noop\n if (destroyed) return process.nextTick(cb)\n destroyed = true\n clearInterval(interval)\n\n // Need to drop memberships by hand and ignore errors.\n // socket.close() does not cope with errors.\n for (var iface in memberships) {\n try {\n socket.dropMembership(ip, iface)\n } catch (e) {\n // eat it\n }\n }\n memberships = {}\n socket.close(cb)\n }\n\n that.update = function () {\n var ifaces = opts.interface ? [].concat(opts.interface) : allInterfaces()\n var updated = false\n\n for (var i = 0; i < ifaces.length; i++) {\n var addr = ifaces[i]\n if (memberships[addr]) continue\n\n try {\n socket.addMembership(ip, addr)\n memberships[addr] = true\n updated = true\n } catch (err) {\n that.emit('warning', err)\n }\n }\n\n if (updated) {\n if (socket.setMulticastInterface) {\n try {\n socket.setMulticastInterface(opts.interface || defaultInterface())\n } catch (err) {\n that.emit('warning', err)\n }\n }\n that.emit('networkInterface')\n }\n }\n\n return that\n}\n\nfunction defaultInterface () {\n var networks = os.networkInterfaces()\n var names = Object.keys(networks)\n\n for (var i = 0; i < names.length; i++) {\n var net = networks[names[i]]\n for (var j = 0; j < net.length; j++) {\n var iface = net[j]\n if (isIPv4(iface.family) && !iface.internal) {\n if (os.platform() === 'darwin' && names[i] === 'en0') return iface.address\n return '0.0.0.0'\n }\n }\n }\n\n return '127.0.0.1'\n}\n\nfunction allInterfaces () {\n var networks = os.networkInterfaces()\n var names = Object.keys(networks)\n var res = []\n\n for (var i = 0; i < names.length; i++) {\n var net = networks[names[i]]\n for (var j = 0; j < net.length; j++) {\n var iface = net[j]\n if (isIPv4(iface.family)) {\n res.push(iface.address)\n // could only addMembership once per interface (https://nodejs.org/api/dgram.html#dgram_socket_addmembership_multicastaddress_multicastinterface)\n break\n }\n }\n }\n\n return res\n}\n\nfunction isIPv4 (family) { // for backwards compat\n return family === 4 || family === 'IPv4'\n}\n","/*!\n * negotiator\n * Copyright(c) 2012 Federico Romero\n * Copyright(c) 2012-2014 Isaac Z. Schlueter\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\nvar preferredCharsets = require('./lib/charset')\nvar preferredEncodings = require('./lib/encoding')\nvar preferredLanguages = require('./lib/language')\nvar preferredMediaTypes = require('./lib/mediaType')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = Negotiator;\nmodule.exports.Negotiator = Negotiator;\n\n/**\n * Create a Negotiator instance from a request.\n * @param {object} request\n * @public\n */\n\nfunction Negotiator(request) {\n if (!(this instanceof Negotiator)) {\n return new Negotiator(request);\n }\n\n this.request = request;\n}\n\nNegotiator.prototype.charset = function charset(available) {\n var set = this.charsets(available);\n return set && set[0];\n};\n\nNegotiator.prototype.charsets = function charsets(available) {\n return preferredCharsets(this.request.headers['accept-charset'], available);\n};\n\nNegotiator.prototype.encoding = function encoding(available) {\n var set = this.encodings(available);\n return set && set[0];\n};\n\nNegotiator.prototype.encodings = function encodings(available) {\n return preferredEncodings(this.request.headers['accept-encoding'], available);\n};\n\nNegotiator.prototype.language = function language(available) {\n var set = this.languages(available);\n return set && set[0];\n};\n\nNegotiator.prototype.languages = function languages(available) {\n return preferredLanguages(this.request.headers['accept-language'], available);\n};\n\nNegotiator.prototype.mediaType = function mediaType(available) {\n var set = this.mediaTypes(available);\n return set && set[0];\n};\n\nNegotiator.prototype.mediaTypes = function mediaTypes(available) {\n return preferredMediaTypes(this.request.headers.accept, available);\n};\n\n// Backwards compatibility\nNegotiator.prototype.preferredCharset = Negotiator.prototype.charset;\nNegotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;\nNegotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;\nNegotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;\nNegotiator.prototype.preferredLanguage = Negotiator.prototype.language;\nNegotiator.prototype.preferredLanguages = Negotiator.prototype.languages;\nNegotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;\nNegotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredCharsets;\nmodule.exports.preferredCharsets = preferredCharsets;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleCharsetRegExp = /^\\s*([^\\s;]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Charset header.\n * @private\n */\n\nfunction parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a charset from the Accept-Charset header.\n * @private\n */\n\nfunction parseCharset(str, i) {\n var match = simpleCharsetRegExp.exec(str);\n if (!match) return null;\n\n var charset = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n charset: charset,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of a charset.\n * @private\n */\n\nfunction getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the charset.\n * @private\n */\n\nfunction specify(charset, spec, index) {\n var s = 0;\n if(spec.charset.toLowerCase() === charset.toLowerCase()){\n s |= 1;\n } else if (spec.charset !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n}\n\n/**\n * Get the preferred charsets from an Accept-Charset header.\n * @public\n */\n\nfunction preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full charset string.\n * @private\n */\n\nfunction getFullCharset(spec) {\n return spec.charset;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredEncodings;\nmodule.exports.preferredEncodings = preferredEncodings;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleEncodingRegExp = /^\\s*([^\\s;]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Encoding header.\n * @private\n */\n\nfunction parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse an encoding from the Accept-Encoding header.\n * @private\n */\n\nfunction parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of an encoding.\n * @private\n */\n\nfunction getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the encoding.\n * @private\n */\n\nfunction specify(encoding, spec, index) {\n var s = 0;\n if(spec.encoding.toLowerCase() === encoding.toLowerCase()){\n s |= 1;\n } else if (spec.encoding !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n};\n\n/**\n * Get the preferred encodings from an Accept-Encoding header.\n * @public\n */\n\nfunction preferredEncodings(accept, provided) {\n var accepts = parseAcceptEncoding(accept || '');\n\n if (!provided) {\n // sorted list of all encodings\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullEncoding);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getEncodingPriority(type, accepts, index);\n });\n\n // sorted list of accepted encodings\n return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full encoding string.\n * @private\n */\n\nfunction getFullEncoding(spec) {\n return spec.encoding;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredLanguages;\nmodule.exports.preferredLanguages = preferredLanguages;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleLanguageRegExp = /^\\s*([^\\s\\-;]+)(?:-([^\\s;]+))?\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept-Language header.\n * @private\n */\n\nfunction parseAcceptLanguage(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var language = parseLanguage(accepts[i].trim(), i);\n\n if (language) {\n accepts[j++] = language;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a language from the Accept-Language header.\n * @private\n */\n\nfunction parseLanguage(str, i) {\n var match = simpleLanguageRegExp.exec(str);\n if (!match) return null;\n\n var prefix = match[1]\n var suffix = match[2]\n var full = prefix\n\n if (suffix) full += \"-\" + suffix;\n\n var q = 1;\n if (match[3]) {\n var params = match[3].split(';')\n for (var j = 0; j < params.length; j++) {\n var p = params[j].split('=');\n if (p[0] === 'q') q = parseFloat(p[1]);\n }\n }\n\n return {\n prefix: prefix,\n suffix: suffix,\n q: q,\n i: i,\n full: full\n };\n}\n\n/**\n * Get the priority of a language.\n * @private\n */\n\nfunction getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the language.\n * @private\n */\n\nfunction specify(language, spec, index) {\n var p = parseLanguage(language)\n if (!p) return null;\n var s = 0;\n if(spec.full.toLowerCase() === p.full.toLowerCase()){\n s |= 4;\n } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {\n s |= 2;\n } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {\n s |= 1;\n } else if (spec.full !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n};\n\n/**\n * Get the preferred languages from an Accept-Language header.\n * @public\n */\n\nfunction preferredLanguages(accept, provided) {\n // RFC 2616 sec 14.4: no header = *\n var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all languages\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullLanguage);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getLanguagePriority(type, accepts, index);\n });\n\n // sorted list of accepted languages\n return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full language string.\n * @private\n */\n\nfunction getFullLanguage(spec) {\n return spec.full;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n","/**\n * negotiator\n * Copyright(c) 2012 Isaac Z. Schlueter\n * Copyright(c) 2014 Federico Romero\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = preferredMediaTypes;\nmodule.exports.preferredMediaTypes = preferredMediaTypes;\n\n/**\n * Module variables.\n * @private\n */\n\nvar simpleMediaTypeRegExp = /^\\s*([^\\s\\/;]+)\\/([^;\\s]+)\\s*(?:;(.*))?$/;\n\n/**\n * Parse the Accept header.\n * @private\n */\n\nfunction parseAccept(accept) {\n var accepts = splitMediaTypes(accept);\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var mediaType = parseMediaType(accepts[i].trim(), i);\n\n if (mediaType) {\n accepts[j++] = mediaType;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}\n\n/**\n * Parse a media type from the Accept header.\n * @private\n */\n\nfunction parseMediaType(str, i) {\n var match = simpleMediaTypeRegExp.exec(str);\n if (!match) return null;\n\n var params = Object.create(null);\n var q = 1;\n var subtype = match[2];\n var type = match[1];\n\n if (match[3]) {\n var kvps = splitParameters(match[3]).map(splitKeyValuePair);\n\n for (var j = 0; j < kvps.length; j++) {\n var pair = kvps[j];\n var key = pair[0].toLowerCase();\n var val = pair[1];\n\n // get the value, unwrapping quotes\n var value = val && val[0] === '\"' && val[val.length - 1] === '\"'\n ? val.substr(1, val.length - 2)\n : val;\n\n if (key === 'q') {\n q = parseFloat(value);\n break;\n }\n\n // store parameter\n params[key] = value;\n }\n }\n\n return {\n type: type,\n subtype: subtype,\n params: params,\n q: q,\n i: i\n };\n}\n\n/**\n * Get the priority of a media type.\n * @private\n */\n\nfunction getMediaTypePriority(type, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(type, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}\n\n/**\n * Get the specificity of the media type.\n * @private\n */\n\nfunction specify(type, spec, index) {\n var p = parseMediaType(type);\n var s = 0;\n\n if (!p) {\n return null;\n }\n\n if(spec.type.toLowerCase() == p.type.toLowerCase()) {\n s |= 4\n } else if(spec.type != '*') {\n return null;\n }\n\n if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {\n s |= 2\n } else if(spec.subtype != '*') {\n return null;\n }\n\n var keys = Object.keys(spec.params);\n if (keys.length > 0) {\n if (keys.every(function (k) {\n return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();\n })) {\n s |= 1\n } else {\n return null\n }\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s,\n }\n}\n\n/**\n * Get the preferred media types from an Accept header.\n * @public\n */\n\nfunction preferredMediaTypes(accept, provided) {\n // RFC 2616 sec 14.2: no header = */*\n var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');\n\n if (!provided) {\n // sorted list of all types\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullType);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getMediaTypePriority(type, accepts, index);\n });\n\n // sorted list of accepted types\n return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}\n\n/**\n * Compare two specs.\n * @private\n */\n\nfunction compareSpecs(a, b) {\n return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;\n}\n\n/**\n * Get full type string.\n * @private\n */\n\nfunction getFullType(spec) {\n return spec.type + '/' + spec.subtype;\n}\n\n/**\n * Check if a spec has any quality.\n * @private\n */\n\nfunction isQuality(spec) {\n return spec.q > 0;\n}\n\n/**\n * Count the number of quotes in a string.\n * @private\n */\n\nfunction quoteCount(string) {\n var count = 0;\n var index = 0;\n\n while ((index = string.indexOf('\"', index)) !== -1) {\n count++;\n index++;\n }\n\n return count;\n}\n\n/**\n * Split a key value pair.\n * @private\n */\n\nfunction splitKeyValuePair(str) {\n var index = str.indexOf('=');\n var key;\n var val;\n\n if (index === -1) {\n key = str;\n } else {\n key = str.substr(0, index);\n val = str.substr(index + 1);\n }\n\n return [key, val];\n}\n\n/**\n * Split an Accept header into media types.\n * @private\n */\n\nfunction splitMediaTypes(accept) {\n var accepts = accept.split(',');\n\n for (var i = 1, j = 0; i < accepts.length; i++) {\n if (quoteCount(accepts[j]) % 2 == 0) {\n accepts[++j] = accepts[i];\n } else {\n accepts[j] += ',' + accepts[i];\n }\n }\n\n // trim accepts\n accepts.length = j + 1;\n\n return accepts;\n}\n\n/**\n * Split a string of parameters.\n * @private\n */\n\nfunction splitParameters(str) {\n var parameters = str.split(';');\n\n for (var i = 1, j = 0; i < parameters.length; i++) {\n if (quoteCount(parameters[j]) % 2 == 0) {\n parameters[++j] = parameters[i];\n } else {\n parameters[j] += ';' + parameters[i];\n }\n }\n\n // trim parameters\n parameters.length = j + 1;\n\n for (var i = 0; i < parameters.length; i++) {\n parameters[i] = parameters[i].trim();\n }\n\n return parameters;\n}\n","if (typeof process.addon === 'function') { // if the platform supports native resolving prefer that\n module.exports = process.addon.bind(process)\n} else { // else use the runtime version here\n module.exports = require('./node-gyp-build.js')\n}\n","var fs = require('fs')\nvar path = require('path')\nvar os = require('os')\n\n// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'\nvar runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line\n\nvar vars = (process.config && process.config.variables) || {}\nvar prebuildsOnly = !!process.env.PREBUILDS_ONLY\nvar abi = process.versions.modules // TODO: support old node where this is undef\nvar runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node')\n\nvar arch = process.env.npm_config_arch || os.arch()\nvar platform = process.env.npm_config_platform || os.platform()\nvar libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')\nvar armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''\nvar uv = (process.versions.uv || '').split('.')[0]\n\nmodule.exports = load\n\nfunction load (dir) {\n return runtimeRequire(load.resolve(dir))\n}\n\nload.resolve = load.path = function (dir) {\n dir = path.resolve(dir || '.')\n\n try {\n var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')\n if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']\n } catch (err) {}\n\n if (!prebuildsOnly) {\n var release = getFirst(path.join(dir, 'build/Release'), matchBuild)\n if (release) return release\n\n var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)\n if (debug) return debug\n }\n\n var prebuild = resolve(dir)\n if (prebuild) return prebuild\n\n var nearby = resolve(path.dirname(process.execPath))\n if (nearby) return nearby\n\n var target = [\n 'platform=' + platform,\n 'arch=' + arch,\n 'runtime=' + runtime,\n 'abi=' + abi,\n 'uv=' + uv,\n armv ? 'armv=' + armv : '',\n 'libc=' + libc,\n 'node=' + process.versions.node,\n process.versions.electron ? 'electron=' + process.versions.electron : '',\n typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line\n ].filter(Boolean).join(' ')\n\n throw new Error('No native build was found for ' + target + '\\n loaded from: ' + dir + '\\n')\n\n function resolve (dir) {\n // Find matching \"prebuilds/-\" directory\n var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)\n var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]\n if (!tuple) return\n\n // Find most specific flavor first\n var prebuilds = path.join(dir, 'prebuilds', tuple.name)\n var parsed = readdirSync(prebuilds).map(parseTags)\n var candidates = parsed.filter(matchTags(runtime, abi))\n var winner = candidates.sort(compareTags(runtime))[0]\n if (winner) return path.join(prebuilds, winner.file)\n }\n}\n\nfunction readdirSync (dir) {\n try {\n return fs.readdirSync(dir)\n } catch (err) {\n return []\n }\n}\n\nfunction getFirst (dir, filter) {\n var files = readdirSync(dir).filter(filter)\n return files[0] && path.join(dir, files[0])\n}\n\nfunction matchBuild (name) {\n return /\\.node$/.test(name)\n}\n\nfunction parseTuple (name) {\n // Example: darwin-x64+arm64\n var arr = name.split('-')\n if (arr.length !== 2) return\n\n var platform = arr[0]\n var architectures = arr[1].split('+')\n\n if (!platform) return\n if (!architectures.length) return\n if (!architectures.every(Boolean)) return\n\n return { name, platform, architectures }\n}\n\nfunction matchTuple (platform, arch) {\n return function (tuple) {\n if (tuple == null) return false\n if (tuple.platform !== platform) return false\n return tuple.architectures.includes(arch)\n }\n}\n\nfunction compareTuples (a, b) {\n // Prefer single-arch prebuilds over multi-arch\n return a.architectures.length - b.architectures.length\n}\n\nfunction parseTags (file) {\n var arr = file.split('.')\n var extension = arr.pop()\n var tags = { file: file, specificity: 0 }\n\n if (extension !== 'node') return\n\n for (var i = 0; i < arr.length; i++) {\n var tag = arr[i]\n\n if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {\n tags.runtime = tag\n } else if (tag === 'napi') {\n tags.napi = true\n } else if (tag.slice(0, 3) === 'abi') {\n tags.abi = tag.slice(3)\n } else if (tag.slice(0, 2) === 'uv') {\n tags.uv = tag.slice(2)\n } else if (tag.slice(0, 4) === 'armv') {\n tags.armv = tag.slice(4)\n } else if (tag === 'glibc' || tag === 'musl') {\n tags.libc = tag\n } else {\n continue\n }\n\n tags.specificity++\n }\n\n return tags\n}\n\nfunction matchTags (runtime, abi) {\n return function (tags) {\n if (tags == null) return false\n if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false\n if (tags.abi !== abi && !tags.napi) return false\n if (tags.uv && tags.uv !== uv) return false\n if (tags.armv && tags.armv !== armv) return false\n if (tags.libc && tags.libc !== libc) return false\n\n return true\n }\n}\n\nfunction runtimeAgnostic (tags) {\n return tags.runtime === 'node' && tags.napi\n}\n\nfunction compareTags (runtime) {\n // Precedence: non-agnostic runtime, abi over napi, then by specificity.\n return function (a, b) {\n if (a.runtime !== b.runtime) {\n return a.runtime === runtime ? -1 : 1\n } else if (a.abi !== b.abi) {\n return a.abi ? -1 : 1\n } else if (a.specificity !== b.specificity) {\n return a.specificity > b.specificity ? -1 : 1\n } else {\n return 0\n }\n }\n}\n\nfunction isNwjs () {\n return !!(process.versions && process.versions.nw)\n}\n\nfunction isElectron () {\n if (process.versions && process.versions.electron) return true\n if (process.env.ELECTRON_RUN_AS_NODE) return true\n return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'\n}\n\nfunction isAlpine (platform) {\n return platform === 'linux' && fs.existsSync('/etc/alpine-release')\n}\n\n// Exposed for unit tests\n// TODO: move to lib\nload.parseTags = parseTags\nload.matchTags = matchTags\nload.compareTags = compareTags\nload.parseTuple = parseTuple\nload.matchTuple = matchTuple\nload.compareTuples = compareTuples\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","module.exports = require('util').inspect;\n","/*!\n * on-finished\n * Copyright(c) 2013 Jonathan Ong\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = onFinished\nmodule.exports.isFinished = isFinished\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar asyncHooks = tryRequireAsyncHooks()\nvar first = require('ee-first')\n\n/**\n * Variables.\n * @private\n */\n\n/* istanbul ignore next */\nvar defer = typeof setImmediate === 'function'\n ? setImmediate\n : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }\n\n/**\n * Invoke callback when the response has finished, useful for\n * cleaning up resources afterwards.\n *\n * @param {object} msg\n * @param {function} listener\n * @return {object}\n * @public\n */\n\nfunction onFinished (msg, listener) {\n if (isFinished(msg) !== false) {\n defer(listener, null, msg)\n return msg\n }\n\n // attach the listener to the message\n attachListener(msg, wrap(listener))\n\n return msg\n}\n\n/**\n * Determine if message is already finished.\n *\n * @param {object} msg\n * @return {boolean}\n * @public\n */\n\nfunction isFinished (msg) {\n var socket = msg.socket\n\n if (typeof msg.finished === 'boolean') {\n // OutgoingMessage\n return Boolean(msg.finished || (socket && !socket.writable))\n }\n\n if (typeof msg.complete === 'boolean') {\n // IncomingMessage\n return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))\n }\n\n // don't know\n return undefined\n}\n\n/**\n * Attach a finished listener to the message.\n *\n * @param {object} msg\n * @param {function} callback\n * @private\n */\n\nfunction attachFinishedListener (msg, callback) {\n var eeMsg\n var eeSocket\n var finished = false\n\n function onFinish (error) {\n eeMsg.cancel()\n eeSocket.cancel()\n\n finished = true\n callback(error)\n }\n\n // finished on first message event\n eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)\n\n function onSocket (socket) {\n // remove listener\n msg.removeListener('socket', onSocket)\n\n if (finished) return\n if (eeMsg !== eeSocket) return\n\n // finished on first socket event\n eeSocket = first([[socket, 'error', 'close']], onFinish)\n }\n\n if (msg.socket) {\n // socket already assigned\n onSocket(msg.socket)\n return\n }\n\n // wait for socket to be assigned\n msg.on('socket', onSocket)\n\n if (msg.socket === undefined) {\n // istanbul ignore next: node.js 0.8 patch\n patchAssignSocket(msg, onSocket)\n }\n}\n\n/**\n * Attach the listener to the message.\n *\n * @param {object} msg\n * @return {function}\n * @private\n */\n\nfunction attachListener (msg, listener) {\n var attached = msg.__onFinished\n\n // create a private single listener with queue\n if (!attached || !attached.queue) {\n attached = msg.__onFinished = createListener(msg)\n attachFinishedListener(msg, attached)\n }\n\n attached.queue.push(listener)\n}\n\n/**\n * Create listener on message.\n *\n * @param {object} msg\n * @return {function}\n * @private\n */\n\nfunction createListener (msg) {\n function listener (err) {\n if (msg.__onFinished === listener) msg.__onFinished = null\n if (!listener.queue) return\n\n var queue = listener.queue\n listener.queue = null\n\n for (var i = 0; i < queue.length; i++) {\n queue[i](err, msg)\n }\n }\n\n listener.queue = []\n\n return listener\n}\n\n/**\n * Patch ServerResponse.prototype.assignSocket for node.js 0.8.\n *\n * @param {ServerResponse} res\n * @param {function} callback\n * @private\n */\n\n// istanbul ignore next: node.js 0.8 patch\nfunction patchAssignSocket (res, callback) {\n var assignSocket = res.assignSocket\n\n if (typeof assignSocket !== 'function') return\n\n // res.on('socket', callback) is broken in 0.8\n res.assignSocket = function _assignSocket (socket) {\n assignSocket.call(this, socket)\n callback(socket)\n }\n}\n\n/**\n * Try to require async_hooks\n * @private\n */\n\nfunction tryRequireAsyncHooks () {\n try {\n return require('async_hooks')\n } catch (e) {\n return {}\n }\n}\n\n/**\n * Wrap function with async resource, if possible.\n * AsyncResource.bind static method backported.\n * @private\n */\n\nfunction wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}\n","/*!\n * on-headers\n * Copyright(c) 2014 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = onHeaders\n\n/**\n * Create a replacement writeHead method.\n *\n * @param {function} prevWriteHead\n * @param {function} listener\n * @private\n */\n\nfunction createWriteHead (prevWriteHead, listener) {\n var fired = false\n\n // return function with core name and argument list\n return function writeHead (statusCode) {\n // set headers from arguments\n var args = setWriteHeadHeaders.apply(this, arguments)\n\n // fire listener\n if (!fired) {\n fired = true\n listener.call(this)\n\n // pass-along an updated status code\n if (typeof args[0] === 'number' && this.statusCode !== args[0]) {\n args[0] = this.statusCode\n args.length = 1\n }\n }\n\n return prevWriteHead.apply(this, args)\n }\n}\n\n/**\n * Execute a listener when a response is about to write headers.\n *\n * @param {object} res\n * @return {function} listener\n * @public\n */\n\nfunction onHeaders (res, listener) {\n if (!res) {\n throw new TypeError('argument res is required')\n }\n\n if (typeof listener !== 'function') {\n throw new TypeError('argument listener must be a function')\n }\n\n res.writeHead = createWriteHead(res.writeHead, listener)\n}\n\n/**\n * Set headers contained in array on the response object.\n *\n * @param {object} res\n * @param {array} headers\n * @private\n */\n\nfunction setHeadersFromArray (res, headers) {\n for (var i = 0; i < headers.length; i++) {\n res.setHeader(headers[i][0], headers[i][1])\n }\n}\n\n/**\n * Set headers contained in object on the response object.\n *\n * @param {object} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeadersFromObject (res, headers) {\n var keys = Object.keys(headers)\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i]\n if (k) res.setHeader(k, headers[k])\n }\n}\n\n/**\n * Set headers and other properties on the response object.\n *\n * @param {number} statusCode\n * @private\n */\n\nfunction setWriteHeadHeaders (statusCode) {\n var length = arguments.length\n var headerIndex = length > 1 && typeof arguments[1] === 'string'\n ? 2\n : 1\n\n var headers = length >= headerIndex + 1\n ? arguments[headerIndex]\n : undefined\n\n this.statusCode = statusCode\n\n if (Array.isArray(headers)) {\n // handle array case\n setHeadersFromArray(this, headers)\n } else if (headers) {\n // handle object case\n setHeadersFromObject(this, headers)\n }\n\n // copy leading arguments\n var args = new Array(Math.min(length, headerIndex))\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n return args\n}\n","/*!\n * parseurl\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar url = require('url')\nvar parse = url.parse\nvar Url = url.Url\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = parseurl\nmodule.exports.original = originalurl\n\n/**\n * Parse the `req` url with memoization.\n *\n * @param {ServerRequest} req\n * @return {Object}\n * @public\n */\n\nfunction parseurl (req) {\n var url = req.url\n\n if (url === undefined) {\n // URL is undefined\n return undefined\n }\n\n var parsed = req._parsedUrl\n\n if (fresh(url, parsed)) {\n // Return cached URL parse\n return parsed\n }\n\n // Parse the URL\n parsed = fastparse(url)\n parsed._raw = url\n\n return (req._parsedUrl = parsed)\n};\n\n/**\n * Parse the `req` original url with fallback and memoization.\n *\n * @param {ServerRequest} req\n * @return {Object}\n * @public\n */\n\nfunction originalurl (req) {\n var url = req.originalUrl\n\n if (typeof url !== 'string') {\n // Fallback\n return parseurl(req)\n }\n\n var parsed = req._parsedOriginalUrl\n\n if (fresh(url, parsed)) {\n // Return cached URL parse\n return parsed\n }\n\n // Parse the URL\n parsed = fastparse(url)\n parsed._raw = url\n\n return (req._parsedOriginalUrl = parsed)\n};\n\n/**\n * Parse the `str` url with fast-path short-cut.\n *\n * @param {string} str\n * @return {Object}\n * @private\n */\n\nfunction fastparse (str) {\n if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {\n return parse(str)\n }\n\n var pathname = str\n var query = null\n var search = null\n\n // This takes the regexp from https://github.com/joyent/node/pull/7878\n // Which is /^(\\/[^?#\\s]*)(\\?[^#\\s]*)?$/\n // And unrolls it into a for loop\n for (var i = 1; i < str.length; i++) {\n switch (str.charCodeAt(i)) {\n case 0x3f: /* ? */\n if (search === null) {\n pathname = str.substring(0, i)\n query = str.substring(i + 1)\n search = str.substring(i)\n }\n break\n case 0x09: /* \\t */\n case 0x0a: /* \\n */\n case 0x0c: /* \\f */\n case 0x0d: /* \\r */\n case 0x20: /* */\n case 0x23: /* # */\n case 0xa0:\n case 0xfeff:\n return parse(str)\n }\n }\n\n var url = Url !== undefined\n ? new Url()\n : {}\n\n url.path = str\n url.href = str\n url.pathname = pathname\n\n if (search !== null) {\n url.query = query\n url.search = search\n }\n\n return url\n}\n\n/**\n * Determine if parsed is still fresh for url.\n *\n * @param {string} url\n * @param {object} parsedUrl\n * @return {boolean}\n * @private\n */\n\nfunction fresh (url, parsedUrl) {\n return typeof parsedUrl === 'object' &&\n parsedUrl !== null &&\n (Url === undefined || parsedUrl instanceof Url) &&\n parsedUrl._raw === url\n}\n","/**\n * Expose `pathtoRegexp`.\n */\n\nmodule.exports = pathtoRegexp;\n\n/**\n * Match matching groups in a regular expression.\n */\nvar MATCHING_GROUP_REGEXP = /\\((?!\\?)/g;\n\n/**\n * Normalize the given path string,\n * returning a regular expression.\n *\n * An empty array should be passed,\n * which will contain the placeholder\n * key names. For example \"/user/:id\" will\n * then contain [\"id\"].\n *\n * @param {String|RegExp|Array} path\n * @param {Array} keys\n * @param {Object} options\n * @return {RegExp}\n * @api private\n */\n\nfunction pathtoRegexp(path, keys, options) {\n options = options || {};\n keys = keys || [];\n var strict = options.strict;\n var end = options.end !== false;\n var flags = options.sensitive ? '' : 'i';\n var extraOffset = 0;\n var keysOffset = keys.length;\n var i = 0;\n var name = 0;\n var m;\n\n if (path instanceof RegExp) {\n while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {\n keys.push({\n name: name++,\n optional: false,\n offset: m.index\n });\n }\n\n return path;\n }\n\n if (Array.isArray(path)) {\n // Map array parts into regexps and return their source. We also pass\n // the same keys and options instance into every generation to get\n // consistent matching groups before we join the sources together.\n path = path.map(function (value) {\n return pathtoRegexp(value, keys, options).source;\n });\n\n return new RegExp('(?:' + path.join('|') + ')', flags);\n }\n\n path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'))\n .replace(/\\/\\(/g, '/(?:')\n .replace(/([\\/\\.])/g, '\\\\$1')\n .replace(/(\\\\\\/)?(\\\\\\.)?:(\\w+)(\\(.*?\\))?(\\*)?(\\?)?/g, function (match, slash, format, key, capture, star, optional, offset) {\n slash = slash || '';\n format = format || '';\n capture = capture || '([^\\\\/' + format + ']+?)';\n optional = optional || '';\n\n keys.push({\n name: key,\n optional: !!optional,\n offset: offset + extraOffset\n });\n\n var result = ''\n + (optional ? '' : slash)\n + '(?:'\n + format + (optional ? slash : '') + capture\n + (star ? '((?:[\\\\/' + format + '].+?)?)' : '')\n + ')'\n + optional;\n\n extraOffset += result.length - match.length;\n\n return result;\n })\n .replace(/\\*/g, function (star, index) {\n var len = keys.length\n\n while (len-- > keysOffset && keys[len].offset > index) {\n keys[len].offset += 3; // Replacement length minus asterisk length.\n }\n\n return '(.*)';\n });\n\n // This is a workaround for handling unnamed matching groups.\n while (m = MATCHING_GROUP_REGEXP.exec(path)) {\n var escapeCount = 0;\n var index = m.index;\n\n while (path.charAt(--index) === '\\\\') {\n escapeCount++;\n }\n\n // It's possible to escape the bracket.\n if (escapeCount % 2 === 1) {\n continue;\n }\n\n if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {\n keys.splice(keysOffset + i, 0, {\n name: name++, // Unnamed matching groups must be consistently linear.\n optional: false,\n offset: m.index\n });\n }\n\n i++;\n }\n\n // If the path is non-ending, match until the end or a slash.\n path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\\\/|$)'));\n\n return new RegExp(path, flags);\n};\n","/*!\n * proxy-addr\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = proxyaddr\nmodule.exports.all = alladdrs\nmodule.exports.compile = compile\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar forwarded = require('forwarded')\nvar ipaddr = require('ipaddr.js')\n\n/**\n * Variables.\n * @private\n */\n\nvar DIGIT_REGEXP = /^[0-9]+$/\nvar isip = ipaddr.isValid\nvar parseip = ipaddr.parse\n\n/**\n * Pre-defined IP ranges.\n * @private\n */\n\nvar IP_RANGES = {\n linklocal: ['169.254.0.0/16', 'fe80::/10'],\n loopback: ['127.0.0.1/8', '::1/128'],\n uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']\n}\n\n/**\n * Get all addresses in the request, optionally stopping\n * at the first untrusted.\n *\n * @param {Object} request\n * @param {Function|Array|String} [trust]\n * @public\n */\n\nfunction alladdrs (req, trust) {\n // get addresses\n var addrs = forwarded(req)\n\n if (!trust) {\n // Return all addresses\n return addrs\n }\n\n if (typeof trust !== 'function') {\n trust = compile(trust)\n }\n\n for (var i = 0; i < addrs.length - 1; i++) {\n if (trust(addrs[i], i)) continue\n\n addrs.length = i + 1\n }\n\n return addrs\n}\n\n/**\n * Compile argument into trust function.\n *\n * @param {Array|String} val\n * @private\n */\n\nfunction compile (val) {\n if (!val) {\n throw new TypeError('argument is required')\n }\n\n var trust\n\n if (typeof val === 'string') {\n trust = [val]\n } else if (Array.isArray(val)) {\n trust = val.slice()\n } else {\n throw new TypeError('unsupported trust argument')\n }\n\n for (var i = 0; i < trust.length; i++) {\n val = trust[i]\n\n if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) {\n continue\n }\n\n // Splice in pre-defined range\n val = IP_RANGES[val]\n trust.splice.apply(trust, [i, 1].concat(val))\n i += val.length - 1\n }\n\n return compileTrust(compileRangeSubnets(trust))\n}\n\n/**\n * Compile `arr` elements into range subnets.\n *\n * @param {Array} arr\n * @private\n */\n\nfunction compileRangeSubnets (arr) {\n var rangeSubnets = new Array(arr.length)\n\n for (var i = 0; i < arr.length; i++) {\n rangeSubnets[i] = parseipNotation(arr[i])\n }\n\n return rangeSubnets\n}\n\n/**\n * Compile range subnet array into trust function.\n *\n * @param {Array} rangeSubnets\n * @private\n */\n\nfunction compileTrust (rangeSubnets) {\n // Return optimized function based on length\n var len = rangeSubnets.length\n return len === 0\n ? trustNone\n : len === 1\n ? trustSingle(rangeSubnets[0])\n : trustMulti(rangeSubnets)\n}\n\n/**\n * Parse IP notation string into range subnet.\n *\n * @param {String} note\n * @private\n */\n\nfunction parseipNotation (note) {\n var pos = note.lastIndexOf('/')\n var str = pos !== -1\n ? note.substring(0, pos)\n : note\n\n if (!isip(str)) {\n throw new TypeError('invalid IP address: ' + str)\n }\n\n var ip = parseip(str)\n\n if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) {\n // Store as IPv4\n ip = ip.toIPv4Address()\n }\n\n var max = ip.kind() === 'ipv6'\n ? 128\n : 32\n\n var range = pos !== -1\n ? note.substring(pos + 1, note.length)\n : null\n\n if (range === null) {\n range = max\n } else if (DIGIT_REGEXP.test(range)) {\n range = parseInt(range, 10)\n } else if (ip.kind() === 'ipv4' && isip(range)) {\n range = parseNetmask(range)\n } else {\n range = null\n }\n\n if (range <= 0 || range > max) {\n throw new TypeError('invalid range on address: ' + note)\n }\n\n return [ip, range]\n}\n\n/**\n * Parse netmask string into CIDR range.\n *\n * @param {String} netmask\n * @private\n */\n\nfunction parseNetmask (netmask) {\n var ip = parseip(netmask)\n var kind = ip.kind()\n\n return kind === 'ipv4'\n ? ip.prefixLengthFromSubnetMask()\n : null\n}\n\n/**\n * Determine address of proxied request.\n *\n * @param {Object} request\n * @param {Function|Array|String} trust\n * @public\n */\n\nfunction proxyaddr (req, trust) {\n if (!req) {\n throw new TypeError('req argument is required')\n }\n\n if (!trust) {\n throw new TypeError('trust argument is required')\n }\n\n var addrs = alladdrs(req, trust)\n var addr = addrs[addrs.length - 1]\n\n return addr\n}\n\n/**\n * Static trust function to trust nothing.\n *\n * @private\n */\n\nfunction trustNone () {\n return false\n}\n\n/**\n * Compile trust function for multiple subnets.\n *\n * @param {Array} subnets\n * @private\n */\n\nfunction trustMulti (subnets) {\n return function trust (addr) {\n if (!isip(addr)) return false\n\n var ip = parseip(addr)\n var ipconv\n var kind = ip.kind()\n\n for (var i = 0; i < subnets.length; i++) {\n var subnet = subnets[i]\n var subnetip = subnet[0]\n var subnetkind = subnetip.kind()\n var subnetrange = subnet[1]\n var trusted = ip\n\n if (kind !== subnetkind) {\n if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) {\n // Incompatible IP addresses\n continue\n }\n\n if (!ipconv) {\n // Convert IP to match subnet IP kind\n ipconv = subnetkind === 'ipv4'\n ? ip.toIPv4Address()\n : ip.toIPv4MappedAddress()\n }\n\n trusted = ipconv\n }\n\n if (trusted.match(subnetip, subnetrange)) {\n return true\n }\n }\n\n return false\n }\n}\n\n/**\n * Compile trust function for single subnet.\n *\n * @param {Object} subnet\n * @private\n */\n\nfunction trustSingle (subnet) {\n var subnetip = subnet[0]\n var subnetkind = subnetip.kind()\n var subnetisipv4 = subnetkind === 'ipv4'\n var subnetrange = subnet[1]\n\n return function trust (addr) {\n if (!isip(addr)) return false\n\n var ip = parseip(addr)\n var kind = ip.kind()\n\n if (kind !== subnetkind) {\n if (subnetisipv4 && !ip.isIPv4MappedAddress()) {\n // Incompatible IP addresses\n return false\n }\n\n // Convert IP to match subnet IP kind\n ip = subnetisipv4\n ? ip.toIPv4Address()\n : ip.toIPv4MappedAddress()\n }\n\n return ip.match(subnetip, subnetrange)\n }\n}\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar split = String.prototype.split;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n if (generateArrayPrefix === 'comma' && encodeValuesOnly) {\n var valuesArray = split.call(String(obj), ',');\n var valuesJoined = '';\n for (var i = 0; i < valuesArray.length; ++i) {\n valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));\n }\n return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];\n }\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","/*!\n * random-bytes\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar crypto = require('crypto')\n\n/**\n * Module variables.\n * @private\n */\n\nvar generateAttempts = crypto.randomBytes === crypto.pseudoRandomBytes ? 1 : 3\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = randomBytes\nmodule.exports.sync = randomBytesSync\n\n/**\n * Generates strong pseudo-random bytes.\n *\n * @param {number} size\n * @param {function} [callback]\n * @return {Promise}\n * @public\n */\n\nfunction randomBytes(size, callback) {\n // validate callback is a function, if provided\n if (callback !== undefined && typeof callback !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!callback && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n if (callback) {\n // classic callback style\n return generateRandomBytes(size, generateAttempts, callback)\n }\n\n return new Promise(function executor(resolve, reject) {\n generateRandomBytes(size, generateAttempts, function onRandomBytes(err, str) {\n if (err) return reject(err)\n resolve(str)\n })\n })\n}\n\n/**\n * Generates strong pseudo-random bytes sync.\n *\n * @param {number} size\n * @return {Buffer}\n * @public\n */\n\nfunction randomBytesSync(size) {\n var err = null\n\n for (var i = 0; i < generateAttempts; i++) {\n try {\n return crypto.randomBytes(size)\n } catch (e) {\n err = e\n }\n }\n\n throw err\n}\n\n/**\n * Generates strong pseudo-random bytes.\n *\n * @param {number} size\n * @param {number} attempts\n * @param {function} callback\n * @private\n */\n\nfunction generateRandomBytes(size, attempts, callback) {\n crypto.randomBytes(size, function onRandomBytes(err, buf) {\n if (!err) return callback(null, buf)\n if (!--attempts) return callback(err)\n setTimeout(generateRandomBytes.bind(null, size, attempts, callback), 10)\n })\n}\n","/*!\n * range-parser\n * Copyright(c) 2012-2014 TJ Holowaychuk\n * Copyright(c) 2015-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = rangeParser\n\n/**\n * Parse \"Range\" header `str` relative to the given file `size`.\n *\n * @param {Number} size\n * @param {String} str\n * @param {Object} [options]\n * @return {Array}\n * @public\n */\n\nfunction rangeParser (size, str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string')\n }\n\n var index = str.indexOf('=')\n\n if (index === -1) {\n return -2\n }\n\n // split the range string\n var arr = str.slice(index + 1).split(',')\n var ranges = []\n\n // add ranges type\n ranges.type = str.slice(0, index)\n\n // parse all ranges\n for (var i = 0; i < arr.length; i++) {\n var range = arr[i].split('-')\n var start = parseInt(range[0], 10)\n var end = parseInt(range[1], 10)\n\n // -nnn\n if (isNaN(start)) {\n start = size - end\n end = size - 1\n // nnn-\n } else if (isNaN(end)) {\n end = size - 1\n }\n\n // limit last-byte-pos to current length\n if (end > size - 1) {\n end = size - 1\n }\n\n // invalid or unsatisifiable\n if (isNaN(start) || isNaN(end) || start > end || start < 0) {\n continue\n }\n\n // add range\n ranges.push({\n start: start,\n end: end\n })\n }\n\n if (ranges.length < 1) {\n // unsatisifiable\n return -1\n }\n\n return options && options.combine\n ? combineRanges(ranges)\n : ranges\n}\n\n/**\n * Combine overlapping & adjacent ranges.\n * @private\n */\n\nfunction combineRanges (ranges) {\n var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart)\n\n for (var j = 0, i = 1; i < ordered.length; i++) {\n var range = ordered[i]\n var current = ordered[j]\n\n if (range.start > current.end + 1) {\n // next range\n ordered[++j] = range\n } else if (range.end > current.end) {\n // extend range\n current.end = range.end\n current.index = Math.min(current.index, range.index)\n }\n }\n\n // trim ordered array\n ordered.length = j + 1\n\n // generate combined range\n var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex)\n\n // copy ranges type\n combined.type = ranges.type\n\n return combined\n}\n\n/**\n * Map function to add index value to ranges.\n * @private\n */\n\nfunction mapWithIndex (range, index) {\n return {\n start: range.start,\n end: range.end,\n index: index\n }\n}\n\n/**\n * Map function to remove index value from ranges.\n * @private\n */\n\nfunction mapWithoutIndex (range) {\n return {\n start: range.start,\n end: range.end\n }\n}\n\n/**\n * Sort function to sort ranges by index.\n * @private\n */\n\nfunction sortByRangeIndex (a, b) {\n return a.index - b.index\n}\n\n/**\n * Sort function to sort ranges by start position.\n * @private\n */\n\nfunction sortByRangeStart (a, b) {\n return a.start - b.start\n}\n","/*!\n * raw-body\n * Copyright(c) 2013-2014 Jonathan Ong\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar asyncHooks = tryRequireAsyncHooks()\nvar bytes = require('bytes')\nvar createError = require('http-errors')\nvar iconv = require('iconv-lite')\nvar unpipe = require('unpipe')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = getRawBody\n\n/**\n * Module variables.\n * @private\n */\n\nvar ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /\n\n/**\n * Get the decoder for a given encoding.\n *\n * @param {string} encoding\n * @private\n */\n\nfunction getDecoder (encoding) {\n if (!encoding) return null\n\n try {\n return iconv.getDecoder(encoding)\n } catch (e) {\n // error getting decoder\n if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e\n\n // the encoding was not found\n throw createError(415, 'specified encoding unsupported', {\n encoding: encoding,\n type: 'encoding.unsupported'\n })\n }\n}\n\n/**\n * Get the raw body of a stream (typically HTTP).\n *\n * @param {object} stream\n * @param {object|string|function} [options]\n * @param {function} [callback]\n * @public\n */\n\nfunction getRawBody (stream, options, callback) {\n var done = callback\n var opts = options || {}\n\n if (options === true || typeof options === 'string') {\n // short cut for encoding\n opts = {\n encoding: options\n }\n }\n\n if (typeof options === 'function') {\n done = options\n opts = {}\n }\n\n // validate callback is a function, if provided\n if (done !== undefined && typeof done !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!done && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n // get encoding\n var encoding = opts.encoding !== true\n ? opts.encoding\n : 'utf-8'\n\n // convert the limit to an integer\n var limit = bytes.parse(opts.limit)\n\n // convert the expected length to an integer\n var length = opts.length != null && !isNaN(opts.length)\n ? parseInt(opts.length, 10)\n : null\n\n if (done) {\n // classic callback style\n return readStream(stream, encoding, length, limit, wrap(done))\n }\n\n return new Promise(function executor (resolve, reject) {\n readStream(stream, encoding, length, limit, function onRead (err, buf) {\n if (err) return reject(err)\n resolve(buf)\n })\n })\n}\n\n/**\n * Halt a stream.\n *\n * @param {Object} stream\n * @private\n */\n\nfunction halt (stream) {\n // unpipe everything from the stream\n unpipe(stream)\n\n // pause stream\n if (typeof stream.pause === 'function') {\n stream.pause()\n }\n}\n\n/**\n * Read the data from the stream.\n *\n * @param {object} stream\n * @param {string} encoding\n * @param {number} length\n * @param {number} limit\n * @param {function} callback\n * @public\n */\n\nfunction readStream (stream, encoding, length, limit, callback) {\n var complete = false\n var sync = true\n\n // check the length and limit options.\n // note: we intentionally leave the stream paused,\n // so users should handle the stream themselves.\n if (limit !== null && length !== null && length > limit) {\n return done(createError(413, 'request entity too large', {\n expected: length,\n length: length,\n limit: limit,\n type: 'entity.too.large'\n }))\n }\n\n // streams1: assert request encoding is buffer.\n // streams2+: assert the stream encoding is buffer.\n // stream._decoder: streams1\n // state.encoding: streams2\n // state.decoder: streams2, specifically < 0.10.6\n var state = stream._readableState\n if (stream._decoder || (state && (state.encoding || state.decoder))) {\n // developer error\n return done(createError(500, 'stream encoding should not be set', {\n type: 'stream.encoding.set'\n }))\n }\n\n if (typeof stream.readable !== 'undefined' && !stream.readable) {\n return done(createError(500, 'stream is not readable', {\n type: 'stream.not.readable'\n }))\n }\n\n var received = 0\n var decoder\n\n try {\n decoder = getDecoder(encoding)\n } catch (err) {\n return done(err)\n }\n\n var buffer = decoder\n ? ''\n : []\n\n // attach listeners\n stream.on('aborted', onAborted)\n stream.on('close', cleanup)\n stream.on('data', onData)\n stream.on('end', onEnd)\n stream.on('error', onEnd)\n\n // mark sync section complete\n sync = false\n\n function done () {\n var args = new Array(arguments.length)\n\n // copy arguments\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n // mark complete\n complete = true\n\n if (sync) {\n process.nextTick(invokeCallback)\n } else {\n invokeCallback()\n }\n\n function invokeCallback () {\n cleanup()\n\n if (args[0]) {\n // halt the stream on error\n halt(stream)\n }\n\n callback.apply(null, args)\n }\n }\n\n function onAborted () {\n if (complete) return\n\n done(createError(400, 'request aborted', {\n code: 'ECONNABORTED',\n expected: length,\n length: length,\n received: received,\n type: 'request.aborted'\n }))\n }\n\n function onData (chunk) {\n if (complete) return\n\n received += chunk.length\n\n if (limit !== null && received > limit) {\n done(createError(413, 'request entity too large', {\n limit: limit,\n received: received,\n type: 'entity.too.large'\n }))\n } else if (decoder) {\n buffer += decoder.write(chunk)\n } else {\n buffer.push(chunk)\n }\n }\n\n function onEnd (err) {\n if (complete) return\n if (err) return done(err)\n\n if (length !== null && received !== length) {\n done(createError(400, 'request size did not match content length', {\n expected: length,\n length: length,\n received: received,\n type: 'request.size.invalid'\n }))\n } else {\n var string = decoder\n ? buffer + (decoder.end() || '')\n : Buffer.concat(buffer)\n done(null, string)\n }\n }\n\n function cleanup () {\n buffer = null\n\n stream.removeListener('aborted', onAborted)\n stream.removeListener('data', onData)\n stream.removeListener('end', onEnd)\n stream.removeListener('error', onEnd)\n stream.removeListener('close', cleanup)\n }\n}\n\n/**\n * Try to require async_hooks\n * @private\n */\n\nfunction tryRequireAsyncHooks () {\n try {\n return require('async_hooks')\n } catch (e) {\n return {}\n }\n}\n\n/**\n * Wrap function with async resource, if possible.\n * AsyncResource.bind static method backported.\n * @private\n */\n\nfunction wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) });\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next mehtod, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","/*!\n * send\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = require('http-errors')\nvar debug = require('debug')('send')\nvar deprecate = require('depd')('send')\nvar destroy = require('destroy')\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar etag = require('etag')\nvar fresh = require('fresh')\nvar fs = require('fs')\nvar mime = require('mime')\nvar ms = require('ms')\nvar onFinished = require('on-finished')\nvar parseRange = require('range-parser')\nvar path = require('path')\nvar statuses = require('statuses')\nvar Stream = require('stream')\nvar util = require('util')\n\n/**\n * Path function references.\n * @private\n */\n\nvar extname = path.extname\nvar join = path.join\nvar normalize = path.normalize\nvar resolve = path.resolve\nvar sep = path.sep\n\n/**\n * Regular expression for identifying a bytes Range header.\n * @private\n */\n\nvar BYTES_RANGE_REGEXP = /^ *bytes=/\n\n/**\n * Maximum value allowed for the max age.\n * @private\n */\n\nvar MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year\n\n/**\n * Regular expression to match a path with a directory up component.\n * @private\n */\n\nvar UP_PATH_REGEXP = /(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$)/\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = send\nmodule.exports.mime = mime\n\n/**\n * Return a `SendStream` for `req` and `path`.\n *\n * @param {object} req\n * @param {string} path\n * @param {object} [options]\n * @return {SendStream}\n * @public\n */\n\nfunction send (req, path, options) {\n return new SendStream(req, path, options)\n}\n\n/**\n * Initialize a `SendStream` with the given `path`.\n *\n * @param {Request} req\n * @param {String} path\n * @param {object} [options]\n * @private\n */\n\nfunction SendStream (req, path, options) {\n Stream.call(this)\n\n var opts = options || {}\n\n this.options = opts\n this.path = path\n this.req = req\n\n this._acceptRanges = opts.acceptRanges !== undefined\n ? Boolean(opts.acceptRanges)\n : true\n\n this._cacheControl = opts.cacheControl !== undefined\n ? Boolean(opts.cacheControl)\n : true\n\n this._etag = opts.etag !== undefined\n ? Boolean(opts.etag)\n : true\n\n this._dotfiles = opts.dotfiles !== undefined\n ? opts.dotfiles\n : 'ignore'\n\n if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') {\n throw new TypeError('dotfiles option must be \"allow\", \"deny\", or \"ignore\"')\n }\n\n this._hidden = Boolean(opts.hidden)\n\n if (opts.hidden !== undefined) {\n deprecate('hidden: use dotfiles: \\'' + (this._hidden ? 'allow' : 'ignore') + '\\' instead')\n }\n\n // legacy support\n if (opts.dotfiles === undefined) {\n this._dotfiles = undefined\n }\n\n this._extensions = opts.extensions !== undefined\n ? normalizeList(opts.extensions, 'extensions option')\n : []\n\n this._immutable = opts.immutable !== undefined\n ? Boolean(opts.immutable)\n : false\n\n this._index = opts.index !== undefined\n ? normalizeList(opts.index, 'index option')\n : ['index.html']\n\n this._lastModified = opts.lastModified !== undefined\n ? Boolean(opts.lastModified)\n : true\n\n this._maxage = opts.maxAge || opts.maxage\n this._maxage = typeof this._maxage === 'string'\n ? ms(this._maxage)\n : Number(this._maxage)\n this._maxage = !isNaN(this._maxage)\n ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)\n : 0\n\n this._root = opts.root\n ? resolve(opts.root)\n : null\n\n if (!this._root && opts.from) {\n this.from(opts.from)\n }\n}\n\n/**\n * Inherits from `Stream`.\n */\n\nutil.inherits(SendStream, Stream)\n\n/**\n * Enable or disable etag generation.\n *\n * @param {Boolean} val\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.etag = deprecate.function(function etag (val) {\n this._etag = Boolean(val)\n debug('etag %s', this._etag)\n return this\n}, 'send.etag: pass etag as option')\n\n/**\n * Enable or disable \"hidden\" (dot) files.\n *\n * @param {Boolean} path\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.hidden = deprecate.function(function hidden (val) {\n this._hidden = Boolean(val)\n this._dotfiles = undefined\n debug('hidden %s', this._hidden)\n return this\n}, 'send.hidden: use dotfiles option')\n\n/**\n * Set index `paths`, set to a falsy\n * value to disable index support.\n *\n * @param {String|Boolean|Array} paths\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.index = deprecate.function(function index (paths) {\n var index = !paths ? [] : normalizeList(paths, 'paths argument')\n debug('index %o', paths)\n this._index = index\n return this\n}, 'send.index: pass index as option')\n\n/**\n * Set root `path`.\n *\n * @param {String} path\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.root = function root (path) {\n this._root = resolve(String(path))\n debug('root %s', this._root)\n return this\n}\n\nSendStream.prototype.from = deprecate.function(SendStream.prototype.root,\n 'send.from: pass root as option')\n\nSendStream.prototype.root = deprecate.function(SendStream.prototype.root,\n 'send.root: pass root as option')\n\n/**\n * Set max-age to `maxAge`.\n *\n * @param {Number} maxAge\n * @return {SendStream}\n * @api public\n */\n\nSendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {\n this._maxage = typeof maxAge === 'string'\n ? ms(maxAge)\n : Number(maxAge)\n this._maxage = !isNaN(this._maxage)\n ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)\n : 0\n debug('max-age %d', this._maxage)\n return this\n}, 'send.maxage: pass maxAge as option')\n\n/**\n * Emit error with `status`.\n *\n * @param {number} status\n * @param {Error} [err]\n * @private\n */\n\nSendStream.prototype.error = function error (status, err) {\n // emit if listeners instead of responding\n if (hasListeners(this, 'error')) {\n return this.emit('error', createHttpError(status, err))\n }\n\n var res = this.res\n var msg = statuses.message[status] || String(status)\n var doc = createHtmlDocument('Error', escapeHtml(msg))\n\n // clear existing headers\n clearHeaders(res)\n\n // add error headers\n if (err && err.headers) {\n setHeaders(res, err.headers)\n }\n\n // send basic response\n res.statusCode = status\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.end(doc)\n}\n\n/**\n * Check if the pathname ends with \"/\".\n *\n * @return {boolean}\n * @private\n */\n\nSendStream.prototype.hasTrailingSlash = function hasTrailingSlash () {\n return this.path[this.path.length - 1] === '/'\n}\n\n/**\n * Check if this is a conditional GET request.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isConditionalGET = function isConditionalGET () {\n return this.req.headers['if-match'] ||\n this.req.headers['if-unmodified-since'] ||\n this.req.headers['if-none-match'] ||\n this.req.headers['if-modified-since']\n}\n\n/**\n * Check if the request preconditions failed.\n *\n * @return {boolean}\n * @private\n */\n\nSendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {\n var req = this.req\n var res = this.res\n\n // if-match\n var match = req.headers['if-match']\n if (match) {\n var etag = res.getHeader('ETag')\n return !etag || (match !== '*' && parseTokenList(match).every(function (match) {\n return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag\n }))\n }\n\n // if-unmodified-since\n var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since'])\n if (!isNaN(unmodifiedSince)) {\n var lastModified = parseHttpDate(res.getHeader('Last-Modified'))\n return isNaN(lastModified) || lastModified > unmodifiedSince\n }\n\n return false\n}\n\n/**\n * Strip various content header fields for a change in entity.\n *\n * @private\n */\n\nSendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {\n var res = this.res\n\n res.removeHeader('Content-Encoding')\n res.removeHeader('Content-Language')\n res.removeHeader('Content-Length')\n res.removeHeader('Content-Range')\n res.removeHeader('Content-Type')\n}\n\n/**\n * Respond with 304 not modified.\n *\n * @api private\n */\n\nSendStream.prototype.notModified = function notModified () {\n var res = this.res\n debug('not modified')\n this.removeContentHeaderFields()\n res.statusCode = 304\n res.end()\n}\n\n/**\n * Raise error that headers already sent.\n *\n * @api private\n */\n\nSendStream.prototype.headersAlreadySent = function headersAlreadySent () {\n var err = new Error('Can\\'t set headers after they are sent.')\n debug('headers already sent')\n this.error(500, err)\n}\n\n/**\n * Check if the request is cacheable, aka\n * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isCachable = function isCachable () {\n var statusCode = this.res.statusCode\n return (statusCode >= 200 && statusCode < 300) ||\n statusCode === 304\n}\n\n/**\n * Handle stat() error.\n *\n * @param {Error} error\n * @private\n */\n\nSendStream.prototype.onStatError = function onStatError (error) {\n switch (error.code) {\n case 'ENAMETOOLONG':\n case 'ENOENT':\n case 'ENOTDIR':\n this.error(404, error)\n break\n default:\n this.error(500, error)\n break\n }\n}\n\n/**\n * Check if the cache is fresh.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isFresh = function isFresh () {\n return fresh(this.req.headers, {\n etag: this.res.getHeader('ETag'),\n 'last-modified': this.res.getHeader('Last-Modified')\n })\n}\n\n/**\n * Check if the range is fresh.\n *\n * @return {Boolean}\n * @api private\n */\n\nSendStream.prototype.isRangeFresh = function isRangeFresh () {\n var ifRange = this.req.headers['if-range']\n\n if (!ifRange) {\n return true\n }\n\n // if-range as etag\n if (ifRange.indexOf('\"') !== -1) {\n var etag = this.res.getHeader('ETag')\n return Boolean(etag && ifRange.indexOf(etag) !== -1)\n }\n\n // if-range as modified date\n var lastModified = this.res.getHeader('Last-Modified')\n return parseHttpDate(lastModified) <= parseHttpDate(ifRange)\n}\n\n/**\n * Redirect to path.\n *\n * @param {string} path\n * @private\n */\n\nSendStream.prototype.redirect = function redirect (path) {\n var res = this.res\n\n if (hasListeners(this, 'directory')) {\n this.emit('directory', res, path)\n return\n }\n\n if (this.hasTrailingSlash()) {\n this.error(403)\n return\n }\n\n var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to ' +\n escapeHtml(loc) + '')\n\n // redirect\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n}\n\n/**\n * Pipe to `res.\n *\n * @param {Stream} res\n * @return {Stream} res\n * @api public\n */\n\nSendStream.prototype.pipe = function pipe (res) {\n // root path\n var root = this._root\n\n // references\n this.res = res\n\n // decode the path\n var path = decode(this.path)\n if (path === -1) {\n this.error(400)\n return res\n }\n\n // null byte(s)\n if (~path.indexOf('\\0')) {\n this.error(400)\n return res\n }\n\n var parts\n if (root !== null) {\n // normalize\n if (path) {\n path = normalize('.' + sep + path)\n }\n\n // malicious path\n if (UP_PATH_REGEXP.test(path)) {\n debug('malicious path \"%s\"', path)\n this.error(403)\n return res\n }\n\n // explode path parts\n parts = path.split(sep)\n\n // join / normalize from optional root dir\n path = normalize(join(root, path))\n } else {\n // \"..\" is malicious without \"root\"\n if (UP_PATH_REGEXP.test(path)) {\n debug('malicious path \"%s\"', path)\n this.error(403)\n return res\n }\n\n // explode path parts\n parts = normalize(path).split(sep)\n\n // resolve the path\n path = resolve(path)\n }\n\n // dotfile handling\n if (containsDotFile(parts)) {\n var access = this._dotfiles\n\n // legacy support\n if (access === undefined) {\n access = parts[parts.length - 1][0] === '.'\n ? (this._hidden ? 'allow' : 'ignore')\n : 'allow'\n }\n\n debug('%s dotfile \"%s\"', access, path)\n switch (access) {\n case 'allow':\n break\n case 'deny':\n this.error(403)\n return res\n case 'ignore':\n default:\n this.error(404)\n return res\n }\n }\n\n // index file support\n if (this._index.length && this.hasTrailingSlash()) {\n this.sendIndex(path)\n return res\n }\n\n this.sendFile(path)\n return res\n}\n\n/**\n * Transfer `path`.\n *\n * @param {String} path\n * @api public\n */\n\nSendStream.prototype.send = function send (path, stat) {\n var len = stat.size\n var options = this.options\n var opts = {}\n var res = this.res\n var req = this.req\n var ranges = req.headers.range\n var offset = options.start || 0\n\n if (headersSent(res)) {\n // impossible to send now\n this.headersAlreadySent()\n return\n }\n\n debug('pipe \"%s\"', path)\n\n // set header fields\n this.setHeader(path, stat)\n\n // set content-type\n this.type(path)\n\n // conditional GET support\n if (this.isConditionalGET()) {\n if (this.isPreconditionFailure()) {\n this.error(412)\n return\n }\n\n if (this.isCachable() && this.isFresh()) {\n this.notModified()\n return\n }\n }\n\n // adjust len to start/end options\n len = Math.max(0, len - offset)\n if (options.end !== undefined) {\n var bytes = options.end - offset + 1\n if (len > bytes) len = bytes\n }\n\n // Range support\n if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) {\n // parse\n ranges = parseRange(len, ranges, {\n combine: true\n })\n\n // If-Range support\n if (!this.isRangeFresh()) {\n debug('range stale')\n ranges = -2\n }\n\n // unsatisfiable\n if (ranges === -1) {\n debug('range unsatisfiable')\n\n // Content-Range\n res.setHeader('Content-Range', contentRange('bytes', len))\n\n // 416 Requested Range Not Satisfiable\n return this.error(416, {\n headers: { 'Content-Range': res.getHeader('Content-Range') }\n })\n }\n\n // valid (syntactically invalid/multiple ranges are treated as a regular response)\n if (ranges !== -2 && ranges.length === 1) {\n debug('range %j', ranges)\n\n // Content-Range\n res.statusCode = 206\n res.setHeader('Content-Range', contentRange('bytes', len, ranges[0]))\n\n // adjust for requested range\n offset += ranges[0].start\n len = ranges[0].end - ranges[0].start + 1\n }\n }\n\n // clone options\n for (var prop in options) {\n opts[prop] = options[prop]\n }\n\n // set read options\n opts.start = offset\n opts.end = Math.max(offset, offset + len - 1)\n\n // content-length\n res.setHeader('Content-Length', len)\n\n // HEAD support\n if (req.method === 'HEAD') {\n res.end()\n return\n }\n\n this.stream(path, opts)\n}\n\n/**\n * Transfer file for `path`.\n *\n * @param {String} path\n * @api private\n */\nSendStream.prototype.sendFile = function sendFile (path) {\n var i = 0\n var self = this\n\n debug('stat \"%s\"', path)\n fs.stat(path, function onstat (err, stat) {\n if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) {\n // not found, check extensions\n return next(err)\n }\n if (err) return self.onStatError(err)\n if (stat.isDirectory()) return self.redirect(path)\n self.emit('file', path, stat)\n self.send(path, stat)\n })\n\n function next (err) {\n if (self._extensions.length <= i) {\n return err\n ? self.onStatError(err)\n : self.error(404)\n }\n\n var p = path + '.' + self._extensions[i++]\n\n debug('stat \"%s\"', p)\n fs.stat(p, function (err, stat) {\n if (err) return next(err)\n if (stat.isDirectory()) return next()\n self.emit('file', p, stat)\n self.send(p, stat)\n })\n }\n}\n\n/**\n * Transfer index for `path`.\n *\n * @param {String} path\n * @api private\n */\nSendStream.prototype.sendIndex = function sendIndex (path) {\n var i = -1\n var self = this\n\n function next (err) {\n if (++i >= self._index.length) {\n if (err) return self.onStatError(err)\n return self.error(404)\n }\n\n var p = join(path, self._index[i])\n\n debug('stat \"%s\"', p)\n fs.stat(p, function (err, stat) {\n if (err) return next(err)\n if (stat.isDirectory()) return next()\n self.emit('file', p, stat)\n self.send(p, stat)\n })\n }\n\n next()\n}\n\n/**\n * Stream `path` to the response.\n *\n * @param {String} path\n * @param {Object} options\n * @api private\n */\n\nSendStream.prototype.stream = function stream (path, options) {\n var self = this\n var res = this.res\n\n // pipe\n var stream = fs.createReadStream(path, options)\n this.emit('stream', stream)\n stream.pipe(res)\n\n // cleanup\n function cleanup () {\n destroy(stream, true)\n }\n\n // response finished, cleanup\n onFinished(res, cleanup)\n\n // error handling\n stream.on('error', function onerror (err) {\n // clean up stream early\n cleanup()\n\n // error\n self.onStatError(err)\n })\n\n // end\n stream.on('end', function onend () {\n self.emit('end')\n })\n}\n\n/**\n * Set content-type based on `path`\n * if it hasn't been explicitly set.\n *\n * @param {String} path\n * @api private\n */\n\nSendStream.prototype.type = function type (path) {\n var res = this.res\n\n if (res.getHeader('Content-Type')) return\n\n var type = mime.lookup(path)\n\n if (!type) {\n debug('no content-type')\n return\n }\n\n var charset = mime.charsets.lookup(type)\n\n debug('content-type %s', type)\n res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''))\n}\n\n/**\n * Set response header fields, most\n * fields may be pre-defined.\n *\n * @param {String} path\n * @param {Object} stat\n * @api private\n */\n\nSendStream.prototype.setHeader = function setHeader (path, stat) {\n var res = this.res\n\n this.emit('headers', res, path, stat)\n\n if (this._acceptRanges && !res.getHeader('Accept-Ranges')) {\n debug('accept ranges')\n res.setHeader('Accept-Ranges', 'bytes')\n }\n\n if (this._cacheControl && !res.getHeader('Cache-Control')) {\n var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000)\n\n if (this._immutable) {\n cacheControl += ', immutable'\n }\n\n debug('cache-control %s', cacheControl)\n res.setHeader('Cache-Control', cacheControl)\n }\n\n if (this._lastModified && !res.getHeader('Last-Modified')) {\n var modified = stat.mtime.toUTCString()\n debug('modified %s', modified)\n res.setHeader('Last-Modified', modified)\n }\n\n if (this._etag && !res.getHeader('ETag')) {\n var val = etag(stat)\n debug('etag %s', val)\n res.setHeader('ETag', val)\n }\n}\n\n/**\n * Clear all headers from a response.\n *\n * @param {object} res\n * @private\n */\n\nfunction clearHeaders (res) {\n var headers = getHeaderNames(res)\n\n for (var i = 0; i < headers.length; i++) {\n res.removeHeader(headers[i])\n }\n}\n\n/**\n * Collapse all leading slashes into a single slash\n *\n * @param {string} str\n * @private\n */\nfunction collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}\n\n/**\n * Determine if path parts contain a dotfile.\n *\n * @api private\n */\n\nfunction containsDotFile (parts) {\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i]\n if (part.length > 1 && part[0] === '.') {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Create a Content-Range header.\n *\n * @param {string} type\n * @param {number} size\n * @param {array} [range]\n */\n\nfunction contentRange (type, size, range) {\n return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size\n}\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} title\n * @param {string} body\n * @private\n */\n\nfunction createHtmlDocument (title, body) {\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n '' + title + '\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Create a HttpError object from simple arguments.\n *\n * @param {number} status\n * @param {Error|object} err\n * @private\n */\n\nfunction createHttpError (status, err) {\n if (!err) {\n return createError(status)\n }\n\n return err instanceof Error\n ? createError(status, err, { expose: false })\n : createError(status, err)\n}\n\n/**\n * decodeURIComponent.\n *\n * Allows V8 to only deoptimize this fn instead of all\n * of send().\n *\n * @param {String} path\n * @api private\n */\n\nfunction decode (path) {\n try {\n return decodeURIComponent(path)\n } catch (err) {\n return -1\n }\n}\n\n/**\n * Get the header names on a respnse.\n *\n * @param {object} res\n * @returns {array[string]}\n * @private\n */\n\nfunction getHeaderNames (res) {\n return typeof res.getHeaderNames !== 'function'\n ? Object.keys(res._headers || {})\n : res.getHeaderNames()\n}\n\n/**\n * Determine if emitter has listeners of a given type.\n *\n * The way to do this check is done three different ways in Node.js >= 0.8\n * so this consolidates them into a minimal set using instance methods.\n *\n * @param {EventEmitter} emitter\n * @param {string} type\n * @returns {boolean}\n * @private\n */\n\nfunction hasListeners (emitter, type) {\n var count = typeof emitter.listenerCount !== 'function'\n ? emitter.listeners(type).length\n : emitter.listenerCount(type)\n\n return count > 0\n}\n\n/**\n * Determine if the response headers have been sent.\n *\n * @param {object} res\n * @returns {boolean}\n * @private\n */\n\nfunction headersSent (res) {\n return typeof res.headersSent !== 'boolean'\n ? Boolean(res._header)\n : res.headersSent\n}\n\n/**\n * Normalize the index option into an array.\n *\n * @param {boolean|string|array} val\n * @param {string} name\n * @private\n */\n\nfunction normalizeList (val, name) {\n var list = [].concat(val || [])\n\n for (var i = 0; i < list.length; i++) {\n if (typeof list[i] !== 'string') {\n throw new TypeError(name + ' must be array of strings or false')\n }\n }\n\n return list\n}\n\n/**\n * Parse an HTTP Date into a number.\n *\n * @param {string} date\n * @private\n */\n\nfunction parseHttpDate (date) {\n var timestamp = date && Date.parse(date)\n\n return typeof timestamp === 'number'\n ? timestamp\n : NaN\n}\n\n/**\n * Parse a HTTP token list.\n *\n * @param {string} str\n * @private\n */\n\nfunction parseTokenList (str) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = str.length; i < len; i++) {\n switch (str.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n if (start !== end) {\n list.push(str.substring(start, end))\n }\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n if (start !== end) {\n list.push(str.substring(start, end))\n }\n\n return list\n}\n\n/**\n * Set an object of headers on a response.\n *\n * @param {object} res\n * @param {object} headers\n * @private\n */\n\nfunction setHeaders (res, headers) {\n var keys = Object.keys(headers)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n res.setHeader(key, headers[key])\n }\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","/*!\n * serve-static\n * Copyright(c) 2010 Sencha Inc.\n * Copyright(c) 2011 TJ Holowaychuk\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar parseUrl = require('parseurl')\nvar resolve = require('path').resolve\nvar send = require('send')\nvar url = require('url')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = serveStatic\nmodule.exports.mime = send.mime\n\n/**\n * @param {string} root\n * @param {object} [options]\n * @return {function}\n * @public\n */\n\nfunction serveStatic (root, options) {\n if (!root) {\n throw new TypeError('root path required')\n }\n\n if (typeof root !== 'string') {\n throw new TypeError('root path must be a string')\n }\n\n // copy options object\n var opts = Object.create(options || null)\n\n // fall-though\n var fallthrough = opts.fallthrough !== false\n\n // default redirect\n var redirect = opts.redirect !== false\n\n // headers listener\n var setHeaders = opts.setHeaders\n\n if (setHeaders && typeof setHeaders !== 'function') {\n throw new TypeError('option setHeaders must be function')\n }\n\n // setup options for send\n opts.maxage = opts.maxage || opts.maxAge || 0\n opts.root = resolve(root)\n\n // construct directory listener\n var onDirectory = redirect\n ? createRedirectDirectoryListener()\n : createNotFoundDirectoryListener()\n\n return function serveStatic (req, res, next) {\n if (req.method !== 'GET' && req.method !== 'HEAD') {\n if (fallthrough) {\n return next()\n }\n\n // method not allowed\n res.statusCode = 405\n res.setHeader('Allow', 'GET, HEAD')\n res.setHeader('Content-Length', '0')\n res.end()\n return\n }\n\n var forwardError = !fallthrough\n var originalUrl = parseUrl.original(req)\n var path = parseUrl(req).pathname\n\n // make sure redirect occurs at mount\n if (path === '/' && originalUrl.pathname.substr(-1) !== '/') {\n path = ''\n }\n\n // create send stream\n var stream = send(req, path, opts)\n\n // add directory handler\n stream.on('directory', onDirectory)\n\n // add headers listener\n if (setHeaders) {\n stream.on('headers', setHeaders)\n }\n\n // add file listener for fallthrough\n if (fallthrough) {\n stream.on('file', function onFile () {\n // once file is determined, always forward error\n forwardError = true\n })\n }\n\n // forward errors\n stream.on('error', function error (err) {\n if (forwardError || !(err.statusCode < 500)) {\n next(err)\n return\n }\n\n next()\n })\n\n // pipe\n stream.pipe(res)\n }\n}\n\n/**\n * Collapse all leading slashes into a single slash\n * @private\n */\nfunction collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}\n\n/**\n * Create a minimal HTML document.\n *\n * @param {string} title\n * @param {string} body\n * @private\n */\n\nfunction createHtmlDocument (title, body) {\n return '\\n' +\n '\\n' +\n '\\n' +\n '\\n' +\n '' + title + '\\n' +\n '\\n' +\n '\\n' +\n '
' + body + '
\\n' +\n '\\n' +\n '\\n'\n}\n\n/**\n * Create a directory listener that just 404s.\n * @private\n */\n\nfunction createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}\n\n/**\n * Create a directory listener that performs a redirect.\n * @private\n */\n\nfunction createRedirectDirectoryListener () {\n return function redirect (res) {\n if (this.hasTrailingSlash()) {\n this.error(404)\n return\n }\n\n // get original URL\n var originalUrl = parseUrl.original(this.req)\n\n // append trailing slash\n originalUrl.path = null\n originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')\n\n // reformat the URL\n var loc = encodeUrl(url.format(originalUrl))\n var doc = createHtmlDocument('Redirecting', 'Redirecting to ' +\n escapeHtml(loc) + '')\n\n // send redirect response\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', Buffer.byteLength(doc))\n res.setHeader('Content-Security-Policy', \"default-src 'none'\")\n res.setHeader('X-Content-Type-Options', 'nosniff')\n res.setHeader('Location', loc)\n res.end(doc)\n }\n}\n","'use strict'\n/* eslint no-proto: 0 */\nmodule.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)\n\nfunction setProtoOf (obj, proto) {\n obj.__proto__ = proto\n return obj\n}\n\nfunction mixinProperties (obj, proto) {\n for (var prop in proto) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) {\n obj[prop] = proto[prop]\n }\n }\n return obj\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","module.exports = {\n\tcore: {\n\t\tBatch: require(\"./src/Batch\"),\n\t\tClientBuilder: require(\"./src/ClientBuilder\"),\n\t\tbuildClient: require(\"./src/util/buildClients\"),\n\t\tSharedCredentials: require(\"./src/SharedCredentials\"),\n\t\tStaticCredentials: require(\"./src/StaticCredentials\"),\n\t\tErrors: require(\"./src/Errors\"),\n\t},\n\tusStreet: {\n\t\tLookup: require(\"./src/us_street/Lookup\"),\n\t\tCandidate: require(\"./src/us_street/Candidate\"),\n\t},\n\tusZipcode: {\n\t\tLookup: require(\"./src/us_zipcode/Lookup\"),\n\t\tResult: require(\"./src/us_zipcode/Result\"),\n\t},\n\tusAutocomplete: {\n\t\tLookup: require(\"./src/us_autocomplete/Lookup\"),\n\t\tSuggestion: require(\"./src/us_autocomplete/Suggestion\"),\n\t},\n\tusAutocompletePro: {\n\t\tLookup: require(\"./src/us_autocomplete_pro/Lookup\"),\n\t\tSuggestion: require(\"./src/us_autocomplete_pro/Suggestion\"),\n\t},\n\tusExtract: {\n\t\tLookup: require(\"./src/us_extract/Lookup\"),\n\t\tResult: require(\"./src/us_extract/Result\"),\n\t},\n\tinternationalStreet: {\n\t\tLookup: require(\"./src/international_street/Lookup\"),\n\t\tCandidate: require(\"./src/international_street/Candidate\"),\n\t},\n\tusReverseGeo: {\n\t\tLookup: require(\"./src/us_reverse_geo/Lookup\"),\n\t},\n\tinternationalAddressAutocomplete: {\n\t\tLookup: require(\"./src/international_address_autocomplete/Lookup\"),\n\t\tSuggestion: require(\"./src/international_address_autocomplete/Suggestion\"),\n\t},\n};\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar VERSION = require('./../env/data').version;\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nvar isHttps = /https:?/;\n\n/**\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} proxy\n * @param {string} location\n */\nfunction setProxy(options, proxy, location) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.port = proxy.port;\n options.path = location;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n // If a proxy is used, any redirects must also pass through the proxy\n options.beforeRedirect = function beforeRedirect(redirection) {\n redirection.headers.host = redirection.host;\n setProxy(redirection, proxy, redirection.href);\n };\n}\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n var resolve = function resolve(value) {\n done();\n resolvePromise(value);\n };\n var rejected = false;\n var reject = function reject(value) {\n done();\n rejected = true;\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n var headerNames = {};\n\n Object.keys(headers).forEach(function storeLowerName(name) {\n headerNames[name.toLowerCase()] = name;\n });\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n if ('user-agent' in headerNames) {\n // User-Agent is specified; handle case where no UA header is desired\n if (!headers[headerNames['user-agent']]) {\n delete headers[headerNames['user-agent']];\n }\n // Otherwise, use specified value\n } else {\n // Only set header if it hasn't been set in config\n headers['User-Agent'] = 'axios/' + VERSION;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(createError('Request body larger than maxBodyLength limit', config));\n }\n\n // Add Content-Length header if data exists\n if (!headerNames['content-length']) {\n headers['Content-Length'] = data.length;\n }\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth && headerNames.authorization) {\n delete headers[headerNames.authorization];\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n try {\n buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, '');\n } catch (err) {\n var customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n reject(customErr);\n }\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port,\n protocol: parsedProxyUrl.protocol\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n var totalResponseBytes = 0;\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destoy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n stream.destroy();\n reject(createError('error request aborted', config, 'ERR_REQUEST_ABORTED', lastRequest));\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n try {\n var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n reject(enhanceError(err, config, err.code, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n var timeout = parseInt(config.timeout, 10);\n\n if (isNaN(timeout)) {\n reject(createError(\n 'error trying to parse `config.timeout` to int',\n config,\n 'ERR_PARSE_TIMEOUT',\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n req.abort();\n var timeoutErrorMessage = '';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n } else {\n timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n }\n var transitional = config.transitional || transitionalDefaults;\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n req\n ));\n });\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.26.1\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","class AgentSender {\n\tconstructor(innerSender) {\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\trequest.parameters.agent = \"smarty (sdk:javascript@\" + require(\"../package.json\").version + \")\";\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = AgentSender;","class BaseUrlSender {\n\tconstructor(innerSender, urlOverride) {\n\t\tthis.urlOverride = urlOverride;\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\trequest.baseUrl = this.urlOverride;\n\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = BaseUrlSender;","const BatchFullError = require(\"./Errors\").BatchFullError;\n\n/**\n * This class contains a collection of up to 100 lookups to be sent to one of the Smarty APIs
\n * all at once. This is more efficient than sending them one at a time.\n */\nclass Batch {\n\tconstructor () {\n\t\tthis.lookups = [];\n\t}\n\n\tadd (lookup) {\n\t\tif (this.lookupsHasRoomForLookup()) this.lookups.push(lookup);\n\t\telse throw new BatchFullError();\n\t}\n\n\tlookupsHasRoomForLookup() {\n\t\tconst maxNumberOfLookups = 100;\n\t\treturn this.lookups.length < maxNumberOfLookups;\n\t}\n\n\tlength() {\n\t\treturn this.lookups.length;\n\t}\n\n\tgetByIndex(index) {\n\t\treturn this.lookups[index];\n\t}\n\n\tgetByInputId(inputId) {\n\t\treturn this.lookups.filter(lookup => {\n\t\t\treturn lookup.inputId === inputId;\n\t\t})[0];\n\t}\n\n\t/**\n\t * Clears the lookups stored in the batch so it can be used again.
\n\t * This helps avoid the overhead of building a new Batch object for each group of lookups.\n\t */\n\tclear () {\n\t\tthis.lookups = [];\n\t}\n\n\tisEmpty () {\n\t\treturn this.length() === 0;\n\t}\n}\n\nmodule.exports = Batch;","const HttpSender = require(\"./HttpSender\");\nconst SigningSender = require(\"./SigningSender\");\nconst BaseUrlSender = require(\"./BaseUrlSender\");\nconst AgentSender = require(\"./AgentSender\");\nconst StaticCredentials = require(\"./StaticCredentials\");\nconst SharedCredentials = require(\"./SharedCredentials\");\nconst CustomHeaderSender = require(\"./CustomHeaderSender\");\nconst StatusCodeSender = require(\"./StatusCodeSender\");\nconst LicenseSender = require(\"./LicenseSender\");\nconst BadCredentialsError = require(\"./Errors\").BadCredentialsError;\n\n//TODO: refactor this to work more cleanly with a bundler.\nconst UsStreetClient = require(\"./us_street/Client\");\nconst UsZipcodeClient = require(\"./us_zipcode/Client\");\nconst UsAutocompleteClient = require(\"./us_autocomplete/Client\");\nconst UsAutocompleteProClient = require(\"./us_autocomplete_pro/Client\");\nconst UsExtractClient = require(\"./us_extract/Client\");\nconst InternationalStreetClient = require(\"./international_street/Client\");\nconst UsReverseGeoClient = require(\"./us_reverse_geo/Client\");\nconst InternationalAddressAutocompleteClient = require(\"./international_address_autocomplete/Client\");\n\nconst INTERNATIONAL_STREET_API_URI = \"https://international-street.api.smartystreets.com/verify\";\nconst US_AUTOCOMPLETE_API_URL = \"https://us-autocomplete.api.smartystreets.com/suggest\";\nconst US_AUTOCOMPLETE_PRO_API_URL = \"https://us-autocomplete-pro.api.smartystreets.com/lookup\";\nconst US_EXTRACT_API_URL = \"https://us-extract.api.smartystreets.com/\";\nconst US_STREET_API_URL = \"https://us-street.api.smartystreets.com/street-address\";\nconst US_ZIP_CODE_API_URL = \"https://us-zipcode.api.smartystreets.com/lookup\";\nconst US_REVERSE_GEO_API_URL = \"https://us-reverse-geo.api.smartystreets.com/lookup\";\nconst INTERNATIONAL_ADDRESS_AUTOCOMPLETE_API_URL = \"https://international-autocomplete.api.smartystreets.com/lookup\";\n\n/**\n * The ClientBuilder class helps you build a client object for one of the supported Smarty APIs.
\n * You can use ClientBuilder's methods to customize settings like maximum retries or timeout duration. These methods
\n * are chainable, so you can usually get set up with one line of code.\n */\nclass ClientBuilder {\n\tconstructor(signer) {\n\t\tif (noCredentialsProvided()) throw new BadCredentialsError();\n\n\t\tthis.signer = signer;\n\t\tthis.httpSender = undefined;\n\t\tthis.maxRetries = 5;\n\t\tthis.maxTimeout = 10000;\n\t\tthis.baseUrl = undefined;\n\t\tthis.proxy = undefined;\n\t\tthis.customHeaders = {};\n\t\tthis.debug = undefined;\n\t\tthis.licenses = [];\n\n\t\tfunction noCredentialsProvided() {\n\t\t\treturn !signer instanceof StaticCredentials || !signer instanceof SharedCredentials;\n\t\t}\n\t}\n\n\t/**\n\t * @param retries The maximum number of times to retry sending the request to the API. (Default is 5)\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithMaxRetries(retries) {\n\t\tthis.maxRetries = retries;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @param timeout The maximum time (in milliseconds) to wait for a connection, and also to wait for
\n\t * the response to be read. (Default is 10000)\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithMaxTimeout(timeout) {\n\t\tthis.maxTimeout = timeout;\n\t\treturn this;\n\t}\n\n\t/**\n\t * @param sender Default is a series of nested senders. See buildSender().\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithSender(sender) {\n\t\tthis.httpSender = sender;\n\t\treturn this;\n\t}\n\n\t/**\n\t * This may be useful when using a local installation of the Smarty APIs.\n\t * @param url Defaults to the URL for the API corresponding to the Client object being built.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithBaseUrl(url) {\n\t\tthis.baseUrl = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Use this to specify a proxy through which to send all lookups.\n\t * @param host The host of the proxy server (do not include the port).\n\t * @param port The port on the proxy server to which you wish to connect.\n\t * @param protocol The protocol on the proxy server to which you wish to connect. If the proxy server uses HTTPS, then you must set the protocol to 'https'.\n\t * @param username The username to login to the proxy.\n\t * @param password The password to login to the proxy.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithProxy(host, port, protocol, username, password) {\n\t\tthis.proxy = {\n\t\t\thost: host,\n\t\t\tport: port,\n\t\t\tprotocol: protocol,\n\t\t};\n\n\t\tif (username && password) {\n\t\t\tthis.proxy.auth = {\n\t\t\t\tusername: username,\n\t\t\t\tpassword: password,\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Use this to add any additional headers you need.\n\t * @param customHeaders A String to Object Map of header name/value pairs.\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithCustomHeaders(customHeaders) {\n\t\tthis.customHeaders = customHeaders;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Enables debug mode, which will print information about the HTTP request and response to console.log\n\t * @return Returns this to accommodate method chaining.\n\t */\n\twithDebug() {\n\t\tthis.debug = true;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Allows the caller to specify the subscription license (aka \"track\") they wish to use.\n\t * @param licenses A String Array of licenses.\n\t * @returns Returns this to accommodate method chaining.\n\t */\n\twithLicenses(licenses) {\n\t\tthis.licenses = licenses;\n\n\t\treturn this;\n\t}\n\n\tbuildSender() {\n\t\tif (this.httpSender) return this.httpSender;\n\n\t\tconst httpSender = new HttpSender(this.maxTimeout, this.maxRetries, this.proxy, this.debug);\n\t\tconst statusCodeSender = new StatusCodeSender(httpSender);\n\t\tconst signingSender = new SigningSender(statusCodeSender, this.signer);\n\t\tconst agentSender = new AgentSender(signingSender);\n\t\tconst customHeaderSender = new CustomHeaderSender(agentSender, this.customHeaders);\n\t\tconst baseUrlSender = new BaseUrlSender(customHeaderSender, this.baseUrl);\n\t\tconst licenseSender = new LicenseSender(baseUrlSender, this.licenses);\n\n\t\treturn licenseSender;\n\t}\n\n\tbuildClient(baseUrl, Client) {\n\t\tif (!this.baseUrl) {\n\t\t\tthis.baseUrl = baseUrl;\n\t\t}\n\n\t\treturn new Client(this.buildSender());\n\t}\n\n\tbuildUsStreetApiClient() {\n\t\treturn this.buildClient(US_STREET_API_URL, UsStreetClient);\n\t}\n\n\tbuildUsZipcodeClient() {\n\t\treturn this.buildClient(US_ZIP_CODE_API_URL, UsZipcodeClient);\n\t}\n\n\tbuildUsAutocompleteClient() { // Deprecated\n\t\treturn this.buildClient(US_AUTOCOMPLETE_API_URL, UsAutocompleteClient);\n\t}\n\n\tbuildUsAutocompleteProClient() {\n\t\treturn this.buildClient(US_AUTOCOMPLETE_PRO_API_URL, UsAutocompleteProClient);\n\t}\n\n\tbuildUsExtractClient() {\n\t\treturn this.buildClient(US_EXTRACT_API_URL, UsExtractClient);\n\t}\n\n\tbuildInternationalStreetClient() {\n\t\treturn this.buildClient(INTERNATIONAL_STREET_API_URI, InternationalStreetClient);\n\t}\n\n\tbuildUsReverseGeoClient() {\n\t\treturn this.buildClient(US_REVERSE_GEO_API_URL, UsReverseGeoClient);\n\t}\n\n\tbuildInternationalAddressAutocompleteClient() {\n\t\treturn this.buildClient(INTERNATIONAL_ADDRESS_AUTOCOMPLETE_API_URL, InternationalAddressAutocompleteClient);\n\t}\n}\n\nmodule.exports = ClientBuilder;","class CustomHeaderSender {\n\tconstructor(innerSender, customHeaders) {\n\t\tthis.sender = innerSender;\n\t\tthis.customHeaders = customHeaders;\n\t}\n\n\tsend(request) {\n\t\tfor (let key in this.customHeaders) {\n\t\t\trequest.headers[key] = this.customHeaders[key];\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = CustomHeaderSender;","class SmartyError extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t}\n}\n\nclass BatchFullError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"A batch can contain a max of 100 lookups.\");\n\t}\n}\n\nclass BatchEmptyError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"A batch must contain at least 1 lookup.\");\n\t}\n}\n\nclass UndefinedLookupError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"The lookup provided is missing or undefined. Make sure you're passing a Lookup object.\");\n\t}\n}\n\nclass BadCredentialsError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Unauthorized: The credentials were provided incorrectly or did not match any existing active credentials.\");\n\t}\n}\n\nclass PaymentRequiredError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Payment Required: There is no active subscription for the account associated with the credentials submitted with the request.\");\n\t}\n}\n\nclass RequestEntityTooLargeError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Request Entity Too Large: The request body has exceeded the maximum size.\");\n\t}\n}\n\nclass BadRequestError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Bad Request (Malformed Payload): A GET request lacked a street field or the request body of a POST request contained malformed JSON.\");\n\t}\n}\n\nclass UnprocessableEntityError extends SmartyError {\n\tconstructor(message) {\n\t\tsuper(message);\n\t}\n}\n\nclass TooManyRequestsError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"When using the public 'embedded key' authentication, we restrict the number of requests coming from a given source over too short of a time.\");\n\t}\n}\n\nclass InternalServerError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Internal Server Error.\");\n\t}\n}\n\nclass ServiceUnavailableError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"Service Unavailable. Try again later.\");\n\t}\n}\n\nclass GatewayTimeoutError extends SmartyError {\n\tconstructor() {\n\t\tsuper(\"The upstream data provider did not respond in a timely fashion and the request failed. A serious, yet rare occurrence indeed.\");\n\t}\n}\n\nmodule.exports = {\n\tBatchFullError: BatchFullError,\n\tBatchEmptyError: BatchEmptyError,\n\tUndefinedLookupError: UndefinedLookupError,\n\tBadCredentialsError: BadCredentialsError,\n\tPaymentRequiredError: PaymentRequiredError,\n\tRequestEntityTooLargeError: RequestEntityTooLargeError,\n\tBadRequestError: BadRequestError,\n\tUnprocessableEntityError: UnprocessableEntityError,\n\tTooManyRequestsError: TooManyRequestsError,\n\tInternalServerError: InternalServerError,\n\tServiceUnavailableError: ServiceUnavailableError,\n\tGatewayTimeoutError: GatewayTimeoutError\n};","const Response = require(\"./Response\");\nconst Axios = require(\"axios\");\nconst axiosRetry = require(\"axios-retry\");\n\nclass HttpSender {\n\tconstructor(timeout = 10000, retries = 5, proxyConfig, debug = false) {\n\t\taxiosRetry(Axios, {\n\t\t\tretries: retries,\n\t\t});\n\t\tthis.timeout = timeout;\n\t\tthis.proxyConfig = proxyConfig;\n\t\tif (debug) this.enableDebug();\n\t}\n\n\tbuildRequestConfig({payload, parameters, headers, baseUrl}) {\n\t\tlet config = {\n\t\t\tmethod: \"GET\",\n\t\t\ttimeout: this.timeout,\n\t\t\tparams: parameters,\n\t\t\theaders: headers,\n\t\t\tbaseURL: baseUrl,\n\t\t\tvalidateStatus: function (status) {\n\t\t\t\treturn status < 500;\n\t\t\t},\n\t\t};\n\n\t\tif (payload) {\n\t\t\tconfig.method = \"POST\";\n\t\t\tconfig.data = payload;\n\t\t}\n\n\t\tif (this.proxyConfig) config.proxy = this.proxyConfig;\n\t\treturn config;\n\t}\n\n\tbuildSmartyResponse(response, error) {\n\t\tif (response) return new Response(response.status, response.data);\n\t\treturn new Response(undefined, undefined, error)\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet requestConfig = this.buildRequestConfig(request);\n\n\t\t\tAxios(requestConfig)\n\t\t\t\t.then(response => {\n\t\t\t\t\tlet smartyResponse = this.buildSmartyResponse(response);\n\n\t\t\t\t\tif (smartyResponse.statusCode >= 400) reject(smartyResponse);\n\n\t\t\t\t\tresolve(smartyResponse);\n\t\t\t\t})\n\t\t\t\t.catch(error => reject(this.buildSmartyResponse(undefined, error)));\n\t\t});\n\t}\n\n\tenableDebug() {\n\t\tAxios.interceptors.request.use(request => {\n\t\t\tconsole.log('Request:\\r\\n', request);\n\t\t\tconsole.log('\\r\\n*******************************************\\r\\n');\n\t\t\treturn request\n\t\t});\n\n\t\tAxios.interceptors.response.use(response => {\n\t\t\tconsole.log('Response:\\r\\n');\n\t\t\tconsole.log('Status:', response.status, response.statusText);\n\t\t\tconsole.log('Headers:', response.headers);\n\t\t\tconsole.log('Data:', response.data);\n\t\t\treturn response\n\t\t})\n\t}\n}\n\nmodule.exports = HttpSender;","class InputData {\n\tconstructor(lookup) {\n\t\tthis.lookup = lookup;\n\t\tthis.data = {};\n\t}\n\n\tadd(apiField, lookupField) {\n\t\tif (this.lookupFieldIsPopulated(lookupField)) this.data[apiField] = this.lookup[lookupField];\n\t}\n\n\tlookupFieldIsPopulated(lookupField) {\n\t\treturn this.lookup[lookupField] !== \"\" && this.lookup[lookupField] !== undefined;\n\t}\n}\n\nmodule.exports = InputData;","class LicenseSender {\n\tconstructor(innerSender, licenses) {\n\t\tthis.sender = innerSender;\n\t\tthis.licenses = licenses;\n\t}\n\n\tsend(request) {\n\t\tif (this.licenses.length !== 0) {\n\t\t\trequest.parameters[\"license\"] = this.licenses.join(\",\");\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = LicenseSender;","class Request {\n\tconstructor(payload) {\n\t\tthis.baseUrl = \"\";\n\t\tthis.payload = payload;\n\t\tthis.headers = {\n\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t\t};\n\n\t\tthis.parameters = {};\n\t}\n}\n\nmodule.exports = Request;","class Response {\n\tconstructor (statusCode, payload, error = undefined) {\n\t\tthis.statusCode = statusCode;\n\t\tthis.payload = payload;\n\t\tthis.error = error;\n\t}\n}\n\nmodule.exports = Response;","class SharedCredentials {\n\tconstructor(authId, hostName) {\n\t\tthis.authId = authId;\n\t\tthis.hostName = hostName;\n\t}\n\n\tsign(request) {\n\t\trequest.parameters[\"key\"] = this.authId;\n\t\tif (this.hostName) request.headers[\"Referer\"] = \"https://\" + this.hostName;\n\t}\n}\n\nmodule.exports = SharedCredentials;","const UnprocessableEntityError = require(\"./Errors\").UnprocessableEntityError;\nconst SharedCredentials = require(\"./SharedCredentials\");\n\nclass SigningSender {\n\tconstructor(innerSender, signer) {\n\t\tthis.signer = signer;\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\tconst sendingPostWithSharedCredentials = request.payload && this.signer instanceof SharedCredentials;\n\t\tif (sendingPostWithSharedCredentials) {\n\t\t\tconst message = \"Shared credentials cannot be used in batches with a length greater than 1 or when using the US Extract API.\";\n\t\t\tthrow new UnprocessableEntityError(message);\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.signer.sign(request);\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n\nmodule.exports = SigningSender;","class StaticCredentials {\n\tconstructor (authId, authToken) {\n\t\tthis.authId = authId;\n\t\tthis.authToken = authToken;\n\t}\n\n\tsign (request) {\n\t\trequest.parameters[\"auth-id\"] = this.authId;\n\t\trequest.parameters[\"auth-token\"] = this.authToken;\n\t}\n}\n\nmodule.exports = StaticCredentials;","const Errors = require(\"./Errors\");\n\nclass StatusCodeSender {\n\tconstructor(innerSender) {\n\t\tthis.sender = innerSender;\n\t}\n\n\tsend(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(error => {\n\t\t\t\t\tswitch (error.statusCode) {\n\t\t\t\t\t\tcase 400:\n\t\t\t\t\t\t\terror.error = new Errors.BadRequestError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\terror.error = new Errors.BadCredentialsError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 402:\n\t\t\t\t\t\t\terror.error = new Errors.PaymentRequiredError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 413:\n\t\t\t\t\t\t\terror.error = new Errors.RequestEntityTooLargeError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 422:\n\t\t\t\t\t\t\terror.error = new Errors.UnprocessableEntityError(\"GET request lacked required fields.\");\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 429:\n\t\t\t\t\t\t\terror.error = new Errors.TooManyRequestsError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 500:\n\t\t\t\t\t\t\terror.error = new Errors.InternalServerError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 503:\n\t\t\t\t\t\t\terror.error = new Errors.ServiceUnavailableError();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 504:\n\t\t\t\t\t\t\terror.error = new Errors.GatewayTimeoutError();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t}\n}\n\nmodule.exports = StatusCodeSender;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = {\n\t\t\tsearch: lookup.search,\n\t\t\tcountry: lookup.country,\n\t\t\tmax_results: lookup.max_results,\n\t\t\tinclude_only_administrative_area: lookup.include_only_administrative_area,\n\t\t\tinclude_only_locality: lookup.include_only_locality,\n\t\t\tinclude_only_postal_code: lookup.include_only_postal_code,\n\t\t};\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload && payload.candidates === null) return [];\n\n\t\t\treturn payload.candidates.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","class Lookup {\n\tconstructor(search = \"\", country = \"United States\", max_results = undefined, include_only_administrative_area = \"\", include_only_locality = \"\", include_only_postal_code = \"\") {\n\t\tthis.result = [];\n\n\t\tthis.search = search;\n\t\tthis.country = country;\n\t\tthis.max_results = max_results;\n\t\tthis.include_only_administrative_area = include_only_administrative_area;\n\t\tthis.include_only_locality = include_only_locality;\n\t\tthis.include_only_postal_code = include_only_postal_code;\n\t}\n}\n\nmodule.exports = Lookup;","class Suggestion {\n\tconstructor(responseData) {\n\t\tthis.street = responseData.street;\n\t\tthis.locality = responseData.locality;\n\t\tthis.administrativeArea = responseData.administrative_area;\n\t\tthis.postalCode = responseData.postal_code;\n\t\tthis.countryIso3 = responseData.country_iso3;\n\t}\n}\n\nmodule.exports = Suggestion;","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous.\n *\n * @see \"https://www.smarty.com/docs/cloud/international-street-api#root\"\n */\nclass Candidate {\n\tconstructor(responseData) {\n\t\tthis.organization = responseData.organization;\n\t\tthis.address1 = responseData.address1;\n\t\tthis.address2 = responseData.address2;\n\t\tthis.address3 = responseData.address3;\n\t\tthis.address4 = responseData.address4;\n\t\tthis.address5 = responseData.address5;\n\t\tthis.address6 = responseData.address6;\n\t\tthis.address7 = responseData.address7;\n\t\tthis.address8 = responseData.address8;\n\t\tthis.address9 = responseData.address9;\n\t\tthis.address10 = responseData.address10;\n\t\tthis.address11 = responseData.address11;\n\t\tthis.address12 = responseData.address12;\n\n\t\tthis.components = {};\n\t\tif (responseData.components !== undefined) {\n\t\t\tthis.components.countryIso3 = responseData.components.country_iso_3;\n\t\t\tthis.components.superAdministrativeArea = responseData.components.super_administrative_area;\n\t\t\tthis.components.administrativeArea = responseData.components.administrative_area;\n\t\t\tthis.components.subAdministrativeArea = responseData.components.sub_administrative_area;\n\t\t\tthis.components.dependentLocality = responseData.components.dependent_locality;\n\t\t\tthis.components.dependentLocalityName = responseData.components.dependent_locality_name;\n\t\t\tthis.components.doubleDependentLocality = responseData.components.double_dependent_locality;\n\t\t\tthis.components.locality = responseData.components.locality;\n\t\t\tthis.components.postalCode = responseData.components.postal_code;\n\t\t\tthis.components.postalCodeShort = responseData.components.postal_code_short;\n\t\t\tthis.components.postalCodeExtra = responseData.components.postal_code_extra;\n\t\t\tthis.components.premise = responseData.components.premise;\n\t\t\tthis.components.premiseExtra = responseData.components.premise_extra;\n\t\t\tthis.components.premisePrefixNumber = responseData.components.premise_prefix_number;\n\t\t\tthis.components.premiseNumber = responseData.components.premise_number;\n\t\t\tthis.components.premiseType = responseData.components.premise_type;\n\t\t\tthis.components.thoroughfare = responseData.components.thoroughfare;\n\t\t\tthis.components.thoroughfarePredirection = responseData.components.thoroughfare_predirection;\n\t\t\tthis.components.thoroughfarePostdirection = responseData.components.thoroughfare_postdirection;\n\t\t\tthis.components.thoroughfareName = responseData.components.thoroughfare_name;\n\t\t\tthis.components.thoroughfareTrailingType = responseData.components.thoroughfare_trailing_type;\n\t\t\tthis.components.thoroughfareType = responseData.components.thoroughfare_type;\n\t\t\tthis.components.dependentThoroughfare = responseData.components.dependent_thoroughfare;\n\t\t\tthis.components.dependentThoroughfarePredirection = responseData.components.dependent_thoroughfare_predirection;\n\t\t\tthis.components.dependentThoroughfarePostdirection = responseData.components.dependent_thoroughfare_postdirection;\n\t\t\tthis.components.dependentThoroughfareName = responseData.components.dependent_thoroughfare_name;\n\t\t\tthis.components.dependentThoroughfareTrailingType = responseData.components.dependent_thoroughfare_trailing_type;\n\t\t\tthis.components.dependentThoroughfareType = responseData.components.dependent_thoroughfare_type;\n\t\t\tthis.components.building = responseData.components.building;\n\t\t\tthis.components.buildingLeadingType = responseData.components.building_leading_type;\n\t\t\tthis.components.buildingName = responseData.components.building_name;\n\t\t\tthis.components.buildingTrailingType = responseData.components.building_trailing_type;\n\t\t\tthis.components.subBuildingType = responseData.components.sub_building_type;\n\t\t\tthis.components.subBuildingNumber = responseData.components.sub_building_number;\n\t\t\tthis.components.subBuildingName = responseData.components.sub_building_name;\n\t\t\tthis.components.subBuilding = responseData.components.sub_building;\n\t\t\tthis.components.postBox = responseData.components.post_box;\n\t\t\tthis.components.postBoxType = responseData.components.post_box_type;\n\t\t\tthis.components.postBoxNumber = responseData.components.post_box_number;\n\t\t}\n\n\t\tthis.analysis = {};\n\t\tif (responseData.analysis !== undefined) {\n\t\t\tthis.analysis.verificationStatus = responseData.analysis.verification_status;\n\t\t\tthis.analysis.addressPrecision = responseData.analysis.address_precision;\n\t\t\tthis.analysis.maxAddressPrecision = responseData.analysis.max_address_precision;\n\n\t\t\tthis.analysis.changes = {};\n\t\t\tif (responseData.analysis.changes !== undefined) {\n\t\t\t\tthis.analysis.changes.organization = responseData.analysis.changes.organization;\n\t\t\t\tthis.analysis.changes.address1 = responseData.analysis.changes.address1;\n\t\t\t\tthis.analysis.changes.address2 = responseData.analysis.changes.address2;\n\t\t\t\tthis.analysis.changes.address3 = responseData.analysis.changes.address3;\n\t\t\t\tthis.analysis.changes.address4 = responseData.analysis.changes.address4;\n\t\t\t\tthis.analysis.changes.address5 = responseData.analysis.changes.address5;\n\t\t\t\tthis.analysis.changes.address6 = responseData.analysis.changes.address6;\n\t\t\t\tthis.analysis.changes.address7 = responseData.analysis.changes.address7;\n\t\t\t\tthis.analysis.changes.address8 = responseData.analysis.changes.address8;\n\t\t\t\tthis.analysis.changes.address9 = responseData.analysis.changes.address9;\n\t\t\t\tthis.analysis.changes.address10 = responseData.analysis.changes.address10;\n\t\t\t\tthis.analysis.changes.address11 = responseData.analysis.changes.address11;\n\t\t\t\tthis.analysis.changes.address12 = responseData.analysis.changes.address12;\n\n\t\t\t\tthis.analysis.changes.components = {};\n\t\t\t\tif (responseData.analysis.changes.components !== undefined) {\n\t\t\t\t\tthis.analysis.changes.components.countryIso3 = responseData.analysis.changes.components.country_iso_3;\n\t\t\t\t\tthis.analysis.changes.components.superAdministrativeArea = responseData.analysis.changes.components.super_administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.administrativeArea = responseData.analysis.changes.components.administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.subAdministrativeArea = responseData.analysis.changes.components.sub_administrative_area;\n\t\t\t\t\tthis.analysis.changes.components.dependentLocality = responseData.analysis.changes.components.dependent_locality;\n\t\t\t\t\tthis.analysis.changes.components.dependentLocalityName = responseData.analysis.changes.components.dependent_locality_name;\n\t\t\t\t\tthis.analysis.changes.components.doubleDependentLocality = responseData.analysis.changes.components.double_dependent_locality;\n\t\t\t\t\tthis.analysis.changes.components.locality = responseData.analysis.changes.components.locality;\n\t\t\t\t\tthis.analysis.changes.components.postalCode = responseData.analysis.changes.components.postal_code;\n\t\t\t\t\tthis.analysis.changes.components.postalCodeShort = responseData.analysis.changes.components.postal_code_short;\n\t\t\t\t\tthis.analysis.changes.components.postalCodeExtra = responseData.analysis.changes.components.postal_code_extra;\n\t\t\t\t\tthis.analysis.changes.components.premise = responseData.analysis.changes.components.premise;\n\t\t\t\t\tthis.analysis.changes.components.premiseExtra = responseData.analysis.changes.components.premise_extra;\n\t\t\t\t\tthis.analysis.changes.components.premisePrefixNumber = responseData.analysis.changes.components.premise_prefix_number;\n\t\t\t\t\tthis.analysis.changes.components.premiseNumber = responseData.analysis.changes.components.premise_number;\n\t\t\t\t\tthis.analysis.changes.components.premiseType = responseData.analysis.changes.components.premise_type;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfare = responseData.analysis.changes.components.thoroughfare;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfarePredirection = responseData.analysis.changes.components.thoroughfare_predirection;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfarePostdirection = responseData.analysis.changes.components.thoroughfare_postdirection;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareName = responseData.analysis.changes.components.thoroughfare_name;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareTrailingType = responseData.analysis.changes.components.thoroughfare_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.thoroughfareType = responseData.analysis.changes.components.thoroughfare_type;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfare = responseData.analysis.changes.components.dependent_thoroughfare;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfarePredirection = responseData.analysis.changes.components.dependent_thoroughfare_predirection;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfarePostdirection = responseData.analysis.changes.components.dependent_thoroughfare_postdirection;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareName = responseData.analysis.changes.components.dependent_thoroughfare_name;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareTrailingType = responseData.analysis.changes.components.dependent_thoroughfare_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.dependentThoroughfareType = responseData.analysis.changes.components.dependent_thoroughfare_type;\n\t\t\t\t\tthis.analysis.changes.components.building = responseData.analysis.changes.components.building;\n\t\t\t\t\tthis.analysis.changes.components.buildingLeadingType = responseData.analysis.changes.components.building_leading_type;\n\t\t\t\t\tthis.analysis.changes.components.buildingName = responseData.analysis.changes.components.building_name;\n\t\t\t\t\tthis.analysis.changes.components.buildingTrailingType = responseData.analysis.changes.components.building_trailing_type;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingType = responseData.analysis.changes.components.sub_building_type;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingNumber = responseData.analysis.changes.components.sub_building_number;\n\t\t\t\t\tthis.analysis.changes.components.subBuildingName = responseData.analysis.changes.components.sub_building_name;\n\t\t\t\t\tthis.analysis.changes.components.subBuilding = responseData.analysis.changes.components.sub_building;\n\t\t\t\t\tthis.analysis.changes.components.postBox = responseData.analysis.changes.components.post_box;\n\t\t\t\t\tthis.analysis.changes.components.postBoxType = responseData.analysis.changes.components.post_box_type;\n\t\t\t\t\tthis.analysis.changes.components.postBoxNumber = responseData.analysis.changes.components.post_box_number;\n\t\t\t\t}\n\t\t\t\t//TODO: Fill in the rest of these fields and their corresponding tests.\n\t\t\t}\n\t\t}\n\n\t\tthis.metadata = {};\n\t\tif (responseData.metadata !== undefined) {\n\t\t\tthis.metadata.latitude = responseData.metadata.latitude;\n\t\t\tthis.metadata.longitude = responseData.metadata.longitude;\n\t\t\tthis.metadata.geocodePrecision = responseData.metadata.geocode_precision;\n\t\t\tthis.metadata.maxGeocodePrecision = responseData.metadata.max_geocode_precision;\n\t\t\tthis.metadata.addressFormat = responseData.metadata.address_format;\n\t\t}\n\t}\n}\n\nmodule.exports = Candidate;","const Request = require(\"../Request\");\nconst Errors = require(\"../Errors\");\nconst Candidate = require(\"./Candidate\");\nconst buildInputData = require(\"../util/buildInputData\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").internationalStreet;\n\n/**\n * This client sends lookups to the Smarty International Street API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildInputData(lookup, keyTranslationFormat);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tresolve(attachLookupCandidates(response, lookup));\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction attachLookupCandidates(response, lookup) {\n\t\t\tresponse.payload.map(rawCandidate => {\n\t\t\t\tlookup.result.push(new Candidate(rawCandidate));\n\t\t\t});\n\n\t\t\treturn lookup;\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","const UnprocessableEntityError = require(\"../Errors\").UnprocessableEntityError;\nconst messages = {\n\tcountryRequired: \"Country field is required.\",\n\tfreeformOrAddress1Required: \"Either freeform or address1 is required.\",\n\tinsufficientInformation: \"Insufficient information: One or more required fields were not set on the lookup.\",\n\tbadGeocode: \"Invalid input: geocode can only be set to 'true' (default is 'false'.\",\n\tinvalidLanguage: \"Invalid input: language can only be set to 'latin' or 'native'. When not set, the the output language will match the language of the input values.\"\n};\n\n\n/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n *

Note: Lookups must have certain required fields set with non-blank values.
\n * These can be found at the URL below.

\n * @see \"https://www.smarty.com/docs/cloud/international-street-api#http-input-fields\"\n */\nclass Lookup {\n\tconstructor(country, freeform) {\n\t\tthis.result = [];\n\n\t\tthis.country = country;\n\t\tthis.freeform = freeform;\n\t\tthis.address1 = undefined;\n\t\tthis.address2 = undefined;\n\t\tthis.address3 = undefined;\n\t\tthis.address4 = undefined;\n\t\tthis.organization = undefined;\n\t\tthis.locality = undefined;\n\t\tthis.administrativeArea = undefined;\n\t\tthis.postalCode = undefined;\n\t\tthis.geocode = undefined;\n\t\tthis.language = undefined;\n\t\tthis.inputId = undefined;\n\n\t\tthis.ensureEnoughInfo = this.ensureEnoughInfo.bind(this);\n\t\tthis.ensureValidData = this.ensureValidData.bind(this);\n\t}\n\n\tensureEnoughInfo() {\n\t\tif (fieldIsMissing(this.country)) throw new UnprocessableEntityError(messages.countryRequired);\n\n\t\tif (fieldIsSet(this.freeform)) return true;\n\n\t\tif (fieldIsMissing(this.address1)) throw new UnprocessableEntityError(messages.freeformOrAddress1Required);\n\n\t\tif (fieldIsSet(this.postalCode)) return true;\n\n\t\tif (fieldIsMissing(this.locality) || fieldIsMissing(this.administrativeArea)) throw new UnprocessableEntityError(messages.insufficientInformation);\n\n\t\treturn true;\n\t}\n\n\tensureValidData() {\n\t\tlet languageIsSetIncorrectly = () => {\n\t\t\tlet isLanguage = language => this.language.toLowerCase() === language;\n\n\t\t\treturn fieldIsSet(this.language) && !(isLanguage(\"latin\") || isLanguage(\"native\"));\n\t\t};\n\n\t\tlet geocodeIsSetIncorrectly = () => {\n\t\t\treturn fieldIsSet(this.geocode) && this.geocode.toLowerCase() !== \"true\";\n\t\t};\n\n\t\tif (geocodeIsSetIncorrectly()) throw new UnprocessableEntityError(messages.badGeocode);\n\n\t\tif (languageIsSetIncorrectly()) throw new UnprocessableEntityError(messages.invalidLanguage);\n\n\t\treturn true;\n\t}\n}\n\nfunction fieldIsMissing (field) {\n\tif (!field) return true;\n\n\tconst whitespaceCharacters = /\\s/g;\n\n\treturn field.replace(whitespaceCharacters, \"\").length < 1;\n}\n\nfunction fieldIsSet (field) {\n\treturn !fieldIsMissing(field);\n}\n\nmodule.exports = Lookup;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\n/**\n * This client sends lookups to the Smarty US Autocomplete API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildRequestParameters(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParameters(lookup) {\n\t\t\treturn {\n\t\t\t\tprefix: lookup.prefix,\n\t\t\t\tsuggestions: lookup.maxSuggestions,\n\t\t\t\tcity_filter: joinFieldWith(lookup.cityFilter, \",\"),\n\t\t\t\tstate_filter: joinFieldWith(lookup.stateFilter, \",\"),\n\t\t\t\tprefer: joinFieldWith(lookup.prefer, \";\"),\n\t\t\t\tprefer_ratio: lookup.preferRatio,\n\t\t\t\tgeolocate: lookup.geolocate,\n\t\t\t\tgeolocate_precision: lookup.geolocatePrecision,\n\t\t\t};\n\n\t\t\tfunction joinFieldWith(field, delimiter) {\n\t\t\t\tif (field.length) return field.join(delimiter);\n\t\t\t}\n\t\t}\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload.suggestions === null) return [];\n\n\t\t\treturn payload.suggestions.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param prefix The beginning of an address. This is required to be set.\n\t */\n\tconstructor(prefix) {\n\t\tthis.result = [];\n\n\t\tthis.prefix = prefix;\n\t\tthis.maxSuggestions = undefined;\n\t\tthis.cityFilter = [];\n\t\tthis.stateFilter = [];\n\t\tthis.prefer = [];\n\t\tthis.preferRatio = undefined;\n\t\tthis.geolocate = undefined;\n\t\tthis.geolocatePrecision = undefined;\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#http-response\"\n */\nclass Suggestion {\n\tconstructor(responseData) {\n\t\tthis.text = responseData.text;\n\t\tthis.streetLine = responseData.street_line;\n\t\tthis.city = responseData.city;\n\t\tthis.state = responseData.state;\n\t}\n}\n\nmodule.exports = Suggestion;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Suggestion = require(\"./Suggestion\");\n\n/**\n * This client sends lookups to the Smarty US Autocomplete Pro API,
\n * and attaches the suggestions to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildRequestParameters(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = buildSuggestionsFromResponse(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParameters(lookup) {\n\t\t\treturn {\n\t\t\t\tsearch: lookup.search,\n\t\t\t\tselected: lookup.selected,\n\t\t\t\tmax_results: lookup.maxResults,\n\t\t\t\tinclude_only_cities: joinFieldWith(lookup.includeOnlyCities, \";\"),\n\t\t\t\tinclude_only_states: joinFieldWith(lookup.includeOnlyStates, \";\"),\n\t\t\t\tinclude_only_zip_codes: joinFieldWith(lookup.includeOnlyZIPCodes, \";\"),\n\t\t\t\texclude_states: joinFieldWith(lookup.excludeStates, \";\"),\n\t\t\t\tprefer_cities: joinFieldWith(lookup.preferCities, \";\"),\n\t\t\t\tprefer_states: joinFieldWith(lookup.preferStates, \";\"),\n\t\t\t\tprefer_zip_codes: joinFieldWith(lookup.preferZIPCodes, \";\"),\n\t\t\t\tprefer_ratio: lookup.preferRatio,\n\t\t\t\tprefer_geolocation: lookup.preferGeolocation,\n\t\t\t\tsource: lookup.source,\n\t\t\t};\n\n\t\t\tfunction joinFieldWith(field, delimiter) {\n\t\t\t\tif (field.length) return field.join(delimiter);\n\t\t\t}\n\t\t}\n\n\t\tfunction buildSuggestionsFromResponse(payload) {\n\t\t\tif (payload.suggestions === null) return [];\n\n\t\t\treturn payload.suggestions.map(suggestion => new Suggestion(suggestion));\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#pro-http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param search The beginning of an address. This is required to be set.\n\t */\n\tconstructor(search) {\n\t\tthis.result = [];\n\n\t\tthis.search = search;\n\t\tthis.selected = undefined;\n\t\tthis.maxResults = undefined;\n\t\tthis.includeOnlyCities = [];\n\t\tthis.includeOnlyStates = [];\n\t\tthis.includeOnlyZIPCodes = [];\n\t\tthis.excludeStates = [];\n\t\tthis.preferCities = [];\n\t\tthis.preferStates = [];\n\t\tthis.preferZIPCodes = [];\n\t\tthis.preferRatio = undefined;\n\t\tthis.preferGeolocation = undefined;\n\t\tthis.source = undefined\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-autocomplete-api#pro-http-response\"\n */\nclass Suggestion {\n\tconstructor(responseData) {\n\t\tthis.streetLine = responseData.street_line;\n\t\tthis.secondary = responseData.secondary;\n\t\tthis.city = responseData.city;\n\t\tthis.state = responseData.state;\n\t\tthis.zipcode = responseData.zipcode;\n\t\tthis.entries = responseData.entries;\n\t}\n}\n\nmodule.exports = Suggestion;","const Candidate = require(\"../us_street/Candidate\");\n\n/**\n * @see Smarty US Extract API docs\n */\nclass Address {\n\tconstructor (responseData) {\n\t\tthis.text = responseData.text;\n\t\tthis.verified = responseData.verified;\n\t\tthis.line = responseData.line;\n\t\tthis.start = responseData.start;\n\t\tthis.end = responseData.end;\n\t\tthis.candidates = responseData.api_output.map(rawAddress => new Candidate(rawAddress));\n\t}\n}\n\nmodule.exports = Address;","const Errors = require(\"../Errors\");\nconst Request = require(\"../Request\");\nconst Result = require(\"./Result\");\n\n/**\n * This client sends lookups to the Smarty US Extract API,
\n * and attaches the results to the Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new Errors.UndefinedLookupError();\n\n\t\tlet request = new Request(lookup.text);\n\t\trequest.parameters = buildRequestParams(lookup);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tlookup.result = new Result(response.payload);\n\t\t\t\t\tresolve(lookup);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction buildRequestParams(lookup) {\n\t\t\treturn {\n\t\t\t\thtml: lookup.html,\n\t\t\t\taggressive: lookup.aggressive,\n\t\t\t\taddr_line_breaks: lookup.addressesHaveLineBreaks,\n\t\t\t\taddr_per_line: lookup.addressesPerLine,\n\t\t\t};\n\t\t}\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-extract-api#http-request-input-fields\"\n */\nclass Lookup {\n\t/**\n\t * @param text The text that is to have addresses extracted out of it for verification (required)\n\t */\n\tconstructor(text) {\n\t\tthis.result = {\n\t\t\tmeta: {},\n\t\t\taddresses: [],\n\t\t};\n\t\t//TODO: require the text field.\n\t\tthis.text = text;\n\t\tthis.html = undefined;\n\t\tthis.aggressive = undefined;\n\t\tthis.addressesHaveLineBreaks = undefined;\n\t\tthis.addressesPerLine = undefined;\n\t}\n}\n\nmodule.exports = Lookup;","const Address = require(\"./Address\");\n\n/**\n * @see Smarty US Extract API docs\n */\nclass Result {\n\tconstructor({meta, addresses}) {\n\t\tthis.meta = {\n\t\t\tlines: meta.lines,\n\t\t\tunicode: meta.unicode,\n\t\t\taddressCount: meta.address_count,\n\t\t\tverifiedCount: meta.verified_count,\n\t\t\tbytes: meta.bytes,\n\t\t\tcharacterCount: meta.character_count,\n\t\t};\n\n\t\tthis.addresses = addresses.map(rawAddress => new Address(rawAddress));\n\t}\n}\n\nmodule.exports = Result;","const Request = require(\"../Request\");\nconst Response = require(\"./Response\");\nconst buildInputData = require(\"../util/buildInputData\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usReverseGeo;\nconst {UndefinedLookupError} = require(\"../Errors.js\");\n\n/**\n * This client sends lookups to the Smarty US Reverse Geo API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\tsend(lookup) {\n\t\tif (typeof lookup === \"undefined\") throw new UndefinedLookupError();\n\n\t\tlet request = new Request();\n\t\trequest.parameters = buildInputData(lookup, keyTranslationFormat);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.sender.send(request)\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\t\tresolve(attachLookupResults(response, lookup));\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\n\t\tfunction attachLookupResults(response, lookup) {\n\t\t\tlookup.response = new Response(response.payload);\n\n\t\t\treturn lookup;\n\t\t}\n\t}\n}\n\nmodule.exports = Client;\n","const Response = require(\"./Response\");\n\n/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#input-fields\"\n */\nclass Lookup {\n\tconstructor(latitude, longitude) {\n\t\tthis.latitude = latitude.toFixed(8);\n\t\tthis.longitude = longitude.toFixed(8);\n\t\tthis.response = new Response();\n\t}\n}\n\nmodule.exports = Lookup;\n","const Result = require(\"./Result\");\n\n/**\n * The SmartyResponse contains the response from a call to the US Reverse Geo API.\n */\nclass Response {\n\tconstructor(responseData) {\n\t\tthis.results = [];\n\n\t\tif (responseData)\n\t\t\tresponseData.results.map(rawResult => {\n\t\t\t\tthis.results.push(new Result(rawResult));\n\t\t\t});\n\t}\n}\n\nmodule.exports = Response;\n","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous.\n *\n * @see \"https://www.smarty.com/docs/cloud/us-reverse-geo-api#result\"\n */\nclass Result {\n\tconstructor(responseData) {\n\t\tthis.distance = responseData.distance;\n\n\t\tthis.address = {};\n\t\tif (responseData.address) {\n\t\t\tthis.address.street = responseData.address.street;\n\t\t\tthis.address.city = responseData.address.city;\n\t\t\tthis.address.state_abbreviation = responseData.address.state_abbreviation;\n\t\t\tthis.address.zipcode = responseData.address.zipcode;\n\t\t}\n\n\t\tthis.coordinate = {};\n\t\tif (responseData.coordinate) {\n\t\t\tthis.coordinate.latitude = responseData.coordinate.latitude;\n\t\t\tthis.coordinate.longitude = responseData.coordinate.longitude;\n\t\t\tthis.coordinate.accuracy = responseData.coordinate.accuracy;\n\t\t\tswitch (responseData.coordinate.license) {\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.coordinate.license = \"SmartyStreets Proprietary\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.coordinate.license = \"SmartyStreets\";\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule.exports = Result;","/**\n * A candidate is a possible match for an address that was submitted.
\n * A lookup can have multiple candidates if the address was ambiguous, and
\n * the maxCandidates field is set higher than 1.\n *\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#root\"\n */\nclass Candidate {\n\tconstructor(responseData) {\n\t\tthis.inputIndex = responseData.input_index;\n\t\tthis.candidateIndex = responseData.candidate_index;\n\t\tthis.addressee = responseData.addressee;\n\t\tthis.deliveryLine1 = responseData.delivery_line_1;\n\t\tthis.deliveryLine2 = responseData.delivery_line_2;\n\t\tthis.lastLine = responseData.last_line;\n\t\tthis.deliveryPointBarcode = responseData.delivery_point_barcode;\n\n\t\tthis.components = {};\n\t\tif (responseData.components !== undefined) {\n\t\t\tthis.components.urbanization = responseData.components.urbanization;\n\t\t\tthis.components.primaryNumber = responseData.components.primary_number;\n\t\t\tthis.components.streetName = responseData.components.street_name;\n\t\t\tthis.components.streetPredirection = responseData.components.street_predirection;\n\t\t\tthis.components.streetPostdirection = responseData.components.street_postdirection;\n\t\t\tthis.components.streetSuffix = responseData.components.street_suffix;\n\t\t\tthis.components.secondaryNumber = responseData.components.secondary_number;\n\t\t\tthis.components.secondaryDesignator = responseData.components.secondary_designator;\n\t\t\tthis.components.extraSecondaryNumber = responseData.components.extra_secondary_number;\n\t\t\tthis.components.extraSecondaryDesignator = responseData.components.extra_secondary_designator;\n\t\t\tthis.components.pmbDesignator = responseData.components.pmb_designator;\n\t\t\tthis.components.pmbNumber = responseData.components.pmb_number;\n\t\t\tthis.components.cityName = responseData.components.city_name;\n\t\t\tthis.components.defaultCityName = responseData.components.default_city_name;\n\t\t\tthis.components.state = responseData.components.state_abbreviation;\n\t\t\tthis.components.zipCode = responseData.components.zipcode;\n\t\t\tthis.components.plus4Code = responseData.components.plus4_code;\n\t\t\tthis.components.deliveryPoint = responseData.components.delivery_point;\n\t\t\tthis.components.deliveryPointCheckDigit = responseData.components.delivery_point_check_digit;\n\t\t}\n\n\t\tthis.metadata = {};\n\t\tif (responseData.metadata !== undefined) {\n\t\t\tthis.metadata.recordType = responseData.metadata.record_type;\n\t\t\tthis.metadata.zipType = responseData.metadata.zip_type;\n\t\t\tthis.metadata.countyFips = responseData.metadata.county_fips;\n\t\t\tthis.metadata.countyName = responseData.metadata.county_name;\n\t\t\tthis.metadata.carrierRoute = responseData.metadata.carrier_route;\n\t\t\tthis.metadata.congressionalDistrict = responseData.metadata.congressional_district;\n\t\t\tthis.metadata.buildingDefaultIndicator = responseData.metadata.building_default_indicator;\n\t\t\tthis.metadata.rdi = responseData.metadata.rdi;\n\t\t\tthis.metadata.elotSequence = responseData.metadata.elot_sequence;\n\t\t\tthis.metadata.elotSort = responseData.metadata.elot_sort;\n\t\t\tthis.metadata.latitude = responseData.metadata.latitude;\n\t\t\tthis.metadata.longitude = responseData.metadata.longitude;\n\t\t\tswitch (responseData.metadata.coordinate_license)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.metadata.coordinateLicense = \"SmartyStreets Proprietary\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.metadata.coordinateLicense = \"SmartyStreets\";\n\t\t\t}\n\t\t\tthis.metadata.precision = responseData.metadata.precision;\n\t\t\tthis.metadata.timeZone = responseData.metadata.time_zone;\n\t\t\tthis.metadata.utcOffset = responseData.metadata.utc_offset;\n\t\t\tthis.metadata.obeysDst = responseData.metadata.dst;\n\t\t\tthis.metadata.isEwsMatch = responseData.metadata.ews_match;\n\t\t}\n\n\t\tthis.analysis = {};\n\t\tif (responseData.analysis !== undefined) {\n\t\t\tthis.analysis.dpvMatchCode = responseData.analysis.dpv_match_code;\n\t\t\tthis.analysis.dpvFootnotes = responseData.analysis.dpv_footnotes;\n\t\t\tthis.analysis.cmra = responseData.analysis.dpv_cmra;\n\t\t\tthis.analysis.vacant = responseData.analysis.dpv_vacant;\n\t\t\tthis.analysis.noStat = responseData.analysis.dpv_no_stat;\n\t\t\tthis.analysis.active = responseData.analysis.active;\n\t\t\tthis.analysis.isEwsMatch = responseData.analysis.ews_match; // Deprecated, refer to metadata.ews_match\n\t\t\tthis.analysis.footnotes = responseData.analysis.footnotes;\n\t\t\tthis.analysis.lacsLinkCode = responseData.analysis.lacslink_code;\n\t\t\tthis.analysis.lacsLinkIndicator = responseData.analysis.lacslink_indicator;\n\t\t\tthis.analysis.isSuiteLinkMatch = responseData.analysis.suitelink_match;\n\t\t\tthis.analysis.enhancedMatch = responseData.analysis.enhanced_match;\n\t\t}\n\t}\n}\n\nmodule.exports = Candidate;","const Candidate = require(\"./Candidate\");\nconst Lookup = require(\"./Lookup\");\nconst Batch = require(\"../Batch\");\nconst UndefinedLookupError = require(\"../Errors\").UndefinedLookupError;\nconst sendBatch = require(\"../util/sendBatch\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usStreet;\n\n/**\n * This client sends lookups to the Smarty US Street API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\t/**\n\t * Sends up to 100 lookups for validation.\n\t * @param data may be a Lookup object, or a Batch which must contain between 1 and 100 Lookup objects\n\t * @throws SmartyException\n\t */\n\tsend(data) {\n\t\tconst dataIsBatch = data instanceof Batch;\n\t\tconst dataIsLookup = data instanceof Lookup;\n\n\t\tif (!dataIsLookup && !dataIsBatch) throw new UndefinedLookupError;\n\n\t\tlet batch;\n\n\t\tif (dataIsLookup) {\n\t\t\tif (data.maxCandidates == null && data.match == \"enhanced\")\n\t\t\t\tdata.maxCandidates = 5;\n\t\t\tbatch = new Batch();\n\t\t\tbatch.add(data);\n\t\t} else {\n\t\t\tbatch = data;\n\t\t}\n\n\t\treturn sendBatch(batch, this.sender, Candidate, keyTranslationFormat);\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-street-api#input-fields\"\n */\nclass Lookup {\n\tconstructor(street, street2, secondary, city, state, zipCode, lastLine, addressee, urbanization, match, maxCandidates, inputId) {\n\t\tthis.street = street;\n\t\tthis.street2 = street2;\n\t\tthis.secondary = secondary;\n\t\tthis.city = city;\n\t\tthis.state = state;\n\t\tthis.zipCode = zipCode;\n\t\tthis.lastLine = lastLine;\n\t\tthis.addressee = addressee;\n\t\tthis.urbanization = urbanization;\n\t\tthis.match = match;\n\t\tthis.maxCandidates = maxCandidates;\n\t\tthis.inputId = inputId;\n\t\tthis.result = [];\n\t}\n}\n\nmodule.exports = Lookup;\n","const Lookup = require(\"./Lookup\");\nconst Result = require(\"./Result\");\nconst Batch = require(\"../Batch\");\nconst UndefinedLookupError = require(\"../Errors\").UndefinedLookupError;\nconst sendBatch = require(\"../util/sendBatch\");\nconst keyTranslationFormat = require(\"../util/apiToSDKKeyMap\").usZipcode;\n\n/**\n * This client sends lookups to the Smarty US ZIP Code API,
\n * and attaches the results to the appropriate Lookup objects.\n */\nclass Client {\n\tconstructor(sender) {\n\t\tthis.sender = sender;\n\t}\n\n\t/**\n\t * Sends up to 100 lookups for validation.\n\t * @param data May be a Lookup object, or a Batch which must contain between 1 and 100 Lookup objects\n\t * @throws SmartyException\n\t */\n\tsend(data) {\n\t\tconst dataIsBatch = data instanceof Batch;\n\t\tconst dataIsLookup = data instanceof Lookup;\n\n\t\tif (!dataIsLookup && !dataIsBatch) throw new UndefinedLookupError;\n\n\t\tlet batch;\n\n\t\tif (dataIsLookup) {\n\t\t\tbatch = new Batch();\n\t\t\tbatch.add(data);\n\t\t} else batch = data;\n\n\t\treturn sendBatch(batch, this.sender, Result, keyTranslationFormat);\n\t}\n}\n\nmodule.exports = Client;","/**\n * In addition to holding all of the input data for this lookup, this class also
\n * will contain the result of the lookup after it comes back from the API.\n * @see \"https://www.smarty.com/docs/cloud/us-zipcode-api#http-request-input-fields\"\n */\nclass Lookup {\n\tconstructor(city, state, zipCode, inputId) {\n\t\tthis.city = city;\n\t\tthis.state = state;\n\t\tthis.zipCode = zipCode;\n\t\tthis.inputId = inputId;\n\t\tthis.result = [];\n\t}\n}\n\nmodule.exports = Lookup;","/**\n * @see \"https://www.smarty.com/docs/cloud/us-zipcode-api#root\"\n */\nclass Result {\n\tconstructor(responseData) {\n\t\tthis.inputIndex = responseData.input_index;\n\t\tthis.status = responseData.status;\n\t\tthis.reason = responseData.reason;\n\t\tthis.valid = this.status === undefined && this.reason === undefined;\n\n\t\tthis.cities = !responseData.city_states ? [] : responseData.city_states.map(city => {\n\t\t\treturn {\n\t\t\t\tcity: city.city,\n\t\t\t\tstateAbbreviation: city.state_abbreviation,\n\t\t\t\tstate: city.state,\n\t\t\t\tmailableCity: city.mailable_city,\n\t\t\t};\n\t\t});\n\n\t\tthis.zipcodes = !responseData.zipcodes ? [] : responseData.zipcodes.map(zipcode => {\n\t\t\treturn {\n\t\t\t\tzipcode: zipcode.zipcode,\n\t\t\t\tzipcodeType: zipcode.zipcode_type,\n\t\t\t\tdefaultCity: zipcode.default_city,\n\t\t\t\tcountyFips: zipcode.county_fips,\n\t\t\t\tcountyName: zipcode.county_name,\n\t\t\t\tlatitude: zipcode.latitude,\n\t\t\t\tlongitude: zipcode.longitude,\n\t\t\t\tprecision: zipcode.precision,\n\t\t\t\tstateAbbreviation: zipcode.state_abbreviation,\n\t\t\t\tstate: zipcode.state,\n\t\t\t\talternateCounties: !zipcode.alternate_counties ? [] : zipcode.alternate_counties.map(county => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcountyFips: county.county_fips,\n\t\t\t\t\t\tcountyName: county.county_name,\n\t\t\t\t\t\tstateAbbreviation: county.state_abbreviation,\n\t\t\t\t\t\tstate: county.state,\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t};\n\t\t});\n\t}\n}\n\nmodule.exports = Result;","module.exports = {\n\tusStreet: {\n\t\t\"street\": \"street\",\n\t\t\"street2\": \"street2\",\n\t\t\"secondary\": \"secondary\",\n\t\t\"city\": \"city\",\n\t\t\"state\": \"state\",\n\t\t\"zipcode\": \"zipCode\",\n\t\t\"lastline\": \"lastLine\",\n\t\t\"addressee\": \"addressee\",\n\t\t\"urbanization\": \"urbanization\",\n\t\t\"match\": \"match\",\n\t\t\"candidates\": \"maxCandidates\",\n\t},\n\tusZipcode: {\n\t\t\"city\": \"city\",\n\t\t\"state\": \"state\",\n\t\t\"zipcode\": \"zipCode\",\n\t},\n\tinternationalStreet: {\n\t\t\"country\": \"country\",\n\t\t\"freeform\": \"freeform\",\n\t\t\"address1\": \"address1\",\n\t\t\"address2\": \"address2\",\n\t\t\"address3\": \"address3\",\n\t\t\"address4\": \"address4\",\n\t\t\"organization\": \"organization\",\n\t\t\"locality\": \"locality\",\n\t\t\"administrative_area\": \"administrativeArea\",\n\t\t\"postal_code\": \"postalCode\",\n\t\t\"geocode\": \"geocode\",\n\t\t\"language\": \"language\",\n\t},\n\tusReverseGeo: {\n\t\t\"latitude\": \"latitude\",\n\t\t\"longitude\": \"longitude\",\n\t}\n};","const ClientBuilder = require(\"../ClientBuilder\");\n\nfunction instantiateClientBuilder(credentials) {\n\treturn new ClientBuilder(credentials);\n}\n\nfunction buildUsStreetApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsStreetApiClient();\n}\n\nfunction buildUsAutocompleteApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsAutocompleteClient();\n}\n\nfunction buildUsAutocompleteProApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsAutocompleteProClient();\n}\n\nfunction buildUsExtractApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsExtractClient();\n}\n\nfunction buildUsZipcodeApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsZipcodeClient();\n}\n\nfunction buildInternationalStreetApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildInternationalStreetClient();\n}\n\nfunction buildUsReverseGeoApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildUsReverseGeoClient();\n}\n\nfunction buildInternationalAddressAutocompleteApiClient(credentials) {\n\treturn instantiateClientBuilder(credentials).buildInternationalAddressAutocompleteClient();\n}\n\nmodule.exports = {\n\tusStreet: buildUsStreetApiClient,\n\tusAutocomplete: buildUsAutocompleteApiClient,\n\tusAutocompletePro: buildUsAutocompleteProApiClient,\n\tusExtract: buildUsExtractApiClient,\n\tusZipcode: buildUsZipcodeApiClient,\n\tinternationalStreet: buildInternationalStreetApiClient,\n\tusReverseGeo: buildUsReverseGeoApiClient,\n\tinternationalAddressAutocomplete: buildInternationalAddressAutocompleteApiClient,\n};","const InputData = require(\"../InputData\");\n\nmodule.exports = (lookup, keyTranslationFormat) => {\n\tlet inputData = new InputData(lookup);\n\n\tfor (let key in keyTranslationFormat) {\n\t\tinputData.add(key, keyTranslationFormat[key]);\n\t}\n\n\treturn inputData.data;\n};\n","const Request = require(\"../Request\");\nconst Errors = require(\"../Errors\");\nconst buildInputData = require(\"../util/buildInputData\");\n\nmodule.exports = (batch, sender, Result, keyTranslationFormat) => {\n\tif (batch.isEmpty()) throw new Errors.BatchEmptyError;\n\n\tlet request = new Request();\n\n\tif (batch.length() === 1) request.parameters = generateRequestPayload(batch)[0];\n\telse request.payload = generateRequestPayload(batch);\n\n\treturn new Promise((resolve, reject) => {\n\t\tsender.send(request)\n\t\t\t.then(response => {\n\t\t\t\tif (response.error) reject(response.error);\n\n\t\t\t\tresolve(assignResultsToLookups(batch, response));\n\t\t\t})\n\t\t\t.catch(reject);\n\t});\n\n\tfunction generateRequestPayload(batch) {\n\t\treturn batch.lookups.map((lookup) => {\n\t\t\treturn buildInputData(lookup, keyTranslationFormat);\n\t\t});\n\t}\n\n\tfunction assignResultsToLookups(batch, response) {\n\t\tresponse.payload.map(rawResult => {\n\t\t\tlet result = new Result(rawResult);\n\t\t\tlet lookup = batch.getByIndex(result.inputIndex);\n\n\t\t\tlookup.result.push(result);\n\t\t});\n\n\t\treturn batch;\n\t}\n};\n","/*!\n * statuses\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar codes = require('./codes.json')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = status\n\n// status code to message map\nstatus.message = codes\n\n// status message (lower-case) to code map\nstatus.code = createMessageToStatusCodeMap(codes)\n\n// array of status codes\nstatus.codes = createStatusCodeList(codes)\n\n// status codes for redirects\nstatus.redirect = {\n 300: true,\n 301: true,\n 302: true,\n 303: true,\n 305: true,\n 307: true,\n 308: true\n}\n\n// status codes for empty bodies\nstatus.empty = {\n 204: true,\n 205: true,\n 304: true\n}\n\n// status codes for when you should retry the request\nstatus.retry = {\n 502: true,\n 503: true,\n 504: true\n}\n\n/**\n * Create a map of message to status code.\n * @private\n */\n\nfunction createMessageToStatusCodeMap (codes) {\n var map = {}\n\n Object.keys(codes).forEach(function forEachCode (code) {\n var message = codes[code]\n var status = Number(code)\n\n // populate map\n map[message.toLowerCase()] = status\n })\n\n return map\n}\n\n/**\n * Create a list of all status codes.\n * @private\n */\n\nfunction createStatusCodeList (codes) {\n return Object.keys(codes).map(function mapCode (code) {\n return Number(code)\n })\n}\n\n/**\n * Get the status code for given message.\n * @private\n */\n\nfunction getStatusCode (message) {\n var msg = message.toLowerCase()\n\n if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {\n throw new Error('invalid status message: \"' + message + '\"')\n }\n\n return status.code[msg]\n}\n\n/**\n * Get the status message for given code.\n * @private\n */\n\nfunction getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new Error('invalid status code: ' + code)\n }\n\n return status.message[code]\n}\n\n/**\n * Get the status code.\n *\n * Given a number, this will throw if it is not a known status\n * code, otherwise the code will be returned. Given a string,\n * the string will be parsed for a number and return the code\n * if valid, otherwise will lookup the code assuming this is\n * the status message.\n *\n * @param {string|number} code\n * @returns {number}\n * @public\n */\n\nfunction status (code) {\n if (typeof code === 'number') {\n return getStatusMessage(code)\n }\n\n if (typeof code !== 'string') {\n throw new TypeError('code must be a number or string')\n }\n\n // '403'\n var n = parseInt(code, 10)\n if (!isNaN(n)) {\n return getStatusMessage(n)\n }\n\n return getStatusCode(code)\n}\n","'use strict';\nconst os = require('os');\nconst hasFlag = require('has-flag');\n\nconst env = process.env;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false')) {\n\tforceColor = false;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = true;\n}\nif ('FORCE_COLOR' in env) {\n\tforceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(stream) {\n\tif (forceColor === false) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (stream && !stream.isTTY && forceColor !== true) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor ? 1 : 0;\n\n\tif (process.platform === 'win32') {\n\t\t// Node.js 7.5.0 is the first version of Node.js to include a patch to\n\t\t// libuv that enables 256 color output on Windows. Anything earlier and it\n\t\t// won't work. However, here we target Node.js 8 at minimum as it is an LTS\n\t\t// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows\n\t\t// release that supports 256 colors. Windows 10 build 14931 is the first release\n\t\t// that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(process.versions.node.split('.')[0]) >= 8 &&\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: getSupportLevel(process.stdout),\n\tstderr: getSupportLevel(process.stderr)\n};\n","'use strict';\nmodule.exports = (flag, argv) => {\n\targv = argv || process.argv;\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst pos = argv.indexOf(prefix + flag);\n\tconst terminatorPos = argv.indexOf('--');\n\treturn pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);\n};\n","'use strict'\n\nvar nextTick = nextTickArgs\nprocess.nextTick(upgrade, 42) // pass 42 and see if upgrade is called with it\n\nmodule.exports = thunky\n\nfunction thunky (fn) {\n var state = run\n return thunk\n\n function thunk (callback) {\n state(callback || noop)\n }\n\n function run (callback) {\n var stack = [callback]\n state = wait\n fn(done)\n\n function wait (callback) {\n stack.push(callback)\n }\n\n function done (err) {\n var args = arguments\n state = isError(err) ? run : finished\n while (stack.length) finished(stack.shift())\n\n function finished (callback) {\n nextTick(apply, callback, args)\n }\n }\n }\n}\n\nfunction isError (err) { // inlined from util so this works in the browser\n return Object.prototype.toString.call(err) === '[object Error]'\n}\n\nfunction noop () {}\n\nfunction apply (callback, args) {\n callback.apply(null, args)\n}\n\nfunction upgrade (val) {\n if (val === 42) nextTick = process.nextTick\n}\n\nfunction nextTickArgs (fn, a, b) {\n process.nextTick(function () {\n fn(a, b)\n })\n}\n","/*!\n * toidentifier\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = toIdentifier\n\n/**\n * Trasform the given string into a JavaScript identifier\n *\n * @param {string} str\n * @returns {string}\n * @public\n */\n\nfunction toIdentifier (str) {\n return str\n .split(' ')\n .map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n })\n .join('')\n .replace(/[^ _0-9a-z]/gi, '')\n}\n","/*!\n * type-is\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar typer = require('media-typer')\nvar mime = require('mime-types')\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = typeofrequest\nmodule.exports.is = typeis\nmodule.exports.hasBody = hasbody\nmodule.exports.normalize = normalize\nmodule.exports.match = mimeMatch\n\n/**\n * Compare a `value` content-type with `types`.\n * Each `type` can be an extension like `html`,\n * a special shortcut like `multipart` or `urlencoded`,\n * or a mime type.\n *\n * If no types match, `false` is returned.\n * Otherwise, the first `type` that matches is returned.\n *\n * @param {String} value\n * @param {Array} types\n * @public\n */\n\nfunction typeis (value, types_) {\n var i\n var types = types_\n\n // remove parameters and normalize\n var val = tryNormalizeType(value)\n\n // no type or invalid\n if (!val) {\n return false\n }\n\n // support flattened arguments\n if (types && !Array.isArray(types)) {\n types = new Array(arguments.length - 1)\n for (i = 0; i < types.length; i++) {\n types[i] = arguments[i + 1]\n }\n }\n\n // no types, return the content type\n if (!types || !types.length) {\n return val\n }\n\n var type\n for (i = 0; i < types.length; i++) {\n if (mimeMatch(normalize(type = types[i]), val)) {\n return type[0] === '+' || type.indexOf('*') !== -1\n ? val\n : type\n }\n }\n\n // no matches\n return false\n}\n\n/**\n * Check if a request has a request body.\n * A request with a body __must__ either have `transfer-encoding`\n * or `content-length` headers set.\n * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3\n *\n * @param {Object} request\n * @return {Boolean}\n * @public\n */\n\nfunction hasbody (req) {\n return req.headers['transfer-encoding'] !== undefined ||\n !isNaN(req.headers['content-length'])\n}\n\n/**\n * Check if the incoming request contains the \"Content-Type\"\n * header field, and it contains any of the give mime `type`s.\n * If there is no request body, `null` is returned.\n * If there is no content type, `false` is returned.\n * Otherwise, it returns the first `type` that matches.\n *\n * Examples:\n *\n * // With Content-Type: text/html; charset=utf-8\n * this.is('html'); // => 'html'\n * this.is('text/html'); // => 'text/html'\n * this.is('text/*', 'application/json'); // => 'text/html'\n *\n * // When Content-Type is application/json\n * this.is('json', 'urlencoded'); // => 'json'\n * this.is('application/json'); // => 'application/json'\n * this.is('html', 'application/*'); // => 'application/json'\n *\n * this.is('html'); // => false\n *\n * @param {String|Array} types...\n * @return {String|false|null}\n * @public\n */\n\nfunction typeofrequest (req, types_) {\n var types = types_\n\n // no body\n if (!hasbody(req)) {\n return null\n }\n\n // support flattened arguments\n if (arguments.length > 2) {\n types = new Array(arguments.length - 1)\n for (var i = 0; i < types.length; i++) {\n types[i] = arguments[i + 1]\n }\n }\n\n // request content type\n var value = req.headers['content-type']\n\n return typeis(value, types)\n}\n\n/**\n * Normalize a mime type.\n * If it's a shorthand, expand it to a valid mime type.\n *\n * In general, you probably want:\n *\n * var type = is(req, ['urlencoded', 'json', 'multipart']);\n *\n * Then use the appropriate body parsers.\n * These three are the most common request body types\n * and are thus ensured to work.\n *\n * @param {String} type\n * @private\n */\n\nfunction normalize (type) {\n if (typeof type !== 'string') {\n // invalid type\n return false\n }\n\n switch (type) {\n case 'urlencoded':\n return 'application/x-www-form-urlencoded'\n case 'multipart':\n return 'multipart/*'\n }\n\n if (type[0] === '+') {\n // \"+json\" -> \"*/*+json\" expando\n return '*/*' + type\n }\n\n return type.indexOf('/') === -1\n ? mime.lookup(type)\n : type\n}\n\n/**\n * Check if `expected` mime type\n * matches `actual` mime type with\n * wildcard and +suffix support.\n *\n * @param {String} expected\n * @param {String} actual\n * @return {Boolean}\n * @private\n */\n\nfunction mimeMatch (expected, actual) {\n // invalid type\n if (expected === false) {\n return false\n }\n\n // split types\n var actualParts = actual.split('/')\n var expectedParts = expected.split('/')\n\n // invalid format\n if (actualParts.length !== 2 || expectedParts.length !== 2) {\n return false\n }\n\n // validate type\n if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {\n return false\n }\n\n // validate suffix wildcard\n if (expectedParts[1].substr(0, 2) === '*+') {\n return expectedParts[1].length <= actualParts[1].length + 1 &&\n expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length)\n }\n\n // validate subtype\n if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {\n return false\n }\n\n return true\n}\n\n/**\n * Normalize a type and remove parameters.\n *\n * @param {string} value\n * @return {string}\n * @private\n */\n\nfunction normalizeType (value) {\n // parse the type\n var type = typer.parse(value)\n\n // remove the parameters\n type.parameters = undefined\n\n // reformat it\n return typer.format(type)\n}\n\n/**\n * Try to normalize a type and remove parameters.\n *\n * @param {string} value\n * @return {string}\n * @private\n */\n\nfunction tryNormalizeType (value) {\n if (!value) {\n return null\n }\n\n try {\n return normalizeType(value)\n } catch (err) {\n return null\n }\n}\n","/*!\n * uid-safe\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar randomBytes = require('random-bytes')\n\n/**\n * Module variables.\n * @private\n */\n\nvar EQUAL_END_REGEXP = /=+$/\nvar PLUS_GLOBAL_REGEXP = /\\+/g\nvar SLASH_GLOBAL_REGEXP = /\\//g\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = uid\nmodule.exports.sync = uidSync\n\n/**\n * Create a unique ID.\n *\n * @param {number} length\n * @param {function} [callback]\n * @return {Promise}\n * @public\n */\n\nfunction uid (length, callback) {\n // validate callback is a function, if provided\n if (callback !== undefined && typeof callback !== 'function') {\n throw new TypeError('argument callback must be a function')\n }\n\n // require the callback without promises\n if (!callback && !global.Promise) {\n throw new TypeError('argument callback is required')\n }\n\n if (callback) {\n // classic callback style\n return generateUid(length, callback)\n }\n\n return new Promise(function executor (resolve, reject) {\n generateUid(length, function onUid (err, str) {\n if (err) return reject(err)\n resolve(str)\n })\n })\n}\n\n/**\n * Create a unique ID sync.\n *\n * @param {number} length\n * @return {string}\n * @public\n */\n\nfunction uidSync (length) {\n return toString(randomBytes.sync(length))\n}\n\n/**\n * Generate a unique ID string.\n *\n * @param {number} length\n * @param {function} callback\n * @private\n */\n\nfunction generateUid (length, callback) {\n randomBytes(length, function (err, buf) {\n if (err) return callback(err)\n callback(null, toString(buf))\n })\n}\n\n/**\n * Change a Buffer into a string.\n *\n * @param {Buffer} buf\n * @return {string}\n * @private\n */\n\nfunction toString (buf) {\n return buf.toString('base64')\n .replace(EQUAL_END_REGEXP, '')\n .replace(PLUS_GLOBAL_REGEXP, '-')\n .replace(SLASH_GLOBAL_REGEXP, '_')\n}\n","/*!\n * unpipe\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = unpipe\n\n/**\n * Determine if there are Node.js pipe-like data listeners.\n * @private\n */\n\nfunction hasPipeDataListeners(stream) {\n var listeners = stream.listeners('data')\n\n for (var i = 0; i < listeners.length; i++) {\n if (listeners[i].name === 'ondata') {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Unpipe a stream from all destinations.\n *\n * @param {object} stream\n * @public\n */\n\nfunction unpipe(stream) {\n if (!stream) {\n throw new TypeError('argument stream is required')\n }\n\n if (typeof stream.unpipe === 'function') {\n // new-style\n stream.unpipe()\n return\n }\n\n // Node.js 0.8 hack\n if (!hasPipeDataListeners(stream)) {\n return\n }\n\n var listener\n var listeners = stream.listeners('close')\n\n for (var i = 0; i < listeners.length; i++) {\n listener = listeners[i]\n\n if (listener.name !== 'cleanup' && listener.name !== 'onclose') {\n continue\n }\n\n // invoke the listener\n listener.call(stream)\n }\n}\n","'use strict';\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if ((buf[i] & 0x80) === 0x00) { // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // overlong\n ) {\n return false;\n }\n\n i += 2;\n } else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80 || // overlong\n buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0 // surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n }\n\n i += 3;\n } else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80 || // overlong\n buf[i] === 0xf4 && buf[i + 1] > 0x8f || buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n }\n\n i += 4;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = isValidUTF8;\n","'use strict';\n\ntry {\n module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n module.exports = require('./fallback');\n}\n","/**\n * Merge object b with object a.\n *\n * var a = { foo: 'bar' }\n * , b = { bar: 'baz' };\n *\n * merge(a, b);\n * // => { foo: 'bar', bar: 'baz' }\n *\n * @param {Object} a\n * @param {Object} b\n * @return {Object}\n * @api public\n */\n\nexports = module.exports = function(a, b){\n if (a && b) {\n for (var key in b) {\n a[key] = b[key];\n }\n }\n return a;\n};\n","/*!\n * vary\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n */\n\nmodule.exports = vary\nmodule.exports.append = append\n\n/**\n * RegExp to match field-name in RFC 7230 sec 3.2\n *\n * field-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n * / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * / DIGIT / ALPHA\n * ; any VCHAR, except delimiters\n */\n\nvar FIELD_NAME_REGEXP = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/\n\n/**\n * Append a field to a vary header.\n *\n * @param {String} header\n * @param {String|Array} field\n * @return {String}\n * @public\n */\n\nfunction append (header, field) {\n if (typeof header !== 'string') {\n throw new TypeError('header argument is required')\n }\n\n if (!field) {\n throw new TypeError('field argument is required')\n }\n\n // get fields array\n var fields = !Array.isArray(field)\n ? parse(String(field))\n : field\n\n // assert on invalid field names\n for (var j = 0; j < fields.length; j++) {\n if (!FIELD_NAME_REGEXP.test(fields[j])) {\n throw new TypeError('field argument contains an invalid header name')\n }\n }\n\n // existing, unspecified vary\n if (header === '*') {\n return header\n }\n\n // enumerate current values\n var val = header\n var vals = parse(header.toLowerCase())\n\n // unspecified vary\n if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {\n return '*'\n }\n\n for (var i = 0; i < fields.length; i++) {\n var fld = fields[i].toLowerCase()\n\n // append value (case-preserving)\n if (vals.indexOf(fld) === -1) {\n vals.push(fld)\n val = val\n ? val + ', ' + fields[i]\n : fields[i]\n }\n }\n\n return val\n}\n\n/**\n * Parse a vary header into an array.\n *\n * @param {String} header\n * @return {Array}\n * @private\n */\n\nfunction parse (header) {\n var end = 0\n var list = []\n var start = 0\n\n // gather tokens\n for (var i = 0, len = header.length; i < len; i++) {\n switch (header.charCodeAt(i)) {\n case 0x20: /* */\n if (start === end) {\n start = end = i + 1\n }\n break\n case 0x2c: /* , */\n list.push(header.substring(start, end))\n start = end = i + 1\n break\n default:\n end = i + 1\n break\n }\n }\n\n // final token\n list.push(header.substring(start, end))\n\n return list\n}\n\n/**\n * Mark that a request is varied on a header field.\n *\n * @param {Object} res\n * @param {String|Array} field\n * @public\n */\n\nfunction vary (res, field) {\n if (!res || !res.getHeader || !res.setHeader) {\n // quack quack\n throw new TypeError('res argument is required')\n }\n\n // get existing header\n var val = res.getHeader('Vary') || ''\n var header = Array.isArray(val)\n ? val.join(', ')\n : String(val)\n\n // set new header\n if ((val = append(header, field))) {\n res.setHeader('Vary', val)\n }\n}\n","'use strict';\n\nconst WebSocket = require('./lib/websocket');\n\nWebSocket.createWebSocketStream = require('./lib/stream');\nWebSocket.Server = require('./lib/websocket-server');\nWebSocket.Receiver = require('./lib/receiver');\nWebSocket.Sender = require('./lib/sender');\n\nmodule.exports = WebSocket;\n","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n if (list.length === 0) return EMPTY_BUFFER;\n if (list.length === 1) return list[0];\n\n const target = Buffer.allocUnsafe(totalLength);\n let offset = 0;\n\n for (let i = 0; i < list.length; i++) {\n const buf = list[i];\n target.set(buf, offset);\n offset += buf.length;\n }\n\n if (offset < totalLength) return target.slice(0, offset);\n\n return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n for (let i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (let i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n if (buf.byteLength === buf.buffer.byteLength) {\n return buf.buffer;\n }\n\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n toBuffer.readOnly = true;\n\n if (Buffer.isBuffer(data)) return data;\n\n let buf;\n\n if (data instanceof ArrayBuffer) {\n buf = Buffer.from(data);\n } else if (ArrayBuffer.isView(data)) {\n buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n } else {\n buf = Buffer.from(data);\n toBuffer.readOnly = false;\n }\n\n return buf;\n}\n\ntry {\n const bufferUtil = require('bufferutil');\n const bu = bufferUtil.BufferUtil || bufferUtil;\n\n module.exports = {\n concat,\n mask(source, mask, output, offset, length) {\n if (length < 48) _mask(source, mask, output, offset, length);\n else bu.mask(source, mask, output, offset, length);\n },\n toArrayBuffer,\n toBuffer,\n unmask(buffer, mask) {\n if (buffer.length < 32) _unmask(buffer, mask);\n else bu.unmask(buffer, mask);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n concat,\n mask: _mask,\n toArrayBuffer,\n toBuffer,\n unmask: _unmask\n };\n}\n","'use strict';\n\nmodule.exports = {\n BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n kStatusCode: Symbol('status-code'),\n kWebSocket: Symbol('websocket'),\n EMPTY_BUFFER: Buffer.alloc(0),\n NOOP: () => {}\n};\n","'use strict';\n\n/**\n * Class representing an event.\n *\n * @private\n */\nclass Event {\n /**\n * Create a new `Event`.\n *\n * @param {String} type The name of the event\n * @param {Object} target A reference to the target to which the event was\n * dispatched\n */\n constructor(type, target) {\n this.target = target;\n this.type = type;\n }\n}\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n * @private\n */\nclass MessageEvent extends Event {\n /**\n * Create a new `MessageEvent`.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(data, target) {\n super('message', target);\n\n this.data = data;\n }\n}\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n * @private\n */\nclass CloseEvent extends Event {\n /**\n * Create a new `CloseEvent`.\n *\n * @param {Number} code The status code explaining why the connection is being\n * closed\n * @param {String} reason A human-readable string explaining why the\n * connection is closing\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(code, reason, target) {\n super('close', target);\n\n this.wasClean = target._closeFrameReceived && target._closeFrameSent;\n this.reason = reason;\n this.code = code;\n }\n}\n\n/**\n * Class representing an open event.\n *\n * @extends Event\n * @private\n */\nclass OpenEvent extends Event {\n /**\n * Create a new `OpenEvent`.\n *\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(target) {\n super('open', target);\n }\n}\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n * @private\n */\nclass ErrorEvent extends Event {\n /**\n * Create a new `ErrorEvent`.\n *\n * @param {Object} error The error that generated this event\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(error, target) {\n super('error', target);\n\n this.message = error.message;\n this.error = error;\n }\n}\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n /**\n * Register an event listener.\n *\n * @param {String} type A string representing the event type to listen for\n * @param {Function} listener The listener to add\n * @param {Object} [options] An options object specifies characteristics about\n * the event listener\n * @param {Boolean} [options.once=false] A `Boolean`` indicating that the\n * listener should be invoked at most once after being added. If `true`,\n * the listener would be automatically removed when invoked.\n * @public\n */\n addEventListener(type, listener, options) {\n if (typeof listener !== 'function') return;\n\n function onMessage(data) {\n listener.call(this, new MessageEvent(data, this));\n }\n\n function onClose(code, message) {\n listener.call(this, new CloseEvent(code, message, this));\n }\n\n function onError(error) {\n listener.call(this, new ErrorEvent(error, this));\n }\n\n function onOpen() {\n listener.call(this, new OpenEvent(this));\n }\n\n const method = options && options.once ? 'once' : 'on';\n\n if (type === 'message') {\n onMessage._listener = listener;\n this[method](type, onMessage);\n } else if (type === 'close') {\n onClose._listener = listener;\n this[method](type, onClose);\n } else if (type === 'error') {\n onError._listener = listener;\n this[method](type, onError);\n } else if (type === 'open') {\n onOpen._listener = listener;\n this[method](type, onOpen);\n } else {\n this[method](type, listener);\n }\n },\n\n /**\n * Remove an event listener.\n *\n * @param {String} type A string representing the event type to remove\n * @param {Function} listener The listener to remove\n * @public\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners(type);\n\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener || listeners[i]._listener === listener) {\n this.removeListener(type, listeners[i]);\n }\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n * parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n if (dest[name] === undefined) dest[name] = [elem];\n else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n const offers = Object.create(null);\n\n if (header === undefined || header === '') return offers;\n\n let params = Object.create(null);\n let mustUnescape = false;\n let isEscaping = false;\n let inQuotes = false;\n let extensionName;\n let paramName;\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (; i < header.length; i++) {\n const code = header.charCodeAt(i);\n\n if (extensionName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\\t' */) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n const name = header.slice(start, end);\n if (code === 0x2c) {\n push(offers, name, params);\n params = Object.create(null);\n } else {\n extensionName = name;\n }\n\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (paramName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 || code === 0x09) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n push(params, header.slice(start, end), true);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n start = end = -1;\n } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n paramName = header.slice(start, i);\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else {\n //\n // The value of a quoted-string after unescaping must conform to the\n // token ABNF, so only token characters are valid.\n // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n //\n if (isEscaping) {\n if (tokenChars[code] !== 1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1) start = i;\n else if (!mustUnescape) mustUnescape = true;\n isEscaping = false;\n } else if (inQuotes) {\n if (tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x22 /* '\"' */ && start !== -1) {\n inQuotes = false;\n end = i;\n } else if (code === 0x5c /* '\\' */) {\n isEscaping = true;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n inQuotes = true;\n } else if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n if (end === -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n let value = header.slice(start, end);\n if (mustUnescape) {\n value = value.replace(/\\\\/g, '');\n mustUnescape = false;\n }\n push(params, paramName, value);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n paramName = undefined;\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n }\n }\n\n if (start === -1 || inQuotes) {\n throw new SyntaxError('Unexpected end of input');\n }\n\n if (end === -1) end = i;\n const token = header.slice(start, end);\n if (extensionName === undefined) {\n push(offers, token, params);\n } else {\n if (paramName === undefined) {\n push(params, token, true);\n } else if (mustUnescape) {\n push(params, paramName, token.replace(/\\\\/g, ''));\n } else {\n push(params, paramName, token);\n }\n push(offers, extensionName, params);\n }\n\n return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n return Object.keys(extensions)\n .map((extension) => {\n let configurations = extensions[extension];\n if (!Array.isArray(configurations)) configurations = [configurations];\n return configurations\n .map((params) => {\n return [extension]\n .concat(\n Object.keys(params).map((k) => {\n let values = params[k];\n if (!Array.isArray(values)) values = [values];\n return values\n .map((v) => (v === true ? k : `${k}=${v}`))\n .join('; ');\n })\n )\n .join('; ');\n })\n .join(', ');\n })\n .join(', ');\n}\n\nmodule.exports = { format, parse };\n","'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n /**\n * Creates a new `Limiter`.\n *\n * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n * to run concurrently\n */\n constructor(concurrency) {\n this[kDone] = () => {\n this.pending--;\n this[kRun]();\n };\n this.concurrency = concurrency || Infinity;\n this.jobs = [];\n this.pending = 0;\n }\n\n /**\n * Adds a job to the queue.\n *\n * @param {Function} job The job to run\n * @public\n */\n add(job) {\n this.jobs.push(job);\n this[kRun]();\n }\n\n /**\n * Removes a job from the queue and runs it if possible.\n *\n * @private\n */\n [kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }\n}\n\nmodule.exports = Limiter;\n","'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode, NOOP } = require('./constants');\n\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n /**\n * Creates a PerMessageDeflate instance.\n *\n * @param {Object} [options] Configuration options\n * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n * disabling of server context takeover\n * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n * acknowledge disabling of client context takeover\n * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n * use of a custom server window size\n * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n * for, or request, a custom client window size\n * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n * deflate\n * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n * inflate\n * @param {Number} [options.threshold=1024] Size (in bytes) below which\n * messages should not be compressed\n * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n * calls to zlib\n * @param {Boolean} [isServer=false] Create the instance in either server or\n * client mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(options, isServer, maxPayload) {\n this._maxPayload = maxPayload | 0;\n this._options = options || {};\n this._threshold =\n this._options.threshold !== undefined ? this._options.threshold : 1024;\n this._isServer = !!isServer;\n this._deflate = null;\n this._inflate = null;\n\n this.params = null;\n\n if (!zlibLimiter) {\n const concurrency =\n this._options.concurrencyLimit !== undefined\n ? this._options.concurrencyLimit\n : 10;\n zlibLimiter = new Limiter(concurrency);\n }\n }\n\n /**\n * @type {String}\n */\n static get extensionName() {\n return 'permessage-deflate';\n }\n\n /**\n * Create an extension negotiation offer.\n *\n * @return {Object} Extension parameters\n * @public\n */\n offer() {\n const params = {};\n\n if (this._options.serverNoContextTakeover) {\n params.server_no_context_takeover = true;\n }\n if (this._options.clientNoContextTakeover) {\n params.client_no_context_takeover = true;\n }\n if (this._options.serverMaxWindowBits) {\n params.server_max_window_bits = this._options.serverMaxWindowBits;\n }\n if (this._options.clientMaxWindowBits) {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n } else if (this._options.clientMaxWindowBits == null) {\n params.client_max_window_bits = true;\n }\n\n return params;\n }\n\n /**\n * Accept an extension negotiation offer/response.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Object} Accepted configuration\n * @public\n */\n accept(configurations) {\n configurations = this.normalizeParams(configurations);\n\n this.params = this._isServer\n ? this.acceptAsServer(configurations)\n : this.acceptAsClient(configurations);\n\n return this.params;\n }\n\n /**\n * Releases all resources used by the extension.\n *\n * @public\n */\n cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n const callback = this._deflate[kCallback];\n\n this._deflate.close();\n this._deflate = null;\n\n if (callback) {\n callback(\n new Error(\n 'The deflate stream was closed while data was being processed'\n )\n );\n }\n }\n }\n\n /**\n * Accept an extension negotiation offer.\n *\n * @param {Array} offers The extension negotiation offers\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsServer(offers) {\n const opts = this._options;\n const accepted = offers.find((params) => {\n if (\n (opts.serverNoContextTakeover === false &&\n params.server_no_context_takeover) ||\n (params.server_max_window_bits &&\n (opts.serverMaxWindowBits === false ||\n (typeof opts.serverMaxWindowBits === 'number' &&\n opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n (typeof opts.clientMaxWindowBits === 'number' &&\n !params.client_max_window_bits)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (!accepted) {\n throw new Error('None of the extension offers can be accepted');\n }\n\n if (opts.serverNoContextTakeover) {\n accepted.server_no_context_takeover = true;\n }\n if (opts.clientNoContextTakeover) {\n accepted.client_no_context_takeover = true;\n }\n if (typeof opts.serverMaxWindowBits === 'number') {\n accepted.server_max_window_bits = opts.serverMaxWindowBits;\n }\n if (typeof opts.clientMaxWindowBits === 'number') {\n accepted.client_max_window_bits = opts.clientMaxWindowBits;\n } else if (\n accepted.client_max_window_bits === true ||\n opts.clientMaxWindowBits === false\n ) {\n delete accepted.client_max_window_bits;\n }\n\n return accepted;\n }\n\n /**\n * Accept the extension negotiation response.\n *\n * @param {Array} response The extension negotiation response\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsClient(response) {\n const params = response[0];\n\n if (\n this._options.clientNoContextTakeover === false &&\n params.client_no_context_takeover\n ) {\n throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n }\n\n if (!params.client_max_window_bits) {\n if (typeof this._options.clientMaxWindowBits === 'number') {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n }\n } else if (\n this._options.clientMaxWindowBits === false ||\n (typeof this._options.clientMaxWindowBits === 'number' &&\n params.client_max_window_bits > this._options.clientMaxWindowBits)\n ) {\n throw new Error(\n 'Unexpected or invalid parameter \"client_max_window_bits\"'\n );\n }\n\n return params;\n }\n\n /**\n * Normalize parameters.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Array} The offers/response with normalized parameters\n * @private\n */\n normalizeParams(configurations) {\n configurations.forEach((params) => {\n Object.keys(params).forEach((key) => {\n let value = params[key];\n\n if (value.length > 1) {\n throw new Error(`Parameter \"${key}\" must have only a single value`);\n }\n\n value = value[0];\n\n if (key === 'client_max_window_bits') {\n if (value !== true) {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (!this._isServer) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else if (key === 'server_max_window_bits') {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (\n key === 'client_no_context_takeover' ||\n key === 'server_no_context_takeover'\n ) {\n if (value !== true) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else {\n throw new Error(`Unknown parameter \"${key}\"`);\n }\n\n params[key] = value;\n });\n });\n\n return configurations;\n }\n\n /**\n * Decompress data. Concurrency limited.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n decompress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._decompress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Compress data. Concurrency limited.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n compress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._compress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Decompress data.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _decompress(data, fin, callback) {\n const endpoint = this._isServer ? 'client' : 'server';\n\n if (!this._inflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._inflate = zlib.createInflateRaw({\n ...this._options.zlibInflateOptions,\n windowBits\n });\n this._inflate[kPerMessageDeflate] = this;\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n this._inflate.on('error', inflateOnError);\n this._inflate.on('data', inflateOnData);\n }\n\n this._inflate[kCallback] = callback;\n\n this._inflate.write(data);\n if (fin) this._inflate.write(TRAILER);\n\n this._inflate.flush(() => {\n const err = this._inflate[kError];\n\n if (err) {\n this._inflate.close();\n this._inflate = null;\n callback(err);\n return;\n }\n\n const data = bufferUtil.concat(\n this._inflate[kBuffers],\n this._inflate[kTotalLength]\n );\n\n if (this._inflate._readableState.endEmitted) {\n this._inflate.close();\n this._inflate = null;\n } else {\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._inflate.reset();\n }\n }\n\n callback(null, data);\n });\n }\n\n /**\n * Compress data.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _compress(data, fin, callback) {\n const endpoint = this._isServer ? 'server' : 'client';\n\n if (!this._deflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._deflate = zlib.createDeflateRaw({\n ...this._options.zlibDeflateOptions,\n windowBits\n });\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n //\n // An `'error'` event is emitted, only on Node.js < 10.0.0, if the\n // `zlib.DeflateRaw` instance is closed while data is being processed.\n // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong\n // time due to an abnormal WebSocket closure.\n //\n this._deflate.on('error', NOOP);\n this._deflate.on('data', deflateOnData);\n }\n\n this._deflate[kCallback] = callback;\n\n this._deflate.write(data);\n this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n if (!this._deflate) {\n //\n // The deflate stream was closed while data was being processed.\n //\n return;\n }\n\n let data = bufferUtil.concat(\n this._deflate[kBuffers],\n this._deflate[kTotalLength]\n );\n\n if (fin) data = data.slice(0, data.length - 4);\n\n //\n // Ensure that the callback will not be called again in\n // `PerMessageDeflate#cleanup()`.\n //\n this._deflate[kCallback] = null;\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._deflate.reset();\n }\n\n callback(null, data);\n });\n }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n this[kBuffers].push(chunk);\n this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n this[kTotalLength] += chunk.length;\n\n if (\n this[kPerMessageDeflate]._maxPayload < 1 ||\n this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n ) {\n this[kBuffers].push(chunk);\n return;\n }\n\n this[kError] = new RangeError('Max payload size exceeded');\n this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';\n this[kError][kStatusCode] = 1009;\n this.removeListener('data', inflateOnData);\n this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n //\n // There is no need to call `Zlib#close()` as the handle is automatically\n // closed when an error is emitted.\n //\n this[kPerMessageDeflate]._inflate = null;\n err[kStatusCode] = 1007;\n this[kCallback](err);\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n kStatusCode,\n kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends Writable\n */\nclass Receiver extends Writable {\n /**\n * Creates a Receiver instance.\n *\n * @param {String} [binaryType=nodebuffer] The type for binary data\n * @param {Object} [extensions] An object containing the negotiated extensions\n * @param {Boolean} [isServer=false] Specifies whether to operate in client or\n * server mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(binaryType, extensions, isServer, maxPayload) {\n super();\n\n this._binaryType = binaryType || BINARY_TYPES[0];\n this[kWebSocket] = undefined;\n this._extensions = extensions || {};\n this._isServer = !!isServer;\n this._maxPayload = maxPayload | 0;\n\n this._bufferedBytes = 0;\n this._buffers = [];\n\n this._compressed = false;\n this._payloadLength = 0;\n this._mask = undefined;\n this._fragmented = 0;\n this._masked = false;\n this._fin = false;\n this._opcode = 0;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragments = [];\n\n this._state = GET_INFO;\n this._loop = false;\n }\n\n /**\n * Implements `Writable.prototype._write()`.\n *\n * @param {Buffer} chunk The chunk of data to write\n * @param {String} encoding The character encoding of `chunk`\n * @param {Function} cb Callback\n * @private\n */\n _write(chunk, encoding, cb) {\n if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n this._bufferedBytes += chunk.length;\n this._buffers.push(chunk);\n this.startLoop(cb);\n }\n\n /**\n * Consumes `n` bytes from the buffered data.\n *\n * @param {Number} n The number of bytes to consume\n * @return {Buffer} The consumed bytes\n * @private\n */\n consume(n) {\n this._bufferedBytes -= n;\n\n if (n === this._buffers[0].length) return this._buffers.shift();\n\n if (n < this._buffers[0].length) {\n const buf = this._buffers[0];\n this._buffers[0] = buf.slice(n);\n return buf.slice(0, n);\n }\n\n const dst = Buffer.allocUnsafe(n);\n\n do {\n const buf = this._buffers[0];\n const offset = dst.length - n;\n\n if (n >= buf.length) {\n dst.set(this._buffers.shift(), offset);\n } else {\n dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n this._buffers[0] = buf.slice(n);\n }\n\n n -= buf.length;\n } while (n > 0);\n\n return dst;\n }\n\n /**\n * Starts the parsing loop.\n *\n * @param {Function} cb Callback\n * @private\n */\n startLoop(cb) {\n let err;\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n err = this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n err = this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n err = this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n err = this.getData(cb);\n break;\n default:\n // `INFLATING`\n this._loop = false;\n return;\n }\n } while (this._loop);\n\n cb(err);\n }\n\n /**\n * Reads the first two bytes of a frame.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getInfo() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV2 and RSV3 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_2_3'\n );\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (!this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n 'invalid opcode 0',\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._opcode = this._fragmented;\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this._loop = false;\n return error(\n RangeError,\n 'FIN must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_FIN'\n );\n }\n\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (this._payloadLength > 0x7d) {\n this._loop = false;\n return error(\n RangeError,\n `invalid payload length ${this._payloadLength}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n }\n } else {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._isServer) {\n if (!this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_MASK'\n );\n }\n } else if (this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_MASK'\n );\n }\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+16).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength16() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n this._payloadLength = this.consume(2).readUInt16BE(0);\n return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+64).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength64() {\n if (this._bufferedBytes < 8) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(8);\n const num = buf.readUInt32BE(0);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this._loop = false;\n return error(\n RangeError,\n 'Unsupported WebSocket frame: payload length > 2^53 - 1',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'\n );\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n return this.haveLength();\n }\n\n /**\n * Payload length has been read.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n haveLength() {\n if (this._payloadLength && this._opcode < 0x08) {\n this._totalPayloadLength += this._payloadLength;\n if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n this._loop = false;\n return error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n );\n }\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }\n\n /**\n * Reads mask bytes.\n *\n * @private\n */\n getMask() {\n if (this._bufferedBytes < 4) {\n this._loop = false;\n return;\n }\n\n this._mask = this.consume(4);\n this._state = GET_DATA;\n }\n\n /**\n * Reads data bytes.\n *\n * @param {Function} cb Callback\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n getData(cb) {\n let data = EMPTY_BUFFER;\n\n if (this._payloadLength) {\n if (this._bufferedBytes < this._payloadLength) {\n this._loop = false;\n return;\n }\n\n data = this.consume(this._payloadLength);\n if (this._masked) unmask(data, this._mask);\n }\n\n if (this._opcode > 0x07) return this.controlMessage(data);\n\n if (this._compressed) {\n this._state = INFLATING;\n this.decompress(data, cb);\n return;\n }\n\n if (data.length) {\n //\n // This message is not compressed so its lenght is the sum of the payload\n // length of all fragments.\n //\n this._messageLength = this._totalPayloadLength;\n this._fragments.push(data);\n }\n\n return this.dataMessage();\n }\n\n /**\n * Decompresses data.\n *\n * @param {Buffer} data Compressed data\n * @param {Function} cb Callback\n * @private\n */\n decompress(data, cb) {\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n if (err) return cb(err);\n\n if (buf.length) {\n this._messageLength += buf.length;\n if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n return cb(\n error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n )\n );\n }\n\n this._fragments.push(buf);\n }\n\n const er = this.dataMessage();\n if (er) return cb(er);\n\n this.startLoop(cb);\n });\n }\n\n /**\n * Handles a data message.\n *\n * @return {(Error|undefined)} A possible error\n * @private\n */\n dataMessage() {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n let data;\n\n if (this._binaryType === 'nodebuffer') {\n data = concat(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(concat(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.emit('message', data);\n } else {\n const buf = concat(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this._loop = false;\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('message', buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }\n\n /**\n * Handles a control message.\n *\n * @param {Buffer} data Data to handle\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n controlMessage(data) {\n if (this._opcode === 0x08) {\n this._loop = false;\n\n if (data.length === 0) {\n this.emit('conclude', 1005, '');\n this.end();\n } else if (data.length === 1) {\n return error(\n RangeError,\n 'invalid payload length 1',\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n } else {\n const code = data.readUInt16BE(0);\n\n if (!isValidStatusCode(code)) {\n return error(\n RangeError,\n `invalid status code ${code}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CLOSE_CODE'\n );\n }\n\n const buf = data.slice(2);\n\n if (!isValidUTF8(buf)) {\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('conclude', code, buf.toString());\n this.end();\n }\n } else if (this._opcode === 0x09) {\n this.emit('ping', data);\n } else {\n this.emit('pong', data);\n }\n\n this._state = GET_INFO;\n }\n}\n\nmodule.exports = Receiver;\n\n/**\n * Builds an error object.\n *\n * @param {function(new:Error|RangeError)} ErrorCtor The error constructor\n * @param {String} message The error message\n * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n * `message`\n * @param {Number} statusCode The status code\n * @param {String} errorCode The exposed error code\n * @return {(Error|RangeError)} The error\n * @private\n */\nfunction error(ErrorCtor, message, prefix, statusCode, errorCode) {\n const err = new ErrorCtor(\n prefix ? `Invalid WebSocket frame: ${message}` : message\n );\n\n Error.captureStackTrace(err, error);\n err.code = errorCode;\n err[kStatusCode] = statusCode;\n return err;\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls$\" }] */\n\n'use strict';\n\nconst net = require('net');\nconst tls = require('tls');\nconst { randomFillSync } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst mask = Buffer.alloc(4);\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n /**\n * Creates a Sender instance.\n *\n * @param {(net.Socket|tls.Socket)} socket The connection socket\n * @param {Object} [extensions] An object containing the negotiated extensions\n */\n constructor(socket, extensions) {\n this._extensions = extensions || {};\n this._socket = socket;\n\n this._firstFragment = true;\n this._compress = false;\n\n this._bufferedBytes = 0;\n this._deflating = false;\n this._queue = [];\n }\n\n /**\n * Frames a piece of data according to the HyBi WebSocket protocol.\n *\n * @param {Buffer} data The data to frame\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @return {Buffer[]} The framed data as a list of `Buffer` instances\n * @public\n */\n static frame(data, options) {\n const merge = options.mask && options.readOnly;\n let offset = options.mask ? 6 : 2;\n let payloadLength = data.length;\n\n if (data.length >= 65536) {\n offset += 8;\n payloadLength = 127;\n } else if (data.length > 125) {\n offset += 2;\n payloadLength = 126;\n }\n\n const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);\n\n target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n if (options.rsv1) target[0] |= 0x40;\n\n target[1] = payloadLength;\n\n if (payloadLength === 126) {\n target.writeUInt16BE(data.length, 2);\n } else if (payloadLength === 127) {\n target.writeUInt32BE(0, 2);\n target.writeUInt32BE(data.length, 6);\n }\n\n if (!options.mask) return [target, data];\n\n randomFillSync(mask, 0, 4);\n\n target[1] |= 0x80;\n target[offset - 4] = mask[0];\n target[offset - 3] = mask[1];\n target[offset - 2] = mask[2];\n target[offset - 1] = mask[3];\n\n if (merge) {\n applyMask(data, mask, target, offset, data.length);\n return [target];\n }\n\n applyMask(data, mask, data, 0, data.length);\n return [target, data];\n }\n\n /**\n * Sends a close message to the other peer.\n *\n * @param {Number} [code] The status code component of the body\n * @param {String} [data] The message component of the body\n * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n * @param {Function} [cb] Callback\n * @public\n */\n close(code, data, mask, cb) {\n let buf;\n\n if (code === undefined) {\n buf = EMPTY_BUFFER;\n } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n throw new TypeError('First argument must be a valid error code number');\n } else if (data === undefined || data === '') {\n buf = Buffer.allocUnsafe(2);\n buf.writeUInt16BE(code, 0);\n } else {\n const length = Buffer.byteLength(data);\n\n if (length > 123) {\n throw new RangeError('The message must not be greater than 123 bytes');\n }\n\n buf = Buffer.allocUnsafe(2 + length);\n buf.writeUInt16BE(code, 0);\n buf.write(data, 2);\n }\n\n if (this._deflating) {\n this.enqueue([this.doClose, buf, mask, cb]);\n } else {\n this.doClose(buf, mask, cb);\n }\n }\n\n /**\n * Frames and sends a close message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @private\n */\n doClose(data, mask, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x08,\n mask,\n readOnly: false\n }),\n cb\n );\n }\n\n /**\n * Sends a ping message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n ping(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPing(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a ping message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPing(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x09,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a pong message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n pong(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPong(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a pong message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPong(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x0a,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a data message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} [options.compress=false] Specifies whether or not to\n * compress `data`\n * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n * or text\n * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Function} [cb] Callback\n * @public\n */\n send(data, options, cb) {\n const buf = toBuffer(data);\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n let opcode = options.binary ? 2 : 1;\n let rsv1 = options.compress;\n\n if (this._firstFragment) {\n this._firstFragment = false;\n if (rsv1 && perMessageDeflate) {\n rsv1 = buf.length >= perMessageDeflate._threshold;\n }\n this._compress = rsv1;\n } else {\n rsv1 = false;\n opcode = 0;\n }\n\n if (options.fin) this._firstFragment = true;\n\n if (perMessageDeflate) {\n const opts = {\n fin: options.fin,\n rsv1,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n };\n\n if (this._deflating) {\n this.enqueue([this.dispatch, buf, this._compress, opts, cb]);\n } else {\n this.dispatch(buf, this._compress, opts, cb);\n }\n } else {\n this.sendFrame(\n Sender.frame(buf, {\n fin: options.fin,\n rsv1: false,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n }),\n cb\n );\n }\n }\n\n /**\n * Dispatches a data message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [compress=false] Specifies whether or not to compress\n * `data`\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @param {Function} [cb] Callback\n * @private\n */\n dispatch(data, compress, options, cb) {\n if (!compress) {\n this.sendFrame(Sender.frame(data, options), cb);\n return;\n }\n\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n this._bufferedBytes += data.length;\n this._deflating = true;\n perMessageDeflate.compress(data, options.fin, (_, buf) => {\n if (this._socket.destroyed) {\n const err = new Error(\n 'The socket was closed while data was being compressed'\n );\n\n if (typeof cb === 'function') cb(err);\n\n for (let i = 0; i < this._queue.length; i++) {\n const callback = this._queue[i][4];\n\n if (typeof callback === 'function') callback(err);\n }\n\n return;\n }\n\n this._bufferedBytes -= data.length;\n this._deflating = false;\n options.readOnly = false;\n this.sendFrame(Sender.frame(buf, options), cb);\n this.dequeue();\n });\n }\n\n /**\n * Executes queued send operations.\n *\n * @private\n */\n dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }\n\n /**\n * Enqueues a send operation.\n *\n * @param {Array} params Send operation parameters.\n * @private\n */\n enqueue(params) {\n this._bufferedBytes += params[1].length;\n this._queue.push(params);\n }\n\n /**\n * Sends a frame.\n *\n * @param {Buffer[]} list The frame to send\n * @param {Function} [cb] Callback\n * @private\n */\n sendFrame(list, cb) {\n if (list.length === 2) {\n this._socket.cork();\n this._socket.write(list[0]);\n this._socket.write(list[1], cb);\n this._socket.uncork();\n } else {\n this._socket.write(list[0], cb);\n }\n }\n}\n\nmodule.exports = Sender;\n","'use strict';\n\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {Duplex} stream The stream.\n * @private\n */\nfunction emitClose(stream) {\n stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n if (!this.destroyed && this._writableState.finished) {\n this.destroy();\n }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n this.removeListener('error', duplexOnError);\n this.destroy();\n if (this.listenerCount('error') === 0) {\n // Do not suppress the throwing behavior.\n this.emit('error', err);\n }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n let resumeOnReceiverDrain = true;\n let terminateOnDestroy = true;\n\n function receiverOnDrain() {\n if (resumeOnReceiverDrain) ws._socket.resume();\n }\n\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n });\n } else {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n }\n\n const duplex = new Duplex({\n ...options,\n autoDestroy: false,\n emitClose: false,\n objectMode: false,\n writableObjectMode: false\n });\n\n ws.on('message', function message(msg) {\n if (!duplex.push(msg)) {\n resumeOnReceiverDrain = false;\n ws._socket.pause();\n }\n });\n\n ws.once('error', function error(err) {\n if (duplex.destroyed) return;\n\n // Prevent `ws.terminate()` from being called by `duplex._destroy()`.\n //\n // - If the `'error'` event is emitted before the `'open'` event, then\n // `ws.terminate()` is a noop as no socket is assigned.\n // - Otherwise, the error is re-emitted by the listener of the `'error'`\n // event of the `Receiver` object. The listener already closes the\n // connection by calling `ws.close()`. This allows a close frame to be\n // sent to the other peer. If `ws.terminate()` is called right after this,\n // then the close frame might not be sent.\n terminateOnDestroy = false;\n duplex.destroy(err);\n });\n\n ws.once('close', function close() {\n if (duplex.destroyed) return;\n\n duplex.push(null);\n });\n\n duplex._destroy = function (err, callback) {\n if (ws.readyState === ws.CLOSED) {\n callback(err);\n process.nextTick(emitClose, duplex);\n return;\n }\n\n let called = false;\n\n ws.once('error', function error(err) {\n called = true;\n callback(err);\n });\n\n ws.once('close', function close() {\n if (!called) callback(err);\n process.nextTick(emitClose, duplex);\n });\n\n if (terminateOnDestroy) ws.terminate();\n };\n\n duplex._final = function (callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._final(callback);\n });\n return;\n }\n\n // If the value of the `_socket` property is `null` it means that `ws` is a\n // client websocket and the handshake failed. In fact, when this happens, a\n // socket is never assigned to the websocket. Wait for the `'error'` event\n // that will be emitted by the websocket.\n if (ws._socket === null) return;\n\n if (ws._socket._writableState.finished) {\n callback();\n if (duplex._readableState.endEmitted) duplex.destroy();\n } else {\n ws._socket.once('finish', function finish() {\n // `duplex` is not destroyed here because the `'end'` event will be\n // emitted on `duplex` after this `'finish'` event. The EOF signaling\n // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n callback();\n });\n ws.close();\n }\n };\n\n duplex._read = function () {\n if (\n (ws.readyState === ws.OPEN || ws.readyState === ws.CLOSING) &&\n !resumeOnReceiverDrain\n ) {\n resumeOnReceiverDrain = true;\n if (!ws._receiver._writableState.needDrain) ws._socket.resume();\n }\n };\n\n duplex._write = function (chunk, encoding, callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._write(chunk, encoding, callback);\n });\n return;\n }\n\n ws.send(chunk, callback);\n };\n\n duplex.on('end', duplexOnEnd);\n duplex.on('error', duplexOnError);\n return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n","'use strict';\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n return (\n (code >= 1000 &&\n code <= 1014 &&\n code !== 1004 &&\n code !== 1005 &&\n code !== 1006) ||\n (code >= 3000 && code <= 4999)\n );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if ((buf[i] & 0x80) === 0) {\n // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) {\n // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // Overlong\n ) {\n return false;\n }\n\n i += 2;\n } else if ((buf[i] & 0xf0) === 0xe0) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n }\n\n i += 3;\n } else if ((buf[i] & 0xf8) === 0xf0) {\n // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n }\n\n i += 4;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\ntry {\n let isValidUTF8 = require('utf-8-validate');\n\n /* istanbul ignore if */\n if (typeof isValidUTF8 === 'object') {\n isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0\n }\n\n module.exports = {\n isValidStatusCode,\n isValidUTF8(buf) {\n return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n isValidStatusCode,\n isValidUTF8: _isValidUTF8\n };\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls|https$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst http = require('http');\nconst https = require('https');\nconst net = require('net');\nconst tls = require('tls');\nconst { createHash } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst WebSocket = require('./websocket');\nconst { format, parse } = require('./extension');\nconst { GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\nconst RUNNING = 0;\nconst CLOSING = 1;\nconst CLOSED = 2;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n /**\n * Create a `WebSocketServer` instance.\n *\n * @param {Object} options Configuration options\n * @param {Number} [options.backlog=511] The maximum length of the queue of\n * pending connections\n * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n * track clients\n * @param {Function} [options.handleProtocols] A hook to handle protocols\n * @param {String} [options.host] The hostname where to bind the server\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.noServer=false] Enable no server mode\n * @param {String} [options.path] Accept only connections matching this path\n * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n * permessage-deflate\n * @param {Number} [options.port] The port where to bind the server\n * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n * server to use\n * @param {Function} [options.verifyClient] A hook to reject connections\n * @param {Function} [callback] A listener for the `listening` event\n */\n constructor(options, callback) {\n super();\n\n options = {\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: false,\n handleProtocols: null,\n clientTracking: true,\n verifyClient: null,\n noServer: false,\n backlog: null, // use default (511 as implemented in net.js)\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n };\n\n if (\n (options.port == null && !options.server && !options.noServer) ||\n (options.port != null && (options.server || options.noServer)) ||\n (options.server && options.noServer)\n ) {\n throw new TypeError(\n 'One and only one of the \"port\", \"server\", or \"noServer\" options ' +\n 'must be specified'\n );\n }\n\n if (options.port != null) {\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n\n res.writeHead(426, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n });\n this._server.listen(\n options.port,\n options.host,\n options.backlog,\n callback\n );\n } else if (options.server) {\n this._server = options.server;\n }\n\n if (this._server) {\n const emitConnection = this.emit.bind(this, 'connection');\n\n this._removeListeners = addListeners(this._server, {\n listening: this.emit.bind(this, 'listening'),\n error: this.emit.bind(this, 'error'),\n upgrade: (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n }\n });\n }\n\n if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n if (options.clientTracking) this.clients = new Set();\n this.options = options;\n this._state = RUNNING;\n }\n\n /**\n * Returns the bound address, the address family name, and port of the server\n * as reported by the operating system if listening on an IP socket.\n * If the server is listening on a pipe or UNIX domain socket, the name is\n * returned as a string.\n *\n * @return {(Object|String|null)} The address of the server\n * @public\n */\n address() {\n if (this.options.noServer) {\n throw new Error('The server is operating in \"noServer\" mode');\n }\n\n if (!this._server) return null;\n return this._server.address();\n }\n\n /**\n * Close the server.\n *\n * @param {Function} [cb] Callback\n * @public\n */\n close(cb) {\n if (cb) this.once('close', cb);\n\n if (this._state === CLOSED) {\n process.nextTick(emitClose, this);\n return;\n }\n\n if (this._state === CLOSING) return;\n this._state = CLOSING;\n\n //\n // Terminate all associated clients.\n //\n if (this.clients) {\n for (const client of this.clients) client.terminate();\n }\n\n const server = this._server;\n\n if (server) {\n this._removeListeners();\n this._removeListeners = this._server = null;\n\n //\n // Close the http server if it was internally created.\n //\n if (this.options.port != null) {\n server.close(emitClose.bind(undefined, this));\n return;\n }\n }\n\n process.nextTick(emitClose, this);\n }\n\n /**\n * See if a given request should be handled by this server instance.\n *\n * @param {http.IncomingMessage} req Request object to inspect\n * @return {Boolean} `true` if the request is valid, else `false`\n * @public\n */\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf('?');\n const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n if (pathname !== this.options.path) return false;\n }\n\n return true;\n }\n\n /**\n * Handle a HTTP Upgrade request.\n *\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @public\n */\n handleUpgrade(req, socket, head, cb) {\n socket.on('error', socketOnError);\n\n const key =\n req.headers['sec-websocket-key'] !== undefined\n ? req.headers['sec-websocket-key'].trim()\n : false;\n const version = +req.headers['sec-websocket-version'];\n const extensions = {};\n\n if (\n req.method !== 'GET' ||\n req.headers.upgrade.toLowerCase() !== 'websocket' ||\n !key ||\n !keyRegex.test(key) ||\n (version !== 8 && version !== 13) ||\n !this.shouldHandle(req)\n ) {\n return abortHandshake(socket, 400);\n }\n\n if (this.options.perMessageDeflate) {\n const perMessageDeflate = new PerMessageDeflate(\n this.options.perMessageDeflate,\n true,\n this.options.maxPayload\n );\n\n try {\n const offers = parse(req.headers['sec-websocket-extensions']);\n\n if (offers[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n }\n } catch (err) {\n return abortHandshake(socket, 400);\n }\n }\n\n //\n // Optionally call external client verification handler.\n //\n if (this.options.verifyClient) {\n const info = {\n origin:\n req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified) {\n return abortHandshake(socket, code || 401, message, headers);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n });\n return;\n }\n\n if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n }\n\n /**\n * Upgrade the connection to WebSocket.\n *\n * @param {String} key The value of the `Sec-WebSocket-Key` header\n * @param {Object} extensions The accepted extensions\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @throws {Error} If called more than once with the same socket\n * @private\n */\n completeUpgrade(key, extensions, req, socket, head, cb) {\n //\n // Destroy the socket if the client has already sent a FIN packet.\n //\n if (!socket.readable || !socket.writable) return socket.destroy();\n\n if (socket[kWebSocket]) {\n throw new Error(\n 'server.handleUpgrade() was called more than once with the same ' +\n 'socket, possibly due to a misconfiguration'\n );\n }\n\n if (this._state > RUNNING) return abortHandshake(socket, 503);\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n const headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${digest}`\n ];\n\n const ws = new WebSocket(null);\n let protocol = req.headers['sec-websocket-protocol'];\n\n if (protocol) {\n protocol = protocol.split(',').map(trim);\n\n //\n // Optionally call external protocol selection handler.\n //\n if (this.options.handleProtocols) {\n protocol = this.options.handleProtocols(protocol, req);\n } else {\n protocol = protocol[0];\n }\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n ws._protocol = protocol;\n }\n }\n\n if (extensions[PerMessageDeflate.extensionName]) {\n const params = extensions[PerMessageDeflate.extensionName].params;\n const value = format({\n [PerMessageDeflate.extensionName]: [params]\n });\n headers.push(`Sec-WebSocket-Extensions: ${value}`);\n ws._extensions = extensions;\n }\n\n //\n // Allow external modification/inspection of handshake headers.\n //\n this.emit('headers', headers, req);\n\n socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n socket.removeListener('error', socketOnError);\n\n ws.setSocket(socket, head, this.options.maxPayload);\n\n if (this.clients) {\n this.clients.add(ws);\n ws.on('close', () => this.clients.delete(ws));\n }\n\n cb(ws, req);\n }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of \n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n * called\n * @private\n */\nfunction addListeners(server, map) {\n for (const event of Object.keys(map)) server.on(event, map[event]);\n\n return function removeListeners() {\n for (const event of Object.keys(map)) {\n server.removeListener(event, map[event]);\n }\n };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n server._state = CLOSED;\n server.emit('close');\n}\n\n/**\n * Handle premature socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n if (socket.writable) {\n message = message || http.STATUS_CODES[code];\n headers = {\n Connection: 'close',\n 'Content-Type': 'text/html',\n 'Content-Length': Buffer.byteLength(message),\n ...headers\n };\n\n socket.write(\n `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n Object.keys(headers)\n .map((h) => `${h}: ${headers[h]}`)\n .join('\\r\\n') +\n '\\r\\n\\r\\n' +\n message\n );\n }\n\n socket.removeListener('error', socketOnError);\n socket.destroy();\n}\n\n/**\n * Remove whitespace characters from both ends of a string.\n *\n * @param {String} str The string\n * @return {String} A new string representing `str` stripped of whitespace\n * characters from both its beginning and end\n * @private\n */\nfunction trim(str) {\n return str.trim();\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Readable$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { Readable } = require('stream');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n GUID,\n kStatusCode,\n kWebSocket,\n NOOP\n} = require('./constants');\nconst { addEventListener, removeEventListener } = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst protocolVersions = [8, 13];\nconst closeTimeout = 30 * 1000;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n /**\n * Create a new `WebSocket`.\n *\n * @param {(String|URL)} address The URL to which to connect\n * @param {(String|String[])} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n */\n constructor(address, protocols, options) {\n super();\n\n this._binaryType = BINARY_TYPES[0];\n this._closeCode = 1006;\n this._closeFrameReceived = false;\n this._closeFrameSent = false;\n this._closeMessage = '';\n this._closeTimer = null;\n this._extensions = {};\n this._protocol = '';\n this._readyState = WebSocket.CONNECTING;\n this._receiver = null;\n this._sender = null;\n this._socket = null;\n\n if (address !== null) {\n this._bufferedAmount = 0;\n this._isServer = false;\n this._redirects = 0;\n\n if (Array.isArray(protocols)) {\n protocols = protocols.join(', ');\n } else if (typeof protocols === 'object' && protocols !== null) {\n options = protocols;\n protocols = undefined;\n }\n\n initAsClient(this, address, protocols, options);\n } else {\n this._isServer = true;\n }\n }\n\n /**\n * This deviates from the WHATWG interface since ws doesn't support the\n * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n * type).\n *\n * @type {String}\n */\n get binaryType() {\n return this._binaryType;\n }\n\n set binaryType(type) {\n if (!BINARY_TYPES.includes(type)) return;\n\n this._binaryType = type;\n\n //\n // Allow to change `binaryType` on the fly.\n //\n if (this._receiver) this._receiver._binaryType = type;\n }\n\n /**\n * @type {Number}\n */\n get bufferedAmount() {\n if (!this._socket) return this._bufferedAmount;\n\n return this._socket._writableState.length + this._sender._bufferedBytes;\n }\n\n /**\n * @type {String}\n */\n get extensions() {\n return Object.keys(this._extensions).join();\n }\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onclose() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onclose(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onerror() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onerror(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onopen() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onopen(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onmessage() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onmessage(listener) {}\n\n /**\n * @type {String}\n */\n get protocol() {\n return this._protocol;\n }\n\n /**\n * @type {Number}\n */\n get readyState() {\n return this._readyState;\n }\n\n /**\n * @type {String}\n */\n get url() {\n return this._url;\n }\n\n /**\n * Set up the socket and the internal resources.\n *\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Number} [maxPayload=0] The maximum allowed message size\n * @private\n */\n setSocket(socket, head, maxPayload) {\n const receiver = new Receiver(\n this.binaryType,\n this._extensions,\n this._isServer,\n maxPayload\n );\n\n this._sender = new Sender(socket, this._extensions);\n this._receiver = receiver;\n this._socket = socket;\n\n receiver[kWebSocket] = this;\n socket[kWebSocket] = this;\n\n receiver.on('conclude', receiverOnConclude);\n receiver.on('drain', receiverOnDrain);\n receiver.on('error', receiverOnError);\n receiver.on('message', receiverOnMessage);\n receiver.on('ping', receiverOnPing);\n receiver.on('pong', receiverOnPong);\n\n socket.setTimeout(0);\n socket.setNoDelay();\n\n if (head.length > 0) socket.unshift(head);\n\n socket.on('close', socketOnClose);\n socket.on('data', socketOnData);\n socket.on('end', socketOnEnd);\n socket.on('error', socketOnError);\n\n this._readyState = WebSocket.OPEN;\n this.emit('open');\n }\n\n /**\n * Emit the `'close'` event.\n *\n * @private\n */\n emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }\n\n /**\n * Start a closing handshake.\n *\n * +----------+ +-----------+ +----------+\n * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n * | +----------+ +-----------+ +----------+ |\n * +----------+ +-----------+ |\n * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING\n * +----------+ +-----------+ |\n * | | | +---+ |\n * +------------------------+-->|fin| - - - -\n * | +---+ | +---+\n * - - - - -|fin|<---------------------+\n * +---+\n *\n * @param {Number} [code] Status code explaining why the connection is closing\n * @param {String} [data] A string explaining why the connection is closing\n * @public\n */\n close(code, data) {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this.readyState === WebSocket.CLOSING) {\n if (\n this._closeFrameSent &&\n (this._closeFrameReceived || this._receiver._writableState.errorEmitted)\n ) {\n this._socket.end();\n }\n\n return;\n }\n\n this._readyState = WebSocket.CLOSING;\n this._sender.close(code, data, !this._isServer, (err) => {\n //\n // This error is handled by the `'error'` listener on the socket. We only\n // want to know if the close frame has been sent here.\n //\n if (err) return;\n\n this._closeFrameSent = true;\n\n if (\n this._closeFrameReceived ||\n this._receiver._writableState.errorEmitted\n ) {\n this._socket.end();\n }\n });\n\n //\n // Specify a timeout for the closing handshake to complete.\n //\n this._closeTimer = setTimeout(\n this._socket.destroy.bind(this._socket),\n closeTimeout\n );\n }\n\n /**\n * Send a ping.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the ping is sent\n * @public\n */\n ping(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a pong.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the pong is sent\n * @public\n */\n pong(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a data message.\n *\n * @param {*} data The message to send\n * @param {Object} [options] Options object\n * @param {Boolean} [options.compress] Specifies whether or not to compress\n * `data`\n * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n * text\n * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when data is written out\n * @public\n */\n send(data, options, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n const opts = {\n binary: typeof data !== 'string',\n mask: !this._isServer,\n compress: true,\n fin: true,\n ...options\n };\n\n if (!this._extensions[PerMessageDeflate.extensionName]) {\n opts.compress = false;\n }\n\n this._sender.send(data || EMPTY_BUFFER, opts, cb);\n }\n\n /**\n * Forcibly close the connection.\n *\n * @public\n */\n terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }\n}\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n[\n 'binaryType',\n 'bufferedAmount',\n 'extensions',\n 'protocol',\n 'readyState',\n 'url'\n].forEach((property) => {\n Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n Object.defineProperty(WebSocket.prototype, `on${method}`, {\n enumerable: true,\n get() {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]._listener) return listeners[i]._listener;\n }\n\n return undefined;\n },\n set(listener) {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n //\n // Remove only the listeners added via `addEventListener`.\n //\n if (listeners[i]._listener) this.removeListener(method, listeners[i]);\n }\n this.addEventListener(method, listener);\n }\n });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|URL)} address The URL to which to connect\n * @param {String} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n * permessage-deflate\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n * handshake request\n * @param {Number} [options.protocolVersion=13] Value of the\n * `Sec-WebSocket-Version` header\n * @param {String} [options.origin] Value of the `Origin` or\n * `Sec-WebSocket-Origin` header\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n * redirects\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n * allowed\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n const opts = {\n protocolVersion: protocolVersions[1],\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: true,\n followRedirects: false,\n maxRedirects: 10,\n ...options,\n createConnection: undefined,\n socketPath: undefined,\n hostname: undefined,\n protocol: undefined,\n timeout: undefined,\n method: undefined,\n host: undefined,\n path: undefined,\n port: undefined\n };\n\n if (!protocolVersions.includes(opts.protocolVersion)) {\n throw new RangeError(\n `Unsupported protocol version: ${opts.protocolVersion} ` +\n `(supported versions: ${protocolVersions.join(', ')})`\n );\n }\n\n let parsedUrl;\n\n if (address instanceof URL) {\n parsedUrl = address;\n websocket._url = address.href;\n } else {\n parsedUrl = new URL(address);\n websocket._url = address;\n }\n\n const isUnixSocket = parsedUrl.protocol === 'ws+unix:';\n\n if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) {\n const err = new Error(`Invalid URL: ${websocket.url}`);\n\n if (websocket._redirects === 0) {\n throw err;\n } else {\n emitErrorAndClose(websocket, err);\n return;\n }\n }\n\n const isSecure =\n parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:';\n const defaultPort = isSecure ? 443 : 80;\n const key = randomBytes(16).toString('base64');\n const get = isSecure ? https.get : http.get;\n let perMessageDeflate;\n\n opts.createConnection = isSecure ? tlsConnect : netConnect;\n opts.defaultPort = opts.defaultPort || defaultPort;\n opts.port = parsedUrl.port || defaultPort;\n opts.host = parsedUrl.hostname.startsWith('[')\n ? parsedUrl.hostname.slice(1, -1)\n : parsedUrl.hostname;\n opts.headers = {\n 'Sec-WebSocket-Version': opts.protocolVersion,\n 'Sec-WebSocket-Key': key,\n Connection: 'Upgrade',\n Upgrade: 'websocket',\n ...opts.headers\n };\n opts.path = parsedUrl.pathname + parsedUrl.search;\n opts.timeout = opts.handshakeTimeout;\n\n if (opts.perMessageDeflate) {\n perMessageDeflate = new PerMessageDeflate(\n opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n false,\n opts.maxPayload\n );\n opts.headers['Sec-WebSocket-Extensions'] = format({\n [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n });\n }\n if (protocols) {\n opts.headers['Sec-WebSocket-Protocol'] = protocols;\n }\n if (opts.origin) {\n if (opts.protocolVersion < 13) {\n opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n } else {\n opts.headers.Origin = opts.origin;\n }\n }\n if (parsedUrl.username || parsedUrl.password) {\n opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n }\n\n if (isUnixSocket) {\n const parts = opts.path.split(':');\n\n opts.socketPath = parts[0];\n opts.path = parts[1];\n }\n\n if (opts.followRedirects) {\n if (websocket._redirects === 0) {\n websocket._originalUnixSocket = isUnixSocket;\n websocket._originalSecure = isSecure;\n websocket._originalHostOrSocketPath = isUnixSocket\n ? opts.socketPath\n : parsedUrl.host;\n\n const headers = options && options.headers;\n\n //\n // Shallow copy the user provided options so that headers can be changed\n // without mutating the original object.\n //\n options = { ...options, headers: {} };\n\n if (headers) {\n for (const [key, value] of Object.entries(headers)) {\n options.headers[key.toLowerCase()] = value;\n }\n }\n } else {\n const isSameHost = isUnixSocket\n ? websocket._originalUnixSocket\n ? opts.socketPath === websocket._originalHostOrSocketPath\n : false\n : websocket._originalUnixSocket\n ? false\n : parsedUrl.host === websocket._originalHostOrSocketPath;\n\n if (!isSameHost || (websocket._originalSecure && !isSecure)) {\n //\n // Match curl 7.77.0 behavior and drop the following headers. These\n // headers are also dropped when following a redirect to a subdomain.\n //\n delete opts.headers.authorization;\n delete opts.headers.cookie;\n\n if (!isSameHost) delete opts.headers.host;\n\n opts.auth = undefined;\n }\n }\n\n //\n // Match curl 7.77.0 behavior and make the first `Authorization` header win.\n // If the `Authorization` header is set, then there is nothing to do as it\n // will take precedence.\n //\n if (opts.auth && !options.headers.authorization) {\n options.headers.authorization =\n 'Basic ' + Buffer.from(opts.auth).toString('base64');\n }\n }\n\n let req = (websocket._req = get(opts));\n\n if (opts.timeout) {\n req.on('timeout', () => {\n abortHandshake(websocket, req, 'Opening handshake has timed out');\n });\n }\n\n req.on('error', (err) => {\n if (req === null || req.aborted) return;\n\n req = websocket._req = null;\n emitErrorAndClose(websocket, err);\n });\n\n req.on('response', (res) => {\n const location = res.headers.location;\n const statusCode = res.statusCode;\n\n if (\n location &&\n opts.followRedirects &&\n statusCode >= 300 &&\n statusCode < 400\n ) {\n if (++websocket._redirects > opts.maxRedirects) {\n abortHandshake(websocket, req, 'Maximum redirects exceeded');\n return;\n }\n\n req.abort();\n\n let addr;\n\n try {\n addr = new URL(location, address);\n } catch (err) {\n emitErrorAndClose(websocket, err);\n return;\n }\n\n initAsClient(websocket, addr, protocols, options);\n } else if (!websocket.emit('unexpected-response', req, res)) {\n abortHandshake(\n websocket,\n req,\n `Unexpected server response: ${res.statusCode}`\n );\n }\n });\n\n req.on('upgrade', (res, socket, head) => {\n websocket.emit('upgrade', res);\n\n //\n // The user may have closed the connection from a listener of the `upgrade`\n // event.\n //\n if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n req = websocket._req = null;\n\n if (res.headers.upgrade.toLowerCase() !== 'websocket') {\n abortHandshake(websocket, socket, 'Invalid Upgrade header');\n return;\n }\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n if (res.headers['sec-websocket-accept'] !== digest) {\n abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n return;\n }\n\n const serverProt = res.headers['sec-websocket-protocol'];\n const protList = (protocols || '').split(/, */);\n let protError;\n\n if (!protocols && serverProt) {\n protError = 'Server sent a subprotocol but none was requested';\n } else if (protocols && !serverProt) {\n protError = 'Server sent no subprotocol';\n } else if (serverProt && !protList.includes(serverProt)) {\n protError = 'Server sent an invalid subprotocol';\n }\n\n if (protError) {\n abortHandshake(websocket, socket, protError);\n return;\n }\n\n if (serverProt) websocket._protocol = serverProt;\n\n const secWebSocketExtensions = res.headers['sec-websocket-extensions'];\n\n if (secWebSocketExtensions !== undefined) {\n if (!perMessageDeflate) {\n const message =\n 'Server sent a Sec-WebSocket-Extensions header but no extension ' +\n 'was requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n let extensions;\n\n try {\n extensions = parse(secWebSocketExtensions);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n const extensionNames = Object.keys(extensions);\n\n if (extensionNames.length) {\n if (\n extensionNames.length !== 1 ||\n extensionNames[0] !== PerMessageDeflate.extensionName\n ) {\n const message =\n 'Server indicated an extension that was not requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n try {\n perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n websocket._extensions[PerMessageDeflate.extensionName] =\n perMessageDeflate;\n }\n }\n\n websocket.setSocket(socket, head, opts.maxPayload);\n });\n}\n\n/**\n * Emit the `'error'` and `'close'` event.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {Error} The error to emit\n * @private\n */\nfunction emitErrorAndClose(websocket, err) {\n websocket._readyState = WebSocket.CLOSING;\n websocket.emit('error', err);\n websocket.emitClose();\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n options.path = options.socketPath;\n return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n options.path = undefined;\n\n if (!options.servername && options.servername !== '') {\n options.servername = net.isIP(options.host) ? '' : options.host;\n }\n\n return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to\n * abort or the socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n websocket._readyState = WebSocket.CLOSING;\n\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshake);\n\n if (stream.setHeader) {\n stream.abort();\n\n if (stream.socket && !stream.socket.destroyed) {\n //\n // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n // called after the request completed. See\n // https://github.com/websockets/ws/issues/1869.\n //\n stream.socket.destroy();\n }\n\n stream.once('abort', websocket.emitClose.bind(websocket));\n websocket.emit('error', err);\n } else {\n stream.destroy(err);\n stream.once('error', websocket.emit.bind(websocket, 'error'));\n stream.once('close', websocket.emitClose.bind(websocket));\n }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n if (data) {\n const length = toBuffer(data).length;\n\n //\n // The `_bufferedAmount` property is used only when the peer is a client and\n // the opening handshake fails. Under these circumstances, in fact, the\n // `setSocket()` method is not called, so the `_socket` and `_sender`\n // properties are set to `null`.\n //\n if (websocket._socket) websocket._sender._bufferedBytes += length;\n else websocket._bufferedAmount += length;\n }\n\n if (cb) {\n const err = new Error(\n `WebSocket is not open: readyState ${websocket.readyState} ` +\n `(${readyStates[websocket.readyState]})`\n );\n cb(err);\n }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {String} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n const websocket = this[kWebSocket];\n\n websocket._closeFrameReceived = true;\n websocket._closeMessage = reason;\n websocket._closeCode = code;\n\n if (websocket._socket[kWebSocket] === undefined) return;\n\n websocket._socket.removeListener('data', socketOnData);\n process.nextTick(resume, websocket._socket);\n\n if (code === 1005) websocket.close();\n else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n const websocket = this[kWebSocket];\n\n if (websocket._socket[kWebSocket] !== undefined) {\n websocket._socket.removeListener('data', socketOnData);\n\n //\n // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See\n // https://github.com/websockets/ws/issues/1940.\n //\n process.nextTick(resume, websocket._socket);\n\n websocket.close(err[kStatusCode]);\n }\n\n websocket.emit('error', err);\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message\n * @private\n */\nfunction receiverOnMessage(data) {\n this[kWebSocket].emit('message', data);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n const websocket = this[kWebSocket];\n\n websocket.pong(data, !websocket._isServer, NOOP);\n websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n this[kWebSocket].emit('pong', data);\n}\n\n/**\n * Resume a readable stream\n *\n * @param {Readable} stream The readable stream\n * @private\n */\nfunction resume(stream) {\n stream.resume();\n}\n\n/**\n * The listener of the `net.Socket` `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('data', socketOnData);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n let chunk;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk.\n //\n if (\n !this._readableState.endEmitted &&\n !websocket._closeFrameReceived &&\n !websocket._receiver._writableState.errorEmitted &&\n (chunk = websocket._socket.read()) !== null\n ) {\n websocket._receiver.write(chunk);\n }\n\n websocket._receiver.end();\n\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}\n\n/**\n * The listener of the `net.Socket` `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n if (!this[kWebSocket]._receiver.write(chunk)) {\n this.pause();\n }\n}\n\n/**\n * The listener of the `net.Socket` `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}\n\n/**\n * The listener of the `net.Socket` `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n const websocket = this[kWebSocket];\n\n this.removeListener('error', socketOnError);\n this.on('error', NOOP);\n\n if (websocket) {\n websocket._readyState = WebSocket.CLOSING;\n this.destroy();\n }\n}\n","module.exports = require(\"assert\");","module.exports = require(\"async_hooks\");","module.exports = require(\"buffer\");","module.exports = require(\"cluster\");","module.exports = require(\"crypto\");","module.exports = require(\"dgram\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"querystring\");","module.exports = require(\"stream\");","module.exports = require(\"string_decoder\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// GENERATED FILE. DO NOT EDIT.\nvar ipCodec = (function(exports) {\n \"use strict\";\n \n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.decode = decode;\n exports.encode = encode;\n exports.familyOf = familyOf;\n exports.name = void 0;\n exports.sizeOf = sizeOf;\n exports.v6 = exports.v4 = void 0;\n const v4Regex = /^(\\d{1,3}\\.){3,3}\\d{1,3}$/;\n const v4Size = 4;\n const v6Regex = /^(::)?(((\\d{1,3}\\.){3}(\\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;\n const v6Size = 16;\n const v4 = {\n name: 'v4',\n size: v4Size,\n isFormat: ip => v4Regex.test(ip),\n \n encode(ip, buff, offset) {\n offset = ~~offset;\n buff = buff || new Uint8Array(offset + v4Size);\n const max = ip.length;\n let n = 0;\n \n for (let i = 0; i < max;) {\n const c = ip.charCodeAt(i++);\n \n if (c === 46) {\n // \".\"\n buff[offset++] = n;\n n = 0;\n } else {\n n = n * 10 + (c - 48);\n }\n }\n \n buff[offset] = n;\n return buff;\n },\n \n decode(buff, offset) {\n offset = ~~offset;\n return `${buff[offset++]}.${buff[offset++]}.${buff[offset++]}.${buff[offset]}`;\n }\n \n };\n exports.v4 = v4;\n const v6 = {\n name: 'v6',\n size: v6Size,\n isFormat: ip => ip.length > 0 && v6Regex.test(ip),\n \n encode(ip, buff, offset) {\n offset = ~~offset;\n let end = offset + v6Size;\n let fill = -1;\n let hexN = 0;\n let decN = 0;\n let prevColon = true;\n let useDec = false;\n buff = buff || new Uint8Array(offset + v6Size); // Note: This algorithm needs to check if the offset\n // could exceed the buffer boundaries as it supports\n // non-standard compliant encodings that may go beyond\n // the boundary limits. if (offset < end) checks should\n // not be necessary...\n \n for (let i = 0; i < ip.length; i++) {\n let c = ip.charCodeAt(i);\n \n if (c === 58) {\n // :\n if (prevColon) {\n if (fill !== -1) {\n // Not Standard! (standard doesn't allow multiple ::)\n // We need to treat\n if (offset < end) buff[offset] = 0;\n if (offset < end - 1) buff[offset + 1] = 0;\n offset += 2;\n } else if (offset < end) {\n // :: in the middle\n fill = offset;\n }\n } else {\n // : ends the previous number\n if (useDec === true) {\n // Non-standard! (ipv4 should be at end only)\n // A ipv4 address should not be found anywhere else but at\n // the end. This codec also support putting characters\n // after the ipv4 address..\n if (offset < end) buff[offset] = decN;\n offset++;\n } else {\n if (offset < end) buff[offset] = hexN >> 8;\n if (offset < end - 1) buff[offset + 1] = hexN & 0xff;\n offset += 2;\n }\n \n hexN = 0;\n decN = 0;\n }\n \n prevColon = true;\n useDec = false;\n } else if (c === 46) {\n // . indicates IPV4 notation\n if (offset < end) buff[offset] = decN;\n offset++;\n decN = 0;\n hexN = 0;\n prevColon = false;\n useDec = true;\n } else {\n prevColon = false;\n \n if (c >= 97) {\n c -= 87; // a-f ... 97~102 -87 => 10~15\n } else if (c >= 65) {\n c -= 55; // A-F ... 65~70 -55 => 10~15\n } else {\n c -= 48; // 0-9 ... starting from charCode 48\n \n decN = decN * 10 + c;\n } // We don't know yet if its a dec or hex number\n \n \n hexN = (hexN << 4) + c;\n }\n }\n \n if (prevColon === false) {\n // Commiting last number\n if (useDec === true) {\n if (offset < end) buff[offset] = decN;\n offset++;\n } else {\n if (offset < end) buff[offset] = hexN >> 8;\n if (offset < end - 1) buff[offset + 1] = hexN & 0xff;\n offset += 2;\n }\n } else if (fill === 0) {\n // Not Standard! (standard doesn't allow multiple ::)\n // This means that a : was found at the start AND end which means the\n // end needs to be treated as 0 entry...\n if (offset < end) buff[offset] = 0;\n if (offset < end - 1) buff[offset + 1] = 0;\n offset += 2;\n } else if (fill !== -1) {\n // Non-standard! (standard doens't allow multiple ::)\n // Here we find that there has been a :: somewhere in the middle\n // and the end. To treat the end with priority we need to move all\n // written data two bytes to the right.\n offset += 2;\n \n for (let i = Math.min(offset - 1, end - 1); i >= fill + 2; i--) {\n buff[i] = buff[i - 2];\n }\n \n buff[fill] = 0;\n buff[fill + 1] = 0;\n fill = offset;\n }\n \n if (fill !== offset && fill !== -1) {\n // Move the written numbers to the end while filling the everything\n // \"fill\" to the bytes with zeros.\n if (offset > end - 2) {\n // Non Standard support, when the cursor exceeds bounds.\n offset = end - 2;\n }\n \n while (end > fill) {\n buff[--end] = offset < end && offset > fill ? buff[--offset] : 0;\n }\n } else {\n // Fill the rest with zeros\n while (offset < end) {\n buff[offset++] = 0;\n }\n }\n \n return buff;\n },\n \n decode(buff, offset) {\n offset = ~~offset;\n let result = '';\n \n for (let i = 0; i < v6Size; i += 2) {\n if (i !== 0) {\n result += ':';\n }\n \n result += (buff[offset + i] << 8 | buff[offset + i + 1]).toString(16);\n }\n \n return result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3').replace(/:{3,4}/, '::');\n }\n \n };\n exports.v6 = v6;\n const name = 'ip';\n exports.name = name;\n \n function sizeOf(ip) {\n if (v4.isFormat(ip)) return v4.size;\n if (v6.isFormat(ip)) return v6.size;\n throw Error(`Invalid ip address: ${ip}`);\n }\n \n function familyOf(string) {\n return sizeOf(string) === v4.size ? 1 : 2;\n }\n \n function encode(ip, buff, offset) {\n offset = ~~offset;\n const size = sizeOf(ip);\n \n if (typeof buff === 'function') {\n buff = buff(offset + size);\n }\n \n if (size === v4.size) {\n return v4.encode(ip, buff, offset);\n }\n \n return v6.encode(ip, buff, offset);\n }\n \n function decode(buff, offset, length) {\n offset = ~~offset;\n length = length || buff.length - offset;\n \n if (length === v4.size) {\n return v4.decode(buff, offset, length);\n }\n \n if (length === v6.size) {\n return v6.decode(buff, offset, length);\n }\n \n throw Error(`Invalid buffer size needs to be ${v4.size} for v4 or ${v6.size} for v6.`);\n }\n return \"default\" in exports ? exports.default : exports;\n})({});\nif (typeof define === 'function' && define.amd) define([], function() { return ipCodec; });\nelse if (typeof module === 'object' && typeof exports==='object') module.exports = ipCodec;\n","import crypto from 'crypto'\nimport { urlAlphabet } from './url-alphabet/index.js'\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\nlet fillPool = bytes => {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.randomFillSync(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.randomFillSync(pool)\n poolOffset = 0\n }\n poolOffset += bytes\n}\nlet random = bytes => {\n fillPool((bytes -= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let i = step\n while (i--) {\n id += alphabet[bytes[i] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n fillPool((size -= 0))\n let id = ''\n for (let i = poolOffset - size; i < poolOffset; i++) {\n id += urlAlphabet[pool[i] & 63]\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport { urlAlphabet }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = function(name, initScope) {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = function(msg) {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"aegis-app\";\n\tvar register = function(name, version, factory, eager) {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = function(id) {\n\t\tvar handleError = function(err) { warn(\"Initialization of sharing external failed: \" + err); };\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = function(module) { return module && module.init && module.init(__webpack_require__.S[name], initScope); }\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"axios\", \"0.21.4\", function() { return function() { return __webpack_require__(/*! ./node_modules/axios/index.js */ \"./node_modules/axios/index.js\"); }; }, 1);\n\t\t\tregister(\"axios\", \"0.26.1\", function() { return function() { return __webpack_require__(/*! ./node_modules/smartystreets-javascript-sdk/node_modules/axios/index.js */ \"./node_modules/smartystreets-javascript-sdk/node_modules/axios/index.js\"); }; }, 1);\n\t\t\tregister(\"kafkajs\", \"1.16.0\", function() { return function() { return __webpack_require__(/*! ./node_modules/kafkajs/index.js */ \"./node_modules/kafkajs/index.js\"); }; }, 1);\n\t\t\tregister(\"multicast-dns\", \"7.2.5\", function() { return function() { return __webpack_require__(/*! ./node_modules/multicast-dns/index.js */ \"./node_modules/multicast-dns/index.js\"); }; }, 1);\n\t\t\tregister(\"nanoid\", \"3.3.6\", function() { return function() { return __webpack_require__(/*! ./node_modules/nanoid/index.js */ \"./node_modules/nanoid/index.js\"); }; }, 1);\n\t\t\tregister(\"smartystreets-javascript-sdk\", \"1.13.7\", function() { return function() { return __webpack_require__(/*! ./node_modules/smartystreets-javascript-sdk/index.js */ \"./node_modules/smartystreets-javascript-sdk/index.js\"); }; }, 1);\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(function() { return initPromises[name] = 1; });\n};","var parseVersion = function(str) {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=function(p){return p.split(\".\").map((function(p){return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = function(a, b) {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f