diff --git a/CHANGELOG.md b/CHANGELOG.md index 082fe10e..56fa349f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.7.15](https://github.com/kunalnagarco/action-cve/compare/v1.7.14...v1.7.15) (2022-10-10) + + +### Chores + +* **deps:** lock file maintenance ([#118](https://github.com/kunalnagarco/action-cve/issues/118)) ([6f57e17](https://github.com/kunalnagarco/action-cve/commit/6f57e17b88ac6284dc3581d6d3bca923ec908fec)) +* **deps:** update dependency @types/jest to v27.5.2 ([#116](https://github.com/kunalnagarco/action-cve/issues/116)) ([301d4d3](https://github.com/kunalnagarco/action-cve/commit/301d4d348b0f8952e3d51d49c2da9ce37d11e1ff)) + ### [1.7.14](https://github.com/kunalnagarco/action-cve/compare/v1.7.13...v1.7.14) (2022-10-05) diff --git a/dist/index.js b/dist/index.js index 64175572..726e18a8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19198,63 +19198,67 @@ module.exports = { /***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __nccwpck_require__(4670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) +var register = __nccwpck_require__(4670); +var addHook = __nccwpck_require__(5549); +var removeHook = __nccwpck_require__(6819); // bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) +var bind = Function.bind; +var bindable = bind.bind(bind); -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) +function bindApi(hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); + }); } -function HookSingular () { - var singularHookName = 'h' +function HookSingular() { + var singularHookName = "h"; var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook + registry: {}, + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; } -function HookCollection () { +function HookCollection() { var state = { - registry: {} - } + registry: {}, + }; - var hook = register.bind(null, state) - bindApi(hook, state) + var hook = register.bind(null, state); + bindApi(hook, state); - return hook + return hook; } -var collectionHookDeprecationMessageDisplayed = false -function Hook () { +var collectionHookDeprecationMessageDisplayed = false; +function Hook() { if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true + console.warn( + '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' + ); + collectionHookDeprecationMessageDisplayed = true; } - return HookCollection() + return HookCollection(); } -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() +Hook.Singular = HookSingular.bind(); +Hook.Collection = HookCollection.bind(); -module.exports = Hook +module.exports = Hook; // expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection +module.exports.Hook = Hook; +module.exports.Singular = Hook.Singular; +module.exports.Collection = Hook.Collection; /***/ }), diff --git a/dist/index.js.map b/dist/index.js.map index f40acb05..7202fb45 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACllCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3rMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9iCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACv3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7gBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3LA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtIA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChCA;;;;;;;;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://@kunalnagarco/action-cve/./lib/constants.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/email.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/index.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/microsoft-teams.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/pager-duty.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/slack.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/zenduty.js","../webpack://@kunalnagarco/action-cve/./lib/entities/advisory.js","../webpack://@kunalnagarco/action-cve/./lib/entities/alert.js","../webpack://@kunalnagarco/action-cve/./lib/entities/index.js","../webpack://@kunalnagarco/action-cve/./lib/entities/repository.js","../webpack://@kunalnagarco/action-cve/./lib/entities/vulnerability.js","../webpack://@kunalnagarco/action-cve/./lib/fetch-alerts.js","../webpack://@kunalnagarco/action-cve/./lib/main.js","../webpack://@kunalnagarco/action-cve/./lib/utils/adaptive-card/index.js","../webpack://@kunalnagarco/action-cve/./lib/utils/index.js","../webpack://@kunalnagarco/action-cve/./lib/utils/request/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/command.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/core.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/file-command.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/path-utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/summary.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/context.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/github.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/internal/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/auth.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/proxy.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/core/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/request/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/api.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/common.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/events.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/IncomingWebhook.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/errors.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/instrument.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/activity-request.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/adaptive-applet.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/adaptivecards.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/card-elements.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/card-object.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/channel-adapter.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/collection.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/constants.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/menu-item.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/popup-control.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/popup-menu.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/enums.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/host-capabilities.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/host-config.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/registry.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/serialization.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/shared.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/strings.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/table.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/text-formatters.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/adapters/http.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/adapters/xhr.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/axios.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/Cancel.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/CancelToken.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/isCancel.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/Axios.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/InterceptorManager.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/buildFullPath.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/createError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/dispatchRequest.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/enhanceError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/mergeConfig.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/settle.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/transformData.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/defaults.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/bind.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/buildURL.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/combineURLs.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/cookies.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isAbsoluteURL.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isAxiosError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isURLSameOrigin.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/normalizeHeaderName.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/parseHeaders.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/spread.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/validator.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/add.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/register.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/remove.js","../webpack://@kunalnagarco/action-cve/./node_modules/browser-or-node/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/cross-fetch/dist/node-ponyfill.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/browser.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/common.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/node.js","../webpack://@kunalnagarco/action-cve/./node_modules/deprecation/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/follow-redirects/debug.js","../webpack://@kunalnagarco/action-cve/./node_modules/follow-redirects/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/has-flag/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://@kunalnagarco/action-cve/./node_modules/ms/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/tr46/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/addressparser/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/base64/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/message-parser.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/relaxed-body.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/sign.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/fetch/cookies.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/fetch/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/json-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mail-composer/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mailer/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mailer/mail-message.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-funcs/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-funcs/mime-types.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/last-newline.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/le-unix.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/le-windows.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/nodemailer.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/qp/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/sendmail-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/ses-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/shared/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/data-stream.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-pool/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-pool/pool-resource.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/stream-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/well-known/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/xoauth2/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/once/once.js","../webpack://@kunalnagarco/action-cve/./node_modules/supports-color/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/tunnel/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/tunnel/lib/tunnel.js","../webpack://@kunalnagarco/action-cve/./node_modules/universal-user-agent/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/md5.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/nil.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/parse.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/regex.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/rng.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/sha1.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/stringify.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v1.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v3.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v35.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v4.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v5.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/validate.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/version.js","../webpack://@kunalnagarco/action-cve/./node_modules/wrappy/wrappy.js","../webpack://@kunalnagarco/action-cve/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://@kunalnagarco/action-cve/external node-commonjs \"assert\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"child_process\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"crypto\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"dns\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"events\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"fs\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"http\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"https\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"net\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"os\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"path\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"punycode\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"stream\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"tls\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"tty\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"url\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"util\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"zlib\"","../webpack://@kunalnagarco/action-cve/webpack/bootstrap","../webpack://@kunalnagarco/action-cve/webpack/runtime/compat","../webpack://@kunalnagarco/action-cve/webpack/before-startup","../webpack://@kunalnagarco/action-cve/webpack/startup","../webpack://@kunalnagarco/action-cve/webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ACTION_URL = exports.ACTION_SHORT_SUMMARY = exports.ACTION_ICON = void 0;\nexports.ACTION_ICON = 'https://github.com/kunalnagarco/action-cve/raw/main/icons/ladybug.png';\nexports.ACTION_SHORT_SUMMARY = 'GitHub Action - @kunalnagarco/action-cve';\nexports.ACTION_URL = 'https://github.com/kunalnagarco/action-cve';\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToEmailSmtp = void 0;\nconst constants_1 = require(\"../constants\");\nconst entities_1 = require(\"../entities\");\nconst nodemailer_1 = require(\"nodemailer\");\nconst createTable = (alerts) => {\n let rowData = '';\n for (const alert of alerts) {\n rowData += createTableRow(alert);\n }\n return `\n \n \n \n \n \n \n \n \n \n \n ${rowData}\n \n
Package nameVulnerability Version RangePatched VersionSeveritySummary
\n `;\n};\nconst createTableRow = (alert) => {\n var _a, _b, _c, _d, _e;\n return `\n \n ${alert.packageName}\n ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n View\n \n `;\n};\nconst createEmailBody = (alerts) => {\n return `\n

Hello,

\n

You are receiving this message as you have set up email notifications for vulnerabilities in ${(0, entities_1.getFullRepositoryNameFromAlert)(alerts[0])} via ${constants_1.ACTION_SHORT_SUMMARY}.

\n ${createTable(alerts)}\n `;\n};\nconst sendAlertsToEmailSmtp = (config, alerts, emailList, emailFrom, subject) => __awaiter(void 0, void 0, void 0, function* () {\n const transporter = (0, nodemailer_1.createTransport)(config);\n yield transporter.sendMail({\n from: emailFrom,\n bcc: emailList,\n subject: subject ||\n `${constants_1.ACTION_SHORT_SUMMARY} - ${alerts.length} vulnerabilities in ${(0, entities_1.getFullRepositoryNameFromAlert)(alerts[0])}`,\n html: createEmailBody(alerts),\n });\n});\nexports.sendAlertsToEmailSmtp = sendAlertsToEmailSmtp;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./slack\"), exports);\n__exportStar(require(\"./pager-duty\"), exports);\n__exportStar(require(\"./zenduty\"), exports);\n__exportStar(require(\"./microsoft-teams\"), exports);\n__exportStar(require(\"./email\"), exports);\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToMicrosoftTeams = void 0;\n/* eslint-disable i18n-text/no-en */\nconst utils_1 = require(\"../utils\");\nconst constants_1 = require(\"../constants\");\nconst createTableRow = (key, value) => {\n const row = (0, utils_1.createRow)();\n const keyColumn = (0, utils_1.createColumn)();\n keyColumn.addItem((0, utils_1.createTextBlock)(key, true));\n row.addColumn(keyColumn);\n const valueColumn = (0, utils_1.createColumn)();\n valueColumn.addItem((0, utils_1.createTextBlock)(value));\n row.addColumn(valueColumn);\n return row;\n};\nconst createTableButtonRow = (url) => {\n const row = (0, utils_1.createRow)();\n const keyColumn = (0, utils_1.createColumn)();\n keyColumn.addItem((0, utils_1.createTextBlock)('Advisory URL', true));\n row.addColumn(keyColumn);\n const urlColumn = (0, utils_1.createColumn)();\n urlColumn.addItem((0, utils_1.createLinkButton)('View Advisory', url));\n row.addColumn(urlColumn);\n return row;\n};\nconst sendAlertsToMicrosoftTeams = (webhookUrl, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e;\n const alertCount = alerts.length;\n const repositoryOwner = alerts[0].repository.owner;\n const repositoryName = alerts[0].repository.name;\n const adaptiveCard = (0, utils_1.createAdaptiveCard)();\n adaptiveCard.addItem((0, utils_1.createTextBlock)(constants_1.ACTION_SHORT_SUMMARY));\n adaptiveCard.addItem((0, utils_1.createTextBlock)(`You have ${alertCount} vulnerabilities in ${repositoryOwner}/${repositoryName}`));\n for (const alert of alerts) {\n const container = (0, utils_1.createContainer)(true, true);\n container.addItem(createTableRow('Package Name', alert.packageName));\n container.addItem(createTableRow('Vulnerability Version Range', ((_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange) || ''));\n container.addItem(createTableRow('Patched Version', ((_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion) || ''));\n container.addItem(createTableRow('Severity', ((_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity) || ''));\n container.addItem(createTableRow('Summary', ((_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary) || ''));\n container.addItem(createTableButtonRow(((_e = alert.advisory) === null || _e === void 0 ? void 0 : _e.url) || ''));\n adaptiveCard.addItem(container);\n }\n const body = {\n type: 'message',\n attachments: [\n {\n contentType: 'application/vnd.microsoft.card.adaptive',\n contentUrl: null,\n content: adaptiveCard.toJSON(),\n },\n ],\n };\n yield (0, utils_1.request)(webhookUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n});\nexports.sendAlertsToMicrosoftTeams = sendAlertsToMicrosoftTeams;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToPagerDuty = void 0;\nconst constants_1 = require(\"../constants\");\nconst pdjs_1 = require(\"@pagerduty/pdjs\");\nconst sendAlertsToPagerDuty = (integrationKey, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n yield (0, pdjs_1.event)({\n data: {\n routing_key: integrationKey,\n event_action: 'trigger',\n payload: {\n summary: `You have ${alerts.length} vulnerabilities in ${alerts[0].repository.owner}/${alerts[0].repository.name}`,\n source: 'GitHub Dependabot Alerts',\n severity: 'info',\n custom_details: Object.assign({}, alerts),\n },\n images: [\n {\n src: constants_1.ACTION_ICON,\n alt: constants_1.ACTION_SHORT_SUMMARY,\n href: constants_1.ACTION_URL,\n },\n ],\n },\n });\n});\nexports.sendAlertsToPagerDuty = sendAlertsToPagerDuty;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToSlack = exports.MAX_COUNT_SLACK = exports.validateSlackWebhookUrl = void 0;\nconst constants_1 = require(\"../constants\");\nconst webhook_1 = require(\"@slack/webhook\");\nconst createSummaryBlock = (alertCount, repositoryName, repositoryOwner) => {\n return {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `\n You have ${alertCount} vulnerabilities in *${repositoryOwner}/${repositoryName}*.\n${alertCount > exports.MAX_COUNT_SLACK ? createMaxAlertsMarkdownNotice() : ''}\n `,\n },\n };\n};\nconst createDividerBlock = () => {\n return {\n type: 'divider',\n };\n};\nconst createAlertBlock = (alert) => {\n var _a, _b, _c, _d, _e;\n return {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `\n*Package name:* ${alert.packageName}\n*Vulnerability Version Range:* ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n*Patched Version:* ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n*Severity:* ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n*Summary:* ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n `,\n },\n accessory: {\n type: 'button',\n text: {\n type: 'plain_text',\n text: 'View Advisory',\n emoji: true,\n },\n style: 'danger',\n url: (_e = alert.advisory) === null || _e === void 0 ? void 0 : _e.url,\n },\n };\n};\nconst createMaxAlertsMarkdownNotice = () => {\n return `*Note:* Only ${exports.MAX_COUNT_SLACK} have been sent due to message length restrictions.`;\n};\nconst validateSlackWebhookUrl = (url) => {\n const regexPattern = new RegExp(/^https:\\/\\/hooks\\.slack\\.com\\/services\\/T[a-zA-Z0-9_]{8,10}\\/B[a-zA-Z0-9_]{10}\\/[a-zA-Z0-9_]{24}/);\n return regexPattern.test(url);\n};\nexports.validateSlackWebhookUrl = validateSlackWebhookUrl;\nexports.MAX_COUNT_SLACK = 30;\nconst sendAlertsToSlack = (webhookUrl, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n const webhook = new webhook_1.IncomingWebhook(webhookUrl);\n const alertBlocks = [];\n for (const alert of alerts) {\n alertBlocks.push(createAlertBlock(alert));\n }\n yield webhook.send({\n blocks: [\n createSummaryBlock(alerts.length, alerts[0].repository.name, alerts[0].repository.owner),\n createDividerBlock(),\n ...alertBlocks,\n ],\n icon_url: constants_1.ACTION_ICON,\n username: constants_1.ACTION_SHORT_SUMMARY,\n });\n});\nexports.sendAlertsToSlack = sendAlertsToSlack;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToZenduty = void 0;\nconst constants_1 = require(\"../constants\");\nconst utils_1 = require(\"../utils\");\nconst sendAlertsToZenduty = (apiKey, serviceId, escalationPolicyId, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n let summary = `\n You have ${alerts.length} vulnerabilities in ${alerts[0].repository.owner}/${alerts[0].repository.name}\n\n ---\n\n `;\n for (const alert of alerts) {\n summary += `\n Package name: ${alert.packageName}\n Vulnerability Version Range: ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n Patched Version: ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n Severity: ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n Summary: ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n `;\n }\n summary += `\n\n ---\n `;\n const payload = {\n service: serviceId,\n escalation_policy: escalationPolicyId,\n title: `${constants_1.ACTION_SHORT_SUMMARY} - ${alerts[0].repository.name}`,\n urgency: 0,\n summary,\n };\n // eslint-disable-next-line i18n-text/no-en\n const bearer = `Token ${apiKey}`;\n yield (0, utils_1.request)('https://www.zenduty.com/api/incidents/', {\n method: 'POST',\n headers: {\n Authorization: bearer,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload),\n });\n});\nexports.sendAlertsToZenduty = sendAlertsToZenduty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toAdvisory = void 0;\nconst toAdvisory = (securityAdvisory) => ({\n cvssScore: securityAdvisory.cvss.score,\n severity: securityAdvisory.severity,\n summary: securityAdvisory.summary,\n description: securityAdvisory.description,\n url: securityAdvisory.permalink,\n publishedAt: securityAdvisory.publishedAt,\n updatedAt: securityAdvisory.updatedAt,\n withdrawnAt: securityAdvisory.withdrawnAt,\n});\nexports.toAdvisory = toAdvisory;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isActiveAlert = exports.toAlert = void 0;\nconst advisory_1 = require(\"./advisory\");\nconst repository_1 = require(\"./repository\");\nconst vulnerability_1 = require(\"./vulnerability\");\nconst toAlert = (repositoryVulnerabilityAlert) => {\n var _a;\n return ({\n repository: (0, repository_1.toRepository)(repositoryVulnerabilityAlert.repository),\n packageName: ((_a = repositoryVulnerabilityAlert.securityVulnerability) === null || _a === void 0 ? void 0 : _a.package.name) || '',\n advisory: repositoryVulnerabilityAlert.securityAdvisory\n ? (0, advisory_1.toAdvisory)(repositoryVulnerabilityAlert.securityAdvisory)\n : undefined,\n vulnerability: repositoryVulnerabilityAlert.securityVulnerability\n ? (0, vulnerability_1.toVulnerability)(repositoryVulnerabilityAlert.securityVulnerability)\n : undefined,\n manifest: repositoryVulnerabilityAlert.vulnerableManifestFilename,\n createdAt: repositoryVulnerabilityAlert.createdAt,\n });\n};\nexports.toAlert = toAlert;\nconst isActiveAlert = (repositoryVulnerabilityAlert) => {\n if (repositoryVulnerabilityAlert.dismissedAt === null &&\n repositoryVulnerabilityAlert.fixedAt === null) {\n return true;\n }\n return false;\n};\nexports.isActiveAlert = isActiveAlert;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./repository\"), exports);\n__exportStar(require(\"./advisory\"), exports);\n__exportStar(require(\"./alert\"), exports);\n__exportStar(require(\"./vulnerability\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFullRepositoryNameFromAlert = exports.toRepository = void 0;\nconst toRepository = (repository) => ({\n name: repository.name,\n owner: repository.owner.login,\n});\nexports.toRepository = toRepository;\nconst getFullRepositoryNameFromAlert = (alert) => `${alert.repository.owner}/${alert.repository.name}`;\nexports.getFullRepositoryNameFromAlert = getFullRepositoryNameFromAlert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVulnerability = void 0;\nconst toVulnerability = (securityVulnerability) => {\n var _a;\n return ({\n firstPatchedVersion: (_a = securityVulnerability.firstPatchedVersion) === null || _a === void 0 ? void 0 : _a.identifier,\n vulnerableVersionRange: securityVulnerability.vulnerableVersionRange,\n updatedAt: securityVulnerability.updatedAt,\n });\n};\nexports.toVulnerability = toVulnerability;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAlerts = void 0;\nconst entities_1 = require(\"./entities\");\nconst github_1 = require(\"@actions/github\");\nconst fetchAlerts = (gitHubPersonalAccessToken, repositoryName, repositoryOwner, count) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const octokit = (0, github_1.getOctokit)(gitHubPersonalAccessToken);\n const { repository } = yield octokit.graphql(`\n query {\n repository(owner:\"${repositoryOwner}\" name:\"${repositoryName}\") {\n vulnerabilityAlerts(last: ${count}) {\n edges {\n node {\n id\n dismissedAt\n fixedAt\n repository {\n name\n owner {\n login\n }\n }\n securityAdvisory {\n id\n description\n cvss {\n score\n vectorString\n }\n permalink\n severity\n summary\n }\n securityVulnerability {\n firstPatchedVersion {\n identifier\n }\n package {\n ecosystem\n name\n }\n vulnerableVersionRange\n advisory {\n cvss {\n score\n vectorString\n }\n summary\n }\n }\n }\n }\n }\n }\n }\n `);\n const gitHubAlerts = (_a = repository.vulnerabilityAlerts) === null || _a === void 0 ? void 0 : _a.edges;\n if (gitHubAlerts) {\n const alerts = [];\n for (const gitHubAlert of gitHubAlerts) {\n if (gitHubAlert && gitHubAlert.node && (0, entities_1.isActiveAlert)(gitHubAlert.node)) {\n alerts.push((0, entities_1.toAlert)(gitHubAlert.node));\n }\n }\n return alerts;\n }\n return [];\n});\nexports.fetchAlerts = fetchAlerts;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"@actions/core\");\nconst destinations_1 = require(\"./destinations\");\nconst github_1 = require(\"@actions/github\");\nconst fetch_alerts_1 = require(\"./fetch-alerts\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const token = (0, core_1.getInput)('token');\n const microsoftTeamsWebhookUrl = (0, core_1.getInput)('microsoft_teams_webhook');\n const slackWebhookUrl = (0, core_1.getInput)('slack_webhook');\n const pagerDutyIntegrationKey = (0, core_1.getInput)('pager_duty_integration_key');\n const zenDutyApiKey = (0, core_1.getInput)('zenduty_api_key');\n const zenDutyServiceId = (0, core_1.getInput)('zenduty_service_id');\n const zenDutyEscalationPolicyId = (0, core_1.getInput)('zenduty_escalation_policy_id');\n const emailFrom = (0, core_1.getInput)('email_from');\n const emailList = (0, core_1.getInput)('email_list');\n const emailSubject = (0, core_1.getInput)('email_subject');\n const emailTransportSmtpHost = (0, core_1.getInput)('email_transport_smtp_host');\n const emailTransportSmtpPort = parseInt((0, core_1.getInput)('email_transport_smtp_port'));\n const emailTransportSmtpUser = (0, core_1.getInput)('email_transport_smtp_user');\n const emailTransportSmtpPassword = (0, core_1.getInput)('email_transport_smtp_password');\n const count = parseInt((0, core_1.getInput)('count'));\n const owner = github_1.context.repo.owner;\n const repo = github_1.context.repo.repo;\n const alerts = yield (0, fetch_alerts_1.fetchAlerts)(token, repo, owner, count);\n if (alerts.length > 0) {\n if (microsoftTeamsWebhookUrl) {\n yield (0, destinations_1.sendAlertsToMicrosoftTeams)(microsoftTeamsWebhookUrl, alerts);\n }\n if (slackWebhookUrl) {\n if (!(0, destinations_1.validateSlackWebhookUrl)(slackWebhookUrl)) {\n (0, core_1.setFailed)(new Error('Invalid Slack Webhook URL'));\n }\n else {\n yield (0, destinations_1.sendAlertsToSlack)(slackWebhookUrl, alerts);\n }\n }\n if (pagerDutyIntegrationKey) {\n yield (0, destinations_1.sendAlertsToPagerDuty)(pagerDutyIntegrationKey, alerts);\n }\n if (zenDutyApiKey) {\n if (zenDutyServiceId && zenDutyEscalationPolicyId) {\n yield (0, destinations_1.sendAlertsToZenduty)(zenDutyApiKey, zenDutyServiceId, zenDutyEscalationPolicyId, alerts);\n }\n else {\n (0, core_1.setFailed)(new Error('Check your Zenduty Service ID and Escalation Policy ID'));\n }\n }\n if (emailFrom && emailList) {\n const emailWikiLink = 'https://github.com/kunalnagarco/action-cve/wiki/Send-alerts-to-email';\n if (emailTransportSmtpUser && emailTransportSmtpPassword) {\n const emailTransportSmtpConfig = {\n host: emailTransportSmtpHost,\n port: emailTransportSmtpPort,\n secure: emailTransportSmtpPort === 465 && true,\n auth: {\n user: emailTransportSmtpUser,\n pass: emailTransportSmtpPassword,\n },\n };\n (0, destinations_1.sendAlertsToEmailSmtp)(emailTransportSmtpConfig, alerts, emailList, emailFrom, emailSubject);\n }\n else {\n (0, core_1.setFailed)(new Error(`Invalid SMTP config. Please check the wiki for more info: ${emailWikiLink}`));\n }\n }\n }\n }\n catch (err) {\n if (err instanceof Error) {\n (0, core_1.setFailed)(err);\n }\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAdaptiveCard = exports.createLinkButton = exports.createColumn = exports.createTextBlock = exports.createRow = exports.createContainer = void 0;\nconst adaptivecards_1 = require(\"adaptivecards\");\nconst createContainer = (isSpacingLarge, isStyleEmphasis) => {\n const container = new adaptivecards_1.Container();\n if (isSpacingLarge) {\n container.spacing = adaptivecards_1.Spacing.Large;\n }\n if (isStyleEmphasis) {\n container.style = 'emphasis';\n }\n return container;\n};\nexports.createContainer = createContainer;\nconst createRow = () => {\n return new adaptivecards_1.ColumnSet();\n};\nexports.createRow = createRow;\nconst createTextBlock = (text, isBold = false, isWrap = true) => {\n const textBlock = new adaptivecards_1.TextBlock(text);\n if (isBold) {\n textBlock.weight = adaptivecards_1.TextWeight.Bolder;\n }\n textBlock.wrap = isWrap;\n return textBlock;\n};\nexports.createTextBlock = createTextBlock;\nconst createColumn = () => {\n return new adaptivecards_1.Column();\n};\nexports.createColumn = createColumn;\nconst createLinkButton = (text, url) => {\n const linkButton = new adaptivecards_1.ActionSet();\n const action = new adaptivecards_1.OpenUrlAction();\n action.title = text;\n action.url = url;\n linkButton.addAction(action);\n return linkButton;\n};\nexports.createLinkButton = createLinkButton;\nconst createAdaptiveCard = () => {\n const adaptiveCard = new adaptivecards_1.AdaptiveCard();\n adaptiveCard.version = new adaptivecards_1.Version(1, 2);\n return adaptiveCard;\n};\nexports.createAdaptiveCard = createAdaptiveCard;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./request\"), exports);\n__exportStar(require(\"./adaptive-card\"), exports);\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.request = void 0;\nconst node_fetch_1 = __importDefault(require(\"node-fetch\"));\nconst request = (url, options) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, node_fetch_1.default)(url, Object.assign({}, options));\n});\nexports.request = request;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst uuid_1 = require(\"uuid\");\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.\n if (name.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedVal.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options) {\n return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nconst defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.6.0\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.21.3\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return _objectSpread2(_objectSpread2({}, response), {}, {\n data: []\n });\n }\n\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /applications/grants\", \"GET /authorizations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/audit-log\", \"GET /enterprises/{enterprise}/secret-scanning/alerts\", \"GET /enterprises/{enterprise}/settings/billing/advanced-security\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /licenses\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /orgs/{org}/actions/cache/usage-by-repository\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/audit-log\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/code-scanning/alerts\", \"GET /orgs/{org}/codespaces\", \"GET /orgs/{org}/credential-authorizations\", \"GET /orgs/{org}/dependabot/secrets\", \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/external-groups\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/settings/billing/advanced-security\", \"GET /orgs/{org}/team-sync/groups\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/caches\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/codespaces\", \"GET /repos/{owner}/{repo}/codespaces/devcontainers\", \"GET /repos/{owner}/{repo}/codespaces/secrets\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/status\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/dependabot/secrets\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/environments\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repos/{owner}/{repo}/topics\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/codespaces\", \"GET /user/codespaces/secrets\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/packages/{package_type}/{package_name}/versions\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nconst Endpoints = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\"POST /orgs/{org}/actions/runners/{runner_id}/labels\"],\n addCustomLabelsToSelfHostedRunnerForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteActionsCacheById: [\"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\"],\n deleteActionsCacheByKey: [\"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\"GET /orgs/{org}/actions/cache/usage-by-repository\"],\n getActionsCacheUsageForEnterprise: [\"GET /enterprises/{enterprise}/actions/cache/usage\"],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsDefaultWorkflowPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/workflow\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/access\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listLabelsForSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}/labels\"],\n listLabelsForSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\"],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\"],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\"],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForOrg: [\"PUT /orgs/{org}/actions/runners/{runner_id}/labels\"],\n setCustomLabelsForSelfHostedRunnerForRepo: [\"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n setGithubActionsDefaultWorkflowPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/workflow\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"],\n setWorkflowAccessToRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/access\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubAdvancedSecurityBillingGhe: [\"GET /enterprises/{enterprise}/settings/billing/advanced-security\"],\n getGithubAdvancedSecurityBillingOrg: [\"GET /orgs/{org}/settings/billing/advanced-security\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n codespaceMachinesForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/machines\"],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n createOrUpdateSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}\"],\n createWithPrForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\"],\n createWithRepoForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/codespaces\"],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n deleteSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}\"],\n exportForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/exports\"],\n getExportDetailsForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/exports/{export_id}\"],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getPublicKeyForAuthenticatedUser: [\"GET /user/codespaces/secrets/public-key\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n getSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}\"],\n listDevcontainersInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/devcontainers\"],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\"GET /orgs/{org}/codespaces\", {}, {\n renamedParameters: {\n org_id: \"org\"\n }\n }],\n listInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}/repositories\"],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n removeRepositoryForSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n repoMachinesForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/machines\"],\n setRepositoriesForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories\"],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\"],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"]\n },\n dependabot: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"]\n },\n dependencyGraph: {\n createRepositorySnapshot: [\"POST /repos/{owner}/{repo}/dependency-graph/snapshots\"],\n diffRange: [\"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n addCustomLabelsToSelfHostedRunnerForEnterprise: [\"POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n getServerStatistics: [\"GET /enterprise-installation/{enterprise_or_org}/server-statistics\"],\n listLabelsForSelfHostedRunnerForEnterprise: [\"GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForEnterprise: [\"PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listCustomRoles: [\"GET /organizations/{organization_id}/custom_roles\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createTagProtection: [\"POST /repos/{owner}/{repo}/tags/protection\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteTagProtection: [\"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTagProtection: [\"GET /repos/{owner}/{repo}/tags/protection\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/secret-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"5.16.2\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return _objectSpread2(_objectSpread2({}, api), {}, {\n rest: api\n });\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.api = void 0;\nconst common_1 = require(\"./common\");\nfunction api(apiParameters) {\n var _a;\n // If the apiParameters don't include `endpoint` treat it as a partial\n // application.\n if (!apiParameters.endpoint && !apiParameters.url) {\n return partialCall(apiParameters);\n }\n const types = {\n bearer: 'Bearer ',\n token: 'Token token=',\n };\n const { endpoint, server = 'api.pagerduty.com', token, tokenType = apiParameters.tokenType || 'token', url, version = 2, data, ...rest } = apiParameters;\n const config = {\n method: 'GET',\n ...rest,\n headers: {\n Accept: `application/vnd.pagerduty+json;version=${version}`,\n Authorization: `${types[tokenType]}${token}`,\n ...rest.headers,\n },\n };\n // Allow `data` for `queryParameters` for requests without bodies.\n if (isReadonlyRequest(config.method) && data) {\n config.queryParameters =\n (_a = config.queryParameters) !== null && _a !== void 0 ? _a : data;\n }\n else {\n config.body = JSON.stringify(data);\n }\n return apiRequest(url !== null && url !== void 0 ? url : `https://${server}/${endpoint.replace(/^\\/+/, '')}`, config);\n}\nexports.api = api;\nfunction apiRequest(url, options) {\n return (0, common_1.request)(url, options).then((response) => {\n const apiResponse = response;\n apiResponse.response = response;\n if (response.status === 204) {\n return Promise.resolve(apiResponse);\n }\n return response\n .json()\n .then((data) => {\n const resource = resourceKey(url, options.method);\n apiResponse.next = nextFunc(url, options, data);\n apiResponse.data = data;\n apiResponse.resource = resource ? data[resource] : null;\n return apiResponse;\n })\n .catch(() => Promise.reject(apiResponse));\n });\n}\nfunction resourceKey(url, method) {\n const resource = url.match(/.+.com\\/(?[\\w]+)/);\n if (resource) {\n const resourceName = resource[1];\n if (method && method.toLowerCase() === 'get') {\n return resourceName;\n }\n if (resourceName.endsWith('ies')) {\n return resourceName.slice(0, -3) + 'y';\n }\n else if (resourceName.endsWith('s')) {\n return resourceName.slice(0, -1);\n }\n return resourceName;\n }\n return null;\n}\nfunction isReadonlyRequest(method) {\n var _a;\n return !['PUT', 'POST', 'DELETE', 'PATCH'].includes((_a = method.toUpperCase()) !== null && _a !== void 0 ? _a : 'GET');\n}\nfunction isOffsetPagination(data) {\n if (data.offset !== undefined) {\n return true;\n }\n return false;\n}\nfunction isCursorPagination(data) {\n if (data.cursor !== undefined) {\n return true;\n }\n return false;\n}\nfunction nextFunc(url, options, data) {\n if (isOffsetPagination(data)) {\n if ((data === null || data === void 0 ? void 0 : data.more) && typeof data.offset !== undefined && data.limit) {\n return () => apiRequest(url, {\n ...options,\n queryParameters: {\n ...options.queryParameters,\n limit: data.limit.toString(),\n offset: (data.limit + data.offset).toString(),\n },\n });\n }\n }\n else if (isCursorPagination(data)) {\n if (data === null || data === void 0 ? void 0 : data.cursor) {\n return () => apiRequest(url, {\n ...options,\n queryParameters: {\n ...options.queryParameters,\n cursor: data.cursor,\n limit: data.limit.toString(),\n },\n });\n }\n }\n return undefined;\n}\nfunction partialCall(apiParameters) {\n const partialParameters = apiParameters;\n const partial = ((apiParameters) => api({ ...partialParameters, ...apiParameters }));\n const shorthand = (method) => (endpoint, shorthandParameters) => api({\n endpoint,\n method,\n ...partialParameters,\n ...shorthandParameters,\n });\n partial.get = shorthand('get');\n partial.post = shorthand('post');\n partial.put = shorthand('put');\n partial.patch = shorthand('patch');\n partial.delete = shorthand('delete');\n partial.all = (endpoint, shorthandParameters) => {\n function allInner(responses) {\n const response = responses[responses.length - 1];\n if (!response.next) {\n // Base case, resolve and return all responses.\n return Promise.resolve(responses);\n }\n // If there are still more resources to get then concat and repeat.\n return response\n .next()\n .then(response => allInner(responses.concat([response])));\n }\n function repackResponses(responses) {\n // Repack the responses object to make it more user friendly.\n const repackedResponse = responses.shift(); // Use the first response to build the standard response object\n repackedResponse.data = [repackedResponse.data];\n responses.forEach(response => {\n repackedResponse.data = repackedResponse.data.concat(response.data);\n repackedResponse.resource = repackedResponse.resource.concat(response.resource);\n });\n return Promise.resolve(repackedResponse);\n }\n const method = 'get';\n return api({\n endpoint,\n method,\n ...partialParameters,\n ...shorthandParameters,\n })\n .then(response => allInner([response]))\n .then(responses => repackResponses(responses));\n };\n return partial;\n}\n//# sourceMappingURL=api.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.request = void 0;\n/* LEGACY-BROWSER-SUPPORT-START */\nconst cross_fetch_1 = require(\"cross-fetch\");\nconst browser_or_node_1 = require(\"browser-or-node\");\n/* LEGACY-BROWSER-SUPPORT-END */\nconst VERSION = '2.0.0';\nfunction request(url, options = {}) {\n const { queryParameters, requestTimeout = 30000 } = options;\n url = new URL(url.toString());\n url = applyParameters(url, queryParameters);\n options = applyTimeout(options, requestTimeout);\n return fetch_retry(url.toString(), 3, {\n ...options,\n headers: new cross_fetch_1.Headers({\n 'Content-Type': 'application/json; charset=utf-8',\n /* LEGACY-BROWSER-SUPPORT-START */\n ...userAgentHeader(),\n /* LEGACY-BROWSER-SUPPORT-END */\n ...options.headers,\n }),\n });\n}\nexports.request = request;\nfunction fetch_retry(url, retries, options) {\n return new Promise((resolve, reject) => {\n (0, cross_fetch_1.default)(url, options)\n .then(response => {\n // We don't want to `reject` when retries have finished\n // Instead simply stop trying and return.\n if (retries === 0)\n return resolve(response);\n if (response.status === 429) {\n const { retryTimeout = 20000 } = options;\n retryTimeoutPromise(retryTimeout).then(() => {\n fetch_retry(url, retries - 1, options)\n .then(resolve)\n .catch(reject);\n });\n }\n else {\n clearTimeout(options.requestTimer);\n resolve(response);\n }\n })\n .catch(reject);\n });\n}\nconst retryTimeoutPromise = (milliseconds) => {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n};\nfunction userAgentHeader() {\n if (browser_or_node_1.isNode) {\n return {\n 'User-Agent': `pdjs/${VERSION} (${process.version}/${process.platform})`,\n };\n }\n else if (browser_or_node_1.isWebWorker) {\n return {\n 'User-Agent': `pdjs/${VERSION} (WebWorker)`,\n };\n }\n else if (browser_or_node_1.isJsDom) {\n return {\n 'User-Agent': `pdjs/${VERSION} (JsDom)`,\n };\n }\n else if (browser_or_node_1.isDeno) {\n return {\n 'User-Agent': `pdjs/${VERSION} (Deno)`,\n };\n }\n else if (browser_or_node_1.isBrowser) {\n return {\n // Note: This will not work consistently for all browsers as some silently drop the userAgent Header.\n 'User-Agent': `pdjs/${VERSION} (${window.navigator.userAgent})`,\n };\n }\n else {\n return {};\n }\n}\nfunction applyParameters(url, queryParameters) {\n if (!queryParameters)\n return url;\n const combinedParameters = url.searchParams;\n for (const key of Object.keys(queryParameters)) {\n const parameter = queryParameters[key];\n if (Array.isArray(parameter)) {\n // Support for array based keys like `additional_fields[]`\n parameter.forEach(item => {\n combinedParameters.append(key, item);\n });\n }\n else {\n combinedParameters.append(key, parameter);\n }\n }\n url.search = combinedParameters.toString();\n return url;\n}\nfunction applyTimeout(init, timeout) {\n if (!timeout)\n return init;\n const timer = setTimeout(() => { }, timeout);\n return {\n ...init,\n requestTimer: timer,\n };\n}\n//# sourceMappingURL=common.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.change = exports.resolve = exports.acknowledge = exports.trigger = exports.event = void 0;\nconst common_1 = require(\"./common\");\nfunction event(eventParameters) {\n const { server = 'events.pagerduty.com', type = 'event', data, ...config } = eventParameters;\n let url = `https://${server}/v2/enqueue`;\n if (type === 'change') {\n url = `https://${server}/v2/change/enqueue`;\n }\n return eventFetch(url, {\n method: 'POST',\n body: JSON.stringify(data),\n ...config,\n });\n}\nexports.event = event;\nconst shorthand = (action) => (eventParameters) => {\n const typeField = 'event_action';\n return event({\n ...eventParameters,\n data: {\n ...eventParameters.data,\n [typeField]: action,\n },\n });\n};\nexports.trigger = shorthand('trigger');\nexports.acknowledge = shorthand('acknowledge');\nexports.resolve = shorthand('resolve');\nconst change = (eventParameters) => event({ ...eventParameters, type: 'change' });\nexports.change = change;\nfunction eventFetch(url, options) {\n return (0, common_1.request)(url, options).then((response) => {\n const apiResponse = response;\n return response.json().then((data) => {\n apiResponse.data = data;\n apiResponse.response = response;\n return apiResponse;\n });\n });\n}\n//# sourceMappingURL=events.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolve = exports.acknowledge = exports.trigger = exports.change = exports.event = exports.api = void 0;\nvar api_1 = require(\"./api\");\nObject.defineProperty(exports, \"api\", { enumerable: true, get: function () { return api_1.api; } });\nvar events_1 = require(\"./events\");\nObject.defineProperty(exports, \"event\", { enumerable: true, get: function () { return events_1.event; } });\nObject.defineProperty(exports, \"change\", { enumerable: true, get: function () { return events_1.change; } });\nObject.defineProperty(exports, \"trigger\", { enumerable: true, get: function () { return events_1.trigger; } });\nObject.defineProperty(exports, \"acknowledge\", { enumerable: true, get: function () { return events_1.acknowledge; } });\nObject.defineProperty(exports, \"resolve\", { enumerable: true, get: function () { return events_1.resolve; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IncomingWebhook = void 0;\nconst axios_1 = __importDefault(require(\"axios\"));\nconst errors_1 = require(\"./errors\");\nconst instrument_1 = require(\"./instrument\");\n/**\n * A client for Slack's Incoming Webhooks\n */\nclass IncomingWebhook {\n constructor(url, defaults = {\n timeout: 0,\n }) {\n if (url === undefined) {\n throw new Error('Incoming webhook URL is required');\n }\n this.url = url;\n this.defaults = defaults;\n this.axios = axios_1.default.create({\n baseURL: url,\n httpAgent: defaults.agent,\n httpsAgent: defaults.agent,\n maxRedirects: 0,\n proxy: false,\n timeout: defaults.timeout,\n headers: {\n 'User-Agent': (0, instrument_1.getUserAgent)(),\n },\n });\n delete this.defaults.agent;\n }\n /**\n * Send a notification to a conversation\n * @param message - the message (a simple string, or an object describing the message)\n */\n async send(message) {\n // NOTE: no support for TLS config\n let payload = Object.assign({}, this.defaults);\n if (typeof message === 'string') {\n payload.text = message;\n }\n else {\n payload = Object.assign(payload, message);\n }\n try {\n const response = await this.axios.post(this.url, payload);\n return this.buildResult(response);\n }\n catch (error) {\n // Wrap errors in this packages own error types (abstract the implementation details' types)\n if (error.response !== undefined) {\n throw (0, errors_1.httpErrorWithOriginal)(error);\n }\n else if (error.request !== undefined) {\n throw (0, errors_1.requestErrorWithOriginal)(error);\n }\n else {\n throw error;\n }\n }\n }\n /**\n * Processes an HTTP response into an IncomingWebhookResult.\n */\n // eslint-disable-next-line class-methods-use-this\n buildResult(response) {\n return {\n text: response.data,\n };\n }\n}\nexports.IncomingWebhook = IncomingWebhook;\n//# sourceMappingURL=IncomingWebhook.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.httpErrorWithOriginal = exports.requestErrorWithOriginal = exports.ErrorCode = void 0;\n/**\n * A dictionary of codes for errors produced by this package\n */\nvar ErrorCode;\n(function (ErrorCode) {\n ErrorCode[\"RequestError\"] = \"slack_webhook_request_error\";\n ErrorCode[\"HTTPError\"] = \"slack_webhook_http_error\";\n})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));\n/**\n * Factory for producing a {@link CodedError} from a generic error\n */\nfunction errorWithCode(error, code) {\n // NOTE: might be able to return something more specific than a CodedError with conditional typing\n const codedError = error;\n codedError.code = code;\n return codedError;\n}\n/**\n * A factory to create IncomingWebhookRequestError objects\n * @param original The original error\n */\nfunction requestErrorWithOriginal(original) {\n const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError);\n error.original = original;\n return error;\n}\nexports.requestErrorWithOriginal = requestErrorWithOriginal;\n/**\n * A factory to create IncomingWebhookHTTPError objects\n * @param original The original error\n */\nfunction httpErrorWithOriginal(original) {\n const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${original.response.status}`), ErrorCode.HTTPError);\n error.original = original;\n return error;\n}\nexports.httpErrorWithOriginal = httpErrorWithOriginal;\n//# sourceMappingURL=errors.js.map","\"use strict\";\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorCode = exports.IncomingWebhook = void 0;\nvar IncomingWebhook_1 = require(\"./IncomingWebhook\");\nObject.defineProperty(exports, \"IncomingWebhook\", { enumerable: true, get: function () { return IncomingWebhook_1.IncomingWebhook; } });\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"ErrorCode\", { enumerable: true, get: function () { return errors_1.ErrorCode; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getUserAgent = exports.addAppMetadata = void 0;\nconst os = __importStar(require(\"os\"));\nconst packageJson = require('../package.json'); // eslint-disable-line import/no-commonjs, @typescript-eslint/no-var-requires\n/**\n * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.\n */\nfunction replaceSlashes(s) {\n return s.replace('/', ':');\n}\nconst baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` +\n `node/${process.version.replace('v', '')} ` +\n `${os.platform()}/${os.release()}`;\nconst appMetadata = {};\n/**\n * Appends the app metadata into the User-Agent value\n * @param appMetadata.name name of tool to be counted in instrumentation\n * @param appMetadata.version version of tool to be counted in instrumentation\n */\nfunction addAppMetadata({ name, version }) {\n appMetadata[replaceSlashes(name)] = version;\n}\nexports.addAppMetadata = addAppMetadata;\n/**\n * Returns the current User-Agent value for instrumentation\n */\nfunction getUserAgent() {\n const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' ');\n // only prepend the appIdentifier when its not empty\n return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent;\n}\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=instrument.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoginRequestResponse = exports.ErrorResponse = exports.SuccessResponse = exports.ActivityResponse = exports.ActivityRequestError = exports.ActivityRequestTrigger = void 0;\nvar ActivityRequestTrigger;\n(function (ActivityRequestTrigger) {\n ActivityRequestTrigger[\"Automatic\"] = \"automatic\";\n ActivityRequestTrigger[\"Manual\"] = \"manual\";\n})(ActivityRequestTrigger = exports.ActivityRequestTrigger || (exports.ActivityRequestTrigger = {}));\nvar ActivityRequestError = /** @class */ (function () {\n function ActivityRequestError(code, message) {\n this.code = code;\n this.message = message;\n }\n return ActivityRequestError;\n}());\nexports.ActivityRequestError = ActivityRequestError;\nvar ActivityResponse = /** @class */ (function () {\n function ActivityResponse(request) {\n this.request = request;\n }\n return ActivityResponse;\n}());\nexports.ActivityResponse = ActivityResponse;\nvar SuccessResponse = /** @class */ (function (_super) {\n __extends(SuccessResponse, _super);\n function SuccessResponse(request, rawContent) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this.rawContent = rawContent;\n return _this;\n }\n return SuccessResponse;\n}(ActivityResponse));\nexports.SuccessResponse = SuccessResponse;\nvar ErrorResponse = /** @class */ (function (_super) {\n __extends(ErrorResponse, _super);\n function ErrorResponse(request, error) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this.error = error;\n return _this;\n }\n return ErrorResponse;\n}(ActivityResponse));\nexports.ErrorResponse = ErrorResponse;\nvar LoginRequestResponse = /** @class */ (function (_super) {\n __extends(LoginRequestResponse, _super);\n function LoginRequestResponse(request, _auth) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this._auth = _auth;\n for (var _i = 0, _a = _this._auth.buttons; _i < _a.length; _i++) {\n var button = _a[_i];\n if (button.type === \"signin\" && button.value !== undefined) {\n try {\n new URL(button.value);\n _this.signinButton = button;\n break;\n }\n catch (e) {\n // Ignore parsing error\n }\n }\n }\n return _this;\n }\n Object.defineProperty(LoginRequestResponse.prototype, \"tokenExchangeResource\", {\n get: function () {\n return this._auth.tokenExchangeResource;\n },\n enumerable: false,\n configurable: true\n });\n return LoginRequestResponse;\n}(ActivityResponse));\nexports.LoginRequestResponse = LoginRequestResponse;\n//# sourceMappingURL=activity-request.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdaptiveApplet = void 0;\nvar Enums = require(\"./enums\");\nvar Utils = require(\"./utils\");\nvar shared_1 = require(\"./shared\");\nvar activity_request_1 = require(\"./activity-request\");\nvar strings_1 = require(\"./strings\");\nvar card_elements_1 = require(\"./card-elements\");\nvar serialization_1 = require(\"./serialization\");\nfunction logEvent(level, message) {\n var optionalParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n optionalParams[_i - 2] = arguments[_i];\n }\n if (shared_1.GlobalSettings.applets.logEnabled) {\n if (shared_1.GlobalSettings.applets.onLogEvent) {\n shared_1.GlobalSettings.applets.onLogEvent(level, message, optionalParams);\n }\n else {\n switch (level) {\n case Enums.LogLevel.Warning:\n console.warn(message, optionalParams);\n break;\n case Enums.LogLevel.Error:\n console.error(message, optionalParams);\n break;\n default:\n console.log(message, optionalParams);\n break;\n }\n }\n }\n}\nvar ActivityRequest = /** @class */ (function () {\n function ActivityRequest(action, trigger, consecutiveRefreshes) {\n this.action = action;\n this.trigger = trigger;\n this.consecutiveRefreshes = consecutiveRefreshes;\n this.attemptNumber = 0;\n }\n ActivityRequest.prototype.retryAsync = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.onSend) {\n this.onSend(this);\n }\n return [2 /*return*/];\n });\n });\n };\n return ActivityRequest;\n}());\nvar AdaptiveApplet = /** @class */ (function () {\n function AdaptiveApplet() {\n this._allowAutomaticCardUpdate = false;\n this.renderedElement = document.createElement(\"div\");\n this.renderedElement.className = \"aaf-cardHost\";\n this.renderedElement.style.position = \"relative\";\n this.renderedElement.style.display = \"flex\";\n this.renderedElement.style.flexDirection = \"column\";\n this._cardHostElement = document.createElement(\"div\");\n this._refreshButtonHostElement = document.createElement(\"div\");\n this._refreshButtonHostElement.className = \"aaf-refreshButtonHost\";\n this._refreshButtonHostElement.style.display = \"none\";\n this.renderedElement.appendChild(this._cardHostElement);\n this.renderedElement.appendChild(this._refreshButtonHostElement);\n }\n AdaptiveApplet.prototype.displayCard = function (card) {\n if (card.renderedElement) {\n Utils.clearElementChildren(this._cardHostElement);\n this._refreshButtonHostElement.style.display = \"none\";\n this._cardHostElement.appendChild(card.renderedElement);\n }\n else {\n throw new Error(\"displayCard: undefined card.\");\n }\n };\n AdaptiveApplet.prototype.showManualRefreshButton = function (refreshAction) {\n var _this = this;\n var displayBuiltInManualRefreshButton = this.onShowManualRefreshButton ? this.onShowManualRefreshButton(this) : true;\n if (displayBuiltInManualRefreshButton) {\n this._refreshButtonHostElement.style.display = \"none\";\n var renderedRefreshButton = undefined;\n if (this.onRenderManualRefreshButton) {\n renderedRefreshButton = this.onRenderManualRefreshButton(this);\n }\n else {\n var message = strings_1.Strings.runtime.refreshThisCard();\n if (shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Automatic) {\n var autoRefreshPausedMessage = strings_1.Strings.runtime.automaticRefreshPaused();\n if (autoRefreshPausedMessage[autoRefreshPausedMessage.length - 1] !== \" \") {\n autoRefreshPausedMessage += \" \";\n }\n message = strings_1.Strings.runtime.clckToRestartAutomaticRefresh();\n }\n var cardPayload = {\n type: \"AdaptiveCard\",\n version: \"1.2\",\n body: [\n {\n type: \"RichTextBlock\",\n horizontalAlignment: \"right\",\n inlines: [\n {\n type: \"TextRun\",\n text: message,\n selectAction: {\n type: \"Action.Submit\",\n id: \"refreshCard\"\n }\n }\n ]\n }\n ]\n };\n var card = new card_elements_1.AdaptiveCard();\n card.parse(cardPayload, new card_elements_1.SerializationContext(serialization_1.Versions.v1_2));\n card.onExecuteAction = function (action) {\n if (action.id === \"refreshCard\") {\n Utils.clearElementChildren(_this._refreshButtonHostElement);\n _this.internalExecuteAction(refreshAction, activity_request_1.ActivityRequestTrigger.Automatic, 0);\n }\n };\n renderedRefreshButton = card.render();\n }\n if (renderedRefreshButton) {\n Utils.clearElementChildren(this._refreshButtonHostElement);\n this._refreshButtonHostElement.appendChild(renderedRefreshButton);\n this._refreshButtonHostElement.style.removeProperty(\"display\");\n }\n }\n };\n AdaptiveApplet.prototype.createActivityRequest = function (action, trigger, consecutiveRefreshes) {\n var _this = this;\n if (this.card) {\n var request_1 = new ActivityRequest(action, trigger, consecutiveRefreshes);\n request_1.onSend = function (sender) {\n sender.attemptNumber++;\n _this.internalSendActivityRequestAsync(request_1);\n };\n var cancel = this.onPrepareActivityRequest ? !this.onPrepareActivityRequest(this, request_1, action) : false;\n return cancel ? undefined : request_1;\n }\n else {\n throw new Error(\"createActivityRequest: no card has been set.\");\n }\n };\n AdaptiveApplet.prototype.createMagicCodeInputCard = function (attemptNumber) {\n var payload = {\n type: \"AdaptiveCard\",\n version: \"1.0\",\n body: [\n {\n type: \"TextBlock\",\n color: \"attention\",\n text: attemptNumber === 1 ? undefined : \"That didn't work... let's try again.\",\n wrap: true,\n horizontalAlignment: \"center\"\n },\n {\n type: \"TextBlock\",\n text: \"Please login in the popup. You will obtain a magic code. Paste that code below and select \\\"Submit\\\"\",\n wrap: true,\n horizontalAlignment: \"center\"\n },\n {\n type: \"Input.Text\",\n id: \"magicCode\",\n placeholder: \"Enter magic code\"\n },\n {\n type: \"ActionSet\",\n horizontalAlignment: \"center\",\n actions: [\n {\n type: \"Action.Submit\",\n id: AdaptiveApplet.submitMagicCodeActionId,\n title: \"Submit\"\n },\n {\n type: \"Action.Submit\",\n id: AdaptiveApplet.cancelMagicCodeAuthActionId,\n title: \"Cancel\"\n }\n ]\n }\n ]\n };\n var card = new card_elements_1.AdaptiveCard();\n card.parse(payload);\n return card;\n };\n AdaptiveApplet.prototype.cancelAutomaticRefresh = function () {\n if (this._allowAutomaticCardUpdate) {\n logEvent(Enums.LogLevel.Warning, \"Automatic card refresh has been cancelled as a result of the user interacting with the card.\");\n }\n this._allowAutomaticCardUpdate = false;\n };\n AdaptiveApplet.prototype.createSerializationContext = function () {\n return this.onCreateSerializationContext ? this.onCreateSerializationContext(this) : new card_elements_1.SerializationContext();\n };\n AdaptiveApplet.prototype.internalSetCard = function (payload, consecutiveRefreshes) {\n var _this = this;\n if (typeof payload === \"object\" && payload[\"type\"] === \"AdaptiveCard\") {\n this._cardPayload = payload;\n }\n if (this._cardPayload) {\n try {\n var card = new card_elements_1.AdaptiveCard();\n if (this.hostConfig) {\n card.hostConfig = this.hostConfig;\n }\n var serializationContext = this.createSerializationContext();\n card.parse(this._cardPayload, serializationContext);\n var doChangeCard = this.onCardChanging ? this.onCardChanging(this, this._cardPayload) : true;\n if (doChangeCard) {\n this._card = card;\n if (this._card.authentication && this._card.authentication.tokenExchangeResource && this.onPrefetchSSOToken) {\n this.onPrefetchSSOToken(this, this._card.authentication.tokenExchangeResource);\n }\n this._card.onExecuteAction = function (action) {\n // If the user takes an action, cancel any pending automatic refresh\n _this.cancelAutomaticRefresh();\n _this.internalExecuteAction(action, activity_request_1.ActivityRequestTrigger.Manual, 0);\n };\n this._card.onInputValueChanged = function (input) {\n // If the user modifies an input, cancel any pending automatic refresh\n _this.cancelAutomaticRefresh();\n };\n this._card.render();\n if (this._card.renderedElement) {\n this.displayCard(this._card);\n if (this.onCardChanged) {\n this.onCardChanged(this);\n }\n if (this._card.refresh) {\n if (shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Automatic && consecutiveRefreshes < shared_1.GlobalSettings.applets.refresh.maximumConsecutiveAutomaticRefreshes) {\n if (shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes <= 0) {\n logEvent(Enums.LogLevel.Info, \"Triggering automatic card refresh number \" + (consecutiveRefreshes + 1));\n this.internalExecuteAction(this._card.refresh.action, activity_request_1.ActivityRequestTrigger.Automatic, consecutiveRefreshes + 1);\n }\n else {\n logEvent(Enums.LogLevel.Info, \"Scheduling automatic card refresh number \" + (consecutiveRefreshes + 1) + \" in \" + shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes + \"ms\");\n var action_1 = this._card.refresh.action;\n this._allowAutomaticCardUpdate = true;\n window.setTimeout(function () {\n if (_this._allowAutomaticCardUpdate) {\n _this.internalExecuteAction(action_1, activity_request_1.ActivityRequestTrigger.Automatic, consecutiveRefreshes + 1);\n }\n }, shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes);\n }\n }\n else if (shared_1.GlobalSettings.applets.refresh.mode !== Enums.RefreshMode.Disabled) {\n if (consecutiveRefreshes > 0) {\n logEvent(Enums.LogLevel.Warning, \"Stopping automatic refreshes after \" + consecutiveRefreshes + \" consecutive refreshes.\");\n }\n else {\n logEvent(Enums.LogLevel.Warning, \"The card has a refresh section, but automatic refreshes are disabled.\");\n }\n if (shared_1.GlobalSettings.applets.refresh.allowManualRefreshesAfterAutomaticRefreshes || shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Manual) {\n logEvent(Enums.LogLevel.Info, \"Showing manual refresh button.\");\n this.showManualRefreshButton(this._card.refresh.action);\n }\n }\n }\n }\n }\n }\n catch (error) {\n // Ignore all errors\n logEvent(Enums.LogLevel.Error, \"setCard: \" + error);\n }\n }\n };\n AdaptiveApplet.prototype.internalExecuteAction = function (action, trigger, consecutiveRefreshes) {\n if (action instanceof card_elements_1.ExecuteAction) {\n if (this.channelAdapter) {\n var request = this.createActivityRequest(action, trigger, consecutiveRefreshes);\n if (request) {\n request.retryAsync();\n }\n }\n else {\n throw new Error(\"internalExecuteAction: No channel adapter set.\");\n }\n }\n if (this.onAction) {\n this.onAction(this, action);\n }\n };\n AdaptiveApplet.prototype.createProgressOverlay = function (request) {\n if (!this._progressOverlay) {\n if (this.onCreateProgressOverlay) {\n this._progressOverlay = this.onCreateProgressOverlay(this, request);\n }\n else {\n this._progressOverlay = document.createElement(\"div\");\n this._progressOverlay.className = \"aaf-progress-overlay\";\n var spinner = document.createElement(\"div\");\n spinner.className = \"aaf-spinner\";\n spinner.style.width = \"28px\";\n spinner.style.height = \"28px\";\n this._progressOverlay.appendChild(spinner);\n }\n }\n return this._progressOverlay;\n };\n AdaptiveApplet.prototype.removeProgressOverlay = function (request) {\n if (this.onRemoveProgressOverlay) {\n this.onRemoveProgressOverlay(this, request);\n }\n if (this._progressOverlay !== undefined) {\n this.renderedElement.removeChild(this._progressOverlay);\n this._progressOverlay = undefined;\n }\n };\n AdaptiveApplet.prototype.activityRequestSucceeded = function (response, parsedContent) {\n if (this.onActivityRequestSucceeded) {\n this.onActivityRequestSucceeded(this, response, parsedContent);\n }\n };\n AdaptiveApplet.prototype.activityRequestFailed = function (response) {\n return this.onActivityRequestFailed ? this.onActivityRequestFailed(this, response) : shared_1.GlobalSettings.applets.defaultTimeBetweenRetryAttempts;\n };\n AdaptiveApplet.prototype.showAuthCodeInputDialog = function (request) {\n var _this = this;\n var showBuiltInAuthCodeInputCard = this.onShowAuthCodeInputDialog ? this.onShowAuthCodeInputDialog(this, request) : true;\n if (showBuiltInAuthCodeInputCard) {\n var authCodeInputCard = this.createMagicCodeInputCard(request.attemptNumber);\n authCodeInputCard.render();\n authCodeInputCard.onExecuteAction = function (submitMagicCodeAction) {\n if (_this.card && submitMagicCodeAction instanceof card_elements_1.SubmitAction) {\n switch (submitMagicCodeAction.id) {\n case AdaptiveApplet.submitMagicCodeActionId:\n var authCode = undefined;\n if (submitMagicCodeAction.data && typeof submitMagicCodeAction.data[\"magicCode\"] === \"string\") {\n authCode = submitMagicCodeAction.data[\"magicCode\"];\n }\n if (authCode) {\n _this.displayCard(_this.card);\n request.authCode = authCode;\n request.retryAsync();\n }\n else {\n alert(\"Please enter the magic code you received.\");\n }\n break;\n case AdaptiveApplet.cancelMagicCodeAuthActionId:\n logEvent(Enums.LogLevel.Warning, \"Authentication cancelled by user.\");\n _this.displayCard(_this.card);\n break;\n default:\n logEvent(Enums.LogLevel.Error, \"Unespected action taken from magic code input card (id = \" + submitMagicCodeAction.id + \")\");\n alert(strings_1.Strings.magicCodeInputCard.somethingWentWrong());\n break;\n }\n }\n };\n this.displayCard(authCodeInputCard);\n }\n };\n AdaptiveApplet.prototype.internalSendActivityRequestAsync = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var overlay, done, _loop_1, this_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.channelAdapter) {\n throw new Error(\"internalSendActivityRequestAsync: channelAdapter is not set.\");\n }\n overlay = this.createProgressOverlay(request);\n if (overlay !== undefined) {\n this.renderedElement.appendChild(overlay);\n }\n done = false;\n _loop_1 = function () {\n var response, error_1, parsedContent, retryIn_1, attemptOAuth, left, top_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n response = undefined;\n if (request.attemptNumber === 1) {\n logEvent(Enums.LogLevel.Info, \"Sending activity request to channel (attempt \" + request.attemptNumber + \")\");\n }\n else {\n logEvent(Enums.LogLevel.Info, \"Re-sending activity request to channel (attempt \" + request.attemptNumber + \")\");\n }\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this_1.channelAdapter.sendRequestAsync(request)];\n case 2:\n response = _b.sent();\n return [3 /*break*/, 4];\n case 3:\n error_1 = _b.sent();\n logEvent(Enums.LogLevel.Error, \"Activity request failed: \" + error_1);\n this_1.removeProgressOverlay(request);\n done = true;\n return [3 /*break*/, 4];\n case 4:\n if (!response) return [3 /*break*/, 10];\n if (!(response instanceof activity_request_1.SuccessResponse)) return [3 /*break*/, 5];\n this_1.removeProgressOverlay(request);\n if (response.rawContent === undefined) {\n throw new Error(\"internalSendActivityRequestAsync: Action.Execute result is undefined\");\n }\n parsedContent = response.rawContent;\n try {\n parsedContent = JSON.parse(response.rawContent);\n }\n catch (_c) {\n // Leave parseContent as is\n }\n if (typeof parsedContent === \"string\") {\n logEvent(Enums.LogLevel.Info, \"The activity request returned a string after \" + request.attemptNumber + \" attempt(s).\");\n this_1.activityRequestSucceeded(response, parsedContent);\n }\n else if (typeof parsedContent === \"object\" && parsedContent[\"type\"] === \"AdaptiveCard\") {\n logEvent(Enums.LogLevel.Info, \"The activity request returned an Adaptive Card after \" + request.attemptNumber + \" attempt(s).\");\n this_1.internalSetCard(parsedContent, request.consecutiveRefreshes);\n this_1.activityRequestSucceeded(response, this_1.card);\n }\n else {\n throw new Error(\"internalSendActivityRequestAsync: Action.Execute result is of unsupported type (\" + typeof response.rawContent + \")\");\n }\n done = true;\n return [3 /*break*/, 10];\n case 5:\n if (!(response instanceof activity_request_1.ErrorResponse)) return [3 /*break*/, 9];\n retryIn_1 = this_1.activityRequestFailed(response);\n if (!(retryIn_1 >= 0 && request.attemptNumber < shared_1.GlobalSettings.applets.maximumRetryAttempts)) return [3 /*break*/, 7];\n logEvent(Enums.LogLevel.Warning, \"Activity request failed: \" + response.error.message + \". Retrying in \" + retryIn_1 + \"ms\");\n request.attemptNumber++;\n return [4 /*yield*/, new Promise(function (resolve, reject) {\n window.setTimeout(function () { resolve(); }, retryIn_1);\n })];\n case 6:\n _b.sent();\n return [3 /*break*/, 8];\n case 7:\n logEvent(Enums.LogLevel.Error, \"Activity request failed: \" + response.error.message + \". Giving up after \" + request.attemptNumber + \" attempt(s)\");\n this_1.removeProgressOverlay(request);\n done = true;\n _b.label = 8;\n case 8: return [3 /*break*/, 10];\n case 9:\n if (response instanceof activity_request_1.LoginRequestResponse) {\n logEvent(Enums.LogLevel.Info, \"The activity request returned a LoginRequestResponse after \" + request.attemptNumber + \" attempt(s).\");\n if (request.attemptNumber <= shared_1.GlobalSettings.applets.maximumRetryAttempts) {\n attemptOAuth = true;\n if (response.tokenExchangeResource && this_1.onSSOTokenNeeded) {\n // Attempt to use SSO. The host will return true if it can handle SSO, in which case\n // we bypass OAuth\n attemptOAuth = !this_1.onSSOTokenNeeded(this_1, request, response.tokenExchangeResource);\n }\n if (attemptOAuth) {\n // Attempt to use OAuth\n this_1.removeProgressOverlay(request);\n if (response.signinButton === undefined) {\n throw new Error(\"internalSendActivityRequestAsync: the login request doesn't contain a valid signin URL.\");\n }\n logEvent(Enums.LogLevel.Info, \"Login required at \" + response.signinButton.value);\n if (this_1.onShowSigninPrompt) {\n // Bypass the built-in auth prompt if the host app handles it\n this_1.onShowSigninPrompt(this_1, request, response.signinButton);\n }\n else {\n this_1.showAuthCodeInputDialog(request);\n left = window.screenX + (window.outerWidth - shared_1.GlobalSettings.applets.authPromptWidth) / 2;\n top_1 = window.screenY + (window.outerHeight - shared_1.GlobalSettings.applets.authPromptHeight) / 2;\n window.open(response.signinButton.value, response.signinButton.title ? response.signinButton.title : \"Sign in\", \"width=\" + shared_1.GlobalSettings.applets.authPromptWidth + \",height=\" + shared_1.GlobalSettings.applets.authPromptHeight + \",left=\" + left + \",top=\" + top_1);\n }\n }\n }\n else {\n logEvent(Enums.LogLevel.Error, \"Authentication failed. Giving up after \" + request.attemptNumber + \" attempt(s)\");\n alert(strings_1.Strings.magicCodeInputCard.authenticationFailed());\n }\n return [2 /*return*/, \"break\"];\n }\n else {\n throw new Error(\"Unhandled response type: \" + response.toString());\n }\n _b.label = 10;\n case 10: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _a.label = 1;\n case 1:\n if (!!done) return [3 /*break*/, 3];\n return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 3];\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n AdaptiveApplet.prototype.refreshCard = function () {\n if (this._card && this._card.refresh) {\n this.internalExecuteAction(this._card.refresh.action, activity_request_1.ActivityRequestTrigger.Manual, 0);\n }\n };\n AdaptiveApplet.prototype.setCard = function (payload) {\n this.internalSetCard(payload, 0);\n };\n Object.defineProperty(AdaptiveApplet.prototype, \"card\", {\n get: function () {\n return this._card;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveApplet.submitMagicCodeActionId = \"submitMagicCode\";\n AdaptiveApplet.cancelMagicCodeAuthActionId = \"cancelMagicCodeAuth\";\n return AdaptiveApplet;\n}());\nexports.AdaptiveApplet = AdaptiveApplet;\n//# sourceMappingURL=adaptive-applet.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n__exportStar(require(\"./strings\"), exports);\n__exportStar(require(\"./enums\"), exports);\n__exportStar(require(\"./shared\"), exports);\n__exportStar(require(\"./utils\"), exports);\n__exportStar(require(\"./serialization\"), exports);\n__exportStar(require(\"./host-capabilities\"), exports);\n__exportStar(require(\"./host-config\"), exports);\n__exportStar(require(\"./registry\"), exports);\n__exportStar(require(\"./card-object\"), exports);\n__exportStar(require(\"./card-elements\"), exports);\n__exportStar(require(\"./table\"), exports);\n__exportStar(require(\"./channel-adapter\"), exports);\n__exportStar(require(\"./activity-request\"), exports);\n__exportStar(require(\"./adaptive-applet\"), exports);\n//# sourceMappingURL=adaptivecards.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SerializationContext = exports.AdaptiveCard = exports.Authentication = exports.TokenExchangeResource = exports.AuthCardButton = exports.RefreshDefinition = exports.RefreshActionProperty = exports.ContainerWithActions = exports.ColumnSet = exports.Column = exports.Container = exports.BackgroundImage = exports.ContainerBase = exports.StylableCardElementContainer = exports.ContainerStyleProperty = exports.ActionSet = exports.ShowCardAction = exports.HttpAction = exports.HttpHeader = exports.ToggleVisibilityAction = exports.OpenUrlAction = exports.ExecuteAction = exports.SubmitAction = exports.SubmitActionBase = exports.Action = exports.TimeInput = exports.TimeProperty = exports.DateInput = exports.NumberInput = exports.ChoiceSetInput = exports.Choice = exports.ToggleInput = exports.TextInput = exports.Input = exports.Media = exports.MediaSource = exports.ImageSet = exports.CardElementContainer = exports.Image = exports.FactSet = exports.Fact = exports.RichTextBlock = exports.TextRun = exports.TextBlock = exports.BaseTextBlock = exports.ActionProperty = exports.CardElement = exports.renderSeparation = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar shared_1 = require(\"./shared\");\nvar Utils = require(\"./utils\");\nvar host_config_1 = require(\"./host-config\");\nvar TextFormatters = require(\"./text-formatters\");\nvar card_object_1 = require(\"./card-object\");\nvar serialization_1 = require(\"./serialization\");\nvar registry_1 = require(\"./registry\");\nvar strings_1 = require(\"./strings\");\nvar controls_1 = require(\"./controls\");\nfunction renderSeparation(hostConfig, separationDefinition, orientation) {\n if (separationDefinition.spacing > 0 || (separationDefinition.lineThickness && separationDefinition.lineThickness > 0)) {\n var separator = document.createElement(\"div\");\n separator.className = hostConfig.makeCssClassName(\"ac-\" + (orientation == Enums.Orientation.Horizontal ? \"horizontal\" : \"vertical\") + \"-separator\");\n separator.setAttribute(\"aria-hidden\", \"true\");\n var color = separationDefinition.lineColor ? Utils.stringToCssColor(separationDefinition.lineColor) : \"\";\n if (orientation == Enums.Orientation.Horizontal) {\n if (separationDefinition.lineThickness) {\n separator.style.paddingTop = (separationDefinition.spacing / 2) + \"px\";\n separator.style.marginBottom = (separationDefinition.spacing / 2) + \"px\";\n separator.style.borderBottom = separationDefinition.lineThickness + \"px solid \" + color;\n }\n else {\n separator.style.height = separationDefinition.spacing + \"px\";\n }\n }\n else {\n if (separationDefinition.lineThickness) {\n separator.style.paddingLeft = (separationDefinition.spacing / 2) + \"px\";\n separator.style.marginRight = (separationDefinition.spacing / 2) + \"px\";\n separator.style.borderRight = separationDefinition.lineThickness + \"px solid \" + color;\n }\n else {\n separator.style.width = separationDefinition.spacing + \"px\";\n }\n }\n separator.style.overflow = \"hidden\";\n separator.style.flex = \"0 0 auto\";\n return separator;\n }\n else {\n return undefined;\n }\n}\nexports.renderSeparation = renderSeparation;\nvar CardElement = /** @class */ (function (_super) {\n __extends(CardElement, _super);\n function CardElement() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._truncatedDueToOverflow = false;\n return _this;\n }\n Object.defineProperty(CardElement.prototype, \"lang\", {\n get: function () {\n var lang = this.getValue(CardElement.langProperty);\n if (lang) {\n return lang;\n }\n else {\n if (this.parent) {\n return this.parent.lang;\n }\n else {\n return undefined;\n }\n }\n },\n set: function (value) {\n this.setValue(CardElement.langProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isVisible\", {\n get: function () {\n return this.getValue(CardElement.isVisibleProperty);\n },\n set: function (value) {\n // If the element is going to be hidden, reset any changes that were due\n // to overflow truncation (this ensures that if the element is later\n // un-hidden it has the right content)\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && !value) {\n this.undoOverflowTruncation();\n }\n if (this.isVisible !== value) {\n this.setValue(CardElement.isVisibleProperty, value);\n this.updateRenderedElementVisibility();\n if (this._renderedElement) {\n raiseElementVisibilityChangedEvent(this);\n }\n }\n if (this._renderedElement) {\n this._renderedElement.setAttribute(\"aria-expanded\", value.toString());\n }\n },\n enumerable: false,\n configurable: true\n });\n CardElement.prototype.internalRenderSeparator = function () {\n var renderedSeparator = renderSeparation(this.hostConfig, {\n spacing: this.hostConfig.getEffectiveSpacing(this.spacing),\n lineThickness: this.separator ? this.hostConfig.separator.lineThickness : undefined,\n lineColor: this.separator ? this.hostConfig.separator.lineColor : undefined\n }, this.separatorOrientation);\n if (shared_1.GlobalSettings.alwaysBleedSeparators && renderedSeparator && this.separatorOrientation == Enums.Orientation.Horizontal) {\n // Adjust separator's margins if the option to always bleed separators is turned on\n var parentContainer = this.getParentContainer();\n if (parentContainer && parentContainer.getEffectivePadding()) {\n var parentPhysicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(parentContainer.getEffectivePadding());\n renderedSeparator.style.marginLeft = \"-\" + parentPhysicalPadding.left + \"px\";\n renderedSeparator.style.marginRight = \"-\" + parentPhysicalPadding.right + \"px\";\n }\n }\n return renderedSeparator;\n };\n CardElement.prototype.updateRenderedElementVisibility = function () {\n var displayMode = this.isDesignMode() || this.isVisible ? this._defaultRenderedElementDisplayMode : \"none\";\n if (this._renderedElement) {\n if (displayMode) {\n this._renderedElement.style.display = displayMode;\n }\n else {\n this._renderedElement.style.removeProperty(\"display\");\n }\n }\n if (this._separatorElement) {\n if (this.parent && this.parent.isFirstElement(this)) {\n this._separatorElement.style.display = \"none\";\n }\n else {\n if (displayMode) {\n this._separatorElement.style.display = displayMode;\n }\n else {\n this._separatorElement.style.removeProperty(\"display\");\n }\n }\n }\n };\n CardElement.prototype.hideElementDueToOverflow = function () {\n if (this._renderedElement && this.isVisible) {\n this._renderedElement.style.visibility = \"hidden\";\n this.isVisible = false;\n raiseElementVisibilityChangedEvent(this, false);\n }\n };\n CardElement.prototype.showElementHiddenDueToOverflow = function () {\n if (this._renderedElement && !this.isVisible) {\n this._renderedElement.style.removeProperty(\"visibility\");\n this.isVisible = true;\n raiseElementVisibilityChangedEvent(this, false);\n }\n };\n // Marked private to emulate internal access\n CardElement.prototype.handleOverflow = function (maxHeight) {\n if (this.isVisible || this.isHiddenDueToOverflow()) {\n var handled = this.truncateOverflow(maxHeight);\n // Even if we were unable to truncate the element to fit this time,\n // it still could have been previously truncated\n this._truncatedDueToOverflow = handled || this._truncatedDueToOverflow;\n if (!handled) {\n this.hideElementDueToOverflow();\n }\n else if (handled && !this.isVisible) {\n this.showElementHiddenDueToOverflow();\n }\n }\n };\n // Marked private to emulate internal access\n CardElement.prototype.resetOverflow = function () {\n var sizeChanged = false;\n if (this._truncatedDueToOverflow) {\n this.undoOverflowTruncation();\n this._truncatedDueToOverflow = false;\n sizeChanged = true;\n }\n if (this.isHiddenDueToOverflow()) {\n this.showElementHiddenDueToOverflow();\n }\n return sizeChanged;\n };\n CardElement.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext();\n };\n CardElement.prototype.createPlaceholderElement = function () {\n var styleDefinition = this.getEffectiveStyleDefinition();\n var foregroundCssColor = Utils.stringToCssColor(styleDefinition.foregroundColors.default.subtle);\n var element = document.createElement(\"div\");\n element.style.border = \"1px dashed \" + foregroundCssColor;\n element.style.padding = \"4px\";\n element.style.minHeight = \"32px\";\n element.style.fontSize = \"10px\";\n element.style.color = foregroundCssColor;\n element.innerText = \"Empty \" + this.getJsonTypeName();\n return element;\n };\n CardElement.prototype.adjustRenderedElementSize = function (renderedElement) {\n if (this.height === \"auto\") {\n renderedElement.style.flex = \"0 0 auto\";\n }\n else {\n renderedElement.style.flex = \"1 1 auto\";\n }\n };\n CardElement.prototype.isDisplayed = function () {\n return this._renderedElement !== undefined && this.isVisible && this._renderedElement.offsetHeight > 0;\n };\n CardElement.prototype.overrideInternalRender = function () {\n return this.internalRender();\n };\n CardElement.prototype.applyPadding = function () {\n if (this.separatorElement && this.separatorOrientation === Enums.Orientation.Horizontal) {\n if (shared_1.GlobalSettings.alwaysBleedSeparators && !this.isBleeding()) {\n var padding = new shared_1.PaddingDefinition();\n this.getImmediateSurroundingPadding(padding);\n var physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n this.separatorElement.style.marginLeft = \"-\" + physicalPadding.left + \"px\";\n this.separatorElement.style.marginRight = \"-\" + physicalPadding.right + \"px\";\n }\n else {\n this.separatorElement.style.marginRight = \"0\";\n this.separatorElement.style.marginLeft = \"0\";\n }\n }\n };\n /*\n * Called when this element overflows the bottom of the card.\n * maxHeight will be the amount of space still available on the card (0 if\n * the element is fully off the card).\n */\n CardElement.prototype.truncateOverflow = function (maxHeight) {\n // Child implementations should return true if the element handled\n // the truncation request such that its content fits within maxHeight,\n // false if the element should fall back to being hidden\n return false;\n };\n /*\n * This should reverse any changes performed in truncateOverflow().\n */\n CardElement.prototype.undoOverflowTruncation = function () { };\n CardElement.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition();\n };\n CardElement.prototype.getHasBackground = function () {\n return false;\n };\n CardElement.prototype.getHasBorder = function () {\n return false;\n };\n CardElement.prototype.getPadding = function () {\n return this._padding;\n };\n CardElement.prototype.setPadding = function (value) {\n this._padding = value;\n };\n CardElement.prototype.shouldSerialize = function (context) {\n return context.elementRegistry.findByName(this.getJsonTypeName()) !== undefined;\n };\n Object.defineProperty(CardElement.prototype, \"useDefaultSizing\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"separatorOrientation\", {\n get: function () {\n return Enums.Orientation.Horizontal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"defaultStyle\", {\n get: function () {\n return Enums.ContainerStyle.Default;\n },\n enumerable: false,\n configurable: true\n });\n CardElement.prototype.parse = function (source, context) {\n _super.prototype.parse.call(this, source, context ? context : new SerializationContext());\n };\n CardElement.prototype.asString = function () {\n return \"\";\n };\n CardElement.prototype.isBleeding = function () {\n return false;\n };\n CardElement.prototype.getEffectiveStyle = function () {\n if (this.parent) {\n return this.parent.getEffectiveStyle();\n }\n return this.defaultStyle;\n };\n CardElement.prototype.getEffectiveStyleDefinition = function () {\n return this.hostConfig.containerStyles.getStyleByName(this.getEffectiveStyle());\n };\n CardElement.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.parent) {\n return this.parent.getEffectiveTextStyleDefinition();\n }\n return this.hostConfig.textStyles.default;\n };\n CardElement.prototype.getForbiddenActionTypes = function () {\n return [];\n };\n CardElement.prototype.getImmediateSurroundingPadding = function (result, processTop, processRight, processBottom, processLeft) {\n if (processTop === void 0) { processTop = true; }\n if (processRight === void 0) { processRight = true; }\n if (processBottom === void 0) { processBottom = true; }\n if (processLeft === void 0) { processLeft = true; }\n if (this.parent) {\n var doProcessTop = processTop && this.parent.isTopElement(this);\n var doProcessRight = processRight && this.parent.isRightMostElement(this);\n var doProcessBottom = processBottom && this.parent.isBottomElement(this);\n var doProcessLeft = processLeft && this.parent.isLeftMostElement(this);\n var effectivePadding = this.parent.getEffectivePadding();\n if (effectivePadding) {\n if (doProcessTop && effectivePadding.top != Enums.Spacing.None) {\n result.top = effectivePadding.top;\n doProcessTop = false;\n }\n if (doProcessRight && effectivePadding.right != Enums.Spacing.None) {\n result.right = effectivePadding.right;\n doProcessRight = false;\n }\n if (doProcessBottom && effectivePadding.bottom != Enums.Spacing.None) {\n result.bottom = effectivePadding.bottom;\n doProcessBottom = false;\n }\n if (doProcessLeft && effectivePadding.left != Enums.Spacing.None) {\n result.left = effectivePadding.left;\n doProcessLeft = false;\n }\n }\n if (doProcessTop || doProcessRight || doProcessBottom || doProcessLeft) {\n this.parent.getImmediateSurroundingPadding(result, doProcessTop, doProcessRight, doProcessBottom, doProcessLeft);\n }\n }\n };\n CardElement.prototype.getActionCount = function () {\n return 0;\n };\n CardElement.prototype.getActionAt = function (index) {\n throw new Error(strings_1.Strings.errors.indexOutOfRange(index));\n };\n CardElement.prototype.indexOfAction = function (action) {\n for (var i = 0; i < this.getActionCount(); i++) {\n if (this.getActionAt(i) === action) {\n return i;\n }\n }\n return -1;\n };\n CardElement.prototype.remove = function () {\n if (this.parent && this.parent instanceof CardElementContainer) {\n return this.parent.removeItem(this);\n }\n return false;\n };\n CardElement.prototype.render = function () {\n this._renderedElement = this.overrideInternalRender();\n this._separatorElement = this.internalRenderSeparator();\n if (this._renderedElement) {\n if (this.id) {\n this._renderedElement.id = this.id;\n }\n if (this.customCssSelector) {\n this._renderedElement.classList.add(this.customCssSelector);\n }\n this._renderedElement.style.boxSizing = \"border-box\";\n this._defaultRenderedElementDisplayMode = this._renderedElement.style.display ? this._renderedElement.style.display : undefined;\n this.adjustRenderedElementSize(this._renderedElement);\n this.updateLayout(false);\n }\n else if (this.isDesignMode()) {\n this._renderedElement = this.createPlaceholderElement();\n }\n return this._renderedElement;\n };\n CardElement.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n this.updateRenderedElementVisibility();\n this.applyPadding();\n };\n CardElement.prototype.indexOf = function (cardElement) {\n return -1;\n };\n CardElement.prototype.isDesignMode = function () {\n var rootElement = this.getRootElement();\n return rootElement instanceof AdaptiveCard && rootElement.designMode;\n };\n CardElement.prototype.isFirstElement = function (element) {\n return true;\n };\n CardElement.prototype.isLastElement = function (element) {\n return true;\n };\n CardElement.prototype.isAtTheVeryLeft = function () {\n return this.parent ? this.parent.isLeftMostElement(this) && this.parent.isAtTheVeryLeft() : true;\n };\n CardElement.prototype.isAtTheVeryRight = function () {\n return this.parent ? this.parent.isRightMostElement(this) && this.parent.isAtTheVeryRight() : true;\n };\n CardElement.prototype.isAtTheVeryTop = function () {\n return this.parent ? this.parent.isFirstElement(this) && this.parent.isAtTheVeryTop() : true;\n };\n CardElement.prototype.isAtTheVeryBottom = function () {\n return this.parent ? this.parent.isLastElement(this) && this.parent.isAtTheVeryBottom() : true;\n };\n CardElement.prototype.isBleedingAtTop = function () {\n return false;\n };\n CardElement.prototype.isBleedingAtBottom = function () {\n return false;\n };\n CardElement.prototype.isLeftMostElement = function (element) {\n return true;\n };\n CardElement.prototype.isRightMostElement = function (element) {\n return true;\n };\n CardElement.prototype.isTopElement = function (element) {\n return this.isFirstElement(element);\n };\n CardElement.prototype.isBottomElement = function (element) {\n return this.isLastElement(element);\n };\n CardElement.prototype.isHiddenDueToOverflow = function () {\n return this._renderedElement !== undefined && this._renderedElement.style.visibility == 'hidden';\n };\n CardElement.prototype.getRootElement = function () {\n return this.getRootObject();\n };\n CardElement.prototype.getParentContainer = function () {\n var currentElement = this.parent;\n while (currentElement) {\n if (currentElement instanceof Container) {\n return currentElement;\n }\n currentElement = currentElement.parent;\n }\n return undefined;\n };\n CardElement.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [];\n };\n CardElement.prototype.getResourceInformation = function () {\n return [];\n };\n CardElement.prototype.getElementById = function (id) {\n return this.id === id ? this : undefined;\n };\n CardElement.prototype.getActionById = function (id) {\n return undefined;\n };\n CardElement.prototype.getEffectivePadding = function () {\n var padding = this.getPadding();\n return padding ? padding : this.getDefaultPadding();\n };\n CardElement.prototype.getEffectiveHorizontalAlignment = function () {\n if (this.horizontalAlignment !== undefined) {\n return this.horizontalAlignment;\n }\n if (this.parent) {\n return this.parent.getEffectiveHorizontalAlignment();\n }\n return Enums.HorizontalAlignment.Left;\n };\n Object.defineProperty(CardElement.prototype, \"hostConfig\", {\n get: function () {\n if (this._hostConfig) {\n return this._hostConfig;\n }\n else {\n if (this.parent) {\n return this.parent.hostConfig;\n }\n else {\n return host_config_1.defaultHostConfig;\n }\n }\n },\n set: function (value) {\n this._hostConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"index\", {\n get: function () {\n if (this.parent) {\n return this.parent.indexOf(this);\n }\n else {\n return 0;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isInteractive\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isStandalone\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isInline\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"hasVisibleSeparator\", {\n get: function () {\n if (this.parent && this.separatorElement) {\n return !this.parent.isFirstElement(this) && (this.isVisible || this.isDesignMode());\n }\n else {\n return false;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"separatorElement\", {\n get: function () {\n return this._separatorElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n CardElement.langProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"lang\", true, /^[a-z]{2,3}$/ig);\n CardElement.isVisibleProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"isVisible\", true);\n CardElement.separatorProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"separator\", false);\n CardElement.heightProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_1, \"height\", [\n { value: \"auto\" },\n { value: \"stretch\" }\n ], \"auto\");\n CardElement.horizontalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"horizontalAlignment\", Enums.HorizontalAlignment);\n CardElement.spacingProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"spacing\", Enums.Spacing, Enums.Spacing.Default);\n __decorate([\n serialization_1.property(CardElement.horizontalAlignmentProperty)\n ], CardElement.prototype, \"horizontalAlignment\", void 0);\n __decorate([\n serialization_1.property(CardElement.spacingProperty)\n ], CardElement.prototype, \"spacing\", void 0);\n __decorate([\n serialization_1.property(CardElement.separatorProperty)\n ], CardElement.prototype, \"separator\", void 0);\n __decorate([\n serialization_1.property(CardElement.heightProperty)\n ], CardElement.prototype, \"height\", void 0);\n __decorate([\n serialization_1.property(CardElement.langProperty)\n ], CardElement.prototype, \"lang\", null);\n __decorate([\n serialization_1.property(CardElement.isVisibleProperty)\n ], CardElement.prototype, \"isVisible\", null);\n return CardElement;\n}(card_object_1.CardObject));\nexports.CardElement = CardElement;\nvar ActionProperty = /** @class */ (function (_super) {\n __extends(ActionProperty, _super);\n function ActionProperty(targetVersion, name, forbiddenActionTypes) {\n if (forbiddenActionTypes === void 0) { forbiddenActionTypes = []; }\n var _this = _super.call(this, targetVersion, name, undefined) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.forbiddenActionTypes = forbiddenActionTypes;\n return _this;\n }\n ActionProperty.prototype.parse = function (sender, source, context) {\n var parent = sender;\n return context.parseAction(parent, source[this.name], this.forbiddenActionTypes, parent.isDesignMode());\n };\n ActionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value ? value.toJSON(context) : undefined, undefined, true);\n };\n return ActionProperty;\n}(serialization_1.PropertyDefinition));\nexports.ActionProperty = ActionProperty;\nvar BaseTextBlock = /** @class */ (function (_super) {\n __extends(BaseTextBlock, _super);\n function BaseTextBlock(text) {\n var _this = _super.call(this) || this;\n _this.ariaHidden = false;\n if (text) {\n _this.text = text;\n }\n return _this;\n }\n BaseTextBlock.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n // selectAction is declared on BaseTextBlock but is only exposed on TextRun,\n // so the property is removed from the BaseTextBlock schema.\n schema.remove(BaseTextBlock.selectActionProperty);\n };\n Object.defineProperty(BaseTextBlock.prototype, \"text\", {\n get: function () {\n return this.getValue(BaseTextBlock.textProperty);\n },\n set: function (value) {\n this.setText(value);\n },\n enumerable: false,\n configurable: true\n });\n //#endregion\n BaseTextBlock.prototype.getFontSize = function (fontType) {\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n return fontType.fontSizes.small;\n case Enums.TextSize.Medium:\n return fontType.fontSizes.medium;\n case Enums.TextSize.Large:\n return fontType.fontSizes.large;\n case Enums.TextSize.ExtraLarge:\n return fontType.fontSizes.extraLarge;\n default:\n return fontType.fontSizes.default;\n }\n };\n BaseTextBlock.prototype.getColorDefinition = function (colorSet, color) {\n switch (color) {\n case Enums.TextColor.Accent:\n return colorSet.accent;\n case Enums.TextColor.Dark:\n return colorSet.dark;\n case Enums.TextColor.Light:\n return colorSet.light;\n case Enums.TextColor.Good:\n return colorSet.good;\n case Enums.TextColor.Warning:\n return colorSet.warning;\n case Enums.TextColor.Attention:\n return colorSet.attention;\n default:\n return colorSet.default;\n }\n };\n BaseTextBlock.prototype.setText = function (value) {\n this.setValue(BaseTextBlock.textProperty, value);\n };\n BaseTextBlock.prototype.init = function (textDefinition) {\n this.size = textDefinition.size;\n this.weight = textDefinition.weight;\n this.color = textDefinition.color;\n this.isSubtle = textDefinition.isSubtle;\n };\n BaseTextBlock.prototype.asString = function () {\n return this.text;\n };\n BaseTextBlock.prototype.applyStylesTo = function (targetElement) {\n var fontType = this.hostConfig.getFontTypeDefinition(this.effectiveFontType);\n if (fontType.fontFamily) {\n targetElement.style.fontFamily = fontType.fontFamily;\n }\n var fontSize;\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n fontSize = fontType.fontSizes.small;\n break;\n case Enums.TextSize.Medium:\n fontSize = fontType.fontSizes.medium;\n break;\n case Enums.TextSize.Large:\n fontSize = fontType.fontSizes.large;\n break;\n case Enums.TextSize.ExtraLarge:\n fontSize = fontType.fontSizes.extraLarge;\n break;\n default:\n fontSize = fontType.fontSizes.default;\n break;\n }\n targetElement.style.fontSize = fontSize + \"px\";\n var colorDefinition = this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors, this.effectiveColor);\n targetElement.style.color = Utils.stringToCssColor(this.effectiveIsSubtle ? colorDefinition.subtle : colorDefinition.default);\n var fontWeight;\n switch (this.effectiveWeight) {\n case Enums.TextWeight.Lighter:\n fontWeight = fontType.fontWeights.lighter;\n break;\n case Enums.TextWeight.Bolder:\n fontWeight = fontType.fontWeights.bolder;\n break;\n default:\n fontWeight = fontType.fontWeights.default;\n break;\n }\n targetElement.style.fontWeight = fontWeight.toString();\n if (this.ariaHidden) {\n targetElement.setAttribute(\"aria-hidden\", \"true\");\n }\n };\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveColor\", {\n get: function () {\n return this.color !== undefined ? this.color : this.getEffectiveTextStyleDefinition().color;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveFontType\", {\n get: function () {\n return this.fontType !== undefined ? this.fontType : this.getEffectiveTextStyleDefinition().fontType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveIsSubtle\", {\n get: function () {\n return this.isSubtle !== undefined ? this.isSubtle : this.getEffectiveTextStyleDefinition().isSubtle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveSize\", {\n get: function () {\n return this.size !== undefined ? this.size : this.getEffectiveTextStyleDefinition().size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveWeight\", {\n get: function () {\n return this.weight !== undefined ? this.weight : this.getEffectiveTextStyleDefinition().weight;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n BaseTextBlock.textProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"text\", true);\n BaseTextBlock.sizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"size\", Enums.TextSize);\n BaseTextBlock.weightProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"weight\", Enums.TextWeight);\n BaseTextBlock.colorProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"color\", Enums.TextColor);\n BaseTextBlock.isSubtleProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isSubtle\");\n BaseTextBlock.fontTypeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"fontType\", Enums.FontType);\n BaseTextBlock.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(BaseTextBlock.sizeProperty)\n ], BaseTextBlock.prototype, \"size\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.weightProperty)\n ], BaseTextBlock.prototype, \"weight\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.colorProperty)\n ], BaseTextBlock.prototype, \"color\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.fontTypeProperty)\n ], BaseTextBlock.prototype, \"fontType\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.isSubtleProperty)\n ], BaseTextBlock.prototype, \"isSubtle\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.textProperty)\n ], BaseTextBlock.prototype, \"text\", null);\n __decorate([\n serialization_1.property(BaseTextBlock.selectActionProperty)\n ], BaseTextBlock.prototype, \"selectAction\", void 0);\n return BaseTextBlock;\n}(CardElement));\nexports.BaseTextBlock = BaseTextBlock;\nvar TextBlock = /** @class */ (function (_super) {\n __extends(TextBlock, _super);\n function TextBlock() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.wrap = false;\n _this._treatAsPlainText = true;\n _this.useMarkdown = true;\n return _this;\n }\n TextBlock.prototype.restoreOriginalContent = function () {\n if (this.renderedElement !== undefined) {\n if (this.maxLines && this.maxLines > 0) {\n this.renderedElement.style.maxHeight = this._computedLineHeight * this.maxLines + \"px\";\n }\n this.renderedElement.innerHTML = this._originalInnerHtml;\n }\n };\n TextBlock.prototype.truncateIfSupported = function (maxHeight) {\n if (this.renderedElement !== undefined) {\n // For now, only truncate TextBlocks that contain just a single\n // paragraph -- since the maxLines calculation doesn't take into\n // account Markdown lists\n var children = this.renderedElement.children;\n var isTextOnly = !children.length;\n var truncationSupported = isTextOnly || children.length == 1 && children[0].tagName.toLowerCase() == 'p';\n if (truncationSupported) {\n var element = isTextOnly ? this.renderedElement : children[0];\n Utils.truncate(element, maxHeight, this._computedLineHeight);\n return true;\n }\n }\n return false;\n };\n TextBlock.prototype.setText = function (value) {\n _super.prototype.setText.call(this, value);\n this._processedText = undefined;\n };\n TextBlock.prototype.internalRender = function () {\n var _this = this;\n this._processedText = undefined;\n if (this.text) {\n var preProcessedText = this.preProcessPropertyValue(BaseTextBlock.textProperty);\n var hostConfig = this.hostConfig;\n var element = void 0;\n if (this.forElementId) {\n var labelElement = document.createElement(\"label\");\n labelElement.htmlFor = this.forElementId;\n element = labelElement;\n }\n else {\n element = document.createElement(\"div\");\n }\n element.classList.add(hostConfig.makeCssClassName(\"ac-textBlock\"));\n element.style.overflow = \"hidden\";\n this.applyStylesTo(element);\n if (this.style === \"heading\") {\n element.setAttribute(\"role\", \"heading\");\n var headingLevel = this.hostConfig.textBlock.headingLevel;\n if (headingLevel !== undefined && headingLevel > 0) {\n element.setAttribute(\"aria-level\", headingLevel.toString());\n }\n }\n if (this.selectAction && hostConfig.supportsInteractivity) {\n element.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(element);\n if (this.selectAction.isEnabled) {\n element.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n if (!this._processedText) {\n this._treatAsPlainText = true;\n var formattedText = TextFormatters.formatText(this.lang, preProcessedText);\n if (this.useMarkdown && formattedText) {\n if (shared_1.GlobalSettings.allowMarkForTextHighlighting) {\n formattedText = formattedText.replace(//g, \"===\").replace(/<\\/mark>/g, \"/==/\");\n }\n var markdownProcessingResult = AdaptiveCard.applyMarkdown(formattedText);\n if (markdownProcessingResult.didProcess && markdownProcessingResult.outputHtml) {\n this._processedText = markdownProcessingResult.outputHtml;\n this._treatAsPlainText = false;\n // Only process tag if markdown processing was applied because\n // markdown processing is also responsible for sanitizing the input string\n if (shared_1.GlobalSettings.allowMarkForTextHighlighting && this._processedText) {\n var markStyle = \"\";\n var effectiveStyle = this.getEffectiveStyleDefinition();\n if (effectiveStyle.highlightBackgroundColor) {\n markStyle += \"background-color: \" + effectiveStyle.highlightBackgroundColor + \";\";\n }\n if (effectiveStyle.highlightForegroundColor) {\n markStyle += \"color: \" + effectiveStyle.highlightForegroundColor + \";\";\n }\n if (markStyle) {\n markStyle = 'style=\"' + markStyle + '\"';\n }\n this._processedText = this._processedText.replace(/===/g, \"\").replace(/\\/==\\//g, \"\");\n }\n }\n else {\n this._processedText = formattedText;\n this._treatAsPlainText = true;\n }\n }\n else {\n this._processedText = formattedText;\n this._treatAsPlainText = true;\n }\n }\n if (!this._processedText) {\n this._processedText = \"\";\n }\n if (this._treatAsPlainText) {\n element.innerText = this._processedText;\n }\n else {\n element.innerHTML = this._processedText;\n }\n if (element.firstElementChild instanceof HTMLElement) {\n var firstElementChild = element.firstElementChild;\n firstElementChild.style.marginTop = \"0px\";\n firstElementChild.style.width = \"100%\";\n if (!this.wrap) {\n firstElementChild.style.overflow = \"hidden\";\n firstElementChild.style.textOverflow = \"ellipsis\";\n }\n }\n if (element.lastElementChild instanceof HTMLElement) {\n element.lastElementChild.style.marginBottom = \"0px\";\n }\n var anchors = element.getElementsByTagName(\"a\");\n for (var i = 0; i < anchors.length; i++) {\n var anchor = anchors[i];\n anchor.classList.add(hostConfig.makeCssClassName(\"ac-anchor\"));\n anchor.target = \"_blank\";\n anchor.onclick = function (e) {\n if (raiseAnchorClickedEvent(_this, e.target, e)) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n };\n anchor.oncontextmenu = function (e) {\n if (raiseAnchorClickedEvent(_this, e.target, e)) {\n e.preventDefault();\n e.cancelBubble = true;\n return false;\n }\n return true;\n };\n }\n if (this.wrap) {\n element.style.wordWrap = \"break-word\";\n if (this.maxLines && this.maxLines > 0) {\n element.style.overflow = \"hidden\";\n if (Utils.isInternetExplorer() || !shared_1.GlobalSettings.useWebkitLineClamp) {\n element.style.maxHeight = (this._computedLineHeight * this.maxLines) + \"px\";\n }\n else {\n // While non standard, --webkit-line-clamp works in every browser (except IE)\n // and is a great solution to support the maxLines feature with ellipsis\n // truncation. With --webkit-line-clamp there is need to use explicit line heights\n element.style.removeProperty(\"line-height\");\n element.style.display = \"-webkit-box\";\n element.style.webkitBoxOrient = \"vertical\";\n element.style.webkitLineClamp = this.maxLines.toString();\n }\n }\n }\n else {\n element.style.whiteSpace = \"nowrap\";\n element.style.textOverflow = \"ellipsis\";\n }\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation || shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n this._originalInnerHtml = element.innerHTML;\n }\n return element;\n }\n else {\n return undefined;\n }\n };\n TextBlock.prototype.truncateOverflow = function (maxHeight) {\n if (maxHeight >= this._computedLineHeight) {\n return this.truncateIfSupported(maxHeight);\n }\n return false;\n };\n TextBlock.prototype.undoOverflowTruncation = function () {\n this.restoreOriginalContent();\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation && this.maxLines) {\n var maxHeight = this._computedLineHeight * this.maxLines;\n this.truncateIfSupported(maxHeight);\n }\n };\n TextBlock.prototype.applyStylesTo = function (targetElement) {\n _super.prototype.applyStylesTo.call(this, targetElement);\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n targetElement.style.textAlign = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n targetElement.style.textAlign = \"end\";\n break;\n default:\n targetElement.style.textAlign = \"start\";\n break;\n }\n var lineHeights = this.hostConfig.lineHeights;\n if (lineHeights) {\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n this._computedLineHeight = lineHeights.small;\n break;\n case Enums.TextSize.Medium:\n this._computedLineHeight = lineHeights.medium;\n break;\n case Enums.TextSize.Large:\n this._computedLineHeight = lineHeights.large;\n break;\n case Enums.TextSize.ExtraLarge:\n this._computedLineHeight = lineHeights.extraLarge;\n break;\n default:\n this._computedLineHeight = lineHeights.default;\n break;\n }\n }\n else {\n // Looks like 1.33 is the magic number to compute line-height\n // from font size.\n this._computedLineHeight = this.getFontSize(this.hostConfig.getFontTypeDefinition(this.effectiveFontType)) * 1.33;\n }\n targetElement.style.lineHeight = this._computedLineHeight + \"px\";\n };\n TextBlock.prototype.getJsonTypeName = function () {\n return \"TextBlock\";\n };\n TextBlock.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.style) {\n return this.hostConfig.textStyles.getStyleByName(this.style);\n }\n return _super.prototype.getEffectiveTextStyleDefinition.call(this);\n };\n TextBlock.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = false; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation && this.maxLines && this.isDisplayed()) {\n // Reset the element's innerHTML in case the available room for\n // content has increased\n this.restoreOriginalContent();\n this.truncateIfSupported(this._computedLineHeight * this.maxLines);\n }\n };\n TextBlock.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"wrap\", false);\n TextBlock.maxLinesProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"maxLines\");\n TextBlock.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_5, \"style\", [\n { value: \"default\" },\n { value: \"columnHeader\" },\n { value: \"heading\" }\n ]);\n __decorate([\n serialization_1.property(TextBlock.wrapProperty)\n ], TextBlock.prototype, \"wrap\", void 0);\n __decorate([\n serialization_1.property(TextBlock.maxLinesProperty)\n ], TextBlock.prototype, \"maxLines\", void 0);\n __decorate([\n serialization_1.property(TextBlock.styleProperty)\n ], TextBlock.prototype, \"style\", void 0);\n return TextBlock;\n}(BaseTextBlock));\nexports.TextBlock = TextBlock;\nvar TextRun = /** @class */ (function (_super) {\n __extends(TextRun, _super);\n function TextRun() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.italic = false;\n _this.strikethrough = false;\n _this.highlight = false;\n _this.underline = false;\n return _this;\n }\n TextRun.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.add(BaseTextBlock.selectActionProperty);\n };\n //#endregion\n TextRun.prototype.internalRender = function () {\n var _this = this;\n if (this.text) {\n var preProcessedText = this.preProcessPropertyValue(BaseTextBlock.textProperty);\n var hostConfig = this.hostConfig;\n var formattedText = TextFormatters.formatText(this.lang, preProcessedText);\n if (!formattedText) {\n formattedText = \"\";\n }\n var element = document.createElement(\"span\");\n element.classList.add(hostConfig.makeCssClassName(\"ac-textRun\"));\n this.applyStylesTo(element);\n if (this.selectAction && hostConfig.supportsInteractivity) {\n var anchor = document.createElement(\"a\");\n anchor.classList.add(hostConfig.makeCssClassName(\"ac-anchor\"));\n var href = this.selectAction.getHref();\n anchor.href = href ? href : \"\";\n anchor.target = \"_blank\";\n anchor.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(anchor);\n anchor.innerText = formattedText;\n element.appendChild(anchor);\n }\n else {\n element.innerText = formattedText;\n }\n return element;\n }\n else {\n return undefined;\n }\n };\n TextRun.prototype.applyStylesTo = function (targetElement) {\n _super.prototype.applyStylesTo.call(this, targetElement);\n if (this.italic) {\n targetElement.style.fontStyle = \"italic\";\n }\n if (this.strikethrough) {\n targetElement.style.textDecoration = \"line-through\";\n }\n if (this.highlight) {\n var colorDefinition = this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors, this.effectiveColor);\n targetElement.style.backgroundColor = Utils.stringToCssColor(this.effectiveIsSubtle ? colorDefinition.highlightColors.subtle : colorDefinition.highlightColors.default);\n }\n if (this.underline) {\n targetElement.style.textDecoration = \"underline\";\n }\n };\n TextRun.prototype.getJsonTypeName = function () {\n return \"TextRun\";\n };\n Object.defineProperty(TextRun.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextRun.prototype, \"isInline\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n TextRun.italicProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"italic\", false);\n TextRun.strikethroughProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"strikethrough\", false);\n TextRun.highlightProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"highlight\", false);\n TextRun.underlineProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"underline\", false);\n __decorate([\n serialization_1.property(TextRun.italicProperty)\n ], TextRun.prototype, \"italic\", void 0);\n __decorate([\n serialization_1.property(TextRun.strikethroughProperty)\n ], TextRun.prototype, \"strikethrough\", void 0);\n __decorate([\n serialization_1.property(TextRun.highlightProperty)\n ], TextRun.prototype, \"highlight\", void 0);\n __decorate([\n serialization_1.property(TextRun.underlineProperty)\n ], TextRun.prototype, \"underline\", void 0);\n return TextRun;\n}(BaseTextBlock));\nexports.TextRun = TextRun;\nvar RichTextBlock = /** @class */ (function (_super) {\n __extends(RichTextBlock, _super);\n function RichTextBlock() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._inlines = [];\n return _this;\n }\n RichTextBlock.prototype.internalAddInline = function (inline, forceAdd) {\n if (forceAdd === void 0) { forceAdd = false; }\n if (!inline.isInline) {\n throw new Error(strings_1.Strings.errors.elementCannotBeUsedAsInline());\n }\n var doAdd = inline.parent === undefined || forceAdd;\n if (!doAdd && inline.parent != this) {\n throw new Error(strings_1.Strings.errors.inlineAlreadyParented());\n }\n else {\n inline.setParent(this);\n this._inlines.push(inline);\n }\n };\n RichTextBlock.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._inlines = [];\n if (Array.isArray(source[\"inlines\"])) {\n for (var _i = 0, _a = source[\"inlines\"]; _i < _a.length; _i++) {\n var jsonInline = _a[_i];\n var inline = void 0;\n if (typeof jsonInline === \"string\") {\n var textRun = new TextRun();\n textRun.text = jsonInline;\n inline = textRun;\n }\n else {\n // No fallback for inlines in 1.2\n inline = context.parseElement(this, jsonInline, false);\n }\n if (inline) {\n this.internalAddInline(inline, true);\n }\n }\n }\n };\n RichTextBlock.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n if (this._inlines.length > 0) {\n var jsonInlines = [];\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n jsonInlines.push(inline.toJSON(context));\n }\n context.serializeValue(target, \"inlines\", jsonInlines);\n }\n };\n RichTextBlock.prototype.internalRender = function () {\n if (this._inlines.length > 0) {\n var element = void 0;\n if (this.forElementId) {\n var labelElement = document.createElement(\"label\");\n labelElement.htmlFor = this.forElementId;\n element = labelElement;\n }\n else {\n element = document.createElement(\"div\");\n }\n element.className = this.hostConfig.makeCssClassName(\"ac-richTextBlock\");\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.textAlign = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.textAlign = \"end\";\n break;\n default:\n element.style.textAlign = \"start\";\n break;\n }\n var renderedInlines = 0;\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n var renderedInline = inline.render();\n if (renderedInline) {\n element.appendChild(renderedInline);\n renderedInlines++;\n }\n }\n if (renderedInlines > 0) {\n return element;\n }\n }\n return undefined;\n };\n RichTextBlock.prototype.asString = function () {\n var result = \"\";\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n result += inline.asString();\n }\n return result;\n };\n RichTextBlock.prototype.getJsonTypeName = function () {\n return \"RichTextBlock\";\n };\n RichTextBlock.prototype.getInlineCount = function () {\n return this._inlines.length;\n };\n RichTextBlock.prototype.getInlineAt = function (index) {\n if (index >= 0 && index < this._inlines.length) {\n return this._inlines[index];\n }\n else {\n throw new Error(strings_1.Strings.errors.indexOutOfRange(index));\n }\n };\n RichTextBlock.prototype.addInline = function (inline) {\n if (typeof inline === \"string\") {\n this.internalAddInline(new TextRun(inline));\n }\n else {\n this.internalAddInline(inline);\n }\n };\n RichTextBlock.prototype.removeInline = function (inline) {\n var index = this._inlines.indexOf(inline);\n if (index >= 0) {\n this._inlines[index].setParent(undefined);\n this._inlines.splice(index, 1);\n return true;\n }\n return false;\n };\n return RichTextBlock;\n}(CardElement));\nexports.RichTextBlock = RichTextBlock;\nvar Fact = /** @class */ (function (_super) {\n __extends(Fact, _super);\n function Fact(name, value) {\n var _this = _super.call(this) || this;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n //#endregion\n Fact.prototype.getSchemaKey = function () {\n return \"Fact\";\n };\n //#region Schema\n Fact.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Fact.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(Fact.titleProperty)\n ], Fact.prototype, \"name\", void 0);\n __decorate([\n serialization_1.property(Fact.valueProperty)\n ], Fact.prototype, \"value\", void 0);\n return Fact;\n}(serialization_1.SerializableObject));\nexports.Fact = Fact;\nvar FactSet = /** @class */ (function (_super) {\n __extends(FactSet, _super);\n function FactSet() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(FactSet.prototype, \"useDefaultSizing\", {\n //#endregion\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n FactSet.prototype.internalRender = function () {\n var element = undefined;\n var hostConfig = this.hostConfig;\n if (this.facts.length > 0) {\n element = document.createElement(\"table\");\n element.style.borderWidth = \"0px\";\n element.style.borderSpacing = \"0px\";\n element.style.borderStyle = \"none\";\n element.style.borderCollapse = \"collapse\";\n element.style.display = \"block\";\n element.style.overflow = \"hidden\";\n element.classList.add(hostConfig.makeCssClassName(\"ac-factset\"));\n element.setAttribute(\"role\", \"presentation\");\n for (var i = 0; i < this.facts.length; i++) {\n var trElement = document.createElement(\"tr\");\n if (i > 0) {\n trElement.style.marginTop = hostConfig.factSet.spacing + \"px\";\n }\n // Title column\n var tdElement = document.createElement(\"td\");\n tdElement.style.padding = \"0\";\n tdElement.classList.add(hostConfig.makeCssClassName(\"ac-fact-title\"));\n if (hostConfig.factSet.title.maxWidth) {\n tdElement.style.maxWidth = hostConfig.factSet.title.maxWidth + \"px\";\n }\n tdElement.style.verticalAlign = \"top\";\n var textBlock = new TextBlock();\n textBlock.setParent(this);\n textBlock.text = (!this.facts[i].name && this.isDesignMode()) ? \"Title\" : this.facts[i].name;\n textBlock.size = hostConfig.factSet.title.size;\n textBlock.color = hostConfig.factSet.title.color;\n textBlock.isSubtle = hostConfig.factSet.title.isSubtle;\n textBlock.weight = hostConfig.factSet.title.weight;\n textBlock.wrap = hostConfig.factSet.title.wrap;\n textBlock.spacing = Enums.Spacing.None;\n Utils.appendChild(tdElement, textBlock.render());\n Utils.appendChild(trElement, tdElement);\n // Spacer column\n tdElement = document.createElement(\"td\");\n tdElement.style.width = \"10px\";\n Utils.appendChild(trElement, tdElement);\n // Value column\n tdElement = document.createElement(\"td\");\n tdElement.style.padding = \"0\";\n tdElement.style.verticalAlign = \"top\";\n tdElement.classList.add(hostConfig.makeCssClassName(\"ac-fact-value\"));\n textBlock = new TextBlock();\n textBlock.setParent(this);\n textBlock.text = this.facts[i].value;\n textBlock.size = hostConfig.factSet.value.size;\n textBlock.color = hostConfig.factSet.value.color;\n textBlock.isSubtle = hostConfig.factSet.value.isSubtle;\n textBlock.weight = hostConfig.factSet.value.weight;\n textBlock.wrap = hostConfig.factSet.value.wrap;\n textBlock.spacing = Enums.Spacing.None;\n Utils.appendChild(tdElement, textBlock.render());\n Utils.appendChild(trElement, tdElement);\n Utils.appendChild(element, trElement);\n }\n }\n return element;\n };\n FactSet.prototype.getJsonTypeName = function () {\n return \"FactSet\";\n };\n //#region Schema\n FactSet.factsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"facts\", Fact);\n __decorate([\n serialization_1.property(FactSet.factsProperty)\n ], FactSet.prototype, \"facts\", void 0);\n return FactSet;\n}(CardElement));\nexports.FactSet = FactSet;\nvar ImageDimensionProperty = /** @class */ (function (_super) {\n __extends(ImageDimensionProperty, _super);\n function ImageDimensionProperty(targetVersion, name, internalName, fallbackProperty) {\n var _this = _super.call(this, targetVersion, name) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.internalName = internalName;\n _this.fallbackProperty = fallbackProperty;\n return _this;\n }\n ImageDimensionProperty.prototype.getInternalName = function () {\n return this.internalName;\n };\n ImageDimensionProperty.prototype.parse = function (sender, source, context) {\n var result = undefined;\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.defaultValue;\n }\n var isValid = false;\n if (typeof sourceValue === \"string\") {\n try {\n var size = shared_1.SizeAndUnit.parse(sourceValue, true);\n if (size.unit == Enums.SizeUnit.Pixel) {\n result = size.physicalSize;\n isValid = true;\n }\n }\n catch (_a) {\n // Swallow the exception\n }\n // If the source value isn't valid per this property definition,\n // check its validity per the fallback property, if specified\n if (!isValid && this.fallbackProperty) {\n isValid = this.fallbackProperty.isValidValue(sourceValue, context);\n }\n }\n if (!isValid) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n }\n return result;\n };\n ImageDimensionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, typeof value === \"number\" && !isNaN(value) ? value + \"px\" : undefined);\n };\n return ImageDimensionProperty;\n}(serialization_1.PropertyDefinition));\nvar Image = /** @class */ (function (_super) {\n __extends(Image, _super);\n function Image() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.size = Enums.Size.Auto;\n _this.style = Enums.ImageStyle.Default;\n return _this;\n }\n Image.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.remove(CardElement.heightProperty);\n };\n //#endregion\n Image.prototype.applySize = function (element) {\n if (this.pixelWidth || this.pixelHeight) {\n if (this.pixelWidth) {\n element.style.width = this.pixelWidth + \"px\";\n }\n if (this.pixelHeight) {\n element.style.height = this.pixelHeight + \"px\";\n }\n }\n else {\n if (this.maxHeight) {\n // If the image is constrained in height, we set its height property and\n // auto and stretch are ignored (default to medium). THis is necessary for\n // ImageSet which uses a maximum image height as opposed to the cards width\n // as a constraining dimension\n switch (this.size) {\n case Enums.Size.Small:\n element.style.height = this.hostConfig.imageSizes.small + \"px\";\n break;\n case Enums.Size.Large:\n element.style.height = this.hostConfig.imageSizes.large + \"px\";\n break;\n default:\n element.style.height = this.hostConfig.imageSizes.medium + \"px\";\n break;\n }\n element.style.maxHeight = this.maxHeight + \"px\";\n }\n else {\n switch (this.size) {\n case Enums.Size.Stretch:\n element.style.width = \"100%\";\n break;\n case Enums.Size.Auto:\n element.style.maxWidth = \"100%\";\n break;\n case Enums.Size.Small:\n element.style.width = this.hostConfig.imageSizes.small + \"px\";\n break;\n case Enums.Size.Large:\n element.style.width = this.hostConfig.imageSizes.large + \"px\";\n break;\n case Enums.Size.Medium:\n element.style.width = this.hostConfig.imageSizes.medium + \"px\";\n break;\n }\n element.style.maxHeight = \"100%\";\n }\n }\n };\n Object.defineProperty(Image.prototype, \"useDefaultSizing\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Image.prototype.internalRender = function () {\n var _this = this;\n var element = undefined;\n if (this.url) {\n element = document.createElement(\"div\");\n element.style.display = \"flex\";\n element.style.alignItems = \"flex-start\";\n // Cache hostConfig to avoid walking the parent hierarchy multiple times\n var hostConfig = this.hostConfig;\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n var imageElement = document.createElement(\"img\");\n imageElement.onload = function (e) {\n raiseImageLoadedEvent(_this);\n };\n imageElement.onerror = function (e) {\n if (_this.renderedElement) {\n var card = _this.getRootElement();\n _this.renderedElement.innerHTML = \"\";\n if (card && card.designMode) {\n var errorElement = document.createElement(\"div\");\n errorElement.style.display = \"flex\";\n errorElement.style.alignItems = \"center\";\n errorElement.style.justifyContent = \"center\";\n errorElement.style.backgroundColor = \"#EEEEEE\";\n errorElement.style.color = \"black\";\n errorElement.innerText = \":-(\";\n errorElement.style.padding = \"10px\";\n _this.applySize(errorElement);\n _this.renderedElement.appendChild(errorElement);\n }\n }\n raiseImageLoadedEvent(_this);\n };\n imageElement.style.minWidth = \"0\";\n imageElement.classList.add(hostConfig.makeCssClassName(\"ac-image\"));\n if (this.selectAction && hostConfig.supportsInteractivity) {\n imageElement.onkeypress = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled && (e.code == \"Enter\" || e.code == \"Space\")) { // enter or space pressed\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n imageElement.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(imageElement);\n if (this.selectAction.isEnabled) {\n imageElement.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n this.applySize(imageElement);\n if (this.style === Enums.ImageStyle.Person) {\n imageElement.style.borderRadius = \"50%\";\n imageElement.style.backgroundPosition = \"50% 50%\";\n imageElement.style.backgroundRepeat = \"no-repeat\";\n }\n imageElement.style.backgroundColor = Utils.stringToCssColor(this.backgroundColor);\n imageElement.src = this.preProcessPropertyValue(Image.urlProperty);\n var altTextProperty = this.preProcessPropertyValue(Image.altTextProperty);\n if (altTextProperty) {\n imageElement.alt = altTextProperty;\n }\n element.appendChild(imageElement);\n }\n return element;\n };\n Image.prototype.getJsonTypeName = function () {\n return \"Image\";\n };\n Image.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result && this.selectAction) {\n result = this.selectAction.getActionById(id);\n }\n return result;\n };\n Image.prototype.getResourceInformation = function () {\n return this.url ? [{ url: this.url, mimeType: \"image\" }] : [];\n };\n Image.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n Image.altTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"altText\");\n Image.backgroundColorProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"backgroundColor\");\n Image.styleProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"style\", Enums.ImageStyle, Enums.ImageStyle.Default);\n Image.sizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"size\", Enums.Size, Enums.Size.Auto);\n Image.pixelWidthProperty = new ImageDimensionProperty(serialization_1.Versions.v1_1, \"width\", \"pixelWidth\");\n Image.pixelHeightProperty = new ImageDimensionProperty(serialization_1.Versions.v1_1, \"height\", \"pixelHeight\", CardElement.heightProperty);\n Image.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(Image.urlProperty)\n ], Image.prototype, \"url\", void 0);\n __decorate([\n serialization_1.property(Image.altTextProperty)\n ], Image.prototype, \"altText\", void 0);\n __decorate([\n serialization_1.property(Image.backgroundColorProperty)\n ], Image.prototype, \"backgroundColor\", void 0);\n __decorate([\n serialization_1.property(Image.sizeProperty)\n ], Image.prototype, \"size\", void 0);\n __decorate([\n serialization_1.property(Image.styleProperty)\n ], Image.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(Image.pixelWidthProperty)\n ], Image.prototype, \"pixelWidth\", void 0);\n __decorate([\n serialization_1.property(Image.pixelHeightProperty)\n ], Image.prototype, \"pixelHeight\", void 0);\n __decorate([\n serialization_1.property(Image.selectActionProperty)\n ], Image.prototype, \"selectAction\", void 0);\n return Image;\n}(CardElement));\nexports.Image = Image;\nvar CardElementContainer = /** @class */ (function (_super) {\n __extends(CardElementContainer, _super);\n function CardElementContainer() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.allowVerticalOverflow = false;\n return _this;\n }\n CardElementContainer.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n if (!this.isSelectable) {\n schema.remove(CardElementContainer.selectActionProperty);\n }\n };\n //#endregion\n CardElementContainer.prototype.isElementAllowed = function (element) {\n return this.hostConfig.supportsInteractivity || !element.isInteractive;\n };\n CardElementContainer.prototype.applyPadding = function () {\n _super.prototype.applyPadding.call(this);\n if (!this.renderedElement) {\n return;\n }\n var physicalPadding = new shared_1.SpacingDefinition();\n if (this.getEffectivePadding()) {\n physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding());\n }\n this.renderedElement.style.paddingTop = physicalPadding.top + \"px\";\n this.renderedElement.style.paddingRight = physicalPadding.right + \"px\";\n this.renderedElement.style.paddingBottom = physicalPadding.bottom + \"px\";\n this.renderedElement.style.paddingLeft = physicalPadding.left + \"px\";\n this.renderedElement.style.marginRight = \"0\";\n this.renderedElement.style.marginLeft = \"0\";\n };\n Object.defineProperty(CardElementContainer.prototype, \"isSelectable\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n CardElementContainer.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n for (var i = 0; i < this.getItemCount(); i++) {\n var item = this.getItemAt(i);\n if (!this.hostConfig.supportsInteractivity && item.isInteractive) {\n context.addFailure(this, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.interactivityNotAllowed());\n }\n if (!this.isElementAllowed(item)) {\n context.addFailure(this, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(item.getJsonTypeName()));\n }\n item.internalValidateProperties(context);\n }\n if (this._selectAction) {\n this._selectAction.internalValidateProperties(context);\n }\n };\n CardElementContainer.prototype.render = function () {\n var _this = this;\n var element = _super.prototype.render.call(this);\n if (element) {\n var hostConfig = this.hostConfig;\n if (this.allowVerticalOverflow) {\n element.style.overflowX = \"hidden\";\n element.style.overflowY = \"auto\";\n }\n if (element && this.isSelectable && this._selectAction && hostConfig.supportsInteractivity) {\n element.onclick = function (e) {\n if (_this._selectAction && _this._selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this._selectAction.execute();\n }\n };\n element.onkeypress = function (e) {\n if (_this._selectAction && _this._selectAction.isEnabled && (e.code == \"Enter\" || e.code == \"Space\")) {\n // Enter or space pressed\n e.preventDefault();\n e.cancelBubble = true;\n _this._selectAction.execute();\n }\n };\n this._selectAction.setupElementForAccessibility(element);\n if (this._selectAction.isEnabled) {\n element.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n }\n return element;\n };\n CardElementContainer.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (processChildren) {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).updateLayout();\n }\n }\n };\n CardElementContainer.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = [];\n for (var i = 0; i < this.getItemCount(); i++) {\n result = result.concat(this.getItemAt(i).getAllInputs(processActions));\n }\n return result;\n };\n CardElementContainer.prototype.getResourceInformation = function () {\n var result = [];\n for (var i = 0; i < this.getItemCount(); i++) {\n result = result.concat(this.getItemAt(i).getResourceInformation());\n }\n return result;\n };\n CardElementContainer.prototype.getElementById = function (id) {\n var result = _super.prototype.getElementById.call(this, id);\n if (!result) {\n for (var i = 0; i < this.getItemCount(); i++) {\n result = this.getItemAt(i).getElementById(id);\n if (result) {\n break;\n }\n }\n }\n return result;\n };\n /**\n * @inheritdoc\n */\n CardElementContainer.prototype.findDOMNodeOwner = function (node) {\n var target = undefined;\n for (var i = 0; i < this.getItemCount(); i++) {\n // recur through child elements\n target = this.getItemAt(i).findDOMNodeOwner(node);\n if (target) {\n return target;\n }\n }\n // if not found in children, defer to parent implementation\n return _super.prototype.findDOMNodeOwner.call(this, node);\n };\n CardElementContainer.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(CardElementContainer.selectActionProperty)\n ], CardElementContainer.prototype, \"_selectAction\", void 0);\n return CardElementContainer;\n}(CardElement));\nexports.CardElementContainer = CardElementContainer;\nvar ImageSet = /** @class */ (function (_super) {\n __extends(ImageSet, _super);\n function ImageSet() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._images = [];\n _this.imageSize = Enums.ImageSize.Medium;\n return _this;\n }\n //#endregion\n ImageSet.prototype.internalRender = function () {\n var element = undefined;\n if (this._images.length > 0) {\n element = document.createElement(\"div\");\n element.style.display = \"flex\";\n element.style.flexWrap = \"wrap\";\n for (var _i = 0, _a = this._images; _i < _a.length; _i++) {\n var image = _a[_i];\n switch (this.imageSize) {\n case Enums.ImageSize.Small:\n image.size = Enums.Size.Small;\n break;\n case Enums.ImageSize.Large:\n image.size = Enums.Size.Large;\n break;\n default:\n image.size = Enums.Size.Medium;\n break;\n }\n image.maxHeight = this.hostConfig.imageSet.maxImageHeight;\n var renderedImage = image.render();\n if (renderedImage) {\n renderedImage.style.display = \"inline-flex\";\n renderedImage.style.margin = \"0px\";\n renderedImage.style.marginRight = \"10px\";\n Utils.appendChild(element, renderedImage);\n }\n }\n }\n return element;\n };\n ImageSet.prototype.getItemCount = function () {\n return this._images.length;\n };\n ImageSet.prototype.getItemAt = function (index) {\n return this._images[index];\n };\n ImageSet.prototype.getFirstVisibleRenderedItem = function () {\n return this._images && this._images.length > 0 ? this._images[0] : undefined;\n };\n ImageSet.prototype.getLastVisibleRenderedItem = function () {\n return this._images && this._images.length > 0 ? this._images[this._images.length - 1] : undefined;\n };\n ImageSet.prototype.removeItem = function (item) {\n if (item instanceof Image) {\n var itemIndex = this._images.indexOf(item);\n if (itemIndex >= 0) {\n this._images.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n }\n return false;\n };\n ImageSet.prototype.getJsonTypeName = function () {\n return \"ImageSet\";\n };\n ImageSet.prototype.addImage = function (image) {\n if (!image.parent) {\n this._images.push(image);\n image.setParent(this);\n }\n else {\n throw new Error(\"This image already belongs to another ImageSet\");\n }\n };\n ImageSet.prototype.indexOf = function (cardElement) {\n return cardElement instanceof Image ? this._images.indexOf(cardElement) : -1;\n };\n ImageSet.imagesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"images\", Image, function (sender, item) { item.setParent(sender); });\n ImageSet.imageSizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"imageSize\", Enums.ImageSize, Enums.ImageSize.Medium);\n __decorate([\n serialization_1.property(ImageSet.imagesProperty)\n ], ImageSet.prototype, \"_images\", void 0);\n __decorate([\n serialization_1.property(ImageSet.imageSizeProperty)\n ], ImageSet.prototype, \"imageSize\", void 0);\n return ImageSet;\n}(CardElementContainer));\nexports.ImageSet = ImageSet;\nvar MediaSource = /** @class */ (function (_super) {\n __extends(MediaSource, _super);\n function MediaSource(url, mimeType) {\n var _this = _super.call(this) || this;\n _this.url = url;\n _this.mimeType = mimeType;\n return _this;\n }\n //#endregion\n MediaSource.prototype.getSchemaKey = function () {\n return \"MediaSource\";\n };\n MediaSource.prototype.isValid = function () {\n return this.mimeType && this.url ? true : false;\n };\n MediaSource.prototype.render = function () {\n var result = undefined;\n if (this.isValid()) {\n result = document.createElement(\"source\");\n result.src = this.url;\n result.type = this.mimeType;\n }\n return result;\n };\n //#region Schema\n MediaSource.mimeTypeProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"mimeType\");\n MediaSource.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"url\");\n __decorate([\n serialization_1.property(MediaSource.mimeTypeProperty)\n ], MediaSource.prototype, \"mimeType\", void 0);\n __decorate([\n serialization_1.property(MediaSource.urlProperty)\n ], MediaSource.prototype, \"url\", void 0);\n return MediaSource;\n}(serialization_1.SerializableObject));\nexports.MediaSource = MediaSource;\nvar Media = /** @class */ (function (_super) {\n __extends(Media, _super);\n function Media() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.sources = [];\n return _this;\n }\n Media.prototype.getPosterUrl = function () {\n return this.poster ? this.poster : this.hostConfig.media.defaultPoster;\n };\n Media.prototype.processSources = function () {\n this._selectedSources = [];\n this._selectedMediaType = undefined;\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var source = _a[_i];\n var mimeComponents = source.mimeType ? source.mimeType.split('/') : [];\n if (mimeComponents.length == 2) {\n if (!this._selectedMediaType) {\n var index = Media.supportedMediaTypes.indexOf(mimeComponents[0]);\n if (index >= 0) {\n this._selectedMediaType = Media.supportedMediaTypes[index];\n }\n }\n if (mimeComponents[0] == this._selectedMediaType) {\n this._selectedSources.push(source);\n }\n }\n }\n };\n Media.prototype.handlePlayButtonInvoke = function (event) {\n if (this.hostConfig.media.allowInlinePlayback) {\n event.preventDefault();\n event.cancelBubble = true;\n if (this.renderedElement) {\n var mediaPlayerElement = this.renderMediaPlayer();\n this.renderedElement.innerHTML = \"\";\n this.renderedElement.appendChild(mediaPlayerElement);\n mediaPlayerElement.play();\n mediaPlayerElement.focus();\n }\n }\n else {\n if (Media.onPlay) {\n event.preventDefault();\n event.cancelBubble = true;\n Media.onPlay(this);\n }\n }\n };\n Media.prototype.renderPoster = function () {\n var _this = this;\n var playButtonArrowWidth = 12;\n var playButtonArrowHeight = 15;\n var posterRootElement = document.createElement(\"div\");\n posterRootElement.className = this.hostConfig.makeCssClassName(\"ac-media-poster\");\n posterRootElement.setAttribute(\"role\", \"contentinfo\");\n posterRootElement.setAttribute(\"aria-label\", this.altText ? this.altText : strings_1.Strings.defaults.mediaPlayerAriaLabel());\n posterRootElement.style.position = \"relative\";\n posterRootElement.style.display = \"flex\";\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n var posterImageElement_1 = document.createElement(\"img\");\n posterImageElement_1.style.width = \"100%\";\n posterImageElement_1.style.height = \"100%\";\n posterImageElement_1.setAttribute(\"role\", \"presentation\");\n posterImageElement_1.onerror = function (e) {\n if (posterImageElement_1.parentNode) {\n posterImageElement_1.parentNode.removeChild(posterImageElement_1);\n }\n posterRootElement.classList.add(\"empty\");\n posterRootElement.style.minHeight = \"150px\";\n };\n posterImageElement_1.src = posterUrl;\n posterRootElement.appendChild(posterImageElement_1);\n }\n else {\n posterRootElement.classList.add(\"empty\");\n posterRootElement.style.minHeight = \"150px\";\n }\n if (this.hostConfig.supportsInteractivity && this._selectedSources.length > 0) {\n var playButtonOuterElement = document.createElement(\"div\");\n playButtonOuterElement.tabIndex = 0;\n playButtonOuterElement.setAttribute(\"role\", \"button\");\n playButtonOuterElement.setAttribute(\"aria-label\", strings_1.Strings.defaults.mediaPlayerPlayMedia());\n playButtonOuterElement.className = this.hostConfig.makeCssClassName(\"ac-media-playButton\");\n playButtonOuterElement.style.display = \"flex\";\n playButtonOuterElement.style.alignItems = \"center\";\n playButtonOuterElement.style.justifyContent = \"center\";\n playButtonOuterElement.onclick = function (e) {\n _this.handlePlayButtonInvoke(e);\n };\n playButtonOuterElement.onkeypress = function (e) {\n if (e.code == \"Enter\" || e.code == \"Space\") { // space or enter\n _this.handlePlayButtonInvoke(e);\n }\n };\n var playButtonInnerElement = document.createElement(\"div\");\n playButtonInnerElement.className = this.hostConfig.makeCssClassName(\"ac-media-playButton-arrow\");\n playButtonInnerElement.style.width = playButtonArrowWidth + \"px\";\n playButtonInnerElement.style.height = playButtonArrowHeight + \"px\";\n playButtonInnerElement.style.borderTopWidth = (playButtonArrowHeight / 2) + \"px\";\n playButtonInnerElement.style.borderBottomWidth = (playButtonArrowHeight / 2) + \"px\";\n playButtonInnerElement.style.borderLeftWidth = playButtonArrowWidth + \"px\";\n playButtonInnerElement.style.borderRightWidth = \"0\";\n playButtonInnerElement.style.borderStyle = \"solid\";\n playButtonInnerElement.style.borderTopColor = \"transparent\";\n playButtonInnerElement.style.borderRightColor = \"transparent\";\n playButtonInnerElement.style.borderBottomColor = \"transparent\";\n playButtonInnerElement.style.transform = \"translate(\" + (playButtonArrowWidth / 10) + \"px,0px)\";\n playButtonOuterElement.appendChild(playButtonInnerElement);\n var playButtonContainer = document.createElement(\"div\");\n playButtonContainer.style.position = \"absolute\";\n playButtonContainer.style.left = \"0\";\n playButtonContainer.style.top = \"0\";\n playButtonContainer.style.width = \"100%\";\n playButtonContainer.style.height = \"100%\";\n playButtonContainer.style.display = \"flex\";\n playButtonContainer.style.justifyContent = \"center\";\n playButtonContainer.style.alignItems = \"center\";\n playButtonContainer.appendChild(playButtonOuterElement);\n posterRootElement.appendChild(playButtonContainer);\n }\n return posterRootElement;\n };\n Media.prototype.renderMediaPlayer = function () {\n var mediaElement;\n if (this._selectedMediaType == \"video\") {\n var videoPlayer = document.createElement(\"video\");\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n videoPlayer.poster = posterUrl;\n }\n mediaElement = videoPlayer;\n }\n else {\n mediaElement = document.createElement(\"audio\");\n }\n mediaElement.setAttribute(\"aria-label\", this.altText ? this.altText : strings_1.Strings.defaults.mediaPlayerAriaLabel());\n mediaElement.setAttribute(\"webkit-playsinline\", \"\");\n mediaElement.setAttribute(\"playsinline\", \"\");\n mediaElement.autoplay = true;\n mediaElement.controls = true;\n if (Utils.isMobileOS()) {\n mediaElement.muted = true;\n }\n mediaElement.preload = \"none\";\n mediaElement.style.width = \"100%\";\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var source = _a[_i];\n var renderedSource = source.render();\n Utils.appendChild(mediaElement, renderedSource);\n }\n return mediaElement;\n };\n Media.prototype.internalRender = function () {\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-media\");\n this.processSources();\n element.appendChild(this.renderPoster());\n return element;\n };\n Media.prototype.getJsonTypeName = function () {\n return \"Media\";\n };\n Media.prototype.getResourceInformation = function () {\n var result = [];\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n result.push({ url: posterUrl, mimeType: \"image\" });\n }\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var mediaSource = _a[_i];\n if (mediaSource.isValid()) {\n result.push({\n url: mediaSource.url,\n mimeType: mediaSource.mimeType\n });\n }\n }\n return result;\n };\n Object.defineProperty(Media.prototype, \"selectedMediaType\", {\n get: function () {\n return this._selectedMediaType;\n },\n enumerable: false,\n configurable: true\n });\n Media.sourcesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_1, \"sources\", MediaSource);\n Media.posterProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"poster\");\n Media.altTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"altText\");\n //#endregion\n Media.supportedMediaTypes = [\"audio\", \"video\"];\n __decorate([\n serialization_1.property(Media.sourcesProperty)\n ], Media.prototype, \"sources\", void 0);\n __decorate([\n serialization_1.property(Media.posterProperty)\n ], Media.prototype, \"poster\", void 0);\n __decorate([\n serialization_1.property(Media.altTextProperty)\n ], Media.prototype, \"altText\", void 0);\n return Media;\n}(CardElement));\nexports.Media = Media;\nvar Input = /** @class */ (function (_super) {\n __extends(Input, _super);\n function Input() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Input.prototype.getAllLabelIds = function () {\n var labelIds = [];\n if (this.labelledBy) {\n labelIds.push(this.labelledBy);\n }\n if (this._renderedLabelElement) {\n labelIds.push(this._renderedLabelElement.id);\n }\n if (this._renderedErrorMessageElement) {\n labelIds.push(this._renderedErrorMessageElement.id);\n }\n return labelIds;\n };\n Input.prototype.updateInputControlAriaLabelledBy = function () {\n if (this._renderedInputControlElement) {\n var labelIds = this.getAllLabelIds();\n if (labelIds.length > 0) {\n this._renderedInputControlElement.setAttribute(\"aria-labelledby\", labelIds.join(\" \"));\n }\n else {\n this._renderedInputControlElement.removeAttribute(\"aria-labelledby\");\n }\n }\n };\n Object.defineProperty(Input.prototype, \"isNullable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Input.prototype, \"renderedInputControlElement\", {\n get: function () {\n return this._renderedInputControlElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Input.prototype, \"inputControlContainerElement\", {\n get: function () {\n return this._inputControlContainerElement;\n },\n enumerable: false,\n configurable: true\n });\n Input.prototype.overrideInternalRender = function () {\n var hostConfig = this.hostConfig;\n this._outerContainerElement = document.createElement(\"div\");\n this._outerContainerElement.style.display = \"flex\";\n this._outerContainerElement.style.flexDirection = \"column\";\n var renderedInputControlId = Utils.generateUniqueId();\n if (this.label) {\n var labelRichTextBlock = new RichTextBlock();\n labelRichTextBlock.setParent(this);\n labelRichTextBlock.forElementId = renderedInputControlId;\n var labelInline = new TextRun(this.label);\n labelRichTextBlock.addInline(labelInline);\n if (this.isRequired) {\n labelInline.init(hostConfig.inputs.label.requiredInputs);\n var isRequiredCueInline = new TextRun(hostConfig.inputs.label.requiredInputs.suffix);\n isRequiredCueInline.color = hostConfig.inputs.label.requiredInputs.suffixColor;\n isRequiredCueInline.ariaHidden = true;\n labelRichTextBlock.addInline(isRequiredCueInline);\n }\n else {\n labelInline.init(hostConfig.inputs.label.optionalInputs);\n }\n this._renderedLabelElement = labelRichTextBlock.render();\n if (this._renderedLabelElement) {\n this._renderedLabelElement.id = Utils.generateUniqueId();\n this._renderedLabelElement.style.marginBottom = hostConfig.getEffectiveSpacing(hostConfig.inputs.label.inputSpacing) + \"px\";\n this._outerContainerElement.appendChild(this._renderedLabelElement);\n }\n }\n this._inputControlContainerElement = document.createElement(\"div\");\n this._inputControlContainerElement.className = hostConfig.makeCssClassName(\"ac-input-container\");\n this._inputControlContainerElement.style.display = \"flex\";\n if (this.height === \"stretch\") {\n this._inputControlContainerElement.style.alignItems = \"stretch\";\n this._inputControlContainerElement.style.flex = \"1 1 auto\";\n }\n this._renderedInputControlElement = this.internalRender();\n if (this._renderedInputControlElement) {\n this._renderedInputControlElement.id = renderedInputControlId;\n this._renderedInputControlElement.style.minWidth = \"0px\";\n if (this.isNullable && this.isRequired) {\n this._renderedInputControlElement.setAttribute(\"aria-required\", \"true\");\n this._renderedInputControlElement.classList.add(hostConfig.makeCssClassName(\"ac-input-required\"));\n }\n this._inputControlContainerElement.appendChild(this._renderedInputControlElement);\n this._outerContainerElement.appendChild(this._inputControlContainerElement);\n this.updateInputControlAriaLabelledBy();\n return this._outerContainerElement;\n }\n return undefined;\n };\n Input.prototype.valueChanged = function () {\n if (this.isValid()) {\n this.resetValidationFailureCue();\n }\n if (this.onValueChanged) {\n this.onValueChanged(this);\n }\n raiseInputValueChangedEvent(this);\n };\n Input.prototype.resetValidationFailureCue = function () {\n if (this.renderedInputControlElement) {\n this.renderedInputControlElement.classList.remove(this.hostConfig.makeCssClassName(\"ac-input-validation-failed\"));\n this.updateInputControlAriaLabelledBy();\n if (this._renderedErrorMessageElement) {\n this._outerContainerElement.removeChild(this._renderedErrorMessageElement);\n this._renderedErrorMessageElement = undefined;\n }\n }\n };\n Input.prototype.showValidationErrorMessage = function () {\n if (this.renderedElement && this.errorMessage && shared_1.GlobalSettings.displayInputValidationErrors) {\n var errorMessageTextBlock = new TextBlock();\n errorMessageTextBlock.setParent(this);\n errorMessageTextBlock.text = this.errorMessage;\n errorMessageTextBlock.wrap = true;\n errorMessageTextBlock.init(this.hostConfig.inputs.errorMessage);\n this._renderedErrorMessageElement = errorMessageTextBlock.render();\n if (this._renderedErrorMessageElement) {\n this._renderedErrorMessageElement.id = Utils.generateUniqueId();\n this._outerContainerElement.appendChild(this._renderedErrorMessageElement);\n this.updateInputControlAriaLabelledBy();\n }\n }\n };\n Input.prototype.focus = function () {\n if (this._renderedInputControlElement) {\n this._renderedInputControlElement.focus();\n }\n };\n Input.prototype.isValid = function () {\n return true;\n };\n Input.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.id) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.inputsMustHaveUniqueId());\n }\n if (this.isRequired) {\n if (!this.label) {\n context.addFailure(this, Enums.ValidationEvent.RequiredInputsShouldHaveLabel, \"Required inputs should have a label\");\n }\n if (!this.errorMessage) {\n context.addFailure(this, Enums.ValidationEvent.RequiredInputsShouldHaveErrorMessage, \"Required inputs should have an error message\");\n }\n }\n };\n Input.prototype.validateValue = function () {\n this.resetValidationFailureCue();\n var result = this.isRequired ? this.isSet() && this.isValid() : this.isValid();\n if (!result && this.renderedInputControlElement) {\n this.renderedInputControlElement.classList.add(this.hostConfig.makeCssClassName(\"ac-input-validation-failed\"));\n this.showValidationErrorMessage();\n }\n return result;\n };\n Input.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [this];\n };\n Object.defineProperty(Input.prototype, \"isInteractive\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n Input.labelProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"label\", true);\n Input.isRequiredProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"isRequired\", false);\n Input.errorMessageProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"errorMessage\", true);\n __decorate([\n serialization_1.property(Input.labelProperty)\n ], Input.prototype, \"label\", void 0);\n __decorate([\n serialization_1.property(Input.isRequiredProperty)\n ], Input.prototype, \"isRequired\", void 0);\n __decorate([\n serialization_1.property(Input.errorMessageProperty)\n ], Input.prototype, \"errorMessage\", void 0);\n return Input;\n}(CardElement));\nexports.Input = Input;\nvar TextInput = /** @class */ (function (_super) {\n __extends(TextInput, _super);\n function TextInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isMultiline = false;\n _this.style = Enums.InputTextStyle.Text;\n return _this;\n }\n //#endregion\n TextInput.prototype.setupInput = function (input) {\n var _this = this;\n input.style.flex = \"1 1 auto\";\n input.tabIndex = 0;\n if (this.placeholder) {\n input.placeholder = this.placeholder;\n input.setAttribute(\"aria-label\", this.placeholder);\n }\n if (this.defaultValue) {\n input.value = this.defaultValue;\n }\n if (this.maxLength && this.maxLength > 0) {\n input.maxLength = this.maxLength;\n }\n input.oninput = function () { _this.valueChanged(); };\n input.onkeypress = function (e) {\n // Ctrl+Enter pressed\n if (e.ctrlKey && e.code === \"Enter\" && _this.inlineAction && _this.inlineAction.isEnabled) {\n _this.inlineAction.execute();\n }\n };\n };\n TextInput.prototype.internalRender = function () {\n var result;\n if (this.isMultiline && this.style !== Enums.InputTextStyle.Password) {\n result = document.createElement(\"textarea\");\n result.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-textInput\", \"ac-multiline\");\n if (this.height === \"stretch\") {\n result.style.height = \"initial\";\n }\n }\n else {\n result = document.createElement(\"input\");\n result.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-textInput\");\n result.type = Enums.InputTextStyle[this.style].toLowerCase();\n }\n this.setupInput(result);\n return result;\n };\n TextInput.prototype.overrideInternalRender = function () {\n var _this = this;\n var renderedInputControl = _super.prototype.overrideInternalRender.call(this);\n if (this.inlineAction) {\n var button_1 = document.createElement(\"button\");\n button_1.className = this.hostConfig.makeCssClassName(this.inlineAction.isEnabled ? \"ac-inlineActionButton\" : \"ac-inlineActionButton-disabled\");\n button_1.onclick = function (e) {\n if (_this.inlineAction && _this.inlineAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.inlineAction.execute();\n }\n };\n if (this.inlineAction.iconUrl) {\n button_1.classList.add(\"iconOnly\");\n var icon_1 = document.createElement(\"img\");\n icon_1.style.height = \"100%\";\n icon_1.setAttribute(\"role\", \"presentation\");\n // The below trick is necessary as a workaround in Chrome where the icon is initially displayed\n // at its native size then resized to 100% of the button's height. This cfreates an unpleasant\n // flicker. On top of that, Chrome's flex implementation fails to prperly re-layout the button\n // after the image has loaded and been gicven its final size. The below trick also fixes that.\n icon_1.style.display = \"none\";\n icon_1.onload = function () {\n icon_1.style.removeProperty(\"display\");\n };\n icon_1.onerror = function () {\n button_1.removeChild(icon_1);\n button_1.classList.remove(\"iconOnly\");\n button_1.classList.add(\"textOnly\");\n button_1.textContent = _this.inlineAction && _this.inlineAction.title ? _this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n };\n icon_1.src = this.inlineAction.iconUrl;\n button_1.appendChild(icon_1);\n button_1.title = this.inlineAction.title ? this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n }\n else {\n button_1.classList.add(\"textOnly\");\n button_1.textContent = this.inlineAction.title ? this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n }\n this.inlineAction.setupElementForAccessibility(button_1, true);\n button_1.style.marginLeft = \"8px\";\n this.inputControlContainerElement.appendChild(button_1);\n }\n return renderedInputControl;\n };\n TextInput.prototype.getJsonTypeName = function () {\n return \"Input.Text\";\n };\n TextInput.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result && this.inlineAction) {\n result = this.inlineAction.getActionById(id);\n }\n return result;\n };\n TextInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n TextInput.prototype.isValid = function () {\n if (!this.value) {\n return true;\n }\n if (this.regex) {\n return new RegExp(this.regex, \"g\").test(this.value);\n }\n return true;\n };\n Object.defineProperty(TextInput.prototype, \"value\", {\n get: function () {\n if (this.renderedInputControlElement) {\n if (this.isMultiline) {\n return this.renderedInputControlElement.value;\n }\n else {\n return this.renderedInputControlElement.value;\n }\n }\n else {\n return undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n TextInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n TextInput.maxLengthProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"maxLength\");\n TextInput.isMultilineProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isMultiline\", false);\n TextInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n TextInput.styleProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"style\", Enums.InputTextStyle, Enums.InputTextStyle.Text, [\n { value: Enums.InputTextStyle.Text },\n { value: Enums.InputTextStyle.Tel },\n { value: Enums.InputTextStyle.Url },\n { value: Enums.InputTextStyle.Email },\n { value: Enums.InputTextStyle.Password, targetVersion: serialization_1.Versions.v1_5 }\n ]);\n TextInput.inlineActionProperty = new ActionProperty(serialization_1.Versions.v1_0, \"inlineAction\", [\"Action.ShowCard\"]);\n TextInput.regexProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"regex\", true);\n __decorate([\n serialization_1.property(TextInput.valueProperty)\n ], TextInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(TextInput.maxLengthProperty)\n ], TextInput.prototype, \"maxLength\", void 0);\n __decorate([\n serialization_1.property(TextInput.isMultilineProperty)\n ], TextInput.prototype, \"isMultiline\", void 0);\n __decorate([\n serialization_1.property(TextInput.placeholderProperty)\n ], TextInput.prototype, \"placeholder\", void 0);\n __decorate([\n serialization_1.property(TextInput.styleProperty)\n ], TextInput.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(TextInput.inlineActionProperty)\n ], TextInput.prototype, \"inlineAction\", void 0);\n __decorate([\n serialization_1.property(TextInput.regexProperty)\n ], TextInput.prototype, \"regex\", void 0);\n return TextInput;\n}(Input));\nexports.TextInput = TextInput;\nvar ToggleInput = /** @class */ (function (_super) {\n __extends(ToggleInput, _super);\n function ToggleInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.valueOn = \"true\";\n _this.valueOff = \"false\";\n _this.wrap = false;\n return _this;\n }\n ToggleInput.prototype.updateInputControlAriaLabelledBy = function () {\n if (this._checkboxInputElement) {\n var joinedLabelIds = this.getAllLabelIds().join(\" \");\n if (this._checkboxInputLabelElement && this._checkboxInputLabelElement.id) {\n joinedLabelIds += \" \" + this._checkboxInputLabelElement.id;\n }\n if (joinedLabelIds) {\n this._checkboxInputElement.setAttribute(\"aria-labelledby\", joinedLabelIds);\n }\n else {\n this._checkboxInputElement.removeAttribute(\"aria-labelledby\");\n }\n }\n };\n ToggleInput.prototype.internalRender = function () {\n var _this = this;\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-toggleInput\");\n element.style.width = \"100%\";\n element.style.display = \"flex\";\n element.style.alignItems = \"center\";\n this._checkboxInputElement = document.createElement(\"input\");\n this._checkboxInputElement.id = Utils.generateUniqueId();\n this._checkboxInputElement.type = \"checkbox\";\n this._checkboxInputElement.style.display = \"inline-block\";\n this._checkboxInputElement.style.verticalAlign = \"middle\";\n this._checkboxInputElement.style.margin = \"0\";\n this._checkboxInputElement.style.flex = \"0 0 auto\";\n if (this.title) {\n this._checkboxInputElement.setAttribute(\"aria-label\", this.title);\n }\n if (this.isRequired) {\n this._checkboxInputElement.setAttribute(\"aria-required\", \"true\");\n }\n this._checkboxInputElement.tabIndex = 0;\n if (this.defaultValue == this.valueOn) {\n this._checkboxInputElement.checked = true;\n }\n this._checkboxInputElement.onchange = function () { _this.valueChanged(); };\n Utils.appendChild(element, this._checkboxInputElement);\n if (this.title || this.isDesignMode()) {\n var label = new TextBlock();\n label.setParent(this);\n label.forElementId = this._checkboxInputElement.id;\n label.hostConfig = this.hostConfig;\n label.text = !this.title ? this.getJsonTypeName() : this.title;\n label.useMarkdown = shared_1.GlobalSettings.useMarkdownInRadioButtonAndCheckbox;\n label.wrap = this.wrap;\n this._checkboxInputLabelElement = label.render();\n if (this._checkboxInputLabelElement) {\n this._checkboxInputLabelElement.id = Utils.generateUniqueId();\n this._checkboxInputLabelElement.style.display = \"inline-block\";\n this._checkboxInputLabelElement.style.flex = \"1 1 auto\";\n this._checkboxInputLabelElement.style.marginLeft = \"6px\";\n this._checkboxInputLabelElement.style.verticalAlign = \"middle\";\n var spacerElement = document.createElement(\"div\");\n spacerElement.style.width = \"6px\";\n Utils.appendChild(element, spacerElement);\n Utils.appendChild(element, this._checkboxInputLabelElement);\n }\n }\n return element;\n };\n Object.defineProperty(ToggleInput.prototype, \"isNullable\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n ToggleInput.prototype.getJsonTypeName = function () {\n return \"Input.Toggle\";\n };\n ToggleInput.prototype.focus = function () {\n if (this._checkboxInputElement) {\n this._checkboxInputElement.focus();\n }\n };\n ToggleInput.prototype.isSet = function () {\n if (this.isRequired) {\n return this.value === this.valueOn;\n }\n return this.value ? true : false;\n };\n Object.defineProperty(ToggleInput.prototype, \"value\", {\n get: function () {\n if (this._checkboxInputElement) {\n return this._checkboxInputElement.checked ? this.valueOn : this.valueOff;\n }\n else {\n return undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n ToggleInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n ToggleInput.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n ToggleInput.valueOnProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"valueOn\", true, undefined, \"true\", function (sender) { return \"true\"; });\n ToggleInput.valueOffProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"valueOff\", true, undefined, \"false\", function (sender) { return \"false\"; });\n ToggleInput.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"wrap\", false);\n __decorate([\n serialization_1.property(ToggleInput.valueProperty)\n ], ToggleInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.titleProperty)\n ], ToggleInput.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.valueOnProperty)\n ], ToggleInput.prototype, \"valueOn\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.valueOffProperty)\n ], ToggleInput.prototype, \"valueOff\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.wrapProperty)\n ], ToggleInput.prototype, \"wrap\", void 0);\n return ToggleInput;\n}(Input));\nexports.ToggleInput = ToggleInput;\nvar Choice = /** @class */ (function (_super) {\n __extends(Choice, _super);\n function Choice(title, value) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.value = value;\n return _this;\n }\n //#endregion\n Choice.prototype.getSchemaKey = function () {\n return \"Choice\";\n };\n //#region Schema\n Choice.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Choice.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(Choice.titleProperty)\n ], Choice.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(Choice.valueProperty)\n ], Choice.prototype, \"value\", void 0);\n return Choice;\n}(serialization_1.SerializableObject));\nexports.Choice = Choice;\nvar ChoiceSetInput = /** @class */ (function (_super) {\n __extends(ChoiceSetInput, _super);\n function ChoiceSetInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isMultiSelect = false;\n _this.wrap = false;\n _this.choices = [];\n return _this;\n }\n Object.defineProperty(ChoiceSetInput.prototype, \"isCompact\", {\n get: function () {\n return !this.style || this.style === \"compact\";\n },\n set: function (value) {\n this.style = value ? undefined : \"expanded\";\n },\n enumerable: false,\n configurable: true\n });\n ChoiceSetInput.getUniqueCategoryName = function () {\n var uniqueCategoryName = \"__ac-category\" + ChoiceSetInput.uniqueCategoryCounter;\n ChoiceSetInput.uniqueCategoryCounter++;\n return uniqueCategoryName;\n };\n // Make sure `aria-current` is applied to the currently-selected item\n ChoiceSetInput.prototype.internalApplyAriaCurrent = function () {\n if (this._selectElement) {\n var options = this._selectElement.options;\n if (options) {\n for (var i = 0; i < options.length; i++) {\n if (options[i].selected) {\n options[i].setAttribute(\"aria-current\", \"true\");\n }\n else {\n options[i].removeAttribute(\"aria-current\");\n }\n }\n }\n }\n };\n ChoiceSetInput.prototype.renderCompoundInput = function (cssClassName, type, defaultValues) {\n var _this = this;\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-input\", cssClassName);\n element.style.width = \"100%\";\n this._toggleInputs = [];\n this._labels = [];\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n var input = document.createElement(\"input\");\n input.id = Utils.generateUniqueId();\n input.type = type;\n input.style.margin = \"0\";\n input.style.display = \"inline-block\";\n input.style.verticalAlign = \"middle\";\n input.style.flex = \"0 0 auto\";\n input.name = this.id ? this.id : this._uniqueCategoryName;\n if (this.isRequired) {\n input.setAttribute(\"aria-required\", \"true\");\n }\n if (choice.value) {\n input.value = choice.value;\n }\n if (choice.title) {\n input.setAttribute(\"aria-label\", choice.title);\n }\n if (defaultValues && choice.value) {\n if (defaultValues.indexOf(choice.value) >= 0) {\n input.checked = true;\n }\n }\n input.onchange = function () { _this.valueChanged(); };\n this._toggleInputs.push(input);\n var compoundInput = document.createElement(\"div\");\n compoundInput.style.display = \"flex\";\n compoundInput.style.alignItems = \"center\";\n Utils.appendChild(compoundInput, input);\n var label = new TextBlock();\n label.setParent(this);\n label.forElementId = input.id;\n label.hostConfig = this.hostConfig;\n label.text = choice.title ? choice.title : \"Choice \" + this._toggleInputs.length;\n label.useMarkdown = shared_1.GlobalSettings.useMarkdownInRadioButtonAndCheckbox;\n label.wrap = this.wrap;\n var labelElement = label.render();\n this._labels.push(labelElement);\n if (labelElement) {\n labelElement.id = Utils.generateUniqueId();\n labelElement.style.display = \"inline-block\";\n labelElement.style.flex = \"1 1 auto\";\n labelElement.style.marginLeft = \"6px\";\n labelElement.style.verticalAlign = \"middle\";\n var spacerElement = document.createElement(\"div\");\n spacerElement.style.width = \"6px\";\n Utils.appendChild(compoundInput, spacerElement);\n Utils.appendChild(compoundInput, labelElement);\n }\n Utils.appendChild(element, compoundInput);\n }\n return element;\n };\n ChoiceSetInput.prototype.updateInputControlAriaLabelledBy = function () {\n if ((this.isMultiSelect || this.style === \"expanded\") && this._toggleInputs && this._labels) {\n var labelIds = this.getAllLabelIds();\n for (var i = 0; i < this._toggleInputs.length; i++) {\n var joinedLabelIds = labelIds.join(\" \");\n var label = this._labels[i];\n if (label && label.id) {\n joinedLabelIds += \" \" + label.id;\n }\n if (joinedLabelIds) {\n this._toggleInputs[i].setAttribute(\"aria-labelledby\", joinedLabelIds);\n }\n else {\n this._toggleInputs[i].removeAttribute(\"aria-labelledby\");\n }\n }\n }\n else {\n _super.prototype.updateInputControlAriaLabelledBy.call(this);\n }\n };\n ChoiceSetInput.prototype.internalRender = function () {\n var _this = this;\n this._uniqueCategoryName = ChoiceSetInput.getUniqueCategoryName();\n if (this.isMultiSelect) {\n // Render as a list of toggle inputs\n return this.renderCompoundInput(\"ac-choiceSetInput-multiSelect\", \"checkbox\", this.defaultValue ? this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator) : undefined);\n }\n else {\n if (this.style === \"expanded\") {\n // Render as a series of radio buttons\n return this.renderCompoundInput(\"ac-choiceSetInput-expanded\", \"radio\", this.defaultValue ? [this.defaultValue] : undefined);\n }\n else if (this.style === \"filtered\") {\n // Render as a text input coupled with a datalist\n var inputContainer = document.createElement(\"div\");\n inputContainer.style.width = \"100%\";\n this._textInput = document.createElement(\"input\");\n this._textInput.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-multichoiceInput\", \"ac-choiceSetInput-filtered\");\n this._textInput.type = \"text\";\n this._textInput.style.width = \"100%\";\n this._textInput.oninput = function () {\n _this.valueChanged();\n if (_this._textInput) {\n // Remove aria-label when value is not empty so narration software doesn't\n // read the placeholder\n if (_this.value) {\n _this._textInput.removeAttribute(\"placeholder\");\n _this._textInput.removeAttribute(\"aria-label\");\n }\n else if (_this.placeholder) {\n _this._textInput.placeholder = _this.placeholder;\n _this._textInput.setAttribute(\"aria-label\", _this.placeholder);\n }\n }\n };\n if (this.defaultValue) {\n this._textInput.value = this.defaultValue;\n }\n if (this.placeholder && !this._textInput.value) {\n this._textInput.placeholder = this.placeholder;\n this._textInput.setAttribute(\"aria-label\", this.placeholder);\n }\n var dataList = document.createElement(\"datalist\");\n dataList.id = Utils.generateUniqueId();\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n var option = document.createElement(\"option\");\n // To fix https://stackoverflow.com/questions/29882361/show-datalist-labels-but-submit-the-actual-value\n // value is mapped to choice.title other than choice.value\n option.value = choice.title;\n option.setAttribute(\"aria-label\", choice.title);\n dataList.appendChild(option);\n }\n this._textInput.setAttribute(\"list\", dataList.id);\n inputContainer.append(this._textInput, dataList);\n return inputContainer;\n }\n else {\n // Render as a combo box\n this._selectElement = document.createElement(\"select\");\n this._selectElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-multichoiceInput\", \"ac-choiceSetInput-compact\");\n this._selectElement.style.width = \"100%\";\n var option = document.createElement(\"option\");\n option.selected = true;\n option.disabled = true;\n option.hidden = true;\n option.value = \"\";\n if (this.placeholder) {\n option.text = this.placeholder;\n }\n Utils.appendChild(this._selectElement, option);\n for (var _b = 0, _c = this.choices; _b < _c.length; _b++) {\n var choice = _c[_b];\n var option_1 = document.createElement(\"option\");\n option_1.value = choice.value;\n option_1.text = choice.title;\n option_1.setAttribute(\"aria-label\", choice.title);\n if (choice.value == this.defaultValue) {\n option_1.selected = true;\n }\n Utils.appendChild(this._selectElement, option_1);\n }\n this._selectElement.onchange = function () {\n _this.internalApplyAriaCurrent();\n _this.valueChanged();\n };\n this.internalApplyAriaCurrent();\n return this._selectElement;\n }\n }\n };\n ChoiceSetInput.prototype.getJsonTypeName = function () {\n return \"Input.ChoiceSet\";\n };\n ChoiceSetInput.prototype.focus = function () {\n if (this._toggleInputs && (this.isMultiSelect || this.style === \"expanded\")) {\n if (this._toggleInputs.length > 0) {\n this._toggleInputs[0].focus();\n }\n }\n else if (this._textInput) {\n this._textInput.focus();\n }\n else {\n _super.prototype.focus.call(this);\n }\n };\n ChoiceSetInput.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this.choices.length == 0) {\n context.addFailure(this, Enums.ValidationEvent.CollectionCantBeEmpty, strings_1.Strings.errors.choiceSetMustHaveAtLeastOneChoice());\n }\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (!choice.title || !choice.value) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.choiceSetChoicesMustHaveTitleAndValue());\n }\n }\n };\n ChoiceSetInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n ChoiceSetInput.prototype.isValid = function () {\n if (this._textInput) {\n if (this.value === \"\" || this.value === this.placeholder) {\n return true;\n }\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (this.value === choice.value) {\n return true;\n }\n }\n return false;\n }\n return _super.prototype.isValid.call(this);\n };\n Object.defineProperty(ChoiceSetInput.prototype, \"value\", {\n get: function () {\n if (!this.isMultiSelect) {\n if (this._selectElement) {\n return this._selectElement.selectedIndex > 0 ? this._selectElement.value : undefined;\n }\n else if (this._textInput) {\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (choice.title && this._textInput.value === choice.title) {\n return choice.value;\n }\n }\n return this._textInput.value;\n }\n else if (this._toggleInputs && this._toggleInputs.length > 0) {\n for (var _b = 0, _c = this._toggleInputs; _b < _c.length; _b++) {\n var toggleInput = _c[_b];\n if (toggleInput.checked) {\n return toggleInput.value;\n }\n }\n }\n return undefined;\n }\n else {\n if (!this._toggleInputs || this._toggleInputs.length == 0) {\n return undefined;\n }\n var result = \"\";\n for (var _d = 0, _e = this._toggleInputs; _d < _e.length; _d++) {\n var toggleInput = _e[_d];\n if (toggleInput.checked) {\n if (result != \"\") {\n result += this.hostConfig.choiceSetInputValueSeparator;\n }\n result += toggleInput.value;\n }\n }\n return result ? result : undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n ChoiceSetInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n ChoiceSetInput.choicesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"choices\", Choice);\n ChoiceSetInput.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_0, \"style\", [\n { value: \"compact\" },\n { value: \"expanded\" },\n { value: \"filtered\", targetVersion: serialization_1.Versions.v1_5 }\n ], \"compact\");\n ChoiceSetInput.isMultiSelectProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isMultiSelect\", false);\n ChoiceSetInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n ChoiceSetInput.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"wrap\", false);\n //#endregion\n ChoiceSetInput.uniqueCategoryCounter = 0;\n __decorate([\n serialization_1.property(ChoiceSetInput.valueProperty)\n ], ChoiceSetInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.styleProperty)\n ], ChoiceSetInput.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.isMultiSelectProperty)\n ], ChoiceSetInput.prototype, \"isMultiSelect\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.placeholderProperty)\n ], ChoiceSetInput.prototype, \"placeholder\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.wrapProperty)\n ], ChoiceSetInput.prototype, \"wrap\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.choicesProperty)\n ], ChoiceSetInput.prototype, \"choices\", void 0);\n return ChoiceSetInput;\n}(Input));\nexports.ChoiceSetInput = ChoiceSetInput;\nvar NumberInput = /** @class */ (function (_super) {\n __extends(NumberInput, _super);\n function NumberInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NumberInput.prototype.internalRender = function () {\n var _this = this;\n this._numberInputElement = document.createElement(\"input\");\n this._numberInputElement.setAttribute(\"type\", \"number\");\n if (this.min !== undefined) {\n this._numberInputElement.setAttribute(\"min\", this.min.toString());\n }\n if (this.max !== undefined) {\n this._numberInputElement.setAttribute(\"max\", this.max.toString());\n }\n this._numberInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-numberInput\");\n this._numberInputElement.style.width = \"100%\";\n this._numberInputElement.tabIndex = 0;\n if (this.defaultValue !== undefined) {\n this._numberInputElement.valueAsNumber = this.defaultValue;\n }\n if (this.placeholder) {\n this._numberInputElement.placeholder = this.placeholder;\n this._numberInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n this._numberInputElement.oninput = function () { _this.valueChanged(); };\n return this._numberInputElement;\n };\n NumberInput.prototype.getJsonTypeName = function () {\n return \"Input.Number\";\n };\n NumberInput.prototype.isSet = function () {\n return this.value !== undefined && !isNaN(this.value);\n };\n NumberInput.prototype.isValid = function () {\n if (this.value === undefined) {\n return !this.isRequired;\n }\n var result = true;\n if (this.min !== undefined) {\n result = result && (this.value >= this.min);\n }\n if (this.max !== undefined) {\n result = result && (this.value <= this.max);\n }\n return result;\n };\n Object.defineProperty(NumberInput.prototype, \"value\", {\n get: function () {\n return this._numberInputElement ? this._numberInputElement.valueAsNumber : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n NumberInput.valueProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"value\");\n NumberInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n NumberInput.minProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"min\");\n NumberInput.maxProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(NumberInput.valueProperty)\n ], NumberInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(NumberInput.minProperty)\n ], NumberInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(NumberInput.maxProperty)\n ], NumberInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(NumberInput.placeholderProperty)\n ], NumberInput.prototype, \"placeholder\", void 0);\n return NumberInput;\n}(Input));\nexports.NumberInput = NumberInput;\nvar DateInput = /** @class */ (function (_super) {\n __extends(DateInput, _super);\n function DateInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateInput.prototype.internalRender = function () {\n var _this = this;\n this._dateInputElement = document.createElement(\"input\");\n this._dateInputElement.setAttribute(\"type\", \"date\");\n if (this.min) {\n this._dateInputElement.setAttribute(\"min\", this.min);\n }\n if (this.max) {\n this._dateInputElement.setAttribute(\"max\", this.max);\n }\n if (this.placeholder) {\n this._dateInputElement.placeholder = this.placeholder;\n this._dateInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n this._dateInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-dateInput\");\n this._dateInputElement.style.width = \"100%\";\n this._dateInputElement.oninput = function () { _this.valueChanged(); };\n if (this.defaultValue) {\n this._dateInputElement.value = this.defaultValue;\n }\n return this._dateInputElement;\n };\n DateInput.prototype.getJsonTypeName = function () {\n return \"Input.Date\";\n };\n DateInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n DateInput.prototype.isValid = function () {\n if (!this.value) {\n return !this.isRequired;\n }\n var valueAsDate = new Date(this.value);\n var result = true;\n if (this.min) {\n var minDate = new Date(this.min);\n result = result && (valueAsDate >= minDate);\n }\n if (this.max) {\n var maxDate = new Date(this.max);\n result = result && (valueAsDate <= maxDate);\n }\n return result;\n };\n Object.defineProperty(DateInput.prototype, \"value\", {\n get: function () {\n return this._dateInputElement ? this._dateInputElement.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n DateInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n DateInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n DateInput.minProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"min\");\n DateInput.maxProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(DateInput.valueProperty)\n ], DateInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(DateInput.minProperty)\n ], DateInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(DateInput.maxProperty)\n ], DateInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(DateInput.placeholderProperty)\n ], DateInput.prototype, \"placeholder\", void 0);\n return DateInput;\n}(Input));\nexports.DateInput = DateInput;\nvar TimeProperty = /** @class */ (function (_super) {\n __extends(TimeProperty, _super);\n function TimeProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, function (sender, property, source, context) {\n var value = source[property.name];\n if (typeof value === \"string\" && value && /^[0-9]{2}:[0-9]{2}$/.test(value)) {\n return value;\n }\n return undefined;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, value);\n }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n return TimeProperty;\n}(serialization_1.CustomProperty));\nexports.TimeProperty = TimeProperty;\nvar TimeInput = /** @class */ (function (_super) {\n __extends(TimeInput, _super);\n function TimeInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeInput.convertTimeStringToDate = function (timeString) {\n return new Date(\"1973-09-04T\" + timeString + \":00Z\");\n };\n TimeInput.prototype.internalRender = function () {\n var _this = this;\n this._timeInputElement = document.createElement(\"input\");\n this._timeInputElement.setAttribute(\"type\", \"time\");\n this._timeInputElement.setAttribute(\"min\", this.min);\n this._timeInputElement.setAttribute(\"max\", this.max);\n this._timeInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-timeInput\");\n this._timeInputElement.style.width = \"100%\";\n this._timeInputElement.oninput = function () { _this.valueChanged(); };\n if (this.placeholder) {\n this._timeInputElement.placeholder = this.placeholder;\n this._timeInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n if (this.defaultValue) {\n this._timeInputElement.value = this.defaultValue;\n }\n return this._timeInputElement;\n };\n TimeInput.prototype.getJsonTypeName = function () {\n return \"Input.Time\";\n };\n TimeInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n TimeInput.prototype.isValid = function () {\n if (!this.value) {\n return !this.isRequired;\n }\n var valueAsDate = TimeInput.convertTimeStringToDate(this.value);\n var result = true;\n if (this.min) {\n var minDate = TimeInput.convertTimeStringToDate(this.min);\n result = result && (valueAsDate >= minDate);\n }\n if (this.max) {\n var maxDate = TimeInput.convertTimeStringToDate(this.max);\n result = result && (valueAsDate <= maxDate);\n }\n return result;\n };\n Object.defineProperty(TimeInput.prototype, \"value\", {\n get: function () {\n return this._timeInputElement ? this._timeInputElement.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n TimeInput.valueProperty = new TimeProperty(serialization_1.Versions.v1_0, \"value\");\n TimeInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n TimeInput.minProperty = new TimeProperty(serialization_1.Versions.v1_0, \"min\");\n TimeInput.maxProperty = new TimeProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(TimeInput.valueProperty)\n ], TimeInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(TimeInput.minProperty)\n ], TimeInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(TimeInput.maxProperty)\n ], TimeInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(TimeInput.placeholderProperty)\n ], TimeInput.prototype, \"placeholder\", void 0);\n return TimeInput;\n}(Input));\nexports.TimeInput = TimeInput;\nvar Action = /** @class */ (function (_super) {\n __extends(Action, _super);\n function Action() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.style = Enums.ActionStyle.Default;\n _this.mode = Enums.ActionMode.Primary;\n _this._state = 0 /* Normal */;\n _this._isFocusable = true;\n return _this;\n }\n //#endregion\n Action.prototype.renderButtonContent = function () {\n if (this.renderedElement) {\n // Cache hostConfig for perf\n var hostConfig = this.hostConfig;\n var titleElement = document.createElement(\"div\");\n titleElement.style.overflow = \"hidden\";\n titleElement.style.textOverflow = \"ellipsis\";\n if (!(hostConfig.actions.iconPlacement == Enums.ActionIconPlacement.AboveTitle || hostConfig.actions.allowTitleToWrap)) {\n titleElement.style.whiteSpace = \"nowrap\";\n }\n if (this.title) {\n titleElement.innerText = this.title;\n }\n if (!this.iconUrl) {\n this.renderedElement.classList.add(\"noIcon\");\n this.renderedElement.appendChild(titleElement);\n }\n else {\n var iconElement = document.createElement(\"img\");\n iconElement.src = this.iconUrl;\n iconElement.style.width = hostConfig.actions.iconSize + \"px\";\n iconElement.style.height = hostConfig.actions.iconSize + \"px\";\n iconElement.style.flex = \"0 0 auto\";\n if (hostConfig.actions.iconPlacement == Enums.ActionIconPlacement.AboveTitle) {\n this.renderedElement.classList.add(\"iconAbove\");\n this.renderedElement.style.flexDirection = \"column\";\n if (this.title) {\n iconElement.style.marginBottom = \"6px\";\n }\n }\n else {\n this.renderedElement.classList.add(\"iconLeft\");\n iconElement.style.maxHeight = \"100%\";\n if (this.title) {\n iconElement.style.marginRight = \"6px\";\n }\n }\n this.renderedElement.appendChild(iconElement);\n this.renderedElement.appendChild(titleElement);\n }\n }\n };\n Action.prototype.getParentContainer = function () {\n if (this.parent instanceof Container) {\n return this.parent;\n }\n return this.parent ? this.parent.getParentContainer() : undefined;\n };\n Action.prototype.updateCssClasses = function () {\n var _a, _b;\n if (this.parent && this.renderedElement) {\n var hostConfig = this.parent.hostConfig;\n this.renderedElement.className = hostConfig.makeCssClassName(this.isEnabled ? \"ac-pushButton\" : \"ac-pushButton-disabled\");\n var parentContainer = this.getParentContainer();\n if (parentContainer) {\n var parentContainerStyle = parentContainer.getEffectiveStyle();\n if (parentContainerStyle) {\n this.renderedElement.classList.add(\"style-\" + parentContainerStyle);\n }\n }\n this.renderedElement.tabIndex = this.isFocusable ? 0 : -1;\n switch (this._state) {\n case 1 /* Expanded */:\n this.renderedElement.classList.add(hostConfig.makeCssClassName(\"expanded\"));\n break;\n case 2 /* Subdued */:\n this.renderedElement.classList.add(hostConfig.makeCssClassName(\"subdued\"));\n break;\n }\n if (this.style && this.isEnabled) {\n if (this.style === Enums.ActionStyle.Positive) {\n (_a = this.renderedElement.classList).add.apply(_a, hostConfig.makeCssClassNames(\"primary\", \"style-positive\"));\n }\n else {\n (_b = this.renderedElement.classList).add.apply(_b, hostConfig.makeCssClassNames(\"style-\" + this.style.toLowerCase()));\n }\n }\n }\n };\n Action.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext();\n };\n Action.prototype.internalGetReferencedInputs = function () {\n return {};\n };\n Action.prototype.internalPrepareForExecution = function (inputs) {\n // Do nothing in base implementation\n };\n Action.prototype.internalValidateInputs = function (referencedInputs) {\n var result = [];\n if (referencedInputs) {\n for (var _i = 0, _a = Object.keys(referencedInputs); _i < _a.length; _i++) {\n var key = _a[_i];\n var input = referencedInputs[key];\n if (!input.validateValue()) {\n result.push(input);\n }\n }\n }\n return result;\n };\n Action.prototype.shouldSerialize = function (context) {\n return context.actionRegistry.findByName(this.getJsonTypeName()) !== undefined;\n };\n Action.prototype.raiseExecuteActionEvent = function () {\n if (this.onExecute) {\n this.onExecute(this);\n }\n raiseExecuteActionEvent(this);\n };\n Action.prototype.getHref = function () {\n return \"\";\n };\n Action.prototype.getAriaRole = function () {\n return \"button\";\n };\n Action.prototype.setupElementForAccessibility = function (element, promoteTooltipToLabel) {\n if (promoteTooltipToLabel === void 0) { promoteTooltipToLabel = false; }\n element.tabIndex = this.isEnabled ? 0 : -1;\n element.setAttribute(\"role\", this.getAriaRole());\n if (element instanceof HTMLButtonElement) {\n element.disabled = !this.isEnabled;\n }\n if (!this.isEnabled) {\n element.setAttribute(\"aria-disabled\", \"true\");\n }\n else {\n element.classList.add(this.hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n if (this.title) {\n element.setAttribute(\"aria-label\", this.title);\n element.title = this.title;\n }\n if (this.tooltip) {\n var targetAriaAttribute = promoteTooltipToLabel ? (this.title ? \"aria-description\" : \"aria-label\") : \"aria-description\";\n element.setAttribute(targetAriaAttribute, this.tooltip);\n element.title = this.tooltip;\n }\n };\n Action.prototype.parse = function (source, context) {\n return _super.prototype.parse.call(this, source, context ? context : new SerializationContext());\n };\n Action.prototype.render = function () {\n var _this = this;\n var buttonElement = document.createElement(\"button\");\n buttonElement.type = \"button\";\n buttonElement.style.display = \"flex\";\n buttonElement.style.alignItems = \"center\";\n buttonElement.style.justifyContent = \"center\";\n buttonElement.onclick = function (e) {\n if (_this.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.execute();\n }\n };\n this._renderedElement = buttonElement;\n this.renderButtonContent();\n this.updateCssClasses();\n this.setupElementForAccessibility(buttonElement);\n };\n Action.prototype.execute = function () {\n if (this._actionCollection) {\n this._actionCollection.actionExecuted(this);\n }\n this.raiseExecuteActionEvent();\n };\n Action.prototype.prepareForExecution = function () {\n var referencedInputs = this.getReferencedInputs();\n var invalidInputs = this.internalValidateInputs(referencedInputs);\n if (invalidInputs.length > 0) {\n invalidInputs[0].focus();\n return false;\n }\n this.internalPrepareForExecution(referencedInputs);\n return true;\n };\n ;\n Action.prototype.remove = function () {\n if (this._actionCollection) {\n return this._actionCollection.removeAction(this);\n }\n return false;\n };\n Action.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [];\n };\n Action.prototype.getResourceInformation = function () {\n return this.iconUrl ? [{ url: this.iconUrl, mimeType: \"image\" }] : [];\n };\n Action.prototype.getActionById = function (id) {\n return this.id === id ? this : undefined;\n };\n Action.prototype.getReferencedInputs = function () {\n return this.internalGetReferencedInputs();\n };\n /**\n * Validates the inputs associated with this action.\n *\n * @returns A list of inputs that failed validation, or an empty array if no input failed validation.\n */\n Action.prototype.validateInputs = function () {\n return this.internalValidateInputs(this.getReferencedInputs());\n };\n Object.defineProperty(Action.prototype, \"isPrimary\", {\n get: function () {\n return this.style == Enums.ActionStyle.Positive;\n },\n set: function (value) {\n if (value) {\n this.style = Enums.ActionStyle.Positive;\n }\n else {\n if (this.style == Enums.ActionStyle.Positive) {\n this.style = Enums.ActionStyle.Default;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"hostConfig\", {\n get: function () {\n return this.parent ? this.parent.hostConfig : host_config_1.defaultHostConfig;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"state\", {\n get: function () {\n return this._state;\n },\n set: function (value) {\n if (this._state !== value) {\n this._state = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"isFocusable\", {\n get: function () {\n return this._isFocusable;\n },\n set: function (value) {\n if (this._isFocusable !== value) {\n this._isFocusable = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n Action.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Action.iconUrlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"iconUrl\");\n Action.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_2, \"style\", [\n { value: Enums.ActionStyle.Default },\n { value: Enums.ActionStyle.Positive },\n { value: Enums.ActionStyle.Destructive }\n ], Enums.ActionStyle.Default);\n Action.modeProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_5, \"mode\", [\n { value: Enums.ActionMode.Primary },\n { value: Enums.ActionMode.Secondary }\n ], Enums.ActionMode.Primary);\n Action.tooltipProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_5, \"tooltip\");\n Action.isEnabledProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"isEnabled\", true);\n __decorate([\n serialization_1.property(Action.titleProperty)\n ], Action.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(Action.iconUrlProperty)\n ], Action.prototype, \"iconUrl\", void 0);\n __decorate([\n serialization_1.property(Action.styleProperty)\n ], Action.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(Action.modeProperty)\n ], Action.prototype, \"mode\", void 0);\n __decorate([\n serialization_1.property(Action.tooltipProperty)\n ], Action.prototype, \"tooltip\", void 0);\n __decorate([\n serialization_1.property(Action.isEnabledProperty)\n ], Action.prototype, \"isEnabled\", void 0);\n return Action;\n}(card_object_1.CardObject));\nexports.Action = Action;\nvar SubmitActionBase = /** @class */ (function (_super) {\n __extends(SubmitActionBase, _super);\n function SubmitActionBase() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._isPrepared = false;\n return _this;\n }\n SubmitActionBase.prototype.internalGetReferencedInputs = function () {\n var result = {};\n if (this.associatedInputs !== \"none\") {\n var current = this.parent;\n var inputs = [];\n while (current) {\n inputs = inputs.concat(current.getAllInputs(false));\n current = current.parent;\n }\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n if (input.id) {\n result[input.id] = input;\n }\n }\n }\n return result;\n };\n SubmitActionBase.prototype.internalPrepareForExecution = function (inputs) {\n if (this._originalData) {\n this._processedData = JSON.parse(JSON.stringify(this._originalData));\n }\n else {\n this._processedData = {};\n }\n if (this._processedData && inputs) {\n for (var _i = 0, _a = Object.keys(inputs); _i < _a.length; _i++) {\n var key = _a[_i];\n var input = inputs[key];\n if (input.id && input.isSet()) {\n this._processedData[input.id] = typeof input.value === \"string\" ? input.value : input.value.toString();\n }\n }\n }\n this._isPrepared = true;\n };\n Object.defineProperty(SubmitActionBase.prototype, \"data\", {\n get: function () {\n return this._isPrepared ? this._processedData : this._originalData;\n },\n set: function (value) {\n this._originalData = value;\n this._isPrepared = false;\n },\n enumerable: false,\n configurable: true\n });\n SubmitActionBase.dataProperty = new serialization_1.PropertyDefinition(serialization_1.Versions.v1_0, \"data\");\n SubmitActionBase.associatedInputsProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_3, \"associatedInputs\", function (sender, property, source, context) {\n var value = source[property.name];\n if (value !== undefined && typeof value === \"string\") {\n return value.toLowerCase() === \"none\" ? \"none\" : \"auto\";\n }\n return undefined;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, value);\n });\n __decorate([\n serialization_1.property(SubmitActionBase.dataProperty)\n ], SubmitActionBase.prototype, \"_originalData\", void 0);\n __decorate([\n serialization_1.property(SubmitActionBase.associatedInputsProperty)\n ], SubmitActionBase.prototype, \"associatedInputs\", void 0);\n return SubmitActionBase;\n}(Action));\nexports.SubmitActionBase = SubmitActionBase;\nvar SubmitAction = /** @class */ (function (_super) {\n __extends(SubmitAction, _super);\n function SubmitAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SubmitAction.prototype.getJsonTypeName = function () {\n return SubmitAction.JsonTypeName;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n SubmitAction.JsonTypeName = \"Action.Submit\";\n return SubmitAction;\n}(SubmitActionBase));\nexports.SubmitAction = SubmitAction;\nvar ExecuteAction = /** @class */ (function (_super) {\n __extends(ExecuteAction, _super);\n function ExecuteAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n ExecuteAction.prototype.getJsonTypeName = function () {\n return ExecuteAction.JsonTypeName;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ExecuteAction.JsonTypeName = \"Action.Execute\";\n //#region Schema\n ExecuteAction.verbProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"verb\");\n __decorate([\n serialization_1.property(ExecuteAction.verbProperty)\n ], ExecuteAction.prototype, \"verb\", void 0);\n return ExecuteAction;\n}(SubmitActionBase));\nexports.ExecuteAction = ExecuteAction;\nvar OpenUrlAction = /** @class */ (function (_super) {\n __extends(OpenUrlAction, _super);\n function OpenUrlAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OpenUrlAction.prototype.getJsonTypeName = function () {\n return OpenUrlAction.JsonTypeName;\n };\n OpenUrlAction.prototype.getAriaRole = function () {\n return \"link\";\n };\n OpenUrlAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.url) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"url\"));\n }\n };\n OpenUrlAction.prototype.getHref = function () {\n return this.url;\n };\n //#region Schema\n OpenUrlAction.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n OpenUrlAction.JsonTypeName = \"Action.OpenUrl\";\n __decorate([\n serialization_1.property(OpenUrlAction.urlProperty)\n ], OpenUrlAction.prototype, \"url\", void 0);\n return OpenUrlAction;\n}(Action));\nexports.OpenUrlAction = OpenUrlAction;\nvar ToggleVisibilityAction = /** @class */ (function (_super) {\n __extends(ToggleVisibilityAction, _super);\n function ToggleVisibilityAction() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.targetElements = {};\n return _this;\n }\n ToggleVisibilityAction.prototype.updateAriaControlsAttribute = function () {\n // apply aria labels to make it clear which elements this action will toggle\n if (this.targetElements) {\n var elementIds = Object.keys(this.targetElements);\n if (this._renderedElement) {\n if (elementIds.length > 0) {\n this._renderedElement.setAttribute(\"aria-controls\", elementIds.join(\" \"));\n }\n else {\n this._renderedElement.removeAttribute(\"aria-controls\");\n }\n }\n }\n };\n ToggleVisibilityAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.targetElements) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"targetElements\"));\n }\n };\n ToggleVisibilityAction.prototype.getJsonTypeName = function () {\n return ToggleVisibilityAction.JsonTypeName;\n };\n ToggleVisibilityAction.prototype.render = function () {\n _super.prototype.render.call(this);\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.prototype.execute = function () {\n if (this.parent) {\n for (var _i = 0, _a = Object.keys(this.targetElements); _i < _a.length; _i++) {\n var elementId = _a[_i];\n var targetElement = this.parent.getRootElement().getElementById(elementId);\n if (targetElement) {\n if (typeof this.targetElements[elementId] === \"boolean\") {\n targetElement.isVisible = this.targetElements[elementId];\n }\n else {\n targetElement.isVisible = !targetElement.isVisible;\n }\n }\n }\n }\n };\n ToggleVisibilityAction.prototype.addTargetElement = function (elementId, isVisible) {\n if (isVisible === void 0) { isVisible = undefined; }\n this.targetElements[elementId] = isVisible;\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.prototype.removeTargetElement = function (elementId) {\n delete this.targetElements[elementId];\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.targetElementsProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_2, \"targetElements\", function (sender, property, source, context) {\n var result = {};\n if (Array.isArray(source[property.name])) {\n for (var _i = 0, _a = source[property.name]; _i < _a.length; _i++) {\n var item = _a[_i];\n if (typeof item === \"string\") {\n result[item] = undefined;\n }\n else if (typeof item === \"object\") {\n var elementId = item[\"elementId\"];\n if (typeof elementId === \"string\") {\n result[elementId] = Utils.parseBool(item[\"isVisible\"]);\n }\n }\n }\n }\n return result;\n }, function (sender, property, target, value, context) {\n var targetElements = [];\n for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) {\n var id = _a[_i];\n if (typeof value[id] === \"boolean\") {\n targetElements.push({\n elementId: id,\n isVisible: value[id]\n });\n }\n else {\n targetElements.push(id);\n }\n }\n context.serializeArray(target, property.name, targetElements);\n }, {}, function (sender) { return {}; });\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ToggleVisibilityAction.JsonTypeName = \"Action.ToggleVisibility\";\n __decorate([\n serialization_1.property(ToggleVisibilityAction.targetElementsProperty)\n ], ToggleVisibilityAction.prototype, \"targetElements\", void 0);\n return ToggleVisibilityAction;\n}(Action));\nexports.ToggleVisibilityAction = ToggleVisibilityAction;\nvar StringWithSubstitutionProperty = /** @class */ (function (_super) {\n __extends(StringWithSubstitutionProperty, _super);\n function StringWithSubstitutionProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, undefined, function () { return new shared_1.StringWithSubstitutions(); }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n StringWithSubstitutionProperty.prototype.parse = function (sender, source, context) {\n var result = new shared_1.StringWithSubstitutions();\n result.set(Utils.parseString(source[this.name]));\n return result;\n };\n StringWithSubstitutionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value.getOriginal());\n };\n return StringWithSubstitutionProperty;\n}(serialization_1.PropertyDefinition));\nvar HttpHeader = /** @class */ (function (_super) {\n __extends(HttpHeader, _super);\n //#endregion\n function HttpHeader(name, value) {\n if (name === void 0) { name = \"\"; }\n if (value === void 0) { value = \"\"; }\n var _this = _super.call(this) || this;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n HttpHeader.prototype.getSchemaKey = function () {\n return \"HttpHeader\";\n };\n HttpHeader.prototype.getReferencedInputs = function (inputs, referencedInputs) {\n this._value.getReferencedInputs(inputs, referencedInputs);\n };\n HttpHeader.prototype.prepareForExecution = function (inputs) {\n this._value.substituteInputValues(inputs, shared_1.ContentTypes.applicationXWwwFormUrlencoded);\n };\n Object.defineProperty(HttpHeader.prototype, \"value\", {\n get: function () {\n return this._value.get();\n },\n set: function (newValue) {\n this._value.set(newValue);\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n HttpHeader.nameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"name\");\n HttpHeader.valueProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(HttpHeader.nameProperty)\n ], HttpHeader.prototype, \"name\", void 0);\n __decorate([\n serialization_1.property(HttpHeader.valueProperty)\n ], HttpHeader.prototype, \"_value\", void 0);\n return HttpHeader;\n}(serialization_1.SerializableObject));\nexports.HttpHeader = HttpHeader;\nvar HttpAction = /** @class */ (function (_super) {\n __extends(HttpAction, _super);\n function HttpAction() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._ignoreInputValidation = false;\n return _this;\n }\n HttpAction.prototype.internalGetReferencedInputs = function () {\n var allInputs = this.parent ? this.parent.getRootElement().getAllInputs() : [];\n var result = {};\n this._url.getReferencedInputs(allInputs, result);\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n header.getReferencedInputs(allInputs, result);\n }\n this._body.getReferencedInputs(allInputs, result);\n return result;\n };\n HttpAction.prototype.internalPrepareForExecution = function (inputs) {\n if (inputs) {\n this._url.substituteInputValues(inputs, shared_1.ContentTypes.applicationXWwwFormUrlencoded);\n var contentType = shared_1.ContentTypes.applicationJson;\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n header.prepareForExecution(inputs);\n if (header.name && header.name.toLowerCase() == \"content-type\") {\n contentType = header.value;\n }\n }\n this._body.substituteInputValues(inputs, contentType);\n }\n };\n ;\n HttpAction.prototype.getJsonTypeName = function () {\n return HttpAction.JsonTypeName;\n };\n HttpAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.url) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"url\"));\n }\n if (this.headers.length > 0) {\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n if (!header.name) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.actionHttpHeadersMustHaveNameAndValue());\n }\n }\n }\n };\n Object.defineProperty(HttpAction.prototype, \"ignoreInputValidation\", {\n get: function () {\n return this._ignoreInputValidation;\n },\n set: function (value) {\n this._ignoreInputValidation = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HttpAction.prototype, \"url\", {\n get: function () {\n return this._url.get();\n },\n set: function (value) {\n this._url.set(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HttpAction.prototype, \"body\", {\n get: function () {\n return this._body.get();\n },\n set: function (value) {\n this._body.set(value);\n },\n enumerable: false,\n configurable: true\n });\n HttpAction.urlProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"url\");\n HttpAction.bodyProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"body\");\n HttpAction.methodProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"method\");\n HttpAction.headersProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"headers\", HttpHeader);\n HttpAction.ignoreInputValidationProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"ignoreInputValidation\", false);\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n HttpAction.JsonTypeName = \"Action.Http\";\n __decorate([\n serialization_1.property(HttpAction.urlProperty)\n ], HttpAction.prototype, \"_url\", void 0);\n __decorate([\n serialization_1.property(HttpAction.bodyProperty)\n ], HttpAction.prototype, \"_body\", void 0);\n __decorate([\n serialization_1.property(HttpAction.methodProperty)\n ], HttpAction.prototype, \"method\", void 0);\n __decorate([\n serialization_1.property(HttpAction.headersProperty)\n ], HttpAction.prototype, \"headers\", void 0);\n __decorate([\n serialization_1.property(HttpAction.ignoreInputValidationProperty)\n ], HttpAction.prototype, \"_ignoreInputValidation\", void 0);\n return HttpAction;\n}(Action));\nexports.HttpAction = HttpAction;\nvar ShowCardAction = /** @class */ (function (_super) {\n __extends(ShowCardAction, _super);\n function ShowCardAction() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.card = new InlineAdaptiveCard();\n return _this;\n }\n ShowCardAction.prototype.updateCssClasses = function () {\n _super.prototype.updateCssClasses.call(this);\n if (this.renderedElement) {\n var effectiveHostConfig = this.parent ? this.parent.hostConfig : host_config_1.defaultHostConfig;\n this.renderedElement.classList.add(effectiveHostConfig.makeCssClassName(\"expandable\"));\n this.renderedElement.setAttribute(\"aria-expanded\", (this.state === 1 /* Expanded */).toString());\n }\n };\n ShowCardAction.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n var jsonCard = source[\"card\"];\n if (jsonCard) {\n this.card.parse(jsonCard, context);\n }\n else {\n context.logParseEvent(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.showCardMustHaveCard());\n }\n };\n ShowCardAction.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n if (this.card) {\n context.serializeValue(target, \"card\", this.card.toJSON(context));\n }\n };\n ShowCardAction.prototype.raiseExecuteActionEvent = function () {\n if (this.hostConfig.actions.showCard.actionMode === Enums.ShowCardActionMode.Popup) {\n // Only raise the event in Popup mode.\n _super.prototype.raiseExecuteActionEvent.call(this);\n }\n };\n ShowCardAction.prototype.getJsonTypeName = function () {\n return ShowCardAction.JsonTypeName;\n };\n ShowCardAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n this.card.internalValidateProperties(context);\n };\n ShowCardAction.prototype.setParent = function (value) {\n _super.prototype.setParent.call(this, value);\n this.card.setParent(value);\n };\n ShowCardAction.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return this.card.getAllInputs(processActions);\n };\n ShowCardAction.prototype.getResourceInformation = function () {\n return _super.prototype.getResourceInformation.call(this).concat(this.card.getResourceInformation());\n };\n ShowCardAction.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result) {\n result = this.card.getActionById(id);\n }\n return result;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ShowCardAction.JsonTypeName = \"Action.ShowCard\";\n return ShowCardAction;\n}(Action));\nexports.ShowCardAction = ShowCardAction;\nvar OverflowAction = /** @class */ (function (_super) {\n __extends(OverflowAction, _super);\n function OverflowAction(actions) {\n var _this = _super.call(this) || this;\n _this.actions = actions;\n _this.title = strings_1.Strings.defaults.overflowButtonText();\n return _this;\n }\n OverflowAction.prototype.getActions = function () {\n return this.actions;\n };\n OverflowAction.prototype.getJsonTypeName = function () {\n return ShowCardAction.JsonTypeName;\n };\n OverflowAction.prototype.execute = function () {\n var _this = this;\n var _a;\n var shouldDisplayPopupMenu = !raiseDisplayOverflowActionMenuEvent(this, this.renderedElement);\n if (shouldDisplayPopupMenu && this.renderedElement) {\n var contextMenu_1 = new controls_1.PopupMenu();\n contextMenu_1.hostConfig = this.hostConfig;\n var _loop_1 = function (i) {\n var menuItem = new controls_1.MenuItem(i.toString(), (_a = this_1.actions[i].title) !== null && _a !== void 0 ? _a : \"\");\n menuItem.isEnabled = this_1.actions[i].isEnabled;\n menuItem.onClick = function () {\n var actionToExecute = _this.actions[i];\n contextMenu_1.closePopup(false);\n if (actionToExecute.isEnabled) {\n actionToExecute.execute();\n }\n };\n contextMenu_1.items.add(menuItem);\n };\n var this_1 = this;\n for (var i = 0; i < this.actions.length; i++) {\n _loop_1(i);\n }\n ;\n contextMenu_1.popup(this.renderedElement);\n }\n };\n OverflowAction.JsonTypeName = \"Action.Overflow\";\n return OverflowAction;\n}(Action));\nvar ActionCollection = /** @class */ (function () {\n function ActionCollection(owner) {\n this._items = [];\n this._renderedActions = [];\n this._owner = owner;\n }\n ActionCollection.prototype.isActionAllowed = function (action) {\n var forbiddenTypes = this._owner.getForbiddenActionTypes();\n if (forbiddenTypes) {\n for (var _i = 0, forbiddenTypes_1 = forbiddenTypes; _i < forbiddenTypes_1.length; _i++) {\n var forbiddenType = forbiddenTypes_1[_i];\n if (action.constructor === forbiddenType) {\n return false;\n }\n }\n }\n return true;\n };\n ActionCollection.prototype.refreshContainer = function () {\n this._actionCardContainer.innerHTML = \"\";\n if (!this._actionCard) {\n this._actionCardContainer.style.marginTop = \"0px\";\n return;\n }\n this._actionCardContainer.style.marginTop = this.renderedActionCount > 0 ? this._owner.hostConfig.actions.showCard.inlineTopMargin + \"px\" : \"0px\";\n var padding = this._owner.getEffectivePadding();\n this._owner.getImmediateSurroundingPadding(padding);\n var physicalPadding = this._owner.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n if (this._actionCard) {\n this._actionCard.style.paddingLeft = physicalPadding.left + \"px\";\n this._actionCard.style.paddingRight = physicalPadding.right + \"px\";\n this._actionCard.style.marginLeft = \"-\" + physicalPadding.left + \"px\";\n this._actionCard.style.marginRight = \"-\" + physicalPadding.right + \"px\";\n if (physicalPadding.bottom != 0 && !this._owner.isDesignMode()) {\n this._actionCard.style.paddingBottom = physicalPadding.bottom + \"px\";\n this._actionCard.style.marginBottom = \"-\" + physicalPadding.bottom + \"px\";\n }\n Utils.appendChild(this._actionCardContainer, this._actionCard);\n }\n };\n ActionCollection.prototype.layoutChanged = function () {\n this._owner.getRootElement().updateLayout();\n };\n ActionCollection.prototype.showActionCard = function (action, suppressStyle, raiseEvent) {\n if (suppressStyle === void 0) { suppressStyle = false; }\n if (raiseEvent === void 0) { raiseEvent = true; }\n action.card.suppressStyle = suppressStyle;\n // Always re-render a ShowCard action in design mode; reuse already rendered ShowCard (if available) otherwise\n var renderedCard = action.card.renderedElement && !this._owner.isDesignMode() ? action.card.renderedElement : action.card.render();\n this._actionCard = renderedCard;\n this._expandedAction = action;\n this.refreshContainer();\n if (raiseEvent) {\n this.layoutChanged();\n raiseInlineCardExpandedEvent(action, true);\n }\n };\n ActionCollection.prototype.collapseExpandedAction = function () {\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var action = _a[_i];\n action.state = 0 /* Normal */;\n }\n var previouslyExpandedAction = this._expandedAction;\n this._expandedAction = undefined;\n this._actionCard = undefined;\n this.refreshContainer();\n if (previouslyExpandedAction) {\n this.layoutChanged();\n raiseInlineCardExpandedEvent(previouslyExpandedAction, false);\n }\n };\n ActionCollection.prototype.expandShowCardAction = function (action, raiseEvent) {\n var _this = this;\n var afterSelectedAction = false;\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var renderedAction = _a[_i];\n // Remove actions after selected action from tabOrder, to skip focus directly to expanded card\n if (afterSelectedAction) {\n renderedAction.isFocusable = false;\n }\n if (renderedAction !== action) {\n renderedAction.state = 2 /* Subdued */;\n }\n else {\n renderedAction.state = 1 /* Expanded */;\n afterSelectedAction = true;\n if (renderedAction.renderedElement) {\n renderedAction.renderedElement.onblur = function (e) {\n for (var _i = 0, _a = _this._renderedActions; _i < _a.length; _i++) {\n var ra = _a[_i];\n ra.isFocusable = true;\n }\n };\n }\n }\n }\n this.showActionCard(action, !(this._owner.isAtTheVeryLeft() && this._owner.isAtTheVeryRight()), raiseEvent);\n };\n ActionCollection.prototype.actionExecuted = function (action) {\n if (!(action instanceof ShowCardAction)) {\n this.collapseExpandedAction();\n }\n else {\n if (action === this._expandedAction) {\n this.collapseExpandedAction();\n }\n else if (this._owner.hostConfig.actions.showCard.actionMode === Enums.ShowCardActionMode.Inline) {\n this.expandShowCardAction(action, true);\n }\n }\n };\n ActionCollection.prototype.parse = function (source, context) {\n this.clear();\n if (Array.isArray(source)) {\n for (var _i = 0, source_1 = source; _i < source_1.length; _i++) {\n var jsonAction = source_1[_i];\n var action = context.parseAction(this._owner, jsonAction, [], !this._owner.isDesignMode());\n if (action) {\n this.addAction(action);\n }\n }\n }\n };\n ActionCollection.prototype.toJSON = function (target, propertyName, context) {\n context.serializeArray(target, propertyName, this._items);\n };\n ActionCollection.prototype.getActionAt = function (id) {\n return this._items[id];\n };\n ActionCollection.prototype.getActionCount = function () {\n return this._items.length;\n };\n ActionCollection.prototype.getActionById = function (id) {\n var result = undefined;\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n result = item.getActionById(id);\n if (result) {\n break;\n }\n }\n return result;\n };\n ActionCollection.prototype.validateProperties = function (context) {\n if (this._owner.hostConfig.actions.maxActions && this._items.length > this._owner.hostConfig.actions.maxActions) {\n context.addFailure(this._owner, Enums.ValidationEvent.TooManyActions, strings_1.Strings.errors.tooManyActions(this._owner.hostConfig.actions.maxActions));\n }\n if (this._items.length > 0 && !this._owner.hostConfig.supportsInteractivity) {\n context.addFailure(this._owner, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.interactivityNotAllowed());\n }\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (!this.isActionAllowed(item)) {\n context.addFailure(this._owner, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(item.getJsonTypeName()));\n }\n item.internalValidateProperties(context);\n }\n };\n ActionCollection.prototype.render = function (orientation, isDesignMode) {\n // Cache hostConfig for better perf\n var hostConfig = this._owner.hostConfig;\n if (!hostConfig.supportsInteractivity) {\n return undefined;\n }\n var element = document.createElement(\"div\");\n var maxActions = hostConfig.actions.maxActions ? Math.min(hostConfig.actions.maxActions, this._items.length) : this._items.length;\n this._actionCardContainer = document.createElement(\"div\");\n this._renderedActions = [];\n if (hostConfig.actions.preExpandSingleShowCardAction && maxActions == 1 && this._items[0] instanceof ShowCardAction && this.isActionAllowed(this._items[0])) {\n this.showActionCard(this._items[0], true);\n this._renderedActions.push(this._items[0]);\n }\n else {\n var buttonStrip = document.createElement(\"div\");\n buttonStrip.className = hostConfig.makeCssClassName(\"ac-actionSet\");\n buttonStrip.style.display = \"flex\";\n buttonStrip.setAttribute(\"role\", \"menubar\");\n if (orientation == Enums.Orientation.Horizontal) {\n buttonStrip.style.flexDirection = \"row\";\n if (this._owner.horizontalAlignment && hostConfig.actions.actionAlignment != Enums.ActionAlignment.Stretch) {\n switch (this._owner.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n buttonStrip.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n buttonStrip.style.justifyContent = \"flex-end\";\n break;\n default:\n buttonStrip.style.justifyContent = \"flex-start\";\n break;\n }\n }\n else {\n switch (hostConfig.actions.actionAlignment) {\n case Enums.ActionAlignment.Center:\n buttonStrip.style.justifyContent = \"center\";\n break;\n case Enums.ActionAlignment.Right:\n buttonStrip.style.justifyContent = \"flex-end\";\n break;\n default:\n buttonStrip.style.justifyContent = \"flex-start\";\n break;\n }\n }\n }\n else {\n buttonStrip.style.flexDirection = \"column\";\n if (this._owner.horizontalAlignment && hostConfig.actions.actionAlignment != Enums.ActionAlignment.Stretch) {\n switch (this._owner.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n buttonStrip.style.alignItems = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n buttonStrip.style.alignItems = \"flex-end\";\n break;\n default:\n buttonStrip.style.alignItems = \"flex-start\";\n break;\n }\n }\n else {\n switch (hostConfig.actions.actionAlignment) {\n case Enums.ActionAlignment.Center:\n buttonStrip.style.alignItems = \"center\";\n break;\n case Enums.ActionAlignment.Right:\n buttonStrip.style.alignItems = \"flex-end\";\n break;\n case Enums.ActionAlignment.Stretch:\n buttonStrip.style.alignItems = \"stretch\";\n break;\n default:\n buttonStrip.style.alignItems = \"flex-start\";\n break;\n }\n }\n }\n var allowedActions = this._items.filter(this.isActionAllowed.bind(this));\n var primaryActions_1 = [];\n var secondaryActions_1 = [];\n if (!this._owner.isDesignMode()) {\n allowedActions.forEach(function (action) { return action.mode === Enums.ActionMode.Secondary ? secondaryActions_1.push(action) : primaryActions_1.push(action); });\n // If primaryActions.length > maxActions, extra actions are moved to overflow\n var overflowPrimaryActions = primaryActions_1.splice(hostConfig.actions.maxActions);\n if (shared_1.GlobalSettings.allowMoreThanMaxActionsInOverflowMenu) {\n secondaryActions_1.push.apply(secondaryActions_1, overflowPrimaryActions);\n }\n var shouldRenderOverflowActionButton = true;\n if (secondaryActions_1.length > 0) {\n if (!this._overflowAction) {\n this._overflowAction = new OverflowAction(secondaryActions_1);\n this._overflowAction.setParent(this._owner);\n this._overflowAction[\"_actionCollection\"] = this;\n }\n var isRootAction = this._owner instanceof AdaptiveCard && !this._owner.parent;\n shouldRenderOverflowActionButton = !raiseRenderOverflowActionsEvent(this._overflowAction, isRootAction);\n }\n if (this._overflowAction && shouldRenderOverflowActionButton) {\n primaryActions_1.push(this._overflowAction);\n }\n }\n else {\n primaryActions_1 = allowedActions;\n }\n for (var i = 0; i < primaryActions_1.length; i++) {\n var action = primaryActions_1[i];\n action.render();\n if (action.renderedElement) {\n if (primaryActions_1.length > 1) {\n action.renderedElement.setAttribute(\"aria-posinset\", (i + 1).toString());\n action.renderedElement.setAttribute(\"aria-setsize\", primaryActions_1.length.toString());\n action.renderedElement.setAttribute(\"role\", \"menuitem\");\n }\n if (hostConfig.actions.actionsOrientation == Enums.Orientation.Horizontal && hostConfig.actions.actionAlignment == Enums.ActionAlignment.Stretch) {\n action.renderedElement.style.flex = \"0 1 100%\";\n }\n else {\n action.renderedElement.style.flex = \"0 1 auto\";\n }\n buttonStrip.appendChild(action.renderedElement);\n this._renderedActions.push(action);\n if (i < primaryActions_1.length - 1 && hostConfig.actions.buttonSpacing > 0) {\n var spacer = document.createElement(\"div\");\n if (orientation === Enums.Orientation.Horizontal) {\n spacer.style.flex = \"0 0 auto\";\n spacer.style.width = hostConfig.actions.buttonSpacing + \"px\";\n }\n else {\n spacer.style.height = hostConfig.actions.buttonSpacing + \"px\";\n }\n Utils.appendChild(buttonStrip, spacer);\n }\n }\n }\n var buttonStripContainer = document.createElement(\"div\");\n buttonStripContainer.style.overflow = \"hidden\";\n buttonStripContainer.appendChild(buttonStrip);\n Utils.appendChild(element, buttonStripContainer);\n }\n Utils.appendChild(element, this._actionCardContainer);\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var renderedAction = _a[_i];\n if (renderedAction.state == 1 /* Expanded */) {\n this.expandShowCardAction(renderedAction, false);\n break;\n }\n }\n return this._renderedActions.length > 0 ? element : undefined;\n };\n ActionCollection.prototype.addAction = function (action) {\n if (!action) {\n throw new Error(\"The action parameter cannot be null.\");\n }\n if ((!action.parent || action.parent === this._owner) && this._items.indexOf(action) < 0) {\n this._items.push(action);\n if (!action.parent) {\n action.setParent(this._owner);\n }\n action[\"_actionCollection\"] = this;\n }\n else {\n throw new Error(strings_1.Strings.errors.actionAlreadyParented());\n }\n };\n ActionCollection.prototype.removeAction = function (action) {\n if (this.expandedAction && this._expandedAction == action) {\n this.collapseExpandedAction();\n }\n var actionIndex = this._items.indexOf(action);\n if (actionIndex >= 0) {\n this._items.splice(actionIndex, 1);\n action.setParent(undefined);\n action[\"_actionCollection\"] = undefined;\n for (var i = 0; i < this._renderedActions.length; i++) {\n if (this._renderedActions[i] == action) {\n this._renderedActions.splice(i, 1);\n break;\n }\n }\n return true;\n }\n return false;\n };\n ActionCollection.prototype.clear = function () {\n this._items = [];\n this._renderedActions = [];\n this._expandedAction = undefined;\n };\n ActionCollection.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = [];\n if (processActions) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var action = _a[_i];\n result = result.concat(action.getAllInputs());\n }\n }\n return result;\n };\n ActionCollection.prototype.getResourceInformation = function () {\n var result = [];\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var action = _a[_i];\n result = result.concat(action.getResourceInformation());\n }\n return result;\n };\n Object.defineProperty(ActionCollection.prototype, \"renderedActionCount\", {\n get: function () {\n return this._renderedActions.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ActionCollection.prototype, \"expandedAction\", {\n get: function () {\n return this._expandedAction;\n },\n enumerable: false,\n configurable: true\n });\n return ActionCollection;\n}());\nvar ActionSet = /** @class */ (function (_super) {\n __extends(ActionSet, _super);\n function ActionSet() {\n var _this = _super.call(this) || this;\n _this._actionCollection = new ActionCollection(_this);\n return _this;\n }\n ActionSet.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._actionCollection.parse(source[\"actions\"], context);\n };\n ActionSet.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n this._actionCollection.toJSON(target, \"actions\", context);\n };\n ActionSet.prototype.internalRender = function () {\n return this._actionCollection.render(this.orientation !== undefined ? this.orientation : this.hostConfig.actions.actionsOrientation, this.isDesignMode());\n };\n ActionSet.prototype.isBleedingAtBottom = function () {\n if (this._actionCollection.renderedActionCount == 0) {\n return _super.prototype.isBleedingAtBottom.call(this);\n }\n else {\n if (this._actionCollection.getActionCount() == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n }\n };\n ActionSet.prototype.getJsonTypeName = function () {\n return \"ActionSet\";\n };\n ActionSet.prototype.getActionCount = function () {\n return this._actionCollection.getActionCount();\n };\n ActionSet.prototype.getActionAt = function (index) {\n if (index >= 0 && index < this.getActionCount()) {\n return this._actionCollection.getActionAt(index);\n }\n else {\n return _super.prototype.getActionAt.call(this, index);\n }\n };\n ActionSet.prototype.getActionById = function (id) {\n var result = this._actionCollection.getActionById(id);\n return result ? result : _super.prototype.getActionById.call(this, id);\n };\n ActionSet.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n this._actionCollection.validateProperties(context);\n };\n ActionSet.prototype.addAction = function (action) {\n this._actionCollection.addAction(action);\n };\n ActionSet.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return processActions ? this._actionCollection.getAllInputs() : [];\n };\n ActionSet.prototype.getResourceInformation = function () {\n return this._actionCollection.getResourceInformation();\n };\n /**\n * @inheritdoc\n */\n ActionSet.prototype.findDOMNodeOwner = function (node) {\n var target = undefined;\n for (var i = 0; i < this.getActionCount(); i++) {\n var action = this.getActionAt(i);\n if (action) {\n // recur through each Action\n target = action.findDOMNodeOwner(node);\n if (target) {\n return target;\n }\n }\n }\n // if not found in any Action, defer to parent implementation\n return _super.prototype.findDOMNodeOwner.call(this, node);\n };\n Object.defineProperty(ActionSet.prototype, \"isInteractive\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n ActionSet.orientationProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_1, \"orientation\", Enums.Orientation);\n __decorate([\n serialization_1.property(ActionSet.orientationProperty)\n ], ActionSet.prototype, \"orientation\", void 0);\n return ActionSet;\n}(CardElement));\nexports.ActionSet = ActionSet;\nvar ContainerStyleProperty = /** @class */ (function (_super) {\n __extends(ContainerStyleProperty, _super);\n function ContainerStyleProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, [\n { value: Enums.ContainerStyle.Default },\n { value: Enums.ContainerStyle.Emphasis },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Accent },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Good },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Attention },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Warning }\n ], defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n return ContainerStyleProperty;\n}(serialization_1.ValueSetProperty));\nexports.ContainerStyleProperty = ContainerStyleProperty;\nvar StylableCardElementContainer = /** @class */ (function (_super) {\n __extends(StylableCardElementContainer, _super);\n function StylableCardElementContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(StylableCardElementContainer.prototype, \"style\", {\n get: function () {\n if (this.allowCustomStyle) {\n var style = this.getValue(StylableCardElementContainer.styleProperty);\n if (style && this.hostConfig.containerStyles.getStyleByName(style)) {\n return style;\n }\n }\n return undefined;\n },\n set: function (value) {\n this.setValue(StylableCardElementContainer.styleProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StylableCardElementContainer.prototype, \"allowCustomStyle\", {\n //#endregion\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StylableCardElementContainer.prototype, \"hasExplicitStyle\", {\n get: function () {\n return this.getValue(StylableCardElementContainer.styleProperty) !== undefined;\n },\n enumerable: false,\n configurable: true\n });\n StylableCardElementContainer.prototype.applyBorder = function () {\n // No border in base implementation\n };\n StylableCardElementContainer.prototype.applyBackground = function () {\n if (this.renderedElement) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.style, this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));\n if (styleDefinition.backgroundColor) {\n var bgColor = Utils.stringToCssColor(styleDefinition.backgroundColor);\n this.renderedElement.style.backgroundColor = bgColor;\n }\n }\n };\n StylableCardElementContainer.prototype.applyPadding = function () {\n _super.prototype.applyPadding.call(this);\n if (!this.renderedElement) {\n return;\n }\n var physicalPadding = new shared_1.SpacingDefinition();\n if (this.getEffectivePadding()) {\n physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding());\n }\n this.renderedElement.style.paddingTop = physicalPadding.top + \"px\";\n this.renderedElement.style.paddingRight = physicalPadding.right + \"px\";\n this.renderedElement.style.paddingBottom = physicalPadding.bottom + \"px\";\n this.renderedElement.style.paddingLeft = physicalPadding.left + \"px\";\n if (this.isBleeding()) {\n // Bleed into the first parent that does have padding\n var padding = new shared_1.PaddingDefinition();\n this.getImmediateSurroundingPadding(padding);\n var surroundingPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n this.renderedElement.style.marginRight = \"-\" + surroundingPadding.right + \"px\";\n this.renderedElement.style.marginLeft = \"-\" + surroundingPadding.left + \"px\";\n if (!this.isDesignMode()) {\n this.renderedElement.style.marginTop = \"-\" + surroundingPadding.top + \"px\";\n this.renderedElement.style.marginBottom = \"-\" + surroundingPadding.bottom + \"px\";\n }\n if (this.separatorElement && this.separatorOrientation == Enums.Orientation.Horizontal) {\n this.separatorElement.style.marginLeft = \"-\" + surroundingPadding.left + \"px\";\n this.separatorElement.style.marginRight = \"-\" + surroundingPadding.right + \"px\";\n }\n }\n else {\n this.renderedElement.style.marginRight = \"0\";\n this.renderedElement.style.marginLeft = \"0\";\n this.renderedElement.style.marginTop = \"0\";\n this.renderedElement.style.marginBottom = \"0\";\n if (this.separatorElement && this.separatorOrientation === Enums.Orientation.Horizontal) {\n this.separatorElement.style.marginRight = \"0\";\n this.separatorElement.style.marginLeft = \"0\";\n }\n }\n };\n StylableCardElementContainer.prototype.getHasBackground = function () {\n var currentElement = this.parent;\n while (currentElement) {\n var currentElementHasBackgroundImage = currentElement instanceof Container ? currentElement.backgroundImage.isValid() : false;\n if (currentElement instanceof StylableCardElementContainer) {\n if (this.hasExplicitStyle && (currentElement.getEffectiveStyle() != this.getEffectiveStyle() || currentElementHasBackgroundImage)) {\n return true;\n }\n }\n currentElement = currentElement.parent;\n }\n return false;\n };\n StylableCardElementContainer.prototype.getDefaultPadding = function () {\n return this.getHasBackground() || this.getHasBorder() ?\n new shared_1.PaddingDefinition(Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding) : _super.prototype.getDefaultPadding.call(this);\n };\n StylableCardElementContainer.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n var explicitStyle = this.getValue(StylableCardElementContainer.styleProperty);\n if (explicitStyle !== undefined) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(explicitStyle);\n if (!styleDefinition) {\n context.addFailure(this, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(explicitStyle, \"style\"));\n }\n }\n };\n StylableCardElementContainer.prototype.render = function () {\n var renderedElement = _super.prototype.render.call(this);\n if (renderedElement && this.getHasBackground()) {\n this.applyBackground();\n }\n this.applyBorder();\n return renderedElement;\n };\n StylableCardElementContainer.prototype.getEffectiveStyle = function () {\n var effectiveStyle = this.style;\n return effectiveStyle ? effectiveStyle : _super.prototype.getEffectiveStyle.call(this);\n };\n //#region Schema\n StylableCardElementContainer.styleProperty = new ContainerStyleProperty(serialization_1.Versions.v1_0, \"style\");\n __decorate([\n serialization_1.property(StylableCardElementContainer.styleProperty)\n ], StylableCardElementContainer.prototype, \"style\", null);\n return StylableCardElementContainer;\n}(CardElementContainer));\nexports.StylableCardElementContainer = StylableCardElementContainer;\nvar ContainerBase = /** @class */ (function (_super) {\n __extends(ContainerBase, _super);\n function ContainerBase() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._bleed = false;\n return _this;\n }\n //#endregion\n ContainerBase.prototype.adjustRenderedElementSize = function (renderedElement) {\n _super.prototype.adjustRenderedElementSize.call(this, renderedElement);\n if (this.minPixelHeight) {\n renderedElement.style.minHeight = this.minPixelHeight + \"px\";\n }\n };\n ContainerBase.prototype.getHasExpandedAction = function () {\n return false;\n };\n ContainerBase.prototype.getBleed = function () {\n return this._bleed;\n };\n ContainerBase.prototype.setBleed = function (value) {\n this._bleed = value;\n };\n Object.defineProperty(ContainerBase.prototype, \"renderedActionCount\", {\n get: function () {\n return 0;\n },\n enumerable: false,\n configurable: true\n });\n ContainerBase.prototype.isBleeding = function () {\n return (this.getHasBackground() || this.hostConfig.alwaysAllowBleed) && this.getBleed();\n };\n ContainerBase.bleedProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"bleed\", false);\n ContainerBase.minHeightProperty = new serialization_1.PixelSizeProperty(serialization_1.Versions.v1_2, \"minHeight\");\n __decorate([\n serialization_1.property(ContainerBase.bleedProperty)\n ], ContainerBase.prototype, \"_bleed\", void 0);\n __decorate([\n serialization_1.property(ContainerBase.minHeightProperty)\n ], ContainerBase.prototype, \"minPixelHeight\", void 0);\n return ContainerBase;\n}(StylableCardElementContainer));\nexports.ContainerBase = ContainerBase;\nvar BackgroundImage = /** @class */ (function (_super) {\n __extends(BackgroundImage, _super);\n function BackgroundImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n BackgroundImage.prototype.getSchemaKey = function () {\n return \"BackgroundImage\";\n };\n BackgroundImage.prototype.internalParse = function (source, context) {\n if (typeof source === \"string\") {\n this.resetDefaultValues();\n this.url = source;\n }\n else {\n return _super.prototype.internalParse.call(this, source, context);\n }\n };\n BackgroundImage.prototype.apply = function (element) {\n if (this.url && element.renderedElement) {\n element.renderedElement.style.backgroundImage = \"url('\" + element.preProcessPropertyValue(BackgroundImage.urlProperty, this.url) + \"')\";\n switch (this.fillMode) {\n case Enums.FillMode.Repeat:\n element.renderedElement.style.backgroundRepeat = \"repeat\";\n break;\n case Enums.FillMode.RepeatHorizontally:\n element.renderedElement.style.backgroundRepeat = \"repeat-x\";\n break;\n case Enums.FillMode.RepeatVertically:\n element.renderedElement.style.backgroundRepeat = \"repeat-y\";\n break;\n case Enums.FillMode.Cover:\n default:\n element.renderedElement.style.backgroundRepeat = \"no-repeat\";\n element.renderedElement.style.backgroundSize = \"cover\";\n break;\n }\n switch (this.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n element.renderedElement.style.backgroundPositionX = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.renderedElement.style.backgroundPositionX = \"right\";\n break;\n }\n switch (this.verticalAlignment) {\n case Enums.VerticalAlignment.Center:\n element.renderedElement.style.backgroundPositionY = \"center\";\n break;\n case Enums.VerticalAlignment.Bottom:\n element.renderedElement.style.backgroundPositionY = \"bottom\";\n break;\n }\n }\n };\n BackgroundImage.prototype.isValid = function () {\n return this.url ? true : false;\n };\n //#region Schema\n BackgroundImage.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n BackgroundImage.fillModeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"fillMode\", Enums.FillMode, Enums.FillMode.Cover);\n BackgroundImage.horizontalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"horizontalAlignment\", Enums.HorizontalAlignment, Enums.HorizontalAlignment.Left);\n BackgroundImage.verticalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"verticalAlignment\", Enums.VerticalAlignment, Enums.VerticalAlignment.Top);\n __decorate([\n serialization_1.property(BackgroundImage.urlProperty)\n ], BackgroundImage.prototype, \"url\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.fillModeProperty)\n ], BackgroundImage.prototype, \"fillMode\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.horizontalAlignmentProperty)\n ], BackgroundImage.prototype, \"horizontalAlignment\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.verticalAlignmentProperty)\n ], BackgroundImage.prototype, \"verticalAlignment\", void 0);\n return BackgroundImage;\n}(serialization_1.SerializableObject));\nexports.BackgroundImage = BackgroundImage;\nvar Container = /** @class */ (function (_super) {\n __extends(Container, _super);\n function Container() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._items = [];\n _this._renderedItems = [];\n return _this;\n }\n Object.defineProperty(Container.prototype, \"backgroundImage\", {\n get: function () {\n return this.getValue(Container.backgroundImageProperty);\n },\n enumerable: false,\n configurable: true\n });\n Container.prototype.insertItemAt = function (item, index, forceInsert) {\n if (!item.parent || forceInsert) {\n if (item.isStandalone) {\n if (index < 0 || index >= this._items.length) {\n this._items.push(item);\n }\n else {\n this._items.splice(index, 0, item);\n }\n item.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.elementTypeNotStandalone(item.getJsonTypeName()));\n }\n }\n else {\n throw new Error(strings_1.Strings.errors.elementAlreadyParented());\n }\n };\n Container.prototype.getItemsCollectionPropertyName = function () {\n return \"items\";\n };\n Container.prototype.applyBackground = function () {\n if (this.backgroundImage.isValid() && this.renderedElement) {\n this.backgroundImage.apply(this);\n }\n _super.prototype.applyBackground.call(this);\n };\n Container.prototype.internalRender = function () {\n this._renderedItems = [];\n // Cache hostConfig to avoid walking the parent hierarchy several times\n var hostConfig = this.hostConfig;\n var element = document.createElement(\"div\");\n if (this.rtl !== undefined) {\n element.dir = this.rtl ? \"rtl\" : \"ltr\";\n }\n element.classList.add(hostConfig.makeCssClassName(\"ac-container\"));\n element.style.display = \"flex\";\n element.style.flexDirection = \"column\";\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n // Forces the container to be at least as tall as its content.\n //\n // Fixes a quirk in Chrome where, for nested flex elements, the\n // inner element's height would never exceed the outer element's\n // height. This caused overflow truncation to break -- containers\n // would always be measured as not overflowing, since their heights\n // were constrained by their parents as opposed to truly reflecting\n // the height of their content.\n //\n // See the \"Browser Rendering Notes\" section of this answer:\n // https://stackoverflow.com/questions/36247140/why-doesnt-flex-item-shrink-past-content-size\n element.style.minHeight = '-webkit-min-content';\n }\n switch (this.getEffectiveVerticalContentAlignment()) {\n case Enums.VerticalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.VerticalAlignment.Bottom:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n if (this._items.length > 0) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n var renderedItem = this.isElementAllowed(item) ? item.render() : undefined;\n if (renderedItem) {\n if (this._renderedItems.length > 0 && item.separatorElement) {\n item.separatorElement.style.flex = \"0 0 auto\";\n Utils.appendChild(element, item.separatorElement);\n }\n Utils.appendChild(element, renderedItem);\n this._renderedItems.push(item);\n }\n }\n }\n else {\n if (this.isDesignMode()) {\n var placeholderElement = this.createPlaceholderElement();\n placeholderElement.style.width = \"100%\";\n placeholderElement.style.height = \"100%\";\n element.appendChild(placeholderElement);\n }\n }\n return element;\n };\n Container.prototype.truncateOverflow = function (maxHeight) {\n if (this.renderedElement) {\n // Add 1 to account for rounding differences between browsers\n var boundary_1 = this.renderedElement.offsetTop + maxHeight + 1;\n var handleElement_1 = function (cardElement) {\n var elt = cardElement.renderedElement;\n if (elt) {\n switch (Utils.getFitStatus(elt, boundary_1)) {\n case Enums.ContainerFitStatus.FullyInContainer:\n var sizeChanged = cardElement['resetOverflow']();\n // If the element's size changed after resetting content,\n // we have to check if it still fits fully in the card\n if (sizeChanged) {\n handleElement_1(cardElement);\n }\n break;\n case Enums.ContainerFitStatus.Overflowing:\n var maxHeight_1 = boundary_1 - elt.offsetTop;\n cardElement['handleOverflow'](maxHeight_1);\n break;\n case Enums.ContainerFitStatus.FullyOutOfContainer:\n cardElement['handleOverflow'](0);\n break;\n }\n }\n };\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n handleElement_1(item);\n }\n return true;\n }\n return false;\n };\n Container.prototype.undoOverflowTruncation = function () {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n item['resetOverflow']();\n }\n };\n Container.prototype.getHasBackground = function () {\n return this.backgroundImage.isValid() || _super.prototype.getHasBackground.call(this);\n };\n Container.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this.clear();\n this.setShouldFallback(false);\n var jsonItems = source[this.getItemsCollectionPropertyName()];\n if (Array.isArray(jsonItems)) {\n for (var _i = 0, jsonItems_1 = jsonItems; _i < jsonItems_1.length; _i++) {\n var item = jsonItems_1[_i];\n var element = context.parseElement(this, item, !this.isDesignMode());\n if (element) {\n this.insertItemAt(element, -1, true);\n }\n }\n }\n };\n Container.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, this.getItemsCollectionPropertyName(), this._items);\n };\n Object.defineProperty(Container.prototype, \"isSelectable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Container.prototype.getEffectiveVerticalContentAlignment = function () {\n if (this.verticalContentAlignment !== undefined) {\n return this.verticalContentAlignment;\n }\n var parentContainer = this.getParentContainer();\n return parentContainer ? parentContainer.getEffectiveVerticalContentAlignment() : Enums.VerticalAlignment.Top;\n };\n Container.prototype.getItemCount = function () {\n return this._items.length;\n };\n Container.prototype.getItemAt = function (index) {\n return this._items[index];\n };\n Container.prototype.getFirstVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedItems && this._renderedItems.length > 0) {\n for (var _i = 0, _a = this._renderedItems; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.isVisible) {\n return item;\n }\n }\n ;\n }\n return undefined;\n };\n Container.prototype.getLastVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedItems && this._renderedItems.length > 0) {\n for (var i = this._renderedItems.length - 1; i >= 0; i--) {\n if (this._renderedItems[i].isVisible) {\n return this._renderedItems[i];\n }\n }\n }\n return undefined;\n };\n Container.prototype.getJsonTypeName = function () {\n return \"Container\";\n };\n Container.prototype.isFirstElement = function (element) {\n var designMode = this.isDesignMode();\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.isVisible || designMode) {\n return item == element;\n }\n }\n return false;\n };\n Container.prototype.isLastElement = function (element) {\n var designMode = this.isDesignMode();\n for (var i = this._items.length - 1; i >= 0; i--) {\n if (this._items[i].isVisible || designMode) {\n return this._items[i] == element;\n }\n }\n return false;\n };\n Container.prototype.isRtl = function () {\n if (this.rtl !== undefined) {\n return this.rtl;\n }\n else {\n var parentContainer = this.getParentContainer();\n return parentContainer ? parentContainer.isRtl() : false;\n }\n };\n Container.prototype.isBleedingAtTop = function () {\n var firstRenderedItem = this.getFirstVisibleRenderedItem();\n return this.isBleeding() || (firstRenderedItem ? firstRenderedItem.isBleedingAtTop() : false);\n };\n Container.prototype.isBleedingAtBottom = function () {\n var lastRenderedItem = this.getLastVisibleRenderedItem();\n return this.isBleeding() || (lastRenderedItem ? lastRenderedItem.isBleedingAtBottom() && lastRenderedItem.getEffectiveStyle() == this.getEffectiveStyle() : false);\n };\n Container.prototype.indexOf = function (cardElement) {\n return this._items.indexOf(cardElement);\n };\n Container.prototype.addItem = function (item) {\n this.insertItemAt(item, -1, false);\n };\n Container.prototype.insertItemBefore = function (item, insertBefore) {\n this.insertItemAt(item, this._items.indexOf(insertBefore), false);\n };\n Container.prototype.insertItemAfter = function (item, insertAfter) {\n this.insertItemAt(item, this._items.indexOf(insertAfter) + 1, false);\n };\n Container.prototype.removeItem = function (item) {\n var itemIndex = this._items.indexOf(item);\n if (itemIndex >= 0) {\n this._items.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n return false;\n };\n Container.prototype.clear = function () {\n this._items = [];\n this._renderedItems = [];\n };\n Container.prototype.getResourceInformation = function () {\n var result = _super.prototype.getResourceInformation.call(this);\n if (this.backgroundImage.isValid()) {\n result.push({\n url: this.backgroundImage.url,\n mimeType: \"image\"\n });\n }\n return result;\n };\n Container.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result) {\n if (this.selectAction) {\n result = this.selectAction.getActionById(id);\n }\n if (!result) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n result = item.getActionById(id);\n if (result) {\n break;\n }\n }\n }\n }\n return result;\n };\n Object.defineProperty(Container.prototype, \"padding\", {\n get: function () {\n return this.getPadding();\n },\n set: function (value) {\n this.setPadding(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"selectAction\", {\n get: function () {\n return this._selectAction;\n },\n set: function (value) {\n this._selectAction = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"bleed\", {\n get: function () {\n return this.getBleed();\n },\n set: function (value) {\n this.setBleed(value);\n },\n enumerable: false,\n configurable: true\n });\n Container.backgroundImageProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_0, \"backgroundImage\", BackgroundImage);\n Container.verticalContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_1, \"verticalContentAlignment\", Enums.VerticalAlignment);\n Container.rtlProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"rtl\");\n __decorate([\n serialization_1.property(Container.backgroundImageProperty)\n ], Container.prototype, \"backgroundImage\", null);\n __decorate([\n serialization_1.property(Container.verticalContentAlignmentProperty)\n ], Container.prototype, \"verticalContentAlignment\", void 0);\n __decorate([\n serialization_1.property(Container.rtlProperty)\n ], Container.prototype, \"rtl\", void 0);\n return Container;\n}(ContainerBase));\nexports.Container = Container;\nvar Column = /** @class */ (function (_super) {\n __extends(Column, _super);\n function Column(width) {\n if (width === void 0) { width = \"stretch\"; }\n var _this = _super.call(this) || this;\n _this.width = \"stretch\";\n //#endregion\n _this._computedWeight = 0;\n _this.width = width;\n return _this;\n }\n Column.prototype.adjustRenderedElementSize = function (renderedElement) {\n var minDesignTimeColumnHeight = 20;\n if (this.isDesignMode()) {\n renderedElement.style.minWidth = \"20px\";\n renderedElement.style.minHeight = (!this.minPixelHeight ? minDesignTimeColumnHeight : Math.max(this.minPixelHeight, minDesignTimeColumnHeight)) + \"px\";\n }\n else {\n renderedElement.style.minWidth = \"0\";\n if (this.minPixelHeight) {\n renderedElement.style.minHeight = this.minPixelHeight + \"px\";\n }\n }\n if (this.width === \"auto\") {\n renderedElement.style.flex = \"0 1 auto\";\n }\n else if (this.width === \"stretch\") {\n renderedElement.style.flex = \"1 1 50px\";\n }\n else if (this.width instanceof shared_1.SizeAndUnit) {\n if (this.width.unit == Enums.SizeUnit.Pixel) {\n renderedElement.style.flex = \"0 0 auto\";\n renderedElement.style.width = this.width.physicalSize + \"px\";\n }\n else {\n renderedElement.style.flex = \"1 1 \" + (this._computedWeight > 0 ? this._computedWeight : this.width.physicalSize) + \"%\";\n }\n }\n };\n Column.prototype.shouldSerialize = function (context) {\n return true;\n };\n Object.defineProperty(Column.prototype, \"separatorOrientation\", {\n get: function () {\n return Enums.Orientation.Vertical;\n },\n enumerable: false,\n configurable: true\n });\n Column.prototype.getJsonTypeName = function () {\n return \"Column\";\n };\n Object.defineProperty(Column.prototype, \"hasVisibleSeparator\", {\n get: function () {\n if (this.parent && this.parent instanceof ColumnSet) {\n return this.separatorElement !== undefined && !this.parent.isLeftMostElement(this);\n }\n else {\n return false;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Column.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n Column.widthProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"width\", function (sender, property, source, context) {\n var result = property.defaultValue;\n var value = source[property.name];\n var invalidWidth = false;\n if (typeof value === \"number\" && !isNaN(value)) {\n result = new shared_1.SizeAndUnit(value, Enums.SizeUnit.Weight);\n }\n else if (value === \"auto\" || value === \"stretch\") {\n result = value;\n }\n else if (typeof value === \"string\") {\n try {\n result = shared_1.SizeAndUnit.parse(value);\n if (result.unit === Enums.SizeUnit.Pixel && property.targetVersion.compareTo(context.targetVersion) > 0) {\n invalidWidth = true;\n }\n }\n catch (e) {\n invalidWidth = true;\n }\n }\n else {\n invalidWidth = true;\n }\n if (invalidWidth) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidColumnWidth(value));\n result = \"auto\";\n }\n return result;\n }, function (sender, property, target, value, context) {\n if (value instanceof shared_1.SizeAndUnit) {\n if (value.unit === Enums.SizeUnit.Pixel) {\n context.serializeValue(target, \"width\", value.physicalSize + \"px\");\n }\n else {\n context.serializeNumber(target, \"width\", value.physicalSize);\n }\n }\n else {\n context.serializeValue(target, \"width\", value);\n }\n }, \"stretch\");\n __decorate([\n serialization_1.property(Column.widthProperty)\n ], Column.prototype, \"width\", void 0);\n return Column;\n}(Container));\nexports.Column = Column;\nvar ColumnSet = /** @class */ (function (_super) {\n __extends(ColumnSet, _super);\n function ColumnSet() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columns = [];\n return _this;\n }\n ColumnSet.prototype.createColumnInstance = function (source, context) {\n return context.parseCardObject(this, source, [], // Forbidden types not supported for elements for now\n !this.isDesignMode(), function (typeName) {\n return !typeName || typeName === \"Column\" ? new Column() : undefined;\n }, function (typeName, errorType) {\n context.logParseEvent(undefined, Enums.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n });\n };\n ColumnSet.prototype.internalRender = function () {\n this._renderedColumns = [];\n if (this._columns.length > 0) {\n // Cache hostConfig to avoid walking the parent hierarchy several times\n var hostConfig = this.hostConfig;\n var element = document.createElement(\"div\");\n element.className = hostConfig.makeCssClassName(\"ac-columnSet\");\n element.style.display = \"flex\";\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n // See comment in Container.internalRender()\n element.style.minHeight = '-webkit-min-content';\n }\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n var totalWeight = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.width instanceof shared_1.SizeAndUnit && (column.width.unit == Enums.SizeUnit.Weight)) {\n totalWeight += column.width.physicalSize;\n }\n }\n for (var _b = 0, _c = this._columns; _b < _c.length; _b++) {\n var column = _c[_b];\n if (column.width instanceof shared_1.SizeAndUnit && column.width.unit == Enums.SizeUnit.Weight && totalWeight > 0) {\n var computedWeight = 100 / totalWeight * column.width.physicalSize;\n // Best way to emulate \"internal\" access I know of\n column[\"_computedWeight\"] = computedWeight;\n }\n var renderedColumn = column.render();\n if (renderedColumn) {\n if (this._renderedColumns.length > 0 && column.separatorElement) {\n column.separatorElement.style.flex = \"0 0 auto\";\n Utils.appendChild(element, column.separatorElement);\n }\n Utils.appendChild(element, renderedColumn);\n this._renderedColumns.push(column);\n }\n }\n return this._renderedColumns.length > 0 ? element : undefined;\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.truncateOverflow = function (maxHeight) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n column['handleOverflow'](maxHeight);\n }\n return true;\n };\n ColumnSet.prototype.undoOverflowTruncation = function () {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n column['resetOverflow']();\n }\n };\n Object.defineProperty(ColumnSet.prototype, \"isSelectable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n ColumnSet.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._columns = [];\n this._renderedColumns = [];\n var jsonColumns = source[\"columns\"];\n if (Array.isArray(jsonColumns)) {\n for (var _i = 0, jsonColumns_1 = jsonColumns; _i < jsonColumns_1.length; _i++) {\n var item = jsonColumns_1[_i];\n var column = this.createColumnInstance(item, context);\n if (column) {\n this._columns.push(column);\n }\n }\n }\n };\n ColumnSet.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, \"columns\", this._columns);\n };\n ColumnSet.prototype.isFirstElement = function (element) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isVisible) {\n return column == element;\n }\n }\n return false;\n };\n ColumnSet.prototype.isBleedingAtTop = function () {\n if (this.isBleeding()) {\n return true;\n }\n if (this._renderedColumns && this._renderedColumns.length > 0) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isBleedingAtTop()) {\n return true;\n }\n }\n }\n return false;\n };\n ColumnSet.prototype.isBleedingAtBottom = function () {\n if (this.isBleeding()) {\n return true;\n }\n if (this._renderedColumns && this._renderedColumns.length > 0) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isBleedingAtBottom()) {\n return true;\n }\n }\n }\n return false;\n };\n ColumnSet.prototype.getItemCount = function () {\n return this._columns.length;\n };\n ColumnSet.prototype.getFirstVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedColumns && this._renderedColumns.length > 0) {\n return this._renderedColumns[0];\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.getLastVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedColumns && this._renderedColumns.length > 0) {\n return this._renderedColumns[this._renderedColumns.length - 1];\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.getColumnAt = function (index) {\n return this._columns[index];\n };\n ColumnSet.prototype.getItemAt = function (index) {\n return this.getColumnAt(index);\n };\n ColumnSet.prototype.getJsonTypeName = function () {\n return \"ColumnSet\";\n };\n ColumnSet.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n var weightedColumns = 0;\n var stretchedColumns = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (typeof column.width === \"number\") {\n weightedColumns++;\n }\n else if (column.width === \"stretch\") {\n stretchedColumns++;\n }\n }\n if (weightedColumns > 0 && stretchedColumns > 0) {\n context.addFailure(this, Enums.ValidationEvent.Hint, strings_1.Strings.hints.dontUseWeightedAndStrecthedColumnsInSameSet());\n }\n };\n ColumnSet.prototype.addColumn = function (column) {\n if (!column.parent) {\n this._columns.push(column);\n column.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.columnAlreadyBelongsToAnotherSet());\n }\n };\n ColumnSet.prototype.removeItem = function (item) {\n if (item instanceof Column) {\n var itemIndex = this._columns.indexOf(item);\n if (itemIndex >= 0) {\n this._columns.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n }\n return false;\n };\n ColumnSet.prototype.indexOf = function (cardElement) {\n return cardElement instanceof Column ? this._columns.indexOf(cardElement) : -1;\n };\n ColumnSet.prototype.isLeftMostElement = function (element) {\n return this._columns.indexOf(element) == 0;\n };\n ColumnSet.prototype.isRightMostElement = function (element) {\n return this._columns.indexOf(element) == this._columns.length - 1;\n };\n ColumnSet.prototype.isTopElement = function (element) {\n return this._columns.indexOf(element) >= 0;\n };\n ColumnSet.prototype.isBottomElement = function (element) {\n return this._columns.indexOf(element) >= 0;\n };\n ColumnSet.prototype.getActionById = function (id) {\n var result = undefined;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n result = column.getActionById(id);\n if (result) {\n break;\n }\n }\n return result;\n };\n Object.defineProperty(ColumnSet.prototype, \"bleed\", {\n get: function () {\n return this.getBleed();\n },\n set: function (value) {\n this.setBleed(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnSet.prototype, \"padding\", {\n get: function () {\n return this.getPadding();\n },\n set: function (value) {\n this.setPadding(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnSet.prototype, \"selectAction\", {\n get: function () {\n return this._selectAction;\n },\n set: function (value) {\n this._selectAction = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColumnSet;\n}(ContainerBase));\nexports.ColumnSet = ColumnSet;\nfunction raiseImageLoadedEvent(image) {\n var card = image.getRootElement();\n var onImageLoadedHandler = (card && card.onImageLoaded) ? card.onImageLoaded : AdaptiveCard.onImageLoaded;\n if (onImageLoadedHandler) {\n onImageLoadedHandler(image);\n }\n}\nfunction raiseAnchorClickedEvent(element, anchor, ev) {\n var card = element.getRootElement();\n var onAnchorClickedHandler = (card && card.onAnchorClicked) ? card.onAnchorClicked : AdaptiveCard.onAnchorClicked;\n return onAnchorClickedHandler !== undefined ? onAnchorClickedHandler(element, anchor, ev) : false;\n}\nfunction raiseExecuteActionEvent(action) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onExecuteActionHandler = (card && card.onExecuteAction) ? card.onExecuteAction : AdaptiveCard.onExecuteAction;\n if (action.prepareForExecution() && onExecuteActionHandler) {\n onExecuteActionHandler(action);\n }\n}\nfunction raiseInlineCardExpandedEvent(action, isExpanded) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onInlineCardExpandedHandler = (card && card.onInlineCardExpanded) ? card.onInlineCardExpanded : AdaptiveCard.onInlineCardExpanded;\n if (onInlineCardExpandedHandler) {\n onInlineCardExpandedHandler(action, isExpanded);\n }\n}\nfunction raiseInputValueChangedEvent(input) {\n var card = input.getRootElement();\n var onInputValueChangedHandler = (card && card.onInputValueChanged) ? card.onInputValueChanged : AdaptiveCard.onInputValueChanged;\n if (onInputValueChangedHandler) {\n onInputValueChangedHandler(input);\n }\n}\nfunction raiseElementVisibilityChangedEvent(element, shouldUpdateLayout) {\n if (shouldUpdateLayout === void 0) { shouldUpdateLayout = true; }\n var rootElement = element.getRootElement();\n if (shouldUpdateLayout) {\n rootElement.updateLayout();\n }\n var card = rootElement;\n var onElementVisibilityChangedHandler = (card && card.onElementVisibilityChanged) ? card.onElementVisibilityChanged : AdaptiveCard.onElementVisibilityChanged;\n if (onElementVisibilityChangedHandler !== undefined) {\n onElementVisibilityChangedHandler(element);\n }\n}\n/**\n * @returns return false to continue with default context menu; return true to skip SDK default context menu\n */\nfunction raiseDisplayOverflowActionMenuEvent(action, target) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onDisplayOverflowActionMenuHandler = (card && card.onDisplayOverflowActionMenu) ? card.onDisplayOverflowActionMenu : AdaptiveCard.onDisplayOverflowActionMenu;\n return onDisplayOverflowActionMenuHandler !== undefined ? onDisplayOverflowActionMenuHandler(action.getActions(), target) : false;\n}\n/**\n * @returns return false to continue with default action button; return true to skip SDK default action button\n */\nfunction raiseRenderOverflowActionsEvent(action, isAtRootLevelActions) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onRenderOverflowActionsHandler = (card && card.onRenderOverflowActions) ? card.onRenderOverflowActions : AdaptiveCard.onRenderOverflowActions;\n return onRenderOverflowActionsHandler !== undefined ? onRenderOverflowActionsHandler(action.getActions(), isAtRootLevelActions) : false;\n}\nvar ContainerWithActions = /** @class */ (function (_super) {\n __extends(ContainerWithActions, _super);\n function ContainerWithActions() {\n var _this = _super.call(this) || this;\n _this._actionCollection = new ActionCollection(_this);\n return _this;\n }\n ContainerWithActions.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._actionCollection.parse(source[\"actions\"], context);\n };\n ContainerWithActions.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n this._actionCollection.toJSON(target, \"actions\", context);\n };\n ContainerWithActions.prototype.internalRender = function () {\n var element = _super.prototype.internalRender.call(this);\n if (element) {\n var renderedActions = this._actionCollection.render(this.hostConfig.actions.actionsOrientation, false);\n if (renderedActions) {\n Utils.appendChild(element, renderSeparation(this.hostConfig, {\n spacing: this.hostConfig.getEffectiveSpacing(this.hostConfig.actions.spacing)\n }, Enums.Orientation.Horizontal));\n Utils.appendChild(element, renderedActions);\n }\n if (this.renderIfEmpty) {\n return element;\n }\n else {\n return element.children.length > 0 ? element : undefined;\n }\n }\n else {\n return undefined;\n }\n };\n ContainerWithActions.prototype.getHasExpandedAction = function () {\n if (this.renderedActionCount == 0) {\n return false;\n }\n else if (this.renderedActionCount == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n };\n Object.defineProperty(ContainerWithActions.prototype, \"renderedActionCount\", {\n get: function () {\n return this._actionCollection.renderedActionCount;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ContainerWithActions.prototype, \"renderIfEmpty\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n ContainerWithActions.prototype.getActionCount = function () {\n return this._actionCollection.getActionCount();\n };\n ContainerWithActions.prototype.getActionAt = function (index) {\n if (index >= 0 && index < this.getActionCount()) {\n return this._actionCollection.getActionAt(index);\n }\n else {\n return _super.prototype.getActionAt.call(this, index);\n }\n };\n ContainerWithActions.prototype.getActionById = function (id) {\n var result = this._actionCollection.getActionById(id);\n return result ? result : _super.prototype.getActionById.call(this, id);\n };\n ContainerWithActions.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this._actionCollection) {\n this._actionCollection.validateProperties(context);\n }\n };\n ContainerWithActions.prototype.isLastElement = function (element) {\n return _super.prototype.isLastElement.call(this, element) && this._actionCollection.getActionCount() == 0;\n };\n ContainerWithActions.prototype.addAction = function (action) {\n this._actionCollection.addAction(action);\n };\n ContainerWithActions.prototype.clear = function () {\n _super.prototype.clear.call(this);\n this._actionCollection.clear();\n };\n ContainerWithActions.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = _super.prototype.getAllInputs.call(this, processActions);\n if (processActions) {\n result = result.concat(this._actionCollection.getAllInputs(processActions));\n }\n return result;\n };\n ContainerWithActions.prototype.getResourceInformation = function () {\n return _super.prototype.getResourceInformation.call(this).concat(this._actionCollection.getResourceInformation());\n };\n ContainerWithActions.prototype.isBleedingAtBottom = function () {\n if (this._actionCollection.renderedActionCount == 0) {\n return _super.prototype.isBleedingAtBottom.call(this);\n }\n else {\n if (this._actionCollection.getActionCount() == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n }\n };\n Object.defineProperty(ContainerWithActions.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return ContainerWithActions;\n}(Container));\nexports.ContainerWithActions = ContainerWithActions;\nvar RefreshActionProperty = /** @class */ (function (_super) {\n __extends(RefreshActionProperty, _super);\n function RefreshActionProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, undefined) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n RefreshActionProperty.prototype.parse = function (sender, source, context) {\n var action = context.parseAction(sender.parent, source[this.name], [], false);\n if (action !== undefined) {\n if (action instanceof ExecuteAction) {\n return action;\n }\n context.logParseEvent(sender, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(action.getJsonTypeName()));\n }\n context.logParseEvent(sender, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"action\"));\n return undefined;\n };\n RefreshActionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value ? value.toJSON(context) : undefined, undefined, true);\n };\n return RefreshActionProperty;\n}(serialization_1.PropertyDefinition));\nexports.RefreshActionProperty = RefreshActionProperty;\nvar RefreshDefinition = /** @class */ (function (_super) {\n __extends(RefreshDefinition, _super);\n function RefreshDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RefreshDefinition.prototype, \"action\", {\n get: function () {\n return this.getValue(RefreshDefinition.actionProperty);\n },\n set: function (value) {\n this.setValue(RefreshDefinition.actionProperty, value);\n if (value) {\n value.setParent(this.parent);\n }\n },\n enumerable: false,\n configurable: true\n });\n RefreshDefinition.prototype.getSchemaKey = function () {\n return \"RefreshDefinition\";\n };\n //#region Schema\n RefreshDefinition.actionProperty = new RefreshActionProperty(serialization_1.Versions.v1_4, \"action\");\n RefreshDefinition.userIdsProperty = new serialization_1.StringArrayProperty(serialization_1.Versions.v1_4, \"userIds\");\n __decorate([\n serialization_1.property(RefreshDefinition.actionProperty)\n ], RefreshDefinition.prototype, \"action\", null);\n __decorate([\n serialization_1.property(RefreshDefinition.userIdsProperty)\n ], RefreshDefinition.prototype, \"userIds\", void 0);\n return RefreshDefinition;\n}(serialization_1.SerializableObject));\nexports.RefreshDefinition = RefreshDefinition;\nvar AuthCardButton = /** @class */ (function (_super) {\n __extends(AuthCardButton, _super);\n function AuthCardButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AuthCardButton.prototype.getSchemaKey = function () {\n return \"AuthCardButton\";\n };\n //#region Schema\n AuthCardButton.typeProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"type\");\n AuthCardButton.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"title\");\n AuthCardButton.imageProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"image\");\n AuthCardButton.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"value\");\n __decorate([\n serialization_1.property(AuthCardButton.typeProperty)\n ], AuthCardButton.prototype, \"type\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.titleProperty)\n ], AuthCardButton.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.imageProperty)\n ], AuthCardButton.prototype, \"image\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.valueProperty)\n ], AuthCardButton.prototype, \"value\", void 0);\n return AuthCardButton;\n}(serialization_1.SerializableObject));\nexports.AuthCardButton = AuthCardButton;\nvar TokenExchangeResource = /** @class */ (function (_super) {\n __extends(TokenExchangeResource, _super);\n function TokenExchangeResource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TokenExchangeResource.prototype.getSchemaKey = function () {\n return \"TokenExchangeResource\";\n };\n //#region Schema\n TokenExchangeResource.idProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"id\");\n TokenExchangeResource.uriProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"uri\");\n TokenExchangeResource.providerIdProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"providerId\");\n __decorate([\n serialization_1.property(TokenExchangeResource.idProperty)\n ], TokenExchangeResource.prototype, \"id\", void 0);\n __decorate([\n serialization_1.property(TokenExchangeResource.uriProperty)\n ], TokenExchangeResource.prototype, \"uri\", void 0);\n __decorate([\n serialization_1.property(TokenExchangeResource.providerIdProperty)\n ], TokenExchangeResource.prototype, \"providerId\", void 0);\n return TokenExchangeResource;\n}(serialization_1.SerializableObject));\nexports.TokenExchangeResource = TokenExchangeResource;\nvar Authentication = /** @class */ (function (_super) {\n __extends(Authentication, _super);\n function Authentication() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Authentication.prototype.getSchemaKey = function () {\n return \"Authentication\";\n };\n //#region Schema\n Authentication.textProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"text\");\n Authentication.connectionNameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"connectionName\");\n Authentication.buttonsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_4, \"buttons\", AuthCardButton);\n Authentication.tokenExchangeResourceProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"tokenExchangeResource\", TokenExchangeResource, true);\n __decorate([\n serialization_1.property(Authentication.textProperty)\n ], Authentication.prototype, \"text\", void 0);\n __decorate([\n serialization_1.property(Authentication.connectionNameProperty)\n ], Authentication.prototype, \"connectionName\", void 0);\n __decorate([\n serialization_1.property(Authentication.buttonsProperty)\n ], Authentication.prototype, \"buttons\", void 0);\n __decorate([\n serialization_1.property(Authentication.tokenExchangeResourceProperty)\n ], Authentication.prototype, \"tokenExchangeResource\", void 0);\n return Authentication;\n}(serialization_1.SerializableObject));\nexports.Authentication = Authentication;\n// @dynamic\nvar AdaptiveCard = /** @class */ (function (_super) {\n __extends(AdaptiveCard, _super);\n function AdaptiveCard() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.designMode = false;\n return _this;\n }\n Object.defineProperty(AdaptiveCard.prototype, \"refresh\", {\n get: function () {\n return this.getValue(AdaptiveCard.refreshProperty);\n },\n set: function (value) {\n this.setValue(AdaptiveCard.refreshProperty, value);\n if (value) {\n value.parent = this;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard, \"processMarkdown\", {\n get: function () {\n throw new Error(strings_1.Strings.errors.processMarkdownEventRemoved());\n },\n set: function (value) {\n throw new Error(strings_1.Strings.errors.processMarkdownEventRemoved());\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.applyMarkdown = function (text) {\n var result = {\n didProcess: false\n };\n if (AdaptiveCard.onProcessMarkdown) {\n AdaptiveCard.onProcessMarkdown(text, result);\n }\n else if (window.markdownit) {\n // Check for markdownit\n var markdownIt = window.markdownit;\n result.outputHtml = markdownIt().render(text);\n result.didProcess = true;\n }\n else {\n console.warn(strings_1.Strings.errors.markdownProcessingNotEnabled);\n }\n return result;\n };\n AdaptiveCard.prototype.isVersionSupported = function () {\n if (this.bypassVersionCheck) {\n return true;\n }\n else {\n var unsupportedVersion = !this.version ||\n !this.version.isValid ||\n (this.maxVersion.major < this.version.major) ||\n (this.maxVersion.major == this.version.major && this.maxVersion.minor < this.version.minor);\n return !unsupportedVersion;\n }\n };\n AdaptiveCard.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext(this.version);\n };\n AdaptiveCard.prototype.getItemsCollectionPropertyName = function () {\n return \"body\";\n };\n AdaptiveCard.prototype.internalParse = function (source, context) {\n this._fallbackCard = undefined;\n var fallbackElement = context.parseElement(undefined, source[\"fallback\"], !this.isDesignMode());\n if (fallbackElement) {\n this._fallbackCard = new AdaptiveCard();\n this._fallbackCard.addItem(fallbackElement);\n }\n _super.prototype.internalParse.call(this, source, context);\n };\n AdaptiveCard.prototype.internalToJSON = function (target, context) {\n this.setValue(AdaptiveCard.versionProperty, context.targetVersion);\n _super.prototype.internalToJSON.call(this, target, context);\n };\n AdaptiveCard.prototype.internalRender = function () {\n var renderedElement = _super.prototype.internalRender.call(this);\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && renderedElement) {\n // Unlike containers, the root card element should be allowed to\n // be shorter than its content (otherwise the overflow truncation\n // logic would never get triggered)\n renderedElement.style.removeProperty(\"minHeight\");\n }\n return renderedElement;\n };\n AdaptiveCard.prototype.getHasBackground = function () {\n return true;\n };\n AdaptiveCard.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding);\n };\n AdaptiveCard.prototype.shouldSerialize = function (context) {\n return true;\n };\n Object.defineProperty(AdaptiveCard.prototype, \"renderIfEmpty\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"bypassVersionCheck\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"allowCustomStyle\", {\n get: function () {\n return this.hostConfig.adaptiveCard && this.hostConfig.adaptiveCard.allowCustomStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"hasBackground\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.prototype.getJsonTypeName = function () {\n return \"AdaptiveCard\";\n };\n AdaptiveCard.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this.getValue(CardElement.typeNameProperty) !== \"AdaptiveCard\") {\n context.addFailure(this, Enums.ValidationEvent.MissingCardType, strings_1.Strings.errors.invalidCardType());\n }\n if (!this.bypassVersionCheck && !this.version) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"version\"));\n }\n else if (!this.isVersionSupported()) {\n context.addFailure(this, Enums.ValidationEvent.UnsupportedCardVersion, strings_1.Strings.errors.unsupportedCardVersion(this.version.toString(), this.maxVersion.toString()));\n }\n };\n AdaptiveCard.prototype.render = function (target) {\n var renderedCard;\n if (this.shouldFallback() && this._fallbackCard) {\n this._fallbackCard.hostConfig = this.hostConfig;\n renderedCard = this._fallbackCard.render();\n }\n else {\n renderedCard = _super.prototype.render.call(this);\n if (renderedCard) {\n renderedCard.classList.add(this.hostConfig.makeCssClassName(\"ac-adaptiveCard\"));\n // Having a tabIndex on the root container for a card can mess up accessibility in some scenarios.\n // However, we've shipped this behavior before, and so can't just turn it off in a point release. For\n // now, to unblock accessibility scenarios for our customers, we've got an option to turn it off. In a\n // future release, we should strongly consider flipping the default such that we *don't* emit a tabIndex\n // by default.\n if (shared_1.GlobalSettings.setTabIndexAtCardRoot) {\n renderedCard.tabIndex = 0;\n }\n if (this.speak) {\n renderedCard.setAttribute(\"aria-label\", this.speak);\n }\n }\n }\n if (target) {\n Utils.appendChild(target, renderedCard);\n this.updateLayout();\n }\n return renderedCard;\n };\n AdaptiveCard.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && this.isDisplayed()) {\n var padding = this.hostConfig.getEffectiveSpacing(Enums.Spacing.Default);\n this['handleOverflow'](this.renderedElement.offsetHeight - padding);\n }\n };\n AdaptiveCard.prototype.shouldFallback = function () {\n return _super.prototype.shouldFallback.call(this) || !this.isVersionSupported();\n };\n Object.defineProperty(AdaptiveCard.prototype, \"hasVisibleSeparator\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.schemaUrl = \"http://adaptivecards.io/schemas/adaptive-card.json\";\n //#region Schema\n AdaptiveCard.$schemaProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"$schema\", function (sender, property, source, context) {\n return AdaptiveCard.schemaUrl;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, AdaptiveCard.schemaUrl);\n });\n AdaptiveCard.versionProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"version\", function (sender, property, source, context) {\n var version = serialization_1.Version.parse(source[property.name], context);\n if (version === undefined) {\n version = serialization_1.Versions.latest;\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidCardVersion(version.toString()));\n }\n return version;\n }, function (sender, property, target, value, context) {\n if (value !== undefined) {\n context.serializeValue(target, property.name, value.toString());\n }\n }, serialization_1.Versions.v1_0);\n AdaptiveCard.fallbackTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"fallbackText\");\n AdaptiveCard.speakProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"speak\");\n AdaptiveCard.refreshProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"refresh\", RefreshDefinition, true);\n AdaptiveCard.authenticationProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"authentication\", Authentication, true);\n __decorate([\n serialization_1.property(AdaptiveCard.versionProperty)\n ], AdaptiveCard.prototype, \"version\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.fallbackTextProperty)\n ], AdaptiveCard.prototype, \"fallbackText\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.speakProperty)\n ], AdaptiveCard.prototype, \"speak\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.refreshProperty)\n ], AdaptiveCard.prototype, \"refresh\", null);\n __decorate([\n serialization_1.property(AdaptiveCard.authenticationProperty)\n ], AdaptiveCard.prototype, \"authentication\", void 0);\n return AdaptiveCard;\n}(ContainerWithActions));\nexports.AdaptiveCard = AdaptiveCard;\nvar InlineAdaptiveCard = /** @class */ (function (_super) {\n __extends(InlineAdaptiveCard, _super);\n function InlineAdaptiveCard() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.suppressStyle = false;\n return _this;\n }\n InlineAdaptiveCard.prototype.getSchemaKey = function () {\n return \"InlineAdaptiveCard\";\n };\n InlineAdaptiveCard.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.remove(AdaptiveCard.$schemaProperty, AdaptiveCard.versionProperty);\n };\n //#endregion\n InlineAdaptiveCard.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(this.suppressStyle ? Enums.Spacing.None : Enums.Spacing.Padding, Enums.Spacing.Padding, this.suppressStyle ? Enums.Spacing.None : Enums.Spacing.Padding, Enums.Spacing.Padding);\n };\n Object.defineProperty(InlineAdaptiveCard.prototype, \"bypassVersionCheck\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InlineAdaptiveCard.prototype, \"defaultStyle\", {\n get: function () {\n if (this.suppressStyle) {\n return Enums.ContainerStyle.Default;\n }\n else {\n return this.hostConfig.actions.showCard.style ? this.hostConfig.actions.showCard.style : Enums.ContainerStyle.Emphasis;\n }\n },\n enumerable: false,\n configurable: true\n });\n InlineAdaptiveCard.prototype.render = function (target) {\n var renderedCard = _super.prototype.render.call(this, target);\n if (renderedCard) {\n renderedCard.setAttribute(\"aria-live\", \"polite\");\n renderedCard.removeAttribute(\"tabindex\");\n }\n return renderedCard;\n };\n return InlineAdaptiveCard;\n}(AdaptiveCard));\nvar SerializationContext = /** @class */ (function (_super) {\n __extends(SerializationContext, _super);\n function SerializationContext() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SerializationContext.prototype.internalParseCardObject = function (parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent) {\n var result = undefined;\n if (source && typeof source === \"object\") {\n var typeName = Utils.parseString(source[\"type\"]);\n if (typeName && forbiddenTypeNames.indexOf(typeName) >= 0) {\n logParseEvent(typeName, Enums.TypeErrorType.ForbiddenType);\n }\n else {\n var tryToFallback = false;\n result = createInstanceCallback(typeName);\n if (!result) {\n tryToFallback = shared_1.GlobalSettings.enableFallback && allowFallback;\n logParseEvent(typeName, Enums.TypeErrorType.UnknownType);\n }\n else {\n result.setParent(parent);\n result.parse(source, this);\n tryToFallback = shared_1.GlobalSettings.enableFallback && allowFallback && result.shouldFallback();\n }\n if (tryToFallback) {\n var fallback = source[\"fallback\"];\n if (!fallback && parent) {\n parent.setShouldFallback(true);\n }\n if (typeof fallback === \"string\" && fallback.toLowerCase() === \"drop\") {\n result = undefined;\n }\n else if (typeof fallback === \"object\") {\n result = this.internalParseCardObject(parent, fallback, forbiddenTypeNames, true, createInstanceCallback, logParseEvent);\n }\n }\n }\n }\n return result;\n };\n SerializationContext.prototype.cardObjectParsed = function (o, source) {\n if (o instanceof Action && this.onParseAction) {\n this.onParseAction(o, source, this);\n }\n else if (o instanceof CardElement && this.onParseElement) {\n this.onParseElement(o, source, this);\n }\n };\n SerializationContext.prototype.shouldSerialize = function (o) {\n if (o instanceof Action) {\n return this.actionRegistry.findByName(o.getJsonTypeName()) !== undefined;\n }\n else if (o instanceof CardElement) {\n return this.elementRegistry.findByName(o.getJsonTypeName()) !== undefined;\n }\n else {\n return true;\n }\n };\n SerializationContext.prototype.parseCardObject = function (parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent) {\n var result = this.internalParseCardObject(parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent);\n if (result !== undefined) {\n this.cardObjectParsed(result, source);\n }\n return result;\n };\n SerializationContext.prototype.parseElement = function (parent, source, allowFallback) {\n var _this = this;\n return this.parseCardObject(parent, source, [], // Forbidden types not supported for elements for now\n allowFallback, function (typeName) {\n return _this.elementRegistry.createInstance(typeName, _this.targetVersion);\n }, function (typeName, errorType) {\n if (errorType === Enums.TypeErrorType.UnknownType) {\n _this.logParseEvent(undefined, Enums.ValidationEvent.UnknownElementType, strings_1.Strings.errors.unknownElementType(typeName));\n }\n else {\n _this.logParseEvent(undefined, Enums.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n }\n });\n };\n SerializationContext.prototype.parseAction = function (parent, source, forbiddenActionTypes, allowFallback) {\n var _this = this;\n return this.parseCardObject(parent, source, forbiddenActionTypes, allowFallback, function (typeName) {\n return _this.actionRegistry.createInstance(typeName, _this.targetVersion);\n }, function (typeName, errorType) {\n if (errorType == Enums.TypeErrorType.UnknownType) {\n _this.logParseEvent(undefined, Enums.ValidationEvent.UnknownActionType, strings_1.Strings.errors.unknownActionType(typeName));\n }\n else {\n _this.logParseEvent(undefined, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(typeName));\n }\n });\n };\n Object.defineProperty(SerializationContext.prototype, \"elementRegistry\", {\n get: function () {\n return this._elementRegistry ? this._elementRegistry : registry_1.GlobalRegistry.elements;\n },\n enumerable: false,\n configurable: true\n });\n // Not using a property setter here because the setter should accept \"undefined\"\n // whereas the getter should never return undefined.\n SerializationContext.prototype.setElementRegistry = function (value) {\n this._elementRegistry = value;\n };\n Object.defineProperty(SerializationContext.prototype, \"actionRegistry\", {\n get: function () {\n return this._actionRegistry ? this._actionRegistry : registry_1.GlobalRegistry.actions;\n },\n enumerable: false,\n configurable: true\n });\n // Not using a property setter here because the setter should accept \"undefined\"\n // whereas the getter should never return undefined.\n SerializationContext.prototype.setActionRegistry = function (value) {\n this._actionRegistry = value;\n };\n return SerializationContext;\n}(serialization_1.BaseSerializationContext));\nexports.SerializationContext = SerializationContext;\nregistry_1.GlobalRegistry.defaultElements.register(\"Container\", Container);\nregistry_1.GlobalRegistry.defaultElements.register(\"TextBlock\", TextBlock);\nregistry_1.GlobalRegistry.defaultElements.register(\"RichTextBlock\", RichTextBlock, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"TextRun\", TextRun, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"Image\", Image);\nregistry_1.GlobalRegistry.defaultElements.register(\"ImageSet\", ImageSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"Media\", Media, serialization_1.Versions.v1_1);\nregistry_1.GlobalRegistry.defaultElements.register(\"FactSet\", FactSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"ColumnSet\", ColumnSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"ActionSet\", ActionSet, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Text\", TextInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Date\", DateInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Time\", TimeInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Number\", NumberInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.ChoiceSet\", ChoiceSetInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Toggle\", ToggleInput);\nregistry_1.GlobalRegistry.defaultActions.register(OpenUrlAction.JsonTypeName, OpenUrlAction);\nregistry_1.GlobalRegistry.defaultActions.register(SubmitAction.JsonTypeName, SubmitAction);\nregistry_1.GlobalRegistry.defaultActions.register(ShowCardAction.JsonTypeName, ShowCardAction);\nregistry_1.GlobalRegistry.defaultActions.register(ToggleVisibilityAction.JsonTypeName, ToggleVisibilityAction, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultActions.register(ExecuteAction.JsonTypeName, ExecuteAction, serialization_1.Versions.v1_4);\n//# sourceMappingURL=card-elements.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CardObject = exports.ValidationResults = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar strings_1 = require(\"./strings\");\nvar shared_1 = require(\"./shared\");\nvar host_capabilities_1 = require(\"./host-capabilities\");\nvar serialization_1 = require(\"./serialization\");\nvar ValidationResults = /** @class */ (function () {\n function ValidationResults() {\n this.allIds = {};\n this.validationEvents = [];\n }\n ValidationResults.prototype.addFailure = function (cardObject, event, message) {\n this.validationEvents.push({\n phase: Enums.ValidationPhase.Validation,\n source: cardObject,\n event: event,\n message: message\n });\n };\n return ValidationResults;\n}());\nexports.ValidationResults = ValidationResults;\nvar CardObject = /** @class */ (function (_super) {\n __extends(CardObject, _super);\n function CardObject() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._shouldFallback = false;\n return _this;\n }\n CardObject.prototype.getSchemaKey = function () {\n return this.getJsonTypeName();\n };\n Object.defineProperty(CardObject.prototype, \"requires\", {\n get: function () {\n return this.getValue(CardObject.requiresProperty);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Checks if this CardObject contains the given DOM Node.\n * @param node The DOM Node to look for.\n * @returns `true` if the DOM Node was found, `false` otherwise.\n */\n CardObject.prototype.contains = function (node) {\n if (this._renderedElement) {\n return this._renderedElement.contains(node);\n }\n return false;\n };\n CardObject.prototype.preProcessPropertyValue = function (property, propertyValue) {\n var value = propertyValue === undefined ? this.getValue(property) : propertyValue;\n if (shared_1.GlobalSettings.allowPreProcessingPropertyValues) {\n var currentObject = this;\n while (currentObject && !currentObject.onPreProcessPropertyValue) {\n currentObject = currentObject.parent;\n }\n if (currentObject && currentObject.onPreProcessPropertyValue) {\n return currentObject.onPreProcessPropertyValue(this, property, value);\n }\n }\n return value;\n };\n CardObject.prototype.setParent = function (value) {\n this._parent = value;\n };\n CardObject.prototype.setShouldFallback = function (value) {\n this._shouldFallback = value;\n };\n CardObject.prototype.shouldFallback = function () {\n return this._shouldFallback || !this.requires.areAllMet(this.hostConfig.hostCapabilities);\n };\n CardObject.prototype.getRootObject = function () {\n var rootObject = this;\n while (rootObject.parent) {\n rootObject = rootObject.parent;\n }\n return rootObject;\n };\n CardObject.prototype.internalValidateProperties = function (context) {\n if (this.id) {\n if (context.allIds.hasOwnProperty(this.id)) {\n if (context.allIds[this.id] == 1) {\n context.addFailure(this, Enums.ValidationEvent.DuplicateId, strings_1.Strings.errors.duplicateId(this.id));\n }\n context.allIds[this.id] += 1;\n }\n else {\n context.allIds[this.id] = 1;\n }\n }\n };\n CardObject.prototype.validateProperties = function () {\n var result = new ValidationResults();\n this.internalValidateProperties(result);\n return result;\n };\n /**\n * Recursively searches this CardObject and any children to find the\n * innermost CardObject that owns the given DOM Node.\n *\n * @param node The DOM Node to look for.\n *\n * @returns The owner of the given DOM Node, or `undefined` if no owner was found.\n */\n CardObject.prototype.findDOMNodeOwner = function (node) {\n // default implementation for CardObjects with no associated children\n return this.contains(node) ? this : undefined;\n };\n Object.defineProperty(CardObject.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardObject.prototype, \"renderedElement\", {\n get: function () {\n return this._renderedElement;\n },\n enumerable: false,\n configurable: true\n });\n CardObject.typeNameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"type\", undefined, undefined, undefined, function (sender) {\n return sender.getJsonTypeName();\n });\n CardObject.idProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"id\");\n CardObject.requiresProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_2, \"requires\", host_capabilities_1.HostCapabilities, false, new host_capabilities_1.HostCapabilities());\n __decorate([\n serialization_1.property(CardObject.idProperty)\n ], CardObject.prototype, \"id\", void 0);\n __decorate([\n serialization_1.property(CardObject.requiresProperty)\n ], CardObject.prototype, \"requires\", null);\n return CardObject;\n}(serialization_1.SerializableObject));\nexports.CardObject = CardObject;\n//# sourceMappingURL=card-object.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChannelAdapter = void 0;\nvar ChannelAdapter = /** @class */ (function () {\n function ChannelAdapter() {\n }\n return ChannelAdapter;\n}());\nexports.ChannelAdapter = ChannelAdapter;\n//# sourceMappingURL=channel-adapter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Collection = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Collection = /** @class */ (function () {\n function Collection() {\n this._items = [];\n }\n Collection.prototype.get = function (index) {\n return this._items[index];\n };\n Collection.prototype.add = function (item) {\n this._items.push(item);\n if (this.onItemAdded) {\n this.onItemAdded(item);\n }\n };\n Collection.prototype.remove = function (item) {\n var i = this._items.indexOf(item);\n if (i >= 0) {\n this._items = this._items.splice(i, 1);\n if (this.onItemRemoved) {\n this.onItemRemoved(item);\n }\n }\n };\n Collection.prototype.indexOf = function (item) {\n return this._items.indexOf(item);\n };\n Object.defineProperty(Collection.prototype, \"length\", {\n get: function () {\n return this._items.length;\n },\n enumerable: false,\n configurable: true\n });\n return Collection;\n}());\nexports.Collection = Collection;\n//# sourceMappingURL=collection.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Constants = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Constants = /** @class */ (function () {\n function Constants() {\n }\n Constants.keys = {\n tab: \"Tab\",\n enter: \"Enter\",\n escape: \"Escape\",\n space: \" \",\n up: \"ArrowUp\",\n down: \"ArrowDown\",\n delete: \"Delete\"\n };\n return Constants;\n}());\nexports.Constants = Constants;\n//# sourceMappingURL=constants.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./menu-item\"), exports);\n__exportStar(require(\"./popup-menu\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MenuItem = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar host_config_1 = require(\"../host-config\");\nvar constants_1 = require(\"./constants\");\nvar MenuItem = /** @class */ (function () {\n function MenuItem(key, value) {\n this._isEnabled = true;\n this.key = key;\n this._value = value;\n }\n MenuItem.prototype.click = function () {\n if (this.isEnabled && this.onClick) {\n this.onClick(this);\n }\n };\n MenuItem.prototype.updateCssClasses = function () {\n if (this._element) {\n var effectiveHostConfig = this._hostConfig ? this._hostConfig : host_config_1.defaultHostConfig;\n this._element.className = effectiveHostConfig.makeCssClassName(\"ac-ctrl\");\n this._element.classList.add(effectiveHostConfig.makeCssClassName(this.isEnabled ? \"ac-ctrl-dropdown-item\" : \"ac-ctrl-dropdown-item-disabled\"));\n if (!this.isEnabled) {\n this._element.classList.add(effectiveHostConfig.makeCssClassName(\"ac-disabled\"));\n }\n }\n };\n MenuItem.prototype.toString = function () {\n return this.value;\n };\n MenuItem.prototype.render = function (hostConfig) {\n var _this = this;\n this._hostConfig = hostConfig;\n if (!this._element) {\n this._element = document.createElement(\"span\");\n this._element.innerText = this.value;\n this._element.setAttribute(\"role\", \"menuitem\");\n if (!this.isEnabled) {\n this._element.setAttribute(\"aria-disabled\", \"true\");\n }\n this._element.setAttribute(\"aria-selected\", \"false\");\n this._element.onmouseup = function (e) { _this.click(); };\n this._element.onkeydown = function (e) {\n if (e.key === constants_1.Constants.keys.enter) {\n e.cancelBubble = true;\n _this.click();\n }\n };\n this.updateCssClasses();\n }\n return this._element;\n };\n Object.defineProperty(MenuItem.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n set: function (newValue) {\n this._value = newValue;\n if (this._element) {\n this._element.innerText = newValue;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isEnabled\", {\n get: function () {\n return this._isEnabled;\n },\n set: function (value) {\n if (this._isEnabled !== value) {\n this._isEnabled = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n return MenuItem;\n}());\nexports.MenuItem = MenuItem;\n//# sourceMappingURL=menu-item.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopupControl = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar constants_1 = require(\"./constants\");\nvar Utils = require(\"../utils\");\nvar host_config_1 = require(\"../host-config\");\nvar PopupControl = /** @class */ (function () {\n function PopupControl() {\n this._isOpen = false;\n }\n PopupControl.prototype.keyDown = function (e) {\n switch (e.key) {\n case constants_1.Constants.keys.escape:\n this.closePopup(true);\n break;\n }\n };\n PopupControl.prototype.render = function (rootElementBounds) {\n var _this = this;\n var element = document.createElement(\"div\");\n element.tabIndex = 0;\n element.className = this.hostConfig.makeCssClassName(\"ac-ctrl\", \"ac-ctrl-popup-container\");\n element.setAttribute(\"role\", \"dialog\");\n element.setAttribute(\"aria-modal\", \"true\");\n element.onkeydown = function (e) {\n _this.keyDown(e);\n return !e.cancelBubble;\n };\n element.appendChild(this.renderContent());\n return element;\n };\n PopupControl.prototype.focus = function () {\n if (this._popupElement) {\n this._popupElement.firstElementChild.focus();\n }\n };\n PopupControl.prototype.popup = function (rootElement) {\n var _a, _b, _c, _d, _e;\n var _this = this;\n if (!this._isOpen) {\n this._overlayElement = document.createElement(\"div\");\n this._overlayElement.className = this.hostConfig.makeCssClassName(\"ac-ctrl-overlay\");\n this._overlayElement.tabIndex = 0;\n this._overlayElement.style.width = document.documentElement.scrollWidth + \"px\";\n this._overlayElement.style.height = document.documentElement.scrollHeight + \"px\";\n this._overlayElement.onfocus = function (e) { _this.closePopup(true); };\n document.body.appendChild(this._overlayElement);\n var rootElementBounds = rootElement.getBoundingClientRect();\n this._popupElement = this.render(rootElementBounds);\n (_a = this._popupElement.classList).remove.apply(_a, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideLeftToRight\", \"ac-ctrl-slideRightToLeft\", \"ac-ctrl-slideTopToBottom\", \"ac-ctrl-slideRightToLeft\"));\n window.addEventListener(\"resize\", function (e) { _this.closePopup(true); });\n var rootElementLabel = rootElement.getAttribute(\"aria-label\");\n if (rootElementLabel) {\n this._popupElement.setAttribute(\"aria-label\", rootElementLabel);\n }\n this._overlayElement.appendChild(this._popupElement);\n var popupElementBounds = this._popupElement.getBoundingClientRect();\n var availableSpaceBelow = window.innerHeight - rootElementBounds.bottom;\n var availableSpaceAbove = rootElementBounds.top;\n var availableSpaceRight = window.innerWidth - rootElementBounds.left;\n var availableSpaceRight = window.innerWidth - rootElementBounds.right;\n var availableSpaceLeft = rootElementBounds.left;\n var left = rootElementBounds.left + Utils.getScrollX();\n var top;\n if (availableSpaceAbove < popupElementBounds.height && availableSpaceBelow < popupElementBounds.height) {\n // Not enough space above or below root element\n var actualPopupHeight = Math.min(popupElementBounds.height, window.innerHeight);\n this._popupElement.style.maxHeight = actualPopupHeight + \"px\";\n if (actualPopupHeight < popupElementBounds.height) {\n top = Utils.getScrollY();\n }\n else {\n top = Utils.getScrollY() + rootElementBounds.top + (rootElementBounds.height - actualPopupHeight) / 2;\n }\n if (availableSpaceLeft < popupElementBounds.width && availableSpaceRight < popupElementBounds.width) {\n // Not enough space left or right of root element\n var actualPopupWidth = Math.min(popupElementBounds.width, window.innerWidth);\n this._popupElement.style.maxWidth = actualPopupWidth + \"px\";\n if (actualPopupWidth < popupElementBounds.width) {\n left = Utils.getScrollX();\n }\n else {\n left = Utils.getScrollX() + rootElementBounds.left + (rootElementBounds.width - actualPopupWidth) / 2;\n }\n }\n else {\n // Enough space on the left or right of the root element\n if (availableSpaceRight >= popupElementBounds.width) {\n left = Utils.getScrollX() + rootElementBounds.right;\n (_b = this._popupElement.classList).add.apply(_b, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideLeftToRight\"));\n }\n else {\n left = Utils.getScrollX() + rootElementBounds.left - popupElementBounds.width;\n (_c = this._popupElement.classList).add.apply(_c, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideRightToLeft\"));\n }\n }\n }\n else {\n // Enough space above or below root element\n if (availableSpaceBelow >= popupElementBounds.height) {\n top = Utils.getScrollY() + rootElementBounds.bottom;\n (_d = this._popupElement.classList).add.apply(_d, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideTopToBottom\"));\n }\n else {\n top = Utils.getScrollY() + rootElementBounds.top - popupElementBounds.height;\n (_e = this._popupElement.classList).add.apply(_e, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideBottomToTop\"));\n }\n if (availableSpaceRight < popupElementBounds.width) {\n left = Utils.getScrollX() + rootElementBounds.right - popupElementBounds.width;\n }\n }\n this._popupElement.style.left = left + \"px\";\n this._popupElement.style.top = top + \"px\";\n this._popupElement.focus();\n this._isOpen = true;\n }\n };\n PopupControl.prototype.closePopup = function (wasCancelled) {\n if (this._isOpen) {\n document.body.removeChild(this._overlayElement);\n this._isOpen = false;\n if (this.onClose) {\n this.onClose(this, wasCancelled);\n }\n }\n };\n Object.defineProperty(PopupControl.prototype, \"hostConfig\", {\n get: function () {\n return this._hostConfig ? this._hostConfig : host_config_1.defaultHostConfig;\n },\n set: function (value) {\n this._hostConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PopupControl.prototype, \"isOpen\", {\n get: function () {\n return this._isOpen;\n },\n enumerable: false,\n configurable: true\n });\n return PopupControl;\n}());\nexports.PopupControl = PopupControl;\n//# sourceMappingURL=popup-control.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopupMenu = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar constants_1 = require(\"./constants\");\nvar collection_1 = require(\"./collection\");\nvar popup_control_1 = require(\"./popup-control\");\nvar PopupMenu = /** @class */ (function (_super) {\n __extends(PopupMenu, _super);\n function PopupMenu() {\n var _this = _super.call(this) || this;\n _this._items = new collection_1.Collection();\n _this._renderedItems = [];\n _this._selectedIndex = -1;\n return _this;\n }\n PopupMenu.prototype.renderContent = function () {\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-ctrl ac-popup\");\n element.setAttribute(\"role\", \"listbox\");\n for (var i = 0; i < this._items.length; i++) {\n var renderedItem = this._items.get(i).render(this.hostConfig);\n renderedItem.tabIndex = 0;\n element.appendChild(renderedItem);\n if (i == this.selectedIndex) {\n renderedItem.focus();\n }\n this._renderedItems.push(renderedItem);\n }\n return element;\n };\n PopupMenu.prototype.keyDown = function (e) {\n _super.prototype.keyDown.call(this, e);\n var selectedItemIndex = this._selectedIndex;\n switch (e.key) {\n case constants_1.Constants.keys.tab:\n this.closePopup(true);\n break;\n /*\n case Constants.keys.enter:\n if (this.selectedIndex >= 0) {\n this.selectedIndex = this.selectedIndex;\n\n this.close();\n }\n\n break;\n */\n case constants_1.Constants.keys.up:\n if (selectedItemIndex <= 0) {\n selectedItemIndex = this._renderedItems.length - 1;\n }\n else {\n selectedItemIndex--;\n if (selectedItemIndex < 0) {\n selectedItemIndex = this._renderedItems.length - 1;\n }\n }\n this.selectedIndex = selectedItemIndex;\n e.cancelBubble = true;\n break;\n case constants_1.Constants.keys.down:\n if (selectedItemIndex < 0) {\n selectedItemIndex = 0;\n }\n else {\n selectedItemIndex++;\n if (selectedItemIndex >= this._renderedItems.length) {\n selectedItemIndex = 0;\n }\n }\n this.selectedIndex = selectedItemIndex;\n e.cancelBubble = true;\n break;\n }\n };\n Object.defineProperty(PopupMenu.prototype, \"items\", {\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PopupMenu.prototype, \"selectedIndex\", {\n get: function () {\n return this._selectedIndex;\n },\n set: function (index) {\n if (index >= 0 && index < this._renderedItems.length) {\n this._renderedItems[index].focus();\n this._selectedIndex = index;\n }\n },\n enumerable: false,\n configurable: true\n });\n return PopupMenu;\n}(popup_control_1.PopupControl));\nexports.PopupMenu = PopupMenu;\n//# sourceMappingURL=popup-menu.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LogLevel = exports.RefreshMode = exports.TypeErrorType = exports.ContainerFitStatus = exports.ValidationEvent = exports.ValidationPhase = exports.ContainerStyle = exports.InputTextStyle = exports.ActionIconPlacement = exports.FillMode = exports.Orientation = exports.ShowCardActionMode = exports.ImageStyle = exports.ActionAlignment = exports.VerticalAlignment = exports.HorizontalAlignment = exports.TextColor = exports.Spacing = exports.FontType = exports.TextWeight = exports.TextSize = exports.SizeUnit = exports.ImageSize = exports.Size = exports.ActionMode = exports.ActionStyle = void 0;\n// Note the \"weird\" way these readonly fields are declared is to work around\n// a breaking change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n// and adopt this syntax for all other static readonly fields.\nvar ActionStyle = /** @class */ (function () {\n function ActionStyle() {\n }\n ActionStyle.Default = \"default\";\n ActionStyle.Positive = \"positive\";\n ActionStyle.Destructive = \"destructive\";\n return ActionStyle;\n}());\nexports.ActionStyle = ActionStyle;\nvar ActionMode = /** @class */ (function () {\n function ActionMode() {\n }\n ActionMode.Primary = \"primary\";\n ActionMode.Secondary = \"secondary\";\n return ActionMode;\n}());\nexports.ActionMode = ActionMode;\nvar Size;\n(function (Size) {\n Size[Size[\"Auto\"] = 0] = \"Auto\";\n Size[Size[\"Stretch\"] = 1] = \"Stretch\";\n Size[Size[\"Small\"] = 2] = \"Small\";\n Size[Size[\"Medium\"] = 3] = \"Medium\";\n Size[Size[\"Large\"] = 4] = \"Large\";\n})(Size = exports.Size || (exports.Size = {}));\nvar ImageSize;\n(function (ImageSize) {\n ImageSize[ImageSize[\"Small\"] = 0] = \"Small\";\n ImageSize[ImageSize[\"Medium\"] = 1] = \"Medium\";\n ImageSize[ImageSize[\"Large\"] = 2] = \"Large\";\n})(ImageSize = exports.ImageSize || (exports.ImageSize = {}));\nvar SizeUnit;\n(function (SizeUnit) {\n SizeUnit[SizeUnit[\"Weight\"] = 0] = \"Weight\";\n SizeUnit[SizeUnit[\"Pixel\"] = 1] = \"Pixel\";\n})(SizeUnit = exports.SizeUnit || (exports.SizeUnit = {}));\nvar TextSize;\n(function (TextSize) {\n TextSize[TextSize[\"Small\"] = 0] = \"Small\";\n TextSize[TextSize[\"Default\"] = 1] = \"Default\";\n TextSize[TextSize[\"Medium\"] = 2] = \"Medium\";\n TextSize[TextSize[\"Large\"] = 3] = \"Large\";\n TextSize[TextSize[\"ExtraLarge\"] = 4] = \"ExtraLarge\";\n})(TextSize = exports.TextSize || (exports.TextSize = {}));\nvar TextWeight;\n(function (TextWeight) {\n TextWeight[TextWeight[\"Lighter\"] = 0] = \"Lighter\";\n TextWeight[TextWeight[\"Default\"] = 1] = \"Default\";\n TextWeight[TextWeight[\"Bolder\"] = 2] = \"Bolder\";\n})(TextWeight = exports.TextWeight || (exports.TextWeight = {}));\nvar FontType;\n(function (FontType) {\n FontType[FontType[\"Default\"] = 0] = \"Default\";\n FontType[FontType[\"Monospace\"] = 1] = \"Monospace\";\n})(FontType = exports.FontType || (exports.FontType = {}));\nvar Spacing;\n(function (Spacing) {\n Spacing[Spacing[\"None\"] = 0] = \"None\";\n Spacing[Spacing[\"Small\"] = 1] = \"Small\";\n Spacing[Spacing[\"Default\"] = 2] = \"Default\";\n Spacing[Spacing[\"Medium\"] = 3] = \"Medium\";\n Spacing[Spacing[\"Large\"] = 4] = \"Large\";\n Spacing[Spacing[\"ExtraLarge\"] = 5] = \"ExtraLarge\";\n Spacing[Spacing[\"Padding\"] = 6] = \"Padding\";\n})(Spacing = exports.Spacing || (exports.Spacing = {}));\nvar TextColor;\n(function (TextColor) {\n TextColor[TextColor[\"Default\"] = 0] = \"Default\";\n TextColor[TextColor[\"Dark\"] = 1] = \"Dark\";\n TextColor[TextColor[\"Light\"] = 2] = \"Light\";\n TextColor[TextColor[\"Accent\"] = 3] = \"Accent\";\n TextColor[TextColor[\"Good\"] = 4] = \"Good\";\n TextColor[TextColor[\"Warning\"] = 5] = \"Warning\";\n TextColor[TextColor[\"Attention\"] = 6] = \"Attention\";\n})(TextColor = exports.TextColor || (exports.TextColor = {}));\nvar HorizontalAlignment;\n(function (HorizontalAlignment) {\n HorizontalAlignment[HorizontalAlignment[\"Left\"] = 0] = \"Left\";\n HorizontalAlignment[HorizontalAlignment[\"Center\"] = 1] = \"Center\";\n HorizontalAlignment[HorizontalAlignment[\"Right\"] = 2] = \"Right\";\n})(HorizontalAlignment = exports.HorizontalAlignment || (exports.HorizontalAlignment = {}));\nvar VerticalAlignment;\n(function (VerticalAlignment) {\n VerticalAlignment[VerticalAlignment[\"Top\"] = 0] = \"Top\";\n VerticalAlignment[VerticalAlignment[\"Center\"] = 1] = \"Center\";\n VerticalAlignment[VerticalAlignment[\"Bottom\"] = 2] = \"Bottom\";\n})(VerticalAlignment = exports.VerticalAlignment || (exports.VerticalAlignment = {}));\nvar ActionAlignment;\n(function (ActionAlignment) {\n ActionAlignment[ActionAlignment[\"Left\"] = 0] = \"Left\";\n ActionAlignment[ActionAlignment[\"Center\"] = 1] = \"Center\";\n ActionAlignment[ActionAlignment[\"Right\"] = 2] = \"Right\";\n ActionAlignment[ActionAlignment[\"Stretch\"] = 3] = \"Stretch\";\n})(ActionAlignment = exports.ActionAlignment || (exports.ActionAlignment = {}));\nvar ImageStyle;\n(function (ImageStyle) {\n ImageStyle[ImageStyle[\"Default\"] = 0] = \"Default\";\n ImageStyle[ImageStyle[\"Person\"] = 1] = \"Person\";\n})(ImageStyle = exports.ImageStyle || (exports.ImageStyle = {}));\nvar ShowCardActionMode;\n(function (ShowCardActionMode) {\n ShowCardActionMode[ShowCardActionMode[\"Inline\"] = 0] = \"Inline\";\n ShowCardActionMode[ShowCardActionMode[\"Popup\"] = 1] = \"Popup\";\n})(ShowCardActionMode = exports.ShowCardActionMode || (exports.ShowCardActionMode = {}));\nvar Orientation;\n(function (Orientation) {\n Orientation[Orientation[\"Horizontal\"] = 0] = \"Horizontal\";\n Orientation[Orientation[\"Vertical\"] = 1] = \"Vertical\";\n})(Orientation = exports.Orientation || (exports.Orientation = {}));\nvar FillMode;\n(function (FillMode) {\n FillMode[FillMode[\"Cover\"] = 0] = \"Cover\";\n FillMode[FillMode[\"RepeatHorizontally\"] = 1] = \"RepeatHorizontally\";\n FillMode[FillMode[\"RepeatVertically\"] = 2] = \"RepeatVertically\";\n FillMode[FillMode[\"Repeat\"] = 3] = \"Repeat\";\n})(FillMode = exports.FillMode || (exports.FillMode = {}));\nvar ActionIconPlacement;\n(function (ActionIconPlacement) {\n ActionIconPlacement[ActionIconPlacement[\"LeftOfTitle\"] = 0] = \"LeftOfTitle\";\n ActionIconPlacement[ActionIconPlacement[\"AboveTitle\"] = 1] = \"AboveTitle\";\n})(ActionIconPlacement = exports.ActionIconPlacement || (exports.ActionIconPlacement = {}));\nvar InputTextStyle;\n(function (InputTextStyle) {\n InputTextStyle[InputTextStyle[\"Text\"] = 0] = \"Text\";\n InputTextStyle[InputTextStyle[\"Tel\"] = 1] = \"Tel\";\n InputTextStyle[InputTextStyle[\"Url\"] = 2] = \"Url\";\n InputTextStyle[InputTextStyle[\"Email\"] = 3] = \"Email\";\n InputTextStyle[InputTextStyle[\"Password\"] = 4] = \"Password\";\n})(InputTextStyle = exports.InputTextStyle || (exports.InputTextStyle = {}));\n/*\n This should really be a string enum, e.g.\n\n export enum ContainerStyle {\n Default = \"default\",\n Emphasis = \"emphasis\"\n }\n\n However, some hosts do not use a version of TypeScript\n recent enough to understand string enums. This is\n a compatible construct that does not require using\n a more recent version of TypeScript.\n\n Also note the \"weird\" way these readonly fields are declared is to work around\n a breaking change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n and adopt this syntax for all other static readonly fields.\n*/\nvar ContainerStyle = /** @class */ (function () {\n function ContainerStyle() {\n }\n ContainerStyle.Default = \"default\";\n ContainerStyle.Emphasis = \"emphasis\";\n ContainerStyle.Accent = \"accent\";\n ContainerStyle.Good = \"good\";\n ContainerStyle.Attention = \"attention\";\n ContainerStyle.Warning = \"warning\";\n return ContainerStyle;\n}());\nexports.ContainerStyle = ContainerStyle;\nvar ValidationPhase;\n(function (ValidationPhase) {\n ValidationPhase[ValidationPhase[\"Parse\"] = 0] = \"Parse\";\n ValidationPhase[ValidationPhase[\"ToJSON\"] = 1] = \"ToJSON\";\n ValidationPhase[ValidationPhase[\"Validation\"] = 2] = \"Validation\";\n})(ValidationPhase = exports.ValidationPhase || (exports.ValidationPhase = {}));\nvar ValidationEvent;\n(function (ValidationEvent) {\n ValidationEvent[ValidationEvent[\"Hint\"] = 0] = \"Hint\";\n ValidationEvent[ValidationEvent[\"ActionTypeNotAllowed\"] = 1] = \"ActionTypeNotAllowed\";\n ValidationEvent[ValidationEvent[\"CollectionCantBeEmpty\"] = 2] = \"CollectionCantBeEmpty\";\n ValidationEvent[ValidationEvent[\"Deprecated\"] = 3] = \"Deprecated\";\n ValidationEvent[ValidationEvent[\"ElementTypeNotAllowed\"] = 4] = \"ElementTypeNotAllowed\";\n ValidationEvent[ValidationEvent[\"InteractivityNotAllowed\"] = 5] = \"InteractivityNotAllowed\";\n ValidationEvent[ValidationEvent[\"InvalidPropertyValue\"] = 6] = \"InvalidPropertyValue\";\n ValidationEvent[ValidationEvent[\"MissingCardType\"] = 7] = \"MissingCardType\";\n ValidationEvent[ValidationEvent[\"PropertyCantBeNull\"] = 8] = \"PropertyCantBeNull\";\n ValidationEvent[ValidationEvent[\"TooManyActions\"] = 9] = \"TooManyActions\";\n ValidationEvent[ValidationEvent[\"UnknownActionType\"] = 10] = \"UnknownActionType\";\n ValidationEvent[ValidationEvent[\"UnknownElementType\"] = 11] = \"UnknownElementType\";\n ValidationEvent[ValidationEvent[\"UnsupportedCardVersion\"] = 12] = \"UnsupportedCardVersion\";\n ValidationEvent[ValidationEvent[\"DuplicateId\"] = 13] = \"DuplicateId\";\n ValidationEvent[ValidationEvent[\"UnsupportedProperty\"] = 14] = \"UnsupportedProperty\";\n ValidationEvent[ValidationEvent[\"RequiredInputsShouldHaveLabel\"] = 15] = \"RequiredInputsShouldHaveLabel\";\n ValidationEvent[ValidationEvent[\"RequiredInputsShouldHaveErrorMessage\"] = 16] = \"RequiredInputsShouldHaveErrorMessage\";\n ValidationEvent[ValidationEvent[\"Other\"] = 17] = \"Other\";\n})(ValidationEvent = exports.ValidationEvent || (exports.ValidationEvent = {}));\nvar ContainerFitStatus;\n(function (ContainerFitStatus) {\n ContainerFitStatus[ContainerFitStatus[\"FullyInContainer\"] = 0] = \"FullyInContainer\";\n ContainerFitStatus[ContainerFitStatus[\"Overflowing\"] = 1] = \"Overflowing\";\n ContainerFitStatus[ContainerFitStatus[\"FullyOutOfContainer\"] = 2] = \"FullyOutOfContainer\";\n})(ContainerFitStatus = exports.ContainerFitStatus || (exports.ContainerFitStatus = {}));\nvar TypeErrorType;\n(function (TypeErrorType) {\n TypeErrorType[TypeErrorType[\"UnknownType\"] = 0] = \"UnknownType\";\n TypeErrorType[TypeErrorType[\"ForbiddenType\"] = 1] = \"ForbiddenType\";\n})(TypeErrorType = exports.TypeErrorType || (exports.TypeErrorType = {}));\nvar RefreshMode;\n(function (RefreshMode) {\n RefreshMode[RefreshMode[\"Disabled\"] = 0] = \"Disabled\";\n RefreshMode[RefreshMode[\"Manual\"] = 1] = \"Manual\";\n RefreshMode[RefreshMode[\"Automatic\"] = 2] = \"Automatic\";\n})(RefreshMode = exports.RefreshMode || (exports.RefreshMode = {}));\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Info\"] = 0] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 1] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 2] = \"Error\";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n//# sourceMappingURL=enums.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HostCapabilities = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar serialization_1 = require(\"./serialization\");\nvar HostCapabilities = /** @class */ (function (_super) {\n __extends(HostCapabilities, _super);\n function HostCapabilities() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._capabilities = {};\n return _this;\n }\n HostCapabilities.prototype.getSchemaKey = function () {\n return \"HostCapabilities\";\n };\n HostCapabilities.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n if (source) {\n for (var name_1 in source) {\n var jsonVersion = source[name_1];\n if (typeof jsonVersion === \"string\") {\n if (jsonVersion == \"*\") {\n this.addCapability(name_1, \"*\");\n }\n else {\n var version = serialization_1.Version.parse(jsonVersion, context);\n if (version && version.isValid) {\n this.addCapability(name_1, version);\n }\n }\n }\n }\n }\n };\n HostCapabilities.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n for (var key in this._capabilities) {\n target[key] = this._capabilities[key];\n }\n };\n HostCapabilities.prototype.addCapability = function (name, version) {\n this._capabilities[name] = version;\n };\n HostCapabilities.prototype.removeCapability = function (name) {\n delete this._capabilities[name];\n };\n HostCapabilities.prototype.clear = function () {\n this._capabilities = {};\n };\n HostCapabilities.prototype.hasCapability = function (name, version) {\n if (this._capabilities.hasOwnProperty(name)) {\n if (version == \"*\" || this._capabilities[name] == \"*\") {\n return true;\n }\n return version.compareTo(this._capabilities[name]) <= 0;\n }\n return false;\n };\n HostCapabilities.prototype.areAllMet = function (hostCapabilities) {\n for (var capabilityName in this._capabilities) {\n if (!hostCapabilities.hasCapability(capabilityName, this._capabilities[capabilityName])) {\n return false;\n }\n }\n return true;\n };\n return HostCapabilities;\n}(serialization_1.SerializableObject));\nexports.HostCapabilities = HostCapabilities;\n//# sourceMappingURL=host-capabilities.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultHostConfig = exports.HostConfig = exports.FontTypeSet = exports.FontTypeDefinition = exports.ContainerStyleSet = exports.ContainerStyleDefinition = exports.ColorSetDefinition = exports.ActionsConfig = exports.ShowCardActionConfig = exports.FactSetConfig = exports.FactTitleDefinition = exports.FactTextDefinition = exports.InputConfig = exports.InputLabelConfig = exports.RequiredInputLabelTextDefinition = exports.TextBlockConfig = exports.TextStyleSet = exports.TextStyleDefinition = exports.BaseTextDefinition = exports.TableConfig = exports.MediaConfig = exports.ImageSetConfig = exports.AdaptiveCardConfig = exports.TextColorDefinition = exports.ColorDefinition = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar Utils = require(\"./utils\");\nvar Shared = require(\"./shared\");\nvar host_capabilities_1 = require(\"./host-capabilities\");\nfunction parseHostConfigEnum(targetEnum, value, defaultValue) {\n if (typeof value === \"string\") {\n var parsedValue = Utils.parseEnum(targetEnum, value, defaultValue);\n return parsedValue !== undefined ? parsedValue : defaultValue;\n }\n else if (typeof value === \"number\") {\n return value;\n }\n else {\n return defaultValue;\n }\n}\nvar ColorDefinition = /** @class */ (function () {\n function ColorDefinition(defaultColor, subtleColor) {\n this.default = \"#000000\";\n this.subtle = \"#666666\";\n if (defaultColor) {\n this.default = defaultColor;\n }\n if (subtleColor) {\n this.subtle = subtleColor;\n }\n }\n ColorDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.default = obj[\"default\"] || this.default;\n this.subtle = obj[\"subtle\"] || this.subtle;\n }\n };\n return ColorDefinition;\n}());\nexports.ColorDefinition = ColorDefinition;\nvar TextColorDefinition = /** @class */ (function (_super) {\n __extends(TextColorDefinition, _super);\n function TextColorDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.highlightColors = new ColorDefinition(\"#22000000\", \"#11000000\");\n return _this;\n }\n TextColorDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.highlightColors.parse(obj[\"highlightColors\"]);\n }\n };\n return TextColorDefinition;\n}(ColorDefinition));\nexports.TextColorDefinition = TextColorDefinition;\nvar AdaptiveCardConfig = /** @class */ (function () {\n function AdaptiveCardConfig(obj) {\n this.allowCustomStyle = false;\n if (obj) {\n this.allowCustomStyle = obj[\"allowCustomStyle\"] || this.allowCustomStyle;\n }\n }\n return AdaptiveCardConfig;\n}());\nexports.AdaptiveCardConfig = AdaptiveCardConfig;\nvar ImageSetConfig = /** @class */ (function () {\n function ImageSetConfig(obj) {\n this.imageSize = Enums.Size.Medium;\n this.maxImageHeight = 100;\n if (obj) {\n this.imageSize = obj[\"imageSize\"] != null ? obj[\"imageSize\"] : this.imageSize;\n this.maxImageHeight = Utils.parseNumber(obj[\"maxImageHeight\"], 100);\n }\n }\n ImageSetConfig.prototype.toJSON = function () {\n return {\n imageSize: Enums.Size[this.imageSize],\n maxImageHeight: this.maxImageHeight\n };\n };\n return ImageSetConfig;\n}());\nexports.ImageSetConfig = ImageSetConfig;\nvar MediaConfig = /** @class */ (function () {\n function MediaConfig(obj) {\n this.allowInlinePlayback = true;\n if (obj) {\n this.defaultPoster = obj[\"defaultPoster\"];\n this.allowInlinePlayback = obj[\"allowInlinePlayback\"] || this.allowInlinePlayback;\n }\n }\n MediaConfig.prototype.toJSON = function () {\n return {\n defaultPoster: this.defaultPoster,\n allowInlinePlayback: this.allowInlinePlayback\n };\n };\n return MediaConfig;\n}());\nexports.MediaConfig = MediaConfig;\nvar TableConfig = /** @class */ (function () {\n function TableConfig(obj) {\n this.cellSpacing = 8;\n if (obj) {\n this.cellSpacing = obj.cellSpacing && typeof obj.cellSpacing === \"number\" ? obj.cellSpacing : this.cellSpacing;\n }\n }\n TableConfig.prototype.toJSON = function () {\n return {\n cellSpacing: this.cellSpacing\n };\n };\n return TableConfig;\n}());\nexports.TableConfig = TableConfig;\nvar BaseTextDefinition = /** @class */ (function () {\n function BaseTextDefinition(obj) {\n this.size = Enums.TextSize.Default;\n this.color = Enums.TextColor.Default;\n this.isSubtle = false;\n this.weight = Enums.TextWeight.Default;\n this.parse(obj);\n }\n ;\n BaseTextDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.size = parseHostConfigEnum(Enums.TextSize, obj[\"size\"], this.size);\n this.color = parseHostConfigEnum(Enums.TextColor, obj[\"color\"], this.color);\n this.isSubtle = obj.isSubtle !== undefined && typeof obj.isSubtle === \"boolean\" ? obj.isSubtle : this.isSubtle;\n this.weight = parseHostConfigEnum(Enums.TextWeight, obj[\"weight\"], this.getDefaultWeight());\n }\n };\n BaseTextDefinition.prototype.getDefaultWeight = function () {\n return Enums.TextWeight.Default;\n };\n BaseTextDefinition.prototype.toJSON = function () {\n return {\n size: Enums.TextSize[this.size],\n color: Enums.TextColor[this.color],\n isSubtle: this.isSubtle,\n weight: Enums.TextWeight[this.weight]\n };\n };\n return BaseTextDefinition;\n}());\nexports.BaseTextDefinition = BaseTextDefinition;\nvar TextStyleDefinition = /** @class */ (function (_super) {\n __extends(TextStyleDefinition, _super);\n function TextStyleDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.fontType = Enums.FontType.Default;\n return _this;\n }\n TextStyleDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.fontType = parseHostConfigEnum(Enums.FontType, obj.fontType, this.fontType);\n }\n };\n return TextStyleDefinition;\n}(BaseTextDefinition));\nexports.TextStyleDefinition = TextStyleDefinition;\nvar TextStyleSet = /** @class */ (function () {\n function TextStyleSet(obj) {\n this.default = new TextStyleDefinition();\n this.heading = new TextStyleDefinition({\n size: \"Large\",\n weight: \"Bolder\"\n });\n this.columnHeader = new TextStyleDefinition({\n weight: \"Bolder\"\n });\n if (obj) {\n this.heading.parse(obj.heading);\n this.columnHeader.parse(obj.columnHeader);\n }\n }\n TextStyleSet.prototype.getStyleByName = function (name) {\n switch (name.toLowerCase()) {\n case \"heading\":\n return this.heading;\n case \"columnHeader\":\n return this.columnHeader;\n default:\n return this.default;\n }\n };\n return TextStyleSet;\n}());\nexports.TextStyleSet = TextStyleSet;\nvar TextBlockConfig = /** @class */ (function () {\n function TextBlockConfig(obj) {\n if (obj) {\n this.headingLevel = Utils.parseNumber(obj.headingLevel);\n }\n }\n return TextBlockConfig;\n}());\nexports.TextBlockConfig = TextBlockConfig;\nvar RequiredInputLabelTextDefinition = /** @class */ (function (_super) {\n __extends(RequiredInputLabelTextDefinition, _super);\n function RequiredInputLabelTextDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.suffix = \" *\";\n _this.suffixColor = Enums.TextColor.Attention;\n return _this;\n }\n RequiredInputLabelTextDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.suffix = obj[\"suffix\"] || this.suffix;\n this.suffixColor = parseHostConfigEnum(Enums.TextColor, obj[\"suffixColor\"], this.suffixColor);\n }\n };\n RequiredInputLabelTextDefinition.prototype.toJSON = function () {\n var result = _super.prototype.toJSON.call(this);\n result[\"suffix\"] = this.suffix;\n result[\"suffixColor\"] = Enums.TextColor[this.suffixColor];\n return result;\n };\n return RequiredInputLabelTextDefinition;\n}(BaseTextDefinition));\nexports.RequiredInputLabelTextDefinition = RequiredInputLabelTextDefinition;\nvar InputLabelConfig = /** @class */ (function () {\n function InputLabelConfig(obj) {\n this.inputSpacing = Enums.Spacing.Small;\n this.requiredInputs = new RequiredInputLabelTextDefinition();\n this.optionalInputs = new BaseTextDefinition();\n if (obj) {\n this.inputSpacing = parseHostConfigEnum(Enums.Spacing, obj[\"inputSpacing\"], this.inputSpacing);\n this.requiredInputs = new RequiredInputLabelTextDefinition(obj[\"requiredInputs\"]);\n this.optionalInputs = new BaseTextDefinition(obj[\"optionalInputs\"]);\n }\n }\n return InputLabelConfig;\n}());\nexports.InputLabelConfig = InputLabelConfig;\nvar InputConfig = /** @class */ (function () {\n function InputConfig(obj) {\n this.label = new InputLabelConfig();\n this.errorMessage = new BaseTextDefinition({ color: Enums.TextColor.Attention });\n if (obj) {\n this.label = new InputLabelConfig(obj[\"label\"]);\n this.errorMessage = new BaseTextDefinition(obj[\"errorMessage\"]);\n }\n }\n return InputConfig;\n}());\nexports.InputConfig = InputConfig;\nvar FactTextDefinition = /** @class */ (function (_super) {\n __extends(FactTextDefinition, _super);\n function FactTextDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.wrap = true;\n return _this;\n }\n FactTextDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.wrap = obj[\"wrap\"] != null ? obj[\"wrap\"] : this.wrap;\n }\n };\n FactTextDefinition.prototype.toJSON = function () {\n var result = _super.prototype.toJSON.call(this);\n result[\"wrap\"] = this.wrap;\n return result;\n };\n return FactTextDefinition;\n}(BaseTextDefinition));\nexports.FactTextDefinition = FactTextDefinition;\nvar FactTitleDefinition = /** @class */ (function (_super) {\n __extends(FactTitleDefinition, _super);\n function FactTitleDefinition(obj) {\n var _this = _super.call(this, obj) || this;\n _this.maxWidth = 150;\n _this.weight = Enums.TextWeight.Bolder;\n if (obj) {\n _this.maxWidth = obj[\"maxWidth\"] != null ? obj[\"maxWidth\"] : _this.maxWidth;\n _this.weight = parseHostConfigEnum(Enums.TextWeight, obj[\"weight\"], Enums.TextWeight.Bolder);\n }\n return _this;\n }\n FactTitleDefinition.prototype.getDefaultWeight = function () {\n return Enums.TextWeight.Bolder;\n };\n return FactTitleDefinition;\n}(FactTextDefinition));\nexports.FactTitleDefinition = FactTitleDefinition;\nvar FactSetConfig = /** @class */ (function () {\n function FactSetConfig(obj) {\n this.title = new FactTitleDefinition();\n this.value = new FactTextDefinition();\n this.spacing = 10;\n if (obj) {\n this.title = new FactTitleDefinition(obj[\"title\"]);\n this.value = new FactTextDefinition(obj[\"value\"]);\n this.spacing = obj.spacing && obj.spacing != null ? obj.spacing && obj.spacing : this.spacing;\n }\n }\n return FactSetConfig;\n}());\nexports.FactSetConfig = FactSetConfig;\nvar ShowCardActionConfig = /** @class */ (function () {\n function ShowCardActionConfig(obj) {\n this.actionMode = Enums.ShowCardActionMode.Inline;\n this.inlineTopMargin = 16;\n this.style = Enums.ContainerStyle.Emphasis;\n if (obj) {\n this.actionMode = parseHostConfigEnum(Enums.ShowCardActionMode, obj[\"actionMode\"], Enums.ShowCardActionMode.Inline);\n this.inlineTopMargin = obj[\"inlineTopMargin\"] != null ? obj[\"inlineTopMargin\"] : this.inlineTopMargin;\n this.style = obj[\"style\"] && typeof obj[\"style\"] === \"string\" ? obj[\"style\"] : Enums.ContainerStyle.Emphasis;\n }\n }\n ShowCardActionConfig.prototype.toJSON = function () {\n return {\n actionMode: Enums.ShowCardActionMode[this.actionMode],\n inlineTopMargin: this.inlineTopMargin,\n style: this.style\n };\n };\n return ShowCardActionConfig;\n}());\nexports.ShowCardActionConfig = ShowCardActionConfig;\nvar ActionsConfig = /** @class */ (function () {\n function ActionsConfig(obj) {\n this.maxActions = 5;\n this.spacing = Enums.Spacing.Default;\n this.buttonSpacing = 20;\n this.showCard = new ShowCardActionConfig();\n this.preExpandSingleShowCardAction = false;\n this.actionsOrientation = Enums.Orientation.Horizontal;\n this.actionAlignment = Enums.ActionAlignment.Left;\n this.iconPlacement = Enums.ActionIconPlacement.LeftOfTitle;\n this.allowTitleToWrap = false;\n this.iconSize = 16;\n if (obj) {\n this.maxActions = obj[\"maxActions\"] != null ? obj[\"maxActions\"] : this.maxActions;\n this.spacing = parseHostConfigEnum(Enums.Spacing, obj.spacing && obj.spacing, Enums.Spacing.Default);\n this.buttonSpacing = obj[\"buttonSpacing\"] != null ? obj[\"buttonSpacing\"] : this.buttonSpacing;\n this.showCard = new ShowCardActionConfig(obj[\"showCard\"]);\n this.preExpandSingleShowCardAction = Utils.parseBool(obj[\"preExpandSingleShowCardAction\"], false);\n this.actionsOrientation = parseHostConfigEnum(Enums.Orientation, obj[\"actionsOrientation\"], Enums.Orientation.Horizontal);\n this.actionAlignment = parseHostConfigEnum(Enums.ActionAlignment, obj[\"actionAlignment\"], Enums.ActionAlignment.Left);\n this.iconPlacement = parseHostConfigEnum(Enums.ActionIconPlacement, obj[\"iconPlacement\"], Enums.ActionIconPlacement.LeftOfTitle);\n this.allowTitleToWrap = obj[\"allowTitleToWrap\"] != null ? obj[\"allowTitleToWrap\"] : this.allowTitleToWrap;\n try {\n var sizeAndUnit = Shared.SizeAndUnit.parse(obj[\"iconSize\"]);\n if (sizeAndUnit.unit == Enums.SizeUnit.Pixel) {\n this.iconSize = sizeAndUnit.physicalSize;\n }\n }\n catch (e) {\n // Swallow this, keep default icon size\n }\n }\n }\n ActionsConfig.prototype.toJSON = function () {\n return {\n maxActions: this.maxActions,\n spacing: Enums.Spacing[this.spacing],\n buttonSpacing: this.buttonSpacing,\n showCard: this.showCard,\n preExpandSingleShowCardAction: this.preExpandSingleShowCardAction,\n actionsOrientation: Enums.Orientation[this.actionsOrientation],\n actionAlignment: Enums.ActionAlignment[this.actionAlignment]\n };\n };\n return ActionsConfig;\n}());\nexports.ActionsConfig = ActionsConfig;\nvar ColorSetDefinition = /** @class */ (function () {\n function ColorSetDefinition(obj) {\n this.default = new TextColorDefinition();\n this.dark = new TextColorDefinition();\n this.light = new TextColorDefinition();\n this.accent = new TextColorDefinition();\n this.good = new TextColorDefinition();\n this.warning = new TextColorDefinition();\n this.attention = new TextColorDefinition();\n this.parse(obj);\n }\n ColorSetDefinition.prototype.parseSingleColor = function (obj, propertyName) {\n if (obj) {\n this[propertyName].parse(obj[propertyName]);\n }\n };\n ColorSetDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.parseSingleColor(obj, \"default\");\n this.parseSingleColor(obj, \"dark\");\n this.parseSingleColor(obj, \"light\");\n this.parseSingleColor(obj, \"accent\");\n this.parseSingleColor(obj, \"good\");\n this.parseSingleColor(obj, \"warning\");\n this.parseSingleColor(obj, \"attention\");\n }\n };\n return ColorSetDefinition;\n}());\nexports.ColorSetDefinition = ColorSetDefinition;\nvar ContainerStyleDefinition = /** @class */ (function () {\n function ContainerStyleDefinition(obj) {\n this.foregroundColors = new ColorSetDefinition({\n \"default\": { default: \"#333333\", subtle: \"#EE333333\" },\n \"dark\": { default: \"#000000\", subtle: \"#66000000\" },\n \"light\": { default: \"#FFFFFF\", subtle: \"#33000000\" },\n \"accent\": { default: \"#2E89FC\", subtle: \"#882E89FC\" },\n \"good\": { default: \"#028A02\", subtle: \"#DD027502\" },\n \"warning\": { default: \"#E69500\", subtle: \"#DDE69500\" },\n \"attention\": { default: \"#CC3300\", subtle: \"#DDCC3300\" }\n });\n this.parse(obj);\n }\n ContainerStyleDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.backgroundColor = obj[\"backgroundColor\"];\n this.foregroundColors.parse(obj[\"foregroundColors\"]);\n this.highlightBackgroundColor = obj[\"highlightBackgroundColor\"];\n this.highlightForegroundColor = obj[\"highlightForegroundColor\"];\n this.borderColor = obj[\"borderColor\"];\n }\n };\n Object.defineProperty(ContainerStyleDefinition.prototype, \"isBuiltIn\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return ContainerStyleDefinition;\n}());\nexports.ContainerStyleDefinition = ContainerStyleDefinition;\nvar BuiltInContainerStyleDefinition = /** @class */ (function (_super) {\n __extends(BuiltInContainerStyleDefinition, _super);\n function BuiltInContainerStyleDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(BuiltInContainerStyleDefinition.prototype, \"isBuiltIn\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n return BuiltInContainerStyleDefinition;\n}(ContainerStyleDefinition));\nvar ContainerStyleSet = /** @class */ (function () {\n function ContainerStyleSet(obj) {\n this._allStyles = {};\n this._allStyles[Enums.ContainerStyle.Default] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Emphasis] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Accent] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Good] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Attention] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Warning] = new BuiltInContainerStyleDefinition();\n if (obj) {\n this._allStyles[Enums.ContainerStyle.Default].parse(obj[Enums.ContainerStyle.Default]);\n this._allStyles[Enums.ContainerStyle.Emphasis].parse(obj[Enums.ContainerStyle.Emphasis]);\n this._allStyles[Enums.ContainerStyle.Accent].parse(obj[Enums.ContainerStyle.Accent]);\n this._allStyles[Enums.ContainerStyle.Good].parse(obj[Enums.ContainerStyle.Good]);\n this._allStyles[Enums.ContainerStyle.Attention].parse(obj[Enums.ContainerStyle.Attention]);\n this._allStyles[Enums.ContainerStyle.Warning].parse(obj[Enums.ContainerStyle.Warning]);\n var customStyleArray = obj[\"customStyles\"];\n if (customStyleArray && Array.isArray(customStyleArray)) {\n for (var _i = 0, customStyleArray_1 = customStyleArray; _i < customStyleArray_1.length; _i++) {\n var customStyle = customStyleArray_1[_i];\n if (customStyle) {\n var styleName = customStyle[\"name\"];\n if (styleName && typeof styleName === \"string\") {\n if (this._allStyles.hasOwnProperty(styleName)) {\n this._allStyles[styleName].parse(customStyle[\"style\"]);\n }\n else {\n this._allStyles[styleName] = new ContainerStyleDefinition(customStyle[\"style\"]);\n }\n }\n }\n }\n }\n }\n }\n ContainerStyleSet.prototype.toJSON = function () {\n var _this = this;\n var customStyleArray = [];\n Object.keys(this._allStyles).forEach(function (key) {\n if (!_this._allStyles[key].isBuiltIn) {\n customStyleArray.push({\n name: key,\n style: _this._allStyles[key]\n });\n }\n });\n var result = {\n default: this.default,\n emphasis: this.emphasis\n };\n if (customStyleArray.length > 0) {\n result.customStyles = customStyleArray;\n }\n return result;\n };\n ContainerStyleSet.prototype.getStyleByName = function (name, defaultValue) {\n if (name && this._allStyles.hasOwnProperty(name)) {\n return this._allStyles[name];\n }\n else {\n return defaultValue ? defaultValue : this._allStyles[Enums.ContainerStyle.Default];\n }\n };\n Object.defineProperty(ContainerStyleSet.prototype, \"default\", {\n get: function () {\n return this._allStyles[Enums.ContainerStyle.Default];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ContainerStyleSet.prototype, \"emphasis\", {\n get: function () {\n return this._allStyles[Enums.ContainerStyle.Emphasis];\n },\n enumerable: false,\n configurable: true\n });\n return ContainerStyleSet;\n}());\nexports.ContainerStyleSet = ContainerStyleSet;\nvar FontTypeDefinition = /** @class */ (function () {\n function FontTypeDefinition(fontFamily) {\n this.fontFamily = \"Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif\";\n this.fontSizes = {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n };\n this.fontWeights = {\n lighter: 200,\n default: 400,\n bolder: 600\n };\n if (fontFamily) {\n this.fontFamily = fontFamily;\n }\n }\n FontTypeDefinition.prototype.parse = function (obj) {\n this.fontFamily = obj[\"fontFamily\"] || this.fontFamily;\n this.fontSizes = {\n small: obj.fontSizes && obj.fontSizes[\"small\"] || this.fontSizes.small,\n default: obj.fontSizes && obj.fontSizes[\"default\"] || this.fontSizes.default,\n medium: obj.fontSizes && obj.fontSizes[\"medium\"] || this.fontSizes.medium,\n large: obj.fontSizes && obj.fontSizes[\"large\"] || this.fontSizes.large,\n extraLarge: obj.fontSizes && obj.fontSizes[\"extraLarge\"] || this.fontSizes.extraLarge\n };\n this.fontWeights = {\n lighter: obj.fontWeights && obj.fontWeights[\"lighter\"] || this.fontWeights.lighter,\n default: obj.fontWeights && obj.fontWeights[\"default\"] || this.fontWeights.default,\n bolder: obj.fontWeights && obj.fontWeights[\"bolder\"] || this.fontWeights.bolder\n };\n };\n FontTypeDefinition.monospace = new FontTypeDefinition(\"'Courier New', Courier, monospace\");\n return FontTypeDefinition;\n}());\nexports.FontTypeDefinition = FontTypeDefinition;\nvar FontTypeSet = /** @class */ (function () {\n function FontTypeSet(obj) {\n this.default = new FontTypeDefinition();\n this.monospace = new FontTypeDefinition(\"'Courier New', Courier, monospace\");\n if (obj) {\n this.default.parse(obj[\"default\"]);\n this.monospace.parse(obj[\"monospace\"]);\n }\n }\n FontTypeSet.prototype.getStyleDefinition = function (style) {\n switch (style) {\n case Enums.FontType.Monospace:\n return this.monospace;\n case Enums.FontType.Default:\n default:\n return this.default;\n }\n };\n return FontTypeSet;\n}());\nexports.FontTypeSet = FontTypeSet;\nvar HostConfig = /** @class */ (function () {\n function HostConfig(obj) {\n this.hostCapabilities = new host_capabilities_1.HostCapabilities();\n this.choiceSetInputValueSeparator = \",\";\n this.supportsInteractivity = true;\n this.spacing = {\n small: 3,\n default: 8,\n medium: 20,\n large: 30,\n extraLarge: 40,\n padding: 15\n };\n this.separator = {\n lineThickness: 1,\n lineColor: \"#EEEEEE\"\n };\n this.imageSizes = {\n small: 40,\n medium: 80,\n large: 160\n };\n this.containerStyles = new ContainerStyleSet();\n this.inputs = new InputConfig();\n this.actions = new ActionsConfig();\n this.adaptiveCard = new AdaptiveCardConfig();\n this.imageSet = new ImageSetConfig();\n this.media = new MediaConfig();\n this.factSet = new FactSetConfig();\n this.table = new TableConfig();\n this.textStyles = new TextStyleSet();\n this.textBlock = new TextBlockConfig();\n this.alwaysAllowBleed = false;\n if (obj) {\n if (typeof obj === \"string\" || obj instanceof String) {\n obj = JSON.parse(obj);\n }\n this.choiceSetInputValueSeparator = (obj && typeof obj[\"choiceSetInputValueSeparator\"] === \"string\") ? obj[\"choiceSetInputValueSeparator\"] : this.choiceSetInputValueSeparator;\n this.supportsInteractivity = (obj && typeof obj[\"supportsInteractivity\"] === \"boolean\") ? obj[\"supportsInteractivity\"] : this.supportsInteractivity;\n this._legacyFontType = new FontTypeDefinition();\n this._legacyFontType.parse(obj);\n if (obj.fontTypes) {\n this.fontTypes = new FontTypeSet(obj.fontTypes);\n }\n if (obj.lineHeights) {\n this.lineHeights = {\n small: obj.lineHeights[\"small\"],\n default: obj.lineHeights[\"default\"],\n medium: obj.lineHeights[\"medium\"],\n large: obj.lineHeights[\"large\"],\n extraLarge: obj.lineHeights[\"extraLarge\"]\n };\n }\n ;\n this.imageSizes = {\n small: obj.imageSizes && obj.imageSizes[\"small\"] || this.imageSizes.small,\n medium: obj.imageSizes && obj.imageSizes[\"medium\"] || this.imageSizes.medium,\n large: obj.imageSizes && obj.imageSizes[\"large\"] || this.imageSizes.large,\n };\n this.containerStyles = new ContainerStyleSet(obj[\"containerStyles\"]);\n this.spacing = {\n small: obj.spacing && obj.spacing[\"small\"] || this.spacing.small,\n default: obj.spacing && obj.spacing[\"default\"] || this.spacing.default,\n medium: obj.spacing && obj.spacing[\"medium\"] || this.spacing.medium,\n large: obj.spacing && obj.spacing[\"large\"] || this.spacing.large,\n extraLarge: obj.spacing && obj.spacing[\"extraLarge\"] || this.spacing.extraLarge,\n padding: obj.spacing && obj.spacing[\"padding\"] || this.spacing.padding\n };\n this.separator = {\n lineThickness: obj.separator && obj.separator[\"lineThickness\"] || this.separator.lineThickness,\n lineColor: obj.separator && obj.separator[\"lineColor\"] || this.separator.lineColor\n };\n this.inputs = new InputConfig(obj.inputs || this.inputs);\n this.actions = new ActionsConfig(obj.actions || this.actions);\n this.adaptiveCard = new AdaptiveCardConfig(obj.adaptiveCard || this.adaptiveCard);\n this.imageSet = new ImageSetConfig(obj[\"imageSet\"]);\n this.factSet = new FactSetConfig(obj[\"factSet\"]);\n this.textStyles = new TextStyleSet(obj[\"textStyles\"]);\n this.textBlock = new TextBlockConfig(obj[\"textBlock\"]);\n }\n }\n HostConfig.prototype.getFontTypeDefinition = function (style) {\n if (this.fontTypes) {\n return this.fontTypes.getStyleDefinition(style);\n }\n else {\n return style == Enums.FontType.Monospace ? FontTypeDefinition.monospace : this._legacyFontType;\n }\n };\n HostConfig.prototype.getEffectiveSpacing = function (spacing) {\n switch (spacing) {\n case Enums.Spacing.Small:\n return this.spacing.small;\n case Enums.Spacing.Default:\n return this.spacing.default;\n case Enums.Spacing.Medium:\n return this.spacing.medium;\n case Enums.Spacing.Large:\n return this.spacing.large;\n case Enums.Spacing.ExtraLarge:\n return this.spacing.extraLarge;\n case Enums.Spacing.Padding:\n return this.spacing.padding;\n default:\n return 0;\n }\n };\n HostConfig.prototype.paddingDefinitionToSpacingDefinition = function (paddingDefinition) {\n return new Shared.SpacingDefinition(this.getEffectiveSpacing(paddingDefinition.top), this.getEffectiveSpacing(paddingDefinition.right), this.getEffectiveSpacing(paddingDefinition.bottom), this.getEffectiveSpacing(paddingDefinition.left));\n };\n HostConfig.prototype.makeCssClassNames = function () {\n var classNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classNames[_i] = arguments[_i];\n }\n var result = [];\n for (var _a = 0, classNames_1 = classNames; _a < classNames_1.length; _a++) {\n var className = classNames_1[_a];\n result.push((this.cssClassNamePrefix ? this.cssClassNamePrefix + \"-\" : \"\") + className);\n }\n return result;\n };\n HostConfig.prototype.makeCssClassName = function () {\n var classNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classNames[_i] = arguments[_i];\n }\n var result = this.makeCssClassNames.apply(this, classNames).join(\" \");\n return result ? result : \"\";\n };\n Object.defineProperty(HostConfig.prototype, \"fontFamily\", {\n get: function () {\n return this._legacyFontType.fontFamily;\n },\n set: function (value) {\n this._legacyFontType.fontFamily = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HostConfig.prototype, \"fontSizes\", {\n get: function () {\n return this._legacyFontType.fontSizes;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HostConfig.prototype, \"fontWeights\", {\n get: function () {\n return this._legacyFontType.fontWeights;\n },\n enumerable: false,\n configurable: true\n });\n return HostConfig;\n}());\nexports.HostConfig = HostConfig;\nexports.defaultHostConfig = new HostConfig({\n supportsInteractivity: true,\n spacing: {\n small: 10,\n default: 20,\n medium: 30,\n large: 40,\n extraLarge: 50,\n padding: 20\n },\n separator: {\n lineThickness: 1,\n lineColor: \"#EEEEEE\"\n },\n fontTypes: {\n default: {\n fontFamily: \"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif\",\n fontSizes: {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n },\n fontWeights: {\n lighter: 200,\n default: 400,\n bolder: 600\n }\n },\n monospace: {\n fontFamily: \"'Courier New', Courier, monospace\",\n fontSizes: {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n },\n fontWeights: {\n lighter: 200,\n default: 400,\n bolder: 600\n }\n }\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160\n },\n containerStyles: {\n default: {\n backgroundColor: \"#FFFFFF\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n emphasis: {\n backgroundColor: \"#08000000\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n accent: {\n backgroundColor: \"#C7DEF9\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n good: {\n backgroundColor: \"#CCFFCC\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n attention: {\n backgroundColor: \"#FFC5B2\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n warning: {\n backgroundColor: \"#FFE2B2\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n }\n },\n inputs: {\n label: {\n requiredInputs: {\n color: Enums.TextColor.Accent,\n size: Enums.TextSize.ExtraLarge,\n weight: Enums.TextWeight.Bolder,\n isSubtle: true,\n suffix: \" (required)\",\n suffixColor: Enums.TextColor.Good\n },\n optionalInputs: {\n color: Enums.TextColor.Warning,\n size: Enums.TextSize.Medium,\n weight: Enums.TextWeight.Lighter,\n isSubtle: false\n }\n },\n errorMessage: {\n color: Enums.TextColor.Accent,\n size: Enums.TextSize.Small,\n weight: Enums.TextWeight.Bolder\n }\n },\n actions: {\n maxActions: 5,\n spacing: Enums.Spacing.Default,\n buttonSpacing: 10,\n showCard: {\n actionMode: Enums.ShowCardActionMode.Inline,\n inlineTopMargin: 16\n },\n actionsOrientation: Enums.Orientation.Horizontal,\n actionAlignment: Enums.ActionAlignment.Left\n },\n adaptiveCard: {\n allowCustomStyle: false\n },\n imageSet: {\n imageSize: Enums.Size.Medium,\n maxImageHeight: 100\n },\n factSet: {\n title: {\n color: Enums.TextColor.Default,\n size: Enums.TextSize.Default,\n isSubtle: false,\n weight: Enums.TextWeight.Bolder,\n wrap: true,\n maxWidth: 150,\n },\n value: {\n color: Enums.TextColor.Default,\n size: Enums.TextSize.Default,\n isSubtle: false,\n weight: Enums.TextWeight.Default,\n wrap: true,\n },\n spacing: 10\n }\n});\n//# sourceMappingURL=host-config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GlobalRegistry = exports.CardObjectRegistry = void 0;\nvar serialization_1 = require(\"./serialization\");\nvar CardObjectRegistry = /** @class */ (function () {\n function CardObjectRegistry() {\n this._items = {};\n }\n CardObjectRegistry.prototype.findByName = function (typeName) {\n return this._items.hasOwnProperty(typeName) ? this._items[typeName] : undefined;\n };\n CardObjectRegistry.prototype.clear = function () {\n this._items = {};\n };\n CardObjectRegistry.prototype.copyTo = function (target) {\n var keys = Object.keys(this._items);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n var typeRegistration = this._items[key];\n target.register(typeRegistration.typeName, typeRegistration.objectType, typeRegistration.schemaVersion);\n }\n };\n CardObjectRegistry.prototype.register = function (typeName, objectType, schemaVersion) {\n if (schemaVersion === void 0) { schemaVersion = serialization_1.Versions.v1_0; }\n var registrationInfo = this.findByName(typeName);\n if (registrationInfo !== undefined) {\n registrationInfo.objectType = objectType;\n }\n else {\n registrationInfo = {\n typeName: typeName,\n objectType: objectType,\n schemaVersion: schemaVersion\n };\n }\n this._items[typeName] = registrationInfo;\n };\n CardObjectRegistry.prototype.unregister = function (typeName) {\n delete this._items[typeName];\n };\n CardObjectRegistry.prototype.createInstance = function (typeName, targetVersion) {\n var registrationInfo = this.findByName(typeName);\n return (registrationInfo && registrationInfo.schemaVersion.compareTo(targetVersion) <= 0) ? new registrationInfo.objectType() : undefined;\n };\n CardObjectRegistry.prototype.getItemCount = function () {\n return Object.keys(this._items).length;\n };\n CardObjectRegistry.prototype.getItemAt = function (index) {\n var _this = this;\n return Object.keys(this._items).map(function (e) { return _this._items[e]; })[index];\n };\n return CardObjectRegistry;\n}());\nexports.CardObjectRegistry = CardObjectRegistry;\nvar GlobalRegistry = /** @class */ (function () {\n function GlobalRegistry() {\n }\n GlobalRegistry.populateWithDefaultElements = function (registry) {\n registry.clear();\n GlobalRegistry.defaultElements.copyTo(registry);\n };\n GlobalRegistry.populateWithDefaultActions = function (registry) {\n registry.clear();\n GlobalRegistry.defaultActions.copyTo(registry);\n };\n Object.defineProperty(GlobalRegistry, \"elements\", {\n get: function () {\n if (!GlobalRegistry._elements) {\n GlobalRegistry._elements = new CardObjectRegistry();\n GlobalRegistry.populateWithDefaultElements(GlobalRegistry._elements);\n }\n return GlobalRegistry._elements;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlobalRegistry, \"actions\", {\n get: function () {\n if (!GlobalRegistry._actions) {\n GlobalRegistry._actions = new CardObjectRegistry();\n GlobalRegistry.populateWithDefaultActions(GlobalRegistry._actions);\n }\n return GlobalRegistry._actions;\n },\n enumerable: false,\n configurable: true\n });\n GlobalRegistry.reset = function () {\n GlobalRegistry._elements = undefined;\n GlobalRegistry._actions = undefined;\n };\n GlobalRegistry.defaultElements = new CardObjectRegistry();\n GlobalRegistry.defaultActions = new CardObjectRegistry();\n return GlobalRegistry;\n}());\nexports.GlobalRegistry = GlobalRegistry;\n//# sourceMappingURL=registry.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SerializableObject = exports.property = exports.SerializableObjectSchema = exports.CustomProperty = exports.SerializableObjectCollectionProperty = exports.SerializableObjectProperty = exports.EnumProperty = exports.ValueSetProperty = exports.StringArrayProperty = exports.PixelSizeProperty = exports.NumProperty = exports.BoolProperty = exports.StringProperty = exports.PropertyDefinition = exports.BaseSerializationContext = exports.isVersionLessOrEqual = exports.Versions = exports.Version = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar shared_1 = require(\"./shared\");\nvar Utils = require(\"./utils\");\nvar Enums = require(\"./enums\");\nvar strings_1 = require(\"./strings\");\nvar Version = /** @class */ (function () {\n function Version(major, minor, label) {\n if (major === void 0) { major = 1; }\n if (minor === void 0) { minor = 1; }\n this._isValid = true;\n this._major = major;\n this._minor = minor;\n this._label = label;\n }\n Version.parse = function (versionString, context) {\n if (!versionString) {\n return undefined;\n }\n var result = new Version();\n result._versionString = versionString;\n var regEx = /(\\d+).(\\d+)/gi;\n var matches = regEx.exec(versionString);\n if (matches != null && matches.length == 3) {\n result._major = parseInt(matches[1]);\n result._minor = parseInt(matches[2]);\n }\n else {\n result._isValid = false;\n }\n if (!result._isValid) {\n context.logParseEvent(undefined, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidVersionString(result._versionString));\n }\n return result;\n };\n Version.prototype.toString = function () {\n return !this._isValid ? this._versionString : this._major + \".\" + this._minor;\n };\n Version.prototype.toJSON = function () {\n return this.toString();\n };\n Version.prototype.compareTo = function (otherVersion) {\n if (!this.isValid || !otherVersion.isValid) {\n throw new Error(\"Cannot compare invalid version.\");\n }\n if (this.major > otherVersion.major) {\n return 1;\n }\n else if (this.major < otherVersion.major) {\n return -1;\n }\n else if (this.minor > otherVersion.minor) {\n return 1;\n }\n else if (this.minor < otherVersion.minor) {\n return -1;\n }\n return 0;\n };\n Object.defineProperty(Version.prototype, \"label\", {\n get: function () {\n return this._label ? this._label : this.toString();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"major\", {\n get: function () {\n return this._major;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"minor\", {\n get: function () {\n return this._minor;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"isValid\", {\n get: function () {\n return this._isValid;\n },\n enumerable: false,\n configurable: true\n });\n return Version;\n}());\nexports.Version = Version;\nvar Versions = /** @class */ (function () {\n function Versions() {\n }\n Versions.v1_0 = new Version(1, 0);\n Versions.v1_1 = new Version(1, 1);\n Versions.v1_2 = new Version(1, 2);\n Versions.v1_3 = new Version(1, 3);\n Versions.v1_4 = new Version(1, 4);\n Versions.v1_5 = new Version(1, 5);\n Versions.latest = Versions.v1_5;\n return Versions;\n}());\nexports.Versions = Versions;\nfunction isVersionLessOrEqual(version, targetVersion) {\n if (version instanceof Version) {\n if (targetVersion instanceof Version) {\n return targetVersion.compareTo(version) >= 0;\n }\n else {\n // Target version is *\n return true;\n }\n }\n else {\n // Version is *\n return true;\n }\n}\nexports.isVersionLessOrEqual = isVersionLessOrEqual;\nvar BaseSerializationContext = /** @class */ (function () {\n function BaseSerializationContext(targetVersion) {\n if (targetVersion === void 0) { targetVersion = Versions.latest; }\n this.targetVersion = targetVersion;\n this._validationEvents = [];\n }\n BaseSerializationContext.prototype.serializeValue = function (target, propertyName, propertyValue, defaultValue, forceDeleteIfNullOrDefault) {\n if (defaultValue === void 0) { defaultValue = undefined; }\n if (forceDeleteIfNullOrDefault === void 0) { forceDeleteIfNullOrDefault = false; }\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n if (!shared_1.GlobalSettings.enableFullJsonRoundTrip || forceDeleteIfNullOrDefault) {\n delete target[propertyName];\n }\n }\n else if (propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeString = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeBool = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeNumber = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue || isNaN(propertyValue)) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeEnum = function (enumType, target, propertyName, propertyValue, defaultValue) {\n if (defaultValue === void 0) { defaultValue = undefined; }\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = enumType[propertyValue];\n }\n };\n BaseSerializationContext.prototype.serializeArray = function (target, propertyName, propertyValue) {\n var items = [];\n if (propertyValue) {\n for (var _i = 0, propertyValue_1 = propertyValue; _i < propertyValue_1.length; _i++) {\n var item = propertyValue_1[_i];\n var serializedItem = undefined;\n if (item instanceof SerializableObject) {\n serializedItem = item.toJSON(this);\n }\n else if (item.toJSON) {\n serializedItem = item.toJSON();\n }\n else {\n serializedItem = item;\n }\n if (serializedItem !== undefined) {\n items.push(serializedItem);\n }\n }\n }\n if (items.length == 0) {\n if (target.hasOwnProperty(propertyName) && Array.isArray(target[propertyName])) {\n delete target[propertyName];\n }\n }\n else {\n this.serializeValue(target, propertyName, items);\n }\n };\n BaseSerializationContext.prototype.clearEvents = function () {\n this._validationEvents = [];\n };\n BaseSerializationContext.prototype.logEvent = function (source, phase, event, message) {\n this._validationEvents.push({\n source: source,\n phase: phase,\n event: event,\n message: message\n });\n };\n BaseSerializationContext.prototype.logParseEvent = function (source, event, message) {\n this.logEvent(source, Enums.ValidationPhase.Parse, event, message);\n };\n BaseSerializationContext.prototype.getEventAt = function (index) {\n return this._validationEvents[index];\n };\n Object.defineProperty(BaseSerializationContext.prototype, \"eventCount\", {\n get: function () {\n return this._validationEvents.length;\n },\n enumerable: false,\n configurable: true\n });\n return BaseSerializationContext;\n}());\nexports.BaseSerializationContext = BaseSerializationContext;\nvar SimpleSerializationContext = /** @class */ (function (_super) {\n __extends(SimpleSerializationContext, _super);\n function SimpleSerializationContext() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return SimpleSerializationContext;\n}(BaseSerializationContext));\nvar PropertyDefinition = /** @class */ (function () {\n function PropertyDefinition(targetVersion, name, defaultValue, onGetInitialValue) {\n this.targetVersion = targetVersion;\n this.name = name;\n this.defaultValue = defaultValue;\n this.onGetInitialValue = onGetInitialValue;\n this.isSerializationEnabled = true;\n this.sequentialNumber = PropertyDefinition._sequentialNumber;\n PropertyDefinition._sequentialNumber++;\n }\n PropertyDefinition.prototype.getInternalName = function () {\n return this.name;\n };\n PropertyDefinition.prototype.parse = function (sender, source, context) {\n return source[this.name];\n };\n PropertyDefinition.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value, this.defaultValue);\n };\n PropertyDefinition._sequentialNumber = 0;\n return PropertyDefinition;\n}());\nexports.PropertyDefinition = PropertyDefinition;\nvar StringProperty = /** @class */ (function (_super) {\n __extends(StringProperty, _super);\n function StringProperty(targetVersion, name, treatEmptyAsUndefined, regEx, defaultValue, onGetInitialValue) {\n if (treatEmptyAsUndefined === void 0) { treatEmptyAsUndefined = true; }\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.treatEmptyAsUndefined = treatEmptyAsUndefined;\n _this.regEx = regEx;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n StringProperty.prototype.parse = function (sender, source, context) {\n var parsedValue = Utils.parseString(source[this.name], this.defaultValue);\n var isUndefined = parsedValue === undefined || (parsedValue === \"\" && this.treatEmptyAsUndefined);\n if (!isUndefined && this.regEx !== undefined) {\n var matches = this.regEx.exec(parsedValue);\n if (!matches) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(parsedValue, this.name));\n return undefined;\n }\n }\n return parsedValue;\n };\n StringProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeString(target, this.name, value === \"\" && this.treatEmptyAsUndefined ? undefined : value, this.defaultValue);\n };\n return StringProperty;\n}(PropertyDefinition));\nexports.StringProperty = StringProperty;\nvar BoolProperty = /** @class */ (function (_super) {\n __extends(BoolProperty, _super);\n function BoolProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n BoolProperty.prototype.parse = function (sender, source, context) {\n return Utils.parseBool(source[this.name], this.defaultValue);\n };\n BoolProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeBool(target, this.name, value, this.defaultValue);\n };\n return BoolProperty;\n}(PropertyDefinition));\nexports.BoolProperty = BoolProperty;\nvar NumProperty = /** @class */ (function (_super) {\n __extends(NumProperty, _super);\n function NumProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n NumProperty.prototype.parse = function (sender, source, context) {\n return Utils.parseNumber(source[this.name], this.defaultValue);\n };\n NumProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeNumber(target, this.name, value, this.defaultValue);\n };\n return NumProperty;\n}(PropertyDefinition));\nexports.NumProperty = NumProperty;\nvar PixelSizeProperty = /** @class */ (function (_super) {\n __extends(PixelSizeProperty, _super);\n function PixelSizeProperty() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PixelSizeProperty.prototype.parse = function (sender, source, context) {\n var result = undefined;\n var value = source[this.name];\n if (typeof value === \"string\") {\n var isValid = false;\n try {\n var size = shared_1.SizeAndUnit.parse(value, true);\n if (size.unit == Enums.SizeUnit.Pixel) {\n result = size.physicalSize;\n isValid = true;\n }\n }\n catch (_a) {\n // Do nothing. A parse error is emitted below\n }\n if (!isValid) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(source[this.name], \"minHeight\"));\n }\n }\n return result;\n };\n PixelSizeProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, typeof value === \"number\" && !isNaN(value) ? value + \"px\" : undefined);\n };\n return PixelSizeProperty;\n}(PropertyDefinition));\nexports.PixelSizeProperty = PixelSizeProperty;\nvar StringArrayProperty = /** @class */ (function (_super) {\n __extends(StringArrayProperty, _super);\n function StringArrayProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n StringArrayProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined || !Array.isArray(sourceValue)) {\n return this.defaultValue;\n }\n var result = [];\n for (var _i = 0, sourceValue_1 = sourceValue; _i < sourceValue_1.length; _i++) {\n var value = sourceValue_1[_i];\n if (typeof value === \"string\") {\n result.push(value);\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, \"Invalid array value \\\"\" + value + \"\\\" of type \\\"\" + typeof value + \"\\\" ignored for \\\"\" + this.name + \"\\\".\");\n }\n }\n return result;\n };\n StringArrayProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeArray(target, this.name, value);\n };\n return StringArrayProperty;\n}(PropertyDefinition));\nexports.StringArrayProperty = StringArrayProperty;\nvar ValueSetProperty = /** @class */ (function (_super) {\n __extends(ValueSetProperty, _super);\n function ValueSetProperty(targetVersion, name, values, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.values = values;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n ValueSetProperty.prototype.isValidValue = function (value, context) {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (value.toLowerCase() === versionedValue.value.toLowerCase()) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n return targetVersion.compareTo(context.targetVersion) <= 0;\n }\n }\n return false;\n };\n ValueSetProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.defaultValue;\n }\n if (typeof sourceValue === \"string\") {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (sourceValue.toLowerCase() === versionedValue.value.toLowerCase()) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n return versionedValue.value;\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(sourceValue, this.name, targetVersion.toString(), context.targetVersion.toString()));\n return this.defaultValue;\n }\n }\n }\n }\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n return this.defaultValue;\n };\n ValueSetProperty.prototype.toJSON = function (sender, target, value, context) {\n var invalidValue = false;\n if (value !== undefined) {\n invalidValue = true;\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === value) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n invalidValue = false;\n break;\n }\n else {\n context.logEvent(sender, Enums.ValidationPhase.ToJSON, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(value, this.name, targetVersion.toString(), context.targetVersion.toString()));\n }\n }\n }\n }\n if (!invalidValue) {\n context.serializeValue(target, this.name, value, this.defaultValue, true);\n }\n };\n return ValueSetProperty;\n}(PropertyDefinition));\nexports.ValueSetProperty = ValueSetProperty;\nvar EnumProperty = /** @class */ (function (_super) {\n __extends(EnumProperty, _super);\n function EnumProperty(targetVersion, name, enumType, defaultValue, values, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.enumType = enumType;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n _this._values = [];\n if (!values) {\n for (var key in enumType) {\n var keyAsNumber = parseInt(key, 10);\n if (keyAsNumber >= 0) {\n _this._values.push({ value: keyAsNumber });\n }\n }\n }\n else {\n _this._values = values;\n }\n return _this;\n }\n EnumProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (typeof sourceValue !== \"string\") {\n return this.defaultValue;\n }\n var enumValue = Utils.getEnumValueByName(this.enumType, sourceValue);\n if (enumValue !== undefined) {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === enumValue) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n return enumValue;\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(sourceValue, this.name, targetVersion.toString(), context.targetVersion.toString()));\n return this.defaultValue;\n }\n }\n }\n }\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n return this.defaultValue;\n };\n EnumProperty.prototype.toJSON = function (sender, target, value, context) {\n var invalidValue = false;\n if (value !== undefined) {\n invalidValue = true;\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === value) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n invalidValue = false;\n break;\n }\n else {\n context.logEvent(sender, Enums.ValidationPhase.ToJSON, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(value, this.name));\n }\n }\n }\n }\n if (!invalidValue) {\n context.serializeEnum(this.enumType, target, this.name, value, this.defaultValue);\n }\n };\n Object.defineProperty(EnumProperty.prototype, \"values\", {\n get: function () {\n return this._values;\n },\n enumerable: false,\n configurable: true\n });\n return EnumProperty;\n}(PropertyDefinition));\nexports.EnumProperty = EnumProperty;\nvar SerializableObjectProperty = /** @class */ (function (_super) {\n __extends(SerializableObjectProperty, _super);\n function SerializableObjectProperty(targetVersion, name, objectType, nullable, defaultValue) {\n if (nullable === void 0) { nullable = false; }\n var _this = _super.call(this, targetVersion, name, defaultValue, function (sender) { return _this.nullable ? undefined : new _this.objectType(); }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.objectType = objectType;\n _this.nullable = nullable;\n return _this;\n }\n SerializableObjectProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.onGetInitialValue ? this.onGetInitialValue(sender) : this.defaultValue;\n }\n var result = new this.objectType();\n result.parse(sourceValue, context);\n return result;\n };\n SerializableObjectProperty.prototype.toJSON = function (sender, target, value, context) {\n var serializedValue = undefined;\n if (value !== undefined && !value.hasAllDefaultValues()) {\n serializedValue = value.toJSON(context);\n }\n if (typeof serializedValue === \"object\" && Object.keys(serializedValue).length === 0) {\n serializedValue = undefined;\n }\n context.serializeValue(target, this.name, serializedValue, this.defaultValue, true);\n };\n return SerializableObjectProperty;\n}(PropertyDefinition));\nexports.SerializableObjectProperty = SerializableObjectProperty;\nvar SerializableObjectCollectionProperty = /** @class */ (function (_super) {\n __extends(SerializableObjectCollectionProperty, _super);\n function SerializableObjectCollectionProperty(targetVersion, name, objectType, onItemAdded) {\n var _this = _super.call(this, targetVersion, name, undefined, function (sender) { return []; }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.objectType = objectType;\n _this.onItemAdded = onItemAdded;\n return _this;\n }\n SerializableObjectCollectionProperty.prototype.parse = function (sender, source, context) {\n var result = [];\n var sourceCollection = source[this.name];\n if (Array.isArray(sourceCollection)) {\n for (var _i = 0, sourceCollection_1 = sourceCollection; _i < sourceCollection_1.length; _i++) {\n var sourceItem = sourceCollection_1[_i];\n var item = new this.objectType();\n item.parse(sourceItem, context);\n result.push(item);\n if (this.onItemAdded) {\n this.onItemAdded(sender, item);\n }\n }\n }\n return result.length > 0 ? result : (this.onGetInitialValue ? this.onGetInitialValue(sender) : undefined);\n };\n SerializableObjectCollectionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeArray(target, this.name, value);\n };\n return SerializableObjectCollectionProperty;\n}(PropertyDefinition));\nexports.SerializableObjectCollectionProperty = SerializableObjectCollectionProperty;\nvar CustomProperty = /** @class */ (function (_super) {\n __extends(CustomProperty, _super);\n function CustomProperty(targetVersion, name, onParse, onToJSON, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.onParse = onParse;\n _this.onToJSON = onToJSON;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n if (!_this.onParse) {\n throw new Error(\"CustomPropertyDefinition instances must have an onParse handler.\");\n }\n if (!_this.onToJSON) {\n throw new Error(\"CustomPropertyDefinition instances must have an onToJSON handler.\");\n }\n return _this;\n }\n CustomProperty.prototype.parse = function (sender, source, context) {\n return this.onParse(sender, this, source, context);\n };\n CustomProperty.prototype.toJSON = function (sender, target, value, context) {\n this.onToJSON(sender, this, target, value, context);\n };\n return CustomProperty;\n}(PropertyDefinition));\nexports.CustomProperty = CustomProperty;\nvar SerializableObjectSchema = /** @class */ (function () {\n function SerializableObjectSchema() {\n this._properties = [];\n }\n SerializableObjectSchema.prototype.indexOf = function (property) {\n for (var i = 0; i < this._properties.length; i++) {\n if (this._properties[i] === property) {\n return i;\n }\n }\n return -1;\n };\n SerializableObjectSchema.prototype.add = function () {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n for (var i = 0; i < properties.length; i++) {\n if (this.indexOf(properties[i]) === -1) {\n this._properties.push(properties[i]);\n }\n }\n };\n SerializableObjectSchema.prototype.remove = function () {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n for (var _a = 0, properties_1 = properties; _a < properties_1.length; _a++) {\n var property_1 = properties_1[_a];\n while (true) {\n var index = this.indexOf(property_1);\n if (index >= 0) {\n this._properties.splice(index, 1);\n }\n else {\n break;\n }\n }\n }\n };\n SerializableObjectSchema.prototype.getItemAt = function (index) {\n return this._properties[index];\n };\n SerializableObjectSchema.prototype.getCount = function () {\n return this._properties.length;\n };\n return SerializableObjectSchema;\n}());\nexports.SerializableObjectSchema = SerializableObjectSchema;\n// This is a decorator function, used to map SerializableObject descendant class members to\n// schema properties\nfunction property(property) {\n return function (target, propertyKey) {\n var descriptor = Object.getOwnPropertyDescriptor(target, propertyKey) || {};\n if (!descriptor.get && !descriptor.set) {\n descriptor.get = function () { return this.getValue(property); };\n descriptor.set = function (value) { this.setValue(property, value); };\n Object.defineProperty(target, propertyKey, descriptor);\n }\n };\n}\nexports.property = property;\nvar SerializableObject = /** @class */ (function () {\n function SerializableObject() {\n this._propertyBag = {};\n this._rawProperties = {};\n this.maxVersion = SerializableObject.defaultMaxVersion;\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_2 = s.getItemAt(i);\n if (property_2.onGetInitialValue) {\n this.setValue(property_2, property_2.onGetInitialValue(this));\n }\n }\n }\n SerializableObject.prototype.getDefaultSerializationContext = function () {\n return new SimpleSerializationContext();\n };\n SerializableObject.prototype.populateSchema = function (schema) {\n var ctor = this.constructor;\n var properties = [];\n for (var propertyName in ctor) {\n try {\n var propertyValue = ctor[propertyName];\n if (propertyValue instanceof PropertyDefinition) {\n properties.push(propertyValue);\n }\n }\n catch (_a) {\n // If a property happens to have a getter function and\n // it throws an exception, we need to catch it here\n }\n }\n if (properties.length > 0) {\n var sortedProperties = properties.sort(function (p1, p2) {\n if (p1.sequentialNumber > p2.sequentialNumber) {\n return 1;\n }\n else if (p1.sequentialNumber < p2.sequentialNumber) {\n return -1;\n }\n return 0;\n });\n schema.add.apply(schema, sortedProperties);\n }\n if (SerializableObject.onRegisterCustomProperties) {\n SerializableObject.onRegisterCustomProperties(this, schema);\n }\n };\n SerializableObject.prototype.getValue = function (property) {\n return this._propertyBag.hasOwnProperty(property.getInternalName()) ? this._propertyBag[property.getInternalName()] : property.defaultValue;\n };\n SerializableObject.prototype.setValue = function (property, value) {\n if (value === undefined || value === null) {\n delete this._propertyBag[property.getInternalName()];\n }\n else {\n this._propertyBag[property.getInternalName()] = value;\n }\n };\n SerializableObject.prototype.internalParse = function (source, context) {\n this._propertyBag = {};\n this._rawProperties = shared_1.GlobalSettings.enableFullJsonRoundTrip ? (source ? source : {}) : {};\n if (source) {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_3 = s.getItemAt(i);\n if (property_3.isSerializationEnabled) {\n var propertyValue = property_3.onGetInitialValue ? property_3.onGetInitialValue(this) : undefined;\n if (source.hasOwnProperty(property_3.name)) {\n if (property_3.targetVersion.compareTo(context.targetVersion) <= 0) {\n propertyValue = property_3.parse(this, source, context);\n }\n else {\n context.logParseEvent(this, Enums.ValidationEvent.UnsupportedProperty, strings_1.Strings.errors.propertyNotSupported(property_3.name, property_3.targetVersion.toString(), context.targetVersion.toString()));\n }\n }\n this.setValue(property_3, propertyValue);\n }\n }\n }\n else {\n this.resetDefaultValues();\n }\n };\n SerializableObject.prototype.internalToJSON = function (target, context) {\n var s = this.getSchema();\n var serializedProperties = [];\n for (var i = 0; i < s.getCount(); i++) {\n var property_4 = s.getItemAt(i);\n // Avoid serializing the same property multiple times. This is necessary\n // because some property definitions map to the same underlying schema\n // property\n if (property_4.isSerializationEnabled && property_4.targetVersion.compareTo(context.targetVersion) <= 0 && serializedProperties.indexOf(property_4.name) === -1) {\n property_4.toJSON(this, target, this.getValue(property_4), context);\n serializedProperties.push(property_4.name);\n }\n }\n };\n SerializableObject.prototype.shouldSerialize = function (context) {\n return true;\n };\n SerializableObject.prototype.parse = function (source, context) {\n this.internalParse(source, context ? context : new SimpleSerializationContext());\n };\n SerializableObject.prototype.toJSON = function (context) {\n var effectiveContext;\n if (context && context instanceof BaseSerializationContext) {\n effectiveContext = context;\n }\n else {\n effectiveContext = this.getDefaultSerializationContext();\n effectiveContext.toJSONOriginalParam = context;\n }\n if (this.shouldSerialize(effectiveContext)) {\n var result = void 0;\n if (shared_1.GlobalSettings.enableFullJsonRoundTrip && this._rawProperties && typeof this._rawProperties === \"object\") {\n result = this._rawProperties;\n }\n else {\n result = {};\n }\n this.internalToJSON(result, effectiveContext);\n return result;\n }\n else {\n return undefined;\n }\n };\n SerializableObject.prototype.hasDefaultValue = function (property) {\n return this.getValue(property) === property.defaultValue;\n };\n SerializableObject.prototype.hasAllDefaultValues = function () {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_5 = s.getItemAt(i);\n if (!this.hasDefaultValue(property_5)) {\n return false;\n }\n }\n return true;\n };\n SerializableObject.prototype.resetDefaultValues = function () {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_6 = s.getItemAt(i);\n this.setValue(property_6, property_6.defaultValue);\n }\n };\n SerializableObject.prototype.setCustomProperty = function (name, value) {\n var shouldDeleteProperty = (typeof value === \"string\" && !value) || value === undefined || value === null;\n if (shouldDeleteProperty) {\n delete this._rawProperties[name];\n }\n else {\n this._rawProperties[name] = value;\n }\n };\n SerializableObject.prototype.getCustomProperty = function (name) {\n return this._rawProperties[name];\n };\n SerializableObject.prototype.getSchema = function () {\n var schema = SerializableObject._schemaCache[this.getSchemaKey()];\n if (!schema) {\n schema = new SerializableObjectSchema();\n this.populateSchema(schema);\n SerializableObject._schemaCache[this.getSchemaKey()] = schema;\n }\n return schema;\n };\n SerializableObject.defaultMaxVersion = Versions.latest;\n SerializableObject._schemaCache = {};\n return SerializableObject;\n}());\nexports.SerializableObject = SerializableObject;\n//# sourceMappingURL=serialization.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UUID = exports.SizeAndUnit = exports.PaddingDefinition = exports.SpacingDefinition = exports.StringWithSubstitutions = exports.ContentTypes = exports.GlobalSettings = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar GlobalSettings = /** @class */ (function () {\n function GlobalSettings() {\n }\n GlobalSettings.useAdvancedTextBlockTruncation = true;\n GlobalSettings.useAdvancedCardBottomTruncation = false;\n GlobalSettings.useMarkdownInRadioButtonAndCheckbox = true;\n GlobalSettings.allowMarkForTextHighlighting = false;\n GlobalSettings.alwaysBleedSeparators = false;\n GlobalSettings.enableFullJsonRoundTrip = false;\n GlobalSettings.displayInputValidationErrors = true;\n GlobalSettings.allowPreProcessingPropertyValues = false;\n GlobalSettings.setTabIndexAtCardRoot = true;\n GlobalSettings.enableFallback = true;\n GlobalSettings.useWebkitLineClamp = true;\n GlobalSettings.allowMoreThanMaxActionsInOverflowMenu = false;\n GlobalSettings.applets = {\n logEnabled: true,\n logLevel: Enums.LogLevel.Error,\n maximumRetryAttempts: 3,\n defaultTimeBetweenRetryAttempts: 3000,\n authPromptWidth: 400,\n authPromptHeight: 600,\n refresh: {\n mode: Enums.RefreshMode.Manual,\n timeBetweenAutomaticRefreshes: 3000,\n maximumConsecutiveAutomaticRefreshes: 3,\n allowManualRefreshesAfterAutomaticRefreshes: true\n }\n };\n return GlobalSettings;\n}());\nexports.GlobalSettings = GlobalSettings;\nexports.ContentTypes = {\n applicationJson: \"application/json\",\n applicationXWwwFormUrlencoded: \"application/x-www-form-urlencoded\"\n};\nvar StringWithSubstitutions = /** @class */ (function () {\n function StringWithSubstitutions() {\n this._isProcessed = false;\n }\n StringWithSubstitutions.prototype.getReferencedInputs = function (inputs, referencedInputs) {\n if (!referencedInputs) {\n throw new Error(\"The referencedInputs parameter cannot be null.\");\n }\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n var matches = new RegExp(\"\\\\{{2}(\" + input.id + \").value\\\\}{2}\", \"gi\").exec(this._original);\n if (matches != null && input.id) {\n referencedInputs[input.id] = input;\n }\n }\n };\n StringWithSubstitutions.prototype.substituteInputValues = function (inputs, contentType) {\n this._processed = this._original;\n if (this._original) {\n var regEx = /\\{{2}([a-z0-9_$@]+).value\\}{2}/gi;\n var matches = void 0;\n while ((matches = regEx.exec(this._original)) !== null) {\n for (var _i = 0, _a = Object.keys(inputs); _i < _a.length; _i++) {\n var key = _a[_i];\n if (key.toLowerCase() == matches[1].toLowerCase()) {\n var matchedInput = inputs[key];\n var valueForReplace = \"\";\n if (matchedInput.value) {\n valueForReplace = matchedInput.value;\n }\n if (contentType === exports.ContentTypes.applicationJson) {\n valueForReplace = JSON.stringify(valueForReplace);\n valueForReplace = valueForReplace.slice(1, -1);\n }\n else if (contentType === exports.ContentTypes.applicationXWwwFormUrlencoded) {\n valueForReplace = encodeURIComponent(valueForReplace);\n }\n this._processed = this._processed.replace(matches[0], valueForReplace);\n break;\n }\n }\n }\n }\n this._isProcessed = true;\n };\n StringWithSubstitutions.prototype.getOriginal = function () {\n return this._original;\n };\n StringWithSubstitutions.prototype.get = function () {\n if (!this._isProcessed) {\n return this._original;\n }\n else {\n return this._processed;\n }\n };\n StringWithSubstitutions.prototype.set = function (value) {\n this._original = value;\n this._isProcessed = false;\n };\n return StringWithSubstitutions;\n}());\nexports.StringWithSubstitutions = StringWithSubstitutions;\nvar SpacingDefinition = /** @class */ (function () {\n function SpacingDefinition(top, right, bottom, left) {\n if (top === void 0) { top = 0; }\n if (right === void 0) { right = 0; }\n if (bottom === void 0) { bottom = 0; }\n if (left === void 0) { left = 0; }\n this.left = 0;\n this.top = 0;\n this.right = 0;\n this.bottom = 0;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n return SpacingDefinition;\n}());\nexports.SpacingDefinition = SpacingDefinition;\nvar PaddingDefinition = /** @class */ (function () {\n function PaddingDefinition(top, right, bottom, left) {\n if (top === void 0) { top = Enums.Spacing.None; }\n if (right === void 0) { right = Enums.Spacing.None; }\n if (bottom === void 0) { bottom = Enums.Spacing.None; }\n if (left === void 0) { left = Enums.Spacing.None; }\n this.top = Enums.Spacing.None;\n this.right = Enums.Spacing.None;\n this.bottom = Enums.Spacing.None;\n this.left = Enums.Spacing.None;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n return PaddingDefinition;\n}());\nexports.PaddingDefinition = PaddingDefinition;\nvar SizeAndUnit = /** @class */ (function () {\n function SizeAndUnit(physicalSize, unit) {\n this.physicalSize = physicalSize;\n this.unit = unit;\n }\n SizeAndUnit.parse = function (input, requireUnitSpecifier) {\n if (requireUnitSpecifier === void 0) { requireUnitSpecifier = false; }\n var result = new SizeAndUnit(0, Enums.SizeUnit.Weight);\n if (typeof input === \"number\") {\n result.physicalSize = input;\n return result;\n }\n else if (typeof input === \"string\") {\n var regExp = /^([0-9]+)(px|\\*)?$/g;\n var matches = regExp.exec(input);\n var expectedMatchCount = requireUnitSpecifier ? 3 : 2;\n if (matches && matches.length >= expectedMatchCount) {\n result.physicalSize = parseInt(matches[1]);\n if (matches.length == 3) {\n if (matches[2] == \"px\") {\n result.unit = Enums.SizeUnit.Pixel;\n }\n }\n return result;\n }\n }\n throw new Error(\"Invalid size: \" + input);\n };\n return SizeAndUnit;\n}());\nexports.SizeAndUnit = SizeAndUnit;\n/**\n * Fast UUID generator, RFC4122 version 4 compliant.\n * @author Jeff Ward (jcward.com).\n * @license MIT license\n * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n **/\nvar UUID = /** @class */ (function () {\n function UUID() {\n }\n UUID.generate = function () {\n var d0 = Math.random() * 0xffffffff | 0;\n var d1 = Math.random() * 0xffffffff | 0;\n var d2 = Math.random() * 0xffffffff | 0;\n var d3 = Math.random() * 0xffffffff | 0;\n return UUID.lut[d0 & 0xff] + UUID.lut[d0 >> 8 & 0xff] + UUID.lut[d0 >> 16 & 0xff] + UUID.lut[d0 >> 24 & 0xff] + '-' +\n UUID.lut[d1 & 0xff] + UUID.lut[d1 >> 8 & 0xff] + '-' + UUID.lut[d1 >> 16 & 0x0f | 0x40] + UUID.lut[d1 >> 24 & 0xff] + '-' +\n UUID.lut[d2 & 0x3f | 0x80] + UUID.lut[d2 >> 8 & 0xff] + '-' + UUID.lut[d2 >> 16 & 0xff] + UUID.lut[d2 >> 24 & 0xff] +\n UUID.lut[d3 & 0xff] + UUID.lut[d3 >> 8 & 0xff] + UUID.lut[d3 >> 16 & 0xff] + UUID.lut[d3 >> 24 & 0xff];\n };\n UUID.initialize = function () {\n for (var i = 0; i < 256; i++) {\n UUID.lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n }\n };\n UUID.lut = [];\n return UUID;\n}());\nexports.UUID = UUID;\nUUID.initialize();\n//# sourceMappingURL=shared.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Strings = void 0;\nvar Strings = /** @class */ (function () {\n function Strings() {\n }\n Strings.errors = {\n unknownElementType: function (typeName) { return \"Unknown element type \\\"\" + typeName + \"\\\". Fallback will be used if present.\"; },\n unknownActionType: function (typeName) { return \"Unknown action type \\\"\" + typeName + \"\\\". Fallback will be used if present.\"; },\n elementTypeNotAllowed: function (typeName) { return \"Element type \\\"\" + typeName + \"\\\" is not allowed in this context.\"; },\n actionTypeNotAllowed: function (typeName) { return \"Action type \\\"\" + typeName + \"\\\" is not allowed in this context.\"; },\n invalidPropertyValue: function (value, propertyName) { return \"Invalid value \\\"\" + value + \"\\\" for property \\\"\" + propertyName + \"\\\".\"; },\n showCardMustHaveCard: function () { return \"\\\"An Action.ShowCard must have its \\\"card\\\" property set to a valid AdaptiveCard object.\"; },\n invalidColumnWidth: function (invalidWidth) { return \"Invalid column width \\\"\" + invalidWidth + \"\\\" - defaulting to \\\"auto\\\".\"; },\n invalidCardVersion: function (defaultingToVersion) { return \"Invalid card version. Defaulting to \\\"\" + defaultingToVersion + \"\\\".\"; },\n invalidVersionString: function (versionString) { return \"Invalid version string \\\"\" + versionString + \"\\\".\"; },\n propertyValueNotSupported: function (value, propertyName, supportedInVersion, versionUsed) { return \"Value \\\"\" + value + \"\\\" for property \\\"\" + propertyName + \"\\\" is supported in version \" + supportedInVersion + \", but you are using version \" + versionUsed + \".\"; },\n propertyNotSupported: function (propertyName, supportedInVersion, versionUsed) { return \"Property \\\"\" + propertyName + \"\\\" is supported in version \" + supportedInVersion + \", but you are using version \" + versionUsed + \".\"; },\n indexOutOfRange: function (index) { return \"Index out of range (\" + index + \").\"; },\n elementCannotBeUsedAsInline: function () { return \"RichTextBlock.addInline: the specified card element cannot be used as a RichTextBlock inline.\"; },\n inlineAlreadyParented: function () { return \"RichTextBlock.addInline: the specified inline already belongs to another RichTextBlock.\"; },\n interactivityNotAllowed: function () { return \"Interactivity is not allowed.\"; },\n inputsMustHaveUniqueId: function () { return \"All inputs must have a unique Id.\"; },\n choiceSetMustHaveAtLeastOneChoice: function () { return \"An Input.ChoiceSet must have at least one choice defined.\"; },\n choiceSetChoicesMustHaveTitleAndValue: function () { return \"All choices in an Input.ChoiceSet must have their title and value properties set.\"; },\n propertyMustBeSet: function (propertyName) { return \"Property \\\"\" + propertyName + \"\\\" must be set.\"; },\n actionHttpHeadersMustHaveNameAndValue: function () { return \"All headers of an Action.Http must have their name and value properties set.\"; },\n tooManyActions: function (maximumActions) { return \"Maximum number of actions exceeded (\" + maximumActions + \").\"; },\n columnAlreadyBelongsToAnotherSet: function () { return \"This column already belongs to another ColumnSet.\"; },\n invalidCardType: function () { return \"Invalid or missing card type. Make sure the card's type property is set to \\\"AdaptiveCard\\\".\"; },\n unsupportedCardVersion: function (version, maxSupportedVersion) { return \"The specified card version (\" + version + \") is not supported. The maximum supported card version is \" + maxSupportedVersion + \".\"; },\n duplicateId: function (id) { return \"Duplicate Id \\\"\" + id + \"\\\".\"; },\n markdownProcessingNotEnabled: function () { return \"Markdown processing isn't enabled. Please see https://www.npmjs.com/package/adaptivecards#supporting-markdown\"; },\n processMarkdownEventRemoved: function () { return \"The processMarkdown event has been removed. Please update your code and set onProcessMarkdown instead.\"; },\n elementAlreadyParented: function () { return \"The element already belongs to another container.\"; },\n actionAlreadyParented: function () { return \"The action already belongs to another element.\"; },\n elementTypeNotStandalone: function (typeName) { return \"Elements of type \" + typeName + \" cannot be used as standalone elements.\"; }\n };\n Strings.magicCodeInputCard = {\n tryAgain: function () { return \"That didn't work... let's try again.\"; },\n pleaseLogin: function () { return \"Please login in the popup. You will obtain a magic code. Paste that code below and select \\\"Submit\\\"\"; },\n enterMagicCode: function () { return \"Enter magic code\"; },\n pleaseEnterMagicCodeYouReceived: function () { return \"Please enter the magic code you received.\"; },\n submit: function () { return \"Submit\"; },\n cancel: function () { return \"Cancel\"; },\n somethingWentWrong: function () { return \"Something went wrong. This action can't be handled.\"; },\n authenticationFailed: function () { return \"Authentication failed.\"; }\n };\n Strings.runtime = {\n automaticRefreshPaused: function () { return \"Automatic refresh paused.\"; },\n clckToRestartAutomaticRefresh: function () { return \"Click to restart.\"; },\n refreshThisCard: function () { return \"Refresh this card\"; }\n };\n Strings.hints = {\n dontUseWeightedAndStrecthedColumnsInSameSet: function () { return \"It is not recommended to use weighted and stretched columns in the same ColumnSet, because in such a situation stretched columns will always get the minimum amount of space.\"; }\n };\n Strings.defaults = {\n inlineActionTitle: function () { return \"Inline Action\"; },\n overflowButtonText: function () { return \"...\"; },\n mediaPlayerAriaLabel: function () { return \"Media content\"; },\n mediaPlayerPlayMedia: function () { return \"Play media\"; }\n };\n return Strings;\n}());\nexports.Strings = Strings;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Table = exports.TableRow = exports.TableCell = exports.StylableContainer = exports.TableColumnDefinition = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar card_elements_1 = require(\"./card-elements\");\nvar enums_1 = require(\"./enums\");\nvar registry_1 = require(\"./registry\");\nvar serialization_1 = require(\"./serialization\");\nvar shared_1 = require(\"./shared\");\nvar strings_1 = require(\"./strings\");\nvar utils_1 = require(\"./utils\");\nvar TableColumnDefinition = /** @class */ (function (_super) {\n __extends(TableColumnDefinition, _super);\n function TableColumnDefinition() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.width = new shared_1.SizeAndUnit(1, enums_1.SizeUnit.Weight);\n return _this;\n }\n TableColumnDefinition.prototype.getSchemaKey = function () {\n return \"ColumnDefinition\";\n };\n TableColumnDefinition.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n TableColumnDefinition.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n TableColumnDefinition.widthProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_5, \"width\", function (sender, property, source, context) {\n var result = property.defaultValue;\n var value = source[property.name];\n var invalidWidth = false;\n if (typeof value === \"number\" && !isNaN(value)) {\n result = new shared_1.SizeAndUnit(value, enums_1.SizeUnit.Weight);\n }\n else if (typeof value === \"string\") {\n try {\n result = shared_1.SizeAndUnit.parse(value);\n }\n catch (e) {\n invalidWidth = true;\n }\n }\n else {\n invalidWidth = true;\n }\n if (invalidWidth) {\n context.logParseEvent(sender, enums_1.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidColumnWidth(value));\n }\n return result;\n }, function (sender, property, target, value, context) {\n if (value.unit === enums_1.SizeUnit.Pixel) {\n context.serializeValue(target, \"width\", value.physicalSize + \"px\");\n }\n else {\n context.serializeNumber(target, \"width\", value.physicalSize);\n }\n }, new shared_1.SizeAndUnit(1, enums_1.SizeUnit.Weight));\n __decorate([\n serialization_1.property(TableColumnDefinition.horizontalCellContentAlignmentProperty)\n ], TableColumnDefinition.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableColumnDefinition.verticalCellContentAlignmentProperty)\n ], TableColumnDefinition.prototype, \"verticalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableColumnDefinition.widthProperty)\n ], TableColumnDefinition.prototype, \"width\", void 0);\n return TableColumnDefinition;\n}(serialization_1.SerializableObject));\nexports.TableColumnDefinition = TableColumnDefinition;\nvar StylableContainer = /** @class */ (function (_super) {\n __extends(StylableContainer, _super);\n function StylableContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._items = [];\n return _this;\n }\n StylableContainer.prototype.parseItem = function (source, context) {\n var _this = this;\n return context.parseCardObject(this, source, [], // Forbidden types not supported for elements for now\n !this.isDesignMode(), function (typeName) {\n return _this.createItemInstance(typeName);\n }, function (typeName, errorType) {\n context.logParseEvent(undefined, enums_1.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n });\n };\n StylableContainer.prototype.internalAddItem = function (item) {\n if (!item.parent) {\n this._items.push(item);\n item.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.elementAlreadyParented());\n }\n };\n StylableContainer.prototype.internalRemoveItem = function (item) {\n var itemIndex = this._items.indexOf(item);\n if (itemIndex >= 0) {\n this._items.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n return false;\n };\n StylableContainer.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._items = [];\n var items = source[this.getCollectionPropertyName()];\n if (Array.isArray(items)) {\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var instance = this.parseItem(item, context);\n if (instance) {\n this._items.push(instance);\n }\n }\n }\n };\n StylableContainer.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, this.getCollectionPropertyName(), this._items);\n };\n StylableContainer.prototype.removeItem = function (item) {\n return this.internalRemoveItem(item);\n };\n StylableContainer.prototype.getItemCount = function () {\n return this._items.length;\n };\n StylableContainer.prototype.getItemAt = function (index) {\n return this._items[index];\n };\n StylableContainer.prototype.getFirstVisibleRenderedItem = function () {\n return this.getItemCount() > 0 ? this.getItemAt(0) : undefined;\n };\n StylableContainer.prototype.getLastVisibleRenderedItem = function () {\n return this.getItemCount() > 0 ? this.getItemAt(this.getItemCount() - 1) : undefined;\n };\n return StylableContainer;\n}(card_elements_1.StylableCardElementContainer));\nexports.StylableContainer = StylableContainer;\nvar TableCell = /** @class */ (function (_super) {\n __extends(TableCell, _super);\n function TableCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columnIndex = -1;\n _this._cellType = \"data\";\n return _this;\n }\n TableCell.prototype.getHasBorder = function () {\n return this.parentRow.parentTable.showGridLines;\n };\n TableCell.prototype.applyBorder = function () {\n if (this.renderedElement && this.getHasBorder()) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.parentRow.parentTable.gridStyle);\n if (styleDefinition.borderColor) {\n var borderColor = utils_1.stringToCssColor(styleDefinition.borderColor);\n if (borderColor) {\n this.renderedElement.style.borderRight = \"1px solid \" + borderColor;\n this.renderedElement.style.borderBottom = \"1px solid \" + borderColor;\n }\n }\n }\n };\n TableCell.prototype.getDefaultPadding = function () {\n return this.getHasBackground() || this.getHasBorder() ?\n new shared_1.PaddingDefinition(enums_1.Spacing.Small, enums_1.Spacing.Small, enums_1.Spacing.Small, enums_1.Spacing.Small) : _super.prototype.getDefaultPadding.call(this);\n };\n TableCell.prototype.internalRender = function () {\n var cellElement = _super.prototype.internalRender.call(this);\n if (cellElement) {\n cellElement.setAttribute(\"role\", this.cellType === \"data\" ? \"cell\" : \"columnheader\");\n cellElement.style.minWidth = \"0\";\n if (this.cellType === \"header\") {\n cellElement.setAttribute(\"scope\", \"col\");\n }\n }\n return cellElement;\n };\n TableCell.prototype.shouldSerialize = function (context) {\n return true;\n };\n TableCell.prototype.getJsonTypeName = function () {\n return \"TableCell\";\n };\n TableCell.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.cellType === \"header\") {\n return this.hostConfig.textStyles.columnHeader;\n }\n return _super.prototype.getEffectiveTextStyleDefinition.call(this);\n };\n TableCell.prototype.getEffectiveHorizontalAlignment = function () {\n if (this.horizontalAlignment !== undefined) {\n return this.horizontalAlignment;\n }\n if (this.parentRow.horizontalCellContentAlignment !== undefined) {\n return this.parentRow.horizontalCellContentAlignment;\n }\n if (this.columnIndex >= 0) {\n var horizontalAlignment = this.parentRow.parentTable.getColumnAt(this.columnIndex).horizontalCellContentAlignment;\n if (horizontalAlignment !== undefined) {\n return horizontalAlignment;\n }\n }\n if (this.parentRow.parentTable.horizontalCellContentAlignment !== undefined) {\n return this.parentRow.parentTable.horizontalCellContentAlignment;\n }\n return _super.prototype.getEffectiveHorizontalAlignment.call(this);\n };\n TableCell.prototype.getEffectiveVerticalContentAlignment = function () {\n if (this.verticalContentAlignment !== undefined) {\n return this.verticalContentAlignment;\n }\n if (this.parentRow.verticalCellContentAlignment !== undefined) {\n return this.parentRow.verticalCellContentAlignment;\n }\n if (this.columnIndex >= 0) {\n var verticalAlignment = this.parentRow.parentTable.getColumnAt(this.columnIndex).verticalCellContentAlignment;\n if (verticalAlignment !== undefined) {\n return verticalAlignment;\n }\n }\n if (this.parentRow.parentTable.verticalCellContentAlignment !== undefined) {\n return this.parentRow.parentTable.verticalCellContentAlignment;\n }\n return _super.prototype.getEffectiveVerticalContentAlignment.call(this);\n };\n Object.defineProperty(TableCell.prototype, \"columnIndex\", {\n get: function () {\n return this._columnIndex;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"cellType\", {\n get: function () {\n return this._cellType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"parentRow\", {\n get: function () {\n return this.parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return TableCell;\n}(card_elements_1.Container));\nexports.TableCell = TableCell;\nvar TableRow = /** @class */ (function (_super) {\n __extends(TableRow, _super);\n function TableRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n TableRow.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(enums_1.Spacing.None, enums_1.Spacing.None, enums_1.Spacing.None, enums_1.Spacing.None);\n };\n TableRow.prototype.applyBackground = function () {\n if (this.renderedElement) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.style, this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));\n if (styleDefinition.backgroundColor) {\n var bgColor = utils_1.stringToCssColor(styleDefinition.backgroundColor);\n this.renderedElement.style.backgroundColor = bgColor;\n }\n }\n };\n TableRow.prototype.getCollectionPropertyName = function () {\n return \"cells\";\n };\n TableRow.prototype.createItemInstance = function (typeName) {\n return !typeName || typeName === \"TableCell\" ? new TableCell() : undefined;\n };\n TableRow.prototype.internalRender = function () {\n var isFirstRow = this.getIsFirstRow();\n var cellSpacing = this.hostConfig.table.cellSpacing;\n var rowElement = document.createElement(\"div\");\n rowElement.setAttribute(\"role\", \"row\");\n rowElement.style.display = \"flex\";\n rowElement.style.flexDirection = \"row\";\n for (var i = 0; i < Math.min(this.getItemCount(), this.parentTable.getColumnCount()); i++) {\n var cell = this.getItemAt(i);\n // Cheating a bit in order to keep cellType read-only\n cell[\"_columnIndex\"] = i;\n cell[\"_cellType\"] = (this.parentTable.firstRowAsHeaders && isFirstRow) ? \"header\" : \"data\";\n var renderedCell = cell.render();\n if (renderedCell) {\n var column = this.parentTable.getColumnAt(i);\n if (column.computedWidth.unit === enums_1.SizeUnit.Pixel) {\n renderedCell.style.flex = \"0 0 \" + column.computedWidth.physicalSize + \"px\";\n }\n else {\n renderedCell.style.flex = \"1 1 \" + column.computedWidth.physicalSize + \"%\";\n }\n if (i > 0 && !this.parentTable.showGridLines && cellSpacing > 0) {\n renderedCell.style.marginLeft = cellSpacing + \"px\";\n }\n rowElement.appendChild(renderedCell);\n }\n }\n return rowElement.children.length > 0 ? rowElement : undefined;\n };\n TableRow.prototype.shouldSerialize = function (context) {\n return true;\n };\n TableRow.prototype.addCell = function (cell) {\n this.internalAddItem(cell);\n };\n TableRow.prototype.removeCellAt = function (columnIndex) {\n if (columnIndex >= 0 && columnIndex < this.getItemCount()) {\n return this.removeItem(this.getItemAt(columnIndex));\n }\n return false;\n };\n TableRow.prototype.ensureHasEnoughCells = function (cellCount) {\n while (this.getItemCount() < cellCount) {\n this.addCell(new TableCell());\n }\n };\n TableRow.prototype.getJsonTypeName = function () {\n return \"TableRow\";\n };\n TableRow.prototype.getIsFirstRow = function () {\n return this.parentTable.getItemAt(0) === this;\n };\n Object.defineProperty(TableRow.prototype, \"parentTable\", {\n get: function () {\n return this.parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableRow.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n TableRow.styleProperty = new card_elements_1.ContainerStyleProperty(serialization_1.Versions.v1_5, \"style\");\n TableRow.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n TableRow.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n __decorate([\n serialization_1.property(TableRow.horizontalCellContentAlignmentProperty)\n ], TableRow.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableRow.verticalCellContentAlignmentProperty)\n ], TableRow.prototype, \"verticalCellContentAlignment\", void 0);\n return TableRow;\n}(StylableContainer));\nexports.TableRow = TableRow;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columns = [];\n _this.firstRowAsHeaders = true;\n _this.showGridLines = true;\n return _this;\n }\n Object.defineProperty(Table.prototype, \"gridStyle\", {\n get: function () {\n var style = this.getValue(Table.gridStyleProperty);\n if (style && this.hostConfig.containerStyles.getStyleByName(style)) {\n return style;\n }\n return undefined;\n },\n set: function (value) {\n this.setValue(Table.gridStyleProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n //#endregion\n Table.prototype.ensureRowsHaveEnoughCells = function () {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).ensureHasEnoughCells(this.getColumnCount());\n }\n };\n Table.prototype.removeCellsFromColumn = function (columnIndex) {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).removeCellAt(columnIndex);\n }\n };\n Table.prototype.getCollectionPropertyName = function () {\n return \"rows\";\n };\n Table.prototype.createItemInstance = function (typeName) {\n return !typeName || typeName === \"TableRow\" ? new TableRow() : undefined;\n };\n Table.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this.ensureRowsHaveEnoughCells();\n };\n Table.prototype.internalRender = function () {\n if (this.getItemCount() > 0) {\n var totalWeights = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.width.unit === enums_1.SizeUnit.Weight) {\n totalWeights += column.width.physicalSize;\n }\n }\n for (var _b = 0, _c = this._columns; _b < _c.length; _b++) {\n var column = _c[_b];\n if (column.width.unit === enums_1.SizeUnit.Pixel) {\n column.computedWidth = new shared_1.SizeAndUnit(column.width.physicalSize, enums_1.SizeUnit.Pixel);\n }\n else {\n column.computedWidth = new shared_1.SizeAndUnit(100 / totalWeights * column.width.physicalSize, enums_1.SizeUnit.Weight);\n }\n }\n var tableElement = document.createElement(\"div\");\n tableElement.setAttribute(\"role\", \"table\");\n tableElement.style.display = \"flex\";\n tableElement.style.flexDirection = \"column\";\n if (this.showGridLines) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.gridStyle);\n if (styleDefinition.borderColor) {\n var borderColor = utils_1.stringToCssColor(styleDefinition.borderColor);\n if (borderColor) {\n tableElement.style.borderTop = \"1px solid \" + borderColor;\n tableElement.style.borderLeft = \"1px solid \" + borderColor;\n }\n }\n }\n var cellSpacing = this.hostConfig.table.cellSpacing;\n for (var i = 0; i < this.getItemCount(); i++) {\n var renderedRow = this.getItemAt(i).render();\n if (renderedRow) {\n if (i > 0 && !this.showGridLines && cellSpacing > 0) {\n var separatorRow = document.createElement(\"div\");\n separatorRow.setAttribute(\"aria-hidden\", \"true\");\n separatorRow.style.height = cellSpacing + \"px\";\n tableElement.appendChild(separatorRow);\n }\n tableElement.appendChild(renderedRow);\n }\n }\n return tableElement;\n }\n return undefined;\n };\n Table.prototype.addColumn = function (column) {\n this._columns.push(column);\n this.ensureRowsHaveEnoughCells();\n };\n Table.prototype.removeColumn = function (column) {\n var index = this._columns.indexOf(column);\n if (index >= 0) {\n this.removeCellsFromColumn(index);\n this._columns.splice(index, 1);\n }\n };\n Table.prototype.getColumnCount = function () {\n return this._columns.length;\n };\n Table.prototype.getColumnAt = function (index) {\n return this._columns[index];\n };\n Table.prototype.addRow = function (row) {\n this.internalAddItem(row);\n row.ensureHasEnoughCells(this.getColumnCount());\n };\n Table.prototype.getJsonTypeName = function () {\n return \"Table\";\n };\n Table.columnsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_5, \"columns\", TableColumnDefinition);\n Table.firstRowAsHeadersProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"firstRowAsHeaders\", true);\n Table.showGridLinesProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"showGridLines\", true);\n Table.gridStyleProperty = new card_elements_1.ContainerStyleProperty(serialization_1.Versions.v1_5, \"gridStyle\");\n Table.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n Table.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n __decorate([\n serialization_1.property(Table.columnsProperty)\n ], Table.prototype, \"_columns\", void 0);\n __decorate([\n serialization_1.property(Table.firstRowAsHeadersProperty)\n ], Table.prototype, \"firstRowAsHeaders\", void 0);\n __decorate([\n serialization_1.property(Table.showGridLinesProperty)\n ], Table.prototype, \"showGridLines\", void 0);\n __decorate([\n serialization_1.property(Table.gridStyleProperty)\n ], Table.prototype, \"gridStyle\", null);\n __decorate([\n serialization_1.property(Table.horizontalCellContentAlignmentProperty)\n ], Table.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(Table.verticalCellContentAlignmentProperty)\n ], Table.prototype, \"verticalCellContentAlignment\", void 0);\n return Table;\n}(StylableContainer));\nexports.Table = Table;\nregistry_1.GlobalRegistry.defaultElements.register(\"Table\", Table, serialization_1.Versions.v1_5);\n//# sourceMappingURL=table.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatText = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar AbstractTextFormatter = /** @class */ (function () {\n function AbstractTextFormatter(regularExpression) {\n this._regularExpression = regularExpression;\n }\n AbstractTextFormatter.prototype.format = function (lang, input) {\n var matches;\n if (input) {\n var result = input;\n while ((matches = this._regularExpression.exec(input)) != null) {\n result = result.replace(matches[0], this.internalFormat(lang, matches));\n }\n ;\n return result;\n }\n else {\n return input;\n }\n };\n return AbstractTextFormatter;\n}());\nvar DateFormatter = /** @class */ (function (_super) {\n __extends(DateFormatter, _super);\n function DateFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateFormatter.prototype.internalFormat = function (lang, matches) {\n var date = new Date(Date.parse(matches[1]));\n var format = matches[2] != undefined ? matches[2].toLowerCase() : \"compact\";\n if (format != \"compact\") {\n return date.toLocaleDateString(lang, { day: \"numeric\", weekday: format, month: format, year: \"numeric\" });\n }\n else {\n return date.toLocaleDateString();\n }\n };\n return DateFormatter;\n}(AbstractTextFormatter));\nvar TimeFormatter = /** @class */ (function (_super) {\n __extends(TimeFormatter, _super);\n function TimeFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeFormatter.prototype.internalFormat = function (lang, matches) {\n var date = new Date(Date.parse(matches[1]));\n return date.toLocaleTimeString(lang, { hour: 'numeric', minute: '2-digit' });\n };\n return TimeFormatter;\n}(AbstractTextFormatter));\nfunction formatText(lang, text) {\n var formatters = [\n new DateFormatter(/\\{{2}DATE\\((\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|(?:(?:-|\\+)\\d{2}:\\d{2})))(?:, ?(COMPACT|LONG|SHORT))?\\)\\}{2}/g),\n new TimeFormatter(/\\{{2}TIME\\((\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|(?:(?:-|\\+)\\d{2}:\\d{2})))\\)\\}{2}/g)\n ];\n var result = text;\n for (var _i = 0, formatters_1 = formatters; _i < formatters_1.length; _i++) {\n var formatter = formatters_1[_i];\n result = formatter.format(lang, result);\n }\n return result;\n}\nexports.formatText = formatText;\n//# sourceMappingURL=text-formatters.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clearElementChildren = exports.getScrollY = exports.getScrollX = exports.getFitStatus = exports.truncate = exports.stringToCssColor = exports.parseEnum = exports.getEnumValueByName = exports.parseBool = exports.parseNumber = exports.parseString = exports.appendChild = exports.generateUniqueId = exports.isMobileOS = exports.isInternetExplorer = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar Shared = require(\"./shared\");\nfunction isInternetExplorer() {\n // The documentMode property only exists in IE\n return window.document.documentMode !== undefined;\n}\nexports.isInternetExplorer = isInternetExplorer;\nfunction isMobileOS() {\n var userAgent = window.navigator.userAgent;\n return !!userAgent.match(/Android/i) || !!userAgent.match(/iPad/i) || !!userAgent.match(/iPhone/i);\n}\nexports.isMobileOS = isMobileOS;\n/**\n * Generate a UUID prepended with \"__ac-\"\n */\nfunction generateUniqueId() {\n return \"__ac-\" + Shared.UUID.generate();\n}\nexports.generateUniqueId = generateUniqueId;\nfunction appendChild(node, child) {\n if (child) {\n node.appendChild(child);\n }\n}\nexports.appendChild = appendChild;\nfunction parseString(obj, defaultValue) {\n return typeof obj === \"string\" ? obj : defaultValue;\n}\nexports.parseString = parseString;\nfunction parseNumber(obj, defaultValue) {\n return typeof obj === \"number\" ? obj : defaultValue;\n}\nexports.parseNumber = parseNumber;\nfunction parseBool(value, defaultValue) {\n if (typeof value === \"boolean\") {\n return value;\n }\n else if (typeof value === \"string\") {\n switch (value.toLowerCase()) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n return defaultValue;\n }\n }\n return defaultValue;\n}\nexports.parseBool = parseBool;\nfunction getEnumValueByName(enumType, name) {\n for (var key in enumType) {\n var keyAsNumber = parseInt(key, 10);\n if (keyAsNumber >= 0) {\n var value = enumType[key];\n if (value && typeof value === \"string\" && value.toLowerCase() === name.toLowerCase()) {\n return keyAsNumber;\n }\n }\n }\n return undefined;\n}\nexports.getEnumValueByName = getEnumValueByName;\nfunction parseEnum(enumType, name, defaultValue) {\n if (!name) {\n return defaultValue;\n }\n var enumValue = getEnumValueByName(enumType, name);\n return enumValue !== undefined ? enumValue : defaultValue;\n}\nexports.parseEnum = parseEnum;\nfunction stringToCssColor(color) {\n if (color) {\n var regEx = /#([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?/gi;\n var matches = regEx.exec(color);\n if (matches && matches[4]) {\n var a = parseInt(matches[1], 16) / 255;\n var r = parseInt(matches[2], 16);\n var g = parseInt(matches[3], 16);\n var b = parseInt(matches[4], 16);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + a + \")\";\n }\n }\n return color;\n}\nexports.stringToCssColor = stringToCssColor;\nfunction truncate(element, maxHeight, lineHeight) {\n var fits = function () {\n // Allow a one pixel overflow to account for rounding differences\n // between browsers\n return maxHeight - element.scrollHeight >= -1.0;\n };\n if (fits())\n return;\n var fullText = element.innerHTML;\n var truncateAt = function (idx) {\n element.innerHTML = fullText.substring(0, idx) + '...';\n };\n var breakableIndices = findBreakableIndices(fullText);\n var lo = 0;\n var hi = breakableIndices.length;\n var bestBreakIdx = 0;\n // Do a binary search for the longest string that fits\n while (lo < hi) {\n var mid = Math.floor((lo + hi) / 2);\n truncateAt(breakableIndices[mid]);\n if (fits()) {\n bestBreakIdx = breakableIndices[mid];\n lo = mid + 1;\n }\n else {\n hi = mid;\n }\n }\n truncateAt(bestBreakIdx);\n // If we have extra room, try to expand the string letter by letter\n // (covers the case where we have to break in the middle of a long word)\n if (lineHeight && maxHeight - element.scrollHeight >= lineHeight - 1.0) {\n var idx = findNextCharacter(fullText, bestBreakIdx);\n while (idx < fullText.length) {\n truncateAt(idx);\n if (fits()) {\n bestBreakIdx = idx;\n idx = findNextCharacter(fullText, idx);\n }\n else {\n break;\n }\n }\n truncateAt(bestBreakIdx);\n }\n}\nexports.truncate = truncate;\nfunction findBreakableIndices(html) {\n var results = [];\n var idx = findNextCharacter(html, -1);\n while (idx < html.length) {\n if (html[idx] == ' ') {\n results.push(idx);\n }\n idx = findNextCharacter(html, idx);\n }\n return results;\n}\nfunction findNextCharacter(html, currIdx) {\n currIdx += 1;\n // If we found the start of an HTML tag, keep advancing until we get\n // past it, so we don't end up truncating in the middle of the tag\n while (currIdx < html.length && html[currIdx] == '<') {\n while (currIdx < html.length && html[currIdx++] != '>')\n ;\n }\n return currIdx;\n}\nfunction getFitStatus(element, containerEnd) {\n var start = element.offsetTop;\n var end = start + element.clientHeight;\n if (end <= containerEnd) {\n return Enums.ContainerFitStatus.FullyInContainer;\n }\n else if (start < containerEnd) {\n return Enums.ContainerFitStatus.Overflowing;\n }\n else {\n return Enums.ContainerFitStatus.FullyOutOfContainer;\n }\n}\nexports.getFitStatus = getFitStatus;\nfunction getScrollX() {\n return window.pageXOffset;\n}\nexports.getScrollX = getScrollX;\nfunction getScrollY() {\n return window.pageYOffset;\n}\nexports.getScrollY = getScrollY;\nfunction clearElementChildren(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\nexports.clearElementChildren = clearElementChildren;\n//# sourceMappingURL=utils.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","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","\"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\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.core !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;","const nodeFetch = require('node-fetch')\nconst realFetch = nodeFetch.default || nodeFetch\n\nconst fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nfetch.ponyfill = true\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\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","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\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","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\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","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","'use strict';\n\n/**\n * Converts tokens for a single address into an address object\n *\n * @param {Array} tokens Tokens object\n * @return {Object} Address object\n */\nfunction _handleAddress(tokens) {\n let token;\n let isGroup = false;\n let state = 'text';\n let address;\n let addresses = [];\n let data = {\n address: [],\n comment: [],\n group: [],\n text: []\n };\n let i;\n let len;\n\n // Filter out , (comments) and regular text\n for (i = 0, len = tokens.length; i < len; i++) {\n token = tokens[i];\n if (token.type === 'operator') {\n switch (token.value) {\n case '<':\n state = 'address';\n break;\n case '(':\n state = 'comment';\n break;\n case ':':\n state = 'group';\n isGroup = true;\n break;\n default:\n state = 'text';\n }\n } else if (token.value) {\n if (state === 'address') {\n // handle use case where unquoted name includes a \"<\"\n // Apple Mail truncates everything between an unexpected < and an address\n // and so will we\n token.value = token.value.replace(/^[^<]*<\\s*/, '');\n }\n data[state].push(token.value);\n }\n }\n\n // If there is no text but a comment, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n if (isGroup) {\n // http://tools.ietf.org/html/rfc2822#appendix-A.1.3\n data.text = data.text.join(' ');\n addresses.push({\n name: data.text || (address && address.name),\n group: data.group.length ? addressparser(data.group.join(',')) : []\n });\n } else {\n // If no address was found, try to detect one from regular text\n if (!data.address.length && data.text.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n if (data.text[i].match(/^[^@\\s]+@[^@\\s]+$/)) {\n data.address = data.text.splice(i, 1);\n break;\n }\n }\n\n let _regexHandler = function (address) {\n if (!data.address.length) {\n data.address = [address.trim()];\n return ' ';\n } else {\n return address;\n }\n };\n\n // still no address\n if (!data.address.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n // fixed the regex to parse email address correctly when email address has more than one @\n data.text[i] = data.text[i].replace(/\\s*\\b[^@\\s]+@[^\\s]+\\b\\s*/, _regexHandler).trim();\n if (data.address.length) {\n break;\n }\n }\n }\n }\n\n // If there's still is no text but a comment exixts, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n // Keep only the first address occurence, push others to regular text\n if (data.address.length > 1) {\n data.text = data.text.concat(data.address.splice(1));\n }\n\n // Join values with spaces\n data.text = data.text.join(' ');\n data.address = data.address.join(' ');\n\n if (!data.address && isGroup) {\n return [];\n } else {\n address = {\n address: data.address || data.text || '',\n name: data.text || data.address || ''\n };\n\n if (address.address === address.name) {\n if ((address.address || '').match(/@/)) {\n address.name = '';\n } else {\n address.address = '';\n }\n }\n\n addresses.push(address);\n }\n }\n\n return addresses;\n}\n\n/**\n * Creates a Tokenizer object for tokenizing address field strings\n *\n * @constructor\n * @param {String} str Address field string\n */\nclass Tokenizer {\n constructor(str) {\n this.str = (str || '').toString();\n this.operatorCurrent = '';\n this.operatorExpecting = '';\n this.node = null;\n this.escaped = false;\n\n this.list = [];\n /**\n * Operator tokens and which tokens are expected to end the sequence\n */\n this.operators = {\n '\"': '\"',\n '(': ')',\n '<': '>',\n ',': '',\n ':': ';',\n // Semicolons are not a legal delimiter per the RFC2822 grammar other\n // than for terminating a group, but they are also not valid for any\n // other use in this context. Given that some mail clients have\n // historically allowed the semicolon as a delimiter equivalent to the\n // comma in their UI, it makes sense to treat them the same as a comma\n // when used outside of a group.\n ';': ''\n };\n }\n\n /**\n * Tokenizes the original input string\n *\n * @return {Array} An array of operator|text tokens\n */\n tokenize() {\n let chr,\n list = [];\n for (let i = 0, len = this.str.length; i < len; i++) {\n chr = this.str.charAt(i);\n this.checkChar(chr);\n }\n\n this.list.forEach(node => {\n node.value = (node.value || '').toString().trim();\n if (node.value) {\n list.push(node);\n }\n });\n\n return list;\n }\n\n /**\n * Checks if a character is an operator or text and acts accordingly\n *\n * @param {String} chr Character from the address field\n */\n checkChar(chr) {\n if (this.escaped) {\n // ignore next condition blocks\n } else if (chr === this.operatorExpecting) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = '';\n this.escaped = false;\n return;\n } else if (!this.operatorExpecting && chr in this.operators) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = this.operators[chr];\n this.escaped = false;\n return;\n } else if (['\"', \"'\"].includes(this.operatorExpecting) && chr === '\\\\') {\n this.escaped = true;\n return;\n }\n\n if (!this.node) {\n this.node = {\n type: 'text',\n value: ''\n };\n this.list.push(this.node);\n }\n\n if (chr === '\\n') {\n // Convert newlines to spaces. Carriage return is ignored as \\r and \\n usually\n // go together anyway and there already is a WS for \\n. Lone \\r means something is fishy.\n chr = ' ';\n }\n\n if (chr.charCodeAt(0) >= 0x21 || [' ', '\\t'].includes(chr)) {\n // skip command bytes\n this.node.value += chr;\n }\n\n this.escaped = false;\n }\n}\n\n/**\n * Parses structured e-mail addresses from an address field\n *\n * Example:\n *\n * 'Name '\n *\n * will be converted to\n *\n * [{name: 'Name', address: 'address@domain'}]\n *\n * @param {String} str Address field\n * @return {Array} An array of address objects\n */\nfunction addressparser(str, options) {\n options = options || {};\n\n let tokenizer = new Tokenizer(str);\n let tokens = tokenizer.tokenize();\n\n let addresses = [];\n let address = [];\n let parsedAddresses = [];\n\n tokens.forEach(token => {\n if (token.type === 'operator' && (token.value === ',' || token.value === ';')) {\n if (address.length) {\n addresses.push(address);\n }\n address = [];\n } else {\n address.push(token);\n }\n });\n\n if (address.length) {\n addresses.push(address);\n }\n\n addresses.forEach(address => {\n address = _handleAddress(address);\n if (address.length) {\n parsedAddresses = parsedAddresses.concat(address);\n }\n });\n\n if (options.flatten) {\n let addresses = [];\n let walkAddressList = list => {\n list.forEach(address => {\n if (address.group) {\n return walkAddressList(address.group);\n } else {\n addresses.push(address);\n }\n });\n };\n walkAddressList(parsedAddresses);\n return addresses;\n }\n\n return parsedAddresses;\n}\n\n// expose to the world\nmodule.exports = addressparser;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a base64 encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} base64 encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n return buffer.toString('base64');\n}\n\n/**\n * Adds soft line breaks to a base64 string\n *\n * @param {String} str base64 encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped base64 encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let result = [];\n let pos = 0;\n let chunkLength = lineLength * 1024;\n while (pos < str.length) {\n let wrappedLines = str\n .substr(pos, chunkLength)\n .replace(new RegExp('.{' + lineLength + '}', 'g'), '$&\\r\\n')\n .trim();\n result.push(wrappedLines);\n pos += chunkLength;\n }\n\n return result.join('\\r\\n').trim();\n}\n\n/**\n * Creates a transform stream for encoding data to base64 encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n this._remainingBytes = false;\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return setImmediate(done);\n }\n\n this.inputBytes += chunk.length;\n\n if (this._remainingBytes && this._remainingBytes.length) {\n chunk = Buffer.concat([this._remainingBytes, chunk], this._remainingBytes.length + chunk.length);\n this._remainingBytes = false;\n }\n\n if (chunk.length % 3) {\n this._remainingBytes = chunk.slice(chunk.length - (chunk.length % 3));\n chunk = chunk.slice(0, chunk.length - (chunk.length % 3));\n } else {\n this._remainingBytes = false;\n }\n\n let b64 = this._curLine + encode(chunk);\n\n if (this.options.lineLength) {\n b64 = wrap(b64, this.options.lineLength);\n\n // remove last line as it is still most probably incomplete\n let lastLF = b64.lastIndexOf('\\n');\n if (lastLF < 0) {\n this._curLine = b64;\n b64 = '';\n } else if (lastLF === b64.length - 1) {\n this._curLine = '';\n } else {\n this._curLine = b64.substr(lastLF + 1);\n b64 = b64.substr(0, lastLF + 1);\n }\n }\n\n if (b64) {\n this.outputBytes += b64.length;\n this.push(Buffer.from(b64, 'ascii'));\n }\n\n setImmediate(done);\n }\n\n _flush(done) {\n if (this._remainingBytes && this._remainingBytes.length) {\n this._curLine += encode(this._remainingBytes);\n }\n\n if (this._curLine) {\n this._curLine = wrap(this._curLine, this.options.lineLength);\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n this._curLine = '';\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","'use strict';\n\n// FIXME:\n// replace this Transform mess with a method that pipes input argument to output argument\n\nconst MessageParser = require('./message-parser');\nconst RelaxedBody = require('./relaxed-body');\nconst sign = require('./sign');\nconst PassThrough = require('stream').PassThrough;\nconst fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\n\nconst DKIM_ALGO = 'sha256';\nconst MAX_MESSAGE_SIZE = 128 * 1024; // buffer messages larger than this to disk\n\n/*\n// Usage:\n\nlet dkim = new DKIM({\n domainName: 'example.com',\n keySelector: 'key-selector',\n privateKey,\n cacheDir: '/tmp'\n});\ndkim.sign(input).pipe(process.stdout);\n\n// Where inputStream is a rfc822 message (either a stream, string or Buffer)\n// and outputStream is a DKIM signed rfc822 message\n*/\n\nclass DKIMSigner {\n constructor(options, keys, input, output) {\n this.options = options || {};\n this.keys = keys;\n\n this.cacheTreshold = Number(this.options.cacheTreshold) || MAX_MESSAGE_SIZE;\n this.hashAlgo = this.options.hashAlgo || DKIM_ALGO;\n\n this.cacheDir = this.options.cacheDir || false;\n\n this.chunks = [];\n this.chunklen = 0;\n this.readPos = 0;\n this.cachePath = this.cacheDir ? path.join(this.cacheDir, 'message.' + Date.now() + '-' + crypto.randomBytes(14).toString('hex')) : false;\n this.cache = false;\n\n this.headers = false;\n this.bodyHash = false;\n this.parser = false;\n this.relaxedBody = false;\n\n this.input = input;\n this.output = output;\n this.output.usingCache = false;\n\n this.hasErrored = false;\n\n this.input.on('error', err => {\n this.hasErrored = true;\n this.cleanup();\n output.emit('error', err);\n });\n }\n\n cleanup() {\n if (!this.cache || !this.cachePath) {\n return;\n }\n fs.unlink(this.cachePath, () => false);\n }\n\n createReadCache() {\n // pipe remainings to cache file\n this.cache = fs.createReadStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.cleanup();\n });\n this.cache.pipe(this.output);\n }\n\n sendNextChunk() {\n if (this.hasErrored) {\n return;\n }\n\n if (this.readPos >= this.chunks.length) {\n if (!this.cache) {\n return this.output.end();\n }\n return this.createReadCache();\n }\n let chunk = this.chunks[this.readPos++];\n if (this.output.write(chunk) === false) {\n return this.output.once('drain', () => {\n this.sendNextChunk();\n });\n }\n setImmediate(() => this.sendNextChunk());\n }\n\n sendSignedOutput() {\n let keyPos = 0;\n let signNextKey = () => {\n if (keyPos >= this.keys.length) {\n this.output.write(this.parser.rawHeaders);\n return setImmediate(() => this.sendNextChunk());\n }\n let key = this.keys[keyPos++];\n let dkimField = sign(this.headers, this.hashAlgo, this.bodyHash, {\n domainName: key.domainName,\n keySelector: key.keySelector,\n privateKey: key.privateKey,\n headerFieldNames: this.options.headerFieldNames,\n skipFields: this.options.skipFields\n });\n if (dkimField) {\n this.output.write(Buffer.from(dkimField + '\\r\\n'));\n }\n return setImmediate(signNextKey);\n };\n\n if (this.bodyHash && this.headers) {\n return signNextKey();\n }\n\n this.output.write(this.parser.rawHeaders);\n this.sendNextChunk();\n }\n\n createWriteCache() {\n this.output.usingCache = true;\n // pipe remainings to cache file\n this.cache = fs.createWriteStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n // drain input\n this.relaxedBody.unpipe(this.cache);\n this.relaxedBody.on('readable', () => {\n while (this.relaxedBody.read() !== null) {\n // do nothing\n }\n });\n this.hasErrored = true;\n // emit error\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.sendSignedOutput();\n });\n this.relaxedBody.removeAllListeners('readable');\n this.relaxedBody.pipe(this.cache);\n }\n\n signStream() {\n this.parser = new MessageParser();\n this.relaxedBody = new RelaxedBody({\n hashAlgo: this.hashAlgo\n });\n\n this.parser.on('headers', value => {\n this.headers = value;\n });\n\n this.relaxedBody.on('hash', value => {\n this.bodyHash = value;\n });\n\n this.relaxedBody.on('readable', () => {\n let chunk;\n if (this.cache) {\n return;\n }\n while ((chunk = this.relaxedBody.read()) !== null) {\n this.chunks.push(chunk);\n this.chunklen += chunk.length;\n if (this.chunklen >= this.cacheTreshold && this.cachePath) {\n return this.createWriteCache();\n }\n }\n });\n\n this.relaxedBody.on('end', () => {\n if (this.cache) {\n return;\n }\n this.sendSignedOutput();\n });\n\n this.parser.pipe(this.relaxedBody);\n setImmediate(() => this.input.pipe(this.parser));\n }\n}\n\nclass DKIM {\n constructor(options) {\n this.options = options || {};\n this.keys = [].concat(\n this.options.keys || {\n domainName: options.domainName,\n keySelector: options.keySelector,\n privateKey: options.privateKey\n }\n );\n }\n\n sign(input, extraOptions) {\n let output = new PassThrough();\n let inputStream = input;\n let writeValue = false;\n\n if (Buffer.isBuffer(input)) {\n writeValue = input;\n inputStream = new PassThrough();\n } else if (typeof input === 'string') {\n writeValue = Buffer.from(input);\n inputStream = new PassThrough();\n }\n\n let options = this.options;\n if (extraOptions && Object.keys(extraOptions).length) {\n options = {};\n Object.keys(this.options || {}).forEach(key => {\n options[key] = this.options[key];\n });\n Object.keys(extraOptions || {}).forEach(key => {\n if (!(key in options)) {\n options[key] = extraOptions[key];\n }\n });\n }\n\n let signer = new DKIMSigner(options, this.keys, inputStream, output);\n setImmediate(() => {\n signer.signStream();\n if (writeValue) {\n setImmediate(() => {\n inputStream.end(writeValue);\n });\n }\n });\n\n return output;\n }\n}\n\nmodule.exports = DKIM;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * MessageParser instance is a transform stream that separates message headers\n * from the rest of the body. Headers are emitted with the 'headers' event. Message\n * body is passed on as the resulting stream.\n */\nclass MessageParser extends Transform {\n constructor(options) {\n super(options);\n this.lastBytes = Buffer.alloc(4);\n this.headersParsed = false;\n this.headerBytes = 0;\n this.headerChunks = [];\n this.rawHeaders = false;\n this.bodySize = 0;\n }\n\n /**\n * Keeps count of the last 4 bytes in order to detect line breaks on chunk boundaries\n *\n * @param {Buffer} data Next data chunk from the stream\n */\n updateLastBytes(data) {\n let lblen = this.lastBytes.length;\n let nblen = Math.min(data.length, lblen);\n\n // shift existing bytes\n for (let i = 0, len = lblen - nblen; i < len; i++) {\n this.lastBytes[i] = this.lastBytes[i + nblen];\n }\n\n // add new bytes\n for (let i = 1; i <= nblen; i++) {\n this.lastBytes[lblen - i] = data[data.length - i];\n }\n }\n\n /**\n * Finds and removes message headers from the remaining body. We want to keep\n * headers separated until final delivery to be able to modify these\n *\n * @param {Buffer} data Next chunk of data\n * @return {Boolean} Returns true if headers are already found or false otherwise\n */\n checkHeaders(data) {\n if (this.headersParsed) {\n return true;\n }\n\n let lblen = this.lastBytes.length;\n let headerPos = 0;\n this.curLinePos = 0;\n for (let i = 0, len = this.lastBytes.length + data.length; i < len; i++) {\n let chr;\n if (i < lblen) {\n chr = this.lastBytes[i];\n } else {\n chr = data[i - lblen];\n }\n if (chr === 0x0a && i) {\n let pr1 = i - 1 < lblen ? this.lastBytes[i - 1] : data[i - 1 - lblen];\n let pr2 = i > 1 ? (i - 2 < lblen ? this.lastBytes[i - 2] : data[i - 2 - lblen]) : false;\n if (pr1 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n } else if (pr1 === 0x0d && pr2 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n }\n }\n }\n\n if (this.headersParsed) {\n this.headerChunks.push(data.slice(0, headerPos));\n this.rawHeaders = Buffer.concat(this.headerChunks, this.headerBytes);\n this.headerChunks = null;\n this.emit('headers', this.parseHeaders());\n if (data.length - 1 > headerPos) {\n let chunk = data.slice(headerPos);\n this.bodySize += chunk.length;\n // this would be the first chunk of data sent downstream\n setImmediate(() => this.push(chunk));\n }\n return false;\n } else {\n this.headerBytes += data.length;\n this.headerChunks.push(data);\n }\n\n // store last 4 bytes to catch header break\n this.updateLastBytes(data);\n\n return false;\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n let headersFound;\n\n try {\n headersFound = this.checkHeaders(chunk);\n } catch (E) {\n return callback(E);\n }\n\n if (headersFound) {\n this.bodySize += chunk.length;\n this.push(chunk);\n }\n\n setImmediate(callback);\n }\n\n _flush(callback) {\n if (this.headerChunks) {\n let chunk = Buffer.concat(this.headerChunks, this.headerBytes);\n this.bodySize += chunk.length;\n this.push(chunk);\n this.headerChunks = null;\n }\n callback();\n }\n\n parseHeaders() {\n let lines = (this.rawHeaders || '').toString().split(/\\r?\\n/);\n for (let i = lines.length - 1; i > 0; i--) {\n if (/^\\s/.test(lines[i])) {\n lines[i - 1] += '\\n' + lines[i];\n lines.splice(i, 1);\n }\n }\n return lines\n .filter(line => line.trim())\n .map(line => ({\n key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),\n line\n }));\n }\n}\n\nmodule.exports = MessageParser;\n","'use strict';\n\n// streams through a message body and calculates relaxed body hash\n\nconst Transform = require('stream').Transform;\nconst crypto = require('crypto');\n\nclass RelaxedBody extends Transform {\n constructor(options) {\n super();\n options = options || {};\n this.chunkBuffer = [];\n this.chunkBufferLen = 0;\n this.bodyHash = crypto.createHash(options.hashAlgo || 'sha1');\n this.remainder = '';\n this.byteLength = 0;\n\n this.debug = options.debug;\n this._debugBody = options.debug ? [] : false;\n }\n\n updateHash(chunk) {\n let bodyStr;\n\n // find next remainder\n let nextRemainder = '';\n\n // This crux finds and removes the spaces from the last line and the newline characters after the last non-empty line\n // If we get another chunk that does not match this description then we can restore the previously processed data\n let state = 'file';\n for (let i = chunk.length - 1; i >= 0; i--) {\n let c = chunk[i];\n\n if (state === 'file' && (c === 0x0a || c === 0x0d)) {\n // do nothing, found \\n or \\r at the end of chunk, stil end of file\n } else if (state === 'file' && (c === 0x09 || c === 0x20)) {\n // switch to line ending mode, this is the last non-empty line\n state = 'line';\n } else if (state === 'line' && (c === 0x09 || c === 0x20)) {\n // do nothing, found ' ' or \\t at the end of line, keep processing the last non-empty line\n } else if (state === 'file' || state === 'line') {\n // non line/file ending character found, switch to body mode\n state = 'body';\n if (i === chunk.length - 1) {\n // final char is not part of line end or file end, so do nothing\n break;\n }\n }\n\n if (i === 0) {\n // reached to the beginning of the chunk, check if it is still about the ending\n // and if the remainder also matches\n if (\n (state === 'file' && (!this.remainder || /[\\r\\n]$/.test(this.remainder))) ||\n (state === 'line' && (!this.remainder || /[ \\t]$/.test(this.remainder)))\n ) {\n // keep everything\n this.remainder += chunk.toString('binary');\n return;\n } else if (state === 'line' || state === 'file') {\n // process existing remainder as normal line but store the current chunk\n nextRemainder = chunk.toString('binary');\n chunk = false;\n break;\n }\n }\n\n if (state !== 'body') {\n continue;\n }\n\n // reached first non ending byte\n nextRemainder = chunk.slice(i + 1).toString('binary');\n chunk = chunk.slice(0, i + 1);\n break;\n }\n\n let needsFixing = !!this.remainder;\n if (chunk && !needsFixing) {\n // check if we even need to change anything\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (i && chunk[i] === 0x0a && chunk[i - 1] !== 0x0d) {\n // missing \\r before \\n\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x0d && chunk[i - 1] === 0x20) {\n // trailing WSP found\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x20 && chunk[i - 1] === 0x20) {\n // multiple spaces found, needs to be replaced with just one\n needsFixing = true;\n break;\n } else if (chunk[i] === 0x09) {\n // TAB found, needs to be replaced with a space\n needsFixing = true;\n break;\n }\n }\n }\n\n if (needsFixing) {\n bodyStr = this.remainder + (chunk ? chunk.toString('binary') : '');\n this.remainder = nextRemainder;\n bodyStr = bodyStr\n .replace(/\\r?\\n/g, '\\n') // use js line endings\n .replace(/[ \\t]*$/gm, '') // remove line endings, rtrim\n .replace(/[ \\t]+/gm, ' ') // single spaces\n .replace(/\\n/g, '\\r\\n'); // restore rfc822 line endings\n chunk = Buffer.from(bodyStr, 'binary');\n } else if (nextRemainder) {\n this.remainder = nextRemainder;\n }\n\n if (this.debug) {\n this._debugBody.push(chunk);\n }\n this.bodyHash.update(chunk);\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n this.updateHash(chunk);\n\n this.byteLength += chunk.length;\n this.push(chunk);\n callback();\n }\n\n _flush(callback) {\n // generate final hash and emit it\n if (/[\\r\\n]$/.test(this.remainder) && this.byteLength > 2) {\n // add terminating line end\n this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n if (!this.byteLength) {\n // emit empty line buffer to keep the stream flowing\n this.push(Buffer.from('\\r\\n'));\n // this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n\n this.emit('hash', this.bodyHash.digest('base64'), this.debug ? Buffer.concat(this._debugBody) : false);\n callback();\n }\n}\n\nmodule.exports = RelaxedBody;\n","'use strict';\n\nconst punycode = require('punycode');\nconst mimeFuncs = require('../mime-funcs');\nconst crypto = require('crypto');\n\n/**\n * Returns DKIM signature header line\n *\n * @param {Object} headers Parsed headers object from MessageParser\n * @param {String} bodyHash Base64 encoded hash of the message\n * @param {Object} options DKIM options\n * @param {String} options.domainName Domain name to be signed for\n * @param {String} options.keySelector DKIM key selector to use\n * @param {String} options.privateKey DKIM private key to use\n * @return {String} Complete header line\n */\n\nmodule.exports = (headers, hashAlgo, bodyHash, options) => {\n options = options || {};\n\n // all listed fields from RFC4871 #5.5\n let defaultFieldNames =\n 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +\n 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +\n 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +\n 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +\n 'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' +\n 'List-Owner:List-Archive';\n\n let fieldNames = options.headerFieldNames || defaultFieldNames;\n\n let canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);\n let dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash);\n\n let signer, signature;\n\n canonicalizedHeaderData.headers += 'dkim-signature:' + relaxedHeaderLine(dkimHeader);\n\n signer = crypto.createSign(('rsa-' + hashAlgo).toUpperCase());\n signer.update(canonicalizedHeaderData.headers);\n try {\n signature = signer.sign(options.privateKey, 'base64');\n } catch (E) {\n return false;\n }\n\n return dkimHeader + signature.replace(/(^.{73}|.{75}(?!\\r?\\n|\\r))/g, '$&\\r\\n ').trim();\n};\n\nmodule.exports.relaxedHeaders = relaxedHeaders;\n\nfunction generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyHash) {\n let dkim = [\n 'v=1',\n 'a=rsa-' + hashAlgo,\n 'c=relaxed/relaxed',\n 'd=' + punycode.toASCII(domainName),\n 'q=dns/txt',\n 's=' + keySelector,\n 'bh=' + bodyHash,\n 'h=' + fieldNames\n ].join('; ');\n\n return mimeFuncs.foldLines('DKIM-Signature: ' + dkim, 76) + ';\\r\\n b=';\n}\n\nfunction relaxedHeaders(headers, fieldNames, skipFields) {\n let includedFields = new Set();\n let skip = new Set();\n let headerFields = new Map();\n\n (skipFields || '')\n .toLowerCase()\n .split(':')\n .forEach(field => {\n skip.add(field.trim());\n });\n\n (fieldNames || '')\n .toLowerCase()\n .split(':')\n .filter(field => !skip.has(field.trim()))\n .forEach(field => {\n includedFields.add(field.trim());\n });\n\n for (let i = headers.length - 1; i >= 0; i--) {\n let line = headers[i];\n // only include the first value from bottom to top\n if (includedFields.has(line.key) && !headerFields.has(line.key)) {\n headerFields.set(line.key, relaxedHeaderLine(line.line));\n }\n }\n\n let headersList = [];\n let fields = [];\n includedFields.forEach(field => {\n if (headerFields.has(field)) {\n fields.push(field);\n headersList.push(field + ':' + headerFields.get(field));\n }\n });\n\n return {\n headers: headersList.join('\\r\\n') + '\\r\\n',\n fieldNames: fields.join(':')\n };\n}\n\nfunction relaxedHeaderLine(line) {\n return line\n .substr(line.indexOf(':') + 1)\n .replace(/\\r?\\n/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n","'use strict';\n\n// module to handle cookies\n\nconst urllib = require('url');\n\nconst SESSION_TIMEOUT = 1800; // 30 min\n\n/**\n * Creates a biskviit cookie jar for managing cookie values in memory\n *\n * @constructor\n * @param {Object} [options] Optional options object\n */\nclass Cookies {\n constructor(options) {\n this.options = options || {};\n this.cookies = [];\n }\n\n /**\n * Stores a cookie string to the cookie storage\n *\n * @param {String} cookieStr Value from the 'Set-Cookie:' header\n * @param {String} url Current URL\n */\n set(cookieStr, url) {\n let urlparts = urllib.parse(url || '');\n let cookie = this.parse(cookieStr);\n let domain;\n\n if (cookie.domain) {\n domain = cookie.domain.replace(/^\\./, '');\n\n // do not allow cross origin cookies\n if (\n // can't be valid if the requested domain is shorter than current hostname\n urlparts.hostname.length < domain.length ||\n // prefix domains with dot to be sure that partial matches are not used\n ('.' + urlparts.hostname).substr(-domain.length + 1) !== '.' + domain\n ) {\n cookie.domain = urlparts.hostname;\n }\n } else {\n cookie.domain = urlparts.hostname;\n }\n\n if (!cookie.path) {\n cookie.path = this.getPath(urlparts.pathname);\n }\n\n // if no expire date, then use sessionTimeout value\n if (!cookie.expires) {\n cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000);\n }\n\n return this.add(cookie);\n }\n\n /**\n * Returns cookie string for the 'Cookie:' header.\n *\n * @param {String} url URL to check for\n * @returns {String} Cookie header or empty string if no matches were found\n */\n get(url) {\n return this.list(url)\n .map(cookie => cookie.name + '=' + cookie.value)\n .join('; ');\n }\n\n /**\n * Lists all valied cookie objects for the specified URL\n *\n * @param {String} url URL to check for\n * @returns {Array} An array of cookie objects\n */\n list(url) {\n let result = [];\n let i;\n let cookie;\n\n for (i = this.cookies.length - 1; i >= 0; i--) {\n cookie = this.cookies[i];\n\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, i);\n continue;\n }\n\n if (this.match(cookie, url)) {\n result.unshift(cookie);\n }\n }\n\n return result;\n }\n\n /**\n * Parses cookie string from the 'Set-Cookie:' header\n *\n * @param {String} cookieStr String from the 'Set-Cookie:' header\n * @returns {Object} Cookie object\n */\n parse(cookieStr) {\n let cookie = {};\n\n (cookieStr || '')\n .toString()\n .split(';')\n .forEach(cookiePart => {\n let valueParts = cookiePart.split('=');\n let key = valueParts.shift().trim().toLowerCase();\n let value = valueParts.join('=').trim();\n let domain;\n\n if (!key) {\n // skip empty parts\n return;\n }\n\n switch (key) {\n case 'expires':\n value = new Date(value);\n // ignore date if can not parse it\n if (value.toString() !== 'Invalid Date') {\n cookie.expires = value;\n }\n break;\n\n case 'path':\n cookie.path = value;\n break;\n\n case 'domain':\n domain = value.toLowerCase();\n if (domain.length && domain.charAt(0) !== '.') {\n domain = '.' + domain; // ensure preceeding dot for user set domains\n }\n cookie.domain = domain;\n break;\n\n case 'max-age':\n cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);\n break;\n\n case 'secure':\n cookie.secure = true;\n break;\n\n case 'httponly':\n cookie.httponly = true;\n break;\n\n default:\n if (!cookie.name) {\n cookie.name = key;\n cookie.value = value;\n }\n }\n });\n\n return cookie;\n }\n\n /**\n * Checks if a cookie object is valid for a specified URL\n *\n * @param {Object} cookie Cookie object\n * @param {String} url URL to check for\n * @returns {Boolean} true if cookie is valid for specifiec URL\n */\n match(cookie, url) {\n let urlparts = urllib.parse(url || '');\n\n // check if hostname matches\n // .foo.com also matches subdomains, foo.com does not\n if (\n urlparts.hostname !== cookie.domain &&\n (cookie.domain.charAt(0) !== '.' || ('.' + urlparts.hostname).substr(-cookie.domain.length) !== cookie.domain)\n ) {\n return false;\n }\n\n // check if path matches\n let path = this.getPath(urlparts.pathname);\n if (path.substr(0, cookie.path.length) !== cookie.path) {\n return false;\n }\n\n // check secure argument\n if (cookie.secure && urlparts.protocol !== 'https:') {\n return false;\n }\n\n return true;\n }\n\n /**\n * Adds (or updates/removes if needed) a cookie object to the cookie storage\n *\n * @param {Object} cookie Cookie value to be stored\n */\n add(cookie) {\n let i;\n let len;\n\n // nothing to do here\n if (!cookie || !cookie.name) {\n return false;\n }\n\n // overwrite if has same params\n for (i = 0, len = this.cookies.length; i < len; i++) {\n if (this.compare(this.cookies[i], cookie)) {\n // check if the cookie needs to be removed instead\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, 1); // remove expired/unset cookie\n return false;\n }\n\n this.cookies[i] = cookie;\n return true;\n }\n }\n\n // add as new if not already expired\n if (!this.isExpired(cookie)) {\n this.cookies.push(cookie);\n }\n\n return true;\n }\n\n /**\n * Checks if two cookie objects are the same\n *\n * @param {Object} a Cookie to check against\n * @param {Object} b Cookie to check against\n * @returns {Boolean} True, if the cookies are the same\n */\n compare(a, b) {\n return a.name === b.name && a.path === b.path && a.domain === b.domain && a.secure === b.secure && a.httponly === a.httponly;\n }\n\n /**\n * Checks if a cookie is expired\n *\n * @param {Object} cookie Cookie object to check against\n * @returns {Boolean} True, if the cookie is expired\n */\n isExpired(cookie) {\n return (cookie.expires && cookie.expires < new Date()) || !cookie.value;\n }\n\n /**\n * Returns normalized cookie path for an URL path argument\n *\n * @param {String} pathname\n * @returns {String} Normalized path\n */\n getPath(pathname) {\n let path = (pathname || '/').split('/');\n path.pop(); // remove filename part\n path = path.join('/').trim();\n\n // ensure path prefix /\n if (path.charAt(0) !== '/') {\n path = '/' + path;\n }\n\n // ensure path suffix /\n if (path.substr(-1) !== '/') {\n path += '/';\n }\n\n return path;\n }\n}\n\nmodule.exports = Cookies;\n","'use strict';\n\nconst http = require('http');\nconst https = require('https');\nconst urllib = require('url');\nconst zlib = require('zlib');\nconst PassThrough = require('stream').PassThrough;\nconst Cookies = require('./cookies');\nconst packageData = require('../../package.json');\n\nconst MAX_REDIRECTS = 5;\n\nmodule.exports = function (url, options) {\n return nmfetch(url, options);\n};\n\nmodule.exports.Cookies = Cookies;\n\nfunction nmfetch(url, options) {\n options = options || {};\n\n options.fetchRes = options.fetchRes || new PassThrough();\n options.cookies = options.cookies || new Cookies();\n options.redirects = options.redirects || 0;\n options.maxRedirects = isNaN(options.maxRedirects) ? MAX_REDIRECTS : options.maxRedirects;\n\n if (options.cookie) {\n [].concat(options.cookie || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n options.cookie = false;\n }\n\n let fetchRes = options.fetchRes;\n let parsed = urllib.parse(url);\n let method = (options.method || '').toString().trim().toUpperCase() || 'GET';\n let finished = false;\n let cookies;\n let body;\n\n let handler = parsed.protocol === 'https:' ? https : http;\n\n let headers = {\n 'accept-encoding': 'gzip,deflate',\n 'user-agent': 'nodemailer/' + packageData.version\n };\n\n Object.keys(options.headers || {}).forEach(key => {\n headers[key.toLowerCase().trim()] = options.headers[key];\n });\n\n if (options.userAgent) {\n headers['user-agent'] = options.userAgent;\n }\n\n if (parsed.auth) {\n headers.Authorization = 'Basic ' + Buffer.from(parsed.auth).toString('base64');\n }\n\n if ((cookies = options.cookies.get(url))) {\n headers.cookie = cookies;\n }\n\n if (options.body) {\n if (options.contentType !== false) {\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n }\n\n if (typeof options.body.pipe === 'function') {\n // it's a stream\n headers['Transfer-Encoding'] = 'chunked';\n body = options.body;\n body.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n } else {\n if (options.body instanceof Buffer) {\n body = options.body;\n } else if (typeof options.body === 'object') {\n try {\n // encodeURIComponent can fail on invalid input (partial emoji etc.)\n body = Buffer.from(\n Object.keys(options.body)\n .map(key => {\n let value = options.body[key].toString().trim();\n return encodeURIComponent(key) + '=' + encodeURIComponent(value);\n })\n .join('&')\n );\n } catch (E) {\n if (finished) {\n return;\n }\n finished = true;\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n return;\n }\n } else {\n body = Buffer.from(options.body.toString().trim());\n }\n\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n headers['Content-Length'] = body.length;\n }\n // if method is not provided, use POST instead of GET\n method = (options.method || '').toString().trim().toUpperCase() || 'POST';\n }\n\n let req;\n let reqOptions = {\n method,\n host: parsed.hostname,\n path: parsed.path,\n port: parsed.port ? parsed.port : parsed.protocol === 'https:' ? 443 : 80,\n headers,\n rejectUnauthorized: false,\n agent: false\n };\n\n if (options.tls) {\n Object.keys(options.tls).forEach(key => {\n reqOptions[key] = options.tls[key];\n });\n }\n\n try {\n req = handler.request(reqOptions);\n } catch (E) {\n finished = true;\n setImmediate(() => {\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n });\n return fetchRes;\n }\n\n if (options.timeout) {\n req.setTimeout(options.timeout, () => {\n if (finished) {\n return;\n }\n finished = true;\n req.abort();\n let err = new Error('Request Timeout');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n }\n\n req.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n\n req.on('response', res => {\n let inflate;\n\n if (finished) {\n return;\n }\n\n switch (res.headers['content-encoding']) {\n case 'gzip':\n case 'deflate':\n inflate = zlib.createUnzip();\n break;\n }\n\n if (res.headers['set-cookie']) {\n [].concat(res.headers['set-cookie'] || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n }\n\n if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location) {\n // redirect\n options.redirects++;\n if (options.redirects > options.maxRedirects) {\n finished = true;\n let err = new Error('Maximum redirect count exceeded');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n // redirect does not include POST body\n options.method = 'GET';\n options.body = false;\n return nmfetch(urllib.resolve(url, res.headers.location), options);\n }\n\n fetchRes.statusCode = res.statusCode;\n fetchRes.headers = res.headers;\n\n if (res.statusCode >= 300 && !options.allowErrorResponse) {\n finished = true;\n let err = new Error('Invalid status code ' + res.statusCode);\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n\n res.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n\n if (inflate) {\n res.pipe(inflate).pipe(fetchRes);\n inflate.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n } else {\n res.pipe(fetchRes);\n }\n });\n\n setImmediate(() => {\n if (body) {\n try {\n if (typeof body.pipe === 'function') {\n return body.pipe(req);\n } else {\n req.write(body);\n }\n } catch (err) {\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n return;\n }\n }\n req.end();\n });\n\n return fetchRes;\n}\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object to generate JSON output\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass JSONTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'JSONTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'json-transport'\n });\n }\n\n /**\n *

Compiles a mailcomposer message and forwards it to handler that sends it.

\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Composing JSON structure of %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n setImmediate(() => {\n mail.normalize((err, data) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed building JSON structure for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n }\n\n delete data.envelope;\n delete data.normalizedHeaders;\n\n return done(null, {\n envelope,\n messageId,\n message: this.options.skipEncoding ? data : JSON.stringify(data)\n });\n });\n });\n }\n}\n\nmodule.exports = JSONTransport;\n","/* eslint no-undefined: 0 */\n\n'use strict';\n\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\n\n/**\n * Creates the object for composing a MimeNode instance out from the mail options\n *\n * @constructor\n * @param {Object} mail Mail options\n */\nclass MailComposer {\n constructor(mail) {\n this.mail = mail || {};\n this.message = false;\n }\n\n /**\n * Builds MimeNode instance\n */\n compile() {\n this._alternatives = this.getAlternatives();\n this._htmlNode = this._alternatives.filter(alternative => /^text\\/html\\b/i.test(alternative.contentType)).pop();\n this._attachments = this.getAttachments(!!this._htmlNode);\n\n this._useRelated = !!(this._htmlNode && this._attachments.related.length);\n this._useAlternative = this._alternatives.length > 1;\n this._useMixed = this._attachments.attached.length > 1 || (this._alternatives.length && this._attachments.attached.length === 1);\n\n // Compose MIME tree\n if (this.mail.raw) {\n this.message = new MimeNode('message/rfc822', { newline: this.mail.newline }).setRaw(this.mail.raw);\n } else if (this._useMixed) {\n this.message = this._createMixed();\n } else if (this._useAlternative) {\n this.message = this._createAlternative();\n } else if (this._useRelated) {\n this.message = this._createRelated();\n } else {\n this.message = this._createContentNode(\n false,\n []\n .concat(this._alternatives || [])\n .concat(this._attachments.attached || [])\n .shift() || {\n contentType: 'text/plain',\n content: ''\n }\n );\n }\n\n // Add custom headers\n if (this.mail.headers) {\n this.message.addHeader(this.mail.headers);\n }\n\n // Add headers to the root node, always overrides custom headers\n ['from', 'sender', 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'message-id', 'date'].forEach(header => {\n let key = header.replace(/-(\\w)/g, (o, c) => c.toUpperCase());\n if (this.mail[key]) {\n this.message.setHeader(header, this.mail[key]);\n }\n });\n\n // Sets custom envelope\n if (this.mail.envelope) {\n this.message.setEnvelope(this.mail.envelope);\n }\n\n // ensure Message-Id value\n this.message.messageId();\n\n return this.message;\n }\n\n /**\n * List all attachments. Resulting attachment objects can be used as input for MimeNode nodes\n *\n * @param {Boolean} findRelated If true separate related attachments from attached ones\n * @returns {Object} An object of arrays (`related` and `attached`)\n */\n getAttachments(findRelated) {\n let icalEvent, eventObject;\n let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {\n let data;\n let isMessageNode = /^message\\//i.test(attachment.contentType);\n\n if (/^data:/i.test(attachment.path || attachment.href)) {\n attachment = this._processDataUrl(attachment);\n }\n\n data = {\n contentType: attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin'),\n contentDisposition: attachment.contentDisposition || (isMessageNode ? 'inline' : 'attachment'),\n contentTransferEncoding: 'contentTransferEncoding' in attachment ? attachment.contentTransferEncoding : 'base64'\n };\n\n if (attachment.filename) {\n data.filename = attachment.filename;\n } else if (!isMessageNode && attachment.filename !== false) {\n data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (data.filename.indexOf('.') < 0) {\n data.filename += '.' + mimeFuncs.detectExtension(data.contentType);\n }\n }\n\n if (/^https?:\\/\\//i.test(attachment.path)) {\n attachment.href = attachment.path;\n attachment.path = undefined;\n }\n\n if (attachment.cid) {\n data.cid = attachment.cid;\n }\n\n if (attachment.raw) {\n data.raw = attachment.raw;\n } else if (attachment.path) {\n data.content = {\n path: attachment.path\n };\n } else if (attachment.href) {\n data.content = {\n href: attachment.href,\n httpHeaders: attachment.httpHeaders\n };\n } else {\n data.content = attachment.content || '';\n }\n\n if (attachment.encoding) {\n data.encoding = attachment.encoding;\n }\n\n if (attachment.headers) {\n data.headers = attachment.headers;\n }\n\n return data;\n });\n\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n eventObject.contentType = 'application/ics';\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n eventObject.filename = eventObject.filename || 'invite.ics';\n eventObject.headers['Content-Disposition'] = 'attachment';\n eventObject.headers['Content-Transfer-Encoding'] = 'base64';\n }\n\n if (!findRelated) {\n return {\n attached: attachments.concat(eventObject || []),\n related: []\n };\n } else {\n return {\n attached: attachments.filter(attachment => !attachment.cid).concat(eventObject || []),\n related: attachments.filter(attachment => !!attachment.cid)\n };\n }\n }\n\n /**\n * List alternatives. Resulting objects can be used as input for MimeNode nodes\n *\n * @returns {Array} An array of alternative elements. Includes the `text` and `html` values as well\n */\n getAlternatives() {\n let alternatives = [],\n text,\n html,\n watchHtml,\n amp,\n icalEvent,\n eventObject;\n\n if (this.mail.text) {\n if (typeof this.mail.text === 'object' && (this.mail.text.content || this.mail.text.path || this.mail.text.href || this.mail.text.raw)) {\n text = this.mail.text;\n } else {\n text = {\n content: this.mail.text\n };\n }\n text.contentType = 'text/plain; charset=utf-8';\n }\n\n if (this.mail.watchHtml) {\n if (\n typeof this.mail.watchHtml === 'object' &&\n (this.mail.watchHtml.content || this.mail.watchHtml.path || this.mail.watchHtml.href || this.mail.watchHtml.raw)\n ) {\n watchHtml = this.mail.watchHtml;\n } else {\n watchHtml = {\n content: this.mail.watchHtml\n };\n }\n watchHtml.contentType = 'text/watch-html; charset=utf-8';\n }\n\n if (this.mail.amp) {\n if (typeof this.mail.amp === 'object' && (this.mail.amp.content || this.mail.amp.path || this.mail.amp.href || this.mail.amp.raw)) {\n amp = this.mail.amp;\n } else {\n amp = {\n content: this.mail.amp\n };\n }\n amp.contentType = 'text/x-amp-html; charset=utf-8';\n }\n\n // NB! when including attachments with a calendar alternative you might end up in a blank screen on some clients\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n if (eventObject.content && typeof eventObject.content === 'object') {\n // we are going to have the same attachment twice, so mark this to be\n // resolved just once\n eventObject.content._resolve = true;\n }\n\n eventObject.filename = false;\n eventObject.contentType = 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n }\n\n if (this.mail.html) {\n if (typeof this.mail.html === 'object' && (this.mail.html.content || this.mail.html.path || this.mail.html.href || this.mail.html.raw)) {\n html = this.mail.html;\n } else {\n html = {\n content: this.mail.html\n };\n }\n html.contentType = 'text/html; charset=utf-8';\n }\n\n []\n .concat(text || [])\n .concat(watchHtml || [])\n .concat(amp || [])\n .concat(html || [])\n .concat(eventObject || [])\n .concat(this.mail.alternatives || [])\n .forEach(alternative => {\n let data;\n\n if (/^data:/i.test(alternative.path || alternative.href)) {\n alternative = this._processDataUrl(alternative);\n }\n\n data = {\n contentType: alternative.contentType || mimeFuncs.detectMimeType(alternative.filename || alternative.path || alternative.href || 'txt'),\n contentTransferEncoding: alternative.contentTransferEncoding\n };\n\n if (alternative.filename) {\n data.filename = alternative.filename;\n }\n\n if (/^https?:\\/\\//i.test(alternative.path)) {\n alternative.href = alternative.path;\n alternative.path = undefined;\n }\n\n if (alternative.raw) {\n data.raw = alternative.raw;\n } else if (alternative.path) {\n data.content = {\n path: alternative.path\n };\n } else if (alternative.href) {\n data.content = {\n href: alternative.href\n };\n } else {\n data.content = alternative.content || '';\n }\n\n if (alternative.encoding) {\n data.encoding = alternative.encoding;\n }\n\n if (alternative.headers) {\n data.headers = alternative.headers;\n }\n\n alternatives.push(data);\n });\n\n return alternatives;\n }\n\n /**\n * Builds multipart/mixed node. It should always contain different type of elements on the same level\n * eg. text + attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createMixed(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/mixed', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/mixed', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n if (this._useAlternative) {\n this._createAlternative(node);\n } else if (this._useRelated) {\n this._createRelated(node);\n }\n\n []\n .concat((!this._useAlternative && this._alternatives) || [])\n .concat(this._attachments.attached || [])\n .forEach(element => {\n // if the element is a html node from related subpart then ignore it\n if (!this._useRelated || element !== this._htmlNode) {\n this._createContentNode(node, element);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/alternative node. It should always contain same type of elements on the same level\n * eg. text + html view of the same data\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createAlternative(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/alternative', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/alternative', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._alternatives.forEach(alternative => {\n if (this._useRelated && this._htmlNode === alternative) {\n this._createRelated(node);\n } else {\n this._createContentNode(node, alternative);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/related node. It should always contain html node with related attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createRelated(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/related; type=\"text/html\"', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/related; type=\"text/html\"', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._createContentNode(node, this._htmlNode);\n\n this._attachments.related.forEach(alternative => this._createContentNode(node, alternative));\n\n return node;\n }\n\n /**\n * Creates a regular node with contents\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @param {Object} element Node data\n * @returns {Object} MimeNode node element\n */\n _createContentNode(parentNode, element) {\n element = element || {};\n element.content = element.content || '';\n\n let node;\n let encoding = (element.encoding || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!parentNode) {\n node = new MimeNode(element.contentType, {\n filename: element.filename,\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild(element.contentType, {\n filename: element.filename,\n textEncoding: this.mail.textEncoding,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n // add custom headers\n if (element.headers) {\n node.addHeader(element.headers);\n }\n\n if (element.cid) {\n node.setHeader('Content-Id', '<' + element.cid.replace(/[<>]/g, '') + '>');\n }\n\n if (element.contentTransferEncoding) {\n node.setHeader('Content-Transfer-Encoding', element.contentTransferEncoding);\n } else if (this.mail.encoding && /^text\\//i.test(element.contentType)) {\n node.setHeader('Content-Transfer-Encoding', this.mail.encoding);\n }\n\n if (!/^text\\//i.test(element.contentType) || element.contentDisposition) {\n node.setHeader('Content-Disposition', element.contentDisposition || (element.cid ? 'inline' : 'attachment'));\n }\n\n if (typeof element.content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n element.content = Buffer.from(element.content, encoding);\n }\n\n // prefer pregenerated raw content\n if (element.raw) {\n node.setRaw(element.raw);\n } else {\n node.setContent(element.content);\n }\n\n return node;\n }\n\n /**\n * Parses data uri and converts it to a Buffer\n *\n * @param {Object} element Content element\n * @return {Object} Parsed element\n */\n _processDataUrl(element) {\n let parts = (element.path || element.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);\n if (!parts) {\n return element;\n }\n\n element.content = /\\bbase64$/i.test(parts[1]) ? Buffer.from(parts[2], 'base64') : Buffer.from(decodeURIComponent(parts[2]));\n\n if ('path' in element) {\n element.path = false;\n }\n\n if ('href' in element) {\n element.href = false;\n }\n\n parts[1].split(';').forEach(item => {\n if (/^\\w+\\/[^/]+$/i.test(item)) {\n element.contentType = element.contentType || item.toLowerCase();\n }\n });\n\n return element;\n }\n}\n\nmodule.exports = MailComposer;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst shared = require('../shared');\nconst mimeTypes = require('../mime-funcs/mime-types');\nconst MailComposer = require('../mail-composer');\nconst DKIM = require('../dkim');\nconst httpProxyClient = require('../smtp-connection/http-proxy-client');\nconst util = require('util');\nconst urllib = require('url');\nconst packageData = require('../../package.json');\nconst MailMessage = require('./mail-message');\nconst net = require('net');\nconst dns = require('dns');\nconst crypto = require('crypto');\n\n/**\n * Creates an object for exposing the Mail API\n *\n * @constructor\n * @param {Object} transporter Transport object instance to pass the mails to\n */\nclass Mail extends EventEmitter {\n constructor(transporter, options, defaults) {\n super();\n\n this.options = options || {};\n this._defaults = defaults || {};\n\n this._defaultPlugins = {\n compile: [(...args) => this._convertDataImages(...args)],\n stream: []\n };\n\n this._userPlugins = {\n compile: [],\n stream: []\n };\n\n this.meta = new Map();\n\n this.dkim = this.options.dkim ? new DKIM(this.options.dkim) : false;\n\n this.transporter = transporter;\n this.transporter.mailer = this;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'mail'\n });\n\n this.logger.debug(\n {\n tnx: 'create'\n },\n 'Creating transport: %s',\n this.getVersionString()\n );\n\n // setup emit handlers for the transporter\n if (typeof this.transporter.on === 'function') {\n // deprecated log interface\n this.transporter.on('log', log => {\n this.logger.debug(\n {\n tnx: 'transport'\n },\n '%s: %s',\n log.type,\n log.message\n );\n });\n\n // transporter errors\n this.transporter.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'transport'\n },\n 'Transport Error: %s',\n err.message\n );\n this.emit('error', err);\n });\n\n // indicates if the sender has became idle\n this.transporter.on('idle', (...args) => {\n this.emit('idle', ...args);\n });\n }\n\n /**\n * Optional methods passed to the underlying transport object\n */\n ['close', 'isIdle', 'verify'].forEach(method => {\n this[method] = (...args) => {\n if (typeof this.transporter[method] === 'function') {\n if (method === 'verify' && typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n return this.transporter[method](...args);\n } else {\n this.logger.warn(\n {\n tnx: 'transport',\n methodName: method\n },\n 'Non existing method %s called for transport',\n method\n );\n return false;\n }\n };\n });\n\n // setup proxy handling\n if (this.options.proxy && typeof this.options.proxy === 'string') {\n this.setupProxy(this.options.proxy);\n }\n }\n\n use(step, plugin) {\n step = (step || '').toString();\n if (!this._userPlugins.hasOwnProperty(step)) {\n this._userPlugins[step] = [plugin];\n } else {\n this._userPlugins[step].push(plugin);\n }\n\n return this;\n }\n\n /**\n * Sends an email using the preselected transport object\n *\n * @param {Object} data E-data description\n * @param {Function?} callback Callback to run once the sending succeeded or failed\n */\n sendMail(data, callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n\n let mail = new MailMessage(this, data);\n\n this.logger.debug(\n {\n tnx: 'transport',\n name: this.transporter.name,\n version: this.transporter.version,\n action: 'send'\n },\n 'Sending mail using %s/%s',\n this.transporter.name,\n this.transporter.version\n );\n\n this._processPlugins('compile', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'compile'\n },\n 'PluginCompile Error: %s',\n err.message\n );\n return callback(err);\n }\n\n mail.message = new MailComposer(mail.data).compile();\n\n mail.setMailerHeader();\n mail.setPriorityHeaders();\n mail.setListHeaders();\n\n this._processPlugins('stream', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'stream'\n },\n 'PluginStream Error: %s',\n err.message\n );\n return callback(err);\n }\n\n if (mail.data.dkim || this.dkim) {\n mail.message.processFunc(input => {\n let dkim = mail.data.dkim ? new DKIM(mail.data.dkim) : this.dkim;\n this.logger.debug(\n {\n tnx: 'DKIM',\n messageId: mail.message.messageId(),\n dkimDomains: dkim.keys.map(key => key.keySelector + '.' + key.domainName).join(', ')\n },\n 'Signing outgoing message with %s keys',\n dkim.keys.length\n );\n return dkim.sign(input, mail.data._dkim);\n });\n }\n\n this.transporter.send(mail, (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'transport',\n action: 'send'\n },\n 'Send Error: %s',\n args[0].message\n );\n }\n callback(...args);\n });\n });\n });\n\n return promise;\n }\n\n getVersionString() {\n return util.format('%s (%s; +%s; %s/%s)', packageData.name, packageData.version, packageData.homepage, this.transporter.name, this.transporter.version);\n }\n\n _processPlugins(step, mail, callback) {\n step = (step || '').toString();\n\n if (!this._userPlugins.hasOwnProperty(step)) {\n return callback();\n }\n\n let userPlugins = this._userPlugins[step] || [];\n let defaultPlugins = this._defaultPlugins[step] || [];\n\n if (userPlugins.length) {\n this.logger.debug(\n {\n tnx: 'transaction',\n pluginCount: userPlugins.length,\n step\n },\n 'Using %s plugins for %s',\n userPlugins.length,\n step\n );\n }\n\n if (userPlugins.length + defaultPlugins.length === 0) {\n return callback();\n }\n\n let pos = 0;\n let block = 'default';\n let processPlugins = () => {\n let curplugins = block === 'default' ? defaultPlugins : userPlugins;\n if (pos >= curplugins.length) {\n if (block === 'default' && userPlugins.length) {\n block = 'user';\n pos = 0;\n curplugins = userPlugins;\n } else {\n return callback();\n }\n }\n let plugin = curplugins[pos++];\n plugin(mail, err => {\n if (err) {\n return callback(err);\n }\n processPlugins();\n });\n };\n\n processPlugins();\n }\n\n /**\n * Sets up proxy handler for a Nodemailer object\n *\n * @param {String} proxyUrl Proxy configuration url\n */\n setupProxy(proxyUrl) {\n let proxy = urllib.parse(proxyUrl);\n\n // setup socket handler for the mailer object\n this.getSocket = (options, callback) => {\n let protocol = proxy.protocol.replace(/:$/, '').toLowerCase();\n\n if (this.meta.has('proxy_handler_' + protocol)) {\n return this.meta.get('proxy_handler_' + protocol)(proxy, options, callback);\n }\n\n switch (protocol) {\n // Connect using a HTTP CONNECT method\n case 'http':\n case 'https':\n httpProxyClient(proxy.href, options.port, options.host, (err, socket) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: socket\n });\n });\n return;\n case 'socks':\n case 'socks5':\n case 'socks4':\n case 'socks4a': {\n if (!this.meta.has('proxy_socks_module')) {\n return callback(new Error('Socks module not loaded'));\n }\n let connect = ipaddress => {\n let proxyV2 = !!this.meta.get('proxy_socks_module').SocksClient;\n let socksClient = proxyV2 ? this.meta.get('proxy_socks_module').SocksClient : this.meta.get('proxy_socks_module');\n let proxyType = Number(proxy.protocol.replace(/\\D/g, '')) || 5;\n let connectionOpts = {\n proxy: {\n ipaddress,\n port: Number(proxy.port),\n type: proxyType\n },\n [proxyV2 ? 'destination' : 'target']: {\n host: options.host,\n port: options.port\n },\n command: 'connect'\n };\n\n if (proxy.auth) {\n let username = decodeURIComponent(proxy.auth.split(':').shift());\n let password = decodeURIComponent(proxy.auth.split(':').pop());\n if (proxyV2) {\n connectionOpts.proxy.userId = username;\n connectionOpts.proxy.password = password;\n } else if (proxyType === 4) {\n connectionOpts.userid = username;\n } else {\n connectionOpts.authentication = {\n username,\n password\n };\n }\n }\n\n socksClient.createConnection(connectionOpts, (err, info) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: info.socket || info\n });\n });\n };\n\n if (net.isIP(proxy.hostname)) {\n return connect(proxy.hostname);\n }\n\n return dns.resolve(proxy.hostname, (err, address) => {\n if (err) {\n return callback(err);\n }\n connect(Array.isArray(address) ? address[0] : address);\n });\n }\n }\n callback(new Error('Unknown proxy configuration'));\n };\n }\n\n _convertDataImages(mail, callback) {\n if ((!this.options.attachDataUrls && !mail.data.attachDataUrls) || !mail.data.html) {\n return callback();\n }\n mail.resolveContent(mail.data, 'html', (err, html) => {\n if (err) {\n return callback(err);\n }\n let cidCounter = 0;\n html = (html || '').toString().replace(/(]* src\\s*=[\\s\"']*)(data:([^;]+);[^\"'>\\s]+)/gi, (match, prefix, dataUri, mimeType) => {\n let cid = crypto.randomBytes(10).toString('hex') + '@localhost';\n if (!mail.data.attachments) {\n mail.data.attachments = [];\n }\n if (!Array.isArray(mail.data.attachments)) {\n mail.data.attachments = [].concat(mail.data.attachments || []);\n }\n mail.data.attachments.push({\n path: dataUri,\n cid,\n filename: 'image-' + ++cidCounter + '.' + mimeTypes.detectExtension(mimeType)\n });\n return prefix + 'cid:' + cid;\n });\n mail.data.html = html;\n callback();\n });\n }\n\n set(key, value) {\n return this.meta.set(key, value);\n }\n\n get(key) {\n return this.meta.get(key);\n }\n}\n\nmodule.exports = Mail;\n","'use strict';\n\nconst shared = require('../shared');\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\n\nclass MailMessage {\n constructor(mailer, data) {\n this.mailer = mailer;\n this.data = {};\n this.message = null;\n\n data = data || {};\n let options = mailer.options || {};\n let defaults = mailer._defaults || {};\n\n Object.keys(data).forEach(key => {\n this.data[key] = data[key];\n });\n\n this.data.headers = this.data.headers || {};\n\n // apply defaults\n Object.keys(defaults).forEach(key => {\n if (!(key in this.data)) {\n this.data[key] = defaults[key];\n } else if (key === 'headers') {\n // headers is a special case. Allow setting individual default headers\n Object.keys(defaults.headers).forEach(key => {\n if (!(key in this.data.headers)) {\n this.data.headers[key] = defaults.headers[key];\n }\n });\n }\n });\n\n // force specific keys from transporter options\n ['disableFileAccess', 'disableUrlAccess', 'normalizeHeaderKey'].forEach(key => {\n if (key in options) {\n this.data[key] = options[key];\n }\n });\n }\n\n resolveContent(...args) {\n return shared.resolveContent(...args);\n }\n\n resolveAll(callback) {\n let keys = [\n [this.data, 'html'],\n [this.data, 'text'],\n [this.data, 'watchHtml'],\n [this.data, 'amp'],\n [this.data, 'icalEvent']\n ];\n\n if (this.data.alternatives && this.data.alternatives.length) {\n this.data.alternatives.forEach((alternative, i) => {\n keys.push([this.data.alternatives, i]);\n });\n }\n\n if (this.data.attachments && this.data.attachments.length) {\n this.data.attachments.forEach((attachment, i) => {\n if (!attachment.filename) {\n attachment.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (attachment.filename.indexOf('.') < 0) {\n attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);\n }\n }\n\n if (!attachment.contentType) {\n attachment.contentType = mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');\n }\n\n keys.push([this.data.attachments, i]);\n });\n }\n\n let mimeNode = new MimeNode();\n\n let addressKeys = ['from', 'to', 'cc', 'bcc', 'sender', 'replyTo'];\n\n addressKeys.forEach(address => {\n let value;\n if (this.message) {\n value = [].concat(mimeNode._parseAddresses(this.message.getHeader(address === 'replyTo' ? 'reply-to' : address)) || []);\n } else if (this.data[address]) {\n value = [].concat(mimeNode._parseAddresses(this.data[address]) || []);\n }\n if (value && value.length) {\n this.data[address] = value;\n } else if (address in this.data) {\n this.data[address] = null;\n }\n });\n\n let singleKeys = ['from', 'sender'];\n singleKeys.forEach(address => {\n if (this.data[address]) {\n this.data[address] = this.data[address].shift();\n }\n });\n\n let pos = 0;\n let resolveNext = () => {\n if (pos >= keys.length) {\n return callback(null, this.data);\n }\n let args = keys[pos++];\n if (!args[0] || !args[0][args[1]]) {\n return resolveNext();\n }\n shared.resolveContent(...args, (err, value) => {\n if (err) {\n return callback(err);\n }\n\n let node = {\n content: value\n };\n if (args[0][args[1]] && typeof args[0][args[1]] === 'object' && !Buffer.isBuffer(args[0][args[1]])) {\n Object.keys(args[0][args[1]]).forEach(key => {\n if (!(key in node) && !['content', 'path', 'href', 'raw'].includes(key)) {\n node[key] = args[0][args[1]][key];\n }\n });\n }\n\n args[0][args[1]] = node;\n resolveNext();\n });\n };\n\n setImmediate(() => resolveNext());\n }\n\n normalize(callback) {\n let envelope = this.data.envelope || this.message.getEnvelope();\n let messageId = this.message.messageId();\n\n this.resolveAll((err, data) => {\n if (err) {\n return callback(err);\n }\n\n data.envelope = envelope;\n data.messageId = messageId;\n\n ['html', 'text', 'watchHtml', 'amp'].forEach(key => {\n if (data[key] && data[key].content) {\n if (typeof data[key].content === 'string') {\n data[key] = data[key].content;\n } else if (Buffer.isBuffer(data[key].content)) {\n data[key] = data[key].content.toString();\n }\n }\n });\n\n if (data.icalEvent && Buffer.isBuffer(data.icalEvent.content)) {\n data.icalEvent.content = data.icalEvent.content.toString('base64');\n data.icalEvent.encoding = 'base64';\n }\n\n if (data.alternatives && data.alternatives.length) {\n data.alternatives.forEach(alternative => {\n if (alternative && alternative.content && Buffer.isBuffer(alternative.content)) {\n alternative.content = alternative.content.toString('base64');\n alternative.encoding = 'base64';\n }\n });\n }\n\n if (data.attachments && data.attachments.length) {\n data.attachments.forEach(attachment => {\n if (attachment && attachment.content && Buffer.isBuffer(attachment.content)) {\n attachment.content = attachment.content.toString('base64');\n attachment.encoding = 'base64';\n }\n });\n }\n\n data.normalizedHeaders = {};\n Object.keys(data.headers || {}).forEach(key => {\n let value = [].concat(data.headers[key] || []).shift();\n value = (value && value.value) || value;\n if (value) {\n if (['references', 'in-reply-to', 'message-id', 'content-id'].includes(key)) {\n value = this.message._encodeHeaderValue(key, value);\n }\n data.normalizedHeaders[key] = value;\n }\n });\n\n if (data.list && typeof data.list === 'object') {\n let listHeaders = this._getListHeaders(data.list);\n listHeaders.forEach(entry => {\n data.normalizedHeaders[entry.key] = entry.value.map(val => (val && val.value) || val).join(', ');\n });\n }\n\n if (data.references) {\n data.normalizedHeaders.references = this.message._encodeHeaderValue('references', data.references);\n }\n\n if (data.inReplyTo) {\n data.normalizedHeaders['in-reply-to'] = this.message._encodeHeaderValue('in-reply-to', data.inReplyTo);\n }\n\n return callback(null, data);\n });\n }\n\n setMailerHeader() {\n if (!this.message || !this.data.xMailer) {\n return;\n }\n this.message.setHeader('X-Mailer', this.data.xMailer);\n }\n\n setPriorityHeaders() {\n if (!this.message || !this.data.priority) {\n return;\n }\n switch ((this.data.priority || '').toString().toLowerCase()) {\n case 'high':\n this.message.setHeader('X-Priority', '1 (Highest)');\n this.message.setHeader('X-MSMail-Priority', 'High');\n this.message.setHeader('Importance', 'High');\n break;\n case 'low':\n this.message.setHeader('X-Priority', '5 (Lowest)');\n this.message.setHeader('X-MSMail-Priority', 'Low');\n this.message.setHeader('Importance', 'Low');\n break;\n default:\n // do not add anything, since all messages are 'Normal' by default\n }\n }\n\n setListHeaders() {\n if (!this.message || !this.data.list || typeof this.data.list !== 'object') {\n return;\n }\n // add optional List-* headers\n if (this.data.list && typeof this.data.list === 'object') {\n this._getListHeaders(this.data.list).forEach(listHeader => {\n listHeader.value.forEach(value => {\n this.message.addHeader(listHeader.key, value);\n });\n });\n }\n }\n\n _getListHeaders(listData) {\n // make sure an url looks like \n return Object.keys(listData).map(key => ({\n key: 'list-' + key.toLowerCase().trim(),\n value: [].concat(listData[key] || []).map(value => ({\n prepared: true,\n foldLines: true,\n value: []\n .concat(value || [])\n .map(value => {\n if (typeof value === 'string') {\n value = {\n url: value\n };\n }\n\n if (value && value.url) {\n if (key.toLowerCase().trim() === 'id') {\n // List-ID: \"comment\" \n let comment = value.comment || '';\n if (mimeFuncs.isPlainText(comment)) {\n comment = '\"' + comment + '\"';\n } else {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return (value.comment ? comment + ' ' : '') + this._formatListUrl(value.url).replace(/^<[^:]+\\/{,2}/, '');\n }\n\n // List-*: (comment)\n let comment = value.comment || '';\n if (!mimeFuncs.isPlainText(comment)) {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return this._formatListUrl(value.url) + (value.comment ? ' (' + comment + ')' : '');\n }\n\n return '';\n })\n .filter(value => value)\n .join(', ')\n }))\n }));\n }\n\n _formatListUrl(url) {\n url = url.replace(/[\\s<]+|[\\s>]+/g, '');\n if (/^(https?|mailto|ftp):/.test(url)) {\n return '<' + url + '>';\n }\n if (/^[^@]+@[^@]+$/.test(url)) {\n return '';\n }\n\n return '';\n }\n}\n\nmodule.exports = MailMessage;\n","/* eslint no-control-regex:0 */\n\n'use strict';\n\nconst base64 = require('../base64');\nconst qp = require('../qp');\nconst mimeTypes = require('./mime-types');\n\nmodule.exports = {\n /**\n * Checks if a value is plaintext string (uses only printable 7bit chars)\n *\n * @param {String} value String to be tested\n * @returns {Boolean} true if it is a plaintext string\n */\n isPlainText(value, isParam) {\n const re = isParam ? /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\"\\u0080-\\uFFFF]/ : /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\u0080-\\uFFFF]/;\n if (typeof value !== 'string' || re.test(value)) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a multi line string containes lines longer than the selected value.\n *\n * Useful when detecting if a mail message needs any processing at all –\n * if only plaintext characters are used and lines are short, then there is\n * no need to encode the values in any way. If the value is plaintext but has\n * longer lines then allowed, then use format=flowed\n *\n * @param {Number} lineLength Max line length to check for\n * @returns {Boolean} Returns true if there is at least one line longer than lineLength chars\n */\n hasLongerLines(str, lineLength) {\n if (str.length > 128 * 1024) {\n // do not test strings longer than 128kB\n return true;\n }\n return new RegExp('^.{' + (lineLength + 1) + ',}', 'm').test(str);\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047)\n *\n * @param {String|Buffer} data String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @return {String} Single or several mime words joined together\n */\n encodeWord(data, mimeWordEncoding, maxLength) {\n mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);\n maxLength = maxLength || 0;\n\n let encodedStr;\n let toCharset = 'UTF-8';\n\n if (maxLength && maxLength > 7 + toCharset.length) {\n maxLength -= 7 + toCharset.length;\n }\n\n if (mimeWordEncoding === 'Q') {\n // https://tools.ietf.org/html/rfc2047#section-5 rule (3)\n encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\\-/=]/gi, chr => {\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n if (chr === ' ') {\n return '_';\n } else {\n return '=' + (ord.length === 1 ? '0' + ord : ord);\n }\n });\n } else if (mimeWordEncoding === 'B') {\n encodedStr = typeof data === 'string' ? data : base64.encode(data);\n maxLength = maxLength ? Math.max(3, ((maxLength - (maxLength % 4)) / 4) * 3) : 0;\n }\n\n if (maxLength && (mimeWordEncoding !== 'B' ? encodedStr : base64.encode(data)).length > maxLength) {\n if (mimeWordEncoding === 'Q') {\n encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n // RFC2047 6.3 (2) states that encoded-word must include an integral number of characters, so no chopping unicode sequences\n let parts = [];\n let lpart = '';\n for (let i = 0, len = encodedStr.length; i < len; i++) {\n let chr = encodedStr.charAt(i);\n // check if we can add this character to the existing string\n // without breaking byte length limit\n if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {\n lpart += chr;\n } else {\n // we hit the length limit, so push the existing string and start over\n parts.push(base64.encode(lpart));\n lpart = chr;\n }\n }\n if (lpart) {\n parts.push(base64.encode(lpart));\n }\n\n if (parts.length > 1) {\n encodedStr = parts.join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n encodedStr = parts.join('');\n }\n }\n } else if (mimeWordEncoding === 'B') {\n encodedStr = base64.encode(data);\n }\n\n return '=?' + toCharset + '?' + mimeWordEncoding + '?' + encodedStr + (encodedStr.substr(-2) === '?=' ? '' : '?=');\n },\n\n /**\n * Finds word sequences with non ascii text and converts these to mime words\n *\n * @param {String} value String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match\n * @return {String} String with possible mime words\n */\n encodeWords(value, mimeWordEncoding, maxLength, encodeAll) {\n maxLength = maxLength || 0;\n\n let encodedValue;\n\n // find first word with a non-printable ascii or special symbol in it\n let firstMatch = value.match(/(?:^|\\s)([^\\s]*[\"\\u0080-\\uFFFF])/);\n if (!firstMatch) {\n return value;\n }\n\n if (encodeAll) {\n // if it is requested to encode everything or the string contains something that resebles encoded word, then encode everything\n\n return this.encodeWord(value, mimeWordEncoding, maxLength);\n }\n\n // find the last word with a non-printable ascii in it\n let lastMatch = value.match(/([\"\\u0080-\\uFFFF][^\\s]*)[^\"\\u0080-\\uFFFF]*$/);\n if (!lastMatch) {\n // should not happen\n return value;\n }\n\n let startIndex =\n firstMatch.index +\n (\n firstMatch[0].match(/[^\\s]/) || {\n index: 0\n }\n ).index;\n let endIndex = lastMatch.index + (lastMatch[1] || '').length;\n\n encodedValue =\n (startIndex ? value.substr(0, startIndex) : '') +\n this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || 'Q', maxLength) +\n (endIndex < value.length ? value.substr(endIndex) : '');\n\n return encodedValue;\n },\n\n /**\n * Joins parsed header value together as 'value; param1=value1; param2=value2'\n * PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.\n * Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html\n * @param {Object} structured Parsed header value\n * @return {String} joined header value\n */\n buildHeaderValue(structured) {\n let paramsArray = [];\n\n Object.keys(structured.params || {}).forEach(param => {\n // filename might include unicode characters so it is a special case\n // other values probably do not\n let value = structured.params[param];\n if (!this.isPlainText(value, true) || value.length >= 75) {\n this.buildHeaderParam(param, value, 50).forEach(encodedParam => {\n if (!/[\\s\"\\\\;:/=(),<>@[\\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {\n paramsArray.push(encodedParam.key + '=' + encodedParam.value);\n } else {\n paramsArray.push(encodedParam.key + '=' + JSON.stringify(encodedParam.value));\n }\n });\n } else if (/[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(value)) {\n paramsArray.push(param + '=' + JSON.stringify(value));\n } else {\n paramsArray.push(param + '=' + value);\n }\n });\n\n return structured.value + (paramsArray.length ? '; ' + paramsArray.join('; ') : '');\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)\n * Useful for splitting long parameter values.\n *\n * For example\n * title=\"unicode string\"\n * becomes\n * title*0*=utf-8''unicode\n * title*1*=%20string\n *\n * @param {String|Buffer} data String to be encoded\n * @param {Number} [maxLength=50] Max length for generated chunks\n * @param {String} [fromCharset='UTF-8'] Source sharacter set\n * @return {Array} A list of encoded keys and headers\n */\n buildHeaderParam(key, data, maxLength) {\n let list = [];\n let encodedStr = typeof data === 'string' ? data : (data || '').toString();\n let encodedStrArr;\n let chr, ord;\n let line;\n let startPos = 0;\n let i, len;\n\n maxLength = maxLength || 50;\n\n // process ascii only text\n if (this.isPlainText(data, true)) {\n // check if conversion is even needed\n if (encodedStr.length <= maxLength) {\n return [\n {\n key,\n value: encodedStr\n }\n ];\n }\n\n encodedStr = encodedStr.replace(new RegExp('.{' + maxLength + '}', 'g'), str => {\n list.push({\n line: str\n });\n return '';\n });\n\n if (encodedStr) {\n list.push({\n line: encodedStr\n });\n }\n } else {\n if (/[\\uD800-\\uDBFF]/.test(encodedStr)) {\n // string containts surrogate pairs, so normalize it to an array of bytes\n encodedStrArr = [];\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr.charAt(i);\n ord = chr.charCodeAt(0);\n if (ord >= 0xd800 && ord <= 0xdbff && i < len - 1) {\n chr += encodedStr.charAt(i + 1);\n encodedStrArr.push(chr);\n i++;\n } else {\n encodedStrArr.push(chr);\n }\n }\n encodedStr = encodedStrArr;\n }\n\n // first line includes the charset and language info and needs to be encoded\n // even if it does not contain any unicode characters\n line = 'utf-8\\x27\\x27';\n let encoded = true;\n startPos = 0;\n\n // process text with unicode or special chars\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr[i];\n\n if (encoded) {\n chr = this.safeEncodeURIComponent(chr);\n } else {\n // try to urlencode current char\n chr = chr === ' ' ? chr : this.safeEncodeURIComponent(chr);\n // By default it is not required to encode a line, the need\n // only appears when the string contains unicode or special chars\n // in this case we start processing the line over and encode all chars\n if (chr !== encodedStr[i]) {\n // Check if it is even possible to add the encoded char to the line\n // If not, there is no reason to use this line, just push it to the list\n // and start a new line with the char that needs encoding\n if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = '';\n startPos = i - 1;\n } else {\n encoded = true;\n i = startPos;\n line = '';\n continue;\n }\n }\n }\n\n // if the line is already too long, push it to the list and start a new one\n if ((line + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = chr = encodedStr[i] === ' ' ? ' ' : this.safeEncodeURIComponent(encodedStr[i]);\n if (chr === encodedStr[i]) {\n encoded = false;\n startPos = i - 1;\n } else {\n encoded = true;\n }\n } else {\n line += chr;\n }\n }\n\n if (line) {\n list.push({\n line,\n encoded\n });\n }\n }\n\n return list.map((item, i) => ({\n // encoded lines: {name}*{part}*\n // unencoded lines: {name}*{part}\n // if any line needs to be encoded then the first line (part==0) is always encoded\n key: key + '*' + i + (item.encoded ? '*' : ''),\n value: item.line\n }));\n },\n\n /**\n * Parses a header value with key=value arguments into a structured\n * object.\n *\n * parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') ->\n * {\n * 'value': 'text/plain',\n * 'params': {\n * 'charset': 'UTF-8'\n * }\n * }\n *\n * @param {String} str Header value\n * @return {Object} Header value as a parsed structure\n */\n parseHeaderValue(str) {\n let response = {\n value: false,\n params: {}\n };\n let key = false;\n let value = '';\n let type = 'value';\n let quote = false;\n let escaped = false;\n let chr;\n\n for (let i = 0, len = str.length; i < len; i++) {\n chr = str.charAt(i);\n if (type === 'key') {\n if (chr === '=') {\n key = value.trim().toLowerCase();\n type = 'value';\n value = '';\n continue;\n }\n value += chr;\n } else {\n if (escaped) {\n value += chr;\n } else if (chr === '\\\\') {\n escaped = true;\n continue;\n } else if (quote && chr === quote) {\n quote = false;\n } else if (!quote && chr === '\"') {\n quote = chr;\n } else if (!quote && chr === ';') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n type = 'key';\n value = '';\n } else {\n value += chr;\n }\n escaped = false;\n }\n }\n\n if (type === 'value') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n } else if (value.trim()) {\n response.params[value.trim().toLowerCase()] = '';\n }\n\n // handle parameter value continuations\n // https://tools.ietf.org/html/rfc2231#section-3\n\n // preprocess values\n Object.keys(response.params).forEach(key => {\n let actualKey, nr, match, value;\n if ((match = key.match(/(\\*(\\d+)|\\*(\\d+)\\*|\\*)$/))) {\n actualKey = key.substr(0, match.index);\n nr = Number(match[2] || match[3]) || 0;\n\n if (!response.params[actualKey] || typeof response.params[actualKey] !== 'object') {\n response.params[actualKey] = {\n charset: false,\n values: []\n };\n }\n\n value = response.params[key];\n\n if (nr === 0 && match[0].substr(-1) === '*' && (match = value.match(/^([^']*)'[^']*'(.*)$/))) {\n response.params[actualKey].charset = match[1] || 'iso-8859-1';\n value = match[2];\n }\n\n response.params[actualKey].values[nr] = value;\n\n // remove the old reference\n delete response.params[key];\n }\n });\n\n // concatenate split rfc2231 strings and convert encoded strings to mime encoded words\n Object.keys(response.params).forEach(key => {\n let value;\n if (response.params[key] && Array.isArray(response.params[key].values)) {\n value = response.params[key].values.map(val => val || '').join('');\n\n if (response.params[key].charset) {\n // convert \"%AB\" to \"=?charset?Q?=AB?=\"\n response.params[key] =\n '=?' +\n response.params[key].charset +\n '?Q?' +\n value\n // fix invalidly encoded chars\n .replace(/[=?_\\s]/g, s => {\n let c = s.charCodeAt(0).toString(16);\n if (s === ' ') {\n return '_';\n } else {\n return '%' + (c.length < 2 ? '0' : '') + c;\n }\n })\n // change from urlencoding to percent encoding\n .replace(/%/g, '=') +\n '?=';\n } else {\n response.params[key] = value;\n }\n }\n });\n\n return response;\n },\n\n /**\n * Returns file extension for a content type string. If no suitable extensions\n * are found, 'bin' is used as the default extension\n *\n * @param {String} mimeType Content type to be checked for\n * @return {String} File extension\n */\n detectExtension: mimeType => mimeTypes.detectExtension(mimeType),\n\n /**\n * Returns content type for a file extension. If no suitable content types\n * are found, 'application/octet-stream' is used as the default content type\n *\n * @param {String} extension Extension to be checked for\n * @return {String} File extension\n */\n detectMimeType: extension => mimeTypes.detectMimeType(extension),\n\n /**\n * Folds long lines, useful for folding header lines (afterSpace=false) and\n * flowed text (afterSpace=true)\n *\n * @param {String} str String to be folded\n * @param {Number} [lineLength=76] Maximum length of a line\n * @param {Boolean} afterSpace If true, leave a space in th end of a line\n * @return {String} String with folded lines\n */\n foldLines(str, lineLength, afterSpace) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n let pos = 0,\n len = str.length,\n result = '',\n line,\n match;\n\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if (line.length < lineLength) {\n result += line;\n break;\n }\n if ((match = line.match(/^[^\\n\\r]*(\\r?\\n|\\r)/))) {\n line = match[0];\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.match(/(\\s+)[^\\s]*$/)) && match[0].length - (afterSpace ? (match[1] || '').length : 0) < line.length) {\n line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || '').length : 0)));\n } else if ((match = str.substr(pos + line.length).match(/^[^\\s]+(\\s*)/))) {\n line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || '').length : 0));\n }\n\n result += line;\n pos += line.length;\n if (pos < len) {\n result += '\\r\\n';\n }\n }\n\n return result;\n },\n\n /**\n * Splits a mime encoded string. Needed for dividing mime words into smaller chunks\n *\n * @param {String} str Mime encoded string to be split up\n * @param {Number} maxlen Maximum length of characters for one part (minimum 12)\n * @return {Array} Split string\n */\n splitMimeEncodedString: (str, maxlen) => {\n let curLine,\n match,\n chr,\n done,\n lines = [];\n\n // require at least 12 symbols to fit possible 4 octet UTF-8 sequences\n maxlen = Math.max(maxlen || 0, 12);\n\n while (str.length) {\n curLine = str.substr(0, maxlen);\n\n // move incomplete escaped char back to main\n if ((match = curLine.match(/[=][0-9A-F]?$/i))) {\n curLine = curLine.substr(0, match.index);\n }\n\n done = false;\n while (!done) {\n done = true;\n // check if not middle of a unicode char sequence\n if ((match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i))) {\n chr = parseInt(match[1], 16);\n // invalid sequence, move one char back anc recheck\n if (chr < 0xc2 && chr > 0x7f) {\n curLine = curLine.substr(0, curLine.length - 3);\n done = false;\n }\n }\n }\n\n if (curLine.length) {\n lines.push(curLine);\n }\n str = str.substr(curLine.length);\n }\n\n return lines;\n },\n\n encodeURICharComponent: chr => {\n let res = '';\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n\n if (ord.length % 2) {\n ord = '0' + ord;\n }\n\n if (ord.length > 2) {\n for (let i = 0, len = ord.length / 2; i < len; i++) {\n res += '%' + ord.substr(i, 2);\n }\n } else {\n res += '%' + ord;\n }\n\n return res;\n },\n\n safeEncodeURIComponent(str) {\n str = (str || '').toString();\n\n try {\n // might throw if we try to encode invalid sequences, eg. partial emoji\n str = encodeURIComponent(str);\n } catch (E) {\n // should never run\n return str.replace(/[^\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]+/g, '');\n }\n\n // ensure chars that are not handled by encodeURICompent are converted as well\n return str.replace(/[\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]/g, chr => this.encodeURICharComponent(chr));\n }\n};\n","/* eslint quote-props: 0 */\n\n'use strict';\n\nconst path = require('path');\n\nconst defaultMimeType = 'application/octet-stream';\nconst defaultExtension = 'bin';\n\nconst mimeTypes = new Map([\n ['application/acad', 'dwg'],\n ['application/applixware', 'aw'],\n ['application/arj', 'arj'],\n ['application/atom+xml', 'xml'],\n ['application/atomcat+xml', 'atomcat'],\n ['application/atomsvc+xml', 'atomsvc'],\n ['application/base64', ['mm', 'mme']],\n ['application/binhex', 'hqx'],\n ['application/binhex4', 'hqx'],\n ['application/book', ['book', 'boo']],\n ['application/ccxml+xml,', 'ccxml'],\n ['application/cdf', 'cdf'],\n ['application/cdmi-capability', 'cdmia'],\n ['application/cdmi-container', 'cdmic'],\n ['application/cdmi-domain', 'cdmid'],\n ['application/cdmi-object', 'cdmio'],\n ['application/cdmi-queue', 'cdmiq'],\n ['application/clariscad', 'ccad'],\n ['application/commonground', 'dp'],\n ['application/cu-seeme', 'cu'],\n ['application/davmount+xml', 'davmount'],\n ['application/drafting', 'drw'],\n ['application/dsptype', 'tsp'],\n ['application/dssc+der', 'dssc'],\n ['application/dssc+xml', 'xdssc'],\n ['application/dxf', 'dxf'],\n ['application/ecmascript', ['js', 'es']],\n ['application/emma+xml', 'emma'],\n ['application/envoy', 'evy'],\n ['application/epub+zip', 'epub'],\n ['application/excel', ['xls', 'xl', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/exi', 'exi'],\n ['application/font-tdpfr', 'pfr'],\n ['application/fractals', 'fif'],\n ['application/freeloader', 'frl'],\n ['application/futuresplash', 'spl'],\n ['application/gnutar', 'tgz'],\n ['application/groupwise', 'vew'],\n ['application/hlp', 'hlp'],\n ['application/hta', 'hta'],\n ['application/hyperstudio', 'stk'],\n ['application/i-deas', 'unv'],\n ['application/iges', ['iges', 'igs']],\n ['application/inf', 'inf'],\n ['application/internet-property-stream', 'acx'],\n ['application/ipfix', 'ipfix'],\n ['application/java', 'class'],\n ['application/java-archive', 'jar'],\n ['application/java-byte-code', 'class'],\n ['application/java-serialized-object', 'ser'],\n ['application/java-vm', 'class'],\n ['application/javascript', 'js'],\n ['application/json', 'json'],\n ['application/lha', 'lha'],\n ['application/lzx', 'lzx'],\n ['application/mac-binary', 'bin'],\n ['application/mac-binhex', 'hqx'],\n ['application/mac-binhex40', 'hqx'],\n ['application/mac-compactpro', 'cpt'],\n ['application/macbinary', 'bin'],\n ['application/mads+xml', 'mads'],\n ['application/marc', 'mrc'],\n ['application/marcxml+xml', 'mrcx'],\n ['application/mathematica', 'ma'],\n ['application/mathml+xml', 'mathml'],\n ['application/mbedlet', 'mbd'],\n ['application/mbox', 'mbox'],\n ['application/mcad', 'mcd'],\n ['application/mediaservercontrol+xml', 'mscml'],\n ['application/metalink4+xml', 'meta4'],\n ['application/mets+xml', 'mets'],\n ['application/mime', 'aps'],\n ['application/mods+xml', 'mods'],\n ['application/mp21', 'm21'],\n ['application/mp4', 'mp4'],\n ['application/mspowerpoint', ['ppt', 'pot', 'pps', 'ppz']],\n ['application/msword', ['doc', 'dot', 'w6w', 'wiz', 'word']],\n ['application/mswrite', 'wri'],\n ['application/mxf', 'mxf'],\n ['application/netmc', 'mcp'],\n ['application/octet-stream', ['*']],\n ['application/oda', 'oda'],\n ['application/oebps-package+xml', 'opf'],\n ['application/ogg', 'ogx'],\n ['application/olescript', 'axs'],\n ['application/onenote', 'onetoc'],\n ['application/patch-ops-error+xml', 'xer'],\n ['application/pdf', 'pdf'],\n ['application/pgp-encrypted', 'asc'],\n ['application/pgp-signature', 'pgp'],\n ['application/pics-rules', 'prf'],\n ['application/pkcs-12', 'p12'],\n ['application/pkcs-crl', 'crl'],\n ['application/pkcs10', 'p10'],\n ['application/pkcs7-mime', ['p7c', 'p7m']],\n ['application/pkcs7-signature', 'p7s'],\n ['application/pkcs8', 'p8'],\n ['application/pkix-attr-cert', 'ac'],\n ['application/pkix-cert', ['cer', 'crt']],\n ['application/pkix-crl', 'crl'],\n ['application/pkix-pkipath', 'pkipath'],\n ['application/pkixcmp', 'pki'],\n ['application/plain', 'text'],\n ['application/pls+xml', 'pls'],\n ['application/postscript', ['ps', 'ai', 'eps']],\n ['application/powerpoint', 'ppt'],\n ['application/pro_eng', ['part', 'prt']],\n ['application/prs.cww', 'cww'],\n ['application/pskc+xml', 'pskcxml'],\n ['application/rdf+xml', 'rdf'],\n ['application/reginfo+xml', 'rif'],\n ['application/relax-ng-compact-syntax', 'rnc'],\n ['application/resource-lists+xml', 'rl'],\n ['application/resource-lists-diff+xml', 'rld'],\n ['application/ringing-tones', 'rng'],\n ['application/rls-services+xml', 'rs'],\n ['application/rsd+xml', 'rsd'],\n ['application/rss+xml', 'xml'],\n ['application/rtf', ['rtf', 'rtx']],\n ['application/sbml+xml', 'sbml'],\n ['application/scvp-cv-request', 'scq'],\n ['application/scvp-cv-response', 'scs'],\n ['application/scvp-vp-request', 'spq'],\n ['application/scvp-vp-response', 'spp'],\n ['application/sdp', 'sdp'],\n ['application/sea', 'sea'],\n ['application/set', 'set'],\n ['application/set-payment-initiation', 'setpay'],\n ['application/set-registration-initiation', 'setreg'],\n ['application/shf+xml', 'shf'],\n ['application/sla', 'stl'],\n ['application/smil', ['smi', 'smil']],\n ['application/smil+xml', 'smi'],\n ['application/solids', 'sol'],\n ['application/sounder', 'sdr'],\n ['application/sparql-query', 'rq'],\n ['application/sparql-results+xml', 'srx'],\n ['application/srgs', 'gram'],\n ['application/srgs+xml', 'grxml'],\n ['application/sru+xml', 'sru'],\n ['application/ssml+xml', 'ssml'],\n ['application/step', ['step', 'stp']],\n ['application/streamingmedia', 'ssm'],\n ['application/tei+xml', 'tei'],\n ['application/thraud+xml', 'tfi'],\n ['application/timestamped-data', 'tsd'],\n ['application/toolbook', 'tbk'],\n ['application/vda', 'vda'],\n ['application/vnd.3gpp.pic-bw-large', 'plb'],\n ['application/vnd.3gpp.pic-bw-small', 'psb'],\n ['application/vnd.3gpp.pic-bw-var', 'pvb'],\n ['application/vnd.3gpp2.tcap', 'tcap'],\n ['application/vnd.3m.post-it-notes', 'pwn'],\n ['application/vnd.accpac.simply.aso', 'aso'],\n ['application/vnd.accpac.simply.imp', 'imp'],\n ['application/vnd.acucobol', 'acu'],\n ['application/vnd.acucorp', 'atc'],\n ['application/vnd.adobe.air-application-installer-package+zip', 'air'],\n ['application/vnd.adobe.fxp', 'fxp'],\n ['application/vnd.adobe.xdp+xml', 'xdp'],\n ['application/vnd.adobe.xfdf', 'xfdf'],\n ['application/vnd.ahead.space', 'ahead'],\n ['application/vnd.airzip.filesecure.azf', 'azf'],\n ['application/vnd.airzip.filesecure.azs', 'azs'],\n ['application/vnd.amazon.ebook', 'azw'],\n ['application/vnd.americandynamics.acc', 'acc'],\n ['application/vnd.amiga.ami', 'ami'],\n ['application/vnd.android.package-archive', 'apk'],\n ['application/vnd.anser-web-certificate-issue-initiation', 'cii'],\n ['application/vnd.anser-web-funds-transfer-initiation', 'fti'],\n ['application/vnd.antix.game-component', 'atx'],\n ['application/vnd.apple.installer+xml', 'mpkg'],\n ['application/vnd.apple.mpegurl', 'm3u8'],\n ['application/vnd.aristanetworks.swi', 'swi'],\n ['application/vnd.audiograph', 'aep'],\n ['application/vnd.blueice.multipass', 'mpm'],\n ['application/vnd.bmi', 'bmi'],\n ['application/vnd.businessobjects', 'rep'],\n ['application/vnd.chemdraw+xml', 'cdxml'],\n ['application/vnd.chipnuts.karaoke-mmd', 'mmd'],\n ['application/vnd.cinderella', 'cdy'],\n ['application/vnd.claymore', 'cla'],\n ['application/vnd.cloanto.rp9', 'rp9'],\n ['application/vnd.clonk.c4group', 'c4g'],\n ['application/vnd.cluetrust.cartomobile-config', 'c11amc'],\n ['application/vnd.cluetrust.cartomobile-config-pkg', 'c11amz'],\n ['application/vnd.commonspace', 'csp'],\n ['application/vnd.contact.cmsg', 'cdbcmsg'],\n ['application/vnd.cosmocaller', 'cmc'],\n ['application/vnd.crick.clicker', 'clkx'],\n ['application/vnd.crick.clicker.keyboard', 'clkk'],\n ['application/vnd.crick.clicker.palette', 'clkp'],\n ['application/vnd.crick.clicker.template', 'clkt'],\n ['application/vnd.crick.clicker.wordbank', 'clkw'],\n ['application/vnd.criticaltools.wbs+xml', 'wbs'],\n ['application/vnd.ctc-posml', 'pml'],\n ['application/vnd.cups-ppd', 'ppd'],\n ['application/vnd.curl.car', 'car'],\n ['application/vnd.curl.pcurl', 'pcurl'],\n ['application/vnd.data-vision.rdz', 'rdz'],\n ['application/vnd.denovo.fcselayout-link', 'fe_launch'],\n ['application/vnd.dna', 'dna'],\n ['application/vnd.dolby.mlp', 'mlp'],\n ['application/vnd.dpgraph', 'dpg'],\n ['application/vnd.dreamfactory', 'dfac'],\n ['application/vnd.dvb.ait', 'ait'],\n ['application/vnd.dvb.service', 'svc'],\n ['application/vnd.dynageo', 'geo'],\n ['application/vnd.ecowin.chart', 'mag'],\n ['application/vnd.enliven', 'nml'],\n ['application/vnd.epson.esf', 'esf'],\n ['application/vnd.epson.msf', 'msf'],\n ['application/vnd.epson.quickanime', 'qam'],\n ['application/vnd.epson.salt', 'slt'],\n ['application/vnd.epson.ssf', 'ssf'],\n ['application/vnd.eszigno3+xml', 'es3'],\n ['application/vnd.ezpix-album', 'ez2'],\n ['application/vnd.ezpix-package', 'ez3'],\n ['application/vnd.fdf', 'fdf'],\n ['application/vnd.fdsn.seed', 'seed'],\n ['application/vnd.flographit', 'gph'],\n ['application/vnd.fluxtime.clip', 'ftc'],\n ['application/vnd.framemaker', 'fm'],\n ['application/vnd.frogans.fnc', 'fnc'],\n ['application/vnd.frogans.ltf', 'ltf'],\n ['application/vnd.fsc.weblaunch', 'fsc'],\n ['application/vnd.fujitsu.oasys', 'oas'],\n ['application/vnd.fujitsu.oasys2', 'oa2'],\n ['application/vnd.fujitsu.oasys3', 'oa3'],\n ['application/vnd.fujitsu.oasysgp', 'fg5'],\n ['application/vnd.fujitsu.oasysprs', 'bh2'],\n ['application/vnd.fujixerox.ddd', 'ddd'],\n ['application/vnd.fujixerox.docuworks', 'xdw'],\n ['application/vnd.fujixerox.docuworks.binder', 'xbd'],\n ['application/vnd.fuzzysheet', 'fzs'],\n ['application/vnd.genomatix.tuxedo', 'txd'],\n ['application/vnd.geogebra.file', 'ggb'],\n ['application/vnd.geogebra.tool', 'ggt'],\n ['application/vnd.geometry-explorer', 'gex'],\n ['application/vnd.geonext', 'gxt'],\n ['application/vnd.geoplan', 'g2w'],\n ['application/vnd.geospace', 'g3w'],\n ['application/vnd.gmx', 'gmx'],\n ['application/vnd.google-earth.kml+xml', 'kml'],\n ['application/vnd.google-earth.kmz', 'kmz'],\n ['application/vnd.grafeq', 'gqf'],\n ['application/vnd.groove-account', 'gac'],\n ['application/vnd.groove-help', 'ghf'],\n ['application/vnd.groove-identity-message', 'gim'],\n ['application/vnd.groove-injector', 'grv'],\n ['application/vnd.groove-tool-message', 'gtm'],\n ['application/vnd.groove-tool-template', 'tpl'],\n ['application/vnd.groove-vcard', 'vcg'],\n ['application/vnd.hal+xml', 'hal'],\n ['application/vnd.handheld-entertainment+xml', 'zmm'],\n ['application/vnd.hbci', 'hbci'],\n ['application/vnd.hhe.lesson-player', 'les'],\n ['application/vnd.hp-hpgl', ['hgl', 'hpg', 'hpgl']],\n ['application/vnd.hp-hpid', 'hpid'],\n ['application/vnd.hp-hps', 'hps'],\n ['application/vnd.hp-jlyt', 'jlt'],\n ['application/vnd.hp-pcl', 'pcl'],\n ['application/vnd.hp-pclxl', 'pclxl'],\n ['application/vnd.hydrostatix.sof-data', 'sfd-hdstx'],\n ['application/vnd.hzn-3d-crossword', 'x3d'],\n ['application/vnd.ibm.minipay', 'mpy'],\n ['application/vnd.ibm.modcap', 'afp'],\n ['application/vnd.ibm.rights-management', 'irm'],\n ['application/vnd.ibm.secure-container', 'sc'],\n ['application/vnd.iccprofile', 'icc'],\n ['application/vnd.igloader', 'igl'],\n ['application/vnd.immervision-ivp', 'ivp'],\n ['application/vnd.immervision-ivu', 'ivu'],\n ['application/vnd.insors.igm', 'igm'],\n ['application/vnd.intercon.formnet', 'xpw'],\n ['application/vnd.intergeo', 'i2g'],\n ['application/vnd.intu.qbo', 'qbo'],\n ['application/vnd.intu.qfx', 'qfx'],\n ['application/vnd.ipunplugged.rcprofile', 'rcprofile'],\n ['application/vnd.irepository.package+xml', 'irp'],\n ['application/vnd.is-xpr', 'xpr'],\n ['application/vnd.isac.fcs', 'fcs'],\n ['application/vnd.jam', 'jam'],\n ['application/vnd.jcp.javame.midlet-rms', 'rms'],\n ['application/vnd.jisp', 'jisp'],\n ['application/vnd.joost.joda-archive', 'joda'],\n ['application/vnd.kahootz', 'ktz'],\n ['application/vnd.kde.karbon', 'karbon'],\n ['application/vnd.kde.kchart', 'chrt'],\n ['application/vnd.kde.kformula', 'kfo'],\n ['application/vnd.kde.kivio', 'flw'],\n ['application/vnd.kde.kontour', 'kon'],\n ['application/vnd.kde.kpresenter', 'kpr'],\n ['application/vnd.kde.kspread', 'ksp'],\n ['application/vnd.kde.kword', 'kwd'],\n ['application/vnd.kenameaapp', 'htke'],\n ['application/vnd.kidspiration', 'kia'],\n ['application/vnd.kinar', 'kne'],\n ['application/vnd.koan', 'skp'],\n ['application/vnd.kodak-descriptor', 'sse'],\n ['application/vnd.las.las+xml', 'lasxml'],\n ['application/vnd.llamagraphics.life-balance.desktop', 'lbd'],\n ['application/vnd.llamagraphics.life-balance.exchange+xml', 'lbe'],\n ['application/vnd.lotus-1-2-3', '123'],\n ['application/vnd.lotus-approach', 'apr'],\n ['application/vnd.lotus-freelance', 'pre'],\n ['application/vnd.lotus-notes', 'nsf'],\n ['application/vnd.lotus-organizer', 'org'],\n ['application/vnd.lotus-screencam', 'scm'],\n ['application/vnd.lotus-wordpro', 'lwp'],\n ['application/vnd.macports.portpkg', 'portpkg'],\n ['application/vnd.mcd', 'mcd'],\n ['application/vnd.medcalcdata', 'mc1'],\n ['application/vnd.mediastation.cdkey', 'cdkey'],\n ['application/vnd.mfer', 'mwf'],\n ['application/vnd.mfmp', 'mfm'],\n ['application/vnd.micrografx.flo', 'flo'],\n ['application/vnd.micrografx.igx', 'igx'],\n ['application/vnd.mif', 'mif'],\n ['application/vnd.mobius.daf', 'daf'],\n ['application/vnd.mobius.dis', 'dis'],\n ['application/vnd.mobius.mbk', 'mbk'],\n ['application/vnd.mobius.mqy', 'mqy'],\n ['application/vnd.mobius.msl', 'msl'],\n ['application/vnd.mobius.plc', 'plc'],\n ['application/vnd.mobius.txf', 'txf'],\n ['application/vnd.mophun.application', 'mpn'],\n ['application/vnd.mophun.certificate', 'mpc'],\n ['application/vnd.mozilla.xul+xml', 'xul'],\n ['application/vnd.ms-artgalry', 'cil'],\n ['application/vnd.ms-cab-compressed', 'cab'],\n ['application/vnd.ms-excel', ['xls', 'xla', 'xlc', 'xlm', 'xlt', 'xlw', 'xlb', 'xll']],\n ['application/vnd.ms-excel.addin.macroenabled.12', 'xlam'],\n ['application/vnd.ms-excel.sheet.binary.macroenabled.12', 'xlsb'],\n ['application/vnd.ms-excel.sheet.macroenabled.12', 'xlsm'],\n ['application/vnd.ms-excel.template.macroenabled.12', 'xltm'],\n ['application/vnd.ms-fontobject', 'eot'],\n ['application/vnd.ms-htmlhelp', 'chm'],\n ['application/vnd.ms-ims', 'ims'],\n ['application/vnd.ms-lrm', 'lrm'],\n ['application/vnd.ms-officetheme', 'thmx'],\n ['application/vnd.ms-outlook', 'msg'],\n ['application/vnd.ms-pki.certstore', 'sst'],\n ['application/vnd.ms-pki.pko', 'pko'],\n ['application/vnd.ms-pki.seccat', 'cat'],\n ['application/vnd.ms-pki.stl', 'stl'],\n ['application/vnd.ms-pkicertstore', 'sst'],\n ['application/vnd.ms-pkiseccat', 'cat'],\n ['application/vnd.ms-pkistl', 'stl'],\n ['application/vnd.ms-powerpoint', ['ppt', 'pot', 'pps', 'ppa', 'pwz']],\n ['application/vnd.ms-powerpoint.addin.macroenabled.12', 'ppam'],\n ['application/vnd.ms-powerpoint.presentation.macroenabled.12', 'pptm'],\n ['application/vnd.ms-powerpoint.slide.macroenabled.12', 'sldm'],\n ['application/vnd.ms-powerpoint.slideshow.macroenabled.12', 'ppsm'],\n ['application/vnd.ms-powerpoint.template.macroenabled.12', 'potm'],\n ['application/vnd.ms-project', 'mpp'],\n ['application/vnd.ms-word.document.macroenabled.12', 'docm'],\n ['application/vnd.ms-word.template.macroenabled.12', 'dotm'],\n ['application/vnd.ms-works', ['wks', 'wcm', 'wdb', 'wps']],\n ['application/vnd.ms-wpl', 'wpl'],\n ['application/vnd.ms-xpsdocument', 'xps'],\n ['application/vnd.mseq', 'mseq'],\n ['application/vnd.musician', 'mus'],\n ['application/vnd.muvee.style', 'msty'],\n ['application/vnd.neurolanguage.nlu', 'nlu'],\n ['application/vnd.noblenet-directory', 'nnd'],\n ['application/vnd.noblenet-sealer', 'nns'],\n ['application/vnd.noblenet-web', 'nnw'],\n ['application/vnd.nokia.configuration-message', 'ncm'],\n ['application/vnd.nokia.n-gage.data', 'ngdat'],\n ['application/vnd.nokia.n-gage.symbian.install', 'n-gage'],\n ['application/vnd.nokia.radio-preset', 'rpst'],\n ['application/vnd.nokia.radio-presets', 'rpss'],\n ['application/vnd.nokia.ringing-tone', 'rng'],\n ['application/vnd.novadigm.edm', 'edm'],\n ['application/vnd.novadigm.edx', 'edx'],\n ['application/vnd.novadigm.ext', 'ext'],\n ['application/vnd.oasis.opendocument.chart', 'odc'],\n ['application/vnd.oasis.opendocument.chart-template', 'otc'],\n ['application/vnd.oasis.opendocument.database', 'odb'],\n ['application/vnd.oasis.opendocument.formula', 'odf'],\n ['application/vnd.oasis.opendocument.formula-template', 'odft'],\n ['application/vnd.oasis.opendocument.graphics', 'odg'],\n ['application/vnd.oasis.opendocument.graphics-template', 'otg'],\n ['application/vnd.oasis.opendocument.image', 'odi'],\n ['application/vnd.oasis.opendocument.image-template', 'oti'],\n ['application/vnd.oasis.opendocument.presentation', 'odp'],\n ['application/vnd.oasis.opendocument.presentation-template', 'otp'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'ods'],\n ['application/vnd.oasis.opendocument.spreadsheet-template', 'ots'],\n ['application/vnd.oasis.opendocument.text', 'odt'],\n ['application/vnd.oasis.opendocument.text-master', 'odm'],\n ['application/vnd.oasis.opendocument.text-template', 'ott'],\n ['application/vnd.oasis.opendocument.text-web', 'oth'],\n ['application/vnd.olpc-sugar', 'xo'],\n ['application/vnd.oma.dd2+xml', 'dd2'],\n ['application/vnd.openofficeorg.extension', 'oxt'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slide', 'sldx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.template', 'potx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotx'],\n ['application/vnd.osgeo.mapguide.package', 'mgp'],\n ['application/vnd.osgi.dp', 'dp'],\n ['application/vnd.palm', 'pdb'],\n ['application/vnd.pawaafile', 'paw'],\n ['application/vnd.pg.format', 'str'],\n ['application/vnd.pg.osasli', 'ei6'],\n ['application/vnd.picsel', 'efif'],\n ['application/vnd.pmi.widget', 'wg'],\n ['application/vnd.pocketlearn', 'plf'],\n ['application/vnd.powerbuilder6', 'pbd'],\n ['application/vnd.previewsystems.box', 'box'],\n ['application/vnd.proteus.magazine', 'mgz'],\n ['application/vnd.publishare-delta-tree', 'qps'],\n ['application/vnd.pvi.ptid1', 'ptid'],\n ['application/vnd.quark.quarkxpress', 'qxd'],\n ['application/vnd.realvnc.bed', 'bed'],\n ['application/vnd.recordare.musicxml', 'mxl'],\n ['application/vnd.recordare.musicxml+xml', 'musicxml'],\n ['application/vnd.rig.cryptonote', 'cryptonote'],\n ['application/vnd.rim.cod', 'cod'],\n ['application/vnd.rn-realmedia', 'rm'],\n ['application/vnd.rn-realplayer', 'rnx'],\n ['application/vnd.route66.link66+xml', 'link66'],\n ['application/vnd.sailingtracker.track', 'st'],\n ['application/vnd.seemail', 'see'],\n ['application/vnd.sema', 'sema'],\n ['application/vnd.semd', 'semd'],\n ['application/vnd.semf', 'semf'],\n ['application/vnd.shana.informed.formdata', 'ifm'],\n ['application/vnd.shana.informed.formtemplate', 'itp'],\n ['application/vnd.shana.informed.interchange', 'iif'],\n ['application/vnd.shana.informed.package', 'ipk'],\n ['application/vnd.simtech-mindmapper', 'twd'],\n ['application/vnd.smaf', 'mmf'],\n ['application/vnd.smart.teacher', 'teacher'],\n ['application/vnd.solent.sdkm+xml', 'sdkm'],\n ['application/vnd.spotfire.dxp', 'dxp'],\n ['application/vnd.spotfire.sfs', 'sfs'],\n ['application/vnd.stardivision.calc', 'sdc'],\n ['application/vnd.stardivision.draw', 'sda'],\n ['application/vnd.stardivision.impress', 'sdd'],\n ['application/vnd.stardivision.math', 'smf'],\n ['application/vnd.stardivision.writer', 'sdw'],\n ['application/vnd.stardivision.writer-global', 'sgl'],\n ['application/vnd.stepmania.stepchart', 'sm'],\n ['application/vnd.sun.xml.calc', 'sxc'],\n ['application/vnd.sun.xml.calc.template', 'stc'],\n ['application/vnd.sun.xml.draw', 'sxd'],\n ['application/vnd.sun.xml.draw.template', 'std'],\n ['application/vnd.sun.xml.impress', 'sxi'],\n ['application/vnd.sun.xml.impress.template', 'sti'],\n ['application/vnd.sun.xml.math', 'sxm'],\n ['application/vnd.sun.xml.writer', 'sxw'],\n ['application/vnd.sun.xml.writer.global', 'sxg'],\n ['application/vnd.sun.xml.writer.template', 'stw'],\n ['application/vnd.sus-calendar', 'sus'],\n ['application/vnd.svd', 'svd'],\n ['application/vnd.symbian.install', 'sis'],\n ['application/vnd.syncml+xml', 'xsm'],\n ['application/vnd.syncml.dm+wbxml', 'bdm'],\n ['application/vnd.syncml.dm+xml', 'xdm'],\n ['application/vnd.tao.intent-module-archive', 'tao'],\n ['application/vnd.tmobile-livetv', 'tmo'],\n ['application/vnd.trid.tpt', 'tpt'],\n ['application/vnd.triscape.mxs', 'mxs'],\n ['application/vnd.trueapp', 'tra'],\n ['application/vnd.ufdl', 'ufd'],\n ['application/vnd.uiq.theme', 'utz'],\n ['application/vnd.umajin', 'umj'],\n ['application/vnd.unity', 'unityweb'],\n ['application/vnd.uoml+xml', 'uoml'],\n ['application/vnd.vcx', 'vcx'],\n ['application/vnd.visio', 'vsd'],\n ['application/vnd.visionary', 'vis'],\n ['application/vnd.vsf', 'vsf'],\n ['application/vnd.wap.wbxml', 'wbxml'],\n ['application/vnd.wap.wmlc', 'wmlc'],\n ['application/vnd.wap.wmlscriptc', 'wmlsc'],\n ['application/vnd.webturbo', 'wtb'],\n ['application/vnd.wolfram.player', 'nbp'],\n ['application/vnd.wordperfect', 'wpd'],\n ['application/vnd.wqd', 'wqd'],\n ['application/vnd.wt.stf', 'stf'],\n ['application/vnd.xara', ['web', 'xar']],\n ['application/vnd.xfdl', 'xfdl'],\n ['application/vnd.yamaha.hv-dic', 'hvd'],\n ['application/vnd.yamaha.hv-script', 'hvs'],\n ['application/vnd.yamaha.hv-voice', 'hvp'],\n ['application/vnd.yamaha.openscoreformat', 'osf'],\n ['application/vnd.yamaha.openscoreformat.osfpvg+xml', 'osfpvg'],\n ['application/vnd.yamaha.smaf-audio', 'saf'],\n ['application/vnd.yamaha.smaf-phrase', 'spf'],\n ['application/vnd.yellowriver-custom-menu', 'cmp'],\n ['application/vnd.zul', 'zir'],\n ['application/vnd.zzazz.deck+xml', 'zaz'],\n ['application/vocaltec-media-desc', 'vmd'],\n ['application/vocaltec-media-file', 'vmf'],\n ['application/voicexml+xml', 'vxml'],\n ['application/widget', 'wgt'],\n ['application/winhlp', 'hlp'],\n ['application/wordperfect', ['wp', 'wp5', 'wp6', 'wpd']],\n ['application/wordperfect6.0', ['w60', 'wp5']],\n ['application/wordperfect6.1', 'w61'],\n ['application/wsdl+xml', 'wsdl'],\n ['application/wspolicy+xml', 'wspolicy'],\n ['application/x-123', 'wk1'],\n ['application/x-7z-compressed', '7z'],\n ['application/x-abiword', 'abw'],\n ['application/x-ace-compressed', 'ace'],\n ['application/x-aim', 'aim'],\n ['application/x-authorware-bin', 'aab'],\n ['application/x-authorware-map', 'aam'],\n ['application/x-authorware-seg', 'aas'],\n ['application/x-bcpio', 'bcpio'],\n ['application/x-binary', 'bin'],\n ['application/x-binhex40', 'hqx'],\n ['application/x-bittorrent', 'torrent'],\n ['application/x-bsh', ['bsh', 'sh', 'shar']],\n ['application/x-bytecode.elisp', 'elc'],\n ['application/x-bytecode.python', 'pyc'],\n ['application/x-bzip', 'bz'],\n ['application/x-bzip2', ['boz', 'bz2']],\n ['application/x-cdf', 'cdf'],\n ['application/x-cdlink', 'vcd'],\n ['application/x-chat', ['cha', 'chat']],\n ['application/x-chess-pgn', 'pgn'],\n ['application/x-cmu-raster', 'ras'],\n ['application/x-cocoa', 'cco'],\n ['application/x-compactpro', 'cpt'],\n ['application/x-compress', 'z'],\n ['application/x-compressed', ['tgz', 'gz', 'z', 'zip']],\n ['application/x-conference', 'nsc'],\n ['application/x-cpio', 'cpio'],\n ['application/x-cpt', 'cpt'],\n ['application/x-csh', 'csh'],\n ['application/x-debian-package', 'deb'],\n ['application/x-deepv', 'deepv'],\n ['application/x-director', ['dir', 'dcr', 'dxr']],\n ['application/x-doom', 'wad'],\n ['application/x-dtbncx+xml', 'ncx'],\n ['application/x-dtbook+xml', 'dtb'],\n ['application/x-dtbresource+xml', 'res'],\n ['application/x-dvi', 'dvi'],\n ['application/x-elc', 'elc'],\n ['application/x-envoy', ['env', 'evy']],\n ['application/x-esrehber', 'es'],\n ['application/x-excel', ['xls', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/x-font-bdf', 'bdf'],\n ['application/x-font-ghostscript', 'gsf'],\n ['application/x-font-linux-psf', 'psf'],\n ['application/x-font-otf', 'otf'],\n ['application/x-font-pcf', 'pcf'],\n ['application/x-font-snf', 'snf'],\n ['application/x-font-ttf', 'ttf'],\n ['application/x-font-type1', 'pfa'],\n ['application/x-font-woff', 'woff'],\n ['application/x-frame', 'mif'],\n ['application/x-freelance', 'pre'],\n ['application/x-futuresplash', 'spl'],\n ['application/x-gnumeric', 'gnumeric'],\n ['application/x-gsp', 'gsp'],\n ['application/x-gss', 'gss'],\n ['application/x-gtar', 'gtar'],\n ['application/x-gzip', ['gz', 'gzip']],\n ['application/x-hdf', 'hdf'],\n ['application/x-helpfile', ['help', 'hlp']],\n ['application/x-httpd-imap', 'imap'],\n ['application/x-ima', 'ima'],\n ['application/x-internet-signup', ['ins', 'isp']],\n ['application/x-internett-signup', 'ins'],\n ['application/x-inventor', 'iv'],\n ['application/x-ip2', 'ip'],\n ['application/x-iphone', 'iii'],\n ['application/x-java-class', 'class'],\n ['application/x-java-commerce', 'jcm'],\n ['application/x-java-jnlp-file', 'jnlp'],\n ['application/x-javascript', 'js'],\n ['application/x-koan', ['skd', 'skm', 'skp', 'skt']],\n ['application/x-ksh', 'ksh'],\n ['application/x-latex', ['latex', 'ltx']],\n ['application/x-lha', 'lha'],\n ['application/x-lisp', 'lsp'],\n ['application/x-livescreen', 'ivy'],\n ['application/x-lotus', 'wq1'],\n ['application/x-lotusscreencam', 'scm'],\n ['application/x-lzh', 'lzh'],\n ['application/x-lzx', 'lzx'],\n ['application/x-mac-binhex40', 'hqx'],\n ['application/x-macbinary', 'bin'],\n ['application/x-magic-cap-package-1.0', 'mc$'],\n ['application/x-mathcad', 'mcd'],\n ['application/x-meme', 'mm'],\n ['application/x-midi', ['mid', 'midi']],\n ['application/x-mif', 'mif'],\n ['application/x-mix-transfer', 'nix'],\n ['application/x-mobipocket-ebook', 'prc'],\n ['application/x-mplayer2', 'asx'],\n ['application/x-ms-application', 'application'],\n ['application/x-ms-wmd', 'wmd'],\n ['application/x-ms-wmz', 'wmz'],\n ['application/x-ms-xbap', 'xbap'],\n ['application/x-msaccess', 'mdb'],\n ['application/x-msbinder', 'obd'],\n ['application/x-mscardfile', 'crd'],\n ['application/x-msclip', 'clp'],\n ['application/x-msdownload', ['exe', 'dll']],\n ['application/x-msexcel', ['xls', 'xla', 'xlw']],\n ['application/x-msmediaview', ['mvb', 'm13', 'm14']],\n ['application/x-msmetafile', 'wmf'],\n ['application/x-msmoney', 'mny'],\n ['application/x-mspowerpoint', 'ppt'],\n ['application/x-mspublisher', 'pub'],\n ['application/x-msschedule', 'scd'],\n ['application/x-msterminal', 'trm'],\n ['application/x-mswrite', 'wri'],\n ['application/x-navi-animation', 'ani'],\n ['application/x-navidoc', 'nvd'],\n ['application/x-navimap', 'map'],\n ['application/x-navistyle', 'stl'],\n ['application/x-netcdf', ['cdf', 'nc']],\n ['application/x-newton-compatible-pkg', 'pkg'],\n ['application/x-nokia-9000-communicator-add-on-software', 'aos'],\n ['application/x-omc', 'omc'],\n ['application/x-omcdatamaker', 'omcd'],\n ['application/x-omcregerator', 'omcr'],\n ['application/x-pagemaker', ['pm4', 'pm5']],\n ['application/x-pcl', 'pcl'],\n ['application/x-perfmon', ['pma', 'pmc', 'pml', 'pmr', 'pmw']],\n ['application/x-pixclscript', 'plx'],\n ['application/x-pkcs10', 'p10'],\n ['application/x-pkcs12', ['p12', 'pfx']],\n ['application/x-pkcs7-certificates', ['p7b', 'spc']],\n ['application/x-pkcs7-certreqresp', 'p7r'],\n ['application/x-pkcs7-mime', ['p7m', 'p7c']],\n ['application/x-pkcs7-signature', ['p7s', 'p7a']],\n ['application/x-pointplus', 'css'],\n ['application/x-portable-anymap', 'pnm'],\n ['application/x-project', ['mpc', 'mpt', 'mpv', 'mpx']],\n ['application/x-qpro', 'wb1'],\n ['application/x-rar-compressed', 'rar'],\n ['application/x-rtf', 'rtf'],\n ['application/x-sdp', 'sdp'],\n ['application/x-sea', 'sea'],\n ['application/x-seelogo', 'sl'],\n ['application/x-sh', 'sh'],\n ['application/x-shar', ['shar', 'sh']],\n ['application/x-shockwave-flash', 'swf'],\n ['application/x-silverlight-app', 'xap'],\n ['application/x-sit', 'sit'],\n ['application/x-sprite', ['spr', 'sprite']],\n ['application/x-stuffit', 'sit'],\n ['application/x-stuffitx', 'sitx'],\n ['application/x-sv4cpio', 'sv4cpio'],\n ['application/x-sv4crc', 'sv4crc'],\n ['application/x-tar', 'tar'],\n ['application/x-tbook', ['sbk', 'tbk']],\n ['application/x-tcl', 'tcl'],\n ['application/x-tex', 'tex'],\n ['application/x-tex-tfm', 'tfm'],\n ['application/x-texinfo', ['texi', 'texinfo']],\n ['application/x-troff', ['roff', 't', 'tr']],\n ['application/x-troff-man', 'man'],\n ['application/x-troff-me', 'me'],\n ['application/x-troff-ms', 'ms'],\n ['application/x-troff-msvideo', 'avi'],\n ['application/x-ustar', 'ustar'],\n ['application/x-visio', ['vsd', 'vst', 'vsw']],\n ['application/x-vnd.audioexplosion.mzz', 'mzz'],\n ['application/x-vnd.ls-xpix', 'xpix'],\n ['application/x-vrml', 'vrml'],\n ['application/x-wais-source', ['src', 'wsrc']],\n ['application/x-winhelp', 'hlp'],\n ['application/x-wintalk', 'wtk'],\n ['application/x-world', ['wrl', 'svr']],\n ['application/x-wpwin', 'wpd'],\n ['application/x-wri', 'wri'],\n ['application/x-x509-ca-cert', ['cer', 'crt', 'der']],\n ['application/x-x509-user-cert', 'crt'],\n ['application/x-xfig', 'fig'],\n ['application/x-xpinstall', 'xpi'],\n ['application/x-zip-compressed', 'zip'],\n ['application/xcap-diff+xml', 'xdf'],\n ['application/xenc+xml', 'xenc'],\n ['application/xhtml+xml', 'xhtml'],\n ['application/xml', 'xml'],\n ['application/xml-dtd', 'dtd'],\n ['application/xop+xml', 'xop'],\n ['application/xslt+xml', 'xslt'],\n ['application/xspf+xml', 'xspf'],\n ['application/xv+xml', 'mxml'],\n ['application/yang', 'yang'],\n ['application/yin+xml', 'yin'],\n ['application/ynd.ms-pkipko', 'pko'],\n ['application/zip', 'zip'],\n ['audio/adpcm', 'adp'],\n ['audio/aiff', ['aiff', 'aif', 'aifc']],\n ['audio/basic', ['snd', 'au']],\n ['audio/it', 'it'],\n ['audio/make', ['funk', 'my', 'pfunk']],\n ['audio/make.my.funk', 'pfunk'],\n ['audio/mid', ['mid', 'rmi']],\n ['audio/midi', ['midi', 'kar', 'mid']],\n ['audio/mod', 'mod'],\n ['audio/mp4', 'mp4a'],\n ['audio/mpeg', ['mpga', 'mp3', 'm2a', 'mp2', 'mpa', 'mpg']],\n ['audio/mpeg3', 'mp3'],\n ['audio/nspaudio', ['la', 'lma']],\n ['audio/ogg', 'oga'],\n ['audio/s3m', 's3m'],\n ['audio/tsp-audio', 'tsi'],\n ['audio/tsplayer', 'tsp'],\n ['audio/vnd.dece.audio', 'uva'],\n ['audio/vnd.digital-winds', 'eol'],\n ['audio/vnd.dra', 'dra'],\n ['audio/vnd.dts', 'dts'],\n ['audio/vnd.dts.hd', 'dtshd'],\n ['audio/vnd.lucent.voice', 'lvp'],\n ['audio/vnd.ms-playready.media.pya', 'pya'],\n ['audio/vnd.nuera.ecelp4800', 'ecelp4800'],\n ['audio/vnd.nuera.ecelp7470', 'ecelp7470'],\n ['audio/vnd.nuera.ecelp9600', 'ecelp9600'],\n ['audio/vnd.qcelp', 'qcp'],\n ['audio/vnd.rip', 'rip'],\n ['audio/voc', 'voc'],\n ['audio/voxware', 'vox'],\n ['audio/wav', 'wav'],\n ['audio/webm', 'weba'],\n ['audio/x-aac', 'aac'],\n ['audio/x-adpcm', 'snd'],\n ['audio/x-aiff', ['aiff', 'aif', 'aifc']],\n ['audio/x-au', 'au'],\n ['audio/x-gsm', ['gsd', 'gsm']],\n ['audio/x-jam', 'jam'],\n ['audio/x-liveaudio', 'lam'],\n ['audio/x-mid', ['mid', 'midi']],\n ['audio/x-midi', ['midi', 'mid']],\n ['audio/x-mod', 'mod'],\n ['audio/x-mpeg', 'mp2'],\n ['audio/x-mpeg-3', 'mp3'],\n ['audio/x-mpegurl', 'm3u'],\n ['audio/x-mpequrl', 'm3u'],\n ['audio/x-ms-wax', 'wax'],\n ['audio/x-ms-wma', 'wma'],\n ['audio/x-nspaudio', ['la', 'lma']],\n ['audio/x-pn-realaudio', ['ra', 'ram', 'rm', 'rmm', 'rmp']],\n ['audio/x-pn-realaudio-plugin', ['ra', 'rmp', 'rpm']],\n ['audio/x-psid', 'sid'],\n ['audio/x-realaudio', 'ra'],\n ['audio/x-twinvq', 'vqf'],\n ['audio/x-twinvq-plugin', ['vqe', 'vql']],\n ['audio/x-vnd.audioexplosion.mjuicemediafile', 'mjf'],\n ['audio/x-voc', 'voc'],\n ['audio/x-wav', 'wav'],\n ['audio/xm', 'xm'],\n ['chemical/x-cdx', 'cdx'],\n ['chemical/x-cif', 'cif'],\n ['chemical/x-cmdf', 'cmdf'],\n ['chemical/x-cml', 'cml'],\n ['chemical/x-csml', 'csml'],\n ['chemical/x-pdb', ['pdb', 'xyz']],\n ['chemical/x-xyz', 'xyz'],\n ['drawing/x-dwf', 'dwf'],\n ['i-world/i-vrml', 'ivr'],\n ['image/bmp', ['bmp', 'bm']],\n ['image/cgm', 'cgm'],\n ['image/cis-cod', 'cod'],\n ['image/cmu-raster', ['ras', 'rast']],\n ['image/fif', 'fif'],\n ['image/florian', ['flo', 'turbot']],\n ['image/g3fax', 'g3'],\n ['image/gif', 'gif'],\n ['image/ief', ['ief', 'iefs']],\n ['image/jpeg', ['jpeg', 'jpe', 'jpg', 'jfif', 'jfif-tbnl']],\n ['image/jutvision', 'jut'],\n ['image/ktx', 'ktx'],\n ['image/naplps', ['nap', 'naplps']],\n ['image/pict', ['pic', 'pict']],\n ['image/pipeg', 'jfif'],\n ['image/pjpeg', ['jfif', 'jpe', 'jpeg', 'jpg']],\n ['image/png', ['png', 'x-png']],\n ['image/prs.btif', 'btif'],\n ['image/svg+xml', 'svg'],\n ['image/tiff', ['tif', 'tiff']],\n ['image/vasa', 'mcf'],\n ['image/vnd.adobe.photoshop', 'psd'],\n ['image/vnd.dece.graphic', 'uvi'],\n ['image/vnd.djvu', 'djvu'],\n ['image/vnd.dvb.subtitle', 'sub'],\n ['image/vnd.dwg', ['dwg', 'dxf', 'svf']],\n ['image/vnd.dxf', 'dxf'],\n ['image/vnd.fastbidsheet', 'fbs'],\n ['image/vnd.fpx', 'fpx'],\n ['image/vnd.fst', 'fst'],\n ['image/vnd.fujixerox.edmics-mmr', 'mmr'],\n ['image/vnd.fujixerox.edmics-rlc', 'rlc'],\n ['image/vnd.ms-modi', 'mdi'],\n ['image/vnd.net-fpx', ['fpx', 'npx']],\n ['image/vnd.rn-realflash', 'rf'],\n ['image/vnd.rn-realpix', 'rp'],\n ['image/vnd.wap.wbmp', 'wbmp'],\n ['image/vnd.xiff', 'xif'],\n ['image/webp', 'webp'],\n ['image/x-cmu-raster', 'ras'],\n ['image/x-cmx', 'cmx'],\n ['image/x-dwg', ['dwg', 'dxf', 'svf']],\n ['image/x-freehand', 'fh'],\n ['image/x-icon', 'ico'],\n ['image/x-jg', 'art'],\n ['image/x-jps', 'jps'],\n ['image/x-niff', ['niff', 'nif']],\n ['image/x-pcx', 'pcx'],\n ['image/x-pict', ['pct', 'pic']],\n ['image/x-portable-anymap', 'pnm'],\n ['image/x-portable-bitmap', 'pbm'],\n ['image/x-portable-graymap', 'pgm'],\n ['image/x-portable-greymap', 'pgm'],\n ['image/x-portable-pixmap', 'ppm'],\n ['image/x-quicktime', ['qif', 'qti', 'qtif']],\n ['image/x-rgb', 'rgb'],\n ['image/x-tiff', ['tif', 'tiff']],\n ['image/x-windows-bmp', 'bmp'],\n ['image/x-xbitmap', 'xbm'],\n ['image/x-xbm', 'xbm'],\n ['image/x-xpixmap', ['xpm', 'pm']],\n ['image/x-xwd', 'xwd'],\n ['image/x-xwindowdump', 'xwd'],\n ['image/xbm', 'xbm'],\n ['image/xpm', 'xpm'],\n ['message/rfc822', ['eml', 'mht', 'mhtml', 'nws', 'mime']],\n ['model/iges', ['iges', 'igs']],\n ['model/mesh', 'msh'],\n ['model/vnd.collada+xml', 'dae'],\n ['model/vnd.dwf', 'dwf'],\n ['model/vnd.gdl', 'gdl'],\n ['model/vnd.gtw', 'gtw'],\n ['model/vnd.mts', 'mts'],\n ['model/vnd.vtu', 'vtu'],\n ['model/vrml', ['vrml', 'wrl', 'wrz']],\n ['model/x-pov', 'pov'],\n ['multipart/x-gzip', 'gzip'],\n ['multipart/x-ustar', 'ustar'],\n ['multipart/x-zip', 'zip'],\n ['music/crescendo', ['mid', 'midi']],\n ['music/x-karaoke', 'kar'],\n ['paleovu/x-pv', 'pvu'],\n ['text/asp', 'asp'],\n ['text/calendar', 'ics'],\n ['text/css', 'css'],\n ['text/csv', 'csv'],\n ['text/ecmascript', 'js'],\n ['text/h323', '323'],\n ['text/html', ['html', 'htm', 'stm', 'acgi', 'htmls', 'htx', 'shtml']],\n ['text/iuls', 'uls'],\n ['text/javascript', 'js'],\n ['text/mcf', 'mcf'],\n ['text/n3', 'n3'],\n ['text/pascal', 'pas'],\n [\n 'text/plain',\n [\n 'txt',\n 'bas',\n 'c',\n 'h',\n 'c++',\n 'cc',\n 'com',\n 'conf',\n 'cxx',\n 'def',\n 'f',\n 'f90',\n 'for',\n 'g',\n 'hh',\n 'idc',\n 'jav',\n 'java',\n 'list',\n 'log',\n 'lst',\n 'm',\n 'mar',\n 'pl',\n 'sdml',\n 'text'\n ]\n ],\n ['text/plain-bas', 'par'],\n ['text/prs.lines.tag', 'dsc'],\n ['text/richtext', ['rtx', 'rt', 'rtf']],\n ['text/scriplet', 'wsc'],\n ['text/scriptlet', 'sct'],\n ['text/sgml', ['sgm', 'sgml']],\n ['text/tab-separated-values', 'tsv'],\n ['text/troff', 't'],\n ['text/turtle', 'ttl'],\n ['text/uri-list', ['uni', 'unis', 'uri', 'uris']],\n ['text/vnd.abc', 'abc'],\n ['text/vnd.curl', 'curl'],\n ['text/vnd.curl.dcurl', 'dcurl'],\n ['text/vnd.curl.mcurl', 'mcurl'],\n ['text/vnd.curl.scurl', 'scurl'],\n ['text/vnd.fly', 'fly'],\n ['text/vnd.fmi.flexstor', 'flx'],\n ['text/vnd.graphviz', 'gv'],\n ['text/vnd.in3d.3dml', '3dml'],\n ['text/vnd.in3d.spot', 'spot'],\n ['text/vnd.rn-realtext', 'rt'],\n ['text/vnd.sun.j2me.app-descriptor', 'jad'],\n ['text/vnd.wap.wml', 'wml'],\n ['text/vnd.wap.wmlscript', 'wmls'],\n ['text/webviewhtml', 'htt'],\n ['text/x-asm', ['asm', 's']],\n ['text/x-audiosoft-intra', 'aip'],\n ['text/x-c', ['c', 'cc', 'cpp']],\n ['text/x-component', 'htc'],\n ['text/x-fortran', ['for', 'f', 'f77', 'f90']],\n ['text/x-h', ['h', 'hh']],\n ['text/x-java-source', ['java', 'jav']],\n ['text/x-java-source,java', 'java'],\n ['text/x-la-asf', 'lsx'],\n ['text/x-m', 'm'],\n ['text/x-pascal', 'p'],\n ['text/x-script', 'hlb'],\n ['text/x-script.csh', 'csh'],\n ['text/x-script.elisp', 'el'],\n ['text/x-script.guile', 'scm'],\n ['text/x-script.ksh', 'ksh'],\n ['text/x-script.lisp', 'lsp'],\n ['text/x-script.perl', 'pl'],\n ['text/x-script.perl-module', 'pm'],\n ['text/x-script.phyton', 'py'],\n ['text/x-script.rexx', 'rexx'],\n ['text/x-script.scheme', 'scm'],\n ['text/x-script.sh', 'sh'],\n ['text/x-script.tcl', 'tcl'],\n ['text/x-script.tcsh', 'tcsh'],\n ['text/x-script.zsh', 'zsh'],\n ['text/x-server-parsed-html', ['shtml', 'ssi']],\n ['text/x-setext', 'etx'],\n ['text/x-sgml', ['sgm', 'sgml']],\n ['text/x-speech', ['spc', 'talk']],\n ['text/x-uil', 'uil'],\n ['text/x-uuencode', ['uu', 'uue']],\n ['text/x-vcalendar', 'vcs'],\n ['text/x-vcard', 'vcf'],\n ['text/xml', 'xml'],\n ['video/3gpp', '3gp'],\n ['video/3gpp2', '3g2'],\n ['video/animaflex', 'afl'],\n ['video/avi', 'avi'],\n ['video/avs-video', 'avs'],\n ['video/dl', 'dl'],\n ['video/fli', 'fli'],\n ['video/gl', 'gl'],\n ['video/h261', 'h261'],\n ['video/h263', 'h263'],\n ['video/h264', 'h264'],\n ['video/jpeg', 'jpgv'],\n ['video/jpm', 'jpm'],\n ['video/mj2', 'mj2'],\n ['video/mp4', 'mp4'],\n ['video/mpeg', ['mpeg', 'mp2', 'mpa', 'mpe', 'mpg', 'mpv2', 'm1v', 'm2v', 'mp3']],\n ['video/msvideo', 'avi'],\n ['video/ogg', 'ogv'],\n ['video/quicktime', ['mov', 'qt', 'moov']],\n ['video/vdo', 'vdo'],\n ['video/vivo', ['viv', 'vivo']],\n ['video/vnd.dece.hd', 'uvh'],\n ['video/vnd.dece.mobile', 'uvm'],\n ['video/vnd.dece.pd', 'uvp'],\n ['video/vnd.dece.sd', 'uvs'],\n ['video/vnd.dece.video', 'uvv'],\n ['video/vnd.fvt', 'fvt'],\n ['video/vnd.mpegurl', 'mxu'],\n ['video/vnd.ms-playready.media.pyv', 'pyv'],\n ['video/vnd.rn-realvideo', 'rv'],\n ['video/vnd.uvvu.mp4', 'uvu'],\n ['video/vnd.vivo', ['viv', 'vivo']],\n ['video/vosaic', 'vos'],\n ['video/webm', 'webm'],\n ['video/x-amt-demorun', 'xdr'],\n ['video/x-amt-showrun', 'xsr'],\n ['video/x-atomic3d-feature', 'fmf'],\n ['video/x-dl', 'dl'],\n ['video/x-dv', ['dif', 'dv']],\n ['video/x-f4v', 'f4v'],\n ['video/x-fli', 'fli'],\n ['video/x-flv', 'flv'],\n ['video/x-gl', 'gl'],\n ['video/x-isvideo', 'isu'],\n ['video/x-la-asf', ['lsf', 'lsx']],\n ['video/x-m4v', 'm4v'],\n ['video/x-motion-jpeg', 'mjpg'],\n ['video/x-mpeg', ['mp3', 'mp2']],\n ['video/x-mpeq2a', 'mp2'],\n ['video/x-ms-asf', ['asf', 'asr', 'asx']],\n ['video/x-ms-asf-plugin', 'asx'],\n ['video/x-ms-wm', 'wm'],\n ['video/x-ms-wmv', 'wmv'],\n ['video/x-ms-wmx', 'wmx'],\n ['video/x-ms-wvx', 'wvx'],\n ['video/x-msvideo', 'avi'],\n ['video/x-qtc', 'qtc'],\n ['video/x-scm', 'scm'],\n ['video/x-sgi-movie', ['movie', 'mv']],\n ['windows/metafile', 'wmf'],\n ['www/mime', 'mime'],\n ['x-conference/x-cooltalk', 'ice'],\n ['x-music/x-midi', ['mid', 'midi']],\n ['x-world/x-3dmf', ['3dm', '3dmf', 'qd3', 'qd3d']],\n ['x-world/x-svr', 'svr'],\n ['x-world/x-vrml', ['flr', 'vrml', 'wrl', 'wrz', 'xaf', 'xof']],\n ['x-world/x-vrt', 'vrt'],\n ['xgl/drawing', 'xgz'],\n ['xgl/movie', 'xmz']\n]);\nconst extensions = new Map([\n ['123', 'application/vnd.lotus-1-2-3'],\n ['323', 'text/h323'],\n ['*', 'application/octet-stream'],\n ['3dm', 'x-world/x-3dmf'],\n ['3dmf', 'x-world/x-3dmf'],\n ['3dml', 'text/vnd.in3d.3dml'],\n ['3g2', 'video/3gpp2'],\n ['3gp', 'video/3gpp'],\n ['7z', 'application/x-7z-compressed'],\n ['a', 'application/octet-stream'],\n ['aab', 'application/x-authorware-bin'],\n ['aac', 'audio/x-aac'],\n ['aam', 'application/x-authorware-map'],\n ['aas', 'application/x-authorware-seg'],\n ['abc', 'text/vnd.abc'],\n ['abw', 'application/x-abiword'],\n ['ac', 'application/pkix-attr-cert'],\n ['acc', 'application/vnd.americandynamics.acc'],\n ['ace', 'application/x-ace-compressed'],\n ['acgi', 'text/html'],\n ['acu', 'application/vnd.acucobol'],\n ['acx', 'application/internet-property-stream'],\n ['adp', 'audio/adpcm'],\n ['aep', 'application/vnd.audiograph'],\n ['afl', 'video/animaflex'],\n ['afp', 'application/vnd.ibm.modcap'],\n ['ahead', 'application/vnd.ahead.space'],\n ['ai', 'application/postscript'],\n ['aif', ['audio/aiff', 'audio/x-aiff']],\n ['aifc', ['audio/aiff', 'audio/x-aiff']],\n ['aiff', ['audio/aiff', 'audio/x-aiff']],\n ['aim', 'application/x-aim'],\n ['aip', 'text/x-audiosoft-intra'],\n ['air', 'application/vnd.adobe.air-application-installer-package+zip'],\n ['ait', 'application/vnd.dvb.ait'],\n ['ami', 'application/vnd.amiga.ami'],\n ['ani', 'application/x-navi-animation'],\n ['aos', 'application/x-nokia-9000-communicator-add-on-software'],\n ['apk', 'application/vnd.android.package-archive'],\n ['application', 'application/x-ms-application'],\n ['apr', 'application/vnd.lotus-approach'],\n ['aps', 'application/mime'],\n ['arc', 'application/octet-stream'],\n ['arj', ['application/arj', 'application/octet-stream']],\n ['art', 'image/x-jg'],\n ['asf', 'video/x-ms-asf'],\n ['asm', 'text/x-asm'],\n ['aso', 'application/vnd.accpac.simply.aso'],\n ['asp', 'text/asp'],\n ['asr', 'video/x-ms-asf'],\n ['asx', ['video/x-ms-asf', 'application/x-mplayer2', 'video/x-ms-asf-plugin']],\n ['atc', 'application/vnd.acucorp'],\n ['atomcat', 'application/atomcat+xml'],\n ['atomsvc', 'application/atomsvc+xml'],\n ['atx', 'application/vnd.antix.game-component'],\n ['au', ['audio/basic', 'audio/x-au']],\n ['avi', ['video/avi', 'video/msvideo', 'application/x-troff-msvideo', 'video/x-msvideo']],\n ['avs', 'video/avs-video'],\n ['aw', 'application/applixware'],\n ['axs', 'application/olescript'],\n ['azf', 'application/vnd.airzip.filesecure.azf'],\n ['azs', 'application/vnd.airzip.filesecure.azs'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bas', 'text/plain'],\n ['bcpio', 'application/x-bcpio'],\n ['bdf', 'application/x-font-bdf'],\n ['bdm', 'application/vnd.syncml.dm+wbxml'],\n ['bed', 'application/vnd.realvnc.bed'],\n ['bh2', 'application/vnd.fujitsu.oasysprs'],\n ['bin', ['application/octet-stream', 'application/mac-binary', 'application/macbinary', 'application/x-macbinary', 'application/x-binary']],\n ['bm', 'image/bmp'],\n ['bmi', 'application/vnd.bmi'],\n ['bmp', ['image/bmp', 'image/x-windows-bmp']],\n ['boo', 'application/book'],\n ['book', 'application/book'],\n ['box', 'application/vnd.previewsystems.box'],\n ['boz', 'application/x-bzip2'],\n ['bsh', 'application/x-bsh'],\n ['btif', 'image/prs.btif'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['c', ['text/plain', 'text/x-c']],\n ['c++', 'text/plain'],\n ['c11amc', 'application/vnd.cluetrust.cartomobile-config'],\n ['c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg'],\n ['c4g', 'application/vnd.clonk.c4group'],\n ['cab', 'application/vnd.ms-cab-compressed'],\n ['car', 'application/vnd.curl.car'],\n ['cat', ['application/vnd.ms-pkiseccat', 'application/vnd.ms-pki.seccat']],\n ['cc', ['text/plain', 'text/x-c']],\n ['ccad', 'application/clariscad'],\n ['cco', 'application/x-cocoa'],\n ['ccxml', 'application/ccxml+xml,'],\n ['cdbcmsg', 'application/vnd.contact.cmsg'],\n ['cdf', ['application/cdf', 'application/x-cdf', 'application/x-netcdf']],\n ['cdkey', 'application/vnd.mediastation.cdkey'],\n ['cdmia', 'application/cdmi-capability'],\n ['cdmic', 'application/cdmi-container'],\n ['cdmid', 'application/cdmi-domain'],\n ['cdmio', 'application/cdmi-object'],\n ['cdmiq', 'application/cdmi-queue'],\n ['cdx', 'chemical/x-cdx'],\n ['cdxml', 'application/vnd.chemdraw+xml'],\n ['cdy', 'application/vnd.cinderella'],\n ['cer', ['application/pkix-cert', 'application/x-x509-ca-cert']],\n ['cgm', 'image/cgm'],\n ['cha', 'application/x-chat'],\n ['chat', 'application/x-chat'],\n ['chm', 'application/vnd.ms-htmlhelp'],\n ['chrt', 'application/vnd.kde.kchart'],\n ['cif', 'chemical/x-cif'],\n ['cii', 'application/vnd.anser-web-certificate-issue-initiation'],\n ['cil', 'application/vnd.ms-artgalry'],\n ['cla', 'application/vnd.claymore'],\n ['class', ['application/octet-stream', 'application/java', 'application/java-byte-code', 'application/java-vm', 'application/x-java-class']],\n ['clkk', 'application/vnd.crick.clicker.keyboard'],\n ['clkp', 'application/vnd.crick.clicker.palette'],\n ['clkt', 'application/vnd.crick.clicker.template'],\n ['clkw', 'application/vnd.crick.clicker.wordbank'],\n ['clkx', 'application/vnd.crick.clicker'],\n ['clp', 'application/x-msclip'],\n ['cmc', 'application/vnd.cosmocaller'],\n ['cmdf', 'chemical/x-cmdf'],\n ['cml', 'chemical/x-cml'],\n ['cmp', 'application/vnd.yellowriver-custom-menu'],\n ['cmx', 'image/x-cmx'],\n ['cod', ['image/cis-cod', 'application/vnd.rim.cod']],\n ['com', ['application/octet-stream', 'text/plain']],\n ['conf', 'text/plain'],\n ['cpio', 'application/x-cpio'],\n ['cpp', 'text/x-c'],\n ['cpt', ['application/mac-compactpro', 'application/x-compactpro', 'application/x-cpt']],\n ['crd', 'application/x-mscardfile'],\n ['crl', ['application/pkix-crl', 'application/pkcs-crl']],\n ['crt', ['application/pkix-cert', 'application/x-x509-user-cert', 'application/x-x509-ca-cert']],\n ['cryptonote', 'application/vnd.rig.cryptonote'],\n ['csh', ['text/x-script.csh', 'application/x-csh']],\n ['csml', 'chemical/x-csml'],\n ['csp', 'application/vnd.commonspace'],\n ['css', ['text/css', 'application/x-pointplus']],\n ['csv', 'text/csv'],\n ['cu', 'application/cu-seeme'],\n ['curl', 'text/vnd.curl'],\n ['cww', 'application/prs.cww'],\n ['cxx', 'text/plain'],\n ['dae', 'model/vnd.collada+xml'],\n ['daf', 'application/vnd.mobius.daf'],\n ['davmount', 'application/davmount+xml'],\n ['dcr', 'application/x-director'],\n ['dcurl', 'text/vnd.curl.dcurl'],\n ['dd2', 'application/vnd.oma.dd2+xml'],\n ['ddd', 'application/vnd.fujixerox.ddd'],\n ['deb', 'application/x-debian-package'],\n ['deepv', 'application/x-deepv'],\n ['def', 'text/plain'],\n ['der', 'application/x-x509-ca-cert'],\n ['dfac', 'application/vnd.dreamfactory'],\n ['dif', 'video/x-dv'],\n ['dir', 'application/x-director'],\n ['dis', 'application/vnd.mobius.dis'],\n ['djvu', 'image/vnd.djvu'],\n ['dl', ['video/dl', 'video/x-dl']],\n ['dll', 'application/x-msdownload'],\n ['dms', 'application/octet-stream'],\n ['dna', 'application/vnd.dna'],\n ['doc', 'application/msword'],\n ['docm', 'application/vnd.ms-word.document.macroenabled.12'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['dot', 'application/msword'],\n ['dotm', 'application/vnd.ms-word.template.macroenabled.12'],\n ['dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'],\n ['dp', ['application/commonground', 'application/vnd.osgi.dp']],\n ['dpg', 'application/vnd.dpgraph'],\n ['dra', 'audio/vnd.dra'],\n ['drw', 'application/drafting'],\n ['dsc', 'text/prs.lines.tag'],\n ['dssc', 'application/dssc+der'],\n ['dtb', 'application/x-dtbook+xml'],\n ['dtd', 'application/xml-dtd'],\n ['dts', 'audio/vnd.dts'],\n ['dtshd', 'audio/vnd.dts.hd'],\n ['dump', 'application/octet-stream'],\n ['dv', 'video/x-dv'],\n ['dvi', 'application/x-dvi'],\n ['dwf', ['model/vnd.dwf', 'drawing/x-dwf']],\n ['dwg', ['application/acad', 'image/vnd.dwg', 'image/x-dwg']],\n ['dxf', ['application/dxf', 'image/vnd.dwg', 'image/vnd.dxf', 'image/x-dwg']],\n ['dxp', 'application/vnd.spotfire.dxp'],\n ['dxr', 'application/x-director'],\n ['ecelp4800', 'audio/vnd.nuera.ecelp4800'],\n ['ecelp7470', 'audio/vnd.nuera.ecelp7470'],\n ['ecelp9600', 'audio/vnd.nuera.ecelp9600'],\n ['edm', 'application/vnd.novadigm.edm'],\n ['edx', 'application/vnd.novadigm.edx'],\n ['efif', 'application/vnd.picsel'],\n ['ei6', 'application/vnd.pg.osasli'],\n ['el', 'text/x-script.elisp'],\n ['elc', ['application/x-elc', 'application/x-bytecode.elisp']],\n ['eml', 'message/rfc822'],\n ['emma', 'application/emma+xml'],\n ['env', 'application/x-envoy'],\n ['eol', 'audio/vnd.digital-winds'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['eps', 'application/postscript'],\n ['epub', 'application/epub+zip'],\n ['es', ['application/ecmascript', 'application/x-esrehber']],\n ['es3', 'application/vnd.eszigno3+xml'],\n ['esf', 'application/vnd.epson.esf'],\n ['etx', 'text/x-setext'],\n ['evy', ['application/envoy', 'application/x-envoy']],\n ['exe', ['application/octet-stream', 'application/x-msdownload']],\n ['exi', 'application/exi'],\n ['ext', 'application/vnd.novadigm.ext'],\n ['ez2', 'application/vnd.ezpix-album'],\n ['ez3', 'application/vnd.ezpix-package'],\n ['f', ['text/plain', 'text/x-fortran']],\n ['f4v', 'video/x-f4v'],\n ['f77', 'text/x-fortran'],\n ['f90', ['text/plain', 'text/x-fortran']],\n ['fbs', 'image/vnd.fastbidsheet'],\n ['fcs', 'application/vnd.isac.fcs'],\n ['fdf', 'application/vnd.fdf'],\n ['fe_launch', 'application/vnd.denovo.fcselayout-link'],\n ['fg5', 'application/vnd.fujitsu.oasysgp'],\n ['fh', 'image/x-freehand'],\n ['fif', ['application/fractals', 'image/fif']],\n ['fig', 'application/x-xfig'],\n ['fli', ['video/fli', 'video/x-fli']],\n ['flo', ['image/florian', 'application/vnd.micrografx.flo']],\n ['flr', 'x-world/x-vrml'],\n ['flv', 'video/x-flv'],\n ['flw', 'application/vnd.kde.kivio'],\n ['flx', 'text/vnd.fmi.flexstor'],\n ['fly', 'text/vnd.fly'],\n ['fm', 'application/vnd.framemaker'],\n ['fmf', 'video/x-atomic3d-feature'],\n ['fnc', 'application/vnd.frogans.fnc'],\n ['for', ['text/plain', 'text/x-fortran']],\n ['fpx', ['image/vnd.fpx', 'image/vnd.net-fpx']],\n ['frl', 'application/freeloader'],\n ['fsc', 'application/vnd.fsc.weblaunch'],\n ['fst', 'image/vnd.fst'],\n ['ftc', 'application/vnd.fluxtime.clip'],\n ['fti', 'application/vnd.anser-web-funds-transfer-initiation'],\n ['funk', 'audio/make'],\n ['fvt', 'video/vnd.fvt'],\n ['fxp', 'application/vnd.adobe.fxp'],\n ['fzs', 'application/vnd.fuzzysheet'],\n ['g', 'text/plain'],\n ['g2w', 'application/vnd.geoplan'],\n ['g3', 'image/g3fax'],\n ['g3w', 'application/vnd.geospace'],\n ['gac', 'application/vnd.groove-account'],\n ['gdl', 'model/vnd.gdl'],\n ['geo', 'application/vnd.dynageo'],\n ['gex', 'application/vnd.geometry-explorer'],\n ['ggb', 'application/vnd.geogebra.file'],\n ['ggt', 'application/vnd.geogebra.tool'],\n ['ghf', 'application/vnd.groove-help'],\n ['gif', 'image/gif'],\n ['gim', 'application/vnd.groove-identity-message'],\n ['gl', ['video/gl', 'video/x-gl']],\n ['gmx', 'application/vnd.gmx'],\n ['gnumeric', 'application/x-gnumeric'],\n ['gph', 'application/vnd.flographit'],\n ['gqf', 'application/vnd.grafeq'],\n ['gram', 'application/srgs'],\n ['grv', 'application/vnd.groove-injector'],\n ['grxml', 'application/srgs+xml'],\n ['gsd', 'audio/x-gsm'],\n ['gsf', 'application/x-font-ghostscript'],\n ['gsm', 'audio/x-gsm'],\n ['gsp', 'application/x-gsp'],\n ['gss', 'application/x-gss'],\n ['gtar', 'application/x-gtar'],\n ['gtm', 'application/vnd.groove-tool-message'],\n ['gtw', 'model/vnd.gtw'],\n ['gv', 'text/vnd.graphviz'],\n ['gxt', 'application/vnd.geonext'],\n ['gz', ['application/x-gzip', 'application/x-compressed']],\n ['gzip', ['multipart/x-gzip', 'application/x-gzip']],\n ['h', ['text/plain', 'text/x-h']],\n ['h261', 'video/h261'],\n ['h263', 'video/h263'],\n ['h264', 'video/h264'],\n ['hal', 'application/vnd.hal+xml'],\n ['hbci', 'application/vnd.hbci'],\n ['hdf', 'application/x-hdf'],\n ['help', 'application/x-helpfile'],\n ['hgl', 'application/vnd.hp-hpgl'],\n ['hh', ['text/plain', 'text/x-h']],\n ['hlb', 'text/x-script'],\n ['hlp', ['application/winhlp', 'application/hlp', 'application/x-helpfile', 'application/x-winhelp']],\n ['hpg', 'application/vnd.hp-hpgl'],\n ['hpgl', 'application/vnd.hp-hpgl'],\n ['hpid', 'application/vnd.hp-hpid'],\n ['hps', 'application/vnd.hp-hps'],\n [\n 'hqx',\n [\n 'application/mac-binhex40',\n 'application/binhex',\n 'application/binhex4',\n 'application/mac-binhex',\n 'application/x-binhex40',\n 'application/x-mac-binhex40'\n ]\n ],\n ['hta', 'application/hta'],\n ['htc', 'text/x-component'],\n ['htke', 'application/vnd.kenameaapp'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['htmls', 'text/html'],\n ['htt', 'text/webviewhtml'],\n ['htx', 'text/html'],\n ['hvd', 'application/vnd.yamaha.hv-dic'],\n ['hvp', 'application/vnd.yamaha.hv-voice'],\n ['hvs', 'application/vnd.yamaha.hv-script'],\n ['i2g', 'application/vnd.intergeo'],\n ['icc', 'application/vnd.iccprofile'],\n ['ice', 'x-conference/x-cooltalk'],\n ['ico', 'image/x-icon'],\n ['ics', 'text/calendar'],\n ['idc', 'text/plain'],\n ['ief', 'image/ief'],\n ['iefs', 'image/ief'],\n ['ifm', 'application/vnd.shana.informed.formdata'],\n ['iges', ['application/iges', 'model/iges']],\n ['igl', 'application/vnd.igloader'],\n ['igm', 'application/vnd.insors.igm'],\n ['igs', ['application/iges', 'model/iges']],\n ['igx', 'application/vnd.micrografx.igx'],\n ['iif', 'application/vnd.shana.informed.interchange'],\n ['iii', 'application/x-iphone'],\n ['ima', 'application/x-ima'],\n ['imap', 'application/x-httpd-imap'],\n ['imp', 'application/vnd.accpac.simply.imp'],\n ['ims', 'application/vnd.ms-ims'],\n ['inf', 'application/inf'],\n ['ins', ['application/x-internet-signup', 'application/x-internett-signup']],\n ['ip', 'application/x-ip2'],\n ['ipfix', 'application/ipfix'],\n ['ipk', 'application/vnd.shana.informed.package'],\n ['irm', 'application/vnd.ibm.rights-management'],\n ['irp', 'application/vnd.irepository.package+xml'],\n ['isp', 'application/x-internet-signup'],\n ['isu', 'video/x-isvideo'],\n ['it', 'audio/it'],\n ['itp', 'application/vnd.shana.informed.formtemplate'],\n ['iv', 'application/x-inventor'],\n ['ivp', 'application/vnd.immervision-ivp'],\n ['ivr', 'i-world/i-vrml'],\n ['ivu', 'application/vnd.immervision-ivu'],\n ['ivy', 'application/x-livescreen'],\n ['jad', 'text/vnd.sun.j2me.app-descriptor'],\n ['jam', ['application/vnd.jam', 'audio/x-jam']],\n ['jar', 'application/java-archive'],\n ['jav', ['text/plain', 'text/x-java-source']],\n ['java', ['text/plain', 'text/x-java-source,java', 'text/x-java-source']],\n ['jcm', 'application/x-java-commerce'],\n ['jfif', ['image/pipeg', 'image/jpeg', 'image/pjpeg']],\n ['jfif-tbnl', 'image/jpeg'],\n ['jisp', 'application/vnd.jisp'],\n ['jlt', 'application/vnd.hp-jlyt'],\n ['jnlp', 'application/x-java-jnlp-file'],\n ['joda', 'application/vnd.joost.joda-archive'],\n ['jpe', ['image/jpeg', 'image/pjpeg']],\n ['jpeg', ['image/jpeg', 'image/pjpeg']],\n ['jpg', ['image/jpeg', 'image/pjpeg']],\n ['jpgv', 'video/jpeg'],\n ['jpm', 'video/jpm'],\n ['jps', 'image/x-jps'],\n ['js', ['application/javascript', 'application/ecmascript', 'text/javascript', 'text/ecmascript', 'application/x-javascript']],\n ['json', 'application/json'],\n ['jut', 'image/jutvision'],\n ['kar', ['audio/midi', 'music/x-karaoke']],\n ['karbon', 'application/vnd.kde.karbon'],\n ['kfo', 'application/vnd.kde.kformula'],\n ['kia', 'application/vnd.kidspiration'],\n ['kml', 'application/vnd.google-earth.kml+xml'],\n ['kmz', 'application/vnd.google-earth.kmz'],\n ['kne', 'application/vnd.kinar'],\n ['kon', 'application/vnd.kde.kontour'],\n ['kpr', 'application/vnd.kde.kpresenter'],\n ['ksh', ['application/x-ksh', 'text/x-script.ksh']],\n ['ksp', 'application/vnd.kde.kspread'],\n ['ktx', 'image/ktx'],\n ['ktz', 'application/vnd.kahootz'],\n ['kwd', 'application/vnd.kde.kword'],\n ['la', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['lam', 'audio/x-liveaudio'],\n ['lasxml', 'application/vnd.las.las+xml'],\n ['latex', 'application/x-latex'],\n ['lbd', 'application/vnd.llamagraphics.life-balance.desktop'],\n ['lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml'],\n ['les', 'application/vnd.hhe.lesson-player'],\n ['lha', ['application/octet-stream', 'application/lha', 'application/x-lha']],\n ['lhx', 'application/octet-stream'],\n ['link66', 'application/vnd.route66.link66+xml'],\n ['list', 'text/plain'],\n ['lma', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['log', 'text/plain'],\n ['lrm', 'application/vnd.ms-lrm'],\n ['lsf', 'video/x-la-asf'],\n ['lsp', ['application/x-lisp', 'text/x-script.lisp']],\n ['lst', 'text/plain'],\n ['lsx', ['video/x-la-asf', 'text/x-la-asf']],\n ['ltf', 'application/vnd.frogans.ltf'],\n ['ltx', 'application/x-latex'],\n ['lvp', 'audio/vnd.lucent.voice'],\n ['lwp', 'application/vnd.lotus-wordpro'],\n ['lzh', ['application/octet-stream', 'application/x-lzh']],\n ['lzx', ['application/lzx', 'application/octet-stream', 'application/x-lzx']],\n ['m', ['text/plain', 'text/x-m']],\n ['m13', 'application/x-msmediaview'],\n ['m14', 'application/x-msmediaview'],\n ['m1v', 'video/mpeg'],\n ['m21', 'application/mp21'],\n ['m2a', 'audio/mpeg'],\n ['m2v', 'video/mpeg'],\n ['m3u', ['audio/x-mpegurl', 'audio/x-mpequrl']],\n ['m3u8', 'application/vnd.apple.mpegurl'],\n ['m4v', 'video/x-m4v'],\n ['ma', 'application/mathematica'],\n ['mads', 'application/mads+xml'],\n ['mag', 'application/vnd.ecowin.chart'],\n ['man', 'application/x-troff-man'],\n ['map', 'application/x-navimap'],\n ['mar', 'text/plain'],\n ['mathml', 'application/mathml+xml'],\n ['mbd', 'application/mbedlet'],\n ['mbk', 'application/vnd.mobius.mbk'],\n ['mbox', 'application/mbox'],\n ['mc$', 'application/x-magic-cap-package-1.0'],\n ['mc1', 'application/vnd.medcalcdata'],\n ['mcd', ['application/mcad', 'application/vnd.mcd', 'application/x-mathcad']],\n ['mcf', ['image/vasa', 'text/mcf']],\n ['mcp', 'application/netmc'],\n ['mcurl', 'text/vnd.curl.mcurl'],\n ['mdb', 'application/x-msaccess'],\n ['mdi', 'image/vnd.ms-modi'],\n ['me', 'application/x-troff-me'],\n ['meta4', 'application/metalink4+xml'],\n ['mets', 'application/mets+xml'],\n ['mfm', 'application/vnd.mfmp'],\n ['mgp', 'application/vnd.osgeo.mapguide.package'],\n ['mgz', 'application/vnd.proteus.magazine'],\n ['mht', 'message/rfc822'],\n ['mhtml', 'message/rfc822'],\n ['mid', ['audio/mid', 'audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['midi', ['audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['mif', ['application/vnd.mif', 'application/x-mif', 'application/x-frame']],\n ['mime', ['message/rfc822', 'www/mime']],\n ['mj2', 'video/mj2'],\n ['mjf', 'audio/x-vnd.audioexplosion.mjuicemediafile'],\n ['mjpg', 'video/x-motion-jpeg'],\n ['mlp', 'application/vnd.dolby.mlp'],\n ['mm', ['application/base64', 'application/x-meme']],\n ['mmd', 'application/vnd.chipnuts.karaoke-mmd'],\n ['mme', 'application/base64'],\n ['mmf', 'application/vnd.smaf'],\n ['mmr', 'image/vnd.fujixerox.edmics-mmr'],\n ['mny', 'application/x-msmoney'],\n ['mod', ['audio/mod', 'audio/x-mod']],\n ['mods', 'application/mods+xml'],\n ['moov', 'video/quicktime'],\n ['mov', 'video/quicktime'],\n ['movie', 'video/x-sgi-movie'],\n ['mp2', ['video/mpeg', 'audio/mpeg', 'video/x-mpeg', 'audio/x-mpeg', 'video/x-mpeq2a']],\n ['mp3', ['audio/mpeg', 'audio/mpeg3', 'video/mpeg', 'audio/x-mpeg-3', 'video/x-mpeg']],\n ['mp4', ['video/mp4', 'application/mp4']],\n ['mp4a', 'audio/mp4'],\n ['mpa', ['video/mpeg', 'audio/mpeg']],\n ['mpc', ['application/vnd.mophun.certificate', 'application/x-project']],\n ['mpe', 'video/mpeg'],\n ['mpeg', 'video/mpeg'],\n ['mpg', ['video/mpeg', 'audio/mpeg']],\n ['mpga', 'audio/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['mpm', 'application/vnd.blueice.multipass'],\n ['mpn', 'application/vnd.mophun.application'],\n ['mpp', 'application/vnd.ms-project'],\n ['mpt', 'application/x-project'],\n ['mpv', 'application/x-project'],\n ['mpv2', 'video/mpeg'],\n ['mpx', 'application/x-project'],\n ['mpy', 'application/vnd.ibm.minipay'],\n ['mqy', 'application/vnd.mobius.mqy'],\n ['mrc', 'application/marc'],\n ['mrcx', 'application/marcxml+xml'],\n ['ms', 'application/x-troff-ms'],\n ['mscml', 'application/mediaservercontrol+xml'],\n ['mseq', 'application/vnd.mseq'],\n ['msf', 'application/vnd.epson.msf'],\n ['msg', 'application/vnd.ms-outlook'],\n ['msh', 'model/mesh'],\n ['msl', 'application/vnd.mobius.msl'],\n ['msty', 'application/vnd.muvee.style'],\n ['mts', 'model/vnd.mts'],\n ['mus', 'application/vnd.musician'],\n ['musicxml', 'application/vnd.recordare.musicxml+xml'],\n ['mv', 'video/x-sgi-movie'],\n ['mvb', 'application/x-msmediaview'],\n ['mwf', 'application/vnd.mfer'],\n ['mxf', 'application/mxf'],\n ['mxl', 'application/vnd.recordare.musicxml'],\n ['mxml', 'application/xv+xml'],\n ['mxs', 'application/vnd.triscape.mxs'],\n ['mxu', 'video/vnd.mpegurl'],\n ['my', 'audio/make'],\n ['mzz', 'application/x-vnd.audioexplosion.mzz'],\n ['n-gage', 'application/vnd.nokia.n-gage.symbian.install'],\n ['n3', 'text/n3'],\n ['nap', 'image/naplps'],\n ['naplps', 'image/naplps'],\n ['nbp', 'application/vnd.wolfram.player'],\n ['nc', 'application/x-netcdf'],\n ['ncm', 'application/vnd.nokia.configuration-message'],\n ['ncx', 'application/x-dtbncx+xml'],\n ['ngdat', 'application/vnd.nokia.n-gage.data'],\n ['nif', 'image/x-niff'],\n ['niff', 'image/x-niff'],\n ['nix', 'application/x-mix-transfer'],\n ['nlu', 'application/vnd.neurolanguage.nlu'],\n ['nml', 'application/vnd.enliven'],\n ['nnd', 'application/vnd.noblenet-directory'],\n ['nns', 'application/vnd.noblenet-sealer'],\n ['nnw', 'application/vnd.noblenet-web'],\n ['npx', 'image/vnd.net-fpx'],\n ['nsc', 'application/x-conference'],\n ['nsf', 'application/vnd.lotus-notes'],\n ['nvd', 'application/x-navidoc'],\n ['nws', 'message/rfc822'],\n ['o', 'application/octet-stream'],\n ['oa2', 'application/vnd.fujitsu.oasys2'],\n ['oa3', 'application/vnd.fujitsu.oasys3'],\n ['oas', 'application/vnd.fujitsu.oasys'],\n ['obd', 'application/x-msbinder'],\n ['oda', 'application/oda'],\n ['odb', 'application/vnd.oasis.opendocument.database'],\n ['odc', 'application/vnd.oasis.opendocument.chart'],\n ['odf', 'application/vnd.oasis.opendocument.formula'],\n ['odft', 'application/vnd.oasis.opendocument.formula-template'],\n ['odg', 'application/vnd.oasis.opendocument.graphics'],\n ['odi', 'application/vnd.oasis.opendocument.image'],\n ['odm', 'application/vnd.oasis.opendocument.text-master'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['omc', 'application/x-omc'],\n ['omcd', 'application/x-omcdatamaker'],\n ['omcr', 'application/x-omcregerator'],\n ['onetoc', 'application/onenote'],\n ['opf', 'application/oebps-package+xml'],\n ['org', 'application/vnd.lotus-organizer'],\n ['osf', 'application/vnd.yamaha.openscoreformat'],\n ['osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml'],\n ['otc', 'application/vnd.oasis.opendocument.chart-template'],\n ['otf', 'application/x-font-otf'],\n ['otg', 'application/vnd.oasis.opendocument.graphics-template'],\n ['oth', 'application/vnd.oasis.opendocument.text-web'],\n ['oti', 'application/vnd.oasis.opendocument.image-template'],\n ['otp', 'application/vnd.oasis.opendocument.presentation-template'],\n ['ots', 'application/vnd.oasis.opendocument.spreadsheet-template'],\n ['ott', 'application/vnd.oasis.opendocument.text-template'],\n ['oxt', 'application/vnd.openofficeorg.extension'],\n ['p', 'text/x-pascal'],\n ['p10', ['application/pkcs10', 'application/x-pkcs10']],\n ['p12', ['application/pkcs-12', 'application/x-pkcs12']],\n ['p7a', 'application/x-pkcs7-signature'],\n ['p7b', 'application/x-pkcs7-certificates'],\n ['p7c', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7m', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7r', 'application/x-pkcs7-certreqresp'],\n ['p7s', ['application/pkcs7-signature', 'application/x-pkcs7-signature']],\n ['p8', 'application/pkcs8'],\n ['par', 'text/plain-bas'],\n ['part', 'application/pro_eng'],\n ['pas', 'text/pascal'],\n ['paw', 'application/vnd.pawaafile'],\n ['pbd', 'application/vnd.powerbuilder6'],\n ['pbm', 'image/x-portable-bitmap'],\n ['pcf', 'application/x-font-pcf'],\n ['pcl', ['application/vnd.hp-pcl', 'application/x-pcl']],\n ['pclxl', 'application/vnd.hp-pclxl'],\n ['pct', 'image/x-pict'],\n ['pcurl', 'application/vnd.curl.pcurl'],\n ['pcx', 'image/x-pcx'],\n ['pdb', ['application/vnd.palm', 'chemical/x-pdb']],\n ['pdf', 'application/pdf'],\n ['pfa', 'application/x-font-type1'],\n ['pfr', 'application/font-tdpfr'],\n ['pfunk', ['audio/make', 'audio/make.my.funk']],\n ['pfx', 'application/x-pkcs12'],\n ['pgm', ['image/x-portable-graymap', 'image/x-portable-greymap']],\n ['pgn', 'application/x-chess-pgn'],\n ['pgp', 'application/pgp-signature'],\n ['pic', ['image/pict', 'image/x-pict']],\n ['pict', 'image/pict'],\n ['pkg', 'application/x-newton-compatible-pkg'],\n ['pki', 'application/pkixcmp'],\n ['pkipath', 'application/pkix-pkipath'],\n ['pko', ['application/ynd.ms-pkipko', 'application/vnd.ms-pki.pko']],\n ['pl', ['text/plain', 'text/x-script.perl']],\n ['plb', 'application/vnd.3gpp.pic-bw-large'],\n ['plc', 'application/vnd.mobius.plc'],\n ['plf', 'application/vnd.pocketlearn'],\n ['pls', 'application/pls+xml'],\n ['plx', 'application/x-pixclscript'],\n ['pm', ['text/x-script.perl-module', 'image/x-xpixmap']],\n ['pm4', 'application/x-pagemaker'],\n ['pm5', 'application/x-pagemaker'],\n ['pma', 'application/x-perfmon'],\n ['pmc', 'application/x-perfmon'],\n ['pml', ['application/vnd.ctc-posml', 'application/x-perfmon']],\n ['pmr', 'application/x-perfmon'],\n ['pmw', 'application/x-perfmon'],\n ['png', 'image/png'],\n ['pnm', ['application/x-portable-anymap', 'image/x-portable-anymap']],\n ['portpkg', 'application/vnd.macports.portpkg'],\n ['pot', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['potm', 'application/vnd.ms-powerpoint.template.macroenabled.12'],\n ['potx', 'application/vnd.openxmlformats-officedocument.presentationml.template'],\n ['pov', 'model/x-pov'],\n ['ppa', 'application/vnd.ms-powerpoint'],\n ['ppam', 'application/vnd.ms-powerpoint.addin.macroenabled.12'],\n ['ppd', 'application/vnd.cups-ppd'],\n ['ppm', 'image/x-portable-pixmap'],\n ['pps', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['ppsm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12'],\n ['ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'],\n ['ppt', ['application/vnd.ms-powerpoint', 'application/mspowerpoint', 'application/powerpoint', 'application/x-mspowerpoint']],\n ['pptm', 'application/vnd.ms-powerpoint.presentation.macroenabled.12'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['ppz', 'application/mspowerpoint'],\n ['prc', 'application/x-mobipocket-ebook'],\n ['pre', ['application/vnd.lotus-freelance', 'application/x-freelance']],\n ['prf', 'application/pics-rules'],\n ['prt', 'application/pro_eng'],\n ['ps', 'application/postscript'],\n ['psb', 'application/vnd.3gpp.pic-bw-small'],\n ['psd', ['application/octet-stream', 'image/vnd.adobe.photoshop']],\n ['psf', 'application/x-font-linux-psf'],\n ['pskcxml', 'application/pskc+xml'],\n ['ptid', 'application/vnd.pvi.ptid1'],\n ['pub', 'application/x-mspublisher'],\n ['pvb', 'application/vnd.3gpp.pic-bw-var'],\n ['pvu', 'paleovu/x-pv'],\n ['pwn', 'application/vnd.3m.post-it-notes'],\n ['pwz', 'application/vnd.ms-powerpoint'],\n ['py', 'text/x-script.phyton'],\n ['pya', 'audio/vnd.ms-playready.media.pya'],\n ['pyc', 'application/x-bytecode.python'],\n ['pyv', 'video/vnd.ms-playready.media.pyv'],\n ['qam', 'application/vnd.epson.quickanime'],\n ['qbo', 'application/vnd.intu.qbo'],\n ['qcp', 'audio/vnd.qcelp'],\n ['qd3', 'x-world/x-3dmf'],\n ['qd3d', 'x-world/x-3dmf'],\n ['qfx', 'application/vnd.intu.qfx'],\n ['qif', 'image/x-quicktime'],\n ['qps', 'application/vnd.publishare-delta-tree'],\n ['qt', 'video/quicktime'],\n ['qtc', 'video/x-qtc'],\n ['qti', 'image/x-quicktime'],\n ['qtif', 'image/x-quicktime'],\n ['qxd', 'application/vnd.quark.quarkxpress'],\n ['ra', ['audio/x-realaudio', 'audio/x-pn-realaudio', 'audio/x-pn-realaudio-plugin']],\n ['ram', 'audio/x-pn-realaudio'],\n ['rar', 'application/x-rar-compressed'],\n ['ras', ['image/cmu-raster', 'application/x-cmu-raster', 'image/x-cmu-raster']],\n ['rast', 'image/cmu-raster'],\n ['rcprofile', 'application/vnd.ipunplugged.rcprofile'],\n ['rdf', 'application/rdf+xml'],\n ['rdz', 'application/vnd.data-vision.rdz'],\n ['rep', 'application/vnd.businessobjects'],\n ['res', 'application/x-dtbresource+xml'],\n ['rexx', 'text/x-script.rexx'],\n ['rf', 'image/vnd.rn-realflash'],\n ['rgb', 'image/x-rgb'],\n ['rif', 'application/reginfo+xml'],\n ['rip', 'audio/vnd.rip'],\n ['rl', 'application/resource-lists+xml'],\n ['rlc', 'image/vnd.fujixerox.edmics-rlc'],\n ['rld', 'application/resource-lists-diff+xml'],\n ['rm', ['application/vnd.rn-realmedia', 'audio/x-pn-realaudio']],\n ['rmi', 'audio/mid'],\n ['rmm', 'audio/x-pn-realaudio'],\n ['rmp', ['audio/x-pn-realaudio-plugin', 'audio/x-pn-realaudio']],\n ['rms', 'application/vnd.jcp.javame.midlet-rms'],\n ['rnc', 'application/relax-ng-compact-syntax'],\n ['rng', ['application/ringing-tones', 'application/vnd.nokia.ringing-tone']],\n ['rnx', 'application/vnd.rn-realplayer'],\n ['roff', 'application/x-troff'],\n ['rp', 'image/vnd.rn-realpix'],\n ['rp9', 'application/vnd.cloanto.rp9'],\n ['rpm', 'audio/x-pn-realaudio-plugin'],\n ['rpss', 'application/vnd.nokia.radio-presets'],\n ['rpst', 'application/vnd.nokia.radio-preset'],\n ['rq', 'application/sparql-query'],\n ['rs', 'application/rls-services+xml'],\n ['rsd', 'application/rsd+xml'],\n ['rt', ['text/richtext', 'text/vnd.rn-realtext']],\n ['rtf', ['application/rtf', 'text/richtext', 'application/x-rtf']],\n ['rtx', ['text/richtext', 'application/rtf']],\n ['rv', 'video/vnd.rn-realvideo'],\n ['s', 'text/x-asm'],\n ['s3m', 'audio/s3m'],\n ['saf', 'application/vnd.yamaha.smaf-audio'],\n ['saveme', 'application/octet-stream'],\n ['sbk', 'application/x-tbook'],\n ['sbml', 'application/sbml+xml'],\n ['sc', 'application/vnd.ibm.secure-container'],\n ['scd', 'application/x-msschedule'],\n ['scm', ['application/vnd.lotus-screencam', 'video/x-scm', 'text/x-script.guile', 'application/x-lotusscreencam', 'text/x-script.scheme']],\n ['scq', 'application/scvp-cv-request'],\n ['scs', 'application/scvp-cv-response'],\n ['sct', 'text/scriptlet'],\n ['scurl', 'text/vnd.curl.scurl'],\n ['sda', 'application/vnd.stardivision.draw'],\n ['sdc', 'application/vnd.stardivision.calc'],\n ['sdd', 'application/vnd.stardivision.impress'],\n ['sdkm', 'application/vnd.solent.sdkm+xml'],\n ['sdml', 'text/plain'],\n ['sdp', ['application/sdp', 'application/x-sdp']],\n ['sdr', 'application/sounder'],\n ['sdw', 'application/vnd.stardivision.writer'],\n ['sea', ['application/sea', 'application/x-sea']],\n ['see', 'application/vnd.seemail'],\n ['seed', 'application/vnd.fdsn.seed'],\n ['sema', 'application/vnd.sema'],\n ['semd', 'application/vnd.semd'],\n ['semf', 'application/vnd.semf'],\n ['ser', 'application/java-serialized-object'],\n ['set', 'application/set'],\n ['setpay', 'application/set-payment-initiation'],\n ['setreg', 'application/set-registration-initiation'],\n ['sfd-hdstx', 'application/vnd.hydrostatix.sof-data'],\n ['sfs', 'application/vnd.spotfire.sfs'],\n ['sgl', 'application/vnd.stardivision.writer-global'],\n ['sgm', ['text/sgml', 'text/x-sgml']],\n ['sgml', ['text/sgml', 'text/x-sgml']],\n ['sh', ['application/x-shar', 'application/x-bsh', 'application/x-sh', 'text/x-script.sh']],\n ['shar', ['application/x-bsh', 'application/x-shar']],\n ['shf', 'application/shf+xml'],\n ['shtml', ['text/html', 'text/x-server-parsed-html']],\n ['sid', 'audio/x-psid'],\n ['sis', 'application/vnd.symbian.install'],\n ['sit', ['application/x-stuffit', 'application/x-sit']],\n ['sitx', 'application/x-stuffitx'],\n ['skd', 'application/x-koan'],\n ['skm', 'application/x-koan'],\n ['skp', ['application/vnd.koan', 'application/x-koan']],\n ['skt', 'application/x-koan'],\n ['sl', 'application/x-seelogo'],\n ['sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12'],\n ['sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide'],\n ['slt', 'application/vnd.epson.salt'],\n ['sm', 'application/vnd.stepmania.stepchart'],\n ['smf', 'application/vnd.stardivision.math'],\n ['smi', ['application/smil', 'application/smil+xml']],\n ['smil', 'application/smil'],\n ['snd', ['audio/basic', 'audio/x-adpcm']],\n ['snf', 'application/x-font-snf'],\n ['sol', 'application/solids'],\n ['spc', ['text/x-speech', 'application/x-pkcs7-certificates']],\n ['spf', 'application/vnd.yamaha.smaf-phrase'],\n ['spl', ['application/futuresplash', 'application/x-futuresplash']],\n ['spot', 'text/vnd.in3d.spot'],\n ['spp', 'application/scvp-vp-response'],\n ['spq', 'application/scvp-vp-request'],\n ['spr', 'application/x-sprite'],\n ['sprite', 'application/x-sprite'],\n ['src', 'application/x-wais-source'],\n ['sru', 'application/sru+xml'],\n ['srx', 'application/sparql-results+xml'],\n ['sse', 'application/vnd.kodak-descriptor'],\n ['ssf', 'application/vnd.epson.ssf'],\n ['ssi', 'text/x-server-parsed-html'],\n ['ssm', 'application/streamingmedia'],\n ['ssml', 'application/ssml+xml'],\n ['sst', ['application/vnd.ms-pkicertstore', 'application/vnd.ms-pki.certstore']],\n ['st', 'application/vnd.sailingtracker.track'],\n ['stc', 'application/vnd.sun.xml.calc.template'],\n ['std', 'application/vnd.sun.xml.draw.template'],\n ['step', 'application/step'],\n ['stf', 'application/vnd.wt.stf'],\n ['sti', 'application/vnd.sun.xml.impress.template'],\n ['stk', 'application/hyperstudio'],\n ['stl', ['application/vnd.ms-pkistl', 'application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle']],\n ['stm', 'text/html'],\n ['stp', 'application/step'],\n ['str', 'application/vnd.pg.format'],\n ['stw', 'application/vnd.sun.xml.writer.template'],\n ['sub', 'image/vnd.dvb.subtitle'],\n ['sus', 'application/vnd.sus-calendar'],\n ['sv4cpio', 'application/x-sv4cpio'],\n ['sv4crc', 'application/x-sv4crc'],\n ['svc', 'application/vnd.dvb.service'],\n ['svd', 'application/vnd.svd'],\n ['svf', ['image/vnd.dwg', 'image/x-dwg']],\n ['svg', 'image/svg+xml'],\n ['svr', ['x-world/x-svr', 'application/x-world']],\n ['swf', 'application/x-shockwave-flash'],\n ['swi', 'application/vnd.aristanetworks.swi'],\n ['sxc', 'application/vnd.sun.xml.calc'],\n ['sxd', 'application/vnd.sun.xml.draw'],\n ['sxg', 'application/vnd.sun.xml.writer.global'],\n ['sxi', 'application/vnd.sun.xml.impress'],\n ['sxm', 'application/vnd.sun.xml.math'],\n ['sxw', 'application/vnd.sun.xml.writer'],\n ['t', ['text/troff', 'application/x-troff']],\n ['talk', 'text/x-speech'],\n ['tao', 'application/vnd.tao.intent-module-archive'],\n ['tar', 'application/x-tar'],\n ['tbk', ['application/toolbook', 'application/x-tbook']],\n ['tcap', 'application/vnd.3gpp2.tcap'],\n ['tcl', ['text/x-script.tcl', 'application/x-tcl']],\n ['tcsh', 'text/x-script.tcsh'],\n ['teacher', 'application/vnd.smart.teacher'],\n ['tei', 'application/tei+xml'],\n ['tex', 'application/x-tex'],\n ['texi', 'application/x-texinfo'],\n ['texinfo', 'application/x-texinfo'],\n ['text', ['application/plain', 'text/plain']],\n ['tfi', 'application/thraud+xml'],\n ['tfm', 'application/x-tex-tfm'],\n ['tgz', ['application/gnutar', 'application/x-compressed']],\n ['thmx', 'application/vnd.ms-officetheme'],\n ['tif', ['image/tiff', 'image/x-tiff']],\n ['tiff', ['image/tiff', 'image/x-tiff']],\n ['tmo', 'application/vnd.tmobile-livetv'],\n ['torrent', 'application/x-bittorrent'],\n ['tpl', 'application/vnd.groove-tool-template'],\n ['tpt', 'application/vnd.trid.tpt'],\n ['tr', 'application/x-troff'],\n ['tra', 'application/vnd.trueapp'],\n ['trm', 'application/x-msterminal'],\n ['tsd', 'application/timestamped-data'],\n ['tsi', 'audio/tsp-audio'],\n ['tsp', ['application/dsptype', 'audio/tsplayer']],\n ['tsv', 'text/tab-separated-values'],\n ['ttf', 'application/x-font-ttf'],\n ['ttl', 'text/turtle'],\n ['turbot', 'image/florian'],\n ['twd', 'application/vnd.simtech-mindmapper'],\n ['txd', 'application/vnd.genomatix.tuxedo'],\n ['txf', 'application/vnd.mobius.txf'],\n ['txt', 'text/plain'],\n ['ufd', 'application/vnd.ufdl'],\n ['uil', 'text/x-uil'],\n ['uls', 'text/iuls'],\n ['umj', 'application/vnd.umajin'],\n ['uni', 'text/uri-list'],\n ['unis', 'text/uri-list'],\n ['unityweb', 'application/vnd.unity'],\n ['unv', 'application/i-deas'],\n ['uoml', 'application/vnd.uoml+xml'],\n ['uri', 'text/uri-list'],\n ['uris', 'text/uri-list'],\n ['ustar', ['application/x-ustar', 'multipart/x-ustar']],\n ['utz', 'application/vnd.uiq.theme'],\n ['uu', ['application/octet-stream', 'text/x-uuencode']],\n ['uue', 'text/x-uuencode'],\n ['uva', 'audio/vnd.dece.audio'],\n ['uvh', 'video/vnd.dece.hd'],\n ['uvi', 'image/vnd.dece.graphic'],\n ['uvm', 'video/vnd.dece.mobile'],\n ['uvp', 'video/vnd.dece.pd'],\n ['uvs', 'video/vnd.dece.sd'],\n ['uvu', 'video/vnd.uvvu.mp4'],\n ['uvv', 'video/vnd.dece.video'],\n ['vcd', 'application/x-cdlink'],\n ['vcf', 'text/x-vcard'],\n ['vcg', 'application/vnd.groove-vcard'],\n ['vcs', 'text/x-vcalendar'],\n ['vcx', 'application/vnd.vcx'],\n ['vda', 'application/vda'],\n ['vdo', 'video/vdo'],\n ['vew', 'application/groupwise'],\n ['vis', 'application/vnd.visionary'],\n ['viv', ['video/vivo', 'video/vnd.vivo']],\n ['vivo', ['video/vivo', 'video/vnd.vivo']],\n ['vmd', 'application/vocaltec-media-desc'],\n ['vmf', 'application/vocaltec-media-file'],\n ['voc', ['audio/voc', 'audio/x-voc']],\n ['vos', 'video/vosaic'],\n ['vox', 'audio/voxware'],\n ['vqe', 'audio/x-twinvq-plugin'],\n ['vqf', 'audio/x-twinvq'],\n ['vql', 'audio/x-twinvq-plugin'],\n ['vrml', ['model/vrml', 'x-world/x-vrml', 'application/x-vrml']],\n ['vrt', 'x-world/x-vrt'],\n ['vsd', ['application/vnd.visio', 'application/x-visio']],\n ['vsf', 'application/vnd.vsf'],\n ['vst', 'application/x-visio'],\n ['vsw', 'application/x-visio'],\n ['vtu', 'model/vnd.vtu'],\n ['vxml', 'application/voicexml+xml'],\n ['w60', 'application/wordperfect6.0'],\n ['w61', 'application/wordperfect6.1'],\n ['w6w', 'application/msword'],\n ['wad', 'application/x-doom'],\n ['wav', ['audio/wav', 'audio/x-wav']],\n ['wax', 'audio/x-ms-wax'],\n ['wb1', 'application/x-qpro'],\n ['wbmp', 'image/vnd.wap.wbmp'],\n ['wbs', 'application/vnd.criticaltools.wbs+xml'],\n ['wbxml', 'application/vnd.wap.wbxml'],\n ['wcm', 'application/vnd.ms-works'],\n ['wdb', 'application/vnd.ms-works'],\n ['web', 'application/vnd.xara'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['wg', 'application/vnd.pmi.widget'],\n ['wgt', 'application/widget'],\n ['wiz', 'application/msword'],\n ['wk1', 'application/x-123'],\n ['wks', 'application/vnd.ms-works'],\n ['wm', 'video/x-ms-wm'],\n ['wma', 'audio/x-ms-wma'],\n ['wmd', 'application/x-ms-wmd'],\n ['wmf', ['windows/metafile', 'application/x-msmetafile']],\n ['wml', 'text/vnd.wap.wml'],\n ['wmlc', 'application/vnd.wap.wmlc'],\n ['wmls', 'text/vnd.wap.wmlscript'],\n ['wmlsc', 'application/vnd.wap.wmlscriptc'],\n ['wmv', 'video/x-ms-wmv'],\n ['wmx', 'video/x-ms-wmx'],\n ['wmz', 'application/x-ms-wmz'],\n ['woff', 'application/x-font-woff'],\n ['word', 'application/msword'],\n ['wp', 'application/wordperfect'],\n ['wp5', ['application/wordperfect', 'application/wordperfect6.0']],\n ['wp6', 'application/wordperfect'],\n ['wpd', ['application/wordperfect', 'application/vnd.wordperfect', 'application/x-wpwin']],\n ['wpl', 'application/vnd.ms-wpl'],\n ['wps', 'application/vnd.ms-works'],\n ['wq1', 'application/x-lotus'],\n ['wqd', 'application/vnd.wqd'],\n ['wri', ['application/mswrite', 'application/x-wri', 'application/x-mswrite']],\n ['wrl', ['model/vrml', 'x-world/x-vrml', 'application/x-world']],\n ['wrz', ['model/vrml', 'x-world/x-vrml']],\n ['wsc', 'text/scriplet'],\n ['wsdl', 'application/wsdl+xml'],\n ['wspolicy', 'application/wspolicy+xml'],\n ['wsrc', 'application/x-wais-source'],\n ['wtb', 'application/vnd.webturbo'],\n ['wtk', 'application/x-wintalk'],\n ['wvx', 'video/x-ms-wvx'],\n ['x-png', 'image/png'],\n ['x3d', 'application/vnd.hzn-3d-crossword'],\n ['xaf', 'x-world/x-vrml'],\n ['xap', 'application/x-silverlight-app'],\n ['xar', 'application/vnd.xara'],\n ['xbap', 'application/x-ms-xbap'],\n ['xbd', 'application/vnd.fujixerox.docuworks.binder'],\n ['xbm', ['image/xbm', 'image/x-xbm', 'image/x-xbitmap']],\n ['xdf', 'application/xcap-diff+xml'],\n ['xdm', 'application/vnd.syncml.dm+xml'],\n ['xdp', 'application/vnd.adobe.xdp+xml'],\n ['xdr', 'video/x-amt-demorun'],\n ['xdssc', 'application/dssc+xml'],\n ['xdw', 'application/vnd.fujixerox.docuworks'],\n ['xenc', 'application/xenc+xml'],\n ['xer', 'application/patch-ops-error+xml'],\n ['xfdf', 'application/vnd.adobe.xfdf'],\n ['xfdl', 'application/vnd.xfdl'],\n ['xgz', 'xgl/drawing'],\n ['xhtml', 'application/xhtml+xml'],\n ['xif', 'image/vnd.xiff'],\n ['xl', 'application/excel'],\n ['xla', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlam', 'application/vnd.ms-excel.addin.macroenabled.12'],\n ['xlb', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlc', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xld', ['application/excel', 'application/x-excel']],\n ['xlk', ['application/excel', 'application/x-excel']],\n ['xll', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlm', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xls', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlsb', 'application/vnd.ms-excel.sheet.binary.macroenabled.12'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroenabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xlt', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xltm', 'application/vnd.ms-excel.template.macroenabled.12'],\n ['xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'],\n ['xlv', ['application/excel', 'application/x-excel']],\n ['xlw', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xm', 'audio/xm'],\n ['xml', ['application/xml', 'text/xml', 'application/atom+xml', 'application/rss+xml']],\n ['xmz', 'xgl/movie'],\n ['xo', 'application/vnd.olpc-sugar'],\n ['xof', 'x-world/x-vrml'],\n ['xop', 'application/xop+xml'],\n ['xpi', 'application/x-xpinstall'],\n ['xpix', 'application/x-vnd.ls-xpix'],\n ['xpm', ['image/xpm', 'image/x-xpixmap']],\n ['xpr', 'application/vnd.is-xpr'],\n ['xps', 'application/vnd.ms-xpsdocument'],\n ['xpw', 'application/vnd.intercon.formnet'],\n ['xslt', 'application/xslt+xml'],\n ['xsm', 'application/vnd.syncml+xml'],\n ['xspf', 'application/xspf+xml'],\n ['xsr', 'video/x-amt-showrun'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['xwd', ['image/x-xwd', 'image/x-xwindowdump']],\n ['xyz', ['chemical/x-xyz', 'chemical/x-pdb']],\n ['yang', 'application/yang'],\n ['yin', 'application/yin+xml'],\n ['z', ['application/x-compressed', 'application/x-compress']],\n ['zaz', 'application/vnd.zzazz.deck+xml'],\n ['zip', ['application/zip', 'multipart/x-zip', 'application/x-zip-compressed', 'application/x-compressed']],\n ['zir', 'application/vnd.zul'],\n ['zmm', 'application/vnd.handheld-entertainment+xml'],\n ['zoo', 'application/octet-stream'],\n ['zsh', 'text/x-script.zsh']\n]);\n\nmodule.exports = {\n detectMimeType(filename) {\n if (!filename) {\n return defaultMimeType;\n }\n\n let parsed = path.parse(filename);\n let extension = (parsed.ext.substr(1) || parsed.name || '').split('?').shift().trim().toLowerCase();\n let value = defaultMimeType;\n\n if (extensions.has(extension)) {\n value = extensions.get(extension);\n }\n\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n },\n\n detectExtension(mimeType) {\n if (!mimeType) {\n return defaultExtension;\n }\n let parts = (mimeType || '').toLowerCase().trim().split('/');\n let rootType = parts.shift().trim();\n let subType = parts.join('/').trim();\n\n if (mimeTypes.has(rootType + '/' + subType)) {\n let value = mimeTypes.get(rootType + '/' + subType);\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n }\n\n switch (rootType) {\n case 'text':\n return 'txt';\n default:\n return 'bin';\n }\n }\n};\n","/* eslint no-undefined: 0, prefer-spread: 0, no-control-regex: 0 */\n\n'use strict';\n\nconst crypto = require('crypto');\nconst fs = require('fs');\nconst punycode = require('punycode');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\nconst mimeFuncs = require('../mime-funcs');\nconst qp = require('../qp');\nconst base64 = require('../base64');\nconst addressparser = require('../addressparser');\nconst nmfetch = require('../fetch');\nconst LastNewline = require('./last-newline');\n\nconst LeWindows = require('./le-windows');\nconst LeUnix = require('./le-unix');\n\n/**\n * Creates a new mime tree node. Assumes 'multipart/*' as the content type\n * if it is a branch, anything else counts as leaf. If rootNode is missing from\n * the options, assumes this is the root.\n *\n * @param {String} contentType Define the content type for the node. Can be left blank for attachments (derived from filename)\n * @param {Object} [options] optional options\n * @param {Object} [options.rootNode] root node for this tree\n * @param {Object} [options.parentNode] immediate parent for this node\n * @param {Object} [options.filename] filename for an attachment node\n * @param {String} [options.baseBoundary] shared part of the unique multipart boundary\n * @param {Boolean} [options.keepBcc] If true, do not exclude Bcc from the generated headers\n * @param {Function} [options.normalizeHeaderKey] method to normalize header keys for custom caseing\n * @param {String} [options.textEncoding] either 'Q' (the default) or 'B'\n */\nclass MimeNode {\n constructor(contentType, options) {\n this.nodeCounter = 0;\n\n options = options || {};\n\n /**\n * shared part of the unique multipart boundary\n */\n this.baseBoundary = options.baseBoundary || crypto.randomBytes(8).toString('hex');\n this.boundaryPrefix = options.boundaryPrefix || '--_NmP';\n\n this.disableFileAccess = !!options.disableFileAccess;\n this.disableUrlAccess = !!options.disableUrlAccess;\n\n this.normalizeHeaderKey = options.normalizeHeaderKey;\n\n /**\n * If date headers is missing and current node is the root, this value is used instead\n */\n this.date = new Date();\n\n /**\n * Root node for current mime tree\n */\n this.rootNode = options.rootNode || this;\n\n /**\n * If true include Bcc in generated headers (if available)\n */\n this.keepBcc = !!options.keepBcc;\n\n /**\n * If filename is specified but contentType is not (probably an attachment)\n * detect the content type from filename extension\n */\n if (options.filename) {\n /**\n * Filename for this node. Useful with attachments\n */\n this.filename = options.filename;\n if (!contentType) {\n contentType = mimeFuncs.detectMimeType(this.filename.split('.').pop());\n }\n }\n\n /**\n * Indicates which encoding should be used for header strings: \"Q\" or \"B\"\n */\n this.textEncoding = (options.textEncoding || '').toString().trim().charAt(0).toUpperCase();\n\n /**\n * Immediate parent for this node (or undefined if not set)\n */\n this.parentNode = options.parentNode;\n\n /**\n * Hostname for default message-id values\n */\n this.hostname = options.hostname;\n\n /**\n * If set to 'win' then uses \\r\\n, if 'linux' then \\n. If not set (or `raw` is used) then newlines are kept as is.\n */\n this.newline = options.newline;\n\n /**\n * An array for possible child nodes\n */\n this.childNodes = [];\n\n /**\n * Used for generating unique boundaries (prepended to the shared base)\n */\n this._nodeId = ++this.rootNode.nodeCounter;\n\n /**\n * A list of header values for this node in the form of [{key:'', value:''}]\n */\n this._headers = [];\n\n /**\n * True if the content only uses ASCII printable characters\n * @type {Boolean}\n */\n this._isPlainText = false;\n\n /**\n * True if the content is plain text but has longer lines than allowed\n * @type {Boolean}\n */\n this._hasLongLines = false;\n\n /**\n * If set, use instead this value for envelopes instead of generating one\n * @type {Boolean}\n */\n this._envelope = false;\n\n /**\n * If set then use this value as the stream content instead of building it\n * @type {String|Buffer|Stream}\n */\n this._raw = false;\n\n /**\n * Additional transform streams that the message will be piped before\n * exposing by createReadStream\n * @type {Array}\n */\n this._transforms = [];\n\n /**\n * Additional process functions that the message will be piped through before\n * exposing by createReadStream. These functions are run after transforms\n * @type {Array}\n */\n this._processFuncs = [];\n\n /**\n * If content type is set (or derived from the filename) add it to headers\n */\n if (contentType) {\n this.setHeader('Content-Type', contentType);\n }\n }\n\n /////// PUBLIC METHODS\n\n /**\n * Creates and appends a child node.Arguments provided are passed to MimeNode constructor\n *\n * @param {String} [contentType] Optional content type\n * @param {Object} [options] Optional options object\n * @return {Object} Created node object\n */\n createChild(contentType, options) {\n if (!options && typeof contentType === 'object') {\n options = contentType;\n contentType = undefined;\n }\n let node = new MimeNode(contentType, options);\n this.appendChild(node);\n return node;\n }\n\n /**\n * Appends an existing node to the mime tree. Removes the node from an existing\n * tree if needed\n *\n * @param {Object} childNode node to be appended\n * @return {Object} Appended node object\n */\n appendChild(childNode) {\n if (childNode.rootNode !== this.rootNode) {\n childNode.rootNode = this.rootNode;\n childNode._nodeId = ++this.rootNode.nodeCounter;\n }\n\n childNode.parentNode = this;\n\n this.childNodes.push(childNode);\n return childNode;\n }\n\n /**\n * Replaces current node with another node\n *\n * @param {Object} node Replacement node\n * @return {Object} Replacement node\n */\n replace(node) {\n if (node === this) {\n return this;\n }\n\n this.parentNode.childNodes.forEach((childNode, i) => {\n if (childNode === this) {\n node.rootNode = this.rootNode;\n node.parentNode = this.parentNode;\n node._nodeId = this._nodeId;\n\n this.rootNode = this;\n this.parentNode = undefined;\n\n node.parentNode.childNodes[i] = node;\n }\n });\n\n return node;\n }\n\n /**\n * Removes current node from the mime tree\n *\n * @return {Object} removed node\n */\n remove() {\n if (!this.parentNode) {\n return this;\n }\n\n for (let i = this.parentNode.childNodes.length - 1; i >= 0; i--) {\n if (this.parentNode.childNodes[i] === this) {\n this.parentNode.childNodes.splice(i, 1);\n this.parentNode = undefined;\n this.rootNode = this;\n return this;\n }\n }\n }\n\n /**\n * Sets a header value. If the value for selected key exists, it is overwritten.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n setHeader(key, value) {\n let added = false,\n headerValue;\n\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && 'value' in key) {\n this.setHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.setHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.setHeader(i, key[i]);\n });\n }\n return this;\n }\n\n key = this._normalizeHeaderKey(key);\n\n headerValue = {\n key,\n value\n };\n\n // Check if the value exists and overwrite\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n if (!added) {\n // replace the first match\n this._headers[i] = headerValue;\n added = true;\n } else {\n // remove following matches\n this._headers.splice(i, 1);\n i--;\n len--;\n }\n }\n }\n\n // match not found, append the value\n if (!added) {\n this._headers.push(headerValue);\n }\n\n return this;\n }\n\n /**\n * Adds a header value. If the value for selected key exists, the value is appended\n * as a new field and old one is not touched.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n addHeader(key, value) {\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && key.value) {\n this.addHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.addHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.addHeader(i, key[i]);\n });\n }\n return this;\n } else if (Array.isArray(value)) {\n value.forEach(val => {\n this.addHeader(key, val);\n });\n return this;\n }\n\n this._headers.push({\n key: this._normalizeHeaderKey(key),\n value\n });\n\n return this;\n }\n\n /**\n * Retrieves the first mathcing value of a selected key\n *\n * @param {String} key Key to search for\n * @retun {String} Value for the key\n */\n getHeader(key) {\n key = this._normalizeHeaderKey(key);\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n return this._headers[i].value;\n }\n }\n }\n\n /**\n * Sets body content for current node. If the value is a string, charset is added automatically\n * to Content-Type (if it is text/*). If the value is a Buffer, you need to specify\n * the charset yourself\n *\n * @param (String|Buffer) content Body content\n * @return {Object} current node\n */\n setContent(content) {\n this.content = content;\n if (typeof this.content.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this.content.removeListener('error', this._contentErrorHandler);\n this.content = err;\n };\n this.content.once('error', this._contentErrorHandler);\n } else if (typeof this.content === 'string') {\n this._isPlainText = mimeFuncs.isPlainText(this.content);\n if (this._isPlainText && mimeFuncs.hasLongerLines(this.content, 76)) {\n // If there are lines longer than 76 symbols/bytes do not use 7bit\n this._hasLongLines = true;\n }\n }\n return this;\n }\n\n build(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let stream = this.createReadStream();\n let buf = [];\n let buflen = 0;\n let returned = false;\n\n stream.on('readable', () => {\n let chunk;\n\n while ((chunk = stream.read()) !== null) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n\n return callback(err);\n });\n\n stream.once('end', chunk => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (chunk && chunk.length) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n return callback(null, Buffer.concat(buf, buflen));\n });\n\n return promise;\n }\n\n getTransferEncoding() {\n let transferEncoding = false;\n let contentType = (this.getHeader('Content-Type') || '').toString().toLowerCase().trim();\n\n if (this.content) {\n transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '').toString().toLowerCase().trim();\n if (!transferEncoding || !['base64', 'quoted-printable'].includes(transferEncoding)) {\n if (/^text\\//i.test(contentType)) {\n // If there are no special symbols, no need to modify the text\n if (this._isPlainText && !this._hasLongLines) {\n transferEncoding = '7bit';\n } else if (typeof this.content === 'string' || this.content instanceof Buffer) {\n // detect preferred encoding for string value\n transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64';\n } else {\n // we can not check content for a stream, so either use preferred encoding or fallback to QP\n transferEncoding = this.textEncoding === 'B' ? 'base64' : 'quoted-printable';\n }\n } else if (!/^(multipart|message)\\//i.test(contentType)) {\n transferEncoding = transferEncoding || 'base64';\n }\n }\n }\n return transferEncoding;\n }\n\n /**\n * Builds the header block for the mime node. Append \\r\\n\\r\\n before writing the content\n *\n * @returns {String} Headers\n */\n buildHeaders() {\n let transferEncoding = this.getTransferEncoding();\n let headers = [];\n\n if (transferEncoding) {\n this.setHeader('Content-Transfer-Encoding', transferEncoding);\n }\n\n if (this.filename && !this.getHeader('Content-Disposition')) {\n this.setHeader('Content-Disposition', 'attachment');\n }\n\n // Ensure mandatory header fields\n if (this.rootNode === this) {\n if (!this.getHeader('Date')) {\n this.setHeader('Date', this.date.toUTCString().replace(/GMT/, '+0000'));\n }\n\n // ensure that Message-Id is present\n this.messageId();\n\n if (!this.getHeader('MIME-Version')) {\n this.setHeader('MIME-Version', '1.0');\n }\n }\n\n this._headers.forEach(header => {\n let key = header.key;\n let value = header.value;\n let structured;\n let param;\n let options = {};\n let formattedHeaders = ['From', 'Sender', 'To', 'Cc', 'Bcc', 'Reply-To', 'Date', 'References'];\n\n if (value && typeof value === 'object' && !formattedHeaders.includes(key)) {\n Object.keys(value).forEach(key => {\n if (key !== 'value') {\n options[key] = value[key];\n }\n });\n value = (value.value || '').toString();\n if (!value.trim()) {\n return;\n }\n }\n\n if (options.prepared) {\n // header value is\n if (options.foldLines) {\n headers.push(mimeFuncs.foldLines(key + ': ' + value));\n } else {\n headers.push(key + ': ' + value);\n }\n return;\n }\n\n switch (header.key) {\n case 'Content-Disposition':\n structured = mimeFuncs.parseHeaderValue(value);\n if (this.filename) {\n structured.params.filename = this.filename;\n }\n value = mimeFuncs.buildHeaderValue(structured);\n break;\n\n case 'Content-Type':\n structured = mimeFuncs.parseHeaderValue(value);\n\n this._handleContentType(structured);\n\n if (structured.value.match(/^text\\/plain\\b/) && typeof this.content === 'string' && /[\\u0080-\\uFFFF]/.test(this.content)) {\n structured.params.charset = 'utf-8';\n }\n\n value = mimeFuncs.buildHeaderValue(structured);\n\n if (this.filename) {\n // add support for non-compliant clients like QQ webmail\n // we can't build the value with buildHeaderValue as the value is non standard and\n // would be converted to parameter continuation encoding that we do not want\n param = this._encodeWords(this.filename);\n\n if (param !== this.filename || /[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(param)) {\n // include value in quotes if needed\n param = '\"' + param + '\"';\n }\n value += '; name=' + param;\n }\n break;\n\n case 'Bcc':\n if (!this.keepBcc) {\n // skip BCC values\n return;\n }\n break;\n }\n\n value = this._encodeHeaderValue(key, value);\n\n // skip empty lines\n if (!(value || '').toString().trim()) {\n return;\n }\n\n if (typeof this.normalizeHeaderKey === 'function') {\n let normalized = this.normalizeHeaderKey(key, value);\n if (normalized && typeof normalized === 'string' && normalized.length) {\n key = normalized;\n }\n }\n\n headers.push(mimeFuncs.foldLines(key + ': ' + value, 76));\n });\n\n return headers.join('\\r\\n');\n }\n\n /**\n * Streams the rfc2822 message from the current node. If this is a root node,\n * mandatory header fields are set if missing (Date, Message-Id, MIME-Version)\n *\n * @return {String} Compiled message\n */\n createReadStream(options) {\n options = options || {};\n\n let stream = new PassThrough(options);\n let outputStream = stream;\n let transform;\n\n this.stream(stream, options, err => {\n if (err) {\n outputStream.emit('error', err);\n return;\n }\n stream.end();\n });\n\n for (let i = 0, len = this._transforms.length; i < len; i++) {\n transform = typeof this._transforms[i] === 'function' ? this._transforms[i]() : this._transforms[i];\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n }\n\n // ensure terminating newline after possible user transforms\n transform = new LastNewline();\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n\n // dkim and stuff\n for (let i = 0, len = this._processFuncs.length; i < len; i++) {\n transform = this._processFuncs[i];\n outputStream = transform(outputStream);\n }\n\n if (this.newline) {\n const winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes(this.newline.toString().toLowerCase());\n const newlineTransform = winbreak ? new LeWindows() : new LeUnix();\n\n const stream = outputStream.pipe(newlineTransform);\n outputStream.on('error', err => stream.emit('error', err));\n return stream;\n }\n\n return outputStream;\n }\n\n /**\n * Appends a transform stream object to the transforms list. Final output\n * is passed through this stream before exposing\n *\n * @param {Object} transform Read-Write stream\n */\n transform(transform) {\n this._transforms.push(transform);\n }\n\n /**\n * Appends a post process function. The functon is run after transforms and\n * uses the following syntax\n *\n * processFunc(input) -> outputStream\n *\n * @param {Object} processFunc Read-Write stream\n */\n processFunc(processFunc) {\n this._processFuncs.push(processFunc);\n }\n\n stream(outputStream, options, done) {\n let transferEncoding = this.getTransferEncoding();\n let contentStream;\n let localStream;\n\n // protect actual callback against multiple triggering\n let returned = false;\n let callback = err => {\n if (returned) {\n return;\n }\n returned = true;\n done(err);\n };\n\n // for multipart nodes, push child nodes\n // for content nodes end the stream\n let finalize = () => {\n let childId = 0;\n let processChildNode = () => {\n if (childId >= this.childNodes.length) {\n outputStream.write('\\r\\n--' + this.boundary + '--\\r\\n');\n return callback();\n }\n let child = this.childNodes[childId++];\n outputStream.write((childId > 1 ? '\\r\\n' : '') + '--' + this.boundary + '\\r\\n');\n child.stream(outputStream, options, err => {\n if (err) {\n return callback(err);\n }\n setImmediate(processChildNode);\n });\n };\n\n if (this.multipart) {\n setImmediate(processChildNode);\n } else {\n return callback();\n }\n };\n\n // pushes node content\n let sendContent = () => {\n if (this.content) {\n if (Object.prototype.toString.call(this.content) === '[object Error]') {\n // content is already errored\n return callback(this.content);\n }\n\n if (typeof this.content.pipe === 'function') {\n this.content.removeListener('error', this._contentErrorHandler);\n this._contentErrorHandler = err => callback(err);\n this.content.once('error', this._contentErrorHandler);\n }\n\n let createStream = () => {\n if (['quoted-printable', 'base64'].includes(transferEncoding)) {\n contentStream = new (transferEncoding === 'base64' ? base64 : qp).Encoder(options);\n\n contentStream.pipe(outputStream, {\n end: false\n });\n contentStream.once('end', finalize);\n contentStream.once('error', err => callback(err));\n\n localStream = this._getStream(this.content);\n localStream.pipe(contentStream);\n } else {\n // anything that is not QP or Base54 passes as-is\n localStream = this._getStream(this.content);\n localStream.pipe(outputStream, {\n end: false\n });\n localStream.once('end', finalize);\n }\n\n localStream.once('error', err => callback(err));\n };\n\n if (this.content._resolve) {\n let chunks = [];\n let chunklen = 0;\n let returned = false;\n let sourceStream = this._getStream(this.content);\n sourceStream.on('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(err);\n });\n sourceStream.on('readable', () => {\n let chunk;\n while ((chunk = sourceStream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n sourceStream.on('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n this.content._resolve = false;\n this.content._resolvedValue = Buffer.concat(chunks, chunklen);\n setImmediate(createStream);\n });\n } else {\n setImmediate(createStream);\n }\n return;\n } else {\n return setImmediate(finalize);\n }\n };\n\n if (this._raw) {\n setImmediate(() => {\n if (Object.prototype.toString.call(this._raw) === '[object Error]') {\n // content is already errored\n return callback(this._raw);\n }\n\n // remove default error handler (if set)\n if (typeof this._raw.pipe === 'function') {\n this._raw.removeListener('error', this._contentErrorHandler);\n }\n\n let raw = this._getStream(this._raw);\n raw.pipe(outputStream, {\n end: false\n });\n raw.on('error', err => outputStream.emit('error', err));\n raw.on('end', finalize);\n });\n } else {\n outputStream.write(this.buildHeaders() + '\\r\\n\\r\\n');\n setImmediate(sendContent);\n }\n }\n\n /**\n * Sets envelope to be used instead of the generated one\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n setEnvelope(envelope) {\n let list;\n\n this._envelope = {\n from: false,\n to: []\n };\n\n if (envelope.from) {\n list = [];\n this._convertAddresses(this._parseAddresses(envelope.from), list);\n list = list.filter(address => address && address.address);\n if (list.length && list[0]) {\n this._envelope.from = list[0].address;\n }\n }\n ['to', 'cc', 'bcc'].forEach(key => {\n if (envelope[key]) {\n this._convertAddresses(this._parseAddresses(envelope[key]), this._envelope.to);\n }\n });\n\n this._envelope.to = this._envelope.to.map(to => to.address).filter(address => address);\n\n let standardFields = ['to', 'cc', 'bcc', 'from'];\n Object.keys(envelope).forEach(key => {\n if (!standardFields.includes(key)) {\n this._envelope[key] = envelope[key];\n }\n });\n\n return this;\n }\n\n /**\n * Generates and returns an object with parsed address fields\n *\n * @return {Object} Address object\n */\n getAddresses() {\n let addresses = {};\n\n this._headers.forEach(header => {\n let key = header.key.toLowerCase();\n if (['from', 'sender', 'reply-to', 'to', 'cc', 'bcc'].includes(key)) {\n if (!Array.isArray(addresses[key])) {\n addresses[key] = [];\n }\n\n this._convertAddresses(this._parseAddresses(header.value), addresses[key]);\n }\n });\n\n return addresses;\n }\n\n /**\n * Generates and returns SMTP envelope with the sender address and a list of recipients addresses\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n getEnvelope() {\n if (this._envelope) {\n return this._envelope;\n }\n\n let envelope = {\n from: false,\n to: []\n };\n this._headers.forEach(header => {\n let list = [];\n if (header.key === 'From' || (!envelope.from && ['Reply-To', 'Sender'].includes(header.key))) {\n this._convertAddresses(this._parseAddresses(header.value), list);\n if (list.length && list[0]) {\n envelope.from = list[0].address;\n }\n } else if (['To', 'Cc', 'Bcc'].includes(header.key)) {\n this._convertAddresses(this._parseAddresses(header.value), envelope.to);\n }\n });\n\n envelope.to = envelope.to.map(to => to.address);\n\n return envelope;\n }\n\n /**\n * Returns Message-Id value. If it does not exist, then creates one\n *\n * @return {String} Message-Id value\n */\n messageId() {\n let messageId = this.getHeader('Message-ID');\n // You really should define your own Message-Id field!\n if (!messageId) {\n messageId = this._generateMessageId();\n this.setHeader('Message-ID', messageId);\n }\n return messageId;\n }\n\n /**\n * Sets pregenerated content that will be used as the output of this node\n *\n * @param {String|Buffer|Stream} Raw MIME contents\n */\n setRaw(raw) {\n this._raw = raw;\n\n if (this._raw && typeof this._raw.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this._raw.removeListener('error', this._contentErrorHandler);\n this._raw = err;\n };\n this._raw.once('error', this._contentErrorHandler);\n }\n\n return this;\n }\n\n /////// PRIVATE METHODS\n\n /**\n * Detects and returns handle to a stream related with the content.\n *\n * @param {Mixed} content Node content\n * @returns {Object} Stream object\n */\n _getStream(content) {\n let contentStream;\n\n if (content._resolvedValue) {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n setImmediate(() => contentStream.end(content._resolvedValue));\n return contentStream;\n } else if (typeof content.pipe === 'function') {\n // assume as stream\n return content;\n } else if (content && typeof content.path === 'string' && !content.href) {\n if (this.disableFileAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('File access rejected for ' + content.path)));\n return contentStream;\n }\n // read file\n return fs.createReadStream(content.path);\n } else if (content && typeof content.href === 'string') {\n if (this.disableUrlAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('Url access rejected for ' + content.href)));\n return contentStream;\n }\n // fetch URL\n return nmfetch(content.href, { headers: content.httpHeaders });\n } else {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n setImmediate(() => contentStream.end(content || ''));\n return contentStream;\n }\n }\n\n /**\n * Parses addresses. Takes in a single address or an array or an\n * array of address arrays (eg. To: [[first group], [second group],...])\n *\n * @param {Mixed} addresses Addresses to be parsed\n * @return {Array} An array of address objects\n */\n _parseAddresses(addresses) {\n return [].concat.apply(\n [],\n [].concat(addresses).map(address => {\n // eslint-disable-line prefer-spread\n if (address && address.address) {\n address.address = this._normalizeAddress(address.address);\n address.name = address.name || '';\n return [address];\n }\n return addressparser(address);\n })\n );\n }\n\n /**\n * Normalizes a header key, uses Camel-Case form, except for uppercase MIME-\n *\n * @param {String} key Key to be normalized\n * @return {String} key in Camel-Case form\n */\n _normalizeHeaderKey(key) {\n key = (key || '')\n .toString()\n // no newlines in keys\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim()\n .toLowerCase()\n // use uppercase words, except MIME\n .replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())\n // special case\n .replace(/^Content-Features$/i, 'Content-features');\n\n return key;\n }\n\n /**\n * Checks if the content type is multipart and defines boundary if needed.\n * Doesn't return anything, modifies object argument instead.\n *\n * @param {Object} structured Parsed header value for 'Content-Type' key\n */\n _handleContentType(structured) {\n this.contentType = structured.value.trim().toLowerCase();\n\n this.multipart = /^multipart\\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;\n\n if (this.multipart) {\n this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary();\n } else {\n this.boundary = false;\n }\n }\n\n /**\n * Generates a multipart boundary value\n *\n * @return {String} boundary value\n */\n _generateBoundary() {\n return this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary + '-Part_' + this._nodeId;\n }\n\n /**\n * Encodes a header value for use in the generated rfc2822 email.\n *\n * @param {String} key Header key\n * @param {String} value Header value\n */\n _encodeHeaderValue(key, value) {\n key = this._normalizeHeaderKey(key);\n\n switch (key) {\n // Structured headers\n case 'From':\n case 'Sender':\n case 'To':\n case 'Cc':\n case 'Bcc':\n case 'Reply-To':\n return this._convertAddresses(this._parseAddresses(value));\n\n // values enclosed in <>\n case 'Message-ID':\n case 'In-Reply-To':\n case 'Content-Id':\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n if (value.charAt(0) !== '<') {\n value = '<' + value;\n }\n\n if (value.charAt(value.length - 1) !== '>') {\n value = value + '>';\n }\n return value;\n\n // space separated list of values enclosed in <>\n case 'References':\n value = [].concat\n .apply(\n [],\n [].concat(value || '').map(elm => {\n // eslint-disable-line prefer-spread\n elm = (elm || '')\n .toString()\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim();\n return elm.replace(/<[^>]*>/g, str => str.replace(/\\s/g, '')).split(/\\s+/);\n })\n )\n .map(elm => {\n if (elm.charAt(0) !== '<') {\n elm = '<' + elm;\n }\n if (elm.charAt(elm.length - 1) !== '>') {\n elm = elm + '>';\n }\n return elm;\n });\n\n return value.join(' ').trim();\n\n case 'Date':\n if (Object.prototype.toString.call(value) === '[object Date]') {\n return value.toUTCString().replace(/GMT/, '+0000');\n }\n\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n return this._encodeWords(value);\n\n case 'Content-Type':\n case 'Content-Disposition':\n // if it includes a filename then it is already encoded\n return (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n default:\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n // encodeWords only encodes if needed, otherwise the original string is returned\n return this._encodeWords(value);\n }\n }\n\n /**\n * Rebuilds address object using punycode and other adjustments\n *\n * @param {Array} addresses An array of address objects\n * @param {Array} [uniqueList] An array to be populated with addresses\n * @return {String} address string\n */\n _convertAddresses(addresses, uniqueList) {\n let values = [];\n\n uniqueList = uniqueList || [];\n\n [].concat(addresses || []).forEach(address => {\n if (address.address) {\n address.address = this._normalizeAddress(address.address);\n\n if (!address.name) {\n values.push(address.address.indexOf(' ') >= 0 ? `<${address.address}>` : `${address.address}`);\n } else if (address.name) {\n values.push(`${this._encodeAddressName(address.name)} <${address.address}>`);\n }\n\n if (address.address) {\n if (!uniqueList.filter(a => a.address === address.address).length) {\n uniqueList.push(address);\n }\n }\n } else if (address.group) {\n let groupListAddresses = (address.group.length ? this._convertAddresses(address.group, uniqueList) : '').trim();\n values.push(`${this._encodeAddressName(address.name)}:${groupListAddresses};`);\n }\n });\n\n return values.join(', ');\n }\n\n /**\n * Normalizes an email address\n *\n * @param {Array} address An array of address objects\n * @return {String} address string\n */\n _normalizeAddress(address) {\n address = (address || '')\n .toString()\n .replace(/[\\x00-\\x1F<>]+/g, ' ') // remove unallowed characters\n .trim();\n\n let lastAt = address.lastIndexOf('@');\n if (lastAt < 0) {\n // Bare username\n return address;\n }\n\n let user = address.substr(0, lastAt);\n let domain = address.substr(lastAt + 1);\n\n // Usernames are not touched and are kept as is even if these include unicode\n // Domains are punycoded by default\n // 'jõgeva.ee' will be converted to 'xn--jgeva-dua.ee'\n // non-unicode domains are left as is\n\n let encodedDomain;\n\n try {\n encodedDomain = punycode.toASCII(domain.toLowerCase());\n } catch (err) {\n // keep as is?\n }\n\n if (user.indexOf(' ') >= 0) {\n if (user.charAt(0) !== '\"') {\n user = '\"' + user;\n }\n if (user.substr(-1) !== '\"') {\n user = user + '\"';\n }\n }\n\n return `${user}@${encodedDomain}`;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeAddressName(name) {\n if (!/^[\\w ']*$/.test(name)) {\n if (/^[\\x20-\\x7e]*$/.test(name)) {\n return '\"' + name.replace(/([\\\\\"])/g, '\\\\$1') + '\"';\n } else {\n return mimeFuncs.encodeWord(name, this._getTextEncoding(name), 52);\n }\n }\n return name;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeWords(value) {\n // set encodeAll parameter to true even though it is against the recommendation of RFC2047,\n // by default only words that include non-ascii should be converted into encoded words\n // but some clients (eg. Zimbra) do not handle it properly and remove surrounding whitespace\n return mimeFuncs.encodeWords(value, this._getTextEncoding(value), 52, true);\n }\n\n /**\n * Detects best mime encoding for a text value\n *\n * @param {String} value Value to check for\n * @return {String} either 'Q' or 'B'\n */\n _getTextEncoding(value) {\n value = (value || '').toString();\n\n let encoding = this.textEncoding;\n let latinLen;\n let nonLatinLen;\n\n if (!encoding) {\n // count latin alphabet symbols and 8-bit range symbols + control symbols\n // if there are more latin characters, then use quoted-printable\n // encoding, otherwise use base64\n nonLatinLen = (value.match(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\u0080-\\uFFFF]/g) || []).length; // eslint-disable-line no-control-regex\n latinLen = (value.match(/[a-z]/gi) || []).length;\n // if there are more latin symbols than binary/unicode, then prefer Q, otherwise B\n encoding = nonLatinLen < latinLen ? 'Q' : 'B';\n }\n return encoding;\n }\n\n /**\n * Generates a message id\n *\n * @return {String} Random Message-ID value\n */\n _generateMessageId() {\n return (\n '<' +\n [2, 2, 2, 6].reduce(\n // crux to generate UUID-like random strings\n (prev, len) => prev + '-' + crypto.randomBytes(len).toString('hex'),\n crypto.randomBytes(4).toString('hex')\n ) +\n '@' +\n // try to use the domain of the FROM address or fallback to server hostname\n (this.getEnvelope().from || this.hostname || 'localhost').split('@').pop() +\n '>'\n );\n }\n}\n\nmodule.exports = MimeNode;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\nclass LastNewline extends Transform {\n constructor() {\n super();\n this.lastByte = false;\n }\n\n _transform(chunk, encoding, done) {\n if (chunk.length) {\n this.lastByte = chunk[chunk.length - 1];\n }\n\n this.push(chunk);\n done();\n }\n\n _flush(done) {\n if (this.lastByte === 0x0a) {\n return done();\n }\n if (this.lastByte === 0x0d) {\n this.push(Buffer.from('\\n'));\n return done();\n }\n this.push(Buffer.from('\\r\\n'));\n return done();\n }\n}\n\nmodule.exports = LastNewline;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only is used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0d) {\n // \\n\n buf = chunk.slice(lastPos, i);\n lastPos = i + 1;\n this.push(buf);\n }\n }\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0a) {\n // \\n\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n this.push(buf);\n }\n this.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","'use strict';\n\nconst Mailer = require('./mailer');\nconst shared = require('./shared');\nconst SMTPPool = require('./smtp-pool');\nconst SMTPTransport = require('./smtp-transport');\nconst SendmailTransport = require('./sendmail-transport');\nconst StreamTransport = require('./stream-transport');\nconst JSONTransport = require('./json-transport');\nconst SESTransport = require('./ses-transport');\nconst nmfetch = require('./fetch');\nconst packageData = require('../package.json');\n\nconst ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\\/+$/, '');\nconst ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\\/+$/, '');\nconst ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());\n\nlet testAccount = false;\n\nmodule.exports.createTransport = function (transporter, defaults) {\n let urlConfig;\n let options;\n let mailer;\n\n if (\n // provided transporter is a configuration object, not transporter plugin\n (typeof transporter === 'object' && typeof transporter.send !== 'function') ||\n // provided transporter looks like a connection url\n (typeof transporter === 'string' && /^(smtps?|direct):/i.test(transporter))\n ) {\n if ((urlConfig = typeof transporter === 'string' ? transporter : transporter.url)) {\n // parse a configuration URL into configuration options\n options = shared.parseConnectionUrl(urlConfig);\n } else {\n options = transporter;\n }\n\n if (options.pool) {\n transporter = new SMTPPool(options);\n } else if (options.sendmail) {\n transporter = new SendmailTransport(options);\n } else if (options.streamTransport) {\n transporter = new StreamTransport(options);\n } else if (options.jsonTransport) {\n transporter = new JSONTransport(options);\n } else if (options.SES) {\n transporter = new SESTransport(options);\n } else {\n transporter = new SMTPTransport(options);\n }\n }\n\n mailer = new Mailer(transporter, options, defaults);\n\n return mailer;\n};\n\nmodule.exports.createTestAccount = function (apiUrl, callback) {\n let promise;\n\n if (!callback && typeof apiUrl === 'function') {\n callback = apiUrl;\n apiUrl = false;\n }\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (ETHEREAL_CACHE && testAccount) {\n setImmediate(() => callback(null, testAccount));\n return promise;\n }\n\n apiUrl = apiUrl || ETHEREAL_API;\n\n let chunks = [];\n let chunklen = 0;\n\n let req = nmfetch(apiUrl + '/user', {\n contentType: 'application/json',\n method: 'POST',\n body: Buffer.from(\n JSON.stringify({\n requestor: packageData.name,\n version: packageData.version\n })\n )\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => callback(err));\n\n req.once('end', () => {\n let res = Buffer.concat(chunks, chunklen);\n let data;\n let err;\n try {\n data = JSON.parse(res.toString());\n } catch (E) {\n err = E;\n }\n if (err) {\n return callback(err);\n }\n if (data.status !== 'success' || data.error) {\n return callback(new Error(data.error || 'Request failed'));\n }\n delete data.status;\n testAccount = data;\n callback(null, testAccount);\n });\n\n return promise;\n};\n\nmodule.exports.getTestMessageUrl = function (info) {\n if (!info || !info.response) {\n return false;\n }\n\n let infoProps = new Map();\n info.response.replace(/\\[([^\\]]+)\\]$/, (m, props) => {\n props.replace(/\\b([A-Z0-9]+)=([^\\s]+)/g, (m, key, value) => {\n infoProps.set(key, value);\n });\n });\n\n if (infoProps.has('STATUS') && infoProps.has('MSGID')) {\n return (testAccount.web || ETHEREAL_WEB) + '/message/' + infoProps.get('MSGID');\n }\n\n return false;\n};\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a Quoted-Printable encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} Quoted-Printable encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n // usable characters that do not need encoding\n let ranges = [\n // https://tools.ietf.org/html/rfc2045#section-6.7\n [0x09], // \n [0x0a], // \n [0x0d], // \n [0x20, 0x3c], // !\"#$%&'()*+,-./0123456789:;\n [0x3e, 0x7e] // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\n ];\n let result = '';\n let ord;\n\n for (let i = 0, len = buffer.length; i < len; i++) {\n ord = buffer[i];\n // if the char is in allowed range, then keep as is, unless it is a WS in the end of a line\n if (checkRanges(ord, ranges) && !((ord === 0x20 || ord === 0x09) && (i === len - 1 || buffer[i + 1] === 0x0a || buffer[i + 1] === 0x0d))) {\n result += String.fromCharCode(ord);\n continue;\n }\n result += '=' + (ord < 0x10 ? '0' : '') + ord.toString(16).toUpperCase();\n }\n\n return result;\n}\n\n/**\n * Adds soft line breaks to a Quoted-Printable string\n *\n * @param {String} str Quoted-Printable encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped Quoted-Printable encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let pos = 0;\n let len = str.length;\n let match, code, line;\n let lineMargin = Math.floor(lineLength / 3);\n let result = '';\n\n // insert soft linebreaks where needed\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if ((match = line.match(/\\r\\n/))) {\n line = line.substr(0, match.index + match[0].length);\n result += line;\n pos += line.length;\n continue;\n }\n\n if (line.substr(-1) === '\\n') {\n // nothing to change here\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.substr(-lineMargin).match(/\\n.*?$/))) {\n // truncate to nearest line break\n line = line.substr(0, line.length - (match[0].length - 1));\n result += line;\n pos += line.length;\n continue;\n } else if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \\t.,!?][^ \\t.,!?]*$/))) {\n // truncate to nearest space\n line = line.substr(0, line.length - (match[0].length - 1));\n } else if (line.match(/[=][\\da-f]{0,2}$/i)) {\n // push incomplete encoding sequences to the next line\n if ((match = line.match(/[=][\\da-f]{0,1}$/i))) {\n line = line.substr(0, line.length - match[0].length);\n }\n\n // ensure that utf-8 sequences are not split\n while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\\da-f]{2}){1,4}$/i) && (match = line.match(/[=][\\da-f]{2}$/gi))) {\n code = parseInt(match[0].substr(1, 2), 16);\n if (code < 128) {\n break;\n }\n\n line = line.substr(0, line.length - 3);\n\n if (code >= 0xc0) {\n break;\n }\n }\n }\n\n if (pos + line.length < len && line.substr(-1) !== '\\n') {\n if (line.length === lineLength && line.match(/[=][\\da-f]{2}$/i)) {\n line = line.substr(0, line.length - 3);\n } else if (line.length === lineLength) {\n line = line.substr(0, line.length - 1);\n }\n pos += line.length;\n line += '=\\r\\n';\n } else {\n pos += line.length;\n }\n\n result += line;\n }\n\n return result;\n}\n\n/**\n * Helper function to check if a number is inside provided ranges\n *\n * @param {Number} nr Number to check for\n * @param {Array} ranges An Array of allowed values\n * @returns {Boolean} True if the value was found inside allowed ranges, false otherwise\n */\nfunction checkRanges(nr, ranges) {\n for (let i = ranges.length - 1; i >= 0; i--) {\n if (!ranges[i].length) {\n continue;\n }\n if (ranges[i].length === 1 && nr === ranges[i][0]) {\n return true;\n }\n if (ranges[i].length === 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Creates a transform stream for encoding data to Quoted-Printable encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n let qp;\n\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n this.inputBytes += chunk.length;\n\n if (this.options.lineLength) {\n qp = this._curLine + encode(chunk);\n qp = wrap(qp, this.options.lineLength);\n qp = qp.replace(/(^|\\n)([^\\n]*)$/, (match, lineBreak, lastLine) => {\n this._curLine = lastLine;\n return lineBreak;\n });\n\n if (qp) {\n this.outputBytes += qp.length;\n this.push(qp);\n }\n } else {\n qp = encode(chunk);\n this.outputBytes += qp.length;\n this.push(qp, 'ascii');\n }\n\n done();\n }\n\n _flush(done) {\n if (this._curLine) {\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","'use strict';\n\nconst spawn = require('child_process').spawn;\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for Sendmail\n *\n * Possible options can be the following:\n *\n * * **path** optional path to sendmail binary\n * * **newline** either 'windows' or 'unix'\n * * **args** an array of arguments for the sendmail binary\n *\n * @constructor\n * @param {Object} optional config parameter for Sendmail\n */\nclass SendmailTransport {\n constructor(options) {\n options = options || {};\n\n // use a reference to spawn for mocking purposes\n this._spawn = spawn;\n\n this.options = options || {};\n\n this.name = 'Sendmail';\n this.version = packageData.version;\n\n this.path = 'sendmail';\n this.args = false;\n this.winbreak = false;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'sendmail'\n });\n\n if (options) {\n if (typeof options === 'string') {\n this.path = options;\n } else if (typeof options === 'object') {\n if (options.path) {\n this.path = options.path;\n }\n if (Array.isArray(options.args)) {\n this.args = options.args;\n }\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n }\n }\n\n /**\n *

Compiles a mailcomposer message and forwards it to handler that sends it.

\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n let args;\n let sendmail;\n let returned;\n\n const hasInvalidAddresses = []\n .concat(envelope.from || [])\n .concat(envelope.to || [])\n .some(addr => /^-/.test(addr));\n if (hasInvalidAddresses) {\n return done(new Error('Can not send mail. Invalid envelope addresses.'));\n }\n\n if (this.args) {\n // force -i to keep single dots\n args = ['-i'].concat(this.args).concat(envelope.to);\n } else {\n args = ['-i'].concat(envelope.from ? ['-f', envelope.from] : []).concat(envelope.to);\n }\n\n let callback = err => {\n if (returned) {\n // ignore any additional responses, already done\n return;\n }\n returned = true;\n if (typeof done === 'function') {\n if (err) {\n return done(err);\n } else {\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n response: 'Messages queued for delivery'\n });\n }\n }\n };\n\n try {\n sendmail = this._spawn(this.path, args);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred while spawning sendmail. %s',\n E.message\n );\n return callback(E);\n }\n\n if (sendmail) {\n sendmail.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred when sending message %s. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n sendmail.once('exit', code => {\n if (!code) {\n return callback();\n }\n let err;\n if (code === 127) {\n err = new Error('Sendmail command not found, process exited with code ' + code);\n } else {\n err = new Error('Sendmail exited with code ' + code);\n }\n\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error sending message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n sendmail.once('close', callback);\n\n sendmail.stdin.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when piping message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let sourceStream = mail.message.createReadStream();\n sourceStream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when generating message %s. %s',\n messageId,\n err.message\n );\n sendmail.kill('SIGINT'); // do not deliver the message\n callback(err);\n });\n\n sourceStream.pipe(sendmail.stdin);\n } else {\n return callback(new Error('sendmail was not found'));\n }\n }\n}\n\nmodule.exports = SendmailTransport;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\nconst LeWindows = require('../mime-node/le-windows');\n\n/**\n * Generates a Transport object for AWS SES\n *\n * Possible options can be the following:\n *\n * * **sendingRate** optional Number specifying how many messages per second should be delivered to SES\n * * **maxConnections** optional Number specifying max number of parallel connections to SES\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass SESTransport extends EventEmitter {\n constructor(options) {\n super();\n options = options || {};\n\n this.options = options || {};\n this.ses = this.options.SES;\n\n this.name = 'SESTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'ses-transport'\n });\n\n // parallel sending connections\n this.maxConnections = Number(this.options.maxConnections) || Infinity;\n this.connections = 0;\n\n // max messages per second\n this.sendingRate = Number(this.options.sendingRate) || Infinity;\n this.sendingRateTTL = null;\n this.rateInterval = 1000; // milliseconds\n this.rateMessages = [];\n\n this.pending = [];\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Schedules a sending of a message\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, callback) {\n if (this.connections >= this.maxConnections) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n if (!this._checkSendingRate()) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n this._send(mail, (...args) => {\n setImmediate(() => callback(...args));\n this._sent();\n });\n }\n\n _checkRatedQueue() {\n if (this.connections >= this.maxConnections || !this._checkSendingRate()) {\n return;\n }\n\n if (!this.pending.length) {\n if (!this.idling) {\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n let next = this.pending.shift();\n this._send(next.mail, (...args) => {\n setImmediate(() => next.callback(...args));\n this._sent();\n });\n }\n\n _checkSendingRate() {\n clearTimeout(this.sendingRateTTL);\n\n let now = Date.now();\n let oldest = false;\n // delete older messages\n for (let i = this.rateMessages.length - 1; i >= 0; i--) {\n if (this.rateMessages[i].ts >= now - this.rateInterval && (!oldest || this.rateMessages[i].ts < oldest)) {\n oldest = this.rateMessages[i].ts;\n }\n\n if (this.rateMessages[i].ts < now - this.rateInterval && !this.rateMessages[i].pending) {\n this.rateMessages.splice(i, 1);\n }\n }\n\n if (this.rateMessages.length < this.sendingRate) {\n return true;\n }\n\n let delay = Math.max(oldest + 1001, now + 20);\n this.sendingRateTTL = setTimeout(() => this._checkRatedQueue(), now - delay);\n\n try {\n this.sendingRateTTL.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n\n return false;\n }\n\n _sent() {\n this.connections--;\n this._checkRatedQueue();\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to SES\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n _send(mail, callback) {\n let statObject = {\n ts: Date.now(),\n pending: true\n };\n this.connections++;\n this.rateMessages.push(statObject);\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let getRawMessage = next => {\n // do not use Message-ID and Date in DKIM signature\n if (!mail.data._dkim) {\n mail.data._dkim = {};\n }\n if (mail.data._dkim.skipFields && typeof mail.data._dkim.skipFields === 'string') {\n mail.data._dkim.skipFields += ':date:message-id';\n } else {\n mail.data._dkim.skipFields = 'date:message-id';\n }\n\n let sourceStream = mail.message.createReadStream();\n let stream = sourceStream.pipe(new LeWindows());\n let chunks = [];\n let chunklen = 0;\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n sourceStream.once('error', err => stream.emit('error', err));\n\n stream.once('error', err => {\n next(err);\n });\n\n stream.once('end', () => next(null, Buffer.concat(chunks, chunklen)));\n };\n\n setImmediate(() =>\n getRawMessage((err, raw) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n return callback(err);\n }\n\n let sesMessage = {\n RawMessage: {\n // required\n Data: raw // required\n },\n Source: envelope.from,\n Destinations: envelope.to\n };\n\n Object.keys(mail.data.ses || {}).forEach(key => {\n sesMessage[key] = mail.data.ses[key];\n });\n\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n let getRegion = cb => {\n if (ses.config && typeof ses.config.region === 'function') {\n // promise\n return ses.config\n .region()\n .then(region => cb(null, region))\n .catch(err => cb(err));\n }\n return cb(null, (ses.config && ses.config.region) || 'us-east-1');\n };\n\n getRegion((err, region) => {\n if (err || !region) {\n region = 'us-east-1';\n }\n\n let sendPromise;\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));\n } else {\n // v2 API\n sendPromise = ses.sendRawEmail(sesMessage).promise();\n }\n\n sendPromise\n .then(data => {\n if (region === 'us-east-1') {\n region = 'email';\n }\n\n statObject.pending = false;\n callback(null, {\n envelope: {\n from: envelope.from,\n to: envelope.to\n },\n messageId: '<' + data.MessageId + (!/@/.test(data.MessageId) ? '@' + region + '.amazonses.com' : '') + '>',\n response: data.MessageId,\n raw\n });\n })\n .catch(err => {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n callback(err);\n });\n });\n })\n );\n }\n\n /**\n * Verifies SES configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n const sesMessage = {\n RawMessage: {\n // required\n Data: 'From: invalid@invalid\\r\\nTo: invalid@invalid\\r\\n Subject: Invalid\\r\\n\\r\\nInvalid'\n },\n Source: 'invalid@invalid',\n Destinations: ['invalid@invalid']\n };\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n const cb = err => {\n if (err && (err.code || err.Code) !== 'InvalidParameterValue') {\n return callback(err);\n }\n return callback(null, true);\n };\n\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sesMessage.RawMessage.Data = Buffer.from(sesMessage.RawMessage.Data);\n ses.send(new aws.SendRawEmailCommand(sesMessage), cb);\n } else {\n // v2 API\n ses.sendRawEmail(sesMessage, cb);\n }\n\n return promise;\n }\n}\n\nmodule.exports = SESTransport;\n","/* eslint no-console: 0 */\n\n'use strict';\n\nconst urllib = require('url');\nconst util = require('util');\nconst fs = require('fs');\nconst nmfetch = require('../fetch');\nconst dns = require('dns');\nconst net = require('net');\nconst os = require('os');\n\nconst DNS_TTL = 5 * 60 * 1000;\n\nlet networkInterfaces;\ntry {\n networkInterfaces = os.networkInterfaces();\n} catch (err) {\n // fails on some systems\n}\n\nmodule.exports.networkInterfaces = networkInterfaces;\n\nconst isFamilySupported = (family, allowInternal) => {\n let networkInterfaces = module.exports.networkInterfaces;\n if (!networkInterfaces) {\n // hope for the best\n return true;\n }\n\n const familySupported =\n // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6\n Object.keys(networkInterfaces)\n .map(key => networkInterfaces[key])\n // crux that replaces .flat() as it is not supported in older Node versions (v10 and older)\n .reduce((acc, val) => acc.concat(val), [])\n .filter(i => !i.internal || allowInternal)\n .filter(i => i.family === 'IPv' + family || i.family === family).length > 0;\n\n return familySupported;\n};\n\nconst resolver = (family, hostname, options, callback) => {\n options = options || {};\n const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces);\n\n if (!familySupported) {\n return callback(null, []);\n }\n\n dns['resolve' + family](hostname, (err, addresses) => {\n if (err) {\n switch (err.code) {\n case dns.NODATA:\n case dns.NOTFOUND:\n case dns.NOTIMP:\n case dns.SERVFAIL:\n case dns.CONNREFUSED:\n case 'EAI_AGAIN':\n return callback(null, []);\n }\n return callback(err);\n }\n return callback(null, Array.isArray(addresses) ? addresses : [].concat(addresses || []));\n });\n};\n\nconst dnsCache = (module.exports.dnsCache = new Map());\n\nconst formatDNSValue = (value, extra) => {\n if (!value) {\n return Object.assign({}, extra || {});\n }\n\n return Object.assign(\n {\n servername: value.servername,\n host:\n !value.addresses || !value.addresses.length\n ? null\n : value.addresses.length === 1\n ? value.addresses[0]\n : value.addresses[Math.floor(Math.random() * value.addresses.length)]\n },\n extra || {}\n );\n};\n\nmodule.exports.resolveHostname = (options, callback) => {\n options = options || {};\n\n if (!options.host && options.servername) {\n options.host = options.servername;\n }\n\n if (!options.host || net.isIP(options.host)) {\n // nothing to do here\n let value = {\n addresses: [options.host],\n servername: options.servername || false\n };\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n let cached;\n if (dnsCache.has(options.host)) {\n cached = dnsCache.get(options.host);\n\n if (!cached.expires || cached.expires >= Date.now()) {\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n }\n\n resolver(4, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n resolver(6, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n try {\n dns.lookup(options.host, { all: true }, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n let address = addresses\n ? addresses\n .filter(addr => isFamilySupported(addr.family))\n .map(addr => addr.address)\n .shift()\n : false;\n\n if (addresses && addresses.length && !address) {\n // there are addresses but none can be used\n let err = new Error(`Can not use IPv${addresses[0].family} addresses with current network`);\n return callback(err);\n }\n\n if (!address && cached) {\n // nothing was found, fallback to cached value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n\n let value = {\n addresses: address ? [address] : [options.host],\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n });\n } catch (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n });\n });\n};\n/**\n * Parses connection url to a structured configuration object\n *\n * @param {String} str Connection url\n * @return {Object} Configuration object\n */\nmodule.exports.parseConnectionUrl = str => {\n str = str || '';\n let options = {};\n\n [urllib.parse(str, true)].forEach(url => {\n let auth;\n\n switch (url.protocol) {\n case 'smtp:':\n options.secure = false;\n break;\n case 'smtps:':\n options.secure = true;\n break;\n case 'direct:':\n options.direct = true;\n break;\n }\n\n if (!isNaN(url.port) && Number(url.port)) {\n options.port = Number(url.port);\n }\n\n if (url.hostname) {\n options.host = url.hostname;\n }\n\n if (url.auth) {\n auth = url.auth.split(':');\n\n if (!options.auth) {\n options.auth = {};\n }\n\n options.auth.user = auth.shift();\n options.auth.pass = auth.join(':');\n }\n\n Object.keys(url.query || {}).forEach(key => {\n let obj = options;\n let lKey = key;\n let value = url.query[key];\n\n if (!isNaN(value)) {\n value = Number(value);\n }\n\n switch (value) {\n case 'true':\n value = true;\n break;\n case 'false':\n value = false;\n break;\n }\n\n // tls is nested object\n if (key.indexOf('tls.') === 0) {\n lKey = key.substr(4);\n if (!options.tls) {\n options.tls = {};\n }\n obj = options.tls;\n } else if (key.indexOf('.') >= 0) {\n // ignore nested properties besides tls\n return;\n }\n\n if (!(lKey in obj)) {\n obj[lKey] = value;\n }\n });\n });\n\n return options;\n};\n\nmodule.exports._logFunc = (logger, level, defaults, data, message, ...args) => {\n let entry = {};\n\n Object.keys(defaults || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = defaults[key];\n }\n });\n\n Object.keys(data || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = data[key];\n }\n });\n\n logger[level](entry, message, ...args);\n};\n\n/**\n * Returns a bunyan-compatible logger interface. Uses either provided logger or\n * creates a default console logger\n *\n * @param {Object} [options] Options object that might include 'logger' value\n * @return {Object} bunyan compatible logger\n */\nmodule.exports.getLogger = (options, defaults) => {\n options = options || {};\n\n let response = {};\n let levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];\n\n if (!options.logger) {\n // use vanity logger\n levels.forEach(level => {\n response[level] = () => false;\n });\n return response;\n }\n\n let logger = options.logger;\n\n if (options.logger === true) {\n // create console logger\n logger = createDefaultLogger(levels);\n }\n\n levels.forEach(level => {\n response[level] = (data, message, ...args) => {\n module.exports._logFunc(logger, level, defaults, data, message, ...args);\n };\n });\n\n return response;\n};\n\n/**\n * Wrapper for creating a callback that either resolves or rejects a promise\n * based on input\n *\n * @param {Function} resolve Function to run if callback is called\n * @param {Function} reject Function to run if callback ends with an error\n */\nmodule.exports.callbackPromise = (resolve, reject) =>\n function () {\n let args = Array.from(arguments);\n let err = args.shift();\n if (err) {\n reject(err);\n } else {\n resolve(...args);\n }\n };\n\n/**\n * Resolves a String or a Buffer value for content value. Useful if the value\n * is a Stream or a file or an URL. If the value is a Stream, overwrites\n * the stream object with the resolved value (you can't stream a value twice).\n *\n * This is useful when you want to create a plugin that needs a content value,\n * for example the `html` or `text` value as a String or a Buffer but not as\n * a file path or an URL.\n *\n * @param {Object} data An object or an Array you want to resolve an element for\n * @param {String|Number} key Property name or an Array index\n * @param {Function} callback Callback function with (err, value)\n */\nmodule.exports.resolveContent = (data, key, callback) => {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = module.exports.callbackPromise(resolve, reject);\n });\n }\n\n let content = (data && data[key] && data[key].content) || data[key];\n let contentStream;\n let encoding = ((typeof data[key] === 'object' && data[key].encoding) || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!content) {\n return callback(null, content);\n }\n\n if (typeof content === 'object') {\n if (typeof content.pipe === 'function') {\n return resolveStream(content, (err, value) => {\n if (err) {\n return callback(err);\n }\n // we can't stream twice the same content, so we need\n // to replace the stream object with the streaming result\n if (data[key].content) {\n data[key].content = value;\n } else {\n data[key] = value;\n }\n callback(null, value);\n });\n } else if (/^https?:\\/\\//i.test(content.path || content.href)) {\n contentStream = nmfetch(content.path || content.href);\n return resolveStream(contentStream, callback);\n } else if (/^data:/i.test(content.path || content.href)) {\n let parts = (content.path || content.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);\n if (!parts) {\n return callback(null, Buffer.from(0));\n }\n return callback(null, /\\bbase64$/i.test(parts[1]) ? Buffer.from(parts[2], 'base64') : Buffer.from(decodeURIComponent(parts[2])));\n } else if (content.path) {\n return resolveStream(fs.createReadStream(content.path), callback);\n }\n }\n\n if (typeof data[key].content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n content = Buffer.from(data[key].content, encoding);\n }\n\n // default action, return as is\n setImmediate(() => callback(null, content));\n\n return promise;\n};\n\n/**\n * Copies properties from source objects to target objects\n */\nmodule.exports.assign = function (/* target, ... sources */) {\n let args = Array.from(arguments);\n let target = args.shift() || {};\n\n args.forEach(source => {\n Object.keys(source || {}).forEach(key => {\n if (['tls', 'auth'].includes(key) && source[key] && typeof source[key] === 'object') {\n // tls and auth are special keys that need to be enumerated separately\n // other objects are passed as is\n if (!target[key]) {\n // ensure that target has this key\n target[key] = {};\n }\n Object.keys(source[key]).forEach(subKey => {\n target[key][subKey] = source[key][subKey];\n });\n } else {\n target[key] = source[key];\n }\n });\n });\n return target;\n};\n\nmodule.exports.encodeXText = str => {\n // ! 0x21\n // + 0x2B\n // = 0x3D\n // ~ 0x7E\n if (!/[^\\x21-\\x2A\\x2C-\\x3C\\x3E-\\x7E]/.test(str)) {\n return str;\n }\n let buf = Buffer.from(str);\n let result = '';\n for (let i = 0, len = buf.length; i < len; i++) {\n let c = buf[i];\n if (c < 0x21 || c > 0x7e || c === 0x2b || c === 0x3d) {\n result += '+' + (c < 0x10 ? '0' : '') + c.toString(16).toUpperCase();\n } else {\n result += String.fromCharCode(c);\n }\n }\n return result;\n};\n\n/**\n * Streams a stream value into a Buffer\n *\n * @param {Object} stream Readable stream\n * @param {Function} callback Callback function with (err, value)\n */\nfunction resolveStream(stream, callback) {\n let responded = false;\n let chunks = [];\n let chunklen = 0;\n\n stream.on('error', err => {\n if (responded) {\n return;\n }\n\n responded = true;\n callback(err);\n });\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.on('end', () => {\n if (responded) {\n return;\n }\n responded = true;\n\n let value;\n\n try {\n value = Buffer.concat(chunks, chunklen);\n } catch (E) {\n return callback(E);\n }\n callback(null, value);\n });\n}\n\n/**\n * Generates a bunyan-like logger that prints to console\n *\n * @returns {Object} Bunyan logger instance\n */\nfunction createDefaultLogger(levels) {\n let levelMaxLen = 0;\n let levelNames = new Map();\n levels.forEach(level => {\n if (level.length > levelMaxLen) {\n levelMaxLen = level.length;\n }\n });\n\n levels.forEach(level => {\n let levelName = level.toUpperCase();\n if (levelName.length < levelMaxLen) {\n levelName += ' '.repeat(levelMaxLen - levelName.length);\n }\n levelNames.set(level, levelName);\n });\n\n let print = (level, entry, message, ...args) => {\n let prefix = '';\n if (entry) {\n if (entry.tnx === 'server') {\n prefix = 'S: ';\n } else if (entry.tnx === 'client') {\n prefix = 'C: ';\n }\n\n if (entry.sid) {\n prefix = '[' + entry.sid + '] ' + prefix;\n }\n\n if (entry.cid) {\n prefix = '[#' + entry.cid + '] ' + prefix;\n }\n }\n\n message = util.format(message, ...args);\n message.split(/\\r?\\n/).forEach(line => {\n console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);\n });\n };\n\n let logger = {};\n levels.forEach(level => {\n logger[level] = print.bind(null, level);\n });\n\n return logger;\n}\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Escapes dots in the beginning of lines. Ends the stream with .\n * Also makes sure that only sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass DataStream extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this._curLine = '';\n\n this.inByteCount = 0;\n this.outByteCount = 0;\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let chunks = [];\n let chunklen = 0;\n let i,\n len,\n lastPos = 0;\n let buf;\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk);\n }\n\n this.inByteCount += chunk.length;\n\n for (i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x2e) {\n // .\n if ((i && chunk[i - 1] === 0x0a) || (!i && (!this.lastByte || this.lastByte === 0x0a))) {\n buf = chunk.slice(lastPos, i + 1);\n chunks.push(buf);\n chunks.push(Buffer.from('.'));\n chunklen += buf.length + 1;\n lastPos = i + 1;\n }\n } else if (chunk[i] === 0x0a) {\n // .\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n chunks.push(buf);\n chunklen += buf.length + 2;\n } else {\n chunklen += 2;\n }\n chunks.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (chunklen) {\n // add last piece\n if (lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n chunks.push(buf);\n chunklen += buf.length;\n }\n\n this.outByteCount += chunklen;\n this.push(Buffer.concat(chunks, chunklen));\n } else {\n this.outByteCount += chunk.length;\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n\n /**\n * Finalizes the stream with a dot on a single line\n */\n _flush(done) {\n let buf;\n if (this.lastByte === 0x0a) {\n buf = Buffer.from('.\\r\\n');\n } else if (this.lastByte === 0x0d) {\n buf = Buffer.from('\\n.\\r\\n');\n } else {\n buf = Buffer.from('\\r\\n.\\r\\n');\n }\n this.outByteCount += buf.length;\n this.push(buf);\n done();\n }\n}\n\nmodule.exports = DataStream;\n","'use strict';\n\n/**\n * Minimal HTTP/S proxy client\n */\n\nconst net = require('net');\nconst tls = require('tls');\nconst urllib = require('url');\n\n/**\n * Establishes proxied connection to destinationPort\n *\n * httpProxyClient(\"http://localhost:3128/\", 80, \"google.com\", function(err, socket){\n * socket.write(\"GET / HTTP/1.0\\r\\n\\r\\n\");\n * });\n *\n * @param {String} proxyUrl proxy configuration, etg \"http://proxy.host:3128/\"\n * @param {Number} destinationPort Port to open in destination host\n * @param {String} destinationHost Destination hostname\n * @param {Function} callback Callback to run with the rocket object once connection is established\n */\nfunction httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {\n let proxy = urllib.parse(proxyUrl);\n\n // create a socket connection to the proxy server\n let options;\n let connect;\n let socket;\n\n options = {\n host: proxy.hostname,\n port: Number(proxy.port) ? Number(proxy.port) : proxy.protocol === 'https:' ? 443 : 80\n };\n\n if (proxy.protocol === 'https:') {\n // we can use untrusted proxies as long as we verify actual SMTP certificates\n options.rejectUnauthorized = false;\n connect = tls.connect.bind(tls);\n } else {\n connect = net.connect.bind(net);\n }\n\n // Error harness for initial connection. Once connection is established, the responsibility\n // to handle errors is passed to whoever uses this socket\n let finished = false;\n let tempSocketErr = err => {\n if (finished) {\n return;\n }\n finished = true;\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n callback(err);\n };\n\n let timeoutErr = () => {\n let err = new Error('Proxy socket timed out');\n err.code = 'ETIMEDOUT';\n tempSocketErr(err);\n };\n\n socket = connect(options, () => {\n if (finished) {\n return;\n }\n\n let reqHeaders = {\n Host: destinationHost + ':' + destinationPort,\n Connection: 'close'\n };\n if (proxy.auth) {\n reqHeaders['Proxy-Authorization'] = 'Basic ' + Buffer.from(proxy.auth).toString('base64');\n }\n\n socket.write(\n // HTTP method\n 'CONNECT ' +\n destinationHost +\n ':' +\n destinationPort +\n ' HTTP/1.1\\r\\n' +\n // HTTP request headers\n Object.keys(reqHeaders)\n .map(key => key + ': ' + reqHeaders[key])\n .join('\\r\\n') +\n // End request\n '\\r\\n\\r\\n'\n );\n\n let headers = '';\n let onSocketData = chunk => {\n let match;\n let remainder;\n\n if (finished) {\n return;\n }\n\n headers += chunk.toString('binary');\n if ((match = headers.match(/\\r\\n\\r\\n/))) {\n socket.removeListener('data', onSocketData);\n\n remainder = headers.substr(match.index + match[0].length);\n headers = headers.substr(0, match.index);\n if (remainder) {\n socket.unshift(Buffer.from(remainder, 'binary'));\n }\n\n // proxy connection is now established\n finished = true;\n\n // check response code\n match = headers.match(/^HTTP\\/\\d+\\.\\d+ (\\d+)/i);\n if (!match || (match[1] || '').charAt(0) !== '2') {\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n return callback(new Error('Invalid response from proxy' + ((match && ': ' + match[1]) || '')));\n }\n\n socket.removeListener('error', tempSocketErr);\n socket.removeListener('timeout', timeoutErr);\n socket.setTimeout(0);\n\n return callback(null, socket);\n }\n };\n socket.on('data', onSocketData);\n });\n\n socket.setTimeout(httpProxyClient.timeout || 30 * 1000);\n socket.on('timeout', timeoutErr);\n\n socket.once('error', tempSocketErr);\n}\n\nmodule.exports = httpProxyClient;\n","'use strict';\n\nconst packageInfo = require('../../package.json');\nconst EventEmitter = require('events').EventEmitter;\nconst net = require('net');\nconst tls = require('tls');\nconst os = require('os');\nconst crypto = require('crypto');\nconst DataStream = require('./data-stream');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\n// default timeout values in ms\nconst CONNECTION_TIMEOUT = 2 * 60 * 1000; // how much to wait for the connection to be established\nconst SOCKET_TIMEOUT = 10 * 60 * 1000; // how much to wait for socket inactivity before disconnecting the client\nconst GREETING_TIMEOUT = 30 * 1000; // how much to wait after connection is established but SMTP greeting is not receieved\n\n/**\n * Generates a SMTP connection object\n *\n * Optional options object takes the following possible properties:\n *\n * * **port** - is the port to connect to (defaults to 587 or 465)\n * * **host** - is the hostname or IP address to connect to (defaults to 'localhost')\n * * **secure** - use SSL\n * * **ignoreTLS** - ignore server support for STARTTLS\n * * **requireTLS** - forces the client to use STARTTLS\n * * **name** - the name of the client server\n * * **localAddress** - outbound address to bind to (see: http://nodejs.org/api/net.html#net_net_connect_options_connectionlistener)\n * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 10000)\n * * **connectionTimeout** - how many milliseconds to wait for the connection to establish\n * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 1 hour)\n * * **lmtp** - if true, uses LMTP instead of SMTP protocol\n * * **logger** - bunyan compatible logger interface\n * * **debug** - if true pass SMTP traffic to the logger\n * * **tls** - options for createCredentials\n * * **socket** - existing socket to use instead of creating a new one (see: http://nodejs.org/api/net.html#net_class_net_socket)\n * * **secured** - boolean indicates that the provided socket has already been upgraded to tls\n *\n * @constructor\n * @namespace SMTP Client module\n * @param {Object} [options] Option properties\n */\nclass SMTPConnection extends EventEmitter {\n constructor(options) {\n super(options);\n\n this.id = crypto.randomBytes(8).toString('base64').replace(/\\W/g, '');\n this.stage = 'init';\n\n this.options = options || {};\n\n this.secureConnection = !!this.options.secure;\n this.alreadySecured = !!this.options.secured;\n\n this.port = Number(this.options.port) || (this.secureConnection ? 465 : 587);\n this.host = this.options.host || 'localhost';\n\n this.allowInternalNetworkInterfaces = this.options.allowInternalNetworkInterfaces || false;\n\n if (typeof this.options.secure === 'undefined' && this.port === 465) {\n // if secure option is not set but port is 465, then default to secure\n this.secureConnection = true;\n }\n\n this.name = this.options.name || this._getHostname();\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-connection',\n sid: this.id\n });\n\n this.customAuth = new Map();\n Object.keys(this.options.customAuth || {}).forEach(key => {\n let mapKey = (key || '').toString().trim().toUpperCase();\n if (!mapKey) {\n return;\n }\n this.customAuth.set(mapKey, this.options.customAuth[key]);\n });\n\n /**\n * Expose version nr, just for the reference\n * @type {String}\n */\n this.version = packageInfo.version;\n\n /**\n * If true, then the user is authenticated\n * @type {Boolean}\n */\n this.authenticated = false;\n\n /**\n * If set to true, this instance is no longer active\n * @private\n */\n this.destroyed = false;\n\n /**\n * Defines if the current connection is secure or not. If not,\n * STARTTLS can be used if available\n * @private\n */\n this.secure = !!this.secureConnection;\n\n /**\n * Store incomplete messages coming from the server\n * @private\n */\n this._remainder = '';\n\n /**\n * Unprocessed responses from the server\n * @type {Array}\n */\n this._responseQueue = [];\n\n this.lastServerResponse = false;\n\n /**\n * The socket connecting to the server\n * @publick\n */\n this._socket = false;\n\n /**\n * Lists supported auth mechanisms\n * @private\n */\n this._supportedAuth = [];\n\n /**\n * Set to true, if EHLO response includes \"AUTH\".\n * If false then authentication is not tried\n */\n this.allowsAuth = false;\n\n /**\n * Includes current envelope (from, to)\n * @private\n */\n this._envelope = false;\n\n /**\n * Lists supported extensions\n * @private\n */\n this._supportedExtensions = [];\n\n /**\n * Defines the maximum allowed size for a single message\n * @private\n */\n this._maxAllowedSize = 0;\n\n /**\n * Function queue to run if a data chunk comes from the server\n * @private\n */\n this._responseActions = [];\n this._recipientQueue = [];\n\n /**\n * Timeout variable for waiting the greeting\n * @private\n */\n this._greetingTimeout = false;\n\n /**\n * Timeout variable for waiting the connection to start\n * @private\n */\n this._connectionTimeout = false;\n\n /**\n * If the socket is deemed already closed\n * @private\n */\n this._destroyed = false;\n\n /**\n * If the socket is already being closed\n * @private\n */\n this._closing = false;\n\n /**\n * Callbacks for socket's listeners\n */\n this._onSocketData = chunk => this._onData(chunk);\n this._onSocketError = error => this._onError(error, 'ESOCKET', false, 'CONN');\n this._onSocketClose = () => this._onClose();\n this._onSocketEnd = () => this._onEnd();\n this._onSocketTimeout = () => this._onTimeout();\n }\n\n /**\n * Creates a connection to a SMTP server and sets up connection\n * listener\n */\n connect(connectCallback) {\n if (typeof connectCallback === 'function') {\n this.once('connect', () => {\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'SMTP handshake finished'\n );\n connectCallback();\n });\n\n const isDestroyedMessage = this._isDestroyedMessage('connect');\n if (isDestroyedMessage) {\n return connectCallback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'CONN'));\n }\n }\n\n let opts = {\n port: this.port,\n host: this.host,\n allowInternalNetworkInterfaces: this.allowInternalNetworkInterfaces\n };\n\n if (this.options.localAddress) {\n opts.localAddress = this.options.localAddress;\n }\n\n let setupConnectionHandlers = () => {\n this._connectionTimeout = setTimeout(() => {\n this._onError('Connection timeout', 'ETIMEDOUT', false, 'CONN');\n }, this.options.connectionTimeout || CONNECTION_TIMEOUT);\n\n this._socket.on('error', this._onSocketError);\n };\n\n if (this.options.connection) {\n // connection is already opened\n this._socket = this.options.connection;\n if (this.secureConnection && !this.alreadySecured) {\n setImmediate(() =>\n this._upgradeConnection(err => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'CONN');\n return;\n }\n this._onConnect();\n })\n );\n } else {\n setImmediate(() => this._onConnect());\n }\n return;\n } else if (this.options.socket) {\n // socket object is set up but not yet connected\n this._socket = this.options.socket;\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket.connect(this.port, this.host, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else if (this.secureConnection) {\n // connect using tls\n if (this.options.tls) {\n Object.keys(this.options.tls).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n }\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = tls.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else {\n // connect using plaintext\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = net.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n }\n }\n\n /**\n * Sends QUIT\n */\n quit() {\n this._sendCommand('QUIT');\n this._responseActions.push(this.close);\n }\n\n /**\n * Closes the connection to the server\n */\n close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }\n\n /**\n * Authenticate user\n */\n login(authData, callback) {\n const isDestroyedMessage = this._isDestroyedMessage('login');\n if (isDestroyedMessage) {\n return callback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n this._auth = authData || {};\n // Select SASL authentication method\n this._authMethod = (this._auth.method || '').toString().trim().toUpperCase() || false;\n\n if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {\n this._authMethod = 'XOAUTH2';\n } else if (!this._authMethod || (this._authMethod === 'XOAUTH2' && !this._auth.oauth2)) {\n // use first supported\n this._authMethod = (this._supportedAuth[0] || 'PLAIN').toUpperCase().trim();\n }\n\n if (this._authMethod !== 'XOAUTH2' && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) {\n if (this._auth.user && this._auth.pass) {\n this._auth.credentials = {\n user: this._auth.user,\n pass: this._auth.pass,\n options: this._auth.options\n };\n } else {\n return callback(this._formatError('Missing credentials for \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n }\n\n if (this.customAuth.has(this._authMethod)) {\n let handler = this.customAuth.get(this._authMethod);\n let lastResponse;\n let returned = false;\n\n let resolve = () => {\n if (returned) {\n return;\n }\n returned = true;\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n };\n\n let reject = err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(this._formatError(err, 'EAUTH', lastResponse, 'AUTH ' + this._authMethod));\n };\n\n let handlerResponse = handler({\n auth: this._auth,\n method: this._authMethod,\n\n extensions: [].concat(this._supportedExtensions),\n authMethods: [].concat(this._supportedAuth),\n maxAllowedSize: this._maxAllowedSize || false,\n\n sendCommand: (cmd, done) => {\n let promise;\n\n if (!done) {\n promise = new Promise((resolve, reject) => {\n done = shared.callbackPromise(resolve, reject);\n });\n }\n\n this._responseActions.push(str => {\n lastResponse = str;\n\n let codes = str.match(/^(\\d+)(?:\\s(\\d+\\.\\d+\\.\\d+))?\\s/);\n let data = {\n command: cmd,\n response: str\n };\n if (codes) {\n data.status = Number(codes[1]) || 0;\n if (codes[2]) {\n data.code = codes[2];\n }\n data.text = str.substr(codes[0].length);\n } else {\n data.text = str;\n data.status = 0; // just in case we need to perform numeric comparisons\n }\n done(null, data);\n });\n setImmediate(() => this._sendCommand(cmd));\n\n return promise;\n },\n\n resolve,\n reject\n });\n\n if (handlerResponse && typeof handlerResponse.catch === 'function') {\n // a promise was returned\n handlerResponse.then(resolve).catch(reject);\n }\n\n return;\n }\n\n switch (this._authMethod) {\n case 'XOAUTH2':\n this._handleXOauth2Token(false, callback);\n return;\n case 'LOGIN':\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_USER(str, callback);\n });\n this._sendCommand('AUTH LOGIN');\n return;\n case 'PLAIN':\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n this._sendCommand(\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n this._auth.credentials.pass,\n 'utf-8'\n ).toString('base64'),\n // log entry without passwords\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n '/* secret */',\n 'utf-8'\n ).toString('base64')\n );\n return;\n case 'CRAM-MD5':\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5(str, callback);\n });\n this._sendCommand('AUTH CRAM-MD5');\n return;\n }\n\n return callback(this._formatError('Unknown authentication method \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n\n /**\n * Sends a message\n *\n * @param {Object} envelope Envelope object, {from: addr, to: [addr]}\n * @param {Object} message String, Buffer or a Stream\n * @param {Function} callback Callback to return once sending is completed\n */\n send(envelope, message, done) {\n if (!message) {\n return done(this._formatError('Empty message', 'EMESSAGE', false, 'API'));\n }\n\n const isDestroyedMessage = this._isDestroyedMessage('send message');\n if (isDestroyedMessage) {\n return done(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n // reject larger messages than allowed\n if (this._maxAllowedSize && envelope.size > this._maxAllowedSize) {\n return setImmediate(() => {\n done(this._formatError('Message size larger than allowed ' + this._maxAllowedSize, 'EMESSAGE', false, 'MAIL FROM'));\n });\n }\n\n // ensure that callback is only called once\n let returned = false;\n let callback = function () {\n if (returned) {\n return;\n }\n returned = true;\n\n done(...arguments);\n };\n\n if (typeof message.on === 'function') {\n message.on('error', err => callback(this._formatError(err, 'ESTREAM', false, 'API')));\n }\n\n let startTime = Date.now();\n this._setEnvelope(envelope, (err, info) => {\n if (err) {\n return callback(err);\n }\n let envelopeTime = Date.now();\n let stream = this._createSendStream((err, str) => {\n if (err) {\n return callback(err);\n }\n\n info.envelopeTime = envelopeTime - startTime;\n info.messageTime = Date.now() - envelopeTime;\n info.messageSize = stream.outByteCount;\n info.response = str;\n\n return callback(null, info);\n });\n if (typeof message.pipe === 'function') {\n message.pipe(stream);\n } else {\n stream.write(message);\n stream.end();\n }\n });\n }\n\n /**\n * Resets connection state\n *\n * @param {Function} callback Callback to return once connection is reset\n */\n reset(callback) {\n this._sendCommand('RSET');\n this._responseActions.push(str => {\n if (str.charAt(0) !== '2') {\n return callback(this._formatError('Could not reset session state. response=' + str, 'EPROTOCOL', str, 'RSET'));\n }\n this._envelope = false;\n return callback(null, true);\n });\n }\n\n /**\n * Connection listener that is run when the connection to\n * the server is opened\n *\n * @event\n */\n _onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }\n\n /**\n * 'data' listener for data coming from the server\n *\n * @event\n * @param {Buffer} chunk Data chunk coming from the server\n */\n _onData(chunk) {\n if (this._destroyed || !chunk || !chunk.length) {\n return;\n }\n\n let data = (chunk || '').toString('binary');\n let lines = (this._remainder + data).split(/\\r?\\n/);\n let lastline;\n\n this._remainder = lines.pop();\n\n for (let i = 0, len = lines.length; i < len; i++) {\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n this._responseQueue[this._responseQueue.length - 1] += '\\n' + lines[i];\n continue;\n }\n }\n this._responseQueue.push(lines[i]);\n }\n\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n return;\n }\n }\n\n this._processResponse();\n }\n\n /**\n * 'error' listener for the socket\n *\n * @event\n * @param {Error} err Error object\n * @param {String} type Error name\n */\n _onError(err, type, data, command) {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n\n if (this._destroyed) {\n // just ignore, already closed\n // this might happen when a socket is canceled because of reached timeout\n // but the socket timeout error itself receives only after\n return;\n }\n\n err = this._formatError(err, type, data, command);\n\n this.logger.error(data, err.message);\n\n this.emit('error', err);\n this.close();\n }\n\n _formatError(message, type, response, command) {\n let err;\n\n if (/Error\\]$/i.test(Object.prototype.toString.call(message))) {\n err = message;\n } else {\n err = new Error(message);\n }\n\n if (type && type !== 'Error') {\n err.code = type;\n }\n\n if (response) {\n err.response = response;\n err.message += ': ' + response;\n }\n\n let responseCode = (typeof response === 'string' && Number((response.match(/^\\d+/) || [])[0])) || false;\n if (responseCode) {\n err.responseCode = responseCode;\n }\n\n if (command) {\n err.command = command;\n }\n\n return err;\n }\n\n /**\n * 'close' listener for the socket\n *\n * @event\n */\n _onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }\n\n /**\n * 'end' listener for the socket\n *\n * @event\n */\n _onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }\n\n /**\n * 'timeout' listener for the socket\n *\n * @event\n */\n _onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }\n\n /**\n * Destroys the client, emits 'end'\n */\n _destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }\n\n /**\n * Upgrades the connection to TLS\n *\n * @param {Function} callback Callback function to run when the connection\n * has been secured\n */\n _upgradeConnection(callback) {\n // do not remove all listeners or it breaks node v0.10 as there's\n // apparently a 'finish' event set that would be cleared as well\n\n // we can safely keep 'error', 'end', 'close' etc. events\n this._socket.removeListener('data', this._onSocketData); // incoming data is going to be gibberish from this point onwards\n this._socket.removeListener('timeout', this._onSocketTimeout); // timeout will be re-set for the new socket object\n\n let socketPlain = this._socket;\n let opts = {\n socket: this._socket,\n host: this.host\n };\n\n Object.keys(this.options.tls || {}).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n\n this.upgrading = true;\n // tls.connect is not an asynchronous function however it may still throw errors and requires to be wrapped with try/catch\n try {\n this._socket = tls.connect(opts, () => {\n this.secure = true;\n this.upgrading = false;\n this._socket.on('data', this._onSocketData);\n\n socketPlain.removeListener('close', this._onSocketClose);\n socketPlain.removeListener('end', this._onSocketEnd);\n\n return callback(null, true);\n });\n } catch (err) {\n return callback(err);\n }\n\n this._socket.on('error', this._onSocketError);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT); // 10 min.\n this._socket.on('timeout', this._onSocketTimeout);\n\n // resume in case the socket was paused\n socketPlain.resume();\n }\n\n /**\n * Processes queued responses from the server\n *\n * @param {Boolean} force If true, ignores _processing flag\n */\n _processResponse() {\n if (!this._responseQueue.length) {\n return false;\n }\n\n let str = (this.lastServerResponse = (this._responseQueue.shift() || '').toString());\n\n if (/^\\d+-/.test(str.split('\\n').pop())) {\n // keep waiting for the final part of multiline response\n return;\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'server'\n },\n str.replace(/\\r?\\n$/, '')\n );\n }\n\n if (!str.trim()) {\n // skip unexpected empty lines\n setImmediate(() => this._processResponse(true));\n }\n\n let action = this._responseActions.shift();\n\n if (typeof action === 'function') {\n action.call(this, str);\n setImmediate(() => this._processResponse(true));\n } else {\n return this._onError(new Error('Unexpected Response'), 'EPROTOCOL', str, 'CONN');\n }\n }\n\n /**\n * Send a command to the server, append \\r\\n\n *\n * @param {String} str String to be sent to the server\n * @param {String} logStr Optional string to be used for logging instead of the actual string\n */\n _sendCommand(str, logStr) {\n if (this._destroyed) {\n // Connection already closed, can't send any more data\n return;\n }\n\n if (this._socket.destroyed) {\n return this.close();\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'client'\n },\n (logStr || str || '').toString().replace(/\\r?\\n$/, '')\n );\n }\n\n this._socket.write(Buffer.from(str + '\\r\\n', 'utf-8'));\n }\n\n /**\n * Initiates a new message by submitting envelope data, starting with\n * MAIL FROM: command\n *\n * @param {Object} envelope Envelope object in the form of\n * {from:'...', to:['...']}\n * or\n * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']}\n */\n _setEnvelope(envelope, callback) {\n let args = [];\n let useSmtpUtf8 = false;\n\n this._envelope = envelope || {};\n this._envelope.from = ((this._envelope.from && this._envelope.from.address) || this._envelope.from || '').toString().trim();\n\n this._envelope.to = [].concat(this._envelope.to || []).map(to => ((to && to.address) || to || '').toString().trim());\n\n if (!this._envelope.to.length) {\n return callback(this._formatError('No recipients defined', 'EENVELOPE', false, 'API'));\n }\n\n if (this._envelope.from && /[\\r\\n<>]/.test(this._envelope.from)) {\n return callback(this._formatError('Invalid sender ' + JSON.stringify(this._envelope.from), 'EENVELOPE', false, 'API'));\n }\n\n // check if the sender address uses only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n useSmtpUtf8 = true;\n }\n\n for (let i = 0, len = this._envelope.to.length; i < len; i++) {\n if (!this._envelope.to[i] || /[\\r\\n<>]/.test(this._envelope.to[i])) {\n return callback(this._formatError('Invalid recipient ' + JSON.stringify(this._envelope.to[i]), 'EENVELOPE', false, 'API'));\n }\n\n // check if the recipients addresses use only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.to[i])) {\n useSmtpUtf8 = true;\n }\n }\n\n // clone the recipients array for latter manipulation\n this._envelope.rcptQueue = JSON.parse(JSON.stringify(this._envelope.to || []));\n this._envelope.rejected = [];\n this._envelope.rejectedErrors = [];\n this._envelope.accepted = [];\n\n if (this._envelope.dsn) {\n try {\n this._envelope.dsn = this._setDsnEnvelope(this._envelope.dsn);\n } catch (err) {\n return callback(this._formatError('Invalid DSN ' + err.message, 'EENVELOPE', false, 'API'));\n }\n }\n\n this._responseActions.push(str => {\n this._actionMAIL(str, callback);\n });\n\n // If the server supports SMTPUTF8 and the envelope includes an internationalized\n // email address then append SMTPUTF8 keyword to the MAIL FROM command\n if (useSmtpUtf8 && this._supportedExtensions.includes('SMTPUTF8')) {\n args.push('SMTPUTF8');\n this._usingSmtpUtf8 = true;\n }\n\n // If the server supports 8BITMIME and the message might contain non-ascii bytes\n // then append the 8BITMIME keyword to the MAIL FROM command\n if (this._envelope.use8BitMime && this._supportedExtensions.includes('8BITMIME')) {\n args.push('BODY=8BITMIME');\n this._using8BitMime = true;\n }\n\n if (this._envelope.size && this._supportedExtensions.includes('SIZE')) {\n args.push('SIZE=' + this._envelope.size);\n }\n\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the MAIL FROM command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.ret) {\n args.push('RET=' + shared.encodeXText(this._envelope.dsn.ret));\n }\n if (this._envelope.dsn.envid) {\n args.push('ENVID=' + shared.encodeXText(this._envelope.dsn.envid));\n }\n }\n\n this._sendCommand('MAIL FROM:<' + this._envelope.from + '>' + (args.length ? ' ' + args.join(' ') : ''));\n }\n\n _setDsnEnvelope(params) {\n let ret = (params.ret || params.return || '').toString().toUpperCase() || null;\n if (ret) {\n switch (ret) {\n case 'HDRS':\n case 'HEADERS':\n ret = 'HDRS';\n break;\n case 'FULL':\n case 'BODY':\n ret = 'FULL';\n break;\n }\n }\n\n if (ret && !['FULL', 'HDRS'].includes(ret)) {\n throw new Error('ret: ' + JSON.stringify(ret));\n }\n\n let envid = (params.envid || params.id || '').toString() || null;\n\n let notify = params.notify || null;\n if (notify) {\n if (typeof notify === 'string') {\n notify = notify.split(',');\n }\n notify = notify.map(n => n.trim().toUpperCase());\n let validNotify = ['NEVER', 'SUCCESS', 'FAILURE', 'DELAY'];\n let invaliNotify = notify.filter(n => !validNotify.includes(n));\n if (invaliNotify.length || (notify.length > 1 && notify.includes('NEVER'))) {\n throw new Error('notify: ' + JSON.stringify(notify.join(',')));\n }\n notify = notify.join(',');\n }\n\n let orcpt = (params.recipient || params.orcpt || '').toString() || null;\n if (orcpt && orcpt.indexOf(';') < 0) {\n orcpt = 'rfc822;' + orcpt;\n }\n\n return {\n ret,\n envid,\n notify,\n orcpt\n };\n }\n\n _getDsnRcptToArgs() {\n let args = [];\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the RCPT TO command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.notify) {\n args.push('NOTIFY=' + shared.encodeXText(this._envelope.dsn.notify));\n }\n if (this._envelope.dsn.orcpt) {\n args.push('ORCPT=' + shared.encodeXText(this._envelope.dsn.orcpt));\n }\n }\n return args.length ? ' ' + args.join(' ') : '';\n }\n\n _createSendStream(callback) {\n let dataStream = new DataStream();\n let logStream;\n\n if (this.options.lmtp) {\n this._envelope.accepted.forEach((recipient, i) => {\n let final = i === this._envelope.accepted.length - 1;\n this._responseActions.push(str => {\n this._actionLMTPStream(recipient, final, str, callback);\n });\n });\n } else {\n this._responseActions.push(str => {\n this._actionSMTPStream(str, callback);\n });\n }\n\n dataStream.pipe(this._socket, {\n end: false\n });\n\n if (this.options.debug) {\n logStream = new PassThrough();\n logStream.on('readable', () => {\n let chunk;\n while ((chunk = logStream.read())) {\n this.logger.debug(\n {\n tnx: 'message'\n },\n chunk.toString('binary').replace(/\\r?\\n$/, '')\n );\n }\n });\n dataStream.pipe(logStream);\n }\n\n dataStream.once('end', () => {\n this.logger.info(\n {\n tnx: 'message',\n inByteCount: dataStream.inByteCount,\n outByteCount: dataStream.outByteCount\n },\n '<%s bytes encoded mime message (source size %s bytes)>',\n dataStream.outByteCount,\n dataStream.inByteCount\n );\n });\n\n return dataStream;\n }\n\n /** ACTIONS **/\n\n /**\n * Will be run after the connection is created and the server sends\n * a greeting. If the incoming message starts with 220 initiate\n * SMTP session by sending EHLO command\n *\n * @param {String} str Message from the server\n */\n _actionGreeting(str) {\n clearTimeout(this._greetingTimeout);\n\n if (str.substr(0, 3) !== '220') {\n this._onError(new Error('Invalid greeting. response=' + str), 'EPROTOCOL', str, 'CONN');\n return;\n }\n\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n }\n\n /**\n * Handles server response for LHLO command. If it yielded in\n * error, emit 'error', otherwise treat this as an EHLO response\n *\n * @param {String} str Message from the server\n */\n _actionLHLO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid LHLO. response=' + str), 'EPROTOCOL', str, 'LHLO');\n return;\n }\n\n this._actionEHLO(str);\n }\n\n /**\n * Handles server response for EHLO command. If it yielded in\n * error, try HELO instead, otherwise initiate TLS negotiation\n * if STARTTLS is supported by the server or move into the\n * authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionEHLO(str) {\n let match;\n\n if (str.substr(0, 3) === '421') {\n this._onError(new Error('Server terminates connection. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n if (this.options.requireTLS) {\n this._onError(new Error('EHLO failed but HELO does not support required STARTTLS. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n // Try HELO instead\n this._responseActions.push(this._actionHELO);\n this._sendCommand('HELO ' + this.name);\n return;\n }\n\n // Detect if the server supports STARTTLS\n if (!this.secure && !this.options.ignoreTLS && (/[ -]STARTTLS\\b/im.test(str) || this.options.requireTLS)) {\n this._sendCommand('STARTTLS');\n this._responseActions.push(this._actionSTARTTLS);\n return;\n }\n\n // Detect if the server supports SMTPUTF8\n if (/[ -]SMTPUTF8\\b/im.test(str)) {\n this._supportedExtensions.push('SMTPUTF8');\n }\n\n // Detect if the server supports DSN\n if (/[ -]DSN\\b/im.test(str)) {\n this._supportedExtensions.push('DSN');\n }\n\n // Detect if the server supports 8BITMIME\n if (/[ -]8BITMIME\\b/im.test(str)) {\n this._supportedExtensions.push('8BITMIME');\n }\n\n // Detect if the server supports PIPELINING\n if (/[ -]PIPELINING\\b/im.test(str)) {\n this._supportedExtensions.push('PIPELINING');\n }\n\n // Detect if the server supports AUTH\n if (/[ -]AUTH\\b/i.test(str)) {\n this.allowsAuth = true;\n }\n\n // Detect if the server supports PLAIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)PLAIN/i.test(str)) {\n this._supportedAuth.push('PLAIN');\n }\n\n // Detect if the server supports LOGIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)LOGIN/i.test(str)) {\n this._supportedAuth.push('LOGIN');\n }\n\n // Detect if the server supports CRAM-MD5 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)CRAM-MD5/i.test(str)) {\n this._supportedAuth.push('CRAM-MD5');\n }\n\n // Detect if the server supports XOAUTH2 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)XOAUTH2/i.test(str)) {\n this._supportedAuth.push('XOAUTH2');\n }\n\n // Detect if the server supports SIZE extensions (and the max allowed size)\n if ((match = str.match(/[ -]SIZE(?:[ \\t]+(\\d+))?/im))) {\n this._supportedExtensions.push('SIZE');\n this._maxAllowedSize = Number(match[1]) || 0;\n }\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for HELO command. If it yielded in\n * error, emit 'error', otherwise move into the authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionHELO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid HELO. response=' + str), 'EPROTOCOL', str, 'HELO');\n return;\n }\n\n // assume that authentication is enabled (most probably is not though)\n this.allowsAuth = true;\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for STARTTLS command. If there's an error\n * try HELO instead, otherwise initiate TLS upgrade. If the upgrade\n * succeedes restart the EHLO\n *\n * @param {String} str Message from the server\n */\n _actionSTARTTLS(str) {\n if (str.charAt(0) !== '2') {\n if (this.options.opportunisticTLS) {\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Failed STARTTLS upgrade, continuing unencrypted'\n );\n return this.emit('connect');\n }\n this._onError(new Error('Error upgrading connection with STARTTLS'), 'ETLS', str, 'STARTTLS');\n return;\n }\n\n this._upgradeConnection((err, secured) => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'STARTTLS');\n return;\n }\n\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Connection upgraded with STARTTLS'\n );\n\n if (secured) {\n // restart session\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n } else {\n this.emit('connect');\n }\n });\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 VXNlcm5hbWU6' (base64 for 'Username:'). Data to be sent as\n * response needs to be base64 encoded username. We do not need\n * exact match but settle with 334 response in general as some\n * hosts invalidly use a longer message than VXNlcm5hbWU6\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_USER(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 VXNlcm5hbWU6'\n callback(this._formatError('Invalid login sequence while waiting for \"334 VXNlcm5hbWU6\"', 'EAUTH', str, 'AUTH LOGIN'));\n return;\n }\n\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_PASS(str, callback);\n });\n\n this._sendCommand(Buffer.from(this._auth.credentials.user + '', 'utf-8').toString('base64'));\n }\n\n /**\n * Handle the response for AUTH CRAM-MD5 command. We are expecting\n * '334 '. Data to be sent as response needs to be\n * base64 decoded challenge string, MD5 hashed using the password as\n * a HMAC key, prefixed by the username and a space, and finally all\n * base64 encoded again.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5(str, callback) {\n let challengeMatch = str.match(/^334\\s+(.+)$/);\n let challengeString = '';\n\n if (!challengeMatch) {\n return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH CRAM-MD5'));\n } else {\n challengeString = challengeMatch[1];\n }\n\n // Decode from base64\n let base64decoded = Buffer.from(challengeString, 'base64').toString('ascii'),\n hmacMD5 = crypto.createHmac('md5', this._auth.credentials.pass);\n\n hmacMD5.update(base64decoded);\n\n let prepended = this._auth.credentials.user + ' ' + hmacMD5.digest('hex');\n\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5_PASS(str, callback);\n });\n\n this._sendCommand(\n Buffer.from(prepended).toString('base64'),\n // hidden hash for logs\n Buffer.from(this._auth.credentials.user + ' /* secret */').toString('base64')\n );\n }\n\n /**\n * Handles the response to CRAM-MD5 authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5_PASS(str, callback) {\n if (!str.match(/^235\\s+/)) {\n return callback(this._formatError('Invalid login sequence while waiting for \"235\"', 'EAUTH', str, 'AUTH CRAM-MD5'));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 UGFzc3dvcmQ6' (base64 for 'Password:'). Data to be sent as\n * response needs to be base64 encoded password.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_PASS(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 UGFzc3dvcmQ6'\n return callback(this._formatError('Invalid login sequence while waiting for \"334 UGFzc3dvcmQ6\"', 'EAUTH', str, 'AUTH LOGIN'));\n }\n\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n\n this._sendCommand(\n Buffer.from((this._auth.credentials.pass || '').toString(), 'utf-8').toString('base64'),\n // Hidden pass for logs\n Buffer.from('/* secret */', 'utf-8').toString('base64')\n );\n }\n\n /**\n * Handles the response for authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTHComplete(str, isRetry, callback) {\n if (!callback && typeof isRetry === 'function') {\n callback = isRetry;\n isRetry = false;\n }\n\n if (str.substr(0, 3) === '334') {\n this._responseActions.push(str => {\n if (isRetry || this._authMethod !== 'XOAUTH2') {\n this._actionAUTHComplete(str, true, callback);\n } else {\n // fetch a new OAuth2 access token\n setImmediate(() => this._handleXOauth2Token(true, callback));\n }\n });\n this._sendCommand('');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError('Invalid login', 'EAUTH', str, 'AUTH ' + this._authMethod));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle response for a MAIL FROM: command\n *\n * @param {String} str Message from the server\n */\n _actionMAIL(str, callback) {\n let message, curRecipient;\n if (Number(str.charAt(0)) !== 2) {\n if (this._usingSmtpUtf8 && /^550 /.test(str) && /[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Mail command failed';\n }\n return callback(this._formatError(message, 'EENVELOPE', str, 'MAIL FROM'));\n }\n\n if (!this._envelope.rcptQueue.length) {\n return callback(this._formatError('Can\\x27t send mail - no recipients defined', 'EENVELOPE', false, 'API'));\n } else {\n this._recipientQueue = [];\n\n if (this._supportedExtensions.includes('PIPELINING')) {\n while (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n } else {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n }\n\n /**\n * Handle response for a RCPT TO: command\n *\n * @param {String} str Message from the server\n */\n _actionRCPT(str, callback) {\n let message,\n err,\n curRecipient = this._recipientQueue.shift();\n if (Number(str.charAt(0)) !== 2) {\n // this is a soft error\n if (this._usingSmtpUtf8 && /^553 /.test(str) && /[\\x80-\\uFFFF]/.test(curRecipient)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Recipient command failed';\n }\n this._envelope.rejected.push(curRecipient);\n // store error for the failed recipient\n err = this._formatError(message, 'EENVELOPE', str, 'RCPT TO');\n err.recipient = curRecipient;\n this._envelope.rejectedErrors.push(err);\n } else {\n this._envelope.accepted.push(curRecipient);\n }\n\n if (!this._envelope.rcptQueue.length && !this._recipientQueue.length) {\n if (this._envelope.rejected.length < this._envelope.to.length) {\n this._responseActions.push(str => {\n this._actionDATA(str, callback);\n });\n this._sendCommand('DATA');\n } else {\n err = this._formatError('Can\\x27t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO');\n err.rejected = this._envelope.rejected;\n err.rejectedErrors = this._envelope.rejectedErrors;\n return callback(err);\n }\n } else if (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n\n /**\n * Handle response for a DATA command\n *\n * @param {String} str Message from the server\n */\n _actionDATA(str, callback) {\n // response should be 354 but according to this issue https://github.com/eleith/emailjs/issues/24\n // some servers might use 250 instead, so lets check for 2 or 3 as the first digit\n if (!/^[23]/.test(str)) {\n return callback(this._formatError('Data command failed', 'EENVELOPE', str, 'DATA'));\n }\n\n let response = {\n accepted: this._envelope.accepted,\n rejected: this._envelope.rejected\n };\n\n if (this._envelope.rejectedErrors.length) {\n response.rejectedErrors = this._envelope.rejectedErrors;\n }\n\n callback(null, response);\n }\n\n /**\n * Handle response for a DATA stream when using SMTP\n * We expect a single response that defines if the sending succeeded or failed\n *\n * @param {String} str Message from the server\n */\n _actionSMTPStream(str, callback) {\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n return callback(this._formatError('Message failed', 'EMESSAGE', str, 'DATA'));\n } else {\n // Message sent succesfully\n return callback(null, str);\n }\n }\n\n /**\n * Handle response for a DATA stream\n * We expect a separate response for every recipient. All recipients can either\n * succeed or fail separately\n *\n * @param {String} recipient The recipient this response applies to\n * @param {Boolean} final Is this the final recipient?\n * @param {String} str Message from the server\n */\n _actionLMTPStream(recipient, final, str, callback) {\n let err;\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n err = this._formatError('Message failed for recipient ' + recipient, 'EMESSAGE', str, 'DATA');\n err.recipient = recipient;\n this._envelope.rejected.push(recipient);\n this._envelope.rejectedErrors.push(err);\n for (let i = 0, len = this._envelope.accepted.length; i < len; i++) {\n if (this._envelope.accepted[i] === recipient) {\n this._envelope.accepted.splice(i, 1);\n }\n }\n }\n if (final) {\n return callback(null, str);\n }\n }\n\n _handleXOauth2Token(isRetry, callback) {\n this._auth.oauth2.getToken(isRetry, (err, accessToken) => {\n if (err) {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError(err, 'EAUTH', false, 'AUTH XOAUTH2'));\n }\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, isRetry, callback);\n });\n this._sendCommand(\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token(accessToken),\n // Hidden for logs\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token('/* secret */')\n );\n });\n }\n\n /**\n *\n * @param {string} command\n * @private\n */\n _isDestroyedMessage(command) {\n if (this._destroyed) {\n return 'Cannot ' + command + ' - smtp connection is already destroyed.';\n }\n\n if (this._socket) {\n if (this._socket.destroyed) {\n return 'Cannot ' + command + ' - smtp connection socket is already destroyed.';\n }\n\n if (!this._socket.writable) {\n return 'Cannot ' + command + ' - smtp connection socket is already half-closed.';\n }\n }\n }\n\n _getHostname() {\n // defaul hostname is machine hostname or [IP]\n let defaultHostname;\n try {\n defaultHostname = os.hostname() || '';\n } catch (err) {\n // fails on windows 7\n defaultHostname = 'localhost';\n }\n\n // ignore if not FQDN\n if (!defaultHostname || defaultHostname.indexOf('.') < 0) {\n defaultHostname = '[127.0.0.1]';\n }\n\n // IP should be enclosed in []\n if (defaultHostname.match(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/)) {\n defaultHostname = '[' + defaultHostname + ']';\n }\n\n return defaultHostname;\n }\n}\n\nmodule.exports = SMTPConnection;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst PoolResource = require('./pool-resource');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP pool transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options SMTP Connection options\n */\nclass SMTPPool extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.options.maxConnections = this.options.maxConnections || 5;\n this.options.maxMessages = this.options.maxMessages || 100;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-pool'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP (pool)';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n this._rateLimit = {\n counter: 0,\n timeout: null,\n waiting: [],\n checkpoint: false,\n delta: Number(this.options.rateDelta) || 1000,\n limit: Number(this.options.rateLimit) || 0\n };\n this._closed = false;\n this._queue = [];\n this._connections = [];\n this._connectionCounter = 0;\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n /**\n * Queues an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (this._closed) {\n return false;\n }\n\n this._queue.push({\n mail,\n requeueAttempts: 0,\n callback\n });\n\n if (this.idling && this._queue.length >= this.options.maxConnections) {\n this.idling = false;\n }\n\n setImmediate(() => this._processMessages());\n\n return true;\n }\n\n /**\n * Closes all connections in the pool. If there is a message being sent, the connection\n * is closed later\n */\n close() {\n let connection;\n let len = this._connections.length;\n this._closed = true;\n\n // clear rate limit timer if it exists\n clearTimeout(this._rateLimit.timeout);\n\n if (!len && !this._queue.length) {\n return;\n }\n\n // remove all available connections\n for (let i = len - 1; i >= 0; i--) {\n if (this._connections[i] && this._connections[i].available) {\n connection = this._connections[i];\n connection.close();\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'removed'\n },\n 'Connection #%s removed',\n connection.id\n );\n }\n }\n\n if (len && !this._connections.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'All connections removed'\n );\n }\n\n if (!this._queue.length) {\n return;\n }\n\n // make sure that entire queue would be cleaned\n let invokeCallbacks = () => {\n if (!this._queue.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'Pending queue entries cleared'\n );\n return;\n }\n let entry = this._queue.shift();\n if (entry && typeof entry.callback === 'function') {\n try {\n entry.callback(new Error('Connection pool was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n }\n setImmediate(invokeCallbacks);\n };\n setImmediate(invokeCallbacks);\n }\n\n /**\n * Check the queue and available connections. If there is a message to be sent and there is\n * an available connection, then use this connection to send the mail\n */\n _processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }\n\n /**\n * Creates a new pool resource\n */\n _createConnection() {\n let connection = new PoolResource(this);\n\n connection.id = ++this._connectionCounter;\n\n this.logger.info(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'conection'\n },\n 'Created new pool resource #%s',\n connection.id\n );\n\n // resource comes available\n connection.on('available', () => {\n this.logger.debug(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'available'\n },\n 'Connection #%s became available',\n connection.id\n );\n\n if (this._closed) {\n // if already closed run close() that will remove this connections from connections list\n this.close();\n } else {\n // check if there's anything else to send\n this._processMessages();\n }\n });\n\n // resource is terminated with an error\n connection.once('error', err => {\n if (err.code !== 'EMAXLIMIT') {\n this.logger.error(\n {\n err,\n tnx: 'pool',\n cid: connection.id\n },\n 'Pool Error for #%s: %s',\n connection.id,\n err.message\n );\n } else {\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'maxlimit'\n },\n 'Max messages limit exchausted for #%s',\n connection.id\n );\n }\n\n if (connection.queueEntry) {\n try {\n connection.queueEntry.callback(err);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n\n // remove the erroneus connection from connections list\n this._removeConnection(connection);\n\n this._continueProcessing();\n });\n\n connection.once('close', () => {\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'closed'\n },\n 'Connection #%s was closed',\n connection.id\n );\n\n this._removeConnection(connection);\n\n if (connection.queueEntry) {\n // If the connection closed when sending, add the message to the queue again\n // if max number of requeues is not reached yet\n // Note that we must wait a bit.. because the callback of the 'error' handler might be called\n // in the next event loop\n setTimeout(() => {\n if (connection.queueEntry) {\n if (this._shouldRequeuOnConnectionClose(connection.queueEntry)) {\n this._requeueEntryOnConnectionClose(connection);\n } else {\n this._failDeliveryOnConnectionClose(connection);\n }\n }\n this._continueProcessing();\n }, 50);\n } else {\n this._continueProcessing();\n }\n });\n\n this._connections.push(connection);\n\n return connection;\n }\n\n _shouldRequeuOnConnectionClose(queueEntry) {\n if (this.options.maxRequeues === undefined || this.options.maxRequeues < 0) {\n return true;\n }\n\n return queueEntry.requeueAttempts < this.options.maxRequeues;\n }\n\n _failDeliveryOnConnectionClose(connection) {\n if (connection.queueEntry && connection.queueEntry.callback) {\n try {\n connection.queueEntry.callback(new Error('Reached maximum number of retries after connection was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n messageId: connection.queueEntry.messageId,\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n }\n\n _requeueEntryOnConnectionClose(connection) {\n connection.queueEntry.requeueAttempts = connection.queueEntry.requeueAttempts + 1;\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: connection.queueEntry.messageId,\n action: 'requeue'\n },\n 'Re-queued message <%s> for #%s. Attempt: #%s',\n connection.queueEntry.messageId,\n connection.id,\n connection.queueEntry.requeueAttempts\n );\n this._queue.unshift(connection.queueEntry);\n connection.queueEntry = false;\n }\n\n /**\n * Continue to process message if the pool hasn't closed\n */\n _continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }\n\n /**\n * Remove resource from pool\n *\n * @param {Object} connection The PoolResource to remove\n */\n _removeConnection(connection) {\n let index = this._connections.indexOf(connection);\n\n if (index !== -1) {\n this._connections.splice(index, 1);\n }\n }\n\n /**\n * Checks if connections have hit current rate limit and if so, queues the availability callback\n *\n * @param {Function} callback Callback function to run once rate limiter has been cleared\n */\n _checkRateLimit(callback) {\n if (!this._rateLimit.limit) {\n return callback();\n }\n\n let now = Date.now();\n\n if (this._rateLimit.counter < this._rateLimit.limit) {\n return callback();\n }\n\n this._rateLimit.waiting.push(callback);\n\n if (this._rateLimit.checkpoint <= now - this._rateLimit.delta) {\n return this._clearRateLimit();\n } else if (!this._rateLimit.timeout) {\n this._rateLimit.timeout = setTimeout(() => this._clearRateLimit(), this._rateLimit.delta - (now - this._rateLimit.checkpoint));\n this._rateLimit.checkpoint = now;\n }\n }\n\n /**\n * Clears current rate limit limitation and runs paused callback\n */\n _clearRateLimit() {\n clearTimeout(this._rateLimit.timeout);\n this._rateLimit.timeout = null;\n this._rateLimit.counter = 0;\n this._rateLimit.checkpoint = false;\n\n // resume all paused connections\n while (this._rateLimit.waiting.length) {\n let cb = this._rateLimit.waiting.shift();\n setImmediate(cb);\n }\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let auth = new PoolResource(this).auth;\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!auth && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n}\n\n// expose to the world\nmodule.exports = SMTPPool;\n","'use strict';\n\nconst SMTPConnection = require('../smtp-connection');\nconst assign = require('../shared').assign;\nconst XOAuth2 = require('../xoauth2');\nconst EventEmitter = require('events');\n\n/**\n * Creates an element for the pool\n *\n * @constructor\n * @param {Object} options SMTPPool instance\n */\nclass PoolResource extends EventEmitter {\n constructor(pool) {\n super();\n\n this.pool = pool;\n this.options = pool.options;\n this.logger = this.pool.logger;\n\n if (this.options.auth) {\n switch ((this.options.auth.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n let oauth2 = new XOAuth2(this.options.auth, this.logger);\n oauth2.provisionCallback = (this.pool.mailer && this.pool.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n this.auth = {\n type: 'OAUTH2',\n user: this.options.auth.user,\n oauth2,\n method: 'XOAUTH2'\n };\n oauth2.on('token', token => this.pool.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n break;\n }\n default:\n if (!this.options.auth.user && !this.options.auth.pass) {\n break;\n }\n this.auth = {\n type: (this.options.auth.type || '').toString().toUpperCase() || 'LOGIN',\n user: this.options.auth.user,\n credentials: {\n user: this.options.auth.user || '',\n pass: this.options.auth.pass,\n options: this.options.auth.options\n },\n method: (this.options.auth.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n this._connection = false;\n this._connected = false;\n\n this.messages = 0;\n this.available = true;\n }\n\n /**\n * Initiates a connection to the SMTP server\n *\n * @param {Function} callback Callback function to run once the connection is established or failed\n */\n connect(callback) {\n this.pool.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n this.connection = new SMTPConnection(options);\n\n this.connection.once('error', err => {\n this.emit('error', err);\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n this.connection.once('end', () => {\n this.close();\n if (returned) {\n return;\n }\n returned = true;\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (this.connection && this.connection._socket && this.connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n this.connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (this.auth && (this.connection.allowsAuth || options.forceAuth)) {\n this.connection.login(this.auth, err => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n this._connected = true;\n callback(null, true);\n });\n } else {\n returned = true;\n this._connected = true;\n return callback(null, true);\n }\n });\n });\n }\n\n /**\n * Sends an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (!this._connected) {\n return this.connect(err => {\n if (err) {\n return callback(err);\n }\n return this.send(mail, callback);\n });\n }\n\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId,\n cid: this.id\n },\n 'Sending message %s using #%s to <%s>',\n messageId,\n this.id,\n recipients.join(', ')\n );\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n this.messages++;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n\n setImmediate(() => {\n let err;\n if (this.messages >= this.options.maxMessages) {\n err = new Error('Resource exhausted');\n err.code = 'EMAXLIMIT';\n this.connection.close();\n this.emit('error', err);\n } else {\n this.pool._checkRateLimit(() => {\n this.available = true;\n this.emit('available');\n });\n }\n });\n\n callback(null, info);\n });\n }\n\n /**\n * Closes the connection\n */\n close() {\n this._connected = false;\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n if (this.connection) {\n this.connection.close();\n }\n this.emit('close');\n }\n}\n\nmodule.exports = PoolResource;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst XOAuth2 = require('../xoauth2');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options Connection options\n */\nclass SMTPTransport extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-transport'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n if (this.options.auth) {\n this.auth = this.getAuth({});\n }\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n getAuth(authOpts) {\n if (!authOpts) {\n return this.auth;\n }\n\n let hasAuth = false;\n let authData = {};\n\n if (this.options.auth && typeof this.options.auth === 'object') {\n Object.keys(this.options.auth).forEach(key => {\n hasAuth = true;\n authData[key] = this.options.auth[key];\n });\n }\n\n if (authOpts && typeof authOpts === 'object') {\n Object.keys(authOpts).forEach(key => {\n hasAuth = true;\n authData[key] = authOpts[key];\n });\n }\n\n if (!hasAuth) {\n return false;\n }\n\n switch ((authData.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n if (!authData.service && !authData.user) {\n return false;\n }\n let oauth2 = new XOAuth2(authData, this.logger);\n oauth2.provisionCallback = (this.mailer && this.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n oauth2.on('token', token => this.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n return {\n type: 'OAUTH2',\n user: authData.user,\n oauth2,\n method: 'XOAUTH2'\n };\n }\n default:\n return {\n type: (authData.type || '').toString().toUpperCase() || 'LOGIN',\n user: authData.user,\n credentials: {\n user: authData.user || '',\n pass: authData.pass,\n options: authData.options\n },\n method: (authData.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n /**\n * Sends an e-mail using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n // only copy options if we need to modify it\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n returned = true;\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (connection && connection._socket && connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n let sendMessage = () => {\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n returned = true;\n connection.close();\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n return callback(err);\n }\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n try {\n return callback(null, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback'\n },\n 'Callback error for %s: %s',\n messageId,\n E.message\n );\n }\n });\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let auth = this.getAuth(mail.data.auth);\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (auth && auth !== this.auth && auth.oauth2) {\n auth.oauth2.removeAllListeners();\n }\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n sendMessage();\n });\n } else {\n sendMessage();\n }\n });\n });\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let authData = this.getAuth({});\n\n if (authData && (connection.allowsAuth || options.forceAuth)) {\n connection.login(authData, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!authData && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n\n /**\n * Releases resources\n */\n close() {\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n this.emit('close');\n }\n}\n\n// expose to the world\nmodule.exports = SMTPTransport;\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for streaming\n *\n * Possible options can be the following:\n *\n * * **buffer** if true, then returns the message as a Buffer object instead of a stream\n * * **newline** either 'windows' or 'unix'\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass StreamTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'StreamTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'stream-transport'\n });\n\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to handler that sends it\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // We probably need this in the output\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s> using %s line breaks',\n messageId,\n recipients.join(', '),\n this.winbreak ? '' : ''\n );\n\n setImmediate(() => {\n let stream;\n\n try {\n stream = mail.message.createReadStream();\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'send',\n messageId\n },\n 'Creating send stream failed for %s. %s',\n messageId,\n E.message\n );\n return done(E);\n }\n\n if (!this.options.buffer) {\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n });\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: stream\n });\n }\n\n let chunks = [];\n let chunklen = 0;\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n });\n\n stream.on('end', () =>\n done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: Buffer.concat(chunks, chunklen)\n })\n );\n });\n }\n}\n\nmodule.exports = StreamTransport;\n","'use strict';\n\nconst services = require('./services.json');\nconst normalized = {};\n\nObject.keys(services).forEach(key => {\n let service = services[key];\n\n normalized[normalizeKey(key)] = normalizeService(service);\n\n [].concat(service.aliases || []).forEach(alias => {\n normalized[normalizeKey(alias)] = normalizeService(service);\n });\n\n [].concat(service.domains || []).forEach(domain => {\n normalized[normalizeKey(domain)] = normalizeService(service);\n });\n});\n\nfunction normalizeKey(key) {\n return key.replace(/[^a-zA-Z0-9.-]/g, '').toLowerCase();\n}\n\nfunction normalizeService(service) {\n let filter = ['domains', 'aliases'];\n let response = {};\n\n Object.keys(service).forEach(key => {\n if (filter.indexOf(key) < 0) {\n response[key] = service[key];\n }\n });\n\n return response;\n}\n\n/**\n * Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or\n * an email address (like 'test@googlemail.com').\n *\n * @param {String} key [description]\n * @returns {Object} SMTP config or false if not found\n */\nmodule.exports = function (key) {\n key = normalizeKey(key.split('@').pop());\n return normalized[key] || false;\n};\n","'use strict';\n\nconst Stream = require('stream').Stream;\nconst nmfetch = require('../fetch');\nconst crypto = require('crypto');\nconst shared = require('../shared');\n\n/**\n * XOAUTH2 access_token generator for Gmail.\n * Create client ID for web applications in Google API console to use it.\n * See Offline Access for receiving the needed refreshToken for an user\n * https://developers.google.com/accounts/docs/OAuth2WebServer#offline\n *\n * Usage for generating access tokens with a custom method using provisionCallback:\n * provisionCallback(user, renew, callback)\n * * user is the username to get the token for\n * * renew is a boolean that if true indicates that existing token failed and needs to be renewed\n * * callback is the callback to run with (error, accessToken [, expires])\n * * accessToken is a string\n * * expires is an optional expire time in milliseconds\n * If provisionCallback is used, then Nodemailer does not try to attempt generating the token by itself\n *\n * @constructor\n * @param {Object} options Client information for token generation\n * @param {String} options.user User e-mail address\n * @param {String} options.clientId Client ID value\n * @param {String} options.clientSecret Client secret value\n * @param {String} options.refreshToken Refresh token for an user\n * @param {String} options.accessUrl Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token'\n * @param {String} options.accessToken An existing valid accessToken\n * @param {String} options.privateKey Private key for JSW\n * @param {Number} options.expires Optional Access Token expire time in ms\n * @param {Number} options.timeout Optional TTL for Access Token in seconds\n * @param {Function} options.provisionCallback Function to run when a new access token is required\n */\nclass XOAuth2 extends Stream {\n constructor(options, logger) {\n super();\n\n this.options = options || {};\n\n if (options && options.serviceClient) {\n if (!options.privateKey || !options.user) {\n setImmediate(() => this.emit('error', new Error('Options \"privateKey\" and \"user\" are required for service account!')));\n return;\n }\n\n let serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600);\n this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60;\n }\n\n this.logger = shared.getLogger(\n {\n logger\n },\n {\n component: this.options.component || 'OAuth2'\n }\n );\n\n this.provisionCallback = typeof this.options.provisionCallback === 'function' ? this.options.provisionCallback : false;\n\n this.options.accessUrl = this.options.accessUrl || 'https://accounts.google.com/o/oauth2/token';\n this.options.customHeaders = this.options.customHeaders || {};\n this.options.customParams = this.options.customParams || {};\n\n this.accessToken = this.options.accessToken || false;\n\n if (this.options.expires && Number(this.options.expires)) {\n this.expires = this.options.expires;\n } else {\n let timeout = Math.max(Number(this.options.timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n }\n }\n\n /**\n * Returns or generates (if previous has expired) a XOAuth2 token\n *\n * @param {Boolean} renew If false then use cached access token (if available)\n * @param {Function} callback Callback function with error object and token string\n */\n getToken(renew, callback) {\n if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) {\n return callback(null, this.accessToken);\n }\n\n let generateCallback = (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Failed generating new Access Token for %s',\n this.options.user\n );\n } else {\n this.logger.info(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Generated new Access Token for %s',\n this.options.user\n );\n }\n callback(...args);\n };\n\n if (this.provisionCallback) {\n this.provisionCallback(this.options.user, !!renew, (err, accessToken, expires) => {\n if (!err && accessToken) {\n this.accessToken = accessToken;\n this.expires = expires || 0;\n }\n generateCallback(err, accessToken);\n });\n } else {\n this.generateToken(generateCallback);\n }\n }\n\n /**\n * Updates token values\n *\n * @param {String} accessToken New access token\n * @param {Number} timeout Access token lifetime in seconds\n *\n * Emits 'token': { user: User email-address, accessToken: the new accessToken, timeout: TTL in seconds}\n */\n updateToken(accessToken, timeout) {\n this.accessToken = accessToken;\n timeout = Math.max(Number(timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n\n this.emit('token', {\n user: this.options.user,\n accessToken: accessToken || '',\n expires: this.expires\n });\n }\n\n /**\n * Generates a new XOAuth2 token with the credentials provided at initialization\n *\n * @param {Function} callback Callback function with error object and token string\n */\n generateToken(callback) {\n let urlOptions;\n let loggedUrlOptions;\n if (this.options.serviceClient) {\n // service account - https://developers.google.com/identity/protocols/OAuth2ServiceAccount\n let iat = Math.floor(Date.now() / 1000); // unix time\n let tokenData = {\n iss: this.options.serviceClient,\n scope: this.options.scope || 'https://mail.google.com/',\n sub: this.options.user,\n aud: this.options.accessUrl,\n iat,\n exp: iat + this.options.serviceRequestTimeout\n };\n let token;\n try {\n token = this.jwtSignRS256(tokenData);\n } catch (err) {\n return callback(new Error('Can\\x27t generate token. Check your auth options'));\n }\n\n urlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: token\n };\n\n loggedUrlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: tokenData\n };\n } else {\n if (!this.options.refreshToken) {\n return callback(new Error('Can\\x27t create new access token for user'));\n }\n\n // web app - https://developers.google.com/identity/protocols/OAuth2WebServer\n urlOptions = {\n client_id: this.options.clientId || '',\n client_secret: this.options.clientSecret || '',\n refresh_token: this.options.refreshToken,\n grant_type: 'refresh_token'\n };\n\n loggedUrlOptions = {\n client_id: this.options.clientId || '',\n client_secret: (this.options.clientSecret || '').substr(0, 6) + '...',\n refresh_token: (this.options.refreshToken || '').substr(0, 6) + '...',\n grant_type: 'refresh_token'\n };\n }\n\n Object.keys(this.options.customParams).forEach(key => {\n urlOptions[key] = this.options.customParams[key];\n loggedUrlOptions[key] = this.options.customParams[key];\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'generate'\n },\n 'Requesting token using: %s',\n JSON.stringify(loggedUrlOptions)\n );\n\n this.postRequest(this.options.accessUrl, urlOptions, this.options, (error, body) => {\n let data;\n\n if (error) {\n return callback(error);\n }\n\n try {\n data = JSON.parse(body.toString());\n } catch (E) {\n return callback(E);\n }\n\n if (!data || typeof data !== 'object') {\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n (body || '').toString()\n );\n return callback(new Error('Invalid authentication response'));\n }\n\n let logData = {};\n Object.keys(data).forEach(key => {\n if (key !== 'access_token') {\n logData[key] = data[key];\n } else {\n logData[key] = (data[key] || '').toString().substr(0, 6) + '...';\n }\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n JSON.stringify(logData)\n );\n\n if (data.error) {\n // Error Response : https://tools.ietf.org/html/rfc6749#section-5.2\n let errorMessage = data.error;\n if (data.error_description) {\n errorMessage += ': ' + data.error_description;\n }\n if (data.error_uri) {\n errorMessage += ' (' + data.error_uri + ')';\n }\n return callback(new Error(errorMessage));\n }\n\n if (data.access_token) {\n this.updateToken(data.access_token, data.expires_in);\n return callback(null, this.accessToken);\n }\n\n return callback(new Error('No access token'));\n });\n }\n\n /**\n * Converts an access_token and user id into a base64 encoded XOAuth2 token\n *\n * @param {String} [accessToken] Access token string\n * @return {String} Base64 encoded token for IMAP or SMTP login\n */\n buildXOAuth2Token(accessToken) {\n let authData = ['user=' + (this.options.user || ''), 'auth=Bearer ' + (accessToken || this.accessToken), '', ''];\n return Buffer.from(authData.join('\\x01'), 'utf-8').toString('base64');\n }\n\n /**\n * Custom POST request handler.\n * This is only needed to keep paths short in Windows – usually this module\n * is a dependency of a dependency and if it tries to require something\n * like the request module the paths get way too long to handle for Windows.\n * As we do only a simple POST request we do not actually require complicated\n * logic support (no redirects, no nothing) anyway.\n *\n * @param {String} url Url to POST to\n * @param {String|Buffer} payload Payload to POST\n * @param {Function} callback Callback function with (err, buff)\n */\n postRequest(url, payload, params, callback) {\n let returned = false;\n\n let chunks = [];\n let chunklen = 0;\n\n let req = nmfetch(url, {\n method: 'post',\n headers: params.customHeaders,\n body: payload,\n allowErrorResponse: true\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n req.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(null, Buffer.concat(chunks, chunklen));\n });\n }\n\n /**\n * Encodes a buffer or a string into Base64url format\n *\n * @param {Buffer|String} data The data to convert\n * @return {String} The encoded string\n */\n toBase64URL(data) {\n if (typeof data === 'string') {\n data = Buffer.from(data);\n }\n\n return data\n .toString('base64')\n .replace(/[=]+/g, '') // remove '='s\n .replace(/\\+/g, '-') // '+' → '-'\n .replace(/\\//g, '_'); // '/' → '_'\n }\n\n /**\n * Creates a JSON Web Token signed with RS256 (SHA256 + RSA)\n *\n * @param {Object} payload The payload to include in the generated token\n * @return {String} The generated and signed token\n */\n jwtSignRS256(payload) {\n payload = ['{\"alg\":\"RS256\",\"typ\":\"JWT\"}', JSON.stringify(payload)].map(val => this.toBase64URL(val)).join('.');\n let signature = crypto.createSign('RSA-SHA256').update(payload).sign(this.options.privateKey);\n return payload + '.' + this.toBase64URL(signature);\n }\n}\n\nmodule.exports = XOAuth2;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\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(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\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 (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\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', 'GITHUB_ACTIONS', 'BUILDKITE'].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\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n",null,"module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"crypto\");","module.exports = require(\"dns\");","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(\"punycode\");","module.exports = require(\"stream\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// 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\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACllCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3rMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9iCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACv3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7gBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3LA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtIA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChCA;;;;;;;;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://@kunalnagarco/action-cve/./lib/constants.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/email.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/index.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/microsoft-teams.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/pager-duty.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/slack.js","../webpack://@kunalnagarco/action-cve/./lib/destinations/zenduty.js","../webpack://@kunalnagarco/action-cve/./lib/entities/advisory.js","../webpack://@kunalnagarco/action-cve/./lib/entities/alert.js","../webpack://@kunalnagarco/action-cve/./lib/entities/index.js","../webpack://@kunalnagarco/action-cve/./lib/entities/repository.js","../webpack://@kunalnagarco/action-cve/./lib/entities/vulnerability.js","../webpack://@kunalnagarco/action-cve/./lib/fetch-alerts.js","../webpack://@kunalnagarco/action-cve/./lib/main.js","../webpack://@kunalnagarco/action-cve/./lib/utils/adaptive-card/index.js","../webpack://@kunalnagarco/action-cve/./lib/utils/index.js","../webpack://@kunalnagarco/action-cve/./lib/utils/request/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/command.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/core.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/file-command.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/path-utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/summary.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/core/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/context.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/github.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/internal/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/github/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/auth.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@actions/http-client/lib/proxy.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/core/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@octokit/request/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/api.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/common.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/events.js","../webpack://@kunalnagarco/action-cve/./node_modules/@pagerduty/pdjs/build/src/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/IncomingWebhook.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/errors.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/@slack/webhook/dist/instrument.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/activity-request.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/adaptive-applet.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/adaptivecards.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/card-elements.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/card-object.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/channel-adapter.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/collection.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/constants.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/menu-item.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/popup-control.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/controls/popup-menu.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/enums.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/host-capabilities.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/host-config.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/registry.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/serialization.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/shared.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/strings.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/table.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/text-formatters.js","../webpack://@kunalnagarco/action-cve/./node_modules/adaptivecards/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/adapters/http.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/adapters/xhr.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/axios.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/Cancel.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/CancelToken.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/cancel/isCancel.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/Axios.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/InterceptorManager.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/buildFullPath.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/createError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/dispatchRequest.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/enhanceError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/mergeConfig.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/settle.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/core/transformData.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/defaults.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/bind.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/buildURL.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/combineURLs.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/cookies.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isAbsoluteURL.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isAxiosError.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/isURLSameOrigin.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/normalizeHeaderName.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/parseHeaders.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/spread.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/helpers/validator.js","../webpack://@kunalnagarco/action-cve/./node_modules/axios/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/add.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/register.js","../webpack://@kunalnagarco/action-cve/./node_modules/before-after-hook/lib/remove.js","../webpack://@kunalnagarco/action-cve/./node_modules/browser-or-node/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/cross-fetch/dist/node-ponyfill.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/browser.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/common.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/debug/src/node.js","../webpack://@kunalnagarco/action-cve/./node_modules/deprecation/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/follow-redirects/debug.js","../webpack://@kunalnagarco/action-cve/./node_modules/follow-redirects/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/has-flag/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://@kunalnagarco/action-cve/./node_modules/ms/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/tr46/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js","../webpack://@kunalnagarco/action-cve/./node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/addressparser/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/base64/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/message-parser.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/relaxed-body.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/dkim/sign.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/fetch/cookies.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/fetch/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/json-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mail-composer/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mailer/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mailer/mail-message.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-funcs/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-funcs/mime-types.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/last-newline.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/le-unix.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/mime-node/le-windows.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/nodemailer.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/qp/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/sendmail-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/ses-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/shared/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/data-stream.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-connection/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-pool/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-pool/pool-resource.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/smtp-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/stream-transport/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/well-known/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/nodemailer/lib/xoauth2/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/once/once.js","../webpack://@kunalnagarco/action-cve/./node_modules/supports-color/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/tunnel/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/tunnel/lib/tunnel.js","../webpack://@kunalnagarco/action-cve/./node_modules/universal-user-agent/dist-node/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/index.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/md5.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/nil.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/parse.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/regex.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/rng.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/sha1.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/stringify.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v1.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v3.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v35.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v4.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/v5.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/validate.js","../webpack://@kunalnagarco/action-cve/./node_modules/uuid/dist/version.js","../webpack://@kunalnagarco/action-cve/./node_modules/wrappy/wrappy.js","../webpack://@kunalnagarco/action-cve/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://@kunalnagarco/action-cve/external node-commonjs \"assert\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"child_process\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"crypto\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"dns\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"events\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"fs\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"http\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"https\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"net\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"os\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"path\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"punycode\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"stream\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"tls\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"tty\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"url\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"util\"","../webpack://@kunalnagarco/action-cve/external node-commonjs \"zlib\"","../webpack://@kunalnagarco/action-cve/webpack/bootstrap","../webpack://@kunalnagarco/action-cve/webpack/runtime/compat","../webpack://@kunalnagarco/action-cve/webpack/before-startup","../webpack://@kunalnagarco/action-cve/webpack/startup","../webpack://@kunalnagarco/action-cve/webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ACTION_URL = exports.ACTION_SHORT_SUMMARY = exports.ACTION_ICON = void 0;\nexports.ACTION_ICON = 'https://github.com/kunalnagarco/action-cve/raw/main/icons/ladybug.png';\nexports.ACTION_SHORT_SUMMARY = 'GitHub Action - @kunalnagarco/action-cve';\nexports.ACTION_URL = 'https://github.com/kunalnagarco/action-cve';\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToEmailSmtp = void 0;\nconst constants_1 = require(\"../constants\");\nconst entities_1 = require(\"../entities\");\nconst nodemailer_1 = require(\"nodemailer\");\nconst createTable = (alerts) => {\n let rowData = '';\n for (const alert of alerts) {\n rowData += createTableRow(alert);\n }\n return `\n \n \n \n \n \n \n \n \n \n \n ${rowData}\n \n
Package nameVulnerability Version RangePatched VersionSeveritySummary
\n `;\n};\nconst createTableRow = (alert) => {\n var _a, _b, _c, _d, _e;\n return `\n \n ${alert.packageName}\n ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n View\n \n `;\n};\nconst createEmailBody = (alerts) => {\n return `\n

Hello,

\n

You are receiving this message as you have set up email notifications for vulnerabilities in ${(0, entities_1.getFullRepositoryNameFromAlert)(alerts[0])} via ${constants_1.ACTION_SHORT_SUMMARY}.

\n ${createTable(alerts)}\n `;\n};\nconst sendAlertsToEmailSmtp = (config, alerts, emailList, emailFrom, subject) => __awaiter(void 0, void 0, void 0, function* () {\n const transporter = (0, nodemailer_1.createTransport)(config);\n yield transporter.sendMail({\n from: emailFrom,\n bcc: emailList,\n subject: subject ||\n `${constants_1.ACTION_SHORT_SUMMARY} - ${alerts.length} vulnerabilities in ${(0, entities_1.getFullRepositoryNameFromAlert)(alerts[0])}`,\n html: createEmailBody(alerts),\n });\n});\nexports.sendAlertsToEmailSmtp = sendAlertsToEmailSmtp;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./slack\"), exports);\n__exportStar(require(\"./pager-duty\"), exports);\n__exportStar(require(\"./zenduty\"), exports);\n__exportStar(require(\"./microsoft-teams\"), exports);\n__exportStar(require(\"./email\"), exports);\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToMicrosoftTeams = void 0;\n/* eslint-disable i18n-text/no-en */\nconst utils_1 = require(\"../utils\");\nconst constants_1 = require(\"../constants\");\nconst createTableRow = (key, value) => {\n const row = (0, utils_1.createRow)();\n const keyColumn = (0, utils_1.createColumn)();\n keyColumn.addItem((0, utils_1.createTextBlock)(key, true));\n row.addColumn(keyColumn);\n const valueColumn = (0, utils_1.createColumn)();\n valueColumn.addItem((0, utils_1.createTextBlock)(value));\n row.addColumn(valueColumn);\n return row;\n};\nconst createTableButtonRow = (url) => {\n const row = (0, utils_1.createRow)();\n const keyColumn = (0, utils_1.createColumn)();\n keyColumn.addItem((0, utils_1.createTextBlock)('Advisory URL', true));\n row.addColumn(keyColumn);\n const urlColumn = (0, utils_1.createColumn)();\n urlColumn.addItem((0, utils_1.createLinkButton)('View Advisory', url));\n row.addColumn(urlColumn);\n return row;\n};\nconst sendAlertsToMicrosoftTeams = (webhookUrl, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e;\n const alertCount = alerts.length;\n const repositoryOwner = alerts[0].repository.owner;\n const repositoryName = alerts[0].repository.name;\n const adaptiveCard = (0, utils_1.createAdaptiveCard)();\n adaptiveCard.addItem((0, utils_1.createTextBlock)(constants_1.ACTION_SHORT_SUMMARY));\n adaptiveCard.addItem((0, utils_1.createTextBlock)(`You have ${alertCount} vulnerabilities in ${repositoryOwner}/${repositoryName}`));\n for (const alert of alerts) {\n const container = (0, utils_1.createContainer)(true, true);\n container.addItem(createTableRow('Package Name', alert.packageName));\n container.addItem(createTableRow('Vulnerability Version Range', ((_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange) || ''));\n container.addItem(createTableRow('Patched Version', ((_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion) || ''));\n container.addItem(createTableRow('Severity', ((_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity) || ''));\n container.addItem(createTableRow('Summary', ((_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary) || ''));\n container.addItem(createTableButtonRow(((_e = alert.advisory) === null || _e === void 0 ? void 0 : _e.url) || ''));\n adaptiveCard.addItem(container);\n }\n const body = {\n type: 'message',\n attachments: [\n {\n contentType: 'application/vnd.microsoft.card.adaptive',\n contentUrl: null,\n content: adaptiveCard.toJSON(),\n },\n ],\n };\n yield (0, utils_1.request)(webhookUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n});\nexports.sendAlertsToMicrosoftTeams = sendAlertsToMicrosoftTeams;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToPagerDuty = void 0;\nconst constants_1 = require(\"../constants\");\nconst pdjs_1 = require(\"@pagerduty/pdjs\");\nconst sendAlertsToPagerDuty = (integrationKey, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n yield (0, pdjs_1.event)({\n data: {\n routing_key: integrationKey,\n event_action: 'trigger',\n payload: {\n summary: `You have ${alerts.length} vulnerabilities in ${alerts[0].repository.owner}/${alerts[0].repository.name}`,\n source: 'GitHub Dependabot Alerts',\n severity: 'info',\n custom_details: Object.assign({}, alerts),\n },\n images: [\n {\n src: constants_1.ACTION_ICON,\n alt: constants_1.ACTION_SHORT_SUMMARY,\n href: constants_1.ACTION_URL,\n },\n ],\n },\n });\n});\nexports.sendAlertsToPagerDuty = sendAlertsToPagerDuty;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToSlack = exports.MAX_COUNT_SLACK = exports.validateSlackWebhookUrl = void 0;\nconst constants_1 = require(\"../constants\");\nconst webhook_1 = require(\"@slack/webhook\");\nconst createSummaryBlock = (alertCount, repositoryName, repositoryOwner) => {\n return {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `\n You have ${alertCount} vulnerabilities in *${repositoryOwner}/${repositoryName}*.\n${alertCount > exports.MAX_COUNT_SLACK ? createMaxAlertsMarkdownNotice() : ''}\n `,\n },\n };\n};\nconst createDividerBlock = () => {\n return {\n type: 'divider',\n };\n};\nconst createAlertBlock = (alert) => {\n var _a, _b, _c, _d, _e;\n return {\n type: 'section',\n text: {\n type: 'mrkdwn',\n text: `\n*Package name:* ${alert.packageName}\n*Vulnerability Version Range:* ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n*Patched Version:* ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n*Severity:* ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n*Summary:* ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n `,\n },\n accessory: {\n type: 'button',\n text: {\n type: 'plain_text',\n text: 'View Advisory',\n emoji: true,\n },\n style: 'danger',\n url: (_e = alert.advisory) === null || _e === void 0 ? void 0 : _e.url,\n },\n };\n};\nconst createMaxAlertsMarkdownNotice = () => {\n return `*Note:* Only ${exports.MAX_COUNT_SLACK} have been sent due to message length restrictions.`;\n};\nconst validateSlackWebhookUrl = (url) => {\n const regexPattern = new RegExp(/^https:\\/\\/hooks\\.slack\\.com\\/services\\/T[a-zA-Z0-9_]{8,10}\\/B[a-zA-Z0-9_]{10}\\/[a-zA-Z0-9_]{24}/);\n return regexPattern.test(url);\n};\nexports.validateSlackWebhookUrl = validateSlackWebhookUrl;\nexports.MAX_COUNT_SLACK = 30;\nconst sendAlertsToSlack = (webhookUrl, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n const webhook = new webhook_1.IncomingWebhook(webhookUrl);\n const alertBlocks = [];\n for (const alert of alerts) {\n alertBlocks.push(createAlertBlock(alert));\n }\n yield webhook.send({\n blocks: [\n createSummaryBlock(alerts.length, alerts[0].repository.name, alerts[0].repository.owner),\n createDividerBlock(),\n ...alertBlocks,\n ],\n icon_url: constants_1.ACTION_ICON,\n username: constants_1.ACTION_SHORT_SUMMARY,\n });\n});\nexports.sendAlertsToSlack = sendAlertsToSlack;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendAlertsToZenduty = void 0;\nconst constants_1 = require(\"../constants\");\nconst utils_1 = require(\"../utils\");\nconst sendAlertsToZenduty = (apiKey, serviceId, escalationPolicyId, alerts) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n let summary = `\n You have ${alerts.length} vulnerabilities in ${alerts[0].repository.owner}/${alerts[0].repository.name}\n\n ---\n\n `;\n for (const alert of alerts) {\n summary += `\n Package name: ${alert.packageName}\n Vulnerability Version Range: ${(_a = alert.vulnerability) === null || _a === void 0 ? void 0 : _a.vulnerableVersionRange}\n Patched Version: ${(_b = alert.vulnerability) === null || _b === void 0 ? void 0 : _b.firstPatchedVersion}\n Severity: ${(_c = alert.advisory) === null || _c === void 0 ? void 0 : _c.severity}\n Summary: ${(_d = alert.advisory) === null || _d === void 0 ? void 0 : _d.summary}\n `;\n }\n summary += `\n\n ---\n `;\n const payload = {\n service: serviceId,\n escalation_policy: escalationPolicyId,\n title: `${constants_1.ACTION_SHORT_SUMMARY} - ${alerts[0].repository.name}`,\n urgency: 0,\n summary,\n };\n // eslint-disable-next-line i18n-text/no-en\n const bearer = `Token ${apiKey}`;\n yield (0, utils_1.request)('https://www.zenduty.com/api/incidents/', {\n method: 'POST',\n headers: {\n Authorization: bearer,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload),\n });\n});\nexports.sendAlertsToZenduty = sendAlertsToZenduty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toAdvisory = void 0;\nconst toAdvisory = (securityAdvisory) => ({\n cvssScore: securityAdvisory.cvss.score,\n severity: securityAdvisory.severity,\n summary: securityAdvisory.summary,\n description: securityAdvisory.description,\n url: securityAdvisory.permalink,\n publishedAt: securityAdvisory.publishedAt,\n updatedAt: securityAdvisory.updatedAt,\n withdrawnAt: securityAdvisory.withdrawnAt,\n});\nexports.toAdvisory = toAdvisory;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isActiveAlert = exports.toAlert = void 0;\nconst advisory_1 = require(\"./advisory\");\nconst repository_1 = require(\"./repository\");\nconst vulnerability_1 = require(\"./vulnerability\");\nconst toAlert = (repositoryVulnerabilityAlert) => {\n var _a;\n return ({\n repository: (0, repository_1.toRepository)(repositoryVulnerabilityAlert.repository),\n packageName: ((_a = repositoryVulnerabilityAlert.securityVulnerability) === null || _a === void 0 ? void 0 : _a.package.name) || '',\n advisory: repositoryVulnerabilityAlert.securityAdvisory\n ? (0, advisory_1.toAdvisory)(repositoryVulnerabilityAlert.securityAdvisory)\n : undefined,\n vulnerability: repositoryVulnerabilityAlert.securityVulnerability\n ? (0, vulnerability_1.toVulnerability)(repositoryVulnerabilityAlert.securityVulnerability)\n : undefined,\n manifest: repositoryVulnerabilityAlert.vulnerableManifestFilename,\n createdAt: repositoryVulnerabilityAlert.createdAt,\n });\n};\nexports.toAlert = toAlert;\nconst isActiveAlert = (repositoryVulnerabilityAlert) => {\n if (repositoryVulnerabilityAlert.dismissedAt === null &&\n repositoryVulnerabilityAlert.fixedAt === null) {\n return true;\n }\n return false;\n};\nexports.isActiveAlert = isActiveAlert;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./repository\"), exports);\n__exportStar(require(\"./advisory\"), exports);\n__exportStar(require(\"./alert\"), exports);\n__exportStar(require(\"./vulnerability\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFullRepositoryNameFromAlert = exports.toRepository = void 0;\nconst toRepository = (repository) => ({\n name: repository.name,\n owner: repository.owner.login,\n});\nexports.toRepository = toRepository;\nconst getFullRepositoryNameFromAlert = (alert) => `${alert.repository.owner}/${alert.repository.name}`;\nexports.getFullRepositoryNameFromAlert = getFullRepositoryNameFromAlert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVulnerability = void 0;\nconst toVulnerability = (securityVulnerability) => {\n var _a;\n return ({\n firstPatchedVersion: (_a = securityVulnerability.firstPatchedVersion) === null || _a === void 0 ? void 0 : _a.identifier,\n vulnerableVersionRange: securityVulnerability.vulnerableVersionRange,\n updatedAt: securityVulnerability.updatedAt,\n });\n};\nexports.toVulnerability = toVulnerability;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAlerts = void 0;\nconst entities_1 = require(\"./entities\");\nconst github_1 = require(\"@actions/github\");\nconst fetchAlerts = (gitHubPersonalAccessToken, repositoryName, repositoryOwner, count) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const octokit = (0, github_1.getOctokit)(gitHubPersonalAccessToken);\n const { repository } = yield octokit.graphql(`\n query {\n repository(owner:\"${repositoryOwner}\" name:\"${repositoryName}\") {\n vulnerabilityAlerts(last: ${count}) {\n edges {\n node {\n id\n dismissedAt\n fixedAt\n repository {\n name\n owner {\n login\n }\n }\n securityAdvisory {\n id\n description\n cvss {\n score\n vectorString\n }\n permalink\n severity\n summary\n }\n securityVulnerability {\n firstPatchedVersion {\n identifier\n }\n package {\n ecosystem\n name\n }\n vulnerableVersionRange\n advisory {\n cvss {\n score\n vectorString\n }\n summary\n }\n }\n }\n }\n }\n }\n }\n `);\n const gitHubAlerts = (_a = repository.vulnerabilityAlerts) === null || _a === void 0 ? void 0 : _a.edges;\n if (gitHubAlerts) {\n const alerts = [];\n for (const gitHubAlert of gitHubAlerts) {\n if (gitHubAlert && gitHubAlert.node && (0, entities_1.isActiveAlert)(gitHubAlert.node)) {\n alerts.push((0, entities_1.toAlert)(gitHubAlert.node));\n }\n }\n return alerts;\n }\n return [];\n});\nexports.fetchAlerts = fetchAlerts;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"@actions/core\");\nconst destinations_1 = require(\"./destinations\");\nconst github_1 = require(\"@actions/github\");\nconst fetch_alerts_1 = require(\"./fetch-alerts\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const token = (0, core_1.getInput)('token');\n const microsoftTeamsWebhookUrl = (0, core_1.getInput)('microsoft_teams_webhook');\n const slackWebhookUrl = (0, core_1.getInput)('slack_webhook');\n const pagerDutyIntegrationKey = (0, core_1.getInput)('pager_duty_integration_key');\n const zenDutyApiKey = (0, core_1.getInput)('zenduty_api_key');\n const zenDutyServiceId = (0, core_1.getInput)('zenduty_service_id');\n const zenDutyEscalationPolicyId = (0, core_1.getInput)('zenduty_escalation_policy_id');\n const emailFrom = (0, core_1.getInput)('email_from');\n const emailList = (0, core_1.getInput)('email_list');\n const emailSubject = (0, core_1.getInput)('email_subject');\n const emailTransportSmtpHost = (0, core_1.getInput)('email_transport_smtp_host');\n const emailTransportSmtpPort = parseInt((0, core_1.getInput)('email_transport_smtp_port'));\n const emailTransportSmtpUser = (0, core_1.getInput)('email_transport_smtp_user');\n const emailTransportSmtpPassword = (0, core_1.getInput)('email_transport_smtp_password');\n const count = parseInt((0, core_1.getInput)('count'));\n const owner = github_1.context.repo.owner;\n const repo = github_1.context.repo.repo;\n const alerts = yield (0, fetch_alerts_1.fetchAlerts)(token, repo, owner, count);\n if (alerts.length > 0) {\n if (microsoftTeamsWebhookUrl) {\n yield (0, destinations_1.sendAlertsToMicrosoftTeams)(microsoftTeamsWebhookUrl, alerts);\n }\n if (slackWebhookUrl) {\n if (!(0, destinations_1.validateSlackWebhookUrl)(slackWebhookUrl)) {\n (0, core_1.setFailed)(new Error('Invalid Slack Webhook URL'));\n }\n else {\n yield (0, destinations_1.sendAlertsToSlack)(slackWebhookUrl, alerts);\n }\n }\n if (pagerDutyIntegrationKey) {\n yield (0, destinations_1.sendAlertsToPagerDuty)(pagerDutyIntegrationKey, alerts);\n }\n if (zenDutyApiKey) {\n if (zenDutyServiceId && zenDutyEscalationPolicyId) {\n yield (0, destinations_1.sendAlertsToZenduty)(zenDutyApiKey, zenDutyServiceId, zenDutyEscalationPolicyId, alerts);\n }\n else {\n (0, core_1.setFailed)(new Error('Check your Zenduty Service ID and Escalation Policy ID'));\n }\n }\n if (emailFrom && emailList) {\n const emailWikiLink = 'https://github.com/kunalnagarco/action-cve/wiki/Send-alerts-to-email';\n if (emailTransportSmtpUser && emailTransportSmtpPassword) {\n const emailTransportSmtpConfig = {\n host: emailTransportSmtpHost,\n port: emailTransportSmtpPort,\n secure: emailTransportSmtpPort === 465 && true,\n auth: {\n user: emailTransportSmtpUser,\n pass: emailTransportSmtpPassword,\n },\n };\n (0, destinations_1.sendAlertsToEmailSmtp)(emailTransportSmtpConfig, alerts, emailList, emailFrom, emailSubject);\n }\n else {\n (0, core_1.setFailed)(new Error(`Invalid SMTP config. Please check the wiki for more info: ${emailWikiLink}`));\n }\n }\n }\n }\n catch (err) {\n if (err instanceof Error) {\n (0, core_1.setFailed)(err);\n }\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAdaptiveCard = exports.createLinkButton = exports.createColumn = exports.createTextBlock = exports.createRow = exports.createContainer = void 0;\nconst adaptivecards_1 = require(\"adaptivecards\");\nconst createContainer = (isSpacingLarge, isStyleEmphasis) => {\n const container = new adaptivecards_1.Container();\n if (isSpacingLarge) {\n container.spacing = adaptivecards_1.Spacing.Large;\n }\n if (isStyleEmphasis) {\n container.style = 'emphasis';\n }\n return container;\n};\nexports.createContainer = createContainer;\nconst createRow = () => {\n return new adaptivecards_1.ColumnSet();\n};\nexports.createRow = createRow;\nconst createTextBlock = (text, isBold = false, isWrap = true) => {\n const textBlock = new adaptivecards_1.TextBlock(text);\n if (isBold) {\n textBlock.weight = adaptivecards_1.TextWeight.Bolder;\n }\n textBlock.wrap = isWrap;\n return textBlock;\n};\nexports.createTextBlock = createTextBlock;\nconst createColumn = () => {\n return new adaptivecards_1.Column();\n};\nexports.createColumn = createColumn;\nconst createLinkButton = (text, url) => {\n const linkButton = new adaptivecards_1.ActionSet();\n const action = new adaptivecards_1.OpenUrlAction();\n action.title = text;\n action.url = url;\n linkButton.addAction(action);\n return linkButton;\n};\nexports.createLinkButton = createLinkButton;\nconst createAdaptiveCard = () => {\n const adaptiveCard = new adaptivecards_1.AdaptiveCard();\n adaptiveCard.version = new adaptivecards_1.Version(1, 2);\n return adaptiveCard;\n};\nexports.createAdaptiveCard = createAdaptiveCard;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./request\"), exports);\n__exportStar(require(\"./adaptive-card\"), exports);\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.request = void 0;\nconst node_fetch_1 = __importDefault(require(\"node-fetch\"));\nconst request = (url, options) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, node_fetch_1.default)(url, Object.assign({}, options));\n});\nexports.request = request;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst uuid_1 = require(\"uuid\");\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.\n if (name.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedVal.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options) {\n return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nconst defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n//# sourceMappingURL=proxy.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.6.0\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.21.3\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return _objectSpread2(_objectSpread2({}, response), {}, {\n data: []\n });\n }\n\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /applications/grants\", \"GET /authorizations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/audit-log\", \"GET /enterprises/{enterprise}/secret-scanning/alerts\", \"GET /enterprises/{enterprise}/settings/billing/advanced-security\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /licenses\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /orgs/{org}/actions/cache/usage-by-repository\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/audit-log\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/code-scanning/alerts\", \"GET /orgs/{org}/codespaces\", \"GET /orgs/{org}/credential-authorizations\", \"GET /orgs/{org}/dependabot/secrets\", \"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/external-groups\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/settings/billing/advanced-security\", \"GET /orgs/{org}/team-sync/groups\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/caches\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/codespaces\", \"GET /repos/{owner}/{repo}/codespaces/devcontainers\", \"GET /repos/{owner}/{repo}/codespaces/secrets\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/status\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/dependabot/secrets\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/environments\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repos/{owner}/{repo}/topics\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/codespaces\", \"GET /user/codespaces/secrets\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/packages/{package_type}/{package_name}/versions\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nconst Endpoints = {\n actions: {\n addCustomLabelsToSelfHostedRunnerForOrg: [\"POST /orgs/{org}/actions/runners/{runner_id}/labels\"],\n addCustomLabelsToSelfHostedRunnerForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteActionsCacheById: [\"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\"],\n deleteActionsCacheByKey: [\"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getActionsCacheList: [\"GET /repos/{owner}/{repo}/actions/caches\"],\n getActionsCacheUsage: [\"GET /repos/{owner}/{repo}/actions/cache/usage\"],\n getActionsCacheUsageByRepoForOrg: [\"GET /orgs/{org}/actions/cache/usage-by-repository\"],\n getActionsCacheUsageForEnterprise: [\"GET /enterprises/{enterprise}/actions/cache/usage\"],\n getActionsCacheUsageForOrg: [\"GET /orgs/{org}/actions/cache/usage\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsDefaultWorkflowPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions/workflow\"],\n getGithubActionsDefaultWorkflowPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/workflow\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowAccessToRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/access\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listLabelsForSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}/labels\"],\n listLabelsForSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunJobForWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n reRunWorkflowFailedJobs: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\"],\n removeAllCustomLabelsFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels\"],\n removeAllCustomLabelsFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\"],\n removeCustomLabelFromSelfHostedRunnerForRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForOrg: [\"PUT /orgs/{org}/actions/runners/{runner_id}/labels\"],\n setCustomLabelsForSelfHostedRunnerForRepo: [\"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\"],\n setGithubActionsDefaultWorkflowPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions/workflow\"],\n setGithubActionsDefaultWorkflowPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/workflow\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"],\n setWorkflowAccessToRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/access\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubAdvancedSecurityBillingGhe: [\"GET /enterprises/{enterprise}/settings/billing/advanced-security\"],\n getGithubAdvancedSecurityBillingOrg: [\"GET /orgs/{org}/settings/billing/advanced-security\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForOrg: [\"GET /orgs/{org}/code-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n codespaces: {\n addRepositoryForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n codespaceMachinesForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/machines\"],\n createForAuthenticatedUser: [\"POST /user/codespaces\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n createOrUpdateSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}\"],\n createWithPrForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\"],\n createWithRepoForAuthenticatedUser: [\"POST /repos/{owner}/{repo}/codespaces\"],\n deleteForAuthenticatedUser: [\"DELETE /user/codespaces/{codespace_name}\"],\n deleteFromOrganization: [\"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n deleteSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}\"],\n exportForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/exports\"],\n getExportDetailsForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}/exports/{export_id}\"],\n getForAuthenticatedUser: [\"GET /user/codespaces/{codespace_name}\"],\n getPublicKeyForAuthenticatedUser: [\"GET /user/codespaces/secrets/public-key\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/codespaces/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\"],\n getSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}\"],\n listDevcontainersInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/devcontainers\"],\n listForAuthenticatedUser: [\"GET /user/codespaces\"],\n listInOrganization: [\"GET /orgs/{org}/codespaces\", {}, {\n renamedParameters: {\n org_id: \"org\"\n }\n }],\n listInRepositoryForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/codespaces/secrets\"],\n listRepositoriesForSecretForAuthenticatedUser: [\"GET /user/codespaces/secrets/{secret_name}/repositories\"],\n listSecretsForAuthenticatedUser: [\"GET /user/codespaces/secrets\"],\n removeRepositoryForSecretForAuthenticatedUser: [\"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\"],\n repoMachinesForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/codespaces/machines\"],\n setRepositoriesForSecretForAuthenticatedUser: [\"PUT /user/codespaces/secrets/{secret_name}/repositories\"],\n startForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/start\"],\n stopForAuthenticatedUser: [\"POST /user/codespaces/{codespace_name}/stop\"],\n stopInOrganization: [\"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\"],\n updateForAuthenticatedUser: [\"PATCH /user/codespaces/{codespace_name}\"]\n },\n dependabot: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/dependabot/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/dependabot/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\"],\n listOrgSecrets: [\"GET /orgs/{org}/dependabot/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/dependabot/secrets\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\"]\n },\n dependencyGraph: {\n createRepositorySnapshot: [\"POST /repos/{owner}/{repo}/dependency-graph/snapshots\"],\n diffRange: [\"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n addCustomLabelsToSelfHostedRunnerForEnterprise: [\"POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n getServerStatistics: [\"GET /enterprise-installation/{enterprise_or_org}/server-statistics\"],\n listLabelsForSelfHostedRunnerForEnterprise: [\"GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n removeCustomLabelFromSelfHostedRunnerForEnterprise: [\"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setCustomLabelsForSelfHostedRunnerForEnterprise: [\"PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listCustomRoles: [\"GET /organizations/{organization_id}/custom_roles\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n codeownersErrors: [\"GET /repos/{owner}/{repo}/codeowners/errors\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createTagProtection: [\"POST /repos/{owner}/{repo}/tags/protection\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteTagProtection: [\"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\"],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTagProtection: [\"GET /repos/{owner}/{repo}/tags/protection\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\"],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\"],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForEnterprise: [\"GET /enterprises/{enterprise}/secret-scanning/alerts\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n listLocationsForAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"5.16.2\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return _objectSpread2(_objectSpread2({}, api), {}, {\n rest: api\n });\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.api = void 0;\nconst common_1 = require(\"./common\");\nfunction api(apiParameters) {\n var _a;\n // If the apiParameters don't include `endpoint` treat it as a partial\n // application.\n if (!apiParameters.endpoint && !apiParameters.url) {\n return partialCall(apiParameters);\n }\n const types = {\n bearer: 'Bearer ',\n token: 'Token token=',\n };\n const { endpoint, server = 'api.pagerduty.com', token, tokenType = apiParameters.tokenType || 'token', url, version = 2, data, ...rest } = apiParameters;\n const config = {\n method: 'GET',\n ...rest,\n headers: {\n Accept: `application/vnd.pagerduty+json;version=${version}`,\n Authorization: `${types[tokenType]}${token}`,\n ...rest.headers,\n },\n };\n // Allow `data` for `queryParameters` for requests without bodies.\n if (isReadonlyRequest(config.method) && data) {\n config.queryParameters =\n (_a = config.queryParameters) !== null && _a !== void 0 ? _a : data;\n }\n else {\n config.body = JSON.stringify(data);\n }\n return apiRequest(url !== null && url !== void 0 ? url : `https://${server}/${endpoint.replace(/^\\/+/, '')}`, config);\n}\nexports.api = api;\nfunction apiRequest(url, options) {\n return (0, common_1.request)(url, options).then((response) => {\n const apiResponse = response;\n apiResponse.response = response;\n if (response.status === 204) {\n return Promise.resolve(apiResponse);\n }\n return response\n .json()\n .then((data) => {\n const resource = resourceKey(url, options.method);\n apiResponse.next = nextFunc(url, options, data);\n apiResponse.data = data;\n apiResponse.resource = resource ? data[resource] : null;\n return apiResponse;\n })\n .catch(() => Promise.reject(apiResponse));\n });\n}\nfunction resourceKey(url, method) {\n const resource = url.match(/.+.com\\/(?[\\w]+)/);\n if (resource) {\n const resourceName = resource[1];\n if (method && method.toLowerCase() === 'get') {\n return resourceName;\n }\n if (resourceName.endsWith('ies')) {\n return resourceName.slice(0, -3) + 'y';\n }\n else if (resourceName.endsWith('s')) {\n return resourceName.slice(0, -1);\n }\n return resourceName;\n }\n return null;\n}\nfunction isReadonlyRequest(method) {\n var _a;\n return !['PUT', 'POST', 'DELETE', 'PATCH'].includes((_a = method.toUpperCase()) !== null && _a !== void 0 ? _a : 'GET');\n}\nfunction isOffsetPagination(data) {\n if (data.offset !== undefined) {\n return true;\n }\n return false;\n}\nfunction isCursorPagination(data) {\n if (data.cursor !== undefined) {\n return true;\n }\n return false;\n}\nfunction nextFunc(url, options, data) {\n if (isOffsetPagination(data)) {\n if ((data === null || data === void 0 ? void 0 : data.more) && typeof data.offset !== undefined && data.limit) {\n return () => apiRequest(url, {\n ...options,\n queryParameters: {\n ...options.queryParameters,\n limit: data.limit.toString(),\n offset: (data.limit + data.offset).toString(),\n },\n });\n }\n }\n else if (isCursorPagination(data)) {\n if (data === null || data === void 0 ? void 0 : data.cursor) {\n return () => apiRequest(url, {\n ...options,\n queryParameters: {\n ...options.queryParameters,\n cursor: data.cursor,\n limit: data.limit.toString(),\n },\n });\n }\n }\n return undefined;\n}\nfunction partialCall(apiParameters) {\n const partialParameters = apiParameters;\n const partial = ((apiParameters) => api({ ...partialParameters, ...apiParameters }));\n const shorthand = (method) => (endpoint, shorthandParameters) => api({\n endpoint,\n method,\n ...partialParameters,\n ...shorthandParameters,\n });\n partial.get = shorthand('get');\n partial.post = shorthand('post');\n partial.put = shorthand('put');\n partial.patch = shorthand('patch');\n partial.delete = shorthand('delete');\n partial.all = (endpoint, shorthandParameters) => {\n function allInner(responses) {\n const response = responses[responses.length - 1];\n if (!response.next) {\n // Base case, resolve and return all responses.\n return Promise.resolve(responses);\n }\n // If there are still more resources to get then concat and repeat.\n return response\n .next()\n .then(response => allInner(responses.concat([response])));\n }\n function repackResponses(responses) {\n // Repack the responses object to make it more user friendly.\n const repackedResponse = responses.shift(); // Use the first response to build the standard response object\n repackedResponse.data = [repackedResponse.data];\n responses.forEach(response => {\n repackedResponse.data = repackedResponse.data.concat(response.data);\n repackedResponse.resource = repackedResponse.resource.concat(response.resource);\n });\n return Promise.resolve(repackedResponse);\n }\n const method = 'get';\n return api({\n endpoint,\n method,\n ...partialParameters,\n ...shorthandParameters,\n })\n .then(response => allInner([response]))\n .then(responses => repackResponses(responses));\n };\n return partial;\n}\n//# sourceMappingURL=api.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.request = void 0;\n/* LEGACY-BROWSER-SUPPORT-START */\nconst cross_fetch_1 = require(\"cross-fetch\");\nconst browser_or_node_1 = require(\"browser-or-node\");\n/* LEGACY-BROWSER-SUPPORT-END */\nconst VERSION = '2.0.0';\nfunction request(url, options = {}) {\n const { queryParameters, requestTimeout = 30000 } = options;\n url = new URL(url.toString());\n url = applyParameters(url, queryParameters);\n options = applyTimeout(options, requestTimeout);\n return fetch_retry(url.toString(), 3, {\n ...options,\n headers: new cross_fetch_1.Headers({\n 'Content-Type': 'application/json; charset=utf-8',\n /* LEGACY-BROWSER-SUPPORT-START */\n ...userAgentHeader(),\n /* LEGACY-BROWSER-SUPPORT-END */\n ...options.headers,\n }),\n });\n}\nexports.request = request;\nfunction fetch_retry(url, retries, options) {\n return new Promise((resolve, reject) => {\n (0, cross_fetch_1.default)(url, options)\n .then(response => {\n // We don't want to `reject` when retries have finished\n // Instead simply stop trying and return.\n if (retries === 0)\n return resolve(response);\n if (response.status === 429) {\n const { retryTimeout = 20000 } = options;\n retryTimeoutPromise(retryTimeout).then(() => {\n fetch_retry(url, retries - 1, options)\n .then(resolve)\n .catch(reject);\n });\n }\n else {\n clearTimeout(options.requestTimer);\n resolve(response);\n }\n })\n .catch(reject);\n });\n}\nconst retryTimeoutPromise = (milliseconds) => {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n};\nfunction userAgentHeader() {\n if (browser_or_node_1.isNode) {\n return {\n 'User-Agent': `pdjs/${VERSION} (${process.version}/${process.platform})`,\n };\n }\n else if (browser_or_node_1.isWebWorker) {\n return {\n 'User-Agent': `pdjs/${VERSION} (WebWorker)`,\n };\n }\n else if (browser_or_node_1.isJsDom) {\n return {\n 'User-Agent': `pdjs/${VERSION} (JsDom)`,\n };\n }\n else if (browser_or_node_1.isDeno) {\n return {\n 'User-Agent': `pdjs/${VERSION} (Deno)`,\n };\n }\n else if (browser_or_node_1.isBrowser) {\n return {\n // Note: This will not work consistently for all browsers as some silently drop the userAgent Header.\n 'User-Agent': `pdjs/${VERSION} (${window.navigator.userAgent})`,\n };\n }\n else {\n return {};\n }\n}\nfunction applyParameters(url, queryParameters) {\n if (!queryParameters)\n return url;\n const combinedParameters = url.searchParams;\n for (const key of Object.keys(queryParameters)) {\n const parameter = queryParameters[key];\n if (Array.isArray(parameter)) {\n // Support for array based keys like `additional_fields[]`\n parameter.forEach(item => {\n combinedParameters.append(key, item);\n });\n }\n else {\n combinedParameters.append(key, parameter);\n }\n }\n url.search = combinedParameters.toString();\n return url;\n}\nfunction applyTimeout(init, timeout) {\n if (!timeout)\n return init;\n const timer = setTimeout(() => { }, timeout);\n return {\n ...init,\n requestTimer: timer,\n };\n}\n//# sourceMappingURL=common.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.change = exports.resolve = exports.acknowledge = exports.trigger = exports.event = void 0;\nconst common_1 = require(\"./common\");\nfunction event(eventParameters) {\n const { server = 'events.pagerduty.com', type = 'event', data, ...config } = eventParameters;\n let url = `https://${server}/v2/enqueue`;\n if (type === 'change') {\n url = `https://${server}/v2/change/enqueue`;\n }\n return eventFetch(url, {\n method: 'POST',\n body: JSON.stringify(data),\n ...config,\n });\n}\nexports.event = event;\nconst shorthand = (action) => (eventParameters) => {\n const typeField = 'event_action';\n return event({\n ...eventParameters,\n data: {\n ...eventParameters.data,\n [typeField]: action,\n },\n });\n};\nexports.trigger = shorthand('trigger');\nexports.acknowledge = shorthand('acknowledge');\nexports.resolve = shorthand('resolve');\nconst change = (eventParameters) => event({ ...eventParameters, type: 'change' });\nexports.change = change;\nfunction eventFetch(url, options) {\n return (0, common_1.request)(url, options).then((response) => {\n const apiResponse = response;\n return response.json().then((data) => {\n apiResponse.data = data;\n apiResponse.response = response;\n return apiResponse;\n });\n });\n}\n//# sourceMappingURL=events.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolve = exports.acknowledge = exports.trigger = exports.change = exports.event = exports.api = void 0;\nvar api_1 = require(\"./api\");\nObject.defineProperty(exports, \"api\", { enumerable: true, get: function () { return api_1.api; } });\nvar events_1 = require(\"./events\");\nObject.defineProperty(exports, \"event\", { enumerable: true, get: function () { return events_1.event; } });\nObject.defineProperty(exports, \"change\", { enumerable: true, get: function () { return events_1.change; } });\nObject.defineProperty(exports, \"trigger\", { enumerable: true, get: function () { return events_1.trigger; } });\nObject.defineProperty(exports, \"acknowledge\", { enumerable: true, get: function () { return events_1.acknowledge; } });\nObject.defineProperty(exports, \"resolve\", { enumerable: true, get: function () { return events_1.resolve; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IncomingWebhook = void 0;\nconst axios_1 = __importDefault(require(\"axios\"));\nconst errors_1 = require(\"./errors\");\nconst instrument_1 = require(\"./instrument\");\n/**\n * A client for Slack's Incoming Webhooks\n */\nclass IncomingWebhook {\n constructor(url, defaults = {\n timeout: 0,\n }) {\n if (url === undefined) {\n throw new Error('Incoming webhook URL is required');\n }\n this.url = url;\n this.defaults = defaults;\n this.axios = axios_1.default.create({\n baseURL: url,\n httpAgent: defaults.agent,\n httpsAgent: defaults.agent,\n maxRedirects: 0,\n proxy: false,\n timeout: defaults.timeout,\n headers: {\n 'User-Agent': (0, instrument_1.getUserAgent)(),\n },\n });\n delete this.defaults.agent;\n }\n /**\n * Send a notification to a conversation\n * @param message - the message (a simple string, or an object describing the message)\n */\n async send(message) {\n // NOTE: no support for TLS config\n let payload = Object.assign({}, this.defaults);\n if (typeof message === 'string') {\n payload.text = message;\n }\n else {\n payload = Object.assign(payload, message);\n }\n try {\n const response = await this.axios.post(this.url, payload);\n return this.buildResult(response);\n }\n catch (error) {\n // Wrap errors in this packages own error types (abstract the implementation details' types)\n if (error.response !== undefined) {\n throw (0, errors_1.httpErrorWithOriginal)(error);\n }\n else if (error.request !== undefined) {\n throw (0, errors_1.requestErrorWithOriginal)(error);\n }\n else {\n throw error;\n }\n }\n }\n /**\n * Processes an HTTP response into an IncomingWebhookResult.\n */\n // eslint-disable-next-line class-methods-use-this\n buildResult(response) {\n return {\n text: response.data,\n };\n }\n}\nexports.IncomingWebhook = IncomingWebhook;\n//# sourceMappingURL=IncomingWebhook.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.httpErrorWithOriginal = exports.requestErrorWithOriginal = exports.ErrorCode = void 0;\n/**\n * A dictionary of codes for errors produced by this package\n */\nvar ErrorCode;\n(function (ErrorCode) {\n ErrorCode[\"RequestError\"] = \"slack_webhook_request_error\";\n ErrorCode[\"HTTPError\"] = \"slack_webhook_http_error\";\n})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));\n/**\n * Factory for producing a {@link CodedError} from a generic error\n */\nfunction errorWithCode(error, code) {\n // NOTE: might be able to return something more specific than a CodedError with conditional typing\n const codedError = error;\n codedError.code = code;\n return codedError;\n}\n/**\n * A factory to create IncomingWebhookRequestError objects\n * @param original The original error\n */\nfunction requestErrorWithOriginal(original) {\n const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError);\n error.original = original;\n return error;\n}\nexports.requestErrorWithOriginal = requestErrorWithOriginal;\n/**\n * A factory to create IncomingWebhookHTTPError objects\n * @param original The original error\n */\nfunction httpErrorWithOriginal(original) {\n const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${original.response.status}`), ErrorCode.HTTPError);\n error.original = original;\n return error;\n}\nexports.httpErrorWithOriginal = httpErrorWithOriginal;\n//# sourceMappingURL=errors.js.map","\"use strict\";\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorCode = exports.IncomingWebhook = void 0;\nvar IncomingWebhook_1 = require(\"./IncomingWebhook\");\nObject.defineProperty(exports, \"IncomingWebhook\", { enumerable: true, get: function () { return IncomingWebhook_1.IncomingWebhook; } });\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"ErrorCode\", { enumerable: true, get: function () { return errors_1.ErrorCode; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getUserAgent = exports.addAppMetadata = void 0;\nconst os = __importStar(require(\"os\"));\nconst packageJson = require('../package.json'); // eslint-disable-line import/no-commonjs, @typescript-eslint/no-var-requires\n/**\n * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.\n */\nfunction replaceSlashes(s) {\n return s.replace('/', ':');\n}\nconst baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` +\n `node/${process.version.replace('v', '')} ` +\n `${os.platform()}/${os.release()}`;\nconst appMetadata = {};\n/**\n * Appends the app metadata into the User-Agent value\n * @param appMetadata.name name of tool to be counted in instrumentation\n * @param appMetadata.version version of tool to be counted in instrumentation\n */\nfunction addAppMetadata({ name, version }) {\n appMetadata[replaceSlashes(name)] = version;\n}\nexports.addAppMetadata = addAppMetadata;\n/**\n * Returns the current User-Agent value for instrumentation\n */\nfunction getUserAgent() {\n const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' ');\n // only prepend the appIdentifier when its not empty\n return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent;\n}\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=instrument.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoginRequestResponse = exports.ErrorResponse = exports.SuccessResponse = exports.ActivityResponse = exports.ActivityRequestError = exports.ActivityRequestTrigger = void 0;\nvar ActivityRequestTrigger;\n(function (ActivityRequestTrigger) {\n ActivityRequestTrigger[\"Automatic\"] = \"automatic\";\n ActivityRequestTrigger[\"Manual\"] = \"manual\";\n})(ActivityRequestTrigger = exports.ActivityRequestTrigger || (exports.ActivityRequestTrigger = {}));\nvar ActivityRequestError = /** @class */ (function () {\n function ActivityRequestError(code, message) {\n this.code = code;\n this.message = message;\n }\n return ActivityRequestError;\n}());\nexports.ActivityRequestError = ActivityRequestError;\nvar ActivityResponse = /** @class */ (function () {\n function ActivityResponse(request) {\n this.request = request;\n }\n return ActivityResponse;\n}());\nexports.ActivityResponse = ActivityResponse;\nvar SuccessResponse = /** @class */ (function (_super) {\n __extends(SuccessResponse, _super);\n function SuccessResponse(request, rawContent) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this.rawContent = rawContent;\n return _this;\n }\n return SuccessResponse;\n}(ActivityResponse));\nexports.SuccessResponse = SuccessResponse;\nvar ErrorResponse = /** @class */ (function (_super) {\n __extends(ErrorResponse, _super);\n function ErrorResponse(request, error) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this.error = error;\n return _this;\n }\n return ErrorResponse;\n}(ActivityResponse));\nexports.ErrorResponse = ErrorResponse;\nvar LoginRequestResponse = /** @class */ (function (_super) {\n __extends(LoginRequestResponse, _super);\n function LoginRequestResponse(request, _auth) {\n var _this = _super.call(this, request) || this;\n _this.request = request;\n _this._auth = _auth;\n for (var _i = 0, _a = _this._auth.buttons; _i < _a.length; _i++) {\n var button = _a[_i];\n if (button.type === \"signin\" && button.value !== undefined) {\n try {\n new URL(button.value);\n _this.signinButton = button;\n break;\n }\n catch (e) {\n // Ignore parsing error\n }\n }\n }\n return _this;\n }\n Object.defineProperty(LoginRequestResponse.prototype, \"tokenExchangeResource\", {\n get: function () {\n return this._auth.tokenExchangeResource;\n },\n enumerable: false,\n configurable: true\n });\n return LoginRequestResponse;\n}(ActivityResponse));\nexports.LoginRequestResponse = LoginRequestResponse;\n//# sourceMappingURL=activity-request.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdaptiveApplet = void 0;\nvar Enums = require(\"./enums\");\nvar Utils = require(\"./utils\");\nvar shared_1 = require(\"./shared\");\nvar activity_request_1 = require(\"./activity-request\");\nvar strings_1 = require(\"./strings\");\nvar card_elements_1 = require(\"./card-elements\");\nvar serialization_1 = require(\"./serialization\");\nfunction logEvent(level, message) {\n var optionalParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n optionalParams[_i - 2] = arguments[_i];\n }\n if (shared_1.GlobalSettings.applets.logEnabled) {\n if (shared_1.GlobalSettings.applets.onLogEvent) {\n shared_1.GlobalSettings.applets.onLogEvent(level, message, optionalParams);\n }\n else {\n switch (level) {\n case Enums.LogLevel.Warning:\n console.warn(message, optionalParams);\n break;\n case Enums.LogLevel.Error:\n console.error(message, optionalParams);\n break;\n default:\n console.log(message, optionalParams);\n break;\n }\n }\n }\n}\nvar ActivityRequest = /** @class */ (function () {\n function ActivityRequest(action, trigger, consecutiveRefreshes) {\n this.action = action;\n this.trigger = trigger;\n this.consecutiveRefreshes = consecutiveRefreshes;\n this.attemptNumber = 0;\n }\n ActivityRequest.prototype.retryAsync = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.onSend) {\n this.onSend(this);\n }\n return [2 /*return*/];\n });\n });\n };\n return ActivityRequest;\n}());\nvar AdaptiveApplet = /** @class */ (function () {\n function AdaptiveApplet() {\n this._allowAutomaticCardUpdate = false;\n this.renderedElement = document.createElement(\"div\");\n this.renderedElement.className = \"aaf-cardHost\";\n this.renderedElement.style.position = \"relative\";\n this.renderedElement.style.display = \"flex\";\n this.renderedElement.style.flexDirection = \"column\";\n this._cardHostElement = document.createElement(\"div\");\n this._refreshButtonHostElement = document.createElement(\"div\");\n this._refreshButtonHostElement.className = \"aaf-refreshButtonHost\";\n this._refreshButtonHostElement.style.display = \"none\";\n this.renderedElement.appendChild(this._cardHostElement);\n this.renderedElement.appendChild(this._refreshButtonHostElement);\n }\n AdaptiveApplet.prototype.displayCard = function (card) {\n if (card.renderedElement) {\n Utils.clearElementChildren(this._cardHostElement);\n this._refreshButtonHostElement.style.display = \"none\";\n this._cardHostElement.appendChild(card.renderedElement);\n }\n else {\n throw new Error(\"displayCard: undefined card.\");\n }\n };\n AdaptiveApplet.prototype.showManualRefreshButton = function (refreshAction) {\n var _this = this;\n var displayBuiltInManualRefreshButton = this.onShowManualRefreshButton ? this.onShowManualRefreshButton(this) : true;\n if (displayBuiltInManualRefreshButton) {\n this._refreshButtonHostElement.style.display = \"none\";\n var renderedRefreshButton = undefined;\n if (this.onRenderManualRefreshButton) {\n renderedRefreshButton = this.onRenderManualRefreshButton(this);\n }\n else {\n var message = strings_1.Strings.runtime.refreshThisCard();\n if (shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Automatic) {\n var autoRefreshPausedMessage = strings_1.Strings.runtime.automaticRefreshPaused();\n if (autoRefreshPausedMessage[autoRefreshPausedMessage.length - 1] !== \" \") {\n autoRefreshPausedMessage += \" \";\n }\n message = strings_1.Strings.runtime.clckToRestartAutomaticRefresh();\n }\n var cardPayload = {\n type: \"AdaptiveCard\",\n version: \"1.2\",\n body: [\n {\n type: \"RichTextBlock\",\n horizontalAlignment: \"right\",\n inlines: [\n {\n type: \"TextRun\",\n text: message,\n selectAction: {\n type: \"Action.Submit\",\n id: \"refreshCard\"\n }\n }\n ]\n }\n ]\n };\n var card = new card_elements_1.AdaptiveCard();\n card.parse(cardPayload, new card_elements_1.SerializationContext(serialization_1.Versions.v1_2));\n card.onExecuteAction = function (action) {\n if (action.id === \"refreshCard\") {\n Utils.clearElementChildren(_this._refreshButtonHostElement);\n _this.internalExecuteAction(refreshAction, activity_request_1.ActivityRequestTrigger.Automatic, 0);\n }\n };\n renderedRefreshButton = card.render();\n }\n if (renderedRefreshButton) {\n Utils.clearElementChildren(this._refreshButtonHostElement);\n this._refreshButtonHostElement.appendChild(renderedRefreshButton);\n this._refreshButtonHostElement.style.removeProperty(\"display\");\n }\n }\n };\n AdaptiveApplet.prototype.createActivityRequest = function (action, trigger, consecutiveRefreshes) {\n var _this = this;\n if (this.card) {\n var request_1 = new ActivityRequest(action, trigger, consecutiveRefreshes);\n request_1.onSend = function (sender) {\n sender.attemptNumber++;\n _this.internalSendActivityRequestAsync(request_1);\n };\n var cancel = this.onPrepareActivityRequest ? !this.onPrepareActivityRequest(this, request_1, action) : false;\n return cancel ? undefined : request_1;\n }\n else {\n throw new Error(\"createActivityRequest: no card has been set.\");\n }\n };\n AdaptiveApplet.prototype.createMagicCodeInputCard = function (attemptNumber) {\n var payload = {\n type: \"AdaptiveCard\",\n version: \"1.0\",\n body: [\n {\n type: \"TextBlock\",\n color: \"attention\",\n text: attemptNumber === 1 ? undefined : \"That didn't work... let's try again.\",\n wrap: true,\n horizontalAlignment: \"center\"\n },\n {\n type: \"TextBlock\",\n text: \"Please login in the popup. You will obtain a magic code. Paste that code below and select \\\"Submit\\\"\",\n wrap: true,\n horizontalAlignment: \"center\"\n },\n {\n type: \"Input.Text\",\n id: \"magicCode\",\n placeholder: \"Enter magic code\"\n },\n {\n type: \"ActionSet\",\n horizontalAlignment: \"center\",\n actions: [\n {\n type: \"Action.Submit\",\n id: AdaptiveApplet.submitMagicCodeActionId,\n title: \"Submit\"\n },\n {\n type: \"Action.Submit\",\n id: AdaptiveApplet.cancelMagicCodeAuthActionId,\n title: \"Cancel\"\n }\n ]\n }\n ]\n };\n var card = new card_elements_1.AdaptiveCard();\n card.parse(payload);\n return card;\n };\n AdaptiveApplet.prototype.cancelAutomaticRefresh = function () {\n if (this._allowAutomaticCardUpdate) {\n logEvent(Enums.LogLevel.Warning, \"Automatic card refresh has been cancelled as a result of the user interacting with the card.\");\n }\n this._allowAutomaticCardUpdate = false;\n };\n AdaptiveApplet.prototype.createSerializationContext = function () {\n return this.onCreateSerializationContext ? this.onCreateSerializationContext(this) : new card_elements_1.SerializationContext();\n };\n AdaptiveApplet.prototype.internalSetCard = function (payload, consecutiveRefreshes) {\n var _this = this;\n if (typeof payload === \"object\" && payload[\"type\"] === \"AdaptiveCard\") {\n this._cardPayload = payload;\n }\n if (this._cardPayload) {\n try {\n var card = new card_elements_1.AdaptiveCard();\n if (this.hostConfig) {\n card.hostConfig = this.hostConfig;\n }\n var serializationContext = this.createSerializationContext();\n card.parse(this._cardPayload, serializationContext);\n var doChangeCard = this.onCardChanging ? this.onCardChanging(this, this._cardPayload) : true;\n if (doChangeCard) {\n this._card = card;\n if (this._card.authentication && this._card.authentication.tokenExchangeResource && this.onPrefetchSSOToken) {\n this.onPrefetchSSOToken(this, this._card.authentication.tokenExchangeResource);\n }\n this._card.onExecuteAction = function (action) {\n // If the user takes an action, cancel any pending automatic refresh\n _this.cancelAutomaticRefresh();\n _this.internalExecuteAction(action, activity_request_1.ActivityRequestTrigger.Manual, 0);\n };\n this._card.onInputValueChanged = function (input) {\n // If the user modifies an input, cancel any pending automatic refresh\n _this.cancelAutomaticRefresh();\n };\n this._card.render();\n if (this._card.renderedElement) {\n this.displayCard(this._card);\n if (this.onCardChanged) {\n this.onCardChanged(this);\n }\n if (this._card.refresh) {\n if (shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Automatic && consecutiveRefreshes < shared_1.GlobalSettings.applets.refresh.maximumConsecutiveAutomaticRefreshes) {\n if (shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes <= 0) {\n logEvent(Enums.LogLevel.Info, \"Triggering automatic card refresh number \" + (consecutiveRefreshes + 1));\n this.internalExecuteAction(this._card.refresh.action, activity_request_1.ActivityRequestTrigger.Automatic, consecutiveRefreshes + 1);\n }\n else {\n logEvent(Enums.LogLevel.Info, \"Scheduling automatic card refresh number \" + (consecutiveRefreshes + 1) + \" in \" + shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes + \"ms\");\n var action_1 = this._card.refresh.action;\n this._allowAutomaticCardUpdate = true;\n window.setTimeout(function () {\n if (_this._allowAutomaticCardUpdate) {\n _this.internalExecuteAction(action_1, activity_request_1.ActivityRequestTrigger.Automatic, consecutiveRefreshes + 1);\n }\n }, shared_1.GlobalSettings.applets.refresh.timeBetweenAutomaticRefreshes);\n }\n }\n else if (shared_1.GlobalSettings.applets.refresh.mode !== Enums.RefreshMode.Disabled) {\n if (consecutiveRefreshes > 0) {\n logEvent(Enums.LogLevel.Warning, \"Stopping automatic refreshes after \" + consecutiveRefreshes + \" consecutive refreshes.\");\n }\n else {\n logEvent(Enums.LogLevel.Warning, \"The card has a refresh section, but automatic refreshes are disabled.\");\n }\n if (shared_1.GlobalSettings.applets.refresh.allowManualRefreshesAfterAutomaticRefreshes || shared_1.GlobalSettings.applets.refresh.mode === Enums.RefreshMode.Manual) {\n logEvent(Enums.LogLevel.Info, \"Showing manual refresh button.\");\n this.showManualRefreshButton(this._card.refresh.action);\n }\n }\n }\n }\n }\n }\n catch (error) {\n // Ignore all errors\n logEvent(Enums.LogLevel.Error, \"setCard: \" + error);\n }\n }\n };\n AdaptiveApplet.prototype.internalExecuteAction = function (action, trigger, consecutiveRefreshes) {\n if (action instanceof card_elements_1.ExecuteAction) {\n if (this.channelAdapter) {\n var request = this.createActivityRequest(action, trigger, consecutiveRefreshes);\n if (request) {\n request.retryAsync();\n }\n }\n else {\n throw new Error(\"internalExecuteAction: No channel adapter set.\");\n }\n }\n if (this.onAction) {\n this.onAction(this, action);\n }\n };\n AdaptiveApplet.prototype.createProgressOverlay = function (request) {\n if (!this._progressOverlay) {\n if (this.onCreateProgressOverlay) {\n this._progressOverlay = this.onCreateProgressOverlay(this, request);\n }\n else {\n this._progressOverlay = document.createElement(\"div\");\n this._progressOverlay.className = \"aaf-progress-overlay\";\n var spinner = document.createElement(\"div\");\n spinner.className = \"aaf-spinner\";\n spinner.style.width = \"28px\";\n spinner.style.height = \"28px\";\n this._progressOverlay.appendChild(spinner);\n }\n }\n return this._progressOverlay;\n };\n AdaptiveApplet.prototype.removeProgressOverlay = function (request) {\n if (this.onRemoveProgressOverlay) {\n this.onRemoveProgressOverlay(this, request);\n }\n if (this._progressOverlay !== undefined) {\n this.renderedElement.removeChild(this._progressOverlay);\n this._progressOverlay = undefined;\n }\n };\n AdaptiveApplet.prototype.activityRequestSucceeded = function (response, parsedContent) {\n if (this.onActivityRequestSucceeded) {\n this.onActivityRequestSucceeded(this, response, parsedContent);\n }\n };\n AdaptiveApplet.prototype.activityRequestFailed = function (response) {\n return this.onActivityRequestFailed ? this.onActivityRequestFailed(this, response) : shared_1.GlobalSettings.applets.defaultTimeBetweenRetryAttempts;\n };\n AdaptiveApplet.prototype.showAuthCodeInputDialog = function (request) {\n var _this = this;\n var showBuiltInAuthCodeInputCard = this.onShowAuthCodeInputDialog ? this.onShowAuthCodeInputDialog(this, request) : true;\n if (showBuiltInAuthCodeInputCard) {\n var authCodeInputCard = this.createMagicCodeInputCard(request.attemptNumber);\n authCodeInputCard.render();\n authCodeInputCard.onExecuteAction = function (submitMagicCodeAction) {\n if (_this.card && submitMagicCodeAction instanceof card_elements_1.SubmitAction) {\n switch (submitMagicCodeAction.id) {\n case AdaptiveApplet.submitMagicCodeActionId:\n var authCode = undefined;\n if (submitMagicCodeAction.data && typeof submitMagicCodeAction.data[\"magicCode\"] === \"string\") {\n authCode = submitMagicCodeAction.data[\"magicCode\"];\n }\n if (authCode) {\n _this.displayCard(_this.card);\n request.authCode = authCode;\n request.retryAsync();\n }\n else {\n alert(\"Please enter the magic code you received.\");\n }\n break;\n case AdaptiveApplet.cancelMagicCodeAuthActionId:\n logEvent(Enums.LogLevel.Warning, \"Authentication cancelled by user.\");\n _this.displayCard(_this.card);\n break;\n default:\n logEvent(Enums.LogLevel.Error, \"Unespected action taken from magic code input card (id = \" + submitMagicCodeAction.id + \")\");\n alert(strings_1.Strings.magicCodeInputCard.somethingWentWrong());\n break;\n }\n }\n };\n this.displayCard(authCodeInputCard);\n }\n };\n AdaptiveApplet.prototype.internalSendActivityRequestAsync = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var overlay, done, _loop_1, this_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.channelAdapter) {\n throw new Error(\"internalSendActivityRequestAsync: channelAdapter is not set.\");\n }\n overlay = this.createProgressOverlay(request);\n if (overlay !== undefined) {\n this.renderedElement.appendChild(overlay);\n }\n done = false;\n _loop_1 = function () {\n var response, error_1, parsedContent, retryIn_1, attemptOAuth, left, top_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n response = undefined;\n if (request.attemptNumber === 1) {\n logEvent(Enums.LogLevel.Info, \"Sending activity request to channel (attempt \" + request.attemptNumber + \")\");\n }\n else {\n logEvent(Enums.LogLevel.Info, \"Re-sending activity request to channel (attempt \" + request.attemptNumber + \")\");\n }\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this_1.channelAdapter.sendRequestAsync(request)];\n case 2:\n response = _b.sent();\n return [3 /*break*/, 4];\n case 3:\n error_1 = _b.sent();\n logEvent(Enums.LogLevel.Error, \"Activity request failed: \" + error_1);\n this_1.removeProgressOverlay(request);\n done = true;\n return [3 /*break*/, 4];\n case 4:\n if (!response) return [3 /*break*/, 10];\n if (!(response instanceof activity_request_1.SuccessResponse)) return [3 /*break*/, 5];\n this_1.removeProgressOverlay(request);\n if (response.rawContent === undefined) {\n throw new Error(\"internalSendActivityRequestAsync: Action.Execute result is undefined\");\n }\n parsedContent = response.rawContent;\n try {\n parsedContent = JSON.parse(response.rawContent);\n }\n catch (_c) {\n // Leave parseContent as is\n }\n if (typeof parsedContent === \"string\") {\n logEvent(Enums.LogLevel.Info, \"The activity request returned a string after \" + request.attemptNumber + \" attempt(s).\");\n this_1.activityRequestSucceeded(response, parsedContent);\n }\n else if (typeof parsedContent === \"object\" && parsedContent[\"type\"] === \"AdaptiveCard\") {\n logEvent(Enums.LogLevel.Info, \"The activity request returned an Adaptive Card after \" + request.attemptNumber + \" attempt(s).\");\n this_1.internalSetCard(parsedContent, request.consecutiveRefreshes);\n this_1.activityRequestSucceeded(response, this_1.card);\n }\n else {\n throw new Error(\"internalSendActivityRequestAsync: Action.Execute result is of unsupported type (\" + typeof response.rawContent + \")\");\n }\n done = true;\n return [3 /*break*/, 10];\n case 5:\n if (!(response instanceof activity_request_1.ErrorResponse)) return [3 /*break*/, 9];\n retryIn_1 = this_1.activityRequestFailed(response);\n if (!(retryIn_1 >= 0 && request.attemptNumber < shared_1.GlobalSettings.applets.maximumRetryAttempts)) return [3 /*break*/, 7];\n logEvent(Enums.LogLevel.Warning, \"Activity request failed: \" + response.error.message + \". Retrying in \" + retryIn_1 + \"ms\");\n request.attemptNumber++;\n return [4 /*yield*/, new Promise(function (resolve, reject) {\n window.setTimeout(function () { resolve(); }, retryIn_1);\n })];\n case 6:\n _b.sent();\n return [3 /*break*/, 8];\n case 7:\n logEvent(Enums.LogLevel.Error, \"Activity request failed: \" + response.error.message + \". Giving up after \" + request.attemptNumber + \" attempt(s)\");\n this_1.removeProgressOverlay(request);\n done = true;\n _b.label = 8;\n case 8: return [3 /*break*/, 10];\n case 9:\n if (response instanceof activity_request_1.LoginRequestResponse) {\n logEvent(Enums.LogLevel.Info, \"The activity request returned a LoginRequestResponse after \" + request.attemptNumber + \" attempt(s).\");\n if (request.attemptNumber <= shared_1.GlobalSettings.applets.maximumRetryAttempts) {\n attemptOAuth = true;\n if (response.tokenExchangeResource && this_1.onSSOTokenNeeded) {\n // Attempt to use SSO. The host will return true if it can handle SSO, in which case\n // we bypass OAuth\n attemptOAuth = !this_1.onSSOTokenNeeded(this_1, request, response.tokenExchangeResource);\n }\n if (attemptOAuth) {\n // Attempt to use OAuth\n this_1.removeProgressOverlay(request);\n if (response.signinButton === undefined) {\n throw new Error(\"internalSendActivityRequestAsync: the login request doesn't contain a valid signin URL.\");\n }\n logEvent(Enums.LogLevel.Info, \"Login required at \" + response.signinButton.value);\n if (this_1.onShowSigninPrompt) {\n // Bypass the built-in auth prompt if the host app handles it\n this_1.onShowSigninPrompt(this_1, request, response.signinButton);\n }\n else {\n this_1.showAuthCodeInputDialog(request);\n left = window.screenX + (window.outerWidth - shared_1.GlobalSettings.applets.authPromptWidth) / 2;\n top_1 = window.screenY + (window.outerHeight - shared_1.GlobalSettings.applets.authPromptHeight) / 2;\n window.open(response.signinButton.value, response.signinButton.title ? response.signinButton.title : \"Sign in\", \"width=\" + shared_1.GlobalSettings.applets.authPromptWidth + \",height=\" + shared_1.GlobalSettings.applets.authPromptHeight + \",left=\" + left + \",top=\" + top_1);\n }\n }\n }\n else {\n logEvent(Enums.LogLevel.Error, \"Authentication failed. Giving up after \" + request.attemptNumber + \" attempt(s)\");\n alert(strings_1.Strings.magicCodeInputCard.authenticationFailed());\n }\n return [2 /*return*/, \"break\"];\n }\n else {\n throw new Error(\"Unhandled response type: \" + response.toString());\n }\n _b.label = 10;\n case 10: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _a.label = 1;\n case 1:\n if (!!done) return [3 /*break*/, 3];\n return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 3];\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n AdaptiveApplet.prototype.refreshCard = function () {\n if (this._card && this._card.refresh) {\n this.internalExecuteAction(this._card.refresh.action, activity_request_1.ActivityRequestTrigger.Manual, 0);\n }\n };\n AdaptiveApplet.prototype.setCard = function (payload) {\n this.internalSetCard(payload, 0);\n };\n Object.defineProperty(AdaptiveApplet.prototype, \"card\", {\n get: function () {\n return this._card;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveApplet.submitMagicCodeActionId = \"submitMagicCode\";\n AdaptiveApplet.cancelMagicCodeAuthActionId = \"cancelMagicCodeAuth\";\n return AdaptiveApplet;\n}());\nexports.AdaptiveApplet = AdaptiveApplet;\n//# sourceMappingURL=adaptive-applet.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n__exportStar(require(\"./strings\"), exports);\n__exportStar(require(\"./enums\"), exports);\n__exportStar(require(\"./shared\"), exports);\n__exportStar(require(\"./utils\"), exports);\n__exportStar(require(\"./serialization\"), exports);\n__exportStar(require(\"./host-capabilities\"), exports);\n__exportStar(require(\"./host-config\"), exports);\n__exportStar(require(\"./registry\"), exports);\n__exportStar(require(\"./card-object\"), exports);\n__exportStar(require(\"./card-elements\"), exports);\n__exportStar(require(\"./table\"), exports);\n__exportStar(require(\"./channel-adapter\"), exports);\n__exportStar(require(\"./activity-request\"), exports);\n__exportStar(require(\"./adaptive-applet\"), exports);\n//# sourceMappingURL=adaptivecards.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SerializationContext = exports.AdaptiveCard = exports.Authentication = exports.TokenExchangeResource = exports.AuthCardButton = exports.RefreshDefinition = exports.RefreshActionProperty = exports.ContainerWithActions = exports.ColumnSet = exports.Column = exports.Container = exports.BackgroundImage = exports.ContainerBase = exports.StylableCardElementContainer = exports.ContainerStyleProperty = exports.ActionSet = exports.ShowCardAction = exports.HttpAction = exports.HttpHeader = exports.ToggleVisibilityAction = exports.OpenUrlAction = exports.ExecuteAction = exports.SubmitAction = exports.SubmitActionBase = exports.Action = exports.TimeInput = exports.TimeProperty = exports.DateInput = exports.NumberInput = exports.ChoiceSetInput = exports.Choice = exports.ToggleInput = exports.TextInput = exports.Input = exports.Media = exports.MediaSource = exports.ImageSet = exports.CardElementContainer = exports.Image = exports.FactSet = exports.Fact = exports.RichTextBlock = exports.TextRun = exports.TextBlock = exports.BaseTextBlock = exports.ActionProperty = exports.CardElement = exports.renderSeparation = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar shared_1 = require(\"./shared\");\nvar Utils = require(\"./utils\");\nvar host_config_1 = require(\"./host-config\");\nvar TextFormatters = require(\"./text-formatters\");\nvar card_object_1 = require(\"./card-object\");\nvar serialization_1 = require(\"./serialization\");\nvar registry_1 = require(\"./registry\");\nvar strings_1 = require(\"./strings\");\nvar controls_1 = require(\"./controls\");\nfunction renderSeparation(hostConfig, separationDefinition, orientation) {\n if (separationDefinition.spacing > 0 || (separationDefinition.lineThickness && separationDefinition.lineThickness > 0)) {\n var separator = document.createElement(\"div\");\n separator.className = hostConfig.makeCssClassName(\"ac-\" + (orientation == Enums.Orientation.Horizontal ? \"horizontal\" : \"vertical\") + \"-separator\");\n separator.setAttribute(\"aria-hidden\", \"true\");\n var color = separationDefinition.lineColor ? Utils.stringToCssColor(separationDefinition.lineColor) : \"\";\n if (orientation == Enums.Orientation.Horizontal) {\n if (separationDefinition.lineThickness) {\n separator.style.paddingTop = (separationDefinition.spacing / 2) + \"px\";\n separator.style.marginBottom = (separationDefinition.spacing / 2) + \"px\";\n separator.style.borderBottom = separationDefinition.lineThickness + \"px solid \" + color;\n }\n else {\n separator.style.height = separationDefinition.spacing + \"px\";\n }\n }\n else {\n if (separationDefinition.lineThickness) {\n separator.style.paddingLeft = (separationDefinition.spacing / 2) + \"px\";\n separator.style.marginRight = (separationDefinition.spacing / 2) + \"px\";\n separator.style.borderRight = separationDefinition.lineThickness + \"px solid \" + color;\n }\n else {\n separator.style.width = separationDefinition.spacing + \"px\";\n }\n }\n separator.style.overflow = \"hidden\";\n separator.style.flex = \"0 0 auto\";\n return separator;\n }\n else {\n return undefined;\n }\n}\nexports.renderSeparation = renderSeparation;\nvar CardElement = /** @class */ (function (_super) {\n __extends(CardElement, _super);\n function CardElement() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._truncatedDueToOverflow = false;\n return _this;\n }\n Object.defineProperty(CardElement.prototype, \"lang\", {\n get: function () {\n var lang = this.getValue(CardElement.langProperty);\n if (lang) {\n return lang;\n }\n else {\n if (this.parent) {\n return this.parent.lang;\n }\n else {\n return undefined;\n }\n }\n },\n set: function (value) {\n this.setValue(CardElement.langProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isVisible\", {\n get: function () {\n return this.getValue(CardElement.isVisibleProperty);\n },\n set: function (value) {\n // If the element is going to be hidden, reset any changes that were due\n // to overflow truncation (this ensures that if the element is later\n // un-hidden it has the right content)\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && !value) {\n this.undoOverflowTruncation();\n }\n if (this.isVisible !== value) {\n this.setValue(CardElement.isVisibleProperty, value);\n this.updateRenderedElementVisibility();\n if (this._renderedElement) {\n raiseElementVisibilityChangedEvent(this);\n }\n }\n if (this._renderedElement) {\n this._renderedElement.setAttribute(\"aria-expanded\", value.toString());\n }\n },\n enumerable: false,\n configurable: true\n });\n CardElement.prototype.internalRenderSeparator = function () {\n var renderedSeparator = renderSeparation(this.hostConfig, {\n spacing: this.hostConfig.getEffectiveSpacing(this.spacing),\n lineThickness: this.separator ? this.hostConfig.separator.lineThickness : undefined,\n lineColor: this.separator ? this.hostConfig.separator.lineColor : undefined\n }, this.separatorOrientation);\n if (shared_1.GlobalSettings.alwaysBleedSeparators && renderedSeparator && this.separatorOrientation == Enums.Orientation.Horizontal) {\n // Adjust separator's margins if the option to always bleed separators is turned on\n var parentContainer = this.getParentContainer();\n if (parentContainer && parentContainer.getEffectivePadding()) {\n var parentPhysicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(parentContainer.getEffectivePadding());\n renderedSeparator.style.marginLeft = \"-\" + parentPhysicalPadding.left + \"px\";\n renderedSeparator.style.marginRight = \"-\" + parentPhysicalPadding.right + \"px\";\n }\n }\n return renderedSeparator;\n };\n CardElement.prototype.updateRenderedElementVisibility = function () {\n var displayMode = this.isDesignMode() || this.isVisible ? this._defaultRenderedElementDisplayMode : \"none\";\n if (this._renderedElement) {\n if (displayMode) {\n this._renderedElement.style.display = displayMode;\n }\n else {\n this._renderedElement.style.removeProperty(\"display\");\n }\n }\n if (this._separatorElement) {\n if (this.parent && this.parent.isFirstElement(this)) {\n this._separatorElement.style.display = \"none\";\n }\n else {\n if (displayMode) {\n this._separatorElement.style.display = displayMode;\n }\n else {\n this._separatorElement.style.removeProperty(\"display\");\n }\n }\n }\n };\n CardElement.prototype.hideElementDueToOverflow = function () {\n if (this._renderedElement && this.isVisible) {\n this._renderedElement.style.visibility = \"hidden\";\n this.isVisible = false;\n raiseElementVisibilityChangedEvent(this, false);\n }\n };\n CardElement.prototype.showElementHiddenDueToOverflow = function () {\n if (this._renderedElement && !this.isVisible) {\n this._renderedElement.style.removeProperty(\"visibility\");\n this.isVisible = true;\n raiseElementVisibilityChangedEvent(this, false);\n }\n };\n // Marked private to emulate internal access\n CardElement.prototype.handleOverflow = function (maxHeight) {\n if (this.isVisible || this.isHiddenDueToOverflow()) {\n var handled = this.truncateOverflow(maxHeight);\n // Even if we were unable to truncate the element to fit this time,\n // it still could have been previously truncated\n this._truncatedDueToOverflow = handled || this._truncatedDueToOverflow;\n if (!handled) {\n this.hideElementDueToOverflow();\n }\n else if (handled && !this.isVisible) {\n this.showElementHiddenDueToOverflow();\n }\n }\n };\n // Marked private to emulate internal access\n CardElement.prototype.resetOverflow = function () {\n var sizeChanged = false;\n if (this._truncatedDueToOverflow) {\n this.undoOverflowTruncation();\n this._truncatedDueToOverflow = false;\n sizeChanged = true;\n }\n if (this.isHiddenDueToOverflow()) {\n this.showElementHiddenDueToOverflow();\n }\n return sizeChanged;\n };\n CardElement.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext();\n };\n CardElement.prototype.createPlaceholderElement = function () {\n var styleDefinition = this.getEffectiveStyleDefinition();\n var foregroundCssColor = Utils.stringToCssColor(styleDefinition.foregroundColors.default.subtle);\n var element = document.createElement(\"div\");\n element.style.border = \"1px dashed \" + foregroundCssColor;\n element.style.padding = \"4px\";\n element.style.minHeight = \"32px\";\n element.style.fontSize = \"10px\";\n element.style.color = foregroundCssColor;\n element.innerText = \"Empty \" + this.getJsonTypeName();\n return element;\n };\n CardElement.prototype.adjustRenderedElementSize = function (renderedElement) {\n if (this.height === \"auto\") {\n renderedElement.style.flex = \"0 0 auto\";\n }\n else {\n renderedElement.style.flex = \"1 1 auto\";\n }\n };\n CardElement.prototype.isDisplayed = function () {\n return this._renderedElement !== undefined && this.isVisible && this._renderedElement.offsetHeight > 0;\n };\n CardElement.prototype.overrideInternalRender = function () {\n return this.internalRender();\n };\n CardElement.prototype.applyPadding = function () {\n if (this.separatorElement && this.separatorOrientation === Enums.Orientation.Horizontal) {\n if (shared_1.GlobalSettings.alwaysBleedSeparators && !this.isBleeding()) {\n var padding = new shared_1.PaddingDefinition();\n this.getImmediateSurroundingPadding(padding);\n var physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n this.separatorElement.style.marginLeft = \"-\" + physicalPadding.left + \"px\";\n this.separatorElement.style.marginRight = \"-\" + physicalPadding.right + \"px\";\n }\n else {\n this.separatorElement.style.marginRight = \"0\";\n this.separatorElement.style.marginLeft = \"0\";\n }\n }\n };\n /*\n * Called when this element overflows the bottom of the card.\n * maxHeight will be the amount of space still available on the card (0 if\n * the element is fully off the card).\n */\n CardElement.prototype.truncateOverflow = function (maxHeight) {\n // Child implementations should return true if the element handled\n // the truncation request such that its content fits within maxHeight,\n // false if the element should fall back to being hidden\n return false;\n };\n /*\n * This should reverse any changes performed in truncateOverflow().\n */\n CardElement.prototype.undoOverflowTruncation = function () { };\n CardElement.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition();\n };\n CardElement.prototype.getHasBackground = function () {\n return false;\n };\n CardElement.prototype.getHasBorder = function () {\n return false;\n };\n CardElement.prototype.getPadding = function () {\n return this._padding;\n };\n CardElement.prototype.setPadding = function (value) {\n this._padding = value;\n };\n CardElement.prototype.shouldSerialize = function (context) {\n return context.elementRegistry.findByName(this.getJsonTypeName()) !== undefined;\n };\n Object.defineProperty(CardElement.prototype, \"useDefaultSizing\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"separatorOrientation\", {\n get: function () {\n return Enums.Orientation.Horizontal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"defaultStyle\", {\n get: function () {\n return Enums.ContainerStyle.Default;\n },\n enumerable: false,\n configurable: true\n });\n CardElement.prototype.parse = function (source, context) {\n _super.prototype.parse.call(this, source, context ? context : new SerializationContext());\n };\n CardElement.prototype.asString = function () {\n return \"\";\n };\n CardElement.prototype.isBleeding = function () {\n return false;\n };\n CardElement.prototype.getEffectiveStyle = function () {\n if (this.parent) {\n return this.parent.getEffectiveStyle();\n }\n return this.defaultStyle;\n };\n CardElement.prototype.getEffectiveStyleDefinition = function () {\n return this.hostConfig.containerStyles.getStyleByName(this.getEffectiveStyle());\n };\n CardElement.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.parent) {\n return this.parent.getEffectiveTextStyleDefinition();\n }\n return this.hostConfig.textStyles.default;\n };\n CardElement.prototype.getForbiddenActionTypes = function () {\n return [];\n };\n CardElement.prototype.getImmediateSurroundingPadding = function (result, processTop, processRight, processBottom, processLeft) {\n if (processTop === void 0) { processTop = true; }\n if (processRight === void 0) { processRight = true; }\n if (processBottom === void 0) { processBottom = true; }\n if (processLeft === void 0) { processLeft = true; }\n if (this.parent) {\n var doProcessTop = processTop && this.parent.isTopElement(this);\n var doProcessRight = processRight && this.parent.isRightMostElement(this);\n var doProcessBottom = processBottom && this.parent.isBottomElement(this);\n var doProcessLeft = processLeft && this.parent.isLeftMostElement(this);\n var effectivePadding = this.parent.getEffectivePadding();\n if (effectivePadding) {\n if (doProcessTop && effectivePadding.top != Enums.Spacing.None) {\n result.top = effectivePadding.top;\n doProcessTop = false;\n }\n if (doProcessRight && effectivePadding.right != Enums.Spacing.None) {\n result.right = effectivePadding.right;\n doProcessRight = false;\n }\n if (doProcessBottom && effectivePadding.bottom != Enums.Spacing.None) {\n result.bottom = effectivePadding.bottom;\n doProcessBottom = false;\n }\n if (doProcessLeft && effectivePadding.left != Enums.Spacing.None) {\n result.left = effectivePadding.left;\n doProcessLeft = false;\n }\n }\n if (doProcessTop || doProcessRight || doProcessBottom || doProcessLeft) {\n this.parent.getImmediateSurroundingPadding(result, doProcessTop, doProcessRight, doProcessBottom, doProcessLeft);\n }\n }\n };\n CardElement.prototype.getActionCount = function () {\n return 0;\n };\n CardElement.prototype.getActionAt = function (index) {\n throw new Error(strings_1.Strings.errors.indexOutOfRange(index));\n };\n CardElement.prototype.indexOfAction = function (action) {\n for (var i = 0; i < this.getActionCount(); i++) {\n if (this.getActionAt(i) === action) {\n return i;\n }\n }\n return -1;\n };\n CardElement.prototype.remove = function () {\n if (this.parent && this.parent instanceof CardElementContainer) {\n return this.parent.removeItem(this);\n }\n return false;\n };\n CardElement.prototype.render = function () {\n this._renderedElement = this.overrideInternalRender();\n this._separatorElement = this.internalRenderSeparator();\n if (this._renderedElement) {\n if (this.id) {\n this._renderedElement.id = this.id;\n }\n if (this.customCssSelector) {\n this._renderedElement.classList.add(this.customCssSelector);\n }\n this._renderedElement.style.boxSizing = \"border-box\";\n this._defaultRenderedElementDisplayMode = this._renderedElement.style.display ? this._renderedElement.style.display : undefined;\n this.adjustRenderedElementSize(this._renderedElement);\n this.updateLayout(false);\n }\n else if (this.isDesignMode()) {\n this._renderedElement = this.createPlaceholderElement();\n }\n return this._renderedElement;\n };\n CardElement.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n this.updateRenderedElementVisibility();\n this.applyPadding();\n };\n CardElement.prototype.indexOf = function (cardElement) {\n return -1;\n };\n CardElement.prototype.isDesignMode = function () {\n var rootElement = this.getRootElement();\n return rootElement instanceof AdaptiveCard && rootElement.designMode;\n };\n CardElement.prototype.isFirstElement = function (element) {\n return true;\n };\n CardElement.prototype.isLastElement = function (element) {\n return true;\n };\n CardElement.prototype.isAtTheVeryLeft = function () {\n return this.parent ? this.parent.isLeftMostElement(this) && this.parent.isAtTheVeryLeft() : true;\n };\n CardElement.prototype.isAtTheVeryRight = function () {\n return this.parent ? this.parent.isRightMostElement(this) && this.parent.isAtTheVeryRight() : true;\n };\n CardElement.prototype.isAtTheVeryTop = function () {\n return this.parent ? this.parent.isFirstElement(this) && this.parent.isAtTheVeryTop() : true;\n };\n CardElement.prototype.isAtTheVeryBottom = function () {\n return this.parent ? this.parent.isLastElement(this) && this.parent.isAtTheVeryBottom() : true;\n };\n CardElement.prototype.isBleedingAtTop = function () {\n return false;\n };\n CardElement.prototype.isBleedingAtBottom = function () {\n return false;\n };\n CardElement.prototype.isLeftMostElement = function (element) {\n return true;\n };\n CardElement.prototype.isRightMostElement = function (element) {\n return true;\n };\n CardElement.prototype.isTopElement = function (element) {\n return this.isFirstElement(element);\n };\n CardElement.prototype.isBottomElement = function (element) {\n return this.isLastElement(element);\n };\n CardElement.prototype.isHiddenDueToOverflow = function () {\n return this._renderedElement !== undefined && this._renderedElement.style.visibility == 'hidden';\n };\n CardElement.prototype.getRootElement = function () {\n return this.getRootObject();\n };\n CardElement.prototype.getParentContainer = function () {\n var currentElement = this.parent;\n while (currentElement) {\n if (currentElement instanceof Container) {\n return currentElement;\n }\n currentElement = currentElement.parent;\n }\n return undefined;\n };\n CardElement.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [];\n };\n CardElement.prototype.getResourceInformation = function () {\n return [];\n };\n CardElement.prototype.getElementById = function (id) {\n return this.id === id ? this : undefined;\n };\n CardElement.prototype.getActionById = function (id) {\n return undefined;\n };\n CardElement.prototype.getEffectivePadding = function () {\n var padding = this.getPadding();\n return padding ? padding : this.getDefaultPadding();\n };\n CardElement.prototype.getEffectiveHorizontalAlignment = function () {\n if (this.horizontalAlignment !== undefined) {\n return this.horizontalAlignment;\n }\n if (this.parent) {\n return this.parent.getEffectiveHorizontalAlignment();\n }\n return Enums.HorizontalAlignment.Left;\n };\n Object.defineProperty(CardElement.prototype, \"hostConfig\", {\n get: function () {\n if (this._hostConfig) {\n return this._hostConfig;\n }\n else {\n if (this.parent) {\n return this.parent.hostConfig;\n }\n else {\n return host_config_1.defaultHostConfig;\n }\n }\n },\n set: function (value) {\n this._hostConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"index\", {\n get: function () {\n if (this.parent) {\n return this.parent.indexOf(this);\n }\n else {\n return 0;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isInteractive\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isStandalone\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"isInline\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"hasVisibleSeparator\", {\n get: function () {\n if (this.parent && this.separatorElement) {\n return !this.parent.isFirstElement(this) && (this.isVisible || this.isDesignMode());\n }\n else {\n return false;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"separatorElement\", {\n get: function () {\n return this._separatorElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardElement.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n CardElement.langProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"lang\", true, /^[a-z]{2,3}$/ig);\n CardElement.isVisibleProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"isVisible\", true);\n CardElement.separatorProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"separator\", false);\n CardElement.heightProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_1, \"height\", [\n { value: \"auto\" },\n { value: \"stretch\" }\n ], \"auto\");\n CardElement.horizontalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"horizontalAlignment\", Enums.HorizontalAlignment);\n CardElement.spacingProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"spacing\", Enums.Spacing, Enums.Spacing.Default);\n __decorate([\n serialization_1.property(CardElement.horizontalAlignmentProperty)\n ], CardElement.prototype, \"horizontalAlignment\", void 0);\n __decorate([\n serialization_1.property(CardElement.spacingProperty)\n ], CardElement.prototype, \"spacing\", void 0);\n __decorate([\n serialization_1.property(CardElement.separatorProperty)\n ], CardElement.prototype, \"separator\", void 0);\n __decorate([\n serialization_1.property(CardElement.heightProperty)\n ], CardElement.prototype, \"height\", void 0);\n __decorate([\n serialization_1.property(CardElement.langProperty)\n ], CardElement.prototype, \"lang\", null);\n __decorate([\n serialization_1.property(CardElement.isVisibleProperty)\n ], CardElement.prototype, \"isVisible\", null);\n return CardElement;\n}(card_object_1.CardObject));\nexports.CardElement = CardElement;\nvar ActionProperty = /** @class */ (function (_super) {\n __extends(ActionProperty, _super);\n function ActionProperty(targetVersion, name, forbiddenActionTypes) {\n if (forbiddenActionTypes === void 0) { forbiddenActionTypes = []; }\n var _this = _super.call(this, targetVersion, name, undefined) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.forbiddenActionTypes = forbiddenActionTypes;\n return _this;\n }\n ActionProperty.prototype.parse = function (sender, source, context) {\n var parent = sender;\n return context.parseAction(parent, source[this.name], this.forbiddenActionTypes, parent.isDesignMode());\n };\n ActionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value ? value.toJSON(context) : undefined, undefined, true);\n };\n return ActionProperty;\n}(serialization_1.PropertyDefinition));\nexports.ActionProperty = ActionProperty;\nvar BaseTextBlock = /** @class */ (function (_super) {\n __extends(BaseTextBlock, _super);\n function BaseTextBlock(text) {\n var _this = _super.call(this) || this;\n _this.ariaHidden = false;\n if (text) {\n _this.text = text;\n }\n return _this;\n }\n BaseTextBlock.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n // selectAction is declared on BaseTextBlock but is only exposed on TextRun,\n // so the property is removed from the BaseTextBlock schema.\n schema.remove(BaseTextBlock.selectActionProperty);\n };\n Object.defineProperty(BaseTextBlock.prototype, \"text\", {\n get: function () {\n return this.getValue(BaseTextBlock.textProperty);\n },\n set: function (value) {\n this.setText(value);\n },\n enumerable: false,\n configurable: true\n });\n //#endregion\n BaseTextBlock.prototype.getFontSize = function (fontType) {\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n return fontType.fontSizes.small;\n case Enums.TextSize.Medium:\n return fontType.fontSizes.medium;\n case Enums.TextSize.Large:\n return fontType.fontSizes.large;\n case Enums.TextSize.ExtraLarge:\n return fontType.fontSizes.extraLarge;\n default:\n return fontType.fontSizes.default;\n }\n };\n BaseTextBlock.prototype.getColorDefinition = function (colorSet, color) {\n switch (color) {\n case Enums.TextColor.Accent:\n return colorSet.accent;\n case Enums.TextColor.Dark:\n return colorSet.dark;\n case Enums.TextColor.Light:\n return colorSet.light;\n case Enums.TextColor.Good:\n return colorSet.good;\n case Enums.TextColor.Warning:\n return colorSet.warning;\n case Enums.TextColor.Attention:\n return colorSet.attention;\n default:\n return colorSet.default;\n }\n };\n BaseTextBlock.prototype.setText = function (value) {\n this.setValue(BaseTextBlock.textProperty, value);\n };\n BaseTextBlock.prototype.init = function (textDefinition) {\n this.size = textDefinition.size;\n this.weight = textDefinition.weight;\n this.color = textDefinition.color;\n this.isSubtle = textDefinition.isSubtle;\n };\n BaseTextBlock.prototype.asString = function () {\n return this.text;\n };\n BaseTextBlock.prototype.applyStylesTo = function (targetElement) {\n var fontType = this.hostConfig.getFontTypeDefinition(this.effectiveFontType);\n if (fontType.fontFamily) {\n targetElement.style.fontFamily = fontType.fontFamily;\n }\n var fontSize;\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n fontSize = fontType.fontSizes.small;\n break;\n case Enums.TextSize.Medium:\n fontSize = fontType.fontSizes.medium;\n break;\n case Enums.TextSize.Large:\n fontSize = fontType.fontSizes.large;\n break;\n case Enums.TextSize.ExtraLarge:\n fontSize = fontType.fontSizes.extraLarge;\n break;\n default:\n fontSize = fontType.fontSizes.default;\n break;\n }\n targetElement.style.fontSize = fontSize + \"px\";\n var colorDefinition = this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors, this.effectiveColor);\n targetElement.style.color = Utils.stringToCssColor(this.effectiveIsSubtle ? colorDefinition.subtle : colorDefinition.default);\n var fontWeight;\n switch (this.effectiveWeight) {\n case Enums.TextWeight.Lighter:\n fontWeight = fontType.fontWeights.lighter;\n break;\n case Enums.TextWeight.Bolder:\n fontWeight = fontType.fontWeights.bolder;\n break;\n default:\n fontWeight = fontType.fontWeights.default;\n break;\n }\n targetElement.style.fontWeight = fontWeight.toString();\n if (this.ariaHidden) {\n targetElement.setAttribute(\"aria-hidden\", \"true\");\n }\n };\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveColor\", {\n get: function () {\n return this.color !== undefined ? this.color : this.getEffectiveTextStyleDefinition().color;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveFontType\", {\n get: function () {\n return this.fontType !== undefined ? this.fontType : this.getEffectiveTextStyleDefinition().fontType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveIsSubtle\", {\n get: function () {\n return this.isSubtle !== undefined ? this.isSubtle : this.getEffectiveTextStyleDefinition().isSubtle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveSize\", {\n get: function () {\n return this.size !== undefined ? this.size : this.getEffectiveTextStyleDefinition().size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTextBlock.prototype, \"effectiveWeight\", {\n get: function () {\n return this.weight !== undefined ? this.weight : this.getEffectiveTextStyleDefinition().weight;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n BaseTextBlock.textProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"text\", true);\n BaseTextBlock.sizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"size\", Enums.TextSize);\n BaseTextBlock.weightProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"weight\", Enums.TextWeight);\n BaseTextBlock.colorProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"color\", Enums.TextColor);\n BaseTextBlock.isSubtleProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isSubtle\");\n BaseTextBlock.fontTypeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"fontType\", Enums.FontType);\n BaseTextBlock.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(BaseTextBlock.sizeProperty)\n ], BaseTextBlock.prototype, \"size\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.weightProperty)\n ], BaseTextBlock.prototype, \"weight\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.colorProperty)\n ], BaseTextBlock.prototype, \"color\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.fontTypeProperty)\n ], BaseTextBlock.prototype, \"fontType\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.isSubtleProperty)\n ], BaseTextBlock.prototype, \"isSubtle\", void 0);\n __decorate([\n serialization_1.property(BaseTextBlock.textProperty)\n ], BaseTextBlock.prototype, \"text\", null);\n __decorate([\n serialization_1.property(BaseTextBlock.selectActionProperty)\n ], BaseTextBlock.prototype, \"selectAction\", void 0);\n return BaseTextBlock;\n}(CardElement));\nexports.BaseTextBlock = BaseTextBlock;\nvar TextBlock = /** @class */ (function (_super) {\n __extends(TextBlock, _super);\n function TextBlock() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.wrap = false;\n _this._treatAsPlainText = true;\n _this.useMarkdown = true;\n return _this;\n }\n TextBlock.prototype.restoreOriginalContent = function () {\n if (this.renderedElement !== undefined) {\n if (this.maxLines && this.maxLines > 0) {\n this.renderedElement.style.maxHeight = this._computedLineHeight * this.maxLines + \"px\";\n }\n this.renderedElement.innerHTML = this._originalInnerHtml;\n }\n };\n TextBlock.prototype.truncateIfSupported = function (maxHeight) {\n if (this.renderedElement !== undefined) {\n // For now, only truncate TextBlocks that contain just a single\n // paragraph -- since the maxLines calculation doesn't take into\n // account Markdown lists\n var children = this.renderedElement.children;\n var isTextOnly = !children.length;\n var truncationSupported = isTextOnly || children.length == 1 && children[0].tagName.toLowerCase() == 'p';\n if (truncationSupported) {\n var element = isTextOnly ? this.renderedElement : children[0];\n Utils.truncate(element, maxHeight, this._computedLineHeight);\n return true;\n }\n }\n return false;\n };\n TextBlock.prototype.setText = function (value) {\n _super.prototype.setText.call(this, value);\n this._processedText = undefined;\n };\n TextBlock.prototype.internalRender = function () {\n var _this = this;\n this._processedText = undefined;\n if (this.text) {\n var preProcessedText = this.preProcessPropertyValue(BaseTextBlock.textProperty);\n var hostConfig = this.hostConfig;\n var element = void 0;\n if (this.forElementId) {\n var labelElement = document.createElement(\"label\");\n labelElement.htmlFor = this.forElementId;\n element = labelElement;\n }\n else {\n element = document.createElement(\"div\");\n }\n element.classList.add(hostConfig.makeCssClassName(\"ac-textBlock\"));\n element.style.overflow = \"hidden\";\n this.applyStylesTo(element);\n if (this.style === \"heading\") {\n element.setAttribute(\"role\", \"heading\");\n var headingLevel = this.hostConfig.textBlock.headingLevel;\n if (headingLevel !== undefined && headingLevel > 0) {\n element.setAttribute(\"aria-level\", headingLevel.toString());\n }\n }\n if (this.selectAction && hostConfig.supportsInteractivity) {\n element.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(element);\n if (this.selectAction.isEnabled) {\n element.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n if (!this._processedText) {\n this._treatAsPlainText = true;\n var formattedText = TextFormatters.formatText(this.lang, preProcessedText);\n if (this.useMarkdown && formattedText) {\n if (shared_1.GlobalSettings.allowMarkForTextHighlighting) {\n formattedText = formattedText.replace(//g, \"===\").replace(/<\\/mark>/g, \"/==/\");\n }\n var markdownProcessingResult = AdaptiveCard.applyMarkdown(formattedText);\n if (markdownProcessingResult.didProcess && markdownProcessingResult.outputHtml) {\n this._processedText = markdownProcessingResult.outputHtml;\n this._treatAsPlainText = false;\n // Only process tag if markdown processing was applied because\n // markdown processing is also responsible for sanitizing the input string\n if (shared_1.GlobalSettings.allowMarkForTextHighlighting && this._processedText) {\n var markStyle = \"\";\n var effectiveStyle = this.getEffectiveStyleDefinition();\n if (effectiveStyle.highlightBackgroundColor) {\n markStyle += \"background-color: \" + effectiveStyle.highlightBackgroundColor + \";\";\n }\n if (effectiveStyle.highlightForegroundColor) {\n markStyle += \"color: \" + effectiveStyle.highlightForegroundColor + \";\";\n }\n if (markStyle) {\n markStyle = 'style=\"' + markStyle + '\"';\n }\n this._processedText = this._processedText.replace(/===/g, \"\").replace(/\\/==\\//g, \"\");\n }\n }\n else {\n this._processedText = formattedText;\n this._treatAsPlainText = true;\n }\n }\n else {\n this._processedText = formattedText;\n this._treatAsPlainText = true;\n }\n }\n if (!this._processedText) {\n this._processedText = \"\";\n }\n if (this._treatAsPlainText) {\n element.innerText = this._processedText;\n }\n else {\n element.innerHTML = this._processedText;\n }\n if (element.firstElementChild instanceof HTMLElement) {\n var firstElementChild = element.firstElementChild;\n firstElementChild.style.marginTop = \"0px\";\n firstElementChild.style.width = \"100%\";\n if (!this.wrap) {\n firstElementChild.style.overflow = \"hidden\";\n firstElementChild.style.textOverflow = \"ellipsis\";\n }\n }\n if (element.lastElementChild instanceof HTMLElement) {\n element.lastElementChild.style.marginBottom = \"0px\";\n }\n var anchors = element.getElementsByTagName(\"a\");\n for (var i = 0; i < anchors.length; i++) {\n var anchor = anchors[i];\n anchor.classList.add(hostConfig.makeCssClassName(\"ac-anchor\"));\n anchor.target = \"_blank\";\n anchor.onclick = function (e) {\n if (raiseAnchorClickedEvent(_this, e.target, e)) {\n e.preventDefault();\n e.cancelBubble = true;\n }\n };\n anchor.oncontextmenu = function (e) {\n if (raiseAnchorClickedEvent(_this, e.target, e)) {\n e.preventDefault();\n e.cancelBubble = true;\n return false;\n }\n return true;\n };\n }\n if (this.wrap) {\n element.style.wordWrap = \"break-word\";\n if (this.maxLines && this.maxLines > 0) {\n element.style.overflow = \"hidden\";\n if (Utils.isInternetExplorer() || !shared_1.GlobalSettings.useWebkitLineClamp) {\n element.style.maxHeight = (this._computedLineHeight * this.maxLines) + \"px\";\n }\n else {\n // While non standard, --webkit-line-clamp works in every browser (except IE)\n // and is a great solution to support the maxLines feature with ellipsis\n // truncation. With --webkit-line-clamp there is need to use explicit line heights\n element.style.removeProperty(\"line-height\");\n element.style.display = \"-webkit-box\";\n element.style.webkitBoxOrient = \"vertical\";\n element.style.webkitLineClamp = this.maxLines.toString();\n }\n }\n }\n else {\n element.style.whiteSpace = \"nowrap\";\n element.style.textOverflow = \"ellipsis\";\n }\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation || shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n this._originalInnerHtml = element.innerHTML;\n }\n return element;\n }\n else {\n return undefined;\n }\n };\n TextBlock.prototype.truncateOverflow = function (maxHeight) {\n if (maxHeight >= this._computedLineHeight) {\n return this.truncateIfSupported(maxHeight);\n }\n return false;\n };\n TextBlock.prototype.undoOverflowTruncation = function () {\n this.restoreOriginalContent();\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation && this.maxLines) {\n var maxHeight = this._computedLineHeight * this.maxLines;\n this.truncateIfSupported(maxHeight);\n }\n };\n TextBlock.prototype.applyStylesTo = function (targetElement) {\n _super.prototype.applyStylesTo.call(this, targetElement);\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n targetElement.style.textAlign = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n targetElement.style.textAlign = \"end\";\n break;\n default:\n targetElement.style.textAlign = \"start\";\n break;\n }\n var lineHeights = this.hostConfig.lineHeights;\n if (lineHeights) {\n switch (this.effectiveSize) {\n case Enums.TextSize.Small:\n this._computedLineHeight = lineHeights.small;\n break;\n case Enums.TextSize.Medium:\n this._computedLineHeight = lineHeights.medium;\n break;\n case Enums.TextSize.Large:\n this._computedLineHeight = lineHeights.large;\n break;\n case Enums.TextSize.ExtraLarge:\n this._computedLineHeight = lineHeights.extraLarge;\n break;\n default:\n this._computedLineHeight = lineHeights.default;\n break;\n }\n }\n else {\n // Looks like 1.33 is the magic number to compute line-height\n // from font size.\n this._computedLineHeight = this.getFontSize(this.hostConfig.getFontTypeDefinition(this.effectiveFontType)) * 1.33;\n }\n targetElement.style.lineHeight = this._computedLineHeight + \"px\";\n };\n TextBlock.prototype.getJsonTypeName = function () {\n return \"TextBlock\";\n };\n TextBlock.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.style) {\n return this.hostConfig.textStyles.getStyleByName(this.style);\n }\n return _super.prototype.getEffectiveTextStyleDefinition.call(this);\n };\n TextBlock.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = false; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (shared_1.GlobalSettings.useAdvancedTextBlockTruncation && this.maxLines && this.isDisplayed()) {\n // Reset the element's innerHTML in case the available room for\n // content has increased\n this.restoreOriginalContent();\n this.truncateIfSupported(this._computedLineHeight * this.maxLines);\n }\n };\n TextBlock.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"wrap\", false);\n TextBlock.maxLinesProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"maxLines\");\n TextBlock.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_5, \"style\", [\n { value: \"default\" },\n { value: \"columnHeader\" },\n { value: \"heading\" }\n ]);\n __decorate([\n serialization_1.property(TextBlock.wrapProperty)\n ], TextBlock.prototype, \"wrap\", void 0);\n __decorate([\n serialization_1.property(TextBlock.maxLinesProperty)\n ], TextBlock.prototype, \"maxLines\", void 0);\n __decorate([\n serialization_1.property(TextBlock.styleProperty)\n ], TextBlock.prototype, \"style\", void 0);\n return TextBlock;\n}(BaseTextBlock));\nexports.TextBlock = TextBlock;\nvar TextRun = /** @class */ (function (_super) {\n __extends(TextRun, _super);\n function TextRun() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.italic = false;\n _this.strikethrough = false;\n _this.highlight = false;\n _this.underline = false;\n return _this;\n }\n TextRun.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.add(BaseTextBlock.selectActionProperty);\n };\n //#endregion\n TextRun.prototype.internalRender = function () {\n var _this = this;\n if (this.text) {\n var preProcessedText = this.preProcessPropertyValue(BaseTextBlock.textProperty);\n var hostConfig = this.hostConfig;\n var formattedText = TextFormatters.formatText(this.lang, preProcessedText);\n if (!formattedText) {\n formattedText = \"\";\n }\n var element = document.createElement(\"span\");\n element.classList.add(hostConfig.makeCssClassName(\"ac-textRun\"));\n this.applyStylesTo(element);\n if (this.selectAction && hostConfig.supportsInteractivity) {\n var anchor = document.createElement(\"a\");\n anchor.classList.add(hostConfig.makeCssClassName(\"ac-anchor\"));\n var href = this.selectAction.getHref();\n anchor.href = href ? href : \"\";\n anchor.target = \"_blank\";\n anchor.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(anchor);\n anchor.innerText = formattedText;\n element.appendChild(anchor);\n }\n else {\n element.innerText = formattedText;\n }\n return element;\n }\n else {\n return undefined;\n }\n };\n TextRun.prototype.applyStylesTo = function (targetElement) {\n _super.prototype.applyStylesTo.call(this, targetElement);\n if (this.italic) {\n targetElement.style.fontStyle = \"italic\";\n }\n if (this.strikethrough) {\n targetElement.style.textDecoration = \"line-through\";\n }\n if (this.highlight) {\n var colorDefinition = this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors, this.effectiveColor);\n targetElement.style.backgroundColor = Utils.stringToCssColor(this.effectiveIsSubtle ? colorDefinition.highlightColors.subtle : colorDefinition.highlightColors.default);\n }\n if (this.underline) {\n targetElement.style.textDecoration = \"underline\";\n }\n };\n TextRun.prototype.getJsonTypeName = function () {\n return \"TextRun\";\n };\n Object.defineProperty(TextRun.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextRun.prototype, \"isInline\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n TextRun.italicProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"italic\", false);\n TextRun.strikethroughProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"strikethrough\", false);\n TextRun.highlightProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"highlight\", false);\n TextRun.underlineProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"underline\", false);\n __decorate([\n serialization_1.property(TextRun.italicProperty)\n ], TextRun.prototype, \"italic\", void 0);\n __decorate([\n serialization_1.property(TextRun.strikethroughProperty)\n ], TextRun.prototype, \"strikethrough\", void 0);\n __decorate([\n serialization_1.property(TextRun.highlightProperty)\n ], TextRun.prototype, \"highlight\", void 0);\n __decorate([\n serialization_1.property(TextRun.underlineProperty)\n ], TextRun.prototype, \"underline\", void 0);\n return TextRun;\n}(BaseTextBlock));\nexports.TextRun = TextRun;\nvar RichTextBlock = /** @class */ (function (_super) {\n __extends(RichTextBlock, _super);\n function RichTextBlock() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._inlines = [];\n return _this;\n }\n RichTextBlock.prototype.internalAddInline = function (inline, forceAdd) {\n if (forceAdd === void 0) { forceAdd = false; }\n if (!inline.isInline) {\n throw new Error(strings_1.Strings.errors.elementCannotBeUsedAsInline());\n }\n var doAdd = inline.parent === undefined || forceAdd;\n if (!doAdd && inline.parent != this) {\n throw new Error(strings_1.Strings.errors.inlineAlreadyParented());\n }\n else {\n inline.setParent(this);\n this._inlines.push(inline);\n }\n };\n RichTextBlock.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._inlines = [];\n if (Array.isArray(source[\"inlines\"])) {\n for (var _i = 0, _a = source[\"inlines\"]; _i < _a.length; _i++) {\n var jsonInline = _a[_i];\n var inline = void 0;\n if (typeof jsonInline === \"string\") {\n var textRun = new TextRun();\n textRun.text = jsonInline;\n inline = textRun;\n }\n else {\n // No fallback for inlines in 1.2\n inline = context.parseElement(this, jsonInline, false);\n }\n if (inline) {\n this.internalAddInline(inline, true);\n }\n }\n }\n };\n RichTextBlock.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n if (this._inlines.length > 0) {\n var jsonInlines = [];\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n jsonInlines.push(inline.toJSON(context));\n }\n context.serializeValue(target, \"inlines\", jsonInlines);\n }\n };\n RichTextBlock.prototype.internalRender = function () {\n if (this._inlines.length > 0) {\n var element = void 0;\n if (this.forElementId) {\n var labelElement = document.createElement(\"label\");\n labelElement.htmlFor = this.forElementId;\n element = labelElement;\n }\n else {\n element = document.createElement(\"div\");\n }\n element.className = this.hostConfig.makeCssClassName(\"ac-richTextBlock\");\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.textAlign = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.textAlign = \"end\";\n break;\n default:\n element.style.textAlign = \"start\";\n break;\n }\n var renderedInlines = 0;\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n var renderedInline = inline.render();\n if (renderedInline) {\n element.appendChild(renderedInline);\n renderedInlines++;\n }\n }\n if (renderedInlines > 0) {\n return element;\n }\n }\n return undefined;\n };\n RichTextBlock.prototype.asString = function () {\n var result = \"\";\n for (var _i = 0, _a = this._inlines; _i < _a.length; _i++) {\n var inline = _a[_i];\n result += inline.asString();\n }\n return result;\n };\n RichTextBlock.prototype.getJsonTypeName = function () {\n return \"RichTextBlock\";\n };\n RichTextBlock.prototype.getInlineCount = function () {\n return this._inlines.length;\n };\n RichTextBlock.prototype.getInlineAt = function (index) {\n if (index >= 0 && index < this._inlines.length) {\n return this._inlines[index];\n }\n else {\n throw new Error(strings_1.Strings.errors.indexOutOfRange(index));\n }\n };\n RichTextBlock.prototype.addInline = function (inline) {\n if (typeof inline === \"string\") {\n this.internalAddInline(new TextRun(inline));\n }\n else {\n this.internalAddInline(inline);\n }\n };\n RichTextBlock.prototype.removeInline = function (inline) {\n var index = this._inlines.indexOf(inline);\n if (index >= 0) {\n this._inlines[index].setParent(undefined);\n this._inlines.splice(index, 1);\n return true;\n }\n return false;\n };\n return RichTextBlock;\n}(CardElement));\nexports.RichTextBlock = RichTextBlock;\nvar Fact = /** @class */ (function (_super) {\n __extends(Fact, _super);\n function Fact(name, value) {\n var _this = _super.call(this) || this;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n //#endregion\n Fact.prototype.getSchemaKey = function () {\n return \"Fact\";\n };\n //#region Schema\n Fact.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Fact.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(Fact.titleProperty)\n ], Fact.prototype, \"name\", void 0);\n __decorate([\n serialization_1.property(Fact.valueProperty)\n ], Fact.prototype, \"value\", void 0);\n return Fact;\n}(serialization_1.SerializableObject));\nexports.Fact = Fact;\nvar FactSet = /** @class */ (function (_super) {\n __extends(FactSet, _super);\n function FactSet() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(FactSet.prototype, \"useDefaultSizing\", {\n //#endregion\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n FactSet.prototype.internalRender = function () {\n var element = undefined;\n var hostConfig = this.hostConfig;\n if (this.facts.length > 0) {\n element = document.createElement(\"table\");\n element.style.borderWidth = \"0px\";\n element.style.borderSpacing = \"0px\";\n element.style.borderStyle = \"none\";\n element.style.borderCollapse = \"collapse\";\n element.style.display = \"block\";\n element.style.overflow = \"hidden\";\n element.classList.add(hostConfig.makeCssClassName(\"ac-factset\"));\n element.setAttribute(\"role\", \"presentation\");\n for (var i = 0; i < this.facts.length; i++) {\n var trElement = document.createElement(\"tr\");\n if (i > 0) {\n trElement.style.marginTop = hostConfig.factSet.spacing + \"px\";\n }\n // Title column\n var tdElement = document.createElement(\"td\");\n tdElement.style.padding = \"0\";\n tdElement.classList.add(hostConfig.makeCssClassName(\"ac-fact-title\"));\n if (hostConfig.factSet.title.maxWidth) {\n tdElement.style.maxWidth = hostConfig.factSet.title.maxWidth + \"px\";\n }\n tdElement.style.verticalAlign = \"top\";\n var textBlock = new TextBlock();\n textBlock.setParent(this);\n textBlock.text = (!this.facts[i].name && this.isDesignMode()) ? \"Title\" : this.facts[i].name;\n textBlock.size = hostConfig.factSet.title.size;\n textBlock.color = hostConfig.factSet.title.color;\n textBlock.isSubtle = hostConfig.factSet.title.isSubtle;\n textBlock.weight = hostConfig.factSet.title.weight;\n textBlock.wrap = hostConfig.factSet.title.wrap;\n textBlock.spacing = Enums.Spacing.None;\n Utils.appendChild(tdElement, textBlock.render());\n Utils.appendChild(trElement, tdElement);\n // Spacer column\n tdElement = document.createElement(\"td\");\n tdElement.style.width = \"10px\";\n Utils.appendChild(trElement, tdElement);\n // Value column\n tdElement = document.createElement(\"td\");\n tdElement.style.padding = \"0\";\n tdElement.style.verticalAlign = \"top\";\n tdElement.classList.add(hostConfig.makeCssClassName(\"ac-fact-value\"));\n textBlock = new TextBlock();\n textBlock.setParent(this);\n textBlock.text = this.facts[i].value;\n textBlock.size = hostConfig.factSet.value.size;\n textBlock.color = hostConfig.factSet.value.color;\n textBlock.isSubtle = hostConfig.factSet.value.isSubtle;\n textBlock.weight = hostConfig.factSet.value.weight;\n textBlock.wrap = hostConfig.factSet.value.wrap;\n textBlock.spacing = Enums.Spacing.None;\n Utils.appendChild(tdElement, textBlock.render());\n Utils.appendChild(trElement, tdElement);\n Utils.appendChild(element, trElement);\n }\n }\n return element;\n };\n FactSet.prototype.getJsonTypeName = function () {\n return \"FactSet\";\n };\n //#region Schema\n FactSet.factsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"facts\", Fact);\n __decorate([\n serialization_1.property(FactSet.factsProperty)\n ], FactSet.prototype, \"facts\", void 0);\n return FactSet;\n}(CardElement));\nexports.FactSet = FactSet;\nvar ImageDimensionProperty = /** @class */ (function (_super) {\n __extends(ImageDimensionProperty, _super);\n function ImageDimensionProperty(targetVersion, name, internalName, fallbackProperty) {\n var _this = _super.call(this, targetVersion, name) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.internalName = internalName;\n _this.fallbackProperty = fallbackProperty;\n return _this;\n }\n ImageDimensionProperty.prototype.getInternalName = function () {\n return this.internalName;\n };\n ImageDimensionProperty.prototype.parse = function (sender, source, context) {\n var result = undefined;\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.defaultValue;\n }\n var isValid = false;\n if (typeof sourceValue === \"string\") {\n try {\n var size = shared_1.SizeAndUnit.parse(sourceValue, true);\n if (size.unit == Enums.SizeUnit.Pixel) {\n result = size.physicalSize;\n isValid = true;\n }\n }\n catch (_a) {\n // Swallow the exception\n }\n // If the source value isn't valid per this property definition,\n // check its validity per the fallback property, if specified\n if (!isValid && this.fallbackProperty) {\n isValid = this.fallbackProperty.isValidValue(sourceValue, context);\n }\n }\n if (!isValid) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n }\n return result;\n };\n ImageDimensionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, typeof value === \"number\" && !isNaN(value) ? value + \"px\" : undefined);\n };\n return ImageDimensionProperty;\n}(serialization_1.PropertyDefinition));\nvar Image = /** @class */ (function (_super) {\n __extends(Image, _super);\n function Image() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.size = Enums.Size.Auto;\n _this.style = Enums.ImageStyle.Default;\n return _this;\n }\n Image.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.remove(CardElement.heightProperty);\n };\n //#endregion\n Image.prototype.applySize = function (element) {\n if (this.pixelWidth || this.pixelHeight) {\n if (this.pixelWidth) {\n element.style.width = this.pixelWidth + \"px\";\n }\n if (this.pixelHeight) {\n element.style.height = this.pixelHeight + \"px\";\n }\n }\n else {\n if (this.maxHeight) {\n // If the image is constrained in height, we set its height property and\n // auto and stretch are ignored (default to medium). THis is necessary for\n // ImageSet which uses a maximum image height as opposed to the cards width\n // as a constraining dimension\n switch (this.size) {\n case Enums.Size.Small:\n element.style.height = this.hostConfig.imageSizes.small + \"px\";\n break;\n case Enums.Size.Large:\n element.style.height = this.hostConfig.imageSizes.large + \"px\";\n break;\n default:\n element.style.height = this.hostConfig.imageSizes.medium + \"px\";\n break;\n }\n element.style.maxHeight = this.maxHeight + \"px\";\n }\n else {\n switch (this.size) {\n case Enums.Size.Stretch:\n element.style.width = \"100%\";\n break;\n case Enums.Size.Auto:\n element.style.maxWidth = \"100%\";\n break;\n case Enums.Size.Small:\n element.style.width = this.hostConfig.imageSizes.small + \"px\";\n break;\n case Enums.Size.Large:\n element.style.width = this.hostConfig.imageSizes.large + \"px\";\n break;\n case Enums.Size.Medium:\n element.style.width = this.hostConfig.imageSizes.medium + \"px\";\n break;\n }\n element.style.maxHeight = \"100%\";\n }\n }\n };\n Object.defineProperty(Image.prototype, \"useDefaultSizing\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Image.prototype.internalRender = function () {\n var _this = this;\n var element = undefined;\n if (this.url) {\n element = document.createElement(\"div\");\n element.style.display = \"flex\";\n element.style.alignItems = \"flex-start\";\n // Cache hostConfig to avoid walking the parent hierarchy multiple times\n var hostConfig = this.hostConfig;\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n var imageElement = document.createElement(\"img\");\n imageElement.onload = function (e) {\n raiseImageLoadedEvent(_this);\n };\n imageElement.onerror = function (e) {\n if (_this.renderedElement) {\n var card = _this.getRootElement();\n _this.renderedElement.innerHTML = \"\";\n if (card && card.designMode) {\n var errorElement = document.createElement(\"div\");\n errorElement.style.display = \"flex\";\n errorElement.style.alignItems = \"center\";\n errorElement.style.justifyContent = \"center\";\n errorElement.style.backgroundColor = \"#EEEEEE\";\n errorElement.style.color = \"black\";\n errorElement.innerText = \":-(\";\n errorElement.style.padding = \"10px\";\n _this.applySize(errorElement);\n _this.renderedElement.appendChild(errorElement);\n }\n }\n raiseImageLoadedEvent(_this);\n };\n imageElement.style.minWidth = \"0\";\n imageElement.classList.add(hostConfig.makeCssClassName(\"ac-image\"));\n if (this.selectAction && hostConfig.supportsInteractivity) {\n imageElement.onkeypress = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled && (e.code == \"Enter\" || e.code == \"Space\")) { // enter or space pressed\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n imageElement.onclick = function (e) {\n if (_this.selectAction && _this.selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.selectAction.execute();\n }\n };\n this.selectAction.setupElementForAccessibility(imageElement);\n if (this.selectAction.isEnabled) {\n imageElement.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n this.applySize(imageElement);\n if (this.style === Enums.ImageStyle.Person) {\n imageElement.style.borderRadius = \"50%\";\n imageElement.style.backgroundPosition = \"50% 50%\";\n imageElement.style.backgroundRepeat = \"no-repeat\";\n }\n imageElement.style.backgroundColor = Utils.stringToCssColor(this.backgroundColor);\n imageElement.src = this.preProcessPropertyValue(Image.urlProperty);\n var altTextProperty = this.preProcessPropertyValue(Image.altTextProperty);\n if (altTextProperty) {\n imageElement.alt = altTextProperty;\n }\n element.appendChild(imageElement);\n }\n return element;\n };\n Image.prototype.getJsonTypeName = function () {\n return \"Image\";\n };\n Image.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result && this.selectAction) {\n result = this.selectAction.getActionById(id);\n }\n return result;\n };\n Image.prototype.getResourceInformation = function () {\n return this.url ? [{ url: this.url, mimeType: \"image\" }] : [];\n };\n Image.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n Image.altTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"altText\");\n Image.backgroundColorProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"backgroundColor\");\n Image.styleProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"style\", Enums.ImageStyle, Enums.ImageStyle.Default);\n Image.sizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"size\", Enums.Size, Enums.Size.Auto);\n Image.pixelWidthProperty = new ImageDimensionProperty(serialization_1.Versions.v1_1, \"width\", \"pixelWidth\");\n Image.pixelHeightProperty = new ImageDimensionProperty(serialization_1.Versions.v1_1, \"height\", \"pixelHeight\", CardElement.heightProperty);\n Image.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(Image.urlProperty)\n ], Image.prototype, \"url\", void 0);\n __decorate([\n serialization_1.property(Image.altTextProperty)\n ], Image.prototype, \"altText\", void 0);\n __decorate([\n serialization_1.property(Image.backgroundColorProperty)\n ], Image.prototype, \"backgroundColor\", void 0);\n __decorate([\n serialization_1.property(Image.sizeProperty)\n ], Image.prototype, \"size\", void 0);\n __decorate([\n serialization_1.property(Image.styleProperty)\n ], Image.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(Image.pixelWidthProperty)\n ], Image.prototype, \"pixelWidth\", void 0);\n __decorate([\n serialization_1.property(Image.pixelHeightProperty)\n ], Image.prototype, \"pixelHeight\", void 0);\n __decorate([\n serialization_1.property(Image.selectActionProperty)\n ], Image.prototype, \"selectAction\", void 0);\n return Image;\n}(CardElement));\nexports.Image = Image;\nvar CardElementContainer = /** @class */ (function (_super) {\n __extends(CardElementContainer, _super);\n function CardElementContainer() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.allowVerticalOverflow = false;\n return _this;\n }\n CardElementContainer.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n if (!this.isSelectable) {\n schema.remove(CardElementContainer.selectActionProperty);\n }\n };\n //#endregion\n CardElementContainer.prototype.isElementAllowed = function (element) {\n return this.hostConfig.supportsInteractivity || !element.isInteractive;\n };\n CardElementContainer.prototype.applyPadding = function () {\n _super.prototype.applyPadding.call(this);\n if (!this.renderedElement) {\n return;\n }\n var physicalPadding = new shared_1.SpacingDefinition();\n if (this.getEffectivePadding()) {\n physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding());\n }\n this.renderedElement.style.paddingTop = physicalPadding.top + \"px\";\n this.renderedElement.style.paddingRight = physicalPadding.right + \"px\";\n this.renderedElement.style.paddingBottom = physicalPadding.bottom + \"px\";\n this.renderedElement.style.paddingLeft = physicalPadding.left + \"px\";\n this.renderedElement.style.marginRight = \"0\";\n this.renderedElement.style.marginLeft = \"0\";\n };\n Object.defineProperty(CardElementContainer.prototype, \"isSelectable\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n CardElementContainer.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n for (var i = 0; i < this.getItemCount(); i++) {\n var item = this.getItemAt(i);\n if (!this.hostConfig.supportsInteractivity && item.isInteractive) {\n context.addFailure(this, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.interactivityNotAllowed());\n }\n if (!this.isElementAllowed(item)) {\n context.addFailure(this, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(item.getJsonTypeName()));\n }\n item.internalValidateProperties(context);\n }\n if (this._selectAction) {\n this._selectAction.internalValidateProperties(context);\n }\n };\n CardElementContainer.prototype.render = function () {\n var _this = this;\n var element = _super.prototype.render.call(this);\n if (element) {\n var hostConfig = this.hostConfig;\n if (this.allowVerticalOverflow) {\n element.style.overflowX = \"hidden\";\n element.style.overflowY = \"auto\";\n }\n if (element && this.isSelectable && this._selectAction && hostConfig.supportsInteractivity) {\n element.onclick = function (e) {\n if (_this._selectAction && _this._selectAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this._selectAction.execute();\n }\n };\n element.onkeypress = function (e) {\n if (_this._selectAction && _this._selectAction.isEnabled && (e.code == \"Enter\" || e.code == \"Space\")) {\n // Enter or space pressed\n e.preventDefault();\n e.cancelBubble = true;\n _this._selectAction.execute();\n }\n };\n this._selectAction.setupElementForAccessibility(element);\n if (this._selectAction.isEnabled) {\n element.classList.add(hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n }\n }\n return element;\n };\n CardElementContainer.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (processChildren) {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).updateLayout();\n }\n }\n };\n CardElementContainer.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = [];\n for (var i = 0; i < this.getItemCount(); i++) {\n result = result.concat(this.getItemAt(i).getAllInputs(processActions));\n }\n return result;\n };\n CardElementContainer.prototype.getResourceInformation = function () {\n var result = [];\n for (var i = 0; i < this.getItemCount(); i++) {\n result = result.concat(this.getItemAt(i).getResourceInformation());\n }\n return result;\n };\n CardElementContainer.prototype.getElementById = function (id) {\n var result = _super.prototype.getElementById.call(this, id);\n if (!result) {\n for (var i = 0; i < this.getItemCount(); i++) {\n result = this.getItemAt(i).getElementById(id);\n if (result) {\n break;\n }\n }\n }\n return result;\n };\n /**\n * @inheritdoc\n */\n CardElementContainer.prototype.findDOMNodeOwner = function (node) {\n var target = undefined;\n for (var i = 0; i < this.getItemCount(); i++) {\n // recur through child elements\n target = this.getItemAt(i).findDOMNodeOwner(node);\n if (target) {\n return target;\n }\n }\n // if not found in children, defer to parent implementation\n return _super.prototype.findDOMNodeOwner.call(this, node);\n };\n CardElementContainer.selectActionProperty = new ActionProperty(serialization_1.Versions.v1_1, \"selectAction\", [\"Action.ShowCard\"]);\n __decorate([\n serialization_1.property(CardElementContainer.selectActionProperty)\n ], CardElementContainer.prototype, \"_selectAction\", void 0);\n return CardElementContainer;\n}(CardElement));\nexports.CardElementContainer = CardElementContainer;\nvar ImageSet = /** @class */ (function (_super) {\n __extends(ImageSet, _super);\n function ImageSet() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._images = [];\n _this.imageSize = Enums.ImageSize.Medium;\n return _this;\n }\n //#endregion\n ImageSet.prototype.internalRender = function () {\n var element = undefined;\n if (this._images.length > 0) {\n element = document.createElement(\"div\");\n element.style.display = \"flex\";\n element.style.flexWrap = \"wrap\";\n for (var _i = 0, _a = this._images; _i < _a.length; _i++) {\n var image = _a[_i];\n switch (this.imageSize) {\n case Enums.ImageSize.Small:\n image.size = Enums.Size.Small;\n break;\n case Enums.ImageSize.Large:\n image.size = Enums.Size.Large;\n break;\n default:\n image.size = Enums.Size.Medium;\n break;\n }\n image.maxHeight = this.hostConfig.imageSet.maxImageHeight;\n var renderedImage = image.render();\n if (renderedImage) {\n renderedImage.style.display = \"inline-flex\";\n renderedImage.style.margin = \"0px\";\n renderedImage.style.marginRight = \"10px\";\n Utils.appendChild(element, renderedImage);\n }\n }\n }\n return element;\n };\n ImageSet.prototype.getItemCount = function () {\n return this._images.length;\n };\n ImageSet.prototype.getItemAt = function (index) {\n return this._images[index];\n };\n ImageSet.prototype.getFirstVisibleRenderedItem = function () {\n return this._images && this._images.length > 0 ? this._images[0] : undefined;\n };\n ImageSet.prototype.getLastVisibleRenderedItem = function () {\n return this._images && this._images.length > 0 ? this._images[this._images.length - 1] : undefined;\n };\n ImageSet.prototype.removeItem = function (item) {\n if (item instanceof Image) {\n var itemIndex = this._images.indexOf(item);\n if (itemIndex >= 0) {\n this._images.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n }\n return false;\n };\n ImageSet.prototype.getJsonTypeName = function () {\n return \"ImageSet\";\n };\n ImageSet.prototype.addImage = function (image) {\n if (!image.parent) {\n this._images.push(image);\n image.setParent(this);\n }\n else {\n throw new Error(\"This image already belongs to another ImageSet\");\n }\n };\n ImageSet.prototype.indexOf = function (cardElement) {\n return cardElement instanceof Image ? this._images.indexOf(cardElement) : -1;\n };\n ImageSet.imagesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"images\", Image, function (sender, item) { item.setParent(sender); });\n ImageSet.imageSizeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"imageSize\", Enums.ImageSize, Enums.ImageSize.Medium);\n __decorate([\n serialization_1.property(ImageSet.imagesProperty)\n ], ImageSet.prototype, \"_images\", void 0);\n __decorate([\n serialization_1.property(ImageSet.imageSizeProperty)\n ], ImageSet.prototype, \"imageSize\", void 0);\n return ImageSet;\n}(CardElementContainer));\nexports.ImageSet = ImageSet;\nvar MediaSource = /** @class */ (function (_super) {\n __extends(MediaSource, _super);\n function MediaSource(url, mimeType) {\n var _this = _super.call(this) || this;\n _this.url = url;\n _this.mimeType = mimeType;\n return _this;\n }\n //#endregion\n MediaSource.prototype.getSchemaKey = function () {\n return \"MediaSource\";\n };\n MediaSource.prototype.isValid = function () {\n return this.mimeType && this.url ? true : false;\n };\n MediaSource.prototype.render = function () {\n var result = undefined;\n if (this.isValid()) {\n result = document.createElement(\"source\");\n result.src = this.url;\n result.type = this.mimeType;\n }\n return result;\n };\n //#region Schema\n MediaSource.mimeTypeProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"mimeType\");\n MediaSource.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"url\");\n __decorate([\n serialization_1.property(MediaSource.mimeTypeProperty)\n ], MediaSource.prototype, \"mimeType\", void 0);\n __decorate([\n serialization_1.property(MediaSource.urlProperty)\n ], MediaSource.prototype, \"url\", void 0);\n return MediaSource;\n}(serialization_1.SerializableObject));\nexports.MediaSource = MediaSource;\nvar Media = /** @class */ (function (_super) {\n __extends(Media, _super);\n function Media() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.sources = [];\n return _this;\n }\n Media.prototype.getPosterUrl = function () {\n return this.poster ? this.poster : this.hostConfig.media.defaultPoster;\n };\n Media.prototype.processSources = function () {\n this._selectedSources = [];\n this._selectedMediaType = undefined;\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var source = _a[_i];\n var mimeComponents = source.mimeType ? source.mimeType.split('/') : [];\n if (mimeComponents.length == 2) {\n if (!this._selectedMediaType) {\n var index = Media.supportedMediaTypes.indexOf(mimeComponents[0]);\n if (index >= 0) {\n this._selectedMediaType = Media.supportedMediaTypes[index];\n }\n }\n if (mimeComponents[0] == this._selectedMediaType) {\n this._selectedSources.push(source);\n }\n }\n }\n };\n Media.prototype.handlePlayButtonInvoke = function (event) {\n if (this.hostConfig.media.allowInlinePlayback) {\n event.preventDefault();\n event.cancelBubble = true;\n if (this.renderedElement) {\n var mediaPlayerElement = this.renderMediaPlayer();\n this.renderedElement.innerHTML = \"\";\n this.renderedElement.appendChild(mediaPlayerElement);\n mediaPlayerElement.play();\n mediaPlayerElement.focus();\n }\n }\n else {\n if (Media.onPlay) {\n event.preventDefault();\n event.cancelBubble = true;\n Media.onPlay(this);\n }\n }\n };\n Media.prototype.renderPoster = function () {\n var _this = this;\n var playButtonArrowWidth = 12;\n var playButtonArrowHeight = 15;\n var posterRootElement = document.createElement(\"div\");\n posterRootElement.className = this.hostConfig.makeCssClassName(\"ac-media-poster\");\n posterRootElement.setAttribute(\"role\", \"contentinfo\");\n posterRootElement.setAttribute(\"aria-label\", this.altText ? this.altText : strings_1.Strings.defaults.mediaPlayerAriaLabel());\n posterRootElement.style.position = \"relative\";\n posterRootElement.style.display = \"flex\";\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n var posterImageElement_1 = document.createElement(\"img\");\n posterImageElement_1.style.width = \"100%\";\n posterImageElement_1.style.height = \"100%\";\n posterImageElement_1.setAttribute(\"role\", \"presentation\");\n posterImageElement_1.onerror = function (e) {\n if (posterImageElement_1.parentNode) {\n posterImageElement_1.parentNode.removeChild(posterImageElement_1);\n }\n posterRootElement.classList.add(\"empty\");\n posterRootElement.style.minHeight = \"150px\";\n };\n posterImageElement_1.src = posterUrl;\n posterRootElement.appendChild(posterImageElement_1);\n }\n else {\n posterRootElement.classList.add(\"empty\");\n posterRootElement.style.minHeight = \"150px\";\n }\n if (this.hostConfig.supportsInteractivity && this._selectedSources.length > 0) {\n var playButtonOuterElement = document.createElement(\"div\");\n playButtonOuterElement.tabIndex = 0;\n playButtonOuterElement.setAttribute(\"role\", \"button\");\n playButtonOuterElement.setAttribute(\"aria-label\", strings_1.Strings.defaults.mediaPlayerPlayMedia());\n playButtonOuterElement.className = this.hostConfig.makeCssClassName(\"ac-media-playButton\");\n playButtonOuterElement.style.display = \"flex\";\n playButtonOuterElement.style.alignItems = \"center\";\n playButtonOuterElement.style.justifyContent = \"center\";\n playButtonOuterElement.onclick = function (e) {\n _this.handlePlayButtonInvoke(e);\n };\n playButtonOuterElement.onkeypress = function (e) {\n if (e.code == \"Enter\" || e.code == \"Space\") { // space or enter\n _this.handlePlayButtonInvoke(e);\n }\n };\n var playButtonInnerElement = document.createElement(\"div\");\n playButtonInnerElement.className = this.hostConfig.makeCssClassName(\"ac-media-playButton-arrow\");\n playButtonInnerElement.style.width = playButtonArrowWidth + \"px\";\n playButtonInnerElement.style.height = playButtonArrowHeight + \"px\";\n playButtonInnerElement.style.borderTopWidth = (playButtonArrowHeight / 2) + \"px\";\n playButtonInnerElement.style.borderBottomWidth = (playButtonArrowHeight / 2) + \"px\";\n playButtonInnerElement.style.borderLeftWidth = playButtonArrowWidth + \"px\";\n playButtonInnerElement.style.borderRightWidth = \"0\";\n playButtonInnerElement.style.borderStyle = \"solid\";\n playButtonInnerElement.style.borderTopColor = \"transparent\";\n playButtonInnerElement.style.borderRightColor = \"transparent\";\n playButtonInnerElement.style.borderBottomColor = \"transparent\";\n playButtonInnerElement.style.transform = \"translate(\" + (playButtonArrowWidth / 10) + \"px,0px)\";\n playButtonOuterElement.appendChild(playButtonInnerElement);\n var playButtonContainer = document.createElement(\"div\");\n playButtonContainer.style.position = \"absolute\";\n playButtonContainer.style.left = \"0\";\n playButtonContainer.style.top = \"0\";\n playButtonContainer.style.width = \"100%\";\n playButtonContainer.style.height = \"100%\";\n playButtonContainer.style.display = \"flex\";\n playButtonContainer.style.justifyContent = \"center\";\n playButtonContainer.style.alignItems = \"center\";\n playButtonContainer.appendChild(playButtonOuterElement);\n posterRootElement.appendChild(playButtonContainer);\n }\n return posterRootElement;\n };\n Media.prototype.renderMediaPlayer = function () {\n var mediaElement;\n if (this._selectedMediaType == \"video\") {\n var videoPlayer = document.createElement(\"video\");\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n videoPlayer.poster = posterUrl;\n }\n mediaElement = videoPlayer;\n }\n else {\n mediaElement = document.createElement(\"audio\");\n }\n mediaElement.setAttribute(\"aria-label\", this.altText ? this.altText : strings_1.Strings.defaults.mediaPlayerAriaLabel());\n mediaElement.setAttribute(\"webkit-playsinline\", \"\");\n mediaElement.setAttribute(\"playsinline\", \"\");\n mediaElement.autoplay = true;\n mediaElement.controls = true;\n if (Utils.isMobileOS()) {\n mediaElement.muted = true;\n }\n mediaElement.preload = \"none\";\n mediaElement.style.width = \"100%\";\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var source = _a[_i];\n var renderedSource = source.render();\n Utils.appendChild(mediaElement, renderedSource);\n }\n return mediaElement;\n };\n Media.prototype.internalRender = function () {\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-media\");\n this.processSources();\n element.appendChild(this.renderPoster());\n return element;\n };\n Media.prototype.getJsonTypeName = function () {\n return \"Media\";\n };\n Media.prototype.getResourceInformation = function () {\n var result = [];\n var posterUrl = this.getPosterUrl();\n if (posterUrl) {\n result.push({ url: posterUrl, mimeType: \"image\" });\n }\n for (var _i = 0, _a = this.sources; _i < _a.length; _i++) {\n var mediaSource = _a[_i];\n if (mediaSource.isValid()) {\n result.push({\n url: mediaSource.url,\n mimeType: mediaSource.mimeType\n });\n }\n }\n return result;\n };\n Object.defineProperty(Media.prototype, \"selectedMediaType\", {\n get: function () {\n return this._selectedMediaType;\n },\n enumerable: false,\n configurable: true\n });\n Media.sourcesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_1, \"sources\", MediaSource);\n Media.posterProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"poster\");\n Media.altTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"altText\");\n //#endregion\n Media.supportedMediaTypes = [\"audio\", \"video\"];\n __decorate([\n serialization_1.property(Media.sourcesProperty)\n ], Media.prototype, \"sources\", void 0);\n __decorate([\n serialization_1.property(Media.posterProperty)\n ], Media.prototype, \"poster\", void 0);\n __decorate([\n serialization_1.property(Media.altTextProperty)\n ], Media.prototype, \"altText\", void 0);\n return Media;\n}(CardElement));\nexports.Media = Media;\nvar Input = /** @class */ (function (_super) {\n __extends(Input, _super);\n function Input() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Input.prototype.getAllLabelIds = function () {\n var labelIds = [];\n if (this.labelledBy) {\n labelIds.push(this.labelledBy);\n }\n if (this._renderedLabelElement) {\n labelIds.push(this._renderedLabelElement.id);\n }\n if (this._renderedErrorMessageElement) {\n labelIds.push(this._renderedErrorMessageElement.id);\n }\n return labelIds;\n };\n Input.prototype.updateInputControlAriaLabelledBy = function () {\n if (this._renderedInputControlElement) {\n var labelIds = this.getAllLabelIds();\n if (labelIds.length > 0) {\n this._renderedInputControlElement.setAttribute(\"aria-labelledby\", labelIds.join(\" \"));\n }\n else {\n this._renderedInputControlElement.removeAttribute(\"aria-labelledby\");\n }\n }\n };\n Object.defineProperty(Input.prototype, \"isNullable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Input.prototype, \"renderedInputControlElement\", {\n get: function () {\n return this._renderedInputControlElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Input.prototype, \"inputControlContainerElement\", {\n get: function () {\n return this._inputControlContainerElement;\n },\n enumerable: false,\n configurable: true\n });\n Input.prototype.overrideInternalRender = function () {\n var hostConfig = this.hostConfig;\n this._outerContainerElement = document.createElement(\"div\");\n this._outerContainerElement.style.display = \"flex\";\n this._outerContainerElement.style.flexDirection = \"column\";\n var renderedInputControlId = Utils.generateUniqueId();\n if (this.label) {\n var labelRichTextBlock = new RichTextBlock();\n labelRichTextBlock.setParent(this);\n labelRichTextBlock.forElementId = renderedInputControlId;\n var labelInline = new TextRun(this.label);\n labelRichTextBlock.addInline(labelInline);\n if (this.isRequired) {\n labelInline.init(hostConfig.inputs.label.requiredInputs);\n var isRequiredCueInline = new TextRun(hostConfig.inputs.label.requiredInputs.suffix);\n isRequiredCueInline.color = hostConfig.inputs.label.requiredInputs.suffixColor;\n isRequiredCueInline.ariaHidden = true;\n labelRichTextBlock.addInline(isRequiredCueInline);\n }\n else {\n labelInline.init(hostConfig.inputs.label.optionalInputs);\n }\n this._renderedLabelElement = labelRichTextBlock.render();\n if (this._renderedLabelElement) {\n this._renderedLabelElement.id = Utils.generateUniqueId();\n this._renderedLabelElement.style.marginBottom = hostConfig.getEffectiveSpacing(hostConfig.inputs.label.inputSpacing) + \"px\";\n this._outerContainerElement.appendChild(this._renderedLabelElement);\n }\n }\n this._inputControlContainerElement = document.createElement(\"div\");\n this._inputControlContainerElement.className = hostConfig.makeCssClassName(\"ac-input-container\");\n this._inputControlContainerElement.style.display = \"flex\";\n if (this.height === \"stretch\") {\n this._inputControlContainerElement.style.alignItems = \"stretch\";\n this._inputControlContainerElement.style.flex = \"1 1 auto\";\n }\n this._renderedInputControlElement = this.internalRender();\n if (this._renderedInputControlElement) {\n this._renderedInputControlElement.id = renderedInputControlId;\n this._renderedInputControlElement.style.minWidth = \"0px\";\n if (this.isNullable && this.isRequired) {\n this._renderedInputControlElement.setAttribute(\"aria-required\", \"true\");\n this._renderedInputControlElement.classList.add(hostConfig.makeCssClassName(\"ac-input-required\"));\n }\n this._inputControlContainerElement.appendChild(this._renderedInputControlElement);\n this._outerContainerElement.appendChild(this._inputControlContainerElement);\n this.updateInputControlAriaLabelledBy();\n return this._outerContainerElement;\n }\n return undefined;\n };\n Input.prototype.valueChanged = function () {\n if (this.isValid()) {\n this.resetValidationFailureCue();\n }\n if (this.onValueChanged) {\n this.onValueChanged(this);\n }\n raiseInputValueChangedEvent(this);\n };\n Input.prototype.resetValidationFailureCue = function () {\n if (this.renderedInputControlElement) {\n this.renderedInputControlElement.classList.remove(this.hostConfig.makeCssClassName(\"ac-input-validation-failed\"));\n this.updateInputControlAriaLabelledBy();\n if (this._renderedErrorMessageElement) {\n this._outerContainerElement.removeChild(this._renderedErrorMessageElement);\n this._renderedErrorMessageElement = undefined;\n }\n }\n };\n Input.prototype.showValidationErrorMessage = function () {\n if (this.renderedElement && this.errorMessage && shared_1.GlobalSettings.displayInputValidationErrors) {\n var errorMessageTextBlock = new TextBlock();\n errorMessageTextBlock.setParent(this);\n errorMessageTextBlock.text = this.errorMessage;\n errorMessageTextBlock.wrap = true;\n errorMessageTextBlock.init(this.hostConfig.inputs.errorMessage);\n this._renderedErrorMessageElement = errorMessageTextBlock.render();\n if (this._renderedErrorMessageElement) {\n this._renderedErrorMessageElement.id = Utils.generateUniqueId();\n this._outerContainerElement.appendChild(this._renderedErrorMessageElement);\n this.updateInputControlAriaLabelledBy();\n }\n }\n };\n Input.prototype.focus = function () {\n if (this._renderedInputControlElement) {\n this._renderedInputControlElement.focus();\n }\n };\n Input.prototype.isValid = function () {\n return true;\n };\n Input.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.id) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.inputsMustHaveUniqueId());\n }\n if (this.isRequired) {\n if (!this.label) {\n context.addFailure(this, Enums.ValidationEvent.RequiredInputsShouldHaveLabel, \"Required inputs should have a label\");\n }\n if (!this.errorMessage) {\n context.addFailure(this, Enums.ValidationEvent.RequiredInputsShouldHaveErrorMessage, \"Required inputs should have an error message\");\n }\n }\n };\n Input.prototype.validateValue = function () {\n this.resetValidationFailureCue();\n var result = this.isRequired ? this.isSet() && this.isValid() : this.isValid();\n if (!result && this.renderedInputControlElement) {\n this.renderedInputControlElement.classList.add(this.hostConfig.makeCssClassName(\"ac-input-validation-failed\"));\n this.showValidationErrorMessage();\n }\n return result;\n };\n Input.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [this];\n };\n Object.defineProperty(Input.prototype, \"isInteractive\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n Input.labelProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"label\", true);\n Input.isRequiredProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"isRequired\", false);\n Input.errorMessageProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"errorMessage\", true);\n __decorate([\n serialization_1.property(Input.labelProperty)\n ], Input.prototype, \"label\", void 0);\n __decorate([\n serialization_1.property(Input.isRequiredProperty)\n ], Input.prototype, \"isRequired\", void 0);\n __decorate([\n serialization_1.property(Input.errorMessageProperty)\n ], Input.prototype, \"errorMessage\", void 0);\n return Input;\n}(CardElement));\nexports.Input = Input;\nvar TextInput = /** @class */ (function (_super) {\n __extends(TextInput, _super);\n function TextInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isMultiline = false;\n _this.style = Enums.InputTextStyle.Text;\n return _this;\n }\n //#endregion\n TextInput.prototype.setupInput = function (input) {\n var _this = this;\n input.style.flex = \"1 1 auto\";\n input.tabIndex = 0;\n if (this.placeholder) {\n input.placeholder = this.placeholder;\n input.setAttribute(\"aria-label\", this.placeholder);\n }\n if (this.defaultValue) {\n input.value = this.defaultValue;\n }\n if (this.maxLength && this.maxLength > 0) {\n input.maxLength = this.maxLength;\n }\n input.oninput = function () { _this.valueChanged(); };\n input.onkeypress = function (e) {\n // Ctrl+Enter pressed\n if (e.ctrlKey && e.code === \"Enter\" && _this.inlineAction && _this.inlineAction.isEnabled) {\n _this.inlineAction.execute();\n }\n };\n };\n TextInput.prototype.internalRender = function () {\n var result;\n if (this.isMultiline && this.style !== Enums.InputTextStyle.Password) {\n result = document.createElement(\"textarea\");\n result.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-textInput\", \"ac-multiline\");\n if (this.height === \"stretch\") {\n result.style.height = \"initial\";\n }\n }\n else {\n result = document.createElement(\"input\");\n result.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-textInput\");\n result.type = Enums.InputTextStyle[this.style].toLowerCase();\n }\n this.setupInput(result);\n return result;\n };\n TextInput.prototype.overrideInternalRender = function () {\n var _this = this;\n var renderedInputControl = _super.prototype.overrideInternalRender.call(this);\n if (this.inlineAction) {\n var button_1 = document.createElement(\"button\");\n button_1.className = this.hostConfig.makeCssClassName(this.inlineAction.isEnabled ? \"ac-inlineActionButton\" : \"ac-inlineActionButton-disabled\");\n button_1.onclick = function (e) {\n if (_this.inlineAction && _this.inlineAction.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.inlineAction.execute();\n }\n };\n if (this.inlineAction.iconUrl) {\n button_1.classList.add(\"iconOnly\");\n var icon_1 = document.createElement(\"img\");\n icon_1.style.height = \"100%\";\n icon_1.setAttribute(\"role\", \"presentation\");\n // The below trick is necessary as a workaround in Chrome where the icon is initially displayed\n // at its native size then resized to 100% of the button's height. This cfreates an unpleasant\n // flicker. On top of that, Chrome's flex implementation fails to prperly re-layout the button\n // after the image has loaded and been gicven its final size. The below trick also fixes that.\n icon_1.style.display = \"none\";\n icon_1.onload = function () {\n icon_1.style.removeProperty(\"display\");\n };\n icon_1.onerror = function () {\n button_1.removeChild(icon_1);\n button_1.classList.remove(\"iconOnly\");\n button_1.classList.add(\"textOnly\");\n button_1.textContent = _this.inlineAction && _this.inlineAction.title ? _this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n };\n icon_1.src = this.inlineAction.iconUrl;\n button_1.appendChild(icon_1);\n button_1.title = this.inlineAction.title ? this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n }\n else {\n button_1.classList.add(\"textOnly\");\n button_1.textContent = this.inlineAction.title ? this.inlineAction.title : strings_1.Strings.defaults.inlineActionTitle();\n }\n this.inlineAction.setupElementForAccessibility(button_1, true);\n button_1.style.marginLeft = \"8px\";\n this.inputControlContainerElement.appendChild(button_1);\n }\n return renderedInputControl;\n };\n TextInput.prototype.getJsonTypeName = function () {\n return \"Input.Text\";\n };\n TextInput.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result && this.inlineAction) {\n result = this.inlineAction.getActionById(id);\n }\n return result;\n };\n TextInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n TextInput.prototype.isValid = function () {\n if (!this.value) {\n return true;\n }\n if (this.regex) {\n return new RegExp(this.regex, \"g\").test(this.value);\n }\n return true;\n };\n Object.defineProperty(TextInput.prototype, \"value\", {\n get: function () {\n if (this.renderedInputControlElement) {\n if (this.isMultiline) {\n return this.renderedInputControlElement.value;\n }\n else {\n return this.renderedInputControlElement.value;\n }\n }\n else {\n return undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n TextInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n TextInput.maxLengthProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"maxLength\");\n TextInput.isMultilineProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isMultiline\", false);\n TextInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n TextInput.styleProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_0, \"style\", Enums.InputTextStyle, Enums.InputTextStyle.Text, [\n { value: Enums.InputTextStyle.Text },\n { value: Enums.InputTextStyle.Tel },\n { value: Enums.InputTextStyle.Url },\n { value: Enums.InputTextStyle.Email },\n { value: Enums.InputTextStyle.Password, targetVersion: serialization_1.Versions.v1_5 }\n ]);\n TextInput.inlineActionProperty = new ActionProperty(serialization_1.Versions.v1_0, \"inlineAction\", [\"Action.ShowCard\"]);\n TextInput.regexProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_3, \"regex\", true);\n __decorate([\n serialization_1.property(TextInput.valueProperty)\n ], TextInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(TextInput.maxLengthProperty)\n ], TextInput.prototype, \"maxLength\", void 0);\n __decorate([\n serialization_1.property(TextInput.isMultilineProperty)\n ], TextInput.prototype, \"isMultiline\", void 0);\n __decorate([\n serialization_1.property(TextInput.placeholderProperty)\n ], TextInput.prototype, \"placeholder\", void 0);\n __decorate([\n serialization_1.property(TextInput.styleProperty)\n ], TextInput.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(TextInput.inlineActionProperty)\n ], TextInput.prototype, \"inlineAction\", void 0);\n __decorate([\n serialization_1.property(TextInput.regexProperty)\n ], TextInput.prototype, \"regex\", void 0);\n return TextInput;\n}(Input));\nexports.TextInput = TextInput;\nvar ToggleInput = /** @class */ (function (_super) {\n __extends(ToggleInput, _super);\n function ToggleInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.valueOn = \"true\";\n _this.valueOff = \"false\";\n _this.wrap = false;\n return _this;\n }\n ToggleInput.prototype.updateInputControlAriaLabelledBy = function () {\n if (this._checkboxInputElement) {\n var joinedLabelIds = this.getAllLabelIds().join(\" \");\n if (this._checkboxInputLabelElement && this._checkboxInputLabelElement.id) {\n joinedLabelIds += \" \" + this._checkboxInputLabelElement.id;\n }\n if (joinedLabelIds) {\n this._checkboxInputElement.setAttribute(\"aria-labelledby\", joinedLabelIds);\n }\n else {\n this._checkboxInputElement.removeAttribute(\"aria-labelledby\");\n }\n }\n };\n ToggleInput.prototype.internalRender = function () {\n var _this = this;\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-toggleInput\");\n element.style.width = \"100%\";\n element.style.display = \"flex\";\n element.style.alignItems = \"center\";\n this._checkboxInputElement = document.createElement(\"input\");\n this._checkboxInputElement.id = Utils.generateUniqueId();\n this._checkboxInputElement.type = \"checkbox\";\n this._checkboxInputElement.style.display = \"inline-block\";\n this._checkboxInputElement.style.verticalAlign = \"middle\";\n this._checkboxInputElement.style.margin = \"0\";\n this._checkboxInputElement.style.flex = \"0 0 auto\";\n if (this.title) {\n this._checkboxInputElement.setAttribute(\"aria-label\", this.title);\n }\n if (this.isRequired) {\n this._checkboxInputElement.setAttribute(\"aria-required\", \"true\");\n }\n this._checkboxInputElement.tabIndex = 0;\n if (this.defaultValue == this.valueOn) {\n this._checkboxInputElement.checked = true;\n }\n this._checkboxInputElement.onchange = function () { _this.valueChanged(); };\n Utils.appendChild(element, this._checkboxInputElement);\n if (this.title || this.isDesignMode()) {\n var label = new TextBlock();\n label.setParent(this);\n label.forElementId = this._checkboxInputElement.id;\n label.hostConfig = this.hostConfig;\n label.text = !this.title ? this.getJsonTypeName() : this.title;\n label.useMarkdown = shared_1.GlobalSettings.useMarkdownInRadioButtonAndCheckbox;\n label.wrap = this.wrap;\n this._checkboxInputLabelElement = label.render();\n if (this._checkboxInputLabelElement) {\n this._checkboxInputLabelElement.id = Utils.generateUniqueId();\n this._checkboxInputLabelElement.style.display = \"inline-block\";\n this._checkboxInputLabelElement.style.flex = \"1 1 auto\";\n this._checkboxInputLabelElement.style.marginLeft = \"6px\";\n this._checkboxInputLabelElement.style.verticalAlign = \"middle\";\n var spacerElement = document.createElement(\"div\");\n spacerElement.style.width = \"6px\";\n Utils.appendChild(element, spacerElement);\n Utils.appendChild(element, this._checkboxInputLabelElement);\n }\n }\n return element;\n };\n Object.defineProperty(ToggleInput.prototype, \"isNullable\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n ToggleInput.prototype.getJsonTypeName = function () {\n return \"Input.Toggle\";\n };\n ToggleInput.prototype.focus = function () {\n if (this._checkboxInputElement) {\n this._checkboxInputElement.focus();\n }\n };\n ToggleInput.prototype.isSet = function () {\n if (this.isRequired) {\n return this.value === this.valueOn;\n }\n return this.value ? true : false;\n };\n Object.defineProperty(ToggleInput.prototype, \"value\", {\n get: function () {\n if (this._checkboxInputElement) {\n return this._checkboxInputElement.checked ? this.valueOn : this.valueOff;\n }\n else {\n return undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n ToggleInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n ToggleInput.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n ToggleInput.valueOnProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"valueOn\", true, undefined, \"true\", function (sender) { return \"true\"; });\n ToggleInput.valueOffProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"valueOff\", true, undefined, \"false\", function (sender) { return \"false\"; });\n ToggleInput.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"wrap\", false);\n __decorate([\n serialization_1.property(ToggleInput.valueProperty)\n ], ToggleInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.titleProperty)\n ], ToggleInput.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.valueOnProperty)\n ], ToggleInput.prototype, \"valueOn\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.valueOffProperty)\n ], ToggleInput.prototype, \"valueOff\", void 0);\n __decorate([\n serialization_1.property(ToggleInput.wrapProperty)\n ], ToggleInput.prototype, \"wrap\", void 0);\n return ToggleInput;\n}(Input));\nexports.ToggleInput = ToggleInput;\nvar Choice = /** @class */ (function (_super) {\n __extends(Choice, _super);\n function Choice(title, value) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.value = value;\n return _this;\n }\n //#endregion\n Choice.prototype.getSchemaKey = function () {\n return \"Choice\";\n };\n //#region Schema\n Choice.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Choice.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(Choice.titleProperty)\n ], Choice.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(Choice.valueProperty)\n ], Choice.prototype, \"value\", void 0);\n return Choice;\n}(serialization_1.SerializableObject));\nexports.Choice = Choice;\nvar ChoiceSetInput = /** @class */ (function (_super) {\n __extends(ChoiceSetInput, _super);\n function ChoiceSetInput() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isMultiSelect = false;\n _this.wrap = false;\n _this.choices = [];\n return _this;\n }\n Object.defineProperty(ChoiceSetInput.prototype, \"isCompact\", {\n get: function () {\n return !this.style || this.style === \"compact\";\n },\n set: function (value) {\n this.style = value ? undefined : \"expanded\";\n },\n enumerable: false,\n configurable: true\n });\n ChoiceSetInput.getUniqueCategoryName = function () {\n var uniqueCategoryName = \"__ac-category\" + ChoiceSetInput.uniqueCategoryCounter;\n ChoiceSetInput.uniqueCategoryCounter++;\n return uniqueCategoryName;\n };\n // Make sure `aria-current` is applied to the currently-selected item\n ChoiceSetInput.prototype.internalApplyAriaCurrent = function () {\n if (this._selectElement) {\n var options = this._selectElement.options;\n if (options) {\n for (var i = 0; i < options.length; i++) {\n if (options[i].selected) {\n options[i].setAttribute(\"aria-current\", \"true\");\n }\n else {\n options[i].removeAttribute(\"aria-current\");\n }\n }\n }\n }\n };\n ChoiceSetInput.prototype.renderCompoundInput = function (cssClassName, type, defaultValues) {\n var _this = this;\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-input\", cssClassName);\n element.style.width = \"100%\";\n this._toggleInputs = [];\n this._labels = [];\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n var input = document.createElement(\"input\");\n input.id = Utils.generateUniqueId();\n input.type = type;\n input.style.margin = \"0\";\n input.style.display = \"inline-block\";\n input.style.verticalAlign = \"middle\";\n input.style.flex = \"0 0 auto\";\n input.name = this.id ? this.id : this._uniqueCategoryName;\n if (this.isRequired) {\n input.setAttribute(\"aria-required\", \"true\");\n }\n if (choice.value) {\n input.value = choice.value;\n }\n if (choice.title) {\n input.setAttribute(\"aria-label\", choice.title);\n }\n if (defaultValues && choice.value) {\n if (defaultValues.indexOf(choice.value) >= 0) {\n input.checked = true;\n }\n }\n input.onchange = function () { _this.valueChanged(); };\n this._toggleInputs.push(input);\n var compoundInput = document.createElement(\"div\");\n compoundInput.style.display = \"flex\";\n compoundInput.style.alignItems = \"center\";\n Utils.appendChild(compoundInput, input);\n var label = new TextBlock();\n label.setParent(this);\n label.forElementId = input.id;\n label.hostConfig = this.hostConfig;\n label.text = choice.title ? choice.title : \"Choice \" + this._toggleInputs.length;\n label.useMarkdown = shared_1.GlobalSettings.useMarkdownInRadioButtonAndCheckbox;\n label.wrap = this.wrap;\n var labelElement = label.render();\n this._labels.push(labelElement);\n if (labelElement) {\n labelElement.id = Utils.generateUniqueId();\n labelElement.style.display = \"inline-block\";\n labelElement.style.flex = \"1 1 auto\";\n labelElement.style.marginLeft = \"6px\";\n labelElement.style.verticalAlign = \"middle\";\n var spacerElement = document.createElement(\"div\");\n spacerElement.style.width = \"6px\";\n Utils.appendChild(compoundInput, spacerElement);\n Utils.appendChild(compoundInput, labelElement);\n }\n Utils.appendChild(element, compoundInput);\n }\n return element;\n };\n ChoiceSetInput.prototype.updateInputControlAriaLabelledBy = function () {\n if ((this.isMultiSelect || this.style === \"expanded\") && this._toggleInputs && this._labels) {\n var labelIds = this.getAllLabelIds();\n for (var i = 0; i < this._toggleInputs.length; i++) {\n var joinedLabelIds = labelIds.join(\" \");\n var label = this._labels[i];\n if (label && label.id) {\n joinedLabelIds += \" \" + label.id;\n }\n if (joinedLabelIds) {\n this._toggleInputs[i].setAttribute(\"aria-labelledby\", joinedLabelIds);\n }\n else {\n this._toggleInputs[i].removeAttribute(\"aria-labelledby\");\n }\n }\n }\n else {\n _super.prototype.updateInputControlAriaLabelledBy.call(this);\n }\n };\n ChoiceSetInput.prototype.internalRender = function () {\n var _this = this;\n this._uniqueCategoryName = ChoiceSetInput.getUniqueCategoryName();\n if (this.isMultiSelect) {\n // Render as a list of toggle inputs\n return this.renderCompoundInput(\"ac-choiceSetInput-multiSelect\", \"checkbox\", this.defaultValue ? this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator) : undefined);\n }\n else {\n if (this.style === \"expanded\") {\n // Render as a series of radio buttons\n return this.renderCompoundInput(\"ac-choiceSetInput-expanded\", \"radio\", this.defaultValue ? [this.defaultValue] : undefined);\n }\n else if (this.style === \"filtered\") {\n // Render as a text input coupled with a datalist\n var inputContainer = document.createElement(\"div\");\n inputContainer.style.width = \"100%\";\n this._textInput = document.createElement(\"input\");\n this._textInput.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-multichoiceInput\", \"ac-choiceSetInput-filtered\");\n this._textInput.type = \"text\";\n this._textInput.style.width = \"100%\";\n this._textInput.oninput = function () {\n _this.valueChanged();\n if (_this._textInput) {\n // Remove aria-label when value is not empty so narration software doesn't\n // read the placeholder\n if (_this.value) {\n _this._textInput.removeAttribute(\"placeholder\");\n _this._textInput.removeAttribute(\"aria-label\");\n }\n else if (_this.placeholder) {\n _this._textInput.placeholder = _this.placeholder;\n _this._textInput.setAttribute(\"aria-label\", _this.placeholder);\n }\n }\n };\n if (this.defaultValue) {\n this._textInput.value = this.defaultValue;\n }\n if (this.placeholder && !this._textInput.value) {\n this._textInput.placeholder = this.placeholder;\n this._textInput.setAttribute(\"aria-label\", this.placeholder);\n }\n var dataList = document.createElement(\"datalist\");\n dataList.id = Utils.generateUniqueId();\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n var option = document.createElement(\"option\");\n // To fix https://stackoverflow.com/questions/29882361/show-datalist-labels-but-submit-the-actual-value\n // value is mapped to choice.title other than choice.value\n option.value = choice.title;\n option.setAttribute(\"aria-label\", choice.title);\n dataList.appendChild(option);\n }\n this._textInput.setAttribute(\"list\", dataList.id);\n inputContainer.append(this._textInput, dataList);\n return inputContainer;\n }\n else {\n // Render as a combo box\n this._selectElement = document.createElement(\"select\");\n this._selectElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-multichoiceInput\", \"ac-choiceSetInput-compact\");\n this._selectElement.style.width = \"100%\";\n var option = document.createElement(\"option\");\n option.selected = true;\n option.disabled = true;\n option.hidden = true;\n option.value = \"\";\n if (this.placeholder) {\n option.text = this.placeholder;\n }\n Utils.appendChild(this._selectElement, option);\n for (var _b = 0, _c = this.choices; _b < _c.length; _b++) {\n var choice = _c[_b];\n var option_1 = document.createElement(\"option\");\n option_1.value = choice.value;\n option_1.text = choice.title;\n option_1.setAttribute(\"aria-label\", choice.title);\n if (choice.value == this.defaultValue) {\n option_1.selected = true;\n }\n Utils.appendChild(this._selectElement, option_1);\n }\n this._selectElement.onchange = function () {\n _this.internalApplyAriaCurrent();\n _this.valueChanged();\n };\n this.internalApplyAriaCurrent();\n return this._selectElement;\n }\n }\n };\n ChoiceSetInput.prototype.getJsonTypeName = function () {\n return \"Input.ChoiceSet\";\n };\n ChoiceSetInput.prototype.focus = function () {\n if (this._toggleInputs && (this.isMultiSelect || this.style === \"expanded\")) {\n if (this._toggleInputs.length > 0) {\n this._toggleInputs[0].focus();\n }\n }\n else if (this._textInput) {\n this._textInput.focus();\n }\n else {\n _super.prototype.focus.call(this);\n }\n };\n ChoiceSetInput.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this.choices.length == 0) {\n context.addFailure(this, Enums.ValidationEvent.CollectionCantBeEmpty, strings_1.Strings.errors.choiceSetMustHaveAtLeastOneChoice());\n }\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (!choice.title || !choice.value) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.choiceSetChoicesMustHaveTitleAndValue());\n }\n }\n };\n ChoiceSetInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n ChoiceSetInput.prototype.isValid = function () {\n if (this._textInput) {\n if (this.value === \"\" || this.value === this.placeholder) {\n return true;\n }\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (this.value === choice.value) {\n return true;\n }\n }\n return false;\n }\n return _super.prototype.isValid.call(this);\n };\n Object.defineProperty(ChoiceSetInput.prototype, \"value\", {\n get: function () {\n if (!this.isMultiSelect) {\n if (this._selectElement) {\n return this._selectElement.selectedIndex > 0 ? this._selectElement.value : undefined;\n }\n else if (this._textInput) {\n for (var _i = 0, _a = this.choices; _i < _a.length; _i++) {\n var choice = _a[_i];\n if (choice.title && this._textInput.value === choice.title) {\n return choice.value;\n }\n }\n return this._textInput.value;\n }\n else if (this._toggleInputs && this._toggleInputs.length > 0) {\n for (var _b = 0, _c = this._toggleInputs; _b < _c.length; _b++) {\n var toggleInput = _c[_b];\n if (toggleInput.checked) {\n return toggleInput.value;\n }\n }\n }\n return undefined;\n }\n else {\n if (!this._toggleInputs || this._toggleInputs.length == 0) {\n return undefined;\n }\n var result = \"\";\n for (var _d = 0, _e = this._toggleInputs; _d < _e.length; _d++) {\n var toggleInput = _e[_d];\n if (toggleInput.checked) {\n if (result != \"\") {\n result += this.hostConfig.choiceSetInputValueSeparator;\n }\n result += toggleInput.value;\n }\n }\n return result ? result : undefined;\n }\n },\n enumerable: false,\n configurable: true\n });\n ChoiceSetInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n ChoiceSetInput.choicesProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"choices\", Choice);\n ChoiceSetInput.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_0, \"style\", [\n { value: \"compact\" },\n { value: \"expanded\" },\n { value: \"filtered\", targetVersion: serialization_1.Versions.v1_5 }\n ], \"compact\");\n ChoiceSetInput.isMultiSelectProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"isMultiSelect\", false);\n ChoiceSetInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n ChoiceSetInput.wrapProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"wrap\", false);\n //#endregion\n ChoiceSetInput.uniqueCategoryCounter = 0;\n __decorate([\n serialization_1.property(ChoiceSetInput.valueProperty)\n ], ChoiceSetInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.styleProperty)\n ], ChoiceSetInput.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.isMultiSelectProperty)\n ], ChoiceSetInput.prototype, \"isMultiSelect\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.placeholderProperty)\n ], ChoiceSetInput.prototype, \"placeholder\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.wrapProperty)\n ], ChoiceSetInput.prototype, \"wrap\", void 0);\n __decorate([\n serialization_1.property(ChoiceSetInput.choicesProperty)\n ], ChoiceSetInput.prototype, \"choices\", void 0);\n return ChoiceSetInput;\n}(Input));\nexports.ChoiceSetInput = ChoiceSetInput;\nvar NumberInput = /** @class */ (function (_super) {\n __extends(NumberInput, _super);\n function NumberInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NumberInput.prototype.internalRender = function () {\n var _this = this;\n this._numberInputElement = document.createElement(\"input\");\n this._numberInputElement.setAttribute(\"type\", \"number\");\n if (this.min !== undefined) {\n this._numberInputElement.setAttribute(\"min\", this.min.toString());\n }\n if (this.max !== undefined) {\n this._numberInputElement.setAttribute(\"max\", this.max.toString());\n }\n this._numberInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-numberInput\");\n this._numberInputElement.style.width = \"100%\";\n this._numberInputElement.tabIndex = 0;\n if (this.defaultValue !== undefined) {\n this._numberInputElement.valueAsNumber = this.defaultValue;\n }\n if (this.placeholder) {\n this._numberInputElement.placeholder = this.placeholder;\n this._numberInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n this._numberInputElement.oninput = function () { _this.valueChanged(); };\n return this._numberInputElement;\n };\n NumberInput.prototype.getJsonTypeName = function () {\n return \"Input.Number\";\n };\n NumberInput.prototype.isSet = function () {\n return this.value !== undefined && !isNaN(this.value);\n };\n NumberInput.prototype.isValid = function () {\n if (this.value === undefined) {\n return !this.isRequired;\n }\n var result = true;\n if (this.min !== undefined) {\n result = result && (this.value >= this.min);\n }\n if (this.max !== undefined) {\n result = result && (this.value <= this.max);\n }\n return result;\n };\n Object.defineProperty(NumberInput.prototype, \"value\", {\n get: function () {\n return this._numberInputElement ? this._numberInputElement.valueAsNumber : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n NumberInput.valueProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"value\");\n NumberInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n NumberInput.minProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"min\");\n NumberInput.maxProperty = new serialization_1.NumProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(NumberInput.valueProperty)\n ], NumberInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(NumberInput.minProperty)\n ], NumberInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(NumberInput.maxProperty)\n ], NumberInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(NumberInput.placeholderProperty)\n ], NumberInput.prototype, \"placeholder\", void 0);\n return NumberInput;\n}(Input));\nexports.NumberInput = NumberInput;\nvar DateInput = /** @class */ (function (_super) {\n __extends(DateInput, _super);\n function DateInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateInput.prototype.internalRender = function () {\n var _this = this;\n this._dateInputElement = document.createElement(\"input\");\n this._dateInputElement.setAttribute(\"type\", \"date\");\n if (this.min) {\n this._dateInputElement.setAttribute(\"min\", this.min);\n }\n if (this.max) {\n this._dateInputElement.setAttribute(\"max\", this.max);\n }\n if (this.placeholder) {\n this._dateInputElement.placeholder = this.placeholder;\n this._dateInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n this._dateInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-dateInput\");\n this._dateInputElement.style.width = \"100%\";\n this._dateInputElement.oninput = function () { _this.valueChanged(); };\n if (this.defaultValue) {\n this._dateInputElement.value = this.defaultValue;\n }\n return this._dateInputElement;\n };\n DateInput.prototype.getJsonTypeName = function () {\n return \"Input.Date\";\n };\n DateInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n DateInput.prototype.isValid = function () {\n if (!this.value) {\n return !this.isRequired;\n }\n var valueAsDate = new Date(this.value);\n var result = true;\n if (this.min) {\n var minDate = new Date(this.min);\n result = result && (valueAsDate >= minDate);\n }\n if (this.max) {\n var maxDate = new Date(this.max);\n result = result && (valueAsDate <= maxDate);\n }\n return result;\n };\n Object.defineProperty(DateInput.prototype, \"value\", {\n get: function () {\n return this._dateInputElement ? this._dateInputElement.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n DateInput.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"value\");\n DateInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n DateInput.minProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"min\");\n DateInput.maxProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(DateInput.valueProperty)\n ], DateInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(DateInput.minProperty)\n ], DateInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(DateInput.maxProperty)\n ], DateInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(DateInput.placeholderProperty)\n ], DateInput.prototype, \"placeholder\", void 0);\n return DateInput;\n}(Input));\nexports.DateInput = DateInput;\nvar TimeProperty = /** @class */ (function (_super) {\n __extends(TimeProperty, _super);\n function TimeProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, function (sender, property, source, context) {\n var value = source[property.name];\n if (typeof value === \"string\" && value && /^[0-9]{2}:[0-9]{2}$/.test(value)) {\n return value;\n }\n return undefined;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, value);\n }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n return TimeProperty;\n}(serialization_1.CustomProperty));\nexports.TimeProperty = TimeProperty;\nvar TimeInput = /** @class */ (function (_super) {\n __extends(TimeInput, _super);\n function TimeInput() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeInput.convertTimeStringToDate = function (timeString) {\n return new Date(\"1973-09-04T\" + timeString + \":00Z\");\n };\n TimeInput.prototype.internalRender = function () {\n var _this = this;\n this._timeInputElement = document.createElement(\"input\");\n this._timeInputElement.setAttribute(\"type\", \"time\");\n this._timeInputElement.setAttribute(\"min\", this.min);\n this._timeInputElement.setAttribute(\"max\", this.max);\n this._timeInputElement.className = this.hostConfig.makeCssClassName(\"ac-input\", \"ac-timeInput\");\n this._timeInputElement.style.width = \"100%\";\n this._timeInputElement.oninput = function () { _this.valueChanged(); };\n if (this.placeholder) {\n this._timeInputElement.placeholder = this.placeholder;\n this._timeInputElement.setAttribute(\"aria-label\", this.placeholder);\n }\n if (this.defaultValue) {\n this._timeInputElement.value = this.defaultValue;\n }\n return this._timeInputElement;\n };\n TimeInput.prototype.getJsonTypeName = function () {\n return \"Input.Time\";\n };\n TimeInput.prototype.isSet = function () {\n return this.value ? true : false;\n };\n TimeInput.prototype.isValid = function () {\n if (!this.value) {\n return !this.isRequired;\n }\n var valueAsDate = TimeInput.convertTimeStringToDate(this.value);\n var result = true;\n if (this.min) {\n var minDate = TimeInput.convertTimeStringToDate(this.min);\n result = result && (valueAsDate >= minDate);\n }\n if (this.max) {\n var maxDate = TimeInput.convertTimeStringToDate(this.max);\n result = result && (valueAsDate <= maxDate);\n }\n return result;\n };\n Object.defineProperty(TimeInput.prototype, \"value\", {\n get: function () {\n return this._timeInputElement ? this._timeInputElement.value : undefined;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n TimeInput.valueProperty = new TimeProperty(serialization_1.Versions.v1_0, \"value\");\n TimeInput.placeholderProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"placeholder\");\n TimeInput.minProperty = new TimeProperty(serialization_1.Versions.v1_0, \"min\");\n TimeInput.maxProperty = new TimeProperty(serialization_1.Versions.v1_0, \"max\");\n __decorate([\n serialization_1.property(TimeInput.valueProperty)\n ], TimeInput.prototype, \"defaultValue\", void 0);\n __decorate([\n serialization_1.property(TimeInput.minProperty)\n ], TimeInput.prototype, \"min\", void 0);\n __decorate([\n serialization_1.property(TimeInput.maxProperty)\n ], TimeInput.prototype, \"max\", void 0);\n __decorate([\n serialization_1.property(TimeInput.placeholderProperty)\n ], TimeInput.prototype, \"placeholder\", void 0);\n return TimeInput;\n}(Input));\nexports.TimeInput = TimeInput;\nvar Action = /** @class */ (function (_super) {\n __extends(Action, _super);\n function Action() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.style = Enums.ActionStyle.Default;\n _this.mode = Enums.ActionMode.Primary;\n _this._state = 0 /* Normal */;\n _this._isFocusable = true;\n return _this;\n }\n //#endregion\n Action.prototype.renderButtonContent = function () {\n if (this.renderedElement) {\n // Cache hostConfig for perf\n var hostConfig = this.hostConfig;\n var titleElement = document.createElement(\"div\");\n titleElement.style.overflow = \"hidden\";\n titleElement.style.textOverflow = \"ellipsis\";\n if (!(hostConfig.actions.iconPlacement == Enums.ActionIconPlacement.AboveTitle || hostConfig.actions.allowTitleToWrap)) {\n titleElement.style.whiteSpace = \"nowrap\";\n }\n if (this.title) {\n titleElement.innerText = this.title;\n }\n if (!this.iconUrl) {\n this.renderedElement.classList.add(\"noIcon\");\n this.renderedElement.appendChild(titleElement);\n }\n else {\n var iconElement = document.createElement(\"img\");\n iconElement.src = this.iconUrl;\n iconElement.style.width = hostConfig.actions.iconSize + \"px\";\n iconElement.style.height = hostConfig.actions.iconSize + \"px\";\n iconElement.style.flex = \"0 0 auto\";\n if (hostConfig.actions.iconPlacement == Enums.ActionIconPlacement.AboveTitle) {\n this.renderedElement.classList.add(\"iconAbove\");\n this.renderedElement.style.flexDirection = \"column\";\n if (this.title) {\n iconElement.style.marginBottom = \"6px\";\n }\n }\n else {\n this.renderedElement.classList.add(\"iconLeft\");\n iconElement.style.maxHeight = \"100%\";\n if (this.title) {\n iconElement.style.marginRight = \"6px\";\n }\n }\n this.renderedElement.appendChild(iconElement);\n this.renderedElement.appendChild(titleElement);\n }\n }\n };\n Action.prototype.getParentContainer = function () {\n if (this.parent instanceof Container) {\n return this.parent;\n }\n return this.parent ? this.parent.getParentContainer() : undefined;\n };\n Action.prototype.updateCssClasses = function () {\n var _a, _b;\n if (this.parent && this.renderedElement) {\n var hostConfig = this.parent.hostConfig;\n this.renderedElement.className = hostConfig.makeCssClassName(this.isEnabled ? \"ac-pushButton\" : \"ac-pushButton-disabled\");\n var parentContainer = this.getParentContainer();\n if (parentContainer) {\n var parentContainerStyle = parentContainer.getEffectiveStyle();\n if (parentContainerStyle) {\n this.renderedElement.classList.add(\"style-\" + parentContainerStyle);\n }\n }\n this.renderedElement.tabIndex = this.isFocusable ? 0 : -1;\n switch (this._state) {\n case 1 /* Expanded */:\n this.renderedElement.classList.add(hostConfig.makeCssClassName(\"expanded\"));\n break;\n case 2 /* Subdued */:\n this.renderedElement.classList.add(hostConfig.makeCssClassName(\"subdued\"));\n break;\n }\n if (this.style && this.isEnabled) {\n if (this.style === Enums.ActionStyle.Positive) {\n (_a = this.renderedElement.classList).add.apply(_a, hostConfig.makeCssClassNames(\"primary\", \"style-positive\"));\n }\n else {\n (_b = this.renderedElement.classList).add.apply(_b, hostConfig.makeCssClassNames(\"style-\" + this.style.toLowerCase()));\n }\n }\n }\n };\n Action.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext();\n };\n Action.prototype.internalGetReferencedInputs = function () {\n return {};\n };\n Action.prototype.internalPrepareForExecution = function (inputs) {\n // Do nothing in base implementation\n };\n Action.prototype.internalValidateInputs = function (referencedInputs) {\n var result = [];\n if (referencedInputs) {\n for (var _i = 0, _a = Object.keys(referencedInputs); _i < _a.length; _i++) {\n var key = _a[_i];\n var input = referencedInputs[key];\n if (!input.validateValue()) {\n result.push(input);\n }\n }\n }\n return result;\n };\n Action.prototype.shouldSerialize = function (context) {\n return context.actionRegistry.findByName(this.getJsonTypeName()) !== undefined;\n };\n Action.prototype.raiseExecuteActionEvent = function () {\n if (this.onExecute) {\n this.onExecute(this);\n }\n raiseExecuteActionEvent(this);\n };\n Action.prototype.getHref = function () {\n return \"\";\n };\n Action.prototype.getAriaRole = function () {\n return \"button\";\n };\n Action.prototype.setupElementForAccessibility = function (element, promoteTooltipToLabel) {\n if (promoteTooltipToLabel === void 0) { promoteTooltipToLabel = false; }\n element.tabIndex = this.isEnabled ? 0 : -1;\n element.setAttribute(\"role\", this.getAriaRole());\n if (element instanceof HTMLButtonElement) {\n element.disabled = !this.isEnabled;\n }\n if (!this.isEnabled) {\n element.setAttribute(\"aria-disabled\", \"true\");\n }\n else {\n element.classList.add(this.hostConfig.makeCssClassName(\"ac-selectable\"));\n }\n if (this.title) {\n element.setAttribute(\"aria-label\", this.title);\n element.title = this.title;\n }\n if (this.tooltip) {\n var targetAriaAttribute = promoteTooltipToLabel ? (this.title ? \"aria-description\" : \"aria-label\") : \"aria-description\";\n element.setAttribute(targetAriaAttribute, this.tooltip);\n element.title = this.tooltip;\n }\n };\n Action.prototype.parse = function (source, context) {\n return _super.prototype.parse.call(this, source, context ? context : new SerializationContext());\n };\n Action.prototype.render = function () {\n var _this = this;\n var buttonElement = document.createElement(\"button\");\n buttonElement.type = \"button\";\n buttonElement.style.display = \"flex\";\n buttonElement.style.alignItems = \"center\";\n buttonElement.style.justifyContent = \"center\";\n buttonElement.onclick = function (e) {\n if (_this.isEnabled) {\n e.preventDefault();\n e.cancelBubble = true;\n _this.execute();\n }\n };\n this._renderedElement = buttonElement;\n this.renderButtonContent();\n this.updateCssClasses();\n this.setupElementForAccessibility(buttonElement);\n };\n Action.prototype.execute = function () {\n if (this._actionCollection) {\n this._actionCollection.actionExecuted(this);\n }\n this.raiseExecuteActionEvent();\n };\n Action.prototype.prepareForExecution = function () {\n var referencedInputs = this.getReferencedInputs();\n var invalidInputs = this.internalValidateInputs(referencedInputs);\n if (invalidInputs.length > 0) {\n invalidInputs[0].focus();\n return false;\n }\n this.internalPrepareForExecution(referencedInputs);\n return true;\n };\n ;\n Action.prototype.remove = function () {\n if (this._actionCollection) {\n return this._actionCollection.removeAction(this);\n }\n return false;\n };\n Action.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return [];\n };\n Action.prototype.getResourceInformation = function () {\n return this.iconUrl ? [{ url: this.iconUrl, mimeType: \"image\" }] : [];\n };\n Action.prototype.getActionById = function (id) {\n return this.id === id ? this : undefined;\n };\n Action.prototype.getReferencedInputs = function () {\n return this.internalGetReferencedInputs();\n };\n /**\n * Validates the inputs associated with this action.\n *\n * @returns A list of inputs that failed validation, or an empty array if no input failed validation.\n */\n Action.prototype.validateInputs = function () {\n return this.internalValidateInputs(this.getReferencedInputs());\n };\n Object.defineProperty(Action.prototype, \"isPrimary\", {\n get: function () {\n return this.style == Enums.ActionStyle.Positive;\n },\n set: function (value) {\n if (value) {\n this.style = Enums.ActionStyle.Positive;\n }\n else {\n if (this.style == Enums.ActionStyle.Positive) {\n this.style = Enums.ActionStyle.Default;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"hostConfig\", {\n get: function () {\n return this.parent ? this.parent.hostConfig : host_config_1.defaultHostConfig;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"state\", {\n get: function () {\n return this._state;\n },\n set: function (value) {\n if (this._state !== value) {\n this._state = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Action.prototype, \"isFocusable\", {\n get: function () {\n return this._isFocusable;\n },\n set: function (value) {\n if (this._isFocusable !== value) {\n this._isFocusable = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n Action.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"title\");\n Action.iconUrlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_1, \"iconUrl\");\n Action.styleProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_2, \"style\", [\n { value: Enums.ActionStyle.Default },\n { value: Enums.ActionStyle.Positive },\n { value: Enums.ActionStyle.Destructive }\n ], Enums.ActionStyle.Default);\n Action.modeProperty = new serialization_1.ValueSetProperty(serialization_1.Versions.v1_5, \"mode\", [\n { value: Enums.ActionMode.Primary },\n { value: Enums.ActionMode.Secondary }\n ], Enums.ActionMode.Primary);\n Action.tooltipProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_5, \"tooltip\");\n Action.isEnabledProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"isEnabled\", true);\n __decorate([\n serialization_1.property(Action.titleProperty)\n ], Action.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(Action.iconUrlProperty)\n ], Action.prototype, \"iconUrl\", void 0);\n __decorate([\n serialization_1.property(Action.styleProperty)\n ], Action.prototype, \"style\", void 0);\n __decorate([\n serialization_1.property(Action.modeProperty)\n ], Action.prototype, \"mode\", void 0);\n __decorate([\n serialization_1.property(Action.tooltipProperty)\n ], Action.prototype, \"tooltip\", void 0);\n __decorate([\n serialization_1.property(Action.isEnabledProperty)\n ], Action.prototype, \"isEnabled\", void 0);\n return Action;\n}(card_object_1.CardObject));\nexports.Action = Action;\nvar SubmitActionBase = /** @class */ (function (_super) {\n __extends(SubmitActionBase, _super);\n function SubmitActionBase() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._isPrepared = false;\n return _this;\n }\n SubmitActionBase.prototype.internalGetReferencedInputs = function () {\n var result = {};\n if (this.associatedInputs !== \"none\") {\n var current = this.parent;\n var inputs = [];\n while (current) {\n inputs = inputs.concat(current.getAllInputs(false));\n current = current.parent;\n }\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n if (input.id) {\n result[input.id] = input;\n }\n }\n }\n return result;\n };\n SubmitActionBase.prototype.internalPrepareForExecution = function (inputs) {\n if (this._originalData) {\n this._processedData = JSON.parse(JSON.stringify(this._originalData));\n }\n else {\n this._processedData = {};\n }\n if (this._processedData && inputs) {\n for (var _i = 0, _a = Object.keys(inputs); _i < _a.length; _i++) {\n var key = _a[_i];\n var input = inputs[key];\n if (input.id && input.isSet()) {\n this._processedData[input.id] = typeof input.value === \"string\" ? input.value : input.value.toString();\n }\n }\n }\n this._isPrepared = true;\n };\n Object.defineProperty(SubmitActionBase.prototype, \"data\", {\n get: function () {\n return this._isPrepared ? this._processedData : this._originalData;\n },\n set: function (value) {\n this._originalData = value;\n this._isPrepared = false;\n },\n enumerable: false,\n configurable: true\n });\n SubmitActionBase.dataProperty = new serialization_1.PropertyDefinition(serialization_1.Versions.v1_0, \"data\");\n SubmitActionBase.associatedInputsProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_3, \"associatedInputs\", function (sender, property, source, context) {\n var value = source[property.name];\n if (value !== undefined && typeof value === \"string\") {\n return value.toLowerCase() === \"none\" ? \"none\" : \"auto\";\n }\n return undefined;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, value);\n });\n __decorate([\n serialization_1.property(SubmitActionBase.dataProperty)\n ], SubmitActionBase.prototype, \"_originalData\", void 0);\n __decorate([\n serialization_1.property(SubmitActionBase.associatedInputsProperty)\n ], SubmitActionBase.prototype, \"associatedInputs\", void 0);\n return SubmitActionBase;\n}(Action));\nexports.SubmitActionBase = SubmitActionBase;\nvar SubmitAction = /** @class */ (function (_super) {\n __extends(SubmitAction, _super);\n function SubmitAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SubmitAction.prototype.getJsonTypeName = function () {\n return SubmitAction.JsonTypeName;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n SubmitAction.JsonTypeName = \"Action.Submit\";\n return SubmitAction;\n}(SubmitActionBase));\nexports.SubmitAction = SubmitAction;\nvar ExecuteAction = /** @class */ (function (_super) {\n __extends(ExecuteAction, _super);\n function ExecuteAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n ExecuteAction.prototype.getJsonTypeName = function () {\n return ExecuteAction.JsonTypeName;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ExecuteAction.JsonTypeName = \"Action.Execute\";\n //#region Schema\n ExecuteAction.verbProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"verb\");\n __decorate([\n serialization_1.property(ExecuteAction.verbProperty)\n ], ExecuteAction.prototype, \"verb\", void 0);\n return ExecuteAction;\n}(SubmitActionBase));\nexports.ExecuteAction = ExecuteAction;\nvar OpenUrlAction = /** @class */ (function (_super) {\n __extends(OpenUrlAction, _super);\n function OpenUrlAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OpenUrlAction.prototype.getJsonTypeName = function () {\n return OpenUrlAction.JsonTypeName;\n };\n OpenUrlAction.prototype.getAriaRole = function () {\n return \"link\";\n };\n OpenUrlAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.url) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"url\"));\n }\n };\n OpenUrlAction.prototype.getHref = function () {\n return this.url;\n };\n //#region Schema\n OpenUrlAction.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n OpenUrlAction.JsonTypeName = \"Action.OpenUrl\";\n __decorate([\n serialization_1.property(OpenUrlAction.urlProperty)\n ], OpenUrlAction.prototype, \"url\", void 0);\n return OpenUrlAction;\n}(Action));\nexports.OpenUrlAction = OpenUrlAction;\nvar ToggleVisibilityAction = /** @class */ (function (_super) {\n __extends(ToggleVisibilityAction, _super);\n function ToggleVisibilityAction() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.targetElements = {};\n return _this;\n }\n ToggleVisibilityAction.prototype.updateAriaControlsAttribute = function () {\n // apply aria labels to make it clear which elements this action will toggle\n if (this.targetElements) {\n var elementIds = Object.keys(this.targetElements);\n if (this._renderedElement) {\n if (elementIds.length > 0) {\n this._renderedElement.setAttribute(\"aria-controls\", elementIds.join(\" \"));\n }\n else {\n this._renderedElement.removeAttribute(\"aria-controls\");\n }\n }\n }\n };\n ToggleVisibilityAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.targetElements) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"targetElements\"));\n }\n };\n ToggleVisibilityAction.prototype.getJsonTypeName = function () {\n return ToggleVisibilityAction.JsonTypeName;\n };\n ToggleVisibilityAction.prototype.render = function () {\n _super.prototype.render.call(this);\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.prototype.execute = function () {\n if (this.parent) {\n for (var _i = 0, _a = Object.keys(this.targetElements); _i < _a.length; _i++) {\n var elementId = _a[_i];\n var targetElement = this.parent.getRootElement().getElementById(elementId);\n if (targetElement) {\n if (typeof this.targetElements[elementId] === \"boolean\") {\n targetElement.isVisible = this.targetElements[elementId];\n }\n else {\n targetElement.isVisible = !targetElement.isVisible;\n }\n }\n }\n }\n };\n ToggleVisibilityAction.prototype.addTargetElement = function (elementId, isVisible) {\n if (isVisible === void 0) { isVisible = undefined; }\n this.targetElements[elementId] = isVisible;\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.prototype.removeTargetElement = function (elementId) {\n delete this.targetElements[elementId];\n this.updateAriaControlsAttribute();\n };\n ToggleVisibilityAction.targetElementsProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_2, \"targetElements\", function (sender, property, source, context) {\n var result = {};\n if (Array.isArray(source[property.name])) {\n for (var _i = 0, _a = source[property.name]; _i < _a.length; _i++) {\n var item = _a[_i];\n if (typeof item === \"string\") {\n result[item] = undefined;\n }\n else if (typeof item === \"object\") {\n var elementId = item[\"elementId\"];\n if (typeof elementId === \"string\") {\n result[elementId] = Utils.parseBool(item[\"isVisible\"]);\n }\n }\n }\n }\n return result;\n }, function (sender, property, target, value, context) {\n var targetElements = [];\n for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) {\n var id = _a[_i];\n if (typeof value[id] === \"boolean\") {\n targetElements.push({\n elementId: id,\n isVisible: value[id]\n });\n }\n else {\n targetElements.push(id);\n }\n }\n context.serializeArray(target, property.name, targetElements);\n }, {}, function (sender) { return {}; });\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ToggleVisibilityAction.JsonTypeName = \"Action.ToggleVisibility\";\n __decorate([\n serialization_1.property(ToggleVisibilityAction.targetElementsProperty)\n ], ToggleVisibilityAction.prototype, \"targetElements\", void 0);\n return ToggleVisibilityAction;\n}(Action));\nexports.ToggleVisibilityAction = ToggleVisibilityAction;\nvar StringWithSubstitutionProperty = /** @class */ (function (_super) {\n __extends(StringWithSubstitutionProperty, _super);\n function StringWithSubstitutionProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, undefined, function () { return new shared_1.StringWithSubstitutions(); }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n StringWithSubstitutionProperty.prototype.parse = function (sender, source, context) {\n var result = new shared_1.StringWithSubstitutions();\n result.set(Utils.parseString(source[this.name]));\n return result;\n };\n StringWithSubstitutionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value.getOriginal());\n };\n return StringWithSubstitutionProperty;\n}(serialization_1.PropertyDefinition));\nvar HttpHeader = /** @class */ (function (_super) {\n __extends(HttpHeader, _super);\n //#endregion\n function HttpHeader(name, value) {\n if (name === void 0) { name = \"\"; }\n if (value === void 0) { value = \"\"; }\n var _this = _super.call(this) || this;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n HttpHeader.prototype.getSchemaKey = function () {\n return \"HttpHeader\";\n };\n HttpHeader.prototype.getReferencedInputs = function (inputs, referencedInputs) {\n this._value.getReferencedInputs(inputs, referencedInputs);\n };\n HttpHeader.prototype.prepareForExecution = function (inputs) {\n this._value.substituteInputValues(inputs, shared_1.ContentTypes.applicationXWwwFormUrlencoded);\n };\n Object.defineProperty(HttpHeader.prototype, \"value\", {\n get: function () {\n return this._value.get();\n },\n set: function (newValue) {\n this._value.set(newValue);\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n HttpHeader.nameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"name\");\n HttpHeader.valueProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"value\");\n __decorate([\n serialization_1.property(HttpHeader.nameProperty)\n ], HttpHeader.prototype, \"name\", void 0);\n __decorate([\n serialization_1.property(HttpHeader.valueProperty)\n ], HttpHeader.prototype, \"_value\", void 0);\n return HttpHeader;\n}(serialization_1.SerializableObject));\nexports.HttpHeader = HttpHeader;\nvar HttpAction = /** @class */ (function (_super) {\n __extends(HttpAction, _super);\n function HttpAction() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._ignoreInputValidation = false;\n return _this;\n }\n HttpAction.prototype.internalGetReferencedInputs = function () {\n var allInputs = this.parent ? this.parent.getRootElement().getAllInputs() : [];\n var result = {};\n this._url.getReferencedInputs(allInputs, result);\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n header.getReferencedInputs(allInputs, result);\n }\n this._body.getReferencedInputs(allInputs, result);\n return result;\n };\n HttpAction.prototype.internalPrepareForExecution = function (inputs) {\n if (inputs) {\n this._url.substituteInputValues(inputs, shared_1.ContentTypes.applicationXWwwFormUrlencoded);\n var contentType = shared_1.ContentTypes.applicationJson;\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n header.prepareForExecution(inputs);\n if (header.name && header.name.toLowerCase() == \"content-type\") {\n contentType = header.value;\n }\n }\n this._body.substituteInputValues(inputs, contentType);\n }\n };\n ;\n HttpAction.prototype.getJsonTypeName = function () {\n return HttpAction.JsonTypeName;\n };\n HttpAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (!this.url) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"url\"));\n }\n if (this.headers.length > 0) {\n for (var _i = 0, _a = this.headers; _i < _a.length; _i++) {\n var header = _a[_i];\n if (!header.name) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.actionHttpHeadersMustHaveNameAndValue());\n }\n }\n }\n };\n Object.defineProperty(HttpAction.prototype, \"ignoreInputValidation\", {\n get: function () {\n return this._ignoreInputValidation;\n },\n set: function (value) {\n this._ignoreInputValidation = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HttpAction.prototype, \"url\", {\n get: function () {\n return this._url.get();\n },\n set: function (value) {\n this._url.set(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HttpAction.prototype, \"body\", {\n get: function () {\n return this._body.get();\n },\n set: function (value) {\n this._body.set(value);\n },\n enumerable: false,\n configurable: true\n });\n HttpAction.urlProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"url\");\n HttpAction.bodyProperty = new StringWithSubstitutionProperty(serialization_1.Versions.v1_0, \"body\");\n HttpAction.methodProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"method\");\n HttpAction.headersProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_0, \"headers\", HttpHeader);\n HttpAction.ignoreInputValidationProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_3, \"ignoreInputValidation\", false);\n //#endregion\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n HttpAction.JsonTypeName = \"Action.Http\";\n __decorate([\n serialization_1.property(HttpAction.urlProperty)\n ], HttpAction.prototype, \"_url\", void 0);\n __decorate([\n serialization_1.property(HttpAction.bodyProperty)\n ], HttpAction.prototype, \"_body\", void 0);\n __decorate([\n serialization_1.property(HttpAction.methodProperty)\n ], HttpAction.prototype, \"method\", void 0);\n __decorate([\n serialization_1.property(HttpAction.headersProperty)\n ], HttpAction.prototype, \"headers\", void 0);\n __decorate([\n serialization_1.property(HttpAction.ignoreInputValidationProperty)\n ], HttpAction.prototype, \"_ignoreInputValidation\", void 0);\n return HttpAction;\n}(Action));\nexports.HttpAction = HttpAction;\nvar ShowCardAction = /** @class */ (function (_super) {\n __extends(ShowCardAction, _super);\n function ShowCardAction() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.card = new InlineAdaptiveCard();\n return _this;\n }\n ShowCardAction.prototype.updateCssClasses = function () {\n _super.prototype.updateCssClasses.call(this);\n if (this.renderedElement) {\n var effectiveHostConfig = this.parent ? this.parent.hostConfig : host_config_1.defaultHostConfig;\n this.renderedElement.classList.add(effectiveHostConfig.makeCssClassName(\"expandable\"));\n this.renderedElement.setAttribute(\"aria-expanded\", (this.state === 1 /* Expanded */).toString());\n }\n };\n ShowCardAction.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n var jsonCard = source[\"card\"];\n if (jsonCard) {\n this.card.parse(jsonCard, context);\n }\n else {\n context.logParseEvent(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.showCardMustHaveCard());\n }\n };\n ShowCardAction.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n if (this.card) {\n context.serializeValue(target, \"card\", this.card.toJSON(context));\n }\n };\n ShowCardAction.prototype.raiseExecuteActionEvent = function () {\n if (this.hostConfig.actions.showCard.actionMode === Enums.ShowCardActionMode.Popup) {\n // Only raise the event in Popup mode.\n _super.prototype.raiseExecuteActionEvent.call(this);\n }\n };\n ShowCardAction.prototype.getJsonTypeName = function () {\n return ShowCardAction.JsonTypeName;\n };\n ShowCardAction.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n this.card.internalValidateProperties(context);\n };\n ShowCardAction.prototype.setParent = function (value) {\n _super.prototype.setParent.call(this, value);\n this.card.setParent(value);\n };\n ShowCardAction.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return this.card.getAllInputs(processActions);\n };\n ShowCardAction.prototype.getResourceInformation = function () {\n return _super.prototype.getResourceInformation.call(this).concat(this.card.getResourceInformation());\n };\n ShowCardAction.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result) {\n result = this.card.getActionById(id);\n }\n return result;\n };\n // Note the \"weird\" way this field is declared is to work around a breaking\n // change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n ShowCardAction.JsonTypeName = \"Action.ShowCard\";\n return ShowCardAction;\n}(Action));\nexports.ShowCardAction = ShowCardAction;\nvar OverflowAction = /** @class */ (function (_super) {\n __extends(OverflowAction, _super);\n function OverflowAction(actions) {\n var _this = _super.call(this) || this;\n _this.actions = actions;\n _this.title = strings_1.Strings.defaults.overflowButtonText();\n return _this;\n }\n OverflowAction.prototype.getActions = function () {\n return this.actions;\n };\n OverflowAction.prototype.getJsonTypeName = function () {\n return ShowCardAction.JsonTypeName;\n };\n OverflowAction.prototype.execute = function () {\n var _this = this;\n var _a;\n var shouldDisplayPopupMenu = !raiseDisplayOverflowActionMenuEvent(this, this.renderedElement);\n if (shouldDisplayPopupMenu && this.renderedElement) {\n var contextMenu_1 = new controls_1.PopupMenu();\n contextMenu_1.hostConfig = this.hostConfig;\n var _loop_1 = function (i) {\n var menuItem = new controls_1.MenuItem(i.toString(), (_a = this_1.actions[i].title) !== null && _a !== void 0 ? _a : \"\");\n menuItem.isEnabled = this_1.actions[i].isEnabled;\n menuItem.onClick = function () {\n var actionToExecute = _this.actions[i];\n contextMenu_1.closePopup(false);\n if (actionToExecute.isEnabled) {\n actionToExecute.execute();\n }\n };\n contextMenu_1.items.add(menuItem);\n };\n var this_1 = this;\n for (var i = 0; i < this.actions.length; i++) {\n _loop_1(i);\n }\n ;\n contextMenu_1.popup(this.renderedElement);\n }\n };\n OverflowAction.JsonTypeName = \"Action.Overflow\";\n return OverflowAction;\n}(Action));\nvar ActionCollection = /** @class */ (function () {\n function ActionCollection(owner) {\n this._items = [];\n this._renderedActions = [];\n this._owner = owner;\n }\n ActionCollection.prototype.isActionAllowed = function (action) {\n var forbiddenTypes = this._owner.getForbiddenActionTypes();\n if (forbiddenTypes) {\n for (var _i = 0, forbiddenTypes_1 = forbiddenTypes; _i < forbiddenTypes_1.length; _i++) {\n var forbiddenType = forbiddenTypes_1[_i];\n if (action.constructor === forbiddenType) {\n return false;\n }\n }\n }\n return true;\n };\n ActionCollection.prototype.refreshContainer = function () {\n this._actionCardContainer.innerHTML = \"\";\n if (!this._actionCard) {\n this._actionCardContainer.style.marginTop = \"0px\";\n return;\n }\n this._actionCardContainer.style.marginTop = this.renderedActionCount > 0 ? this._owner.hostConfig.actions.showCard.inlineTopMargin + \"px\" : \"0px\";\n var padding = this._owner.getEffectivePadding();\n this._owner.getImmediateSurroundingPadding(padding);\n var physicalPadding = this._owner.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n if (this._actionCard) {\n this._actionCard.style.paddingLeft = physicalPadding.left + \"px\";\n this._actionCard.style.paddingRight = physicalPadding.right + \"px\";\n this._actionCard.style.marginLeft = \"-\" + physicalPadding.left + \"px\";\n this._actionCard.style.marginRight = \"-\" + physicalPadding.right + \"px\";\n if (physicalPadding.bottom != 0 && !this._owner.isDesignMode()) {\n this._actionCard.style.paddingBottom = physicalPadding.bottom + \"px\";\n this._actionCard.style.marginBottom = \"-\" + physicalPadding.bottom + \"px\";\n }\n Utils.appendChild(this._actionCardContainer, this._actionCard);\n }\n };\n ActionCollection.prototype.layoutChanged = function () {\n this._owner.getRootElement().updateLayout();\n };\n ActionCollection.prototype.showActionCard = function (action, suppressStyle, raiseEvent) {\n if (suppressStyle === void 0) { suppressStyle = false; }\n if (raiseEvent === void 0) { raiseEvent = true; }\n action.card.suppressStyle = suppressStyle;\n // Always re-render a ShowCard action in design mode; reuse already rendered ShowCard (if available) otherwise\n var renderedCard = action.card.renderedElement && !this._owner.isDesignMode() ? action.card.renderedElement : action.card.render();\n this._actionCard = renderedCard;\n this._expandedAction = action;\n this.refreshContainer();\n if (raiseEvent) {\n this.layoutChanged();\n raiseInlineCardExpandedEvent(action, true);\n }\n };\n ActionCollection.prototype.collapseExpandedAction = function () {\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var action = _a[_i];\n action.state = 0 /* Normal */;\n }\n var previouslyExpandedAction = this._expandedAction;\n this._expandedAction = undefined;\n this._actionCard = undefined;\n this.refreshContainer();\n if (previouslyExpandedAction) {\n this.layoutChanged();\n raiseInlineCardExpandedEvent(previouslyExpandedAction, false);\n }\n };\n ActionCollection.prototype.expandShowCardAction = function (action, raiseEvent) {\n var _this = this;\n var afterSelectedAction = false;\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var renderedAction = _a[_i];\n // Remove actions after selected action from tabOrder, to skip focus directly to expanded card\n if (afterSelectedAction) {\n renderedAction.isFocusable = false;\n }\n if (renderedAction !== action) {\n renderedAction.state = 2 /* Subdued */;\n }\n else {\n renderedAction.state = 1 /* Expanded */;\n afterSelectedAction = true;\n if (renderedAction.renderedElement) {\n renderedAction.renderedElement.onblur = function (e) {\n for (var _i = 0, _a = _this._renderedActions; _i < _a.length; _i++) {\n var ra = _a[_i];\n ra.isFocusable = true;\n }\n };\n }\n }\n }\n this.showActionCard(action, !(this._owner.isAtTheVeryLeft() && this._owner.isAtTheVeryRight()), raiseEvent);\n };\n ActionCollection.prototype.actionExecuted = function (action) {\n if (!(action instanceof ShowCardAction)) {\n this.collapseExpandedAction();\n }\n else {\n if (action === this._expandedAction) {\n this.collapseExpandedAction();\n }\n else if (this._owner.hostConfig.actions.showCard.actionMode === Enums.ShowCardActionMode.Inline) {\n this.expandShowCardAction(action, true);\n }\n }\n };\n ActionCollection.prototype.parse = function (source, context) {\n this.clear();\n if (Array.isArray(source)) {\n for (var _i = 0, source_1 = source; _i < source_1.length; _i++) {\n var jsonAction = source_1[_i];\n var action = context.parseAction(this._owner, jsonAction, [], !this._owner.isDesignMode());\n if (action) {\n this.addAction(action);\n }\n }\n }\n };\n ActionCollection.prototype.toJSON = function (target, propertyName, context) {\n context.serializeArray(target, propertyName, this._items);\n };\n ActionCollection.prototype.getActionAt = function (id) {\n return this._items[id];\n };\n ActionCollection.prototype.getActionCount = function () {\n return this._items.length;\n };\n ActionCollection.prototype.getActionById = function (id) {\n var result = undefined;\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n result = item.getActionById(id);\n if (result) {\n break;\n }\n }\n return result;\n };\n ActionCollection.prototype.validateProperties = function (context) {\n if (this._owner.hostConfig.actions.maxActions && this._items.length > this._owner.hostConfig.actions.maxActions) {\n context.addFailure(this._owner, Enums.ValidationEvent.TooManyActions, strings_1.Strings.errors.tooManyActions(this._owner.hostConfig.actions.maxActions));\n }\n if (this._items.length > 0 && !this._owner.hostConfig.supportsInteractivity) {\n context.addFailure(this._owner, Enums.ValidationEvent.InteractivityNotAllowed, strings_1.Strings.errors.interactivityNotAllowed());\n }\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (!this.isActionAllowed(item)) {\n context.addFailure(this._owner, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(item.getJsonTypeName()));\n }\n item.internalValidateProperties(context);\n }\n };\n ActionCollection.prototype.render = function (orientation, isDesignMode) {\n // Cache hostConfig for better perf\n var hostConfig = this._owner.hostConfig;\n if (!hostConfig.supportsInteractivity) {\n return undefined;\n }\n var element = document.createElement(\"div\");\n var maxActions = hostConfig.actions.maxActions ? Math.min(hostConfig.actions.maxActions, this._items.length) : this._items.length;\n this._actionCardContainer = document.createElement(\"div\");\n this._renderedActions = [];\n if (hostConfig.actions.preExpandSingleShowCardAction && maxActions == 1 && this._items[0] instanceof ShowCardAction && this.isActionAllowed(this._items[0])) {\n this.showActionCard(this._items[0], true);\n this._renderedActions.push(this._items[0]);\n }\n else {\n var buttonStrip = document.createElement(\"div\");\n buttonStrip.className = hostConfig.makeCssClassName(\"ac-actionSet\");\n buttonStrip.style.display = \"flex\";\n buttonStrip.setAttribute(\"role\", \"menubar\");\n if (orientation == Enums.Orientation.Horizontal) {\n buttonStrip.style.flexDirection = \"row\";\n if (this._owner.horizontalAlignment && hostConfig.actions.actionAlignment != Enums.ActionAlignment.Stretch) {\n switch (this._owner.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n buttonStrip.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n buttonStrip.style.justifyContent = \"flex-end\";\n break;\n default:\n buttonStrip.style.justifyContent = \"flex-start\";\n break;\n }\n }\n else {\n switch (hostConfig.actions.actionAlignment) {\n case Enums.ActionAlignment.Center:\n buttonStrip.style.justifyContent = \"center\";\n break;\n case Enums.ActionAlignment.Right:\n buttonStrip.style.justifyContent = \"flex-end\";\n break;\n default:\n buttonStrip.style.justifyContent = \"flex-start\";\n break;\n }\n }\n }\n else {\n buttonStrip.style.flexDirection = \"column\";\n if (this._owner.horizontalAlignment && hostConfig.actions.actionAlignment != Enums.ActionAlignment.Stretch) {\n switch (this._owner.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n buttonStrip.style.alignItems = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n buttonStrip.style.alignItems = \"flex-end\";\n break;\n default:\n buttonStrip.style.alignItems = \"flex-start\";\n break;\n }\n }\n else {\n switch (hostConfig.actions.actionAlignment) {\n case Enums.ActionAlignment.Center:\n buttonStrip.style.alignItems = \"center\";\n break;\n case Enums.ActionAlignment.Right:\n buttonStrip.style.alignItems = \"flex-end\";\n break;\n case Enums.ActionAlignment.Stretch:\n buttonStrip.style.alignItems = \"stretch\";\n break;\n default:\n buttonStrip.style.alignItems = \"flex-start\";\n break;\n }\n }\n }\n var allowedActions = this._items.filter(this.isActionAllowed.bind(this));\n var primaryActions_1 = [];\n var secondaryActions_1 = [];\n if (!this._owner.isDesignMode()) {\n allowedActions.forEach(function (action) { return action.mode === Enums.ActionMode.Secondary ? secondaryActions_1.push(action) : primaryActions_1.push(action); });\n // If primaryActions.length > maxActions, extra actions are moved to overflow\n var overflowPrimaryActions = primaryActions_1.splice(hostConfig.actions.maxActions);\n if (shared_1.GlobalSettings.allowMoreThanMaxActionsInOverflowMenu) {\n secondaryActions_1.push.apply(secondaryActions_1, overflowPrimaryActions);\n }\n var shouldRenderOverflowActionButton = true;\n if (secondaryActions_1.length > 0) {\n if (!this._overflowAction) {\n this._overflowAction = new OverflowAction(secondaryActions_1);\n this._overflowAction.setParent(this._owner);\n this._overflowAction[\"_actionCollection\"] = this;\n }\n var isRootAction = this._owner instanceof AdaptiveCard && !this._owner.parent;\n shouldRenderOverflowActionButton = !raiseRenderOverflowActionsEvent(this._overflowAction, isRootAction);\n }\n if (this._overflowAction && shouldRenderOverflowActionButton) {\n primaryActions_1.push(this._overflowAction);\n }\n }\n else {\n primaryActions_1 = allowedActions;\n }\n for (var i = 0; i < primaryActions_1.length; i++) {\n var action = primaryActions_1[i];\n action.render();\n if (action.renderedElement) {\n if (primaryActions_1.length > 1) {\n action.renderedElement.setAttribute(\"aria-posinset\", (i + 1).toString());\n action.renderedElement.setAttribute(\"aria-setsize\", primaryActions_1.length.toString());\n action.renderedElement.setAttribute(\"role\", \"menuitem\");\n }\n if (hostConfig.actions.actionsOrientation == Enums.Orientation.Horizontal && hostConfig.actions.actionAlignment == Enums.ActionAlignment.Stretch) {\n action.renderedElement.style.flex = \"0 1 100%\";\n }\n else {\n action.renderedElement.style.flex = \"0 1 auto\";\n }\n buttonStrip.appendChild(action.renderedElement);\n this._renderedActions.push(action);\n if (i < primaryActions_1.length - 1 && hostConfig.actions.buttonSpacing > 0) {\n var spacer = document.createElement(\"div\");\n if (orientation === Enums.Orientation.Horizontal) {\n spacer.style.flex = \"0 0 auto\";\n spacer.style.width = hostConfig.actions.buttonSpacing + \"px\";\n }\n else {\n spacer.style.height = hostConfig.actions.buttonSpacing + \"px\";\n }\n Utils.appendChild(buttonStrip, spacer);\n }\n }\n }\n var buttonStripContainer = document.createElement(\"div\");\n buttonStripContainer.style.overflow = \"hidden\";\n buttonStripContainer.appendChild(buttonStrip);\n Utils.appendChild(element, buttonStripContainer);\n }\n Utils.appendChild(element, this._actionCardContainer);\n for (var _i = 0, _a = this._renderedActions; _i < _a.length; _i++) {\n var renderedAction = _a[_i];\n if (renderedAction.state == 1 /* Expanded */) {\n this.expandShowCardAction(renderedAction, false);\n break;\n }\n }\n return this._renderedActions.length > 0 ? element : undefined;\n };\n ActionCollection.prototype.addAction = function (action) {\n if (!action) {\n throw new Error(\"The action parameter cannot be null.\");\n }\n if ((!action.parent || action.parent === this._owner) && this._items.indexOf(action) < 0) {\n this._items.push(action);\n if (!action.parent) {\n action.setParent(this._owner);\n }\n action[\"_actionCollection\"] = this;\n }\n else {\n throw new Error(strings_1.Strings.errors.actionAlreadyParented());\n }\n };\n ActionCollection.prototype.removeAction = function (action) {\n if (this.expandedAction && this._expandedAction == action) {\n this.collapseExpandedAction();\n }\n var actionIndex = this._items.indexOf(action);\n if (actionIndex >= 0) {\n this._items.splice(actionIndex, 1);\n action.setParent(undefined);\n action[\"_actionCollection\"] = undefined;\n for (var i = 0; i < this._renderedActions.length; i++) {\n if (this._renderedActions[i] == action) {\n this._renderedActions.splice(i, 1);\n break;\n }\n }\n return true;\n }\n return false;\n };\n ActionCollection.prototype.clear = function () {\n this._items = [];\n this._renderedActions = [];\n this._expandedAction = undefined;\n };\n ActionCollection.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = [];\n if (processActions) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var action = _a[_i];\n result = result.concat(action.getAllInputs());\n }\n }\n return result;\n };\n ActionCollection.prototype.getResourceInformation = function () {\n var result = [];\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var action = _a[_i];\n result = result.concat(action.getResourceInformation());\n }\n return result;\n };\n Object.defineProperty(ActionCollection.prototype, \"renderedActionCount\", {\n get: function () {\n return this._renderedActions.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ActionCollection.prototype, \"expandedAction\", {\n get: function () {\n return this._expandedAction;\n },\n enumerable: false,\n configurable: true\n });\n return ActionCollection;\n}());\nvar ActionSet = /** @class */ (function (_super) {\n __extends(ActionSet, _super);\n function ActionSet() {\n var _this = _super.call(this) || this;\n _this._actionCollection = new ActionCollection(_this);\n return _this;\n }\n ActionSet.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._actionCollection.parse(source[\"actions\"], context);\n };\n ActionSet.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n this._actionCollection.toJSON(target, \"actions\", context);\n };\n ActionSet.prototype.internalRender = function () {\n return this._actionCollection.render(this.orientation !== undefined ? this.orientation : this.hostConfig.actions.actionsOrientation, this.isDesignMode());\n };\n ActionSet.prototype.isBleedingAtBottom = function () {\n if (this._actionCollection.renderedActionCount == 0) {\n return _super.prototype.isBleedingAtBottom.call(this);\n }\n else {\n if (this._actionCollection.getActionCount() == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n }\n };\n ActionSet.prototype.getJsonTypeName = function () {\n return \"ActionSet\";\n };\n ActionSet.prototype.getActionCount = function () {\n return this._actionCollection.getActionCount();\n };\n ActionSet.prototype.getActionAt = function (index) {\n if (index >= 0 && index < this.getActionCount()) {\n return this._actionCollection.getActionAt(index);\n }\n else {\n return _super.prototype.getActionAt.call(this, index);\n }\n };\n ActionSet.prototype.getActionById = function (id) {\n var result = this._actionCollection.getActionById(id);\n return result ? result : _super.prototype.getActionById.call(this, id);\n };\n ActionSet.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n this._actionCollection.validateProperties(context);\n };\n ActionSet.prototype.addAction = function (action) {\n this._actionCollection.addAction(action);\n };\n ActionSet.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n return processActions ? this._actionCollection.getAllInputs() : [];\n };\n ActionSet.prototype.getResourceInformation = function () {\n return this._actionCollection.getResourceInformation();\n };\n /**\n * @inheritdoc\n */\n ActionSet.prototype.findDOMNodeOwner = function (node) {\n var target = undefined;\n for (var i = 0; i < this.getActionCount(); i++) {\n var action = this.getActionAt(i);\n if (action) {\n // recur through each Action\n target = action.findDOMNodeOwner(node);\n if (target) {\n return target;\n }\n }\n }\n // if not found in any Action, defer to parent implementation\n return _super.prototype.findDOMNodeOwner.call(this, node);\n };\n Object.defineProperty(ActionSet.prototype, \"isInteractive\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n ActionSet.orientationProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_1, \"orientation\", Enums.Orientation);\n __decorate([\n serialization_1.property(ActionSet.orientationProperty)\n ], ActionSet.prototype, \"orientation\", void 0);\n return ActionSet;\n}(CardElement));\nexports.ActionSet = ActionSet;\nvar ContainerStyleProperty = /** @class */ (function (_super) {\n __extends(ContainerStyleProperty, _super);\n function ContainerStyleProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, [\n { value: Enums.ContainerStyle.Default },\n { value: Enums.ContainerStyle.Emphasis },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Accent },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Good },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Attention },\n { targetVersion: serialization_1.Versions.v1_2, value: Enums.ContainerStyle.Warning }\n ], defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n return ContainerStyleProperty;\n}(serialization_1.ValueSetProperty));\nexports.ContainerStyleProperty = ContainerStyleProperty;\nvar StylableCardElementContainer = /** @class */ (function (_super) {\n __extends(StylableCardElementContainer, _super);\n function StylableCardElementContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(StylableCardElementContainer.prototype, \"style\", {\n get: function () {\n if (this.allowCustomStyle) {\n var style = this.getValue(StylableCardElementContainer.styleProperty);\n if (style && this.hostConfig.containerStyles.getStyleByName(style)) {\n return style;\n }\n }\n return undefined;\n },\n set: function (value) {\n this.setValue(StylableCardElementContainer.styleProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StylableCardElementContainer.prototype, \"allowCustomStyle\", {\n //#endregion\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StylableCardElementContainer.prototype, \"hasExplicitStyle\", {\n get: function () {\n return this.getValue(StylableCardElementContainer.styleProperty) !== undefined;\n },\n enumerable: false,\n configurable: true\n });\n StylableCardElementContainer.prototype.applyBorder = function () {\n // No border in base implementation\n };\n StylableCardElementContainer.prototype.applyBackground = function () {\n if (this.renderedElement) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.style, this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));\n if (styleDefinition.backgroundColor) {\n var bgColor = Utils.stringToCssColor(styleDefinition.backgroundColor);\n this.renderedElement.style.backgroundColor = bgColor;\n }\n }\n };\n StylableCardElementContainer.prototype.applyPadding = function () {\n _super.prototype.applyPadding.call(this);\n if (!this.renderedElement) {\n return;\n }\n var physicalPadding = new shared_1.SpacingDefinition();\n if (this.getEffectivePadding()) {\n physicalPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(this.getEffectivePadding());\n }\n this.renderedElement.style.paddingTop = physicalPadding.top + \"px\";\n this.renderedElement.style.paddingRight = physicalPadding.right + \"px\";\n this.renderedElement.style.paddingBottom = physicalPadding.bottom + \"px\";\n this.renderedElement.style.paddingLeft = physicalPadding.left + \"px\";\n if (this.isBleeding()) {\n // Bleed into the first parent that does have padding\n var padding = new shared_1.PaddingDefinition();\n this.getImmediateSurroundingPadding(padding);\n var surroundingPadding = this.hostConfig.paddingDefinitionToSpacingDefinition(padding);\n this.renderedElement.style.marginRight = \"-\" + surroundingPadding.right + \"px\";\n this.renderedElement.style.marginLeft = \"-\" + surroundingPadding.left + \"px\";\n if (!this.isDesignMode()) {\n this.renderedElement.style.marginTop = \"-\" + surroundingPadding.top + \"px\";\n this.renderedElement.style.marginBottom = \"-\" + surroundingPadding.bottom + \"px\";\n }\n if (this.separatorElement && this.separatorOrientation == Enums.Orientation.Horizontal) {\n this.separatorElement.style.marginLeft = \"-\" + surroundingPadding.left + \"px\";\n this.separatorElement.style.marginRight = \"-\" + surroundingPadding.right + \"px\";\n }\n }\n else {\n this.renderedElement.style.marginRight = \"0\";\n this.renderedElement.style.marginLeft = \"0\";\n this.renderedElement.style.marginTop = \"0\";\n this.renderedElement.style.marginBottom = \"0\";\n if (this.separatorElement && this.separatorOrientation === Enums.Orientation.Horizontal) {\n this.separatorElement.style.marginRight = \"0\";\n this.separatorElement.style.marginLeft = \"0\";\n }\n }\n };\n StylableCardElementContainer.prototype.getHasBackground = function () {\n var currentElement = this.parent;\n while (currentElement) {\n var currentElementHasBackgroundImage = currentElement instanceof Container ? currentElement.backgroundImage.isValid() : false;\n if (currentElement instanceof StylableCardElementContainer) {\n if (this.hasExplicitStyle && (currentElement.getEffectiveStyle() != this.getEffectiveStyle() || currentElementHasBackgroundImage)) {\n return true;\n }\n }\n currentElement = currentElement.parent;\n }\n return false;\n };\n StylableCardElementContainer.prototype.getDefaultPadding = function () {\n return this.getHasBackground() || this.getHasBorder() ?\n new shared_1.PaddingDefinition(Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding) : _super.prototype.getDefaultPadding.call(this);\n };\n StylableCardElementContainer.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n var explicitStyle = this.getValue(StylableCardElementContainer.styleProperty);\n if (explicitStyle !== undefined) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(explicitStyle);\n if (!styleDefinition) {\n context.addFailure(this, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(explicitStyle, \"style\"));\n }\n }\n };\n StylableCardElementContainer.prototype.render = function () {\n var renderedElement = _super.prototype.render.call(this);\n if (renderedElement && this.getHasBackground()) {\n this.applyBackground();\n }\n this.applyBorder();\n return renderedElement;\n };\n StylableCardElementContainer.prototype.getEffectiveStyle = function () {\n var effectiveStyle = this.style;\n return effectiveStyle ? effectiveStyle : _super.prototype.getEffectiveStyle.call(this);\n };\n //#region Schema\n StylableCardElementContainer.styleProperty = new ContainerStyleProperty(serialization_1.Versions.v1_0, \"style\");\n __decorate([\n serialization_1.property(StylableCardElementContainer.styleProperty)\n ], StylableCardElementContainer.prototype, \"style\", null);\n return StylableCardElementContainer;\n}(CardElementContainer));\nexports.StylableCardElementContainer = StylableCardElementContainer;\nvar ContainerBase = /** @class */ (function (_super) {\n __extends(ContainerBase, _super);\n function ContainerBase() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._bleed = false;\n return _this;\n }\n //#endregion\n ContainerBase.prototype.adjustRenderedElementSize = function (renderedElement) {\n _super.prototype.adjustRenderedElementSize.call(this, renderedElement);\n if (this.minPixelHeight) {\n renderedElement.style.minHeight = this.minPixelHeight + \"px\";\n }\n };\n ContainerBase.prototype.getHasExpandedAction = function () {\n return false;\n };\n ContainerBase.prototype.getBleed = function () {\n return this._bleed;\n };\n ContainerBase.prototype.setBleed = function (value) {\n this._bleed = value;\n };\n Object.defineProperty(ContainerBase.prototype, \"renderedActionCount\", {\n get: function () {\n return 0;\n },\n enumerable: false,\n configurable: true\n });\n ContainerBase.prototype.isBleeding = function () {\n return (this.getHasBackground() || this.hostConfig.alwaysAllowBleed) && this.getBleed();\n };\n ContainerBase.bleedProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_2, \"bleed\", false);\n ContainerBase.minHeightProperty = new serialization_1.PixelSizeProperty(serialization_1.Versions.v1_2, \"minHeight\");\n __decorate([\n serialization_1.property(ContainerBase.bleedProperty)\n ], ContainerBase.prototype, \"_bleed\", void 0);\n __decorate([\n serialization_1.property(ContainerBase.minHeightProperty)\n ], ContainerBase.prototype, \"minPixelHeight\", void 0);\n return ContainerBase;\n}(StylableCardElementContainer));\nexports.ContainerBase = ContainerBase;\nvar BackgroundImage = /** @class */ (function (_super) {\n __extends(BackgroundImage, _super);\n function BackgroundImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n BackgroundImage.prototype.getSchemaKey = function () {\n return \"BackgroundImage\";\n };\n BackgroundImage.prototype.internalParse = function (source, context) {\n if (typeof source === \"string\") {\n this.resetDefaultValues();\n this.url = source;\n }\n else {\n return _super.prototype.internalParse.call(this, source, context);\n }\n };\n BackgroundImage.prototype.apply = function (element) {\n if (this.url && element.renderedElement) {\n element.renderedElement.style.backgroundImage = \"url('\" + element.preProcessPropertyValue(BackgroundImage.urlProperty, this.url) + \"')\";\n switch (this.fillMode) {\n case Enums.FillMode.Repeat:\n element.renderedElement.style.backgroundRepeat = \"repeat\";\n break;\n case Enums.FillMode.RepeatHorizontally:\n element.renderedElement.style.backgroundRepeat = \"repeat-x\";\n break;\n case Enums.FillMode.RepeatVertically:\n element.renderedElement.style.backgroundRepeat = \"repeat-y\";\n break;\n case Enums.FillMode.Cover:\n default:\n element.renderedElement.style.backgroundRepeat = \"no-repeat\";\n element.renderedElement.style.backgroundSize = \"cover\";\n break;\n }\n switch (this.horizontalAlignment) {\n case Enums.HorizontalAlignment.Center:\n element.renderedElement.style.backgroundPositionX = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.renderedElement.style.backgroundPositionX = \"right\";\n break;\n }\n switch (this.verticalAlignment) {\n case Enums.VerticalAlignment.Center:\n element.renderedElement.style.backgroundPositionY = \"center\";\n break;\n case Enums.VerticalAlignment.Bottom:\n element.renderedElement.style.backgroundPositionY = \"bottom\";\n break;\n }\n }\n };\n BackgroundImage.prototype.isValid = function () {\n return this.url ? true : false;\n };\n //#region Schema\n BackgroundImage.urlProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"url\");\n BackgroundImage.fillModeProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"fillMode\", Enums.FillMode, Enums.FillMode.Cover);\n BackgroundImage.horizontalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"horizontalAlignment\", Enums.HorizontalAlignment, Enums.HorizontalAlignment.Left);\n BackgroundImage.verticalAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_2, \"verticalAlignment\", Enums.VerticalAlignment, Enums.VerticalAlignment.Top);\n __decorate([\n serialization_1.property(BackgroundImage.urlProperty)\n ], BackgroundImage.prototype, \"url\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.fillModeProperty)\n ], BackgroundImage.prototype, \"fillMode\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.horizontalAlignmentProperty)\n ], BackgroundImage.prototype, \"horizontalAlignment\", void 0);\n __decorate([\n serialization_1.property(BackgroundImage.verticalAlignmentProperty)\n ], BackgroundImage.prototype, \"verticalAlignment\", void 0);\n return BackgroundImage;\n}(serialization_1.SerializableObject));\nexports.BackgroundImage = BackgroundImage;\nvar Container = /** @class */ (function (_super) {\n __extends(Container, _super);\n function Container() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._items = [];\n _this._renderedItems = [];\n return _this;\n }\n Object.defineProperty(Container.prototype, \"backgroundImage\", {\n get: function () {\n return this.getValue(Container.backgroundImageProperty);\n },\n enumerable: false,\n configurable: true\n });\n Container.prototype.insertItemAt = function (item, index, forceInsert) {\n if (!item.parent || forceInsert) {\n if (item.isStandalone) {\n if (index < 0 || index >= this._items.length) {\n this._items.push(item);\n }\n else {\n this._items.splice(index, 0, item);\n }\n item.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.elementTypeNotStandalone(item.getJsonTypeName()));\n }\n }\n else {\n throw new Error(strings_1.Strings.errors.elementAlreadyParented());\n }\n };\n Container.prototype.getItemsCollectionPropertyName = function () {\n return \"items\";\n };\n Container.prototype.applyBackground = function () {\n if (this.backgroundImage.isValid() && this.renderedElement) {\n this.backgroundImage.apply(this);\n }\n _super.prototype.applyBackground.call(this);\n };\n Container.prototype.internalRender = function () {\n this._renderedItems = [];\n // Cache hostConfig to avoid walking the parent hierarchy several times\n var hostConfig = this.hostConfig;\n var element = document.createElement(\"div\");\n if (this.rtl !== undefined) {\n element.dir = this.rtl ? \"rtl\" : \"ltr\";\n }\n element.classList.add(hostConfig.makeCssClassName(\"ac-container\"));\n element.style.display = \"flex\";\n element.style.flexDirection = \"column\";\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n // Forces the container to be at least as tall as its content.\n //\n // Fixes a quirk in Chrome where, for nested flex elements, the\n // inner element's height would never exceed the outer element's\n // height. This caused overflow truncation to break -- containers\n // would always be measured as not overflowing, since their heights\n // were constrained by their parents as opposed to truly reflecting\n // the height of their content.\n //\n // See the \"Browser Rendering Notes\" section of this answer:\n // https://stackoverflow.com/questions/36247140/why-doesnt-flex-item-shrink-past-content-size\n element.style.minHeight = '-webkit-min-content';\n }\n switch (this.getEffectiveVerticalContentAlignment()) {\n case Enums.VerticalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.VerticalAlignment.Bottom:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n if (this._items.length > 0) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n var renderedItem = this.isElementAllowed(item) ? item.render() : undefined;\n if (renderedItem) {\n if (this._renderedItems.length > 0 && item.separatorElement) {\n item.separatorElement.style.flex = \"0 0 auto\";\n Utils.appendChild(element, item.separatorElement);\n }\n Utils.appendChild(element, renderedItem);\n this._renderedItems.push(item);\n }\n }\n }\n else {\n if (this.isDesignMode()) {\n var placeholderElement = this.createPlaceholderElement();\n placeholderElement.style.width = \"100%\";\n placeholderElement.style.height = \"100%\";\n element.appendChild(placeholderElement);\n }\n }\n return element;\n };\n Container.prototype.truncateOverflow = function (maxHeight) {\n if (this.renderedElement) {\n // Add 1 to account for rounding differences between browsers\n var boundary_1 = this.renderedElement.offsetTop + maxHeight + 1;\n var handleElement_1 = function (cardElement) {\n var elt = cardElement.renderedElement;\n if (elt) {\n switch (Utils.getFitStatus(elt, boundary_1)) {\n case Enums.ContainerFitStatus.FullyInContainer:\n var sizeChanged = cardElement['resetOverflow']();\n // If the element's size changed after resetting content,\n // we have to check if it still fits fully in the card\n if (sizeChanged) {\n handleElement_1(cardElement);\n }\n break;\n case Enums.ContainerFitStatus.Overflowing:\n var maxHeight_1 = boundary_1 - elt.offsetTop;\n cardElement['handleOverflow'](maxHeight_1);\n break;\n case Enums.ContainerFitStatus.FullyOutOfContainer:\n cardElement['handleOverflow'](0);\n break;\n }\n }\n };\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n handleElement_1(item);\n }\n return true;\n }\n return false;\n };\n Container.prototype.undoOverflowTruncation = function () {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n item['resetOverflow']();\n }\n };\n Container.prototype.getHasBackground = function () {\n return this.backgroundImage.isValid() || _super.prototype.getHasBackground.call(this);\n };\n Container.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this.clear();\n this.setShouldFallback(false);\n var jsonItems = source[this.getItemsCollectionPropertyName()];\n if (Array.isArray(jsonItems)) {\n for (var _i = 0, jsonItems_1 = jsonItems; _i < jsonItems_1.length; _i++) {\n var item = jsonItems_1[_i];\n var element = context.parseElement(this, item, !this.isDesignMode());\n if (element) {\n this.insertItemAt(element, -1, true);\n }\n }\n }\n };\n Container.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, this.getItemsCollectionPropertyName(), this._items);\n };\n Object.defineProperty(Container.prototype, \"isSelectable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Container.prototype.getEffectiveVerticalContentAlignment = function () {\n if (this.verticalContentAlignment !== undefined) {\n return this.verticalContentAlignment;\n }\n var parentContainer = this.getParentContainer();\n return parentContainer ? parentContainer.getEffectiveVerticalContentAlignment() : Enums.VerticalAlignment.Top;\n };\n Container.prototype.getItemCount = function () {\n return this._items.length;\n };\n Container.prototype.getItemAt = function (index) {\n return this._items[index];\n };\n Container.prototype.getFirstVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedItems && this._renderedItems.length > 0) {\n for (var _i = 0, _a = this._renderedItems; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.isVisible) {\n return item;\n }\n }\n ;\n }\n return undefined;\n };\n Container.prototype.getLastVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedItems && this._renderedItems.length > 0) {\n for (var i = this._renderedItems.length - 1; i >= 0; i--) {\n if (this._renderedItems[i].isVisible) {\n return this._renderedItems[i];\n }\n }\n }\n return undefined;\n };\n Container.prototype.getJsonTypeName = function () {\n return \"Container\";\n };\n Container.prototype.isFirstElement = function (element) {\n var designMode = this.isDesignMode();\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.isVisible || designMode) {\n return item == element;\n }\n }\n return false;\n };\n Container.prototype.isLastElement = function (element) {\n var designMode = this.isDesignMode();\n for (var i = this._items.length - 1; i >= 0; i--) {\n if (this._items[i].isVisible || designMode) {\n return this._items[i] == element;\n }\n }\n return false;\n };\n Container.prototype.isRtl = function () {\n if (this.rtl !== undefined) {\n return this.rtl;\n }\n else {\n var parentContainer = this.getParentContainer();\n return parentContainer ? parentContainer.isRtl() : false;\n }\n };\n Container.prototype.isBleedingAtTop = function () {\n var firstRenderedItem = this.getFirstVisibleRenderedItem();\n return this.isBleeding() || (firstRenderedItem ? firstRenderedItem.isBleedingAtTop() : false);\n };\n Container.prototype.isBleedingAtBottom = function () {\n var lastRenderedItem = this.getLastVisibleRenderedItem();\n return this.isBleeding() || (lastRenderedItem ? lastRenderedItem.isBleedingAtBottom() && lastRenderedItem.getEffectiveStyle() == this.getEffectiveStyle() : false);\n };\n Container.prototype.indexOf = function (cardElement) {\n return this._items.indexOf(cardElement);\n };\n Container.prototype.addItem = function (item) {\n this.insertItemAt(item, -1, false);\n };\n Container.prototype.insertItemBefore = function (item, insertBefore) {\n this.insertItemAt(item, this._items.indexOf(insertBefore), false);\n };\n Container.prototype.insertItemAfter = function (item, insertAfter) {\n this.insertItemAt(item, this._items.indexOf(insertAfter) + 1, false);\n };\n Container.prototype.removeItem = function (item) {\n var itemIndex = this._items.indexOf(item);\n if (itemIndex >= 0) {\n this._items.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n return false;\n };\n Container.prototype.clear = function () {\n this._items = [];\n this._renderedItems = [];\n };\n Container.prototype.getResourceInformation = function () {\n var result = _super.prototype.getResourceInformation.call(this);\n if (this.backgroundImage.isValid()) {\n result.push({\n url: this.backgroundImage.url,\n mimeType: \"image\"\n });\n }\n return result;\n };\n Container.prototype.getActionById = function (id) {\n var result = _super.prototype.getActionById.call(this, id);\n if (!result) {\n if (this.selectAction) {\n result = this.selectAction.getActionById(id);\n }\n if (!result) {\n for (var _i = 0, _a = this._items; _i < _a.length; _i++) {\n var item = _a[_i];\n result = item.getActionById(id);\n if (result) {\n break;\n }\n }\n }\n }\n return result;\n };\n Object.defineProperty(Container.prototype, \"padding\", {\n get: function () {\n return this.getPadding();\n },\n set: function (value) {\n this.setPadding(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"selectAction\", {\n get: function () {\n return this._selectAction;\n },\n set: function (value) {\n this._selectAction = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"bleed\", {\n get: function () {\n return this.getBleed();\n },\n set: function (value) {\n this.setBleed(value);\n },\n enumerable: false,\n configurable: true\n });\n Container.backgroundImageProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_0, \"backgroundImage\", BackgroundImage);\n Container.verticalContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_1, \"verticalContentAlignment\", Enums.VerticalAlignment);\n Container.rtlProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_0, \"rtl\");\n __decorate([\n serialization_1.property(Container.backgroundImageProperty)\n ], Container.prototype, \"backgroundImage\", null);\n __decorate([\n serialization_1.property(Container.verticalContentAlignmentProperty)\n ], Container.prototype, \"verticalContentAlignment\", void 0);\n __decorate([\n serialization_1.property(Container.rtlProperty)\n ], Container.prototype, \"rtl\", void 0);\n return Container;\n}(ContainerBase));\nexports.Container = Container;\nvar Column = /** @class */ (function (_super) {\n __extends(Column, _super);\n function Column(width) {\n if (width === void 0) { width = \"stretch\"; }\n var _this = _super.call(this) || this;\n _this.width = \"stretch\";\n //#endregion\n _this._computedWeight = 0;\n _this.width = width;\n return _this;\n }\n Column.prototype.adjustRenderedElementSize = function (renderedElement) {\n var minDesignTimeColumnHeight = 20;\n if (this.isDesignMode()) {\n renderedElement.style.minWidth = \"20px\";\n renderedElement.style.minHeight = (!this.minPixelHeight ? minDesignTimeColumnHeight : Math.max(this.minPixelHeight, minDesignTimeColumnHeight)) + \"px\";\n }\n else {\n renderedElement.style.minWidth = \"0\";\n if (this.minPixelHeight) {\n renderedElement.style.minHeight = this.minPixelHeight + \"px\";\n }\n }\n if (this.width === \"auto\") {\n renderedElement.style.flex = \"0 1 auto\";\n }\n else if (this.width === \"stretch\") {\n renderedElement.style.flex = \"1 1 50px\";\n }\n else if (this.width instanceof shared_1.SizeAndUnit) {\n if (this.width.unit == Enums.SizeUnit.Pixel) {\n renderedElement.style.flex = \"0 0 auto\";\n renderedElement.style.width = this.width.physicalSize + \"px\";\n }\n else {\n renderedElement.style.flex = \"1 1 \" + (this._computedWeight > 0 ? this._computedWeight : this.width.physicalSize) + \"%\";\n }\n }\n };\n Column.prototype.shouldSerialize = function (context) {\n return true;\n };\n Object.defineProperty(Column.prototype, \"separatorOrientation\", {\n get: function () {\n return Enums.Orientation.Vertical;\n },\n enumerable: false,\n configurable: true\n });\n Column.prototype.getJsonTypeName = function () {\n return \"Column\";\n };\n Object.defineProperty(Column.prototype, \"hasVisibleSeparator\", {\n get: function () {\n if (this.parent && this.parent instanceof ColumnSet) {\n return this.separatorElement !== undefined && !this.parent.isLeftMostElement(this);\n }\n else {\n return false;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Column.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n Column.widthProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"width\", function (sender, property, source, context) {\n var result = property.defaultValue;\n var value = source[property.name];\n var invalidWidth = false;\n if (typeof value === \"number\" && !isNaN(value)) {\n result = new shared_1.SizeAndUnit(value, Enums.SizeUnit.Weight);\n }\n else if (value === \"auto\" || value === \"stretch\") {\n result = value;\n }\n else if (typeof value === \"string\") {\n try {\n result = shared_1.SizeAndUnit.parse(value);\n if (result.unit === Enums.SizeUnit.Pixel && property.targetVersion.compareTo(context.targetVersion) > 0) {\n invalidWidth = true;\n }\n }\n catch (e) {\n invalidWidth = true;\n }\n }\n else {\n invalidWidth = true;\n }\n if (invalidWidth) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidColumnWidth(value));\n result = \"auto\";\n }\n return result;\n }, function (sender, property, target, value, context) {\n if (value instanceof shared_1.SizeAndUnit) {\n if (value.unit === Enums.SizeUnit.Pixel) {\n context.serializeValue(target, \"width\", value.physicalSize + \"px\");\n }\n else {\n context.serializeNumber(target, \"width\", value.physicalSize);\n }\n }\n else {\n context.serializeValue(target, \"width\", value);\n }\n }, \"stretch\");\n __decorate([\n serialization_1.property(Column.widthProperty)\n ], Column.prototype, \"width\", void 0);\n return Column;\n}(Container));\nexports.Column = Column;\nvar ColumnSet = /** @class */ (function (_super) {\n __extends(ColumnSet, _super);\n function ColumnSet() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columns = [];\n return _this;\n }\n ColumnSet.prototype.createColumnInstance = function (source, context) {\n return context.parseCardObject(this, source, [], // Forbidden types not supported for elements for now\n !this.isDesignMode(), function (typeName) {\n return !typeName || typeName === \"Column\" ? new Column() : undefined;\n }, function (typeName, errorType) {\n context.logParseEvent(undefined, Enums.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n });\n };\n ColumnSet.prototype.internalRender = function () {\n this._renderedColumns = [];\n if (this._columns.length > 0) {\n // Cache hostConfig to avoid walking the parent hierarchy several times\n var hostConfig = this.hostConfig;\n var element = document.createElement(\"div\");\n element.className = hostConfig.makeCssClassName(\"ac-columnSet\");\n element.style.display = \"flex\";\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation) {\n // See comment in Container.internalRender()\n element.style.minHeight = '-webkit-min-content';\n }\n switch (this.getEffectiveHorizontalAlignment()) {\n case Enums.HorizontalAlignment.Center:\n element.style.justifyContent = \"center\";\n break;\n case Enums.HorizontalAlignment.Right:\n element.style.justifyContent = \"flex-end\";\n break;\n default:\n element.style.justifyContent = \"flex-start\";\n break;\n }\n var totalWeight = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.width instanceof shared_1.SizeAndUnit && (column.width.unit == Enums.SizeUnit.Weight)) {\n totalWeight += column.width.physicalSize;\n }\n }\n for (var _b = 0, _c = this._columns; _b < _c.length; _b++) {\n var column = _c[_b];\n if (column.width instanceof shared_1.SizeAndUnit && column.width.unit == Enums.SizeUnit.Weight && totalWeight > 0) {\n var computedWeight = 100 / totalWeight * column.width.physicalSize;\n // Best way to emulate \"internal\" access I know of\n column[\"_computedWeight\"] = computedWeight;\n }\n var renderedColumn = column.render();\n if (renderedColumn) {\n if (this._renderedColumns.length > 0 && column.separatorElement) {\n column.separatorElement.style.flex = \"0 0 auto\";\n Utils.appendChild(element, column.separatorElement);\n }\n Utils.appendChild(element, renderedColumn);\n this._renderedColumns.push(column);\n }\n }\n return this._renderedColumns.length > 0 ? element : undefined;\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.truncateOverflow = function (maxHeight) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n column['handleOverflow'](maxHeight);\n }\n return true;\n };\n ColumnSet.prototype.undoOverflowTruncation = function () {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n column['resetOverflow']();\n }\n };\n Object.defineProperty(ColumnSet.prototype, \"isSelectable\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n ColumnSet.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._columns = [];\n this._renderedColumns = [];\n var jsonColumns = source[\"columns\"];\n if (Array.isArray(jsonColumns)) {\n for (var _i = 0, jsonColumns_1 = jsonColumns; _i < jsonColumns_1.length; _i++) {\n var item = jsonColumns_1[_i];\n var column = this.createColumnInstance(item, context);\n if (column) {\n this._columns.push(column);\n }\n }\n }\n };\n ColumnSet.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, \"columns\", this._columns);\n };\n ColumnSet.prototype.isFirstElement = function (element) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isVisible) {\n return column == element;\n }\n }\n return false;\n };\n ColumnSet.prototype.isBleedingAtTop = function () {\n if (this.isBleeding()) {\n return true;\n }\n if (this._renderedColumns && this._renderedColumns.length > 0) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isBleedingAtTop()) {\n return true;\n }\n }\n }\n return false;\n };\n ColumnSet.prototype.isBleedingAtBottom = function () {\n if (this.isBleeding()) {\n return true;\n }\n if (this._renderedColumns && this._renderedColumns.length > 0) {\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.isBleedingAtBottom()) {\n return true;\n }\n }\n }\n return false;\n };\n ColumnSet.prototype.getItemCount = function () {\n return this._columns.length;\n };\n ColumnSet.prototype.getFirstVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedColumns && this._renderedColumns.length > 0) {\n return this._renderedColumns[0];\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.getLastVisibleRenderedItem = function () {\n if (this.renderedElement && this._renderedColumns && this._renderedColumns.length > 0) {\n return this._renderedColumns[this._renderedColumns.length - 1];\n }\n else {\n return undefined;\n }\n };\n ColumnSet.prototype.getColumnAt = function (index) {\n return this._columns[index];\n };\n ColumnSet.prototype.getItemAt = function (index) {\n return this.getColumnAt(index);\n };\n ColumnSet.prototype.getJsonTypeName = function () {\n return \"ColumnSet\";\n };\n ColumnSet.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n var weightedColumns = 0;\n var stretchedColumns = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (typeof column.width === \"number\") {\n weightedColumns++;\n }\n else if (column.width === \"stretch\") {\n stretchedColumns++;\n }\n }\n if (weightedColumns > 0 && stretchedColumns > 0) {\n context.addFailure(this, Enums.ValidationEvent.Hint, strings_1.Strings.hints.dontUseWeightedAndStrecthedColumnsInSameSet());\n }\n };\n ColumnSet.prototype.addColumn = function (column) {\n if (!column.parent) {\n this._columns.push(column);\n column.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.columnAlreadyBelongsToAnotherSet());\n }\n };\n ColumnSet.prototype.removeItem = function (item) {\n if (item instanceof Column) {\n var itemIndex = this._columns.indexOf(item);\n if (itemIndex >= 0) {\n this._columns.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n }\n return false;\n };\n ColumnSet.prototype.indexOf = function (cardElement) {\n return cardElement instanceof Column ? this._columns.indexOf(cardElement) : -1;\n };\n ColumnSet.prototype.isLeftMostElement = function (element) {\n return this._columns.indexOf(element) == 0;\n };\n ColumnSet.prototype.isRightMostElement = function (element) {\n return this._columns.indexOf(element) == this._columns.length - 1;\n };\n ColumnSet.prototype.isTopElement = function (element) {\n return this._columns.indexOf(element) >= 0;\n };\n ColumnSet.prototype.isBottomElement = function (element) {\n return this._columns.indexOf(element) >= 0;\n };\n ColumnSet.prototype.getActionById = function (id) {\n var result = undefined;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n result = column.getActionById(id);\n if (result) {\n break;\n }\n }\n return result;\n };\n Object.defineProperty(ColumnSet.prototype, \"bleed\", {\n get: function () {\n return this.getBleed();\n },\n set: function (value) {\n this.setBleed(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnSet.prototype, \"padding\", {\n get: function () {\n return this.getPadding();\n },\n set: function (value) {\n this.setPadding(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColumnSet.prototype, \"selectAction\", {\n get: function () {\n return this._selectAction;\n },\n set: function (value) {\n this._selectAction = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColumnSet;\n}(ContainerBase));\nexports.ColumnSet = ColumnSet;\nfunction raiseImageLoadedEvent(image) {\n var card = image.getRootElement();\n var onImageLoadedHandler = (card && card.onImageLoaded) ? card.onImageLoaded : AdaptiveCard.onImageLoaded;\n if (onImageLoadedHandler) {\n onImageLoadedHandler(image);\n }\n}\nfunction raiseAnchorClickedEvent(element, anchor, ev) {\n var card = element.getRootElement();\n var onAnchorClickedHandler = (card && card.onAnchorClicked) ? card.onAnchorClicked : AdaptiveCard.onAnchorClicked;\n return onAnchorClickedHandler !== undefined ? onAnchorClickedHandler(element, anchor, ev) : false;\n}\nfunction raiseExecuteActionEvent(action) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onExecuteActionHandler = (card && card.onExecuteAction) ? card.onExecuteAction : AdaptiveCard.onExecuteAction;\n if (action.prepareForExecution() && onExecuteActionHandler) {\n onExecuteActionHandler(action);\n }\n}\nfunction raiseInlineCardExpandedEvent(action, isExpanded) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onInlineCardExpandedHandler = (card && card.onInlineCardExpanded) ? card.onInlineCardExpanded : AdaptiveCard.onInlineCardExpanded;\n if (onInlineCardExpandedHandler) {\n onInlineCardExpandedHandler(action, isExpanded);\n }\n}\nfunction raiseInputValueChangedEvent(input) {\n var card = input.getRootElement();\n var onInputValueChangedHandler = (card && card.onInputValueChanged) ? card.onInputValueChanged : AdaptiveCard.onInputValueChanged;\n if (onInputValueChangedHandler) {\n onInputValueChangedHandler(input);\n }\n}\nfunction raiseElementVisibilityChangedEvent(element, shouldUpdateLayout) {\n if (shouldUpdateLayout === void 0) { shouldUpdateLayout = true; }\n var rootElement = element.getRootElement();\n if (shouldUpdateLayout) {\n rootElement.updateLayout();\n }\n var card = rootElement;\n var onElementVisibilityChangedHandler = (card && card.onElementVisibilityChanged) ? card.onElementVisibilityChanged : AdaptiveCard.onElementVisibilityChanged;\n if (onElementVisibilityChangedHandler !== undefined) {\n onElementVisibilityChangedHandler(element);\n }\n}\n/**\n * @returns return false to continue with default context menu; return true to skip SDK default context menu\n */\nfunction raiseDisplayOverflowActionMenuEvent(action, target) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onDisplayOverflowActionMenuHandler = (card && card.onDisplayOverflowActionMenu) ? card.onDisplayOverflowActionMenu : AdaptiveCard.onDisplayOverflowActionMenu;\n return onDisplayOverflowActionMenuHandler !== undefined ? onDisplayOverflowActionMenuHandler(action.getActions(), target) : false;\n}\n/**\n * @returns return false to continue with default action button; return true to skip SDK default action button\n */\nfunction raiseRenderOverflowActionsEvent(action, isAtRootLevelActions) {\n var card = action.parent ? action.parent.getRootElement() : undefined;\n var onRenderOverflowActionsHandler = (card && card.onRenderOverflowActions) ? card.onRenderOverflowActions : AdaptiveCard.onRenderOverflowActions;\n return onRenderOverflowActionsHandler !== undefined ? onRenderOverflowActionsHandler(action.getActions(), isAtRootLevelActions) : false;\n}\nvar ContainerWithActions = /** @class */ (function (_super) {\n __extends(ContainerWithActions, _super);\n function ContainerWithActions() {\n var _this = _super.call(this) || this;\n _this._actionCollection = new ActionCollection(_this);\n return _this;\n }\n ContainerWithActions.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._actionCollection.parse(source[\"actions\"], context);\n };\n ContainerWithActions.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n this._actionCollection.toJSON(target, \"actions\", context);\n };\n ContainerWithActions.prototype.internalRender = function () {\n var element = _super.prototype.internalRender.call(this);\n if (element) {\n var renderedActions = this._actionCollection.render(this.hostConfig.actions.actionsOrientation, false);\n if (renderedActions) {\n Utils.appendChild(element, renderSeparation(this.hostConfig, {\n spacing: this.hostConfig.getEffectiveSpacing(this.hostConfig.actions.spacing)\n }, Enums.Orientation.Horizontal));\n Utils.appendChild(element, renderedActions);\n }\n if (this.renderIfEmpty) {\n return element;\n }\n else {\n return element.children.length > 0 ? element : undefined;\n }\n }\n else {\n return undefined;\n }\n };\n ContainerWithActions.prototype.getHasExpandedAction = function () {\n if (this.renderedActionCount == 0) {\n return false;\n }\n else if (this.renderedActionCount == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n };\n Object.defineProperty(ContainerWithActions.prototype, \"renderedActionCount\", {\n get: function () {\n return this._actionCollection.renderedActionCount;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ContainerWithActions.prototype, \"renderIfEmpty\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n ContainerWithActions.prototype.getActionCount = function () {\n return this._actionCollection.getActionCount();\n };\n ContainerWithActions.prototype.getActionAt = function (index) {\n if (index >= 0 && index < this.getActionCount()) {\n return this._actionCollection.getActionAt(index);\n }\n else {\n return _super.prototype.getActionAt.call(this, index);\n }\n };\n ContainerWithActions.prototype.getActionById = function (id) {\n var result = this._actionCollection.getActionById(id);\n return result ? result : _super.prototype.getActionById.call(this, id);\n };\n ContainerWithActions.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this._actionCollection) {\n this._actionCollection.validateProperties(context);\n }\n };\n ContainerWithActions.prototype.isLastElement = function (element) {\n return _super.prototype.isLastElement.call(this, element) && this._actionCollection.getActionCount() == 0;\n };\n ContainerWithActions.prototype.addAction = function (action) {\n this._actionCollection.addAction(action);\n };\n ContainerWithActions.prototype.clear = function () {\n _super.prototype.clear.call(this);\n this._actionCollection.clear();\n };\n ContainerWithActions.prototype.getAllInputs = function (processActions) {\n if (processActions === void 0) { processActions = true; }\n var result = _super.prototype.getAllInputs.call(this, processActions);\n if (processActions) {\n result = result.concat(this._actionCollection.getAllInputs(processActions));\n }\n return result;\n };\n ContainerWithActions.prototype.getResourceInformation = function () {\n return _super.prototype.getResourceInformation.call(this).concat(this._actionCollection.getResourceInformation());\n };\n ContainerWithActions.prototype.isBleedingAtBottom = function () {\n if (this._actionCollection.renderedActionCount == 0) {\n return _super.prototype.isBleedingAtBottom.call(this);\n }\n else {\n if (this._actionCollection.getActionCount() == 1) {\n return this._actionCollection.expandedAction !== undefined && !this.hostConfig.actions.preExpandSingleShowCardAction;\n }\n else {\n return this._actionCollection.expandedAction !== undefined;\n }\n }\n };\n Object.defineProperty(ContainerWithActions.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return ContainerWithActions;\n}(Container));\nexports.ContainerWithActions = ContainerWithActions;\nvar RefreshActionProperty = /** @class */ (function (_super) {\n __extends(RefreshActionProperty, _super);\n function RefreshActionProperty(targetVersion, name) {\n var _this = _super.call(this, targetVersion, name, undefined) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n return _this;\n }\n RefreshActionProperty.prototype.parse = function (sender, source, context) {\n var action = context.parseAction(sender.parent, source[this.name], [], false);\n if (action !== undefined) {\n if (action instanceof ExecuteAction) {\n return action;\n }\n context.logParseEvent(sender, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(action.getJsonTypeName()));\n }\n context.logParseEvent(sender, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"action\"));\n return undefined;\n };\n RefreshActionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value ? value.toJSON(context) : undefined, undefined, true);\n };\n return RefreshActionProperty;\n}(serialization_1.PropertyDefinition));\nexports.RefreshActionProperty = RefreshActionProperty;\nvar RefreshDefinition = /** @class */ (function (_super) {\n __extends(RefreshDefinition, _super);\n function RefreshDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RefreshDefinition.prototype, \"action\", {\n get: function () {\n return this.getValue(RefreshDefinition.actionProperty);\n },\n set: function (value) {\n this.setValue(RefreshDefinition.actionProperty, value);\n if (value) {\n value.setParent(this.parent);\n }\n },\n enumerable: false,\n configurable: true\n });\n RefreshDefinition.prototype.getSchemaKey = function () {\n return \"RefreshDefinition\";\n };\n //#region Schema\n RefreshDefinition.actionProperty = new RefreshActionProperty(serialization_1.Versions.v1_4, \"action\");\n RefreshDefinition.userIdsProperty = new serialization_1.StringArrayProperty(serialization_1.Versions.v1_4, \"userIds\");\n __decorate([\n serialization_1.property(RefreshDefinition.actionProperty)\n ], RefreshDefinition.prototype, \"action\", null);\n __decorate([\n serialization_1.property(RefreshDefinition.userIdsProperty)\n ], RefreshDefinition.prototype, \"userIds\", void 0);\n return RefreshDefinition;\n}(serialization_1.SerializableObject));\nexports.RefreshDefinition = RefreshDefinition;\nvar AuthCardButton = /** @class */ (function (_super) {\n __extends(AuthCardButton, _super);\n function AuthCardButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AuthCardButton.prototype.getSchemaKey = function () {\n return \"AuthCardButton\";\n };\n //#region Schema\n AuthCardButton.typeProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"type\");\n AuthCardButton.titleProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"title\");\n AuthCardButton.imageProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"image\");\n AuthCardButton.valueProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"value\");\n __decorate([\n serialization_1.property(AuthCardButton.typeProperty)\n ], AuthCardButton.prototype, \"type\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.titleProperty)\n ], AuthCardButton.prototype, \"title\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.imageProperty)\n ], AuthCardButton.prototype, \"image\", void 0);\n __decorate([\n serialization_1.property(AuthCardButton.valueProperty)\n ], AuthCardButton.prototype, \"value\", void 0);\n return AuthCardButton;\n}(serialization_1.SerializableObject));\nexports.AuthCardButton = AuthCardButton;\nvar TokenExchangeResource = /** @class */ (function (_super) {\n __extends(TokenExchangeResource, _super);\n function TokenExchangeResource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TokenExchangeResource.prototype.getSchemaKey = function () {\n return \"TokenExchangeResource\";\n };\n //#region Schema\n TokenExchangeResource.idProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"id\");\n TokenExchangeResource.uriProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"uri\");\n TokenExchangeResource.providerIdProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"providerId\");\n __decorate([\n serialization_1.property(TokenExchangeResource.idProperty)\n ], TokenExchangeResource.prototype, \"id\", void 0);\n __decorate([\n serialization_1.property(TokenExchangeResource.uriProperty)\n ], TokenExchangeResource.prototype, \"uri\", void 0);\n __decorate([\n serialization_1.property(TokenExchangeResource.providerIdProperty)\n ], TokenExchangeResource.prototype, \"providerId\", void 0);\n return TokenExchangeResource;\n}(serialization_1.SerializableObject));\nexports.TokenExchangeResource = TokenExchangeResource;\nvar Authentication = /** @class */ (function (_super) {\n __extends(Authentication, _super);\n function Authentication() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Authentication.prototype.getSchemaKey = function () {\n return \"Authentication\";\n };\n //#region Schema\n Authentication.textProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"text\");\n Authentication.connectionNameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_4, \"connectionName\");\n Authentication.buttonsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_4, \"buttons\", AuthCardButton);\n Authentication.tokenExchangeResourceProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"tokenExchangeResource\", TokenExchangeResource, true);\n __decorate([\n serialization_1.property(Authentication.textProperty)\n ], Authentication.prototype, \"text\", void 0);\n __decorate([\n serialization_1.property(Authentication.connectionNameProperty)\n ], Authentication.prototype, \"connectionName\", void 0);\n __decorate([\n serialization_1.property(Authentication.buttonsProperty)\n ], Authentication.prototype, \"buttons\", void 0);\n __decorate([\n serialization_1.property(Authentication.tokenExchangeResourceProperty)\n ], Authentication.prototype, \"tokenExchangeResource\", void 0);\n return Authentication;\n}(serialization_1.SerializableObject));\nexports.Authentication = Authentication;\n// @dynamic\nvar AdaptiveCard = /** @class */ (function (_super) {\n __extends(AdaptiveCard, _super);\n function AdaptiveCard() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.designMode = false;\n return _this;\n }\n Object.defineProperty(AdaptiveCard.prototype, \"refresh\", {\n get: function () {\n return this.getValue(AdaptiveCard.refreshProperty);\n },\n set: function (value) {\n this.setValue(AdaptiveCard.refreshProperty, value);\n if (value) {\n value.parent = this;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard, \"processMarkdown\", {\n get: function () {\n throw new Error(strings_1.Strings.errors.processMarkdownEventRemoved());\n },\n set: function (value) {\n throw new Error(strings_1.Strings.errors.processMarkdownEventRemoved());\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.applyMarkdown = function (text) {\n var result = {\n didProcess: false\n };\n if (AdaptiveCard.onProcessMarkdown) {\n AdaptiveCard.onProcessMarkdown(text, result);\n }\n else if (window.markdownit) {\n // Check for markdownit\n var markdownIt = window.markdownit;\n result.outputHtml = markdownIt().render(text);\n result.didProcess = true;\n }\n else {\n console.warn(strings_1.Strings.errors.markdownProcessingNotEnabled);\n }\n return result;\n };\n AdaptiveCard.prototype.isVersionSupported = function () {\n if (this.bypassVersionCheck) {\n return true;\n }\n else {\n var unsupportedVersion = !this.version ||\n !this.version.isValid ||\n (this.maxVersion.major < this.version.major) ||\n (this.maxVersion.major == this.version.major && this.maxVersion.minor < this.version.minor);\n return !unsupportedVersion;\n }\n };\n AdaptiveCard.prototype.getDefaultSerializationContext = function () {\n return new SerializationContext(this.version);\n };\n AdaptiveCard.prototype.getItemsCollectionPropertyName = function () {\n return \"body\";\n };\n AdaptiveCard.prototype.internalParse = function (source, context) {\n this._fallbackCard = undefined;\n var fallbackElement = context.parseElement(undefined, source[\"fallback\"], !this.isDesignMode());\n if (fallbackElement) {\n this._fallbackCard = new AdaptiveCard();\n this._fallbackCard.addItem(fallbackElement);\n }\n _super.prototype.internalParse.call(this, source, context);\n };\n AdaptiveCard.prototype.internalToJSON = function (target, context) {\n this.setValue(AdaptiveCard.versionProperty, context.targetVersion);\n _super.prototype.internalToJSON.call(this, target, context);\n };\n AdaptiveCard.prototype.internalRender = function () {\n var renderedElement = _super.prototype.internalRender.call(this);\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && renderedElement) {\n // Unlike containers, the root card element should be allowed to\n // be shorter than its content (otherwise the overflow truncation\n // logic would never get triggered)\n renderedElement.style.removeProperty(\"minHeight\");\n }\n return renderedElement;\n };\n AdaptiveCard.prototype.getHasBackground = function () {\n return true;\n };\n AdaptiveCard.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding, Enums.Spacing.Padding);\n };\n AdaptiveCard.prototype.shouldSerialize = function (context) {\n return true;\n };\n Object.defineProperty(AdaptiveCard.prototype, \"renderIfEmpty\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"bypassVersionCheck\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"allowCustomStyle\", {\n get: function () {\n return this.hostConfig.adaptiveCard && this.hostConfig.adaptiveCard.allowCustomStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdaptiveCard.prototype, \"hasBackground\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.prototype.getJsonTypeName = function () {\n return \"AdaptiveCard\";\n };\n AdaptiveCard.prototype.internalValidateProperties = function (context) {\n _super.prototype.internalValidateProperties.call(this, context);\n if (this.getValue(CardElement.typeNameProperty) !== \"AdaptiveCard\") {\n context.addFailure(this, Enums.ValidationEvent.MissingCardType, strings_1.Strings.errors.invalidCardType());\n }\n if (!this.bypassVersionCheck && !this.version) {\n context.addFailure(this, Enums.ValidationEvent.PropertyCantBeNull, strings_1.Strings.errors.propertyMustBeSet(\"version\"));\n }\n else if (!this.isVersionSupported()) {\n context.addFailure(this, Enums.ValidationEvent.UnsupportedCardVersion, strings_1.Strings.errors.unsupportedCardVersion(this.version.toString(), this.maxVersion.toString()));\n }\n };\n AdaptiveCard.prototype.render = function (target) {\n var renderedCard;\n if (this.shouldFallback() && this._fallbackCard) {\n this._fallbackCard.hostConfig = this.hostConfig;\n renderedCard = this._fallbackCard.render();\n }\n else {\n renderedCard = _super.prototype.render.call(this);\n if (renderedCard) {\n renderedCard.classList.add(this.hostConfig.makeCssClassName(\"ac-adaptiveCard\"));\n // Having a tabIndex on the root container for a card can mess up accessibility in some scenarios.\n // However, we've shipped this behavior before, and so can't just turn it off in a point release. For\n // now, to unblock accessibility scenarios for our customers, we've got an option to turn it off. In a\n // future release, we should strongly consider flipping the default such that we *don't* emit a tabIndex\n // by default.\n if (shared_1.GlobalSettings.setTabIndexAtCardRoot) {\n renderedCard.tabIndex = 0;\n }\n if (this.speak) {\n renderedCard.setAttribute(\"aria-label\", this.speak);\n }\n }\n }\n if (target) {\n Utils.appendChild(target, renderedCard);\n this.updateLayout();\n }\n return renderedCard;\n };\n AdaptiveCard.prototype.updateLayout = function (processChildren) {\n if (processChildren === void 0) { processChildren = true; }\n _super.prototype.updateLayout.call(this, processChildren);\n if (shared_1.GlobalSettings.useAdvancedCardBottomTruncation && this.isDisplayed()) {\n var padding = this.hostConfig.getEffectiveSpacing(Enums.Spacing.Default);\n this['handleOverflow'](this.renderedElement.offsetHeight - padding);\n }\n };\n AdaptiveCard.prototype.shouldFallback = function () {\n return _super.prototype.shouldFallback.call(this) || !this.isVersionSupported();\n };\n Object.defineProperty(AdaptiveCard.prototype, \"hasVisibleSeparator\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveCard.schemaUrl = \"http://adaptivecards.io/schemas/adaptive-card.json\";\n //#region Schema\n AdaptiveCard.$schemaProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"$schema\", function (sender, property, source, context) {\n return AdaptiveCard.schemaUrl;\n }, function (sender, property, target, value, context) {\n context.serializeValue(target, property.name, AdaptiveCard.schemaUrl);\n });\n AdaptiveCard.versionProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_0, \"version\", function (sender, property, source, context) {\n var version = serialization_1.Version.parse(source[property.name], context);\n if (version === undefined) {\n version = serialization_1.Versions.latest;\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidCardVersion(version.toString()));\n }\n return version;\n }, function (sender, property, target, value, context) {\n if (value !== undefined) {\n context.serializeValue(target, property.name, value.toString());\n }\n }, serialization_1.Versions.v1_0);\n AdaptiveCard.fallbackTextProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"fallbackText\");\n AdaptiveCard.speakProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"speak\");\n AdaptiveCard.refreshProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"refresh\", RefreshDefinition, true);\n AdaptiveCard.authenticationProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_4, \"authentication\", Authentication, true);\n __decorate([\n serialization_1.property(AdaptiveCard.versionProperty)\n ], AdaptiveCard.prototype, \"version\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.fallbackTextProperty)\n ], AdaptiveCard.prototype, \"fallbackText\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.speakProperty)\n ], AdaptiveCard.prototype, \"speak\", void 0);\n __decorate([\n serialization_1.property(AdaptiveCard.refreshProperty)\n ], AdaptiveCard.prototype, \"refresh\", null);\n __decorate([\n serialization_1.property(AdaptiveCard.authenticationProperty)\n ], AdaptiveCard.prototype, \"authentication\", void 0);\n return AdaptiveCard;\n}(ContainerWithActions));\nexports.AdaptiveCard = AdaptiveCard;\nvar InlineAdaptiveCard = /** @class */ (function (_super) {\n __extends(InlineAdaptiveCard, _super);\n function InlineAdaptiveCard() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.suppressStyle = false;\n return _this;\n }\n InlineAdaptiveCard.prototype.getSchemaKey = function () {\n return \"InlineAdaptiveCard\";\n };\n InlineAdaptiveCard.prototype.populateSchema = function (schema) {\n _super.prototype.populateSchema.call(this, schema);\n schema.remove(AdaptiveCard.$schemaProperty, AdaptiveCard.versionProperty);\n };\n //#endregion\n InlineAdaptiveCard.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(this.suppressStyle ? Enums.Spacing.None : Enums.Spacing.Padding, Enums.Spacing.Padding, this.suppressStyle ? Enums.Spacing.None : Enums.Spacing.Padding, Enums.Spacing.Padding);\n };\n Object.defineProperty(InlineAdaptiveCard.prototype, \"bypassVersionCheck\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InlineAdaptiveCard.prototype, \"defaultStyle\", {\n get: function () {\n if (this.suppressStyle) {\n return Enums.ContainerStyle.Default;\n }\n else {\n return this.hostConfig.actions.showCard.style ? this.hostConfig.actions.showCard.style : Enums.ContainerStyle.Emphasis;\n }\n },\n enumerable: false,\n configurable: true\n });\n InlineAdaptiveCard.prototype.render = function (target) {\n var renderedCard = _super.prototype.render.call(this, target);\n if (renderedCard) {\n renderedCard.setAttribute(\"aria-live\", \"polite\");\n renderedCard.removeAttribute(\"tabindex\");\n }\n return renderedCard;\n };\n return InlineAdaptiveCard;\n}(AdaptiveCard));\nvar SerializationContext = /** @class */ (function (_super) {\n __extends(SerializationContext, _super);\n function SerializationContext() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SerializationContext.prototype.internalParseCardObject = function (parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent) {\n var result = undefined;\n if (source && typeof source === \"object\") {\n var typeName = Utils.parseString(source[\"type\"]);\n if (typeName && forbiddenTypeNames.indexOf(typeName) >= 0) {\n logParseEvent(typeName, Enums.TypeErrorType.ForbiddenType);\n }\n else {\n var tryToFallback = false;\n result = createInstanceCallback(typeName);\n if (!result) {\n tryToFallback = shared_1.GlobalSettings.enableFallback && allowFallback;\n logParseEvent(typeName, Enums.TypeErrorType.UnknownType);\n }\n else {\n result.setParent(parent);\n result.parse(source, this);\n tryToFallback = shared_1.GlobalSettings.enableFallback && allowFallback && result.shouldFallback();\n }\n if (tryToFallback) {\n var fallback = source[\"fallback\"];\n if (!fallback && parent) {\n parent.setShouldFallback(true);\n }\n if (typeof fallback === \"string\" && fallback.toLowerCase() === \"drop\") {\n result = undefined;\n }\n else if (typeof fallback === \"object\") {\n result = this.internalParseCardObject(parent, fallback, forbiddenTypeNames, true, createInstanceCallback, logParseEvent);\n }\n }\n }\n }\n return result;\n };\n SerializationContext.prototype.cardObjectParsed = function (o, source) {\n if (o instanceof Action && this.onParseAction) {\n this.onParseAction(o, source, this);\n }\n else if (o instanceof CardElement && this.onParseElement) {\n this.onParseElement(o, source, this);\n }\n };\n SerializationContext.prototype.shouldSerialize = function (o) {\n if (o instanceof Action) {\n return this.actionRegistry.findByName(o.getJsonTypeName()) !== undefined;\n }\n else if (o instanceof CardElement) {\n return this.elementRegistry.findByName(o.getJsonTypeName()) !== undefined;\n }\n else {\n return true;\n }\n };\n SerializationContext.prototype.parseCardObject = function (parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent) {\n var result = this.internalParseCardObject(parent, source, forbiddenTypeNames, allowFallback, createInstanceCallback, logParseEvent);\n if (result !== undefined) {\n this.cardObjectParsed(result, source);\n }\n return result;\n };\n SerializationContext.prototype.parseElement = function (parent, source, allowFallback) {\n var _this = this;\n return this.parseCardObject(parent, source, [], // Forbidden types not supported for elements for now\n allowFallback, function (typeName) {\n return _this.elementRegistry.createInstance(typeName, _this.targetVersion);\n }, function (typeName, errorType) {\n if (errorType === Enums.TypeErrorType.UnknownType) {\n _this.logParseEvent(undefined, Enums.ValidationEvent.UnknownElementType, strings_1.Strings.errors.unknownElementType(typeName));\n }\n else {\n _this.logParseEvent(undefined, Enums.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n }\n });\n };\n SerializationContext.prototype.parseAction = function (parent, source, forbiddenActionTypes, allowFallback) {\n var _this = this;\n return this.parseCardObject(parent, source, forbiddenActionTypes, allowFallback, function (typeName) {\n return _this.actionRegistry.createInstance(typeName, _this.targetVersion);\n }, function (typeName, errorType) {\n if (errorType == Enums.TypeErrorType.UnknownType) {\n _this.logParseEvent(undefined, Enums.ValidationEvent.UnknownActionType, strings_1.Strings.errors.unknownActionType(typeName));\n }\n else {\n _this.logParseEvent(undefined, Enums.ValidationEvent.ActionTypeNotAllowed, strings_1.Strings.errors.actionTypeNotAllowed(typeName));\n }\n });\n };\n Object.defineProperty(SerializationContext.prototype, \"elementRegistry\", {\n get: function () {\n return this._elementRegistry ? this._elementRegistry : registry_1.GlobalRegistry.elements;\n },\n enumerable: false,\n configurable: true\n });\n // Not using a property setter here because the setter should accept \"undefined\"\n // whereas the getter should never return undefined.\n SerializationContext.prototype.setElementRegistry = function (value) {\n this._elementRegistry = value;\n };\n Object.defineProperty(SerializationContext.prototype, \"actionRegistry\", {\n get: function () {\n return this._actionRegistry ? this._actionRegistry : registry_1.GlobalRegistry.actions;\n },\n enumerable: false,\n configurable: true\n });\n // Not using a property setter here because the setter should accept \"undefined\"\n // whereas the getter should never return undefined.\n SerializationContext.prototype.setActionRegistry = function (value) {\n this._actionRegistry = value;\n };\n return SerializationContext;\n}(serialization_1.BaseSerializationContext));\nexports.SerializationContext = SerializationContext;\nregistry_1.GlobalRegistry.defaultElements.register(\"Container\", Container);\nregistry_1.GlobalRegistry.defaultElements.register(\"TextBlock\", TextBlock);\nregistry_1.GlobalRegistry.defaultElements.register(\"RichTextBlock\", RichTextBlock, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"TextRun\", TextRun, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"Image\", Image);\nregistry_1.GlobalRegistry.defaultElements.register(\"ImageSet\", ImageSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"Media\", Media, serialization_1.Versions.v1_1);\nregistry_1.GlobalRegistry.defaultElements.register(\"FactSet\", FactSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"ColumnSet\", ColumnSet);\nregistry_1.GlobalRegistry.defaultElements.register(\"ActionSet\", ActionSet, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Text\", TextInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Date\", DateInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Time\", TimeInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Number\", NumberInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.ChoiceSet\", ChoiceSetInput);\nregistry_1.GlobalRegistry.defaultElements.register(\"Input.Toggle\", ToggleInput);\nregistry_1.GlobalRegistry.defaultActions.register(OpenUrlAction.JsonTypeName, OpenUrlAction);\nregistry_1.GlobalRegistry.defaultActions.register(SubmitAction.JsonTypeName, SubmitAction);\nregistry_1.GlobalRegistry.defaultActions.register(ShowCardAction.JsonTypeName, ShowCardAction);\nregistry_1.GlobalRegistry.defaultActions.register(ToggleVisibilityAction.JsonTypeName, ToggleVisibilityAction, serialization_1.Versions.v1_2);\nregistry_1.GlobalRegistry.defaultActions.register(ExecuteAction.JsonTypeName, ExecuteAction, serialization_1.Versions.v1_4);\n//# sourceMappingURL=card-elements.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CardObject = exports.ValidationResults = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar strings_1 = require(\"./strings\");\nvar shared_1 = require(\"./shared\");\nvar host_capabilities_1 = require(\"./host-capabilities\");\nvar serialization_1 = require(\"./serialization\");\nvar ValidationResults = /** @class */ (function () {\n function ValidationResults() {\n this.allIds = {};\n this.validationEvents = [];\n }\n ValidationResults.prototype.addFailure = function (cardObject, event, message) {\n this.validationEvents.push({\n phase: Enums.ValidationPhase.Validation,\n source: cardObject,\n event: event,\n message: message\n });\n };\n return ValidationResults;\n}());\nexports.ValidationResults = ValidationResults;\nvar CardObject = /** @class */ (function (_super) {\n __extends(CardObject, _super);\n function CardObject() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n //#endregion\n _this._shouldFallback = false;\n return _this;\n }\n CardObject.prototype.getSchemaKey = function () {\n return this.getJsonTypeName();\n };\n Object.defineProperty(CardObject.prototype, \"requires\", {\n get: function () {\n return this.getValue(CardObject.requiresProperty);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Checks if this CardObject contains the given DOM Node.\n * @param node The DOM Node to look for.\n * @returns `true` if the DOM Node was found, `false` otherwise.\n */\n CardObject.prototype.contains = function (node) {\n if (this._renderedElement) {\n return this._renderedElement.contains(node);\n }\n return false;\n };\n CardObject.prototype.preProcessPropertyValue = function (property, propertyValue) {\n var value = propertyValue === undefined ? this.getValue(property) : propertyValue;\n if (shared_1.GlobalSettings.allowPreProcessingPropertyValues) {\n var currentObject = this;\n while (currentObject && !currentObject.onPreProcessPropertyValue) {\n currentObject = currentObject.parent;\n }\n if (currentObject && currentObject.onPreProcessPropertyValue) {\n return currentObject.onPreProcessPropertyValue(this, property, value);\n }\n }\n return value;\n };\n CardObject.prototype.setParent = function (value) {\n this._parent = value;\n };\n CardObject.prototype.setShouldFallback = function (value) {\n this._shouldFallback = value;\n };\n CardObject.prototype.shouldFallback = function () {\n return this._shouldFallback || !this.requires.areAllMet(this.hostConfig.hostCapabilities);\n };\n CardObject.prototype.getRootObject = function () {\n var rootObject = this;\n while (rootObject.parent) {\n rootObject = rootObject.parent;\n }\n return rootObject;\n };\n CardObject.prototype.internalValidateProperties = function (context) {\n if (this.id) {\n if (context.allIds.hasOwnProperty(this.id)) {\n if (context.allIds[this.id] == 1) {\n context.addFailure(this, Enums.ValidationEvent.DuplicateId, strings_1.Strings.errors.duplicateId(this.id));\n }\n context.allIds[this.id] += 1;\n }\n else {\n context.allIds[this.id] = 1;\n }\n }\n };\n CardObject.prototype.validateProperties = function () {\n var result = new ValidationResults();\n this.internalValidateProperties(result);\n return result;\n };\n /**\n * Recursively searches this CardObject and any children to find the\n * innermost CardObject that owns the given DOM Node.\n *\n * @param node The DOM Node to look for.\n *\n * @returns The owner of the given DOM Node, or `undefined` if no owner was found.\n */\n CardObject.prototype.findDOMNodeOwner = function (node) {\n // default implementation for CardObjects with no associated children\n return this.contains(node) ? this : undefined;\n };\n Object.defineProperty(CardObject.prototype, \"parent\", {\n get: function () {\n return this._parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CardObject.prototype, \"renderedElement\", {\n get: function () {\n return this._renderedElement;\n },\n enumerable: false,\n configurable: true\n });\n CardObject.typeNameProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"type\", undefined, undefined, undefined, function (sender) {\n return sender.getJsonTypeName();\n });\n CardObject.idProperty = new serialization_1.StringProperty(serialization_1.Versions.v1_0, \"id\");\n CardObject.requiresProperty = new serialization_1.SerializableObjectProperty(serialization_1.Versions.v1_2, \"requires\", host_capabilities_1.HostCapabilities, false, new host_capabilities_1.HostCapabilities());\n __decorate([\n serialization_1.property(CardObject.idProperty)\n ], CardObject.prototype, \"id\", void 0);\n __decorate([\n serialization_1.property(CardObject.requiresProperty)\n ], CardObject.prototype, \"requires\", null);\n return CardObject;\n}(serialization_1.SerializableObject));\nexports.CardObject = CardObject;\n//# sourceMappingURL=card-object.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChannelAdapter = void 0;\nvar ChannelAdapter = /** @class */ (function () {\n function ChannelAdapter() {\n }\n return ChannelAdapter;\n}());\nexports.ChannelAdapter = ChannelAdapter;\n//# sourceMappingURL=channel-adapter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Collection = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Collection = /** @class */ (function () {\n function Collection() {\n this._items = [];\n }\n Collection.prototype.get = function (index) {\n return this._items[index];\n };\n Collection.prototype.add = function (item) {\n this._items.push(item);\n if (this.onItemAdded) {\n this.onItemAdded(item);\n }\n };\n Collection.prototype.remove = function (item) {\n var i = this._items.indexOf(item);\n if (i >= 0) {\n this._items = this._items.splice(i, 1);\n if (this.onItemRemoved) {\n this.onItemRemoved(item);\n }\n }\n };\n Collection.prototype.indexOf = function (item) {\n return this._items.indexOf(item);\n };\n Object.defineProperty(Collection.prototype, \"length\", {\n get: function () {\n return this._items.length;\n },\n enumerable: false,\n configurable: true\n });\n return Collection;\n}());\nexports.Collection = Collection;\n//# sourceMappingURL=collection.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Constants = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Constants = /** @class */ (function () {\n function Constants() {\n }\n Constants.keys = {\n tab: \"Tab\",\n enter: \"Enter\",\n escape: \"Escape\",\n space: \" \",\n up: \"ArrowUp\",\n down: \"ArrowDown\",\n delete: \"Delete\"\n };\n return Constants;\n}());\nexports.Constants = Constants;\n//# sourceMappingURL=constants.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./menu-item\"), exports);\n__exportStar(require(\"./popup-menu\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MenuItem = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar host_config_1 = require(\"../host-config\");\nvar constants_1 = require(\"./constants\");\nvar MenuItem = /** @class */ (function () {\n function MenuItem(key, value) {\n this._isEnabled = true;\n this.key = key;\n this._value = value;\n }\n MenuItem.prototype.click = function () {\n if (this.isEnabled && this.onClick) {\n this.onClick(this);\n }\n };\n MenuItem.prototype.updateCssClasses = function () {\n if (this._element) {\n var effectiveHostConfig = this._hostConfig ? this._hostConfig : host_config_1.defaultHostConfig;\n this._element.className = effectiveHostConfig.makeCssClassName(\"ac-ctrl\");\n this._element.classList.add(effectiveHostConfig.makeCssClassName(this.isEnabled ? \"ac-ctrl-dropdown-item\" : \"ac-ctrl-dropdown-item-disabled\"));\n if (!this.isEnabled) {\n this._element.classList.add(effectiveHostConfig.makeCssClassName(\"ac-disabled\"));\n }\n }\n };\n MenuItem.prototype.toString = function () {\n return this.value;\n };\n MenuItem.prototype.render = function (hostConfig) {\n var _this = this;\n this._hostConfig = hostConfig;\n if (!this._element) {\n this._element = document.createElement(\"span\");\n this._element.innerText = this.value;\n this._element.setAttribute(\"role\", \"menuitem\");\n if (!this.isEnabled) {\n this._element.setAttribute(\"aria-disabled\", \"true\");\n }\n this._element.setAttribute(\"aria-selected\", \"false\");\n this._element.onmouseup = function (e) { _this.click(); };\n this._element.onkeydown = function (e) {\n if (e.key === constants_1.Constants.keys.enter) {\n e.cancelBubble = true;\n _this.click();\n }\n };\n this.updateCssClasses();\n }\n return this._element;\n };\n Object.defineProperty(MenuItem.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n set: function (newValue) {\n this._value = newValue;\n if (this._element) {\n this._element.innerText = newValue;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MenuItem.prototype, \"isEnabled\", {\n get: function () {\n return this._isEnabled;\n },\n set: function (value) {\n if (this._isEnabled !== value) {\n this._isEnabled = value;\n this.updateCssClasses();\n }\n },\n enumerable: false,\n configurable: true\n });\n return MenuItem;\n}());\nexports.MenuItem = MenuItem;\n//# sourceMappingURL=menu-item.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopupControl = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar constants_1 = require(\"./constants\");\nvar Utils = require(\"../utils\");\nvar host_config_1 = require(\"../host-config\");\nvar PopupControl = /** @class */ (function () {\n function PopupControl() {\n this._isOpen = false;\n }\n PopupControl.prototype.keyDown = function (e) {\n switch (e.key) {\n case constants_1.Constants.keys.escape:\n this.closePopup(true);\n break;\n }\n };\n PopupControl.prototype.render = function (rootElementBounds) {\n var _this = this;\n var element = document.createElement(\"div\");\n element.tabIndex = 0;\n element.className = this.hostConfig.makeCssClassName(\"ac-ctrl\", \"ac-ctrl-popup-container\");\n element.setAttribute(\"role\", \"dialog\");\n element.setAttribute(\"aria-modal\", \"true\");\n element.onkeydown = function (e) {\n _this.keyDown(e);\n return !e.cancelBubble;\n };\n element.appendChild(this.renderContent());\n return element;\n };\n PopupControl.prototype.focus = function () {\n if (this._popupElement) {\n this._popupElement.firstElementChild.focus();\n }\n };\n PopupControl.prototype.popup = function (rootElement) {\n var _a, _b, _c, _d, _e;\n var _this = this;\n if (!this._isOpen) {\n this._overlayElement = document.createElement(\"div\");\n this._overlayElement.className = this.hostConfig.makeCssClassName(\"ac-ctrl-overlay\");\n this._overlayElement.tabIndex = 0;\n this._overlayElement.style.width = document.documentElement.scrollWidth + \"px\";\n this._overlayElement.style.height = document.documentElement.scrollHeight + \"px\";\n this._overlayElement.onfocus = function (e) { _this.closePopup(true); };\n document.body.appendChild(this._overlayElement);\n var rootElementBounds = rootElement.getBoundingClientRect();\n this._popupElement = this.render(rootElementBounds);\n (_a = this._popupElement.classList).remove.apply(_a, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideLeftToRight\", \"ac-ctrl-slideRightToLeft\", \"ac-ctrl-slideTopToBottom\", \"ac-ctrl-slideRightToLeft\"));\n window.addEventListener(\"resize\", function (e) { _this.closePopup(true); });\n var rootElementLabel = rootElement.getAttribute(\"aria-label\");\n if (rootElementLabel) {\n this._popupElement.setAttribute(\"aria-label\", rootElementLabel);\n }\n this._overlayElement.appendChild(this._popupElement);\n var popupElementBounds = this._popupElement.getBoundingClientRect();\n var availableSpaceBelow = window.innerHeight - rootElementBounds.bottom;\n var availableSpaceAbove = rootElementBounds.top;\n var availableSpaceRight = window.innerWidth - rootElementBounds.left;\n var availableSpaceRight = window.innerWidth - rootElementBounds.right;\n var availableSpaceLeft = rootElementBounds.left;\n var left = rootElementBounds.left + Utils.getScrollX();\n var top;\n if (availableSpaceAbove < popupElementBounds.height && availableSpaceBelow < popupElementBounds.height) {\n // Not enough space above or below root element\n var actualPopupHeight = Math.min(popupElementBounds.height, window.innerHeight);\n this._popupElement.style.maxHeight = actualPopupHeight + \"px\";\n if (actualPopupHeight < popupElementBounds.height) {\n top = Utils.getScrollY();\n }\n else {\n top = Utils.getScrollY() + rootElementBounds.top + (rootElementBounds.height - actualPopupHeight) / 2;\n }\n if (availableSpaceLeft < popupElementBounds.width && availableSpaceRight < popupElementBounds.width) {\n // Not enough space left or right of root element\n var actualPopupWidth = Math.min(popupElementBounds.width, window.innerWidth);\n this._popupElement.style.maxWidth = actualPopupWidth + \"px\";\n if (actualPopupWidth < popupElementBounds.width) {\n left = Utils.getScrollX();\n }\n else {\n left = Utils.getScrollX() + rootElementBounds.left + (rootElementBounds.width - actualPopupWidth) / 2;\n }\n }\n else {\n // Enough space on the left or right of the root element\n if (availableSpaceRight >= popupElementBounds.width) {\n left = Utils.getScrollX() + rootElementBounds.right;\n (_b = this._popupElement.classList).add.apply(_b, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideLeftToRight\"));\n }\n else {\n left = Utils.getScrollX() + rootElementBounds.left - popupElementBounds.width;\n (_c = this._popupElement.classList).add.apply(_c, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideRightToLeft\"));\n }\n }\n }\n else {\n // Enough space above or below root element\n if (availableSpaceBelow >= popupElementBounds.height) {\n top = Utils.getScrollY() + rootElementBounds.bottom;\n (_d = this._popupElement.classList).add.apply(_d, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideTopToBottom\"));\n }\n else {\n top = Utils.getScrollY() + rootElementBounds.top - popupElementBounds.height;\n (_e = this._popupElement.classList).add.apply(_e, this.hostConfig.makeCssClassNames(\"ac-ctrl-slide\", \"ac-ctrl-slideBottomToTop\"));\n }\n if (availableSpaceRight < popupElementBounds.width) {\n left = Utils.getScrollX() + rootElementBounds.right - popupElementBounds.width;\n }\n }\n this._popupElement.style.left = left + \"px\";\n this._popupElement.style.top = top + \"px\";\n this._popupElement.focus();\n this._isOpen = true;\n }\n };\n PopupControl.prototype.closePopup = function (wasCancelled) {\n if (this._isOpen) {\n document.body.removeChild(this._overlayElement);\n this._isOpen = false;\n if (this.onClose) {\n this.onClose(this, wasCancelled);\n }\n }\n };\n Object.defineProperty(PopupControl.prototype, \"hostConfig\", {\n get: function () {\n return this._hostConfig ? this._hostConfig : host_config_1.defaultHostConfig;\n },\n set: function (value) {\n this._hostConfig = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PopupControl.prototype, \"isOpen\", {\n get: function () {\n return this._isOpen;\n },\n enumerable: false,\n configurable: true\n });\n return PopupControl;\n}());\nexports.PopupControl = PopupControl;\n//# sourceMappingURL=popup-control.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopupMenu = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar constants_1 = require(\"./constants\");\nvar collection_1 = require(\"./collection\");\nvar popup_control_1 = require(\"./popup-control\");\nvar PopupMenu = /** @class */ (function (_super) {\n __extends(PopupMenu, _super);\n function PopupMenu() {\n var _this = _super.call(this) || this;\n _this._items = new collection_1.Collection();\n _this._renderedItems = [];\n _this._selectedIndex = -1;\n return _this;\n }\n PopupMenu.prototype.renderContent = function () {\n var element = document.createElement(\"div\");\n element.className = this.hostConfig.makeCssClassName(\"ac-ctrl ac-popup\");\n element.setAttribute(\"role\", \"listbox\");\n for (var i = 0; i < this._items.length; i++) {\n var renderedItem = this._items.get(i).render(this.hostConfig);\n renderedItem.tabIndex = 0;\n element.appendChild(renderedItem);\n if (i == this.selectedIndex) {\n renderedItem.focus();\n }\n this._renderedItems.push(renderedItem);\n }\n return element;\n };\n PopupMenu.prototype.keyDown = function (e) {\n _super.prototype.keyDown.call(this, e);\n var selectedItemIndex = this._selectedIndex;\n switch (e.key) {\n case constants_1.Constants.keys.tab:\n this.closePopup(true);\n break;\n /*\n case Constants.keys.enter:\n if (this.selectedIndex >= 0) {\n this.selectedIndex = this.selectedIndex;\n\n this.close();\n }\n\n break;\n */\n case constants_1.Constants.keys.up:\n if (selectedItemIndex <= 0) {\n selectedItemIndex = this._renderedItems.length - 1;\n }\n else {\n selectedItemIndex--;\n if (selectedItemIndex < 0) {\n selectedItemIndex = this._renderedItems.length - 1;\n }\n }\n this.selectedIndex = selectedItemIndex;\n e.cancelBubble = true;\n break;\n case constants_1.Constants.keys.down:\n if (selectedItemIndex < 0) {\n selectedItemIndex = 0;\n }\n else {\n selectedItemIndex++;\n if (selectedItemIndex >= this._renderedItems.length) {\n selectedItemIndex = 0;\n }\n }\n this.selectedIndex = selectedItemIndex;\n e.cancelBubble = true;\n break;\n }\n };\n Object.defineProperty(PopupMenu.prototype, \"items\", {\n get: function () {\n return this._items;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PopupMenu.prototype, \"selectedIndex\", {\n get: function () {\n return this._selectedIndex;\n },\n set: function (index) {\n if (index >= 0 && index < this._renderedItems.length) {\n this._renderedItems[index].focus();\n this._selectedIndex = index;\n }\n },\n enumerable: false,\n configurable: true\n });\n return PopupMenu;\n}(popup_control_1.PopupControl));\nexports.PopupMenu = PopupMenu;\n//# sourceMappingURL=popup-menu.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LogLevel = exports.RefreshMode = exports.TypeErrorType = exports.ContainerFitStatus = exports.ValidationEvent = exports.ValidationPhase = exports.ContainerStyle = exports.InputTextStyle = exports.ActionIconPlacement = exports.FillMode = exports.Orientation = exports.ShowCardActionMode = exports.ImageStyle = exports.ActionAlignment = exports.VerticalAlignment = exports.HorizontalAlignment = exports.TextColor = exports.Spacing = exports.FontType = exports.TextWeight = exports.TextSize = exports.SizeUnit = exports.ImageSize = exports.Size = exports.ActionMode = exports.ActionStyle = void 0;\n// Note the \"weird\" way these readonly fields are declared is to work around\n// a breaking change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n// and adopt this syntax for all other static readonly fields.\nvar ActionStyle = /** @class */ (function () {\n function ActionStyle() {\n }\n ActionStyle.Default = \"default\";\n ActionStyle.Positive = \"positive\";\n ActionStyle.Destructive = \"destructive\";\n return ActionStyle;\n}());\nexports.ActionStyle = ActionStyle;\nvar ActionMode = /** @class */ (function () {\n function ActionMode() {\n }\n ActionMode.Primary = \"primary\";\n ActionMode.Secondary = \"secondary\";\n return ActionMode;\n}());\nexports.ActionMode = ActionMode;\nvar Size;\n(function (Size) {\n Size[Size[\"Auto\"] = 0] = \"Auto\";\n Size[Size[\"Stretch\"] = 1] = \"Stretch\";\n Size[Size[\"Small\"] = 2] = \"Small\";\n Size[Size[\"Medium\"] = 3] = \"Medium\";\n Size[Size[\"Large\"] = 4] = \"Large\";\n})(Size = exports.Size || (exports.Size = {}));\nvar ImageSize;\n(function (ImageSize) {\n ImageSize[ImageSize[\"Small\"] = 0] = \"Small\";\n ImageSize[ImageSize[\"Medium\"] = 1] = \"Medium\";\n ImageSize[ImageSize[\"Large\"] = 2] = \"Large\";\n})(ImageSize = exports.ImageSize || (exports.ImageSize = {}));\nvar SizeUnit;\n(function (SizeUnit) {\n SizeUnit[SizeUnit[\"Weight\"] = 0] = \"Weight\";\n SizeUnit[SizeUnit[\"Pixel\"] = 1] = \"Pixel\";\n})(SizeUnit = exports.SizeUnit || (exports.SizeUnit = {}));\nvar TextSize;\n(function (TextSize) {\n TextSize[TextSize[\"Small\"] = 0] = \"Small\";\n TextSize[TextSize[\"Default\"] = 1] = \"Default\";\n TextSize[TextSize[\"Medium\"] = 2] = \"Medium\";\n TextSize[TextSize[\"Large\"] = 3] = \"Large\";\n TextSize[TextSize[\"ExtraLarge\"] = 4] = \"ExtraLarge\";\n})(TextSize = exports.TextSize || (exports.TextSize = {}));\nvar TextWeight;\n(function (TextWeight) {\n TextWeight[TextWeight[\"Lighter\"] = 0] = \"Lighter\";\n TextWeight[TextWeight[\"Default\"] = 1] = \"Default\";\n TextWeight[TextWeight[\"Bolder\"] = 2] = \"Bolder\";\n})(TextWeight = exports.TextWeight || (exports.TextWeight = {}));\nvar FontType;\n(function (FontType) {\n FontType[FontType[\"Default\"] = 0] = \"Default\";\n FontType[FontType[\"Monospace\"] = 1] = \"Monospace\";\n})(FontType = exports.FontType || (exports.FontType = {}));\nvar Spacing;\n(function (Spacing) {\n Spacing[Spacing[\"None\"] = 0] = \"None\";\n Spacing[Spacing[\"Small\"] = 1] = \"Small\";\n Spacing[Spacing[\"Default\"] = 2] = \"Default\";\n Spacing[Spacing[\"Medium\"] = 3] = \"Medium\";\n Spacing[Spacing[\"Large\"] = 4] = \"Large\";\n Spacing[Spacing[\"ExtraLarge\"] = 5] = \"ExtraLarge\";\n Spacing[Spacing[\"Padding\"] = 6] = \"Padding\";\n})(Spacing = exports.Spacing || (exports.Spacing = {}));\nvar TextColor;\n(function (TextColor) {\n TextColor[TextColor[\"Default\"] = 0] = \"Default\";\n TextColor[TextColor[\"Dark\"] = 1] = \"Dark\";\n TextColor[TextColor[\"Light\"] = 2] = \"Light\";\n TextColor[TextColor[\"Accent\"] = 3] = \"Accent\";\n TextColor[TextColor[\"Good\"] = 4] = \"Good\";\n TextColor[TextColor[\"Warning\"] = 5] = \"Warning\";\n TextColor[TextColor[\"Attention\"] = 6] = \"Attention\";\n})(TextColor = exports.TextColor || (exports.TextColor = {}));\nvar HorizontalAlignment;\n(function (HorizontalAlignment) {\n HorizontalAlignment[HorizontalAlignment[\"Left\"] = 0] = \"Left\";\n HorizontalAlignment[HorizontalAlignment[\"Center\"] = 1] = \"Center\";\n HorizontalAlignment[HorizontalAlignment[\"Right\"] = 2] = \"Right\";\n})(HorizontalAlignment = exports.HorizontalAlignment || (exports.HorizontalAlignment = {}));\nvar VerticalAlignment;\n(function (VerticalAlignment) {\n VerticalAlignment[VerticalAlignment[\"Top\"] = 0] = \"Top\";\n VerticalAlignment[VerticalAlignment[\"Center\"] = 1] = \"Center\";\n VerticalAlignment[VerticalAlignment[\"Bottom\"] = 2] = \"Bottom\";\n})(VerticalAlignment = exports.VerticalAlignment || (exports.VerticalAlignment = {}));\nvar ActionAlignment;\n(function (ActionAlignment) {\n ActionAlignment[ActionAlignment[\"Left\"] = 0] = \"Left\";\n ActionAlignment[ActionAlignment[\"Center\"] = 1] = \"Center\";\n ActionAlignment[ActionAlignment[\"Right\"] = 2] = \"Right\";\n ActionAlignment[ActionAlignment[\"Stretch\"] = 3] = \"Stretch\";\n})(ActionAlignment = exports.ActionAlignment || (exports.ActionAlignment = {}));\nvar ImageStyle;\n(function (ImageStyle) {\n ImageStyle[ImageStyle[\"Default\"] = 0] = \"Default\";\n ImageStyle[ImageStyle[\"Person\"] = 1] = \"Person\";\n})(ImageStyle = exports.ImageStyle || (exports.ImageStyle = {}));\nvar ShowCardActionMode;\n(function (ShowCardActionMode) {\n ShowCardActionMode[ShowCardActionMode[\"Inline\"] = 0] = \"Inline\";\n ShowCardActionMode[ShowCardActionMode[\"Popup\"] = 1] = \"Popup\";\n})(ShowCardActionMode = exports.ShowCardActionMode || (exports.ShowCardActionMode = {}));\nvar Orientation;\n(function (Orientation) {\n Orientation[Orientation[\"Horizontal\"] = 0] = \"Horizontal\";\n Orientation[Orientation[\"Vertical\"] = 1] = \"Vertical\";\n})(Orientation = exports.Orientation || (exports.Orientation = {}));\nvar FillMode;\n(function (FillMode) {\n FillMode[FillMode[\"Cover\"] = 0] = \"Cover\";\n FillMode[FillMode[\"RepeatHorizontally\"] = 1] = \"RepeatHorizontally\";\n FillMode[FillMode[\"RepeatVertically\"] = 2] = \"RepeatVertically\";\n FillMode[FillMode[\"Repeat\"] = 3] = \"Repeat\";\n})(FillMode = exports.FillMode || (exports.FillMode = {}));\nvar ActionIconPlacement;\n(function (ActionIconPlacement) {\n ActionIconPlacement[ActionIconPlacement[\"LeftOfTitle\"] = 0] = \"LeftOfTitle\";\n ActionIconPlacement[ActionIconPlacement[\"AboveTitle\"] = 1] = \"AboveTitle\";\n})(ActionIconPlacement = exports.ActionIconPlacement || (exports.ActionIconPlacement = {}));\nvar InputTextStyle;\n(function (InputTextStyle) {\n InputTextStyle[InputTextStyle[\"Text\"] = 0] = \"Text\";\n InputTextStyle[InputTextStyle[\"Tel\"] = 1] = \"Tel\";\n InputTextStyle[InputTextStyle[\"Url\"] = 2] = \"Url\";\n InputTextStyle[InputTextStyle[\"Email\"] = 3] = \"Email\";\n InputTextStyle[InputTextStyle[\"Password\"] = 4] = \"Password\";\n})(InputTextStyle = exports.InputTextStyle || (exports.InputTextStyle = {}));\n/*\n This should really be a string enum, e.g.\n\n export enum ContainerStyle {\n Default = \"default\",\n Emphasis = \"emphasis\"\n }\n\n However, some hosts do not use a version of TypeScript\n recent enough to understand string enums. This is\n a compatible construct that does not require using\n a more recent version of TypeScript.\n\n Also note the \"weird\" way these readonly fields are declared is to work around\n a breaking change introduced in TS 3.1 wrt d.ts generation. DO NOT CHANGE\n and adopt this syntax for all other static readonly fields.\n*/\nvar ContainerStyle = /** @class */ (function () {\n function ContainerStyle() {\n }\n ContainerStyle.Default = \"default\";\n ContainerStyle.Emphasis = \"emphasis\";\n ContainerStyle.Accent = \"accent\";\n ContainerStyle.Good = \"good\";\n ContainerStyle.Attention = \"attention\";\n ContainerStyle.Warning = \"warning\";\n return ContainerStyle;\n}());\nexports.ContainerStyle = ContainerStyle;\nvar ValidationPhase;\n(function (ValidationPhase) {\n ValidationPhase[ValidationPhase[\"Parse\"] = 0] = \"Parse\";\n ValidationPhase[ValidationPhase[\"ToJSON\"] = 1] = \"ToJSON\";\n ValidationPhase[ValidationPhase[\"Validation\"] = 2] = \"Validation\";\n})(ValidationPhase = exports.ValidationPhase || (exports.ValidationPhase = {}));\nvar ValidationEvent;\n(function (ValidationEvent) {\n ValidationEvent[ValidationEvent[\"Hint\"] = 0] = \"Hint\";\n ValidationEvent[ValidationEvent[\"ActionTypeNotAllowed\"] = 1] = \"ActionTypeNotAllowed\";\n ValidationEvent[ValidationEvent[\"CollectionCantBeEmpty\"] = 2] = \"CollectionCantBeEmpty\";\n ValidationEvent[ValidationEvent[\"Deprecated\"] = 3] = \"Deprecated\";\n ValidationEvent[ValidationEvent[\"ElementTypeNotAllowed\"] = 4] = \"ElementTypeNotAllowed\";\n ValidationEvent[ValidationEvent[\"InteractivityNotAllowed\"] = 5] = \"InteractivityNotAllowed\";\n ValidationEvent[ValidationEvent[\"InvalidPropertyValue\"] = 6] = \"InvalidPropertyValue\";\n ValidationEvent[ValidationEvent[\"MissingCardType\"] = 7] = \"MissingCardType\";\n ValidationEvent[ValidationEvent[\"PropertyCantBeNull\"] = 8] = \"PropertyCantBeNull\";\n ValidationEvent[ValidationEvent[\"TooManyActions\"] = 9] = \"TooManyActions\";\n ValidationEvent[ValidationEvent[\"UnknownActionType\"] = 10] = \"UnknownActionType\";\n ValidationEvent[ValidationEvent[\"UnknownElementType\"] = 11] = \"UnknownElementType\";\n ValidationEvent[ValidationEvent[\"UnsupportedCardVersion\"] = 12] = \"UnsupportedCardVersion\";\n ValidationEvent[ValidationEvent[\"DuplicateId\"] = 13] = \"DuplicateId\";\n ValidationEvent[ValidationEvent[\"UnsupportedProperty\"] = 14] = \"UnsupportedProperty\";\n ValidationEvent[ValidationEvent[\"RequiredInputsShouldHaveLabel\"] = 15] = \"RequiredInputsShouldHaveLabel\";\n ValidationEvent[ValidationEvent[\"RequiredInputsShouldHaveErrorMessage\"] = 16] = \"RequiredInputsShouldHaveErrorMessage\";\n ValidationEvent[ValidationEvent[\"Other\"] = 17] = \"Other\";\n})(ValidationEvent = exports.ValidationEvent || (exports.ValidationEvent = {}));\nvar ContainerFitStatus;\n(function (ContainerFitStatus) {\n ContainerFitStatus[ContainerFitStatus[\"FullyInContainer\"] = 0] = \"FullyInContainer\";\n ContainerFitStatus[ContainerFitStatus[\"Overflowing\"] = 1] = \"Overflowing\";\n ContainerFitStatus[ContainerFitStatus[\"FullyOutOfContainer\"] = 2] = \"FullyOutOfContainer\";\n})(ContainerFitStatus = exports.ContainerFitStatus || (exports.ContainerFitStatus = {}));\nvar TypeErrorType;\n(function (TypeErrorType) {\n TypeErrorType[TypeErrorType[\"UnknownType\"] = 0] = \"UnknownType\";\n TypeErrorType[TypeErrorType[\"ForbiddenType\"] = 1] = \"ForbiddenType\";\n})(TypeErrorType = exports.TypeErrorType || (exports.TypeErrorType = {}));\nvar RefreshMode;\n(function (RefreshMode) {\n RefreshMode[RefreshMode[\"Disabled\"] = 0] = \"Disabled\";\n RefreshMode[RefreshMode[\"Manual\"] = 1] = \"Manual\";\n RefreshMode[RefreshMode[\"Automatic\"] = 2] = \"Automatic\";\n})(RefreshMode = exports.RefreshMode || (exports.RefreshMode = {}));\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Info\"] = 0] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 1] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 2] = \"Error\";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n//# sourceMappingURL=enums.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HostCapabilities = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar serialization_1 = require(\"./serialization\");\nvar HostCapabilities = /** @class */ (function (_super) {\n __extends(HostCapabilities, _super);\n function HostCapabilities() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._capabilities = {};\n return _this;\n }\n HostCapabilities.prototype.getSchemaKey = function () {\n return \"HostCapabilities\";\n };\n HostCapabilities.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n if (source) {\n for (var name_1 in source) {\n var jsonVersion = source[name_1];\n if (typeof jsonVersion === \"string\") {\n if (jsonVersion == \"*\") {\n this.addCapability(name_1, \"*\");\n }\n else {\n var version = serialization_1.Version.parse(jsonVersion, context);\n if (version && version.isValid) {\n this.addCapability(name_1, version);\n }\n }\n }\n }\n }\n };\n HostCapabilities.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n for (var key in this._capabilities) {\n target[key] = this._capabilities[key];\n }\n };\n HostCapabilities.prototype.addCapability = function (name, version) {\n this._capabilities[name] = version;\n };\n HostCapabilities.prototype.removeCapability = function (name) {\n delete this._capabilities[name];\n };\n HostCapabilities.prototype.clear = function () {\n this._capabilities = {};\n };\n HostCapabilities.prototype.hasCapability = function (name, version) {\n if (this._capabilities.hasOwnProperty(name)) {\n if (version == \"*\" || this._capabilities[name] == \"*\") {\n return true;\n }\n return version.compareTo(this._capabilities[name]) <= 0;\n }\n return false;\n };\n HostCapabilities.prototype.areAllMet = function (hostCapabilities) {\n for (var capabilityName in this._capabilities) {\n if (!hostCapabilities.hasCapability(capabilityName, this._capabilities[capabilityName])) {\n return false;\n }\n }\n return true;\n };\n return HostCapabilities;\n}(serialization_1.SerializableObject));\nexports.HostCapabilities = HostCapabilities;\n//# sourceMappingURL=host-capabilities.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultHostConfig = exports.HostConfig = exports.FontTypeSet = exports.FontTypeDefinition = exports.ContainerStyleSet = exports.ContainerStyleDefinition = exports.ColorSetDefinition = exports.ActionsConfig = exports.ShowCardActionConfig = exports.FactSetConfig = exports.FactTitleDefinition = exports.FactTextDefinition = exports.InputConfig = exports.InputLabelConfig = exports.RequiredInputLabelTextDefinition = exports.TextBlockConfig = exports.TextStyleSet = exports.TextStyleDefinition = exports.BaseTextDefinition = exports.TableConfig = exports.MediaConfig = exports.ImageSetConfig = exports.AdaptiveCardConfig = exports.TextColorDefinition = exports.ColorDefinition = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar Utils = require(\"./utils\");\nvar Shared = require(\"./shared\");\nvar host_capabilities_1 = require(\"./host-capabilities\");\nfunction parseHostConfigEnum(targetEnum, value, defaultValue) {\n if (typeof value === \"string\") {\n var parsedValue = Utils.parseEnum(targetEnum, value, defaultValue);\n return parsedValue !== undefined ? parsedValue : defaultValue;\n }\n else if (typeof value === \"number\") {\n return value;\n }\n else {\n return defaultValue;\n }\n}\nvar ColorDefinition = /** @class */ (function () {\n function ColorDefinition(defaultColor, subtleColor) {\n this.default = \"#000000\";\n this.subtle = \"#666666\";\n if (defaultColor) {\n this.default = defaultColor;\n }\n if (subtleColor) {\n this.subtle = subtleColor;\n }\n }\n ColorDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.default = obj[\"default\"] || this.default;\n this.subtle = obj[\"subtle\"] || this.subtle;\n }\n };\n return ColorDefinition;\n}());\nexports.ColorDefinition = ColorDefinition;\nvar TextColorDefinition = /** @class */ (function (_super) {\n __extends(TextColorDefinition, _super);\n function TextColorDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.highlightColors = new ColorDefinition(\"#22000000\", \"#11000000\");\n return _this;\n }\n TextColorDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.highlightColors.parse(obj[\"highlightColors\"]);\n }\n };\n return TextColorDefinition;\n}(ColorDefinition));\nexports.TextColorDefinition = TextColorDefinition;\nvar AdaptiveCardConfig = /** @class */ (function () {\n function AdaptiveCardConfig(obj) {\n this.allowCustomStyle = false;\n if (obj) {\n this.allowCustomStyle = obj[\"allowCustomStyle\"] || this.allowCustomStyle;\n }\n }\n return AdaptiveCardConfig;\n}());\nexports.AdaptiveCardConfig = AdaptiveCardConfig;\nvar ImageSetConfig = /** @class */ (function () {\n function ImageSetConfig(obj) {\n this.imageSize = Enums.Size.Medium;\n this.maxImageHeight = 100;\n if (obj) {\n this.imageSize = obj[\"imageSize\"] != null ? obj[\"imageSize\"] : this.imageSize;\n this.maxImageHeight = Utils.parseNumber(obj[\"maxImageHeight\"], 100);\n }\n }\n ImageSetConfig.prototype.toJSON = function () {\n return {\n imageSize: Enums.Size[this.imageSize],\n maxImageHeight: this.maxImageHeight\n };\n };\n return ImageSetConfig;\n}());\nexports.ImageSetConfig = ImageSetConfig;\nvar MediaConfig = /** @class */ (function () {\n function MediaConfig(obj) {\n this.allowInlinePlayback = true;\n if (obj) {\n this.defaultPoster = obj[\"defaultPoster\"];\n this.allowInlinePlayback = obj[\"allowInlinePlayback\"] || this.allowInlinePlayback;\n }\n }\n MediaConfig.prototype.toJSON = function () {\n return {\n defaultPoster: this.defaultPoster,\n allowInlinePlayback: this.allowInlinePlayback\n };\n };\n return MediaConfig;\n}());\nexports.MediaConfig = MediaConfig;\nvar TableConfig = /** @class */ (function () {\n function TableConfig(obj) {\n this.cellSpacing = 8;\n if (obj) {\n this.cellSpacing = obj.cellSpacing && typeof obj.cellSpacing === \"number\" ? obj.cellSpacing : this.cellSpacing;\n }\n }\n TableConfig.prototype.toJSON = function () {\n return {\n cellSpacing: this.cellSpacing\n };\n };\n return TableConfig;\n}());\nexports.TableConfig = TableConfig;\nvar BaseTextDefinition = /** @class */ (function () {\n function BaseTextDefinition(obj) {\n this.size = Enums.TextSize.Default;\n this.color = Enums.TextColor.Default;\n this.isSubtle = false;\n this.weight = Enums.TextWeight.Default;\n this.parse(obj);\n }\n ;\n BaseTextDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.size = parseHostConfigEnum(Enums.TextSize, obj[\"size\"], this.size);\n this.color = parseHostConfigEnum(Enums.TextColor, obj[\"color\"], this.color);\n this.isSubtle = obj.isSubtle !== undefined && typeof obj.isSubtle === \"boolean\" ? obj.isSubtle : this.isSubtle;\n this.weight = parseHostConfigEnum(Enums.TextWeight, obj[\"weight\"], this.getDefaultWeight());\n }\n };\n BaseTextDefinition.prototype.getDefaultWeight = function () {\n return Enums.TextWeight.Default;\n };\n BaseTextDefinition.prototype.toJSON = function () {\n return {\n size: Enums.TextSize[this.size],\n color: Enums.TextColor[this.color],\n isSubtle: this.isSubtle,\n weight: Enums.TextWeight[this.weight]\n };\n };\n return BaseTextDefinition;\n}());\nexports.BaseTextDefinition = BaseTextDefinition;\nvar TextStyleDefinition = /** @class */ (function (_super) {\n __extends(TextStyleDefinition, _super);\n function TextStyleDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.fontType = Enums.FontType.Default;\n return _this;\n }\n TextStyleDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.fontType = parseHostConfigEnum(Enums.FontType, obj.fontType, this.fontType);\n }\n };\n return TextStyleDefinition;\n}(BaseTextDefinition));\nexports.TextStyleDefinition = TextStyleDefinition;\nvar TextStyleSet = /** @class */ (function () {\n function TextStyleSet(obj) {\n this.default = new TextStyleDefinition();\n this.heading = new TextStyleDefinition({\n size: \"Large\",\n weight: \"Bolder\"\n });\n this.columnHeader = new TextStyleDefinition({\n weight: \"Bolder\"\n });\n if (obj) {\n this.heading.parse(obj.heading);\n this.columnHeader.parse(obj.columnHeader);\n }\n }\n TextStyleSet.prototype.getStyleByName = function (name) {\n switch (name.toLowerCase()) {\n case \"heading\":\n return this.heading;\n case \"columnHeader\":\n return this.columnHeader;\n default:\n return this.default;\n }\n };\n return TextStyleSet;\n}());\nexports.TextStyleSet = TextStyleSet;\nvar TextBlockConfig = /** @class */ (function () {\n function TextBlockConfig(obj) {\n if (obj) {\n this.headingLevel = Utils.parseNumber(obj.headingLevel);\n }\n }\n return TextBlockConfig;\n}());\nexports.TextBlockConfig = TextBlockConfig;\nvar RequiredInputLabelTextDefinition = /** @class */ (function (_super) {\n __extends(RequiredInputLabelTextDefinition, _super);\n function RequiredInputLabelTextDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.suffix = \" *\";\n _this.suffixColor = Enums.TextColor.Attention;\n return _this;\n }\n RequiredInputLabelTextDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.suffix = obj[\"suffix\"] || this.suffix;\n this.suffixColor = parseHostConfigEnum(Enums.TextColor, obj[\"suffixColor\"], this.suffixColor);\n }\n };\n RequiredInputLabelTextDefinition.prototype.toJSON = function () {\n var result = _super.prototype.toJSON.call(this);\n result[\"suffix\"] = this.suffix;\n result[\"suffixColor\"] = Enums.TextColor[this.suffixColor];\n return result;\n };\n return RequiredInputLabelTextDefinition;\n}(BaseTextDefinition));\nexports.RequiredInputLabelTextDefinition = RequiredInputLabelTextDefinition;\nvar InputLabelConfig = /** @class */ (function () {\n function InputLabelConfig(obj) {\n this.inputSpacing = Enums.Spacing.Small;\n this.requiredInputs = new RequiredInputLabelTextDefinition();\n this.optionalInputs = new BaseTextDefinition();\n if (obj) {\n this.inputSpacing = parseHostConfigEnum(Enums.Spacing, obj[\"inputSpacing\"], this.inputSpacing);\n this.requiredInputs = new RequiredInputLabelTextDefinition(obj[\"requiredInputs\"]);\n this.optionalInputs = new BaseTextDefinition(obj[\"optionalInputs\"]);\n }\n }\n return InputLabelConfig;\n}());\nexports.InputLabelConfig = InputLabelConfig;\nvar InputConfig = /** @class */ (function () {\n function InputConfig(obj) {\n this.label = new InputLabelConfig();\n this.errorMessage = new BaseTextDefinition({ color: Enums.TextColor.Attention });\n if (obj) {\n this.label = new InputLabelConfig(obj[\"label\"]);\n this.errorMessage = new BaseTextDefinition(obj[\"errorMessage\"]);\n }\n }\n return InputConfig;\n}());\nexports.InputConfig = InputConfig;\nvar FactTextDefinition = /** @class */ (function (_super) {\n __extends(FactTextDefinition, _super);\n function FactTextDefinition() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.wrap = true;\n return _this;\n }\n FactTextDefinition.prototype.parse = function (obj) {\n _super.prototype.parse.call(this, obj);\n if (obj) {\n this.wrap = obj[\"wrap\"] != null ? obj[\"wrap\"] : this.wrap;\n }\n };\n FactTextDefinition.prototype.toJSON = function () {\n var result = _super.prototype.toJSON.call(this);\n result[\"wrap\"] = this.wrap;\n return result;\n };\n return FactTextDefinition;\n}(BaseTextDefinition));\nexports.FactTextDefinition = FactTextDefinition;\nvar FactTitleDefinition = /** @class */ (function (_super) {\n __extends(FactTitleDefinition, _super);\n function FactTitleDefinition(obj) {\n var _this = _super.call(this, obj) || this;\n _this.maxWidth = 150;\n _this.weight = Enums.TextWeight.Bolder;\n if (obj) {\n _this.maxWidth = obj[\"maxWidth\"] != null ? obj[\"maxWidth\"] : _this.maxWidth;\n _this.weight = parseHostConfigEnum(Enums.TextWeight, obj[\"weight\"], Enums.TextWeight.Bolder);\n }\n return _this;\n }\n FactTitleDefinition.prototype.getDefaultWeight = function () {\n return Enums.TextWeight.Bolder;\n };\n return FactTitleDefinition;\n}(FactTextDefinition));\nexports.FactTitleDefinition = FactTitleDefinition;\nvar FactSetConfig = /** @class */ (function () {\n function FactSetConfig(obj) {\n this.title = new FactTitleDefinition();\n this.value = new FactTextDefinition();\n this.spacing = 10;\n if (obj) {\n this.title = new FactTitleDefinition(obj[\"title\"]);\n this.value = new FactTextDefinition(obj[\"value\"]);\n this.spacing = obj.spacing && obj.spacing != null ? obj.spacing && obj.spacing : this.spacing;\n }\n }\n return FactSetConfig;\n}());\nexports.FactSetConfig = FactSetConfig;\nvar ShowCardActionConfig = /** @class */ (function () {\n function ShowCardActionConfig(obj) {\n this.actionMode = Enums.ShowCardActionMode.Inline;\n this.inlineTopMargin = 16;\n this.style = Enums.ContainerStyle.Emphasis;\n if (obj) {\n this.actionMode = parseHostConfigEnum(Enums.ShowCardActionMode, obj[\"actionMode\"], Enums.ShowCardActionMode.Inline);\n this.inlineTopMargin = obj[\"inlineTopMargin\"] != null ? obj[\"inlineTopMargin\"] : this.inlineTopMargin;\n this.style = obj[\"style\"] && typeof obj[\"style\"] === \"string\" ? obj[\"style\"] : Enums.ContainerStyle.Emphasis;\n }\n }\n ShowCardActionConfig.prototype.toJSON = function () {\n return {\n actionMode: Enums.ShowCardActionMode[this.actionMode],\n inlineTopMargin: this.inlineTopMargin,\n style: this.style\n };\n };\n return ShowCardActionConfig;\n}());\nexports.ShowCardActionConfig = ShowCardActionConfig;\nvar ActionsConfig = /** @class */ (function () {\n function ActionsConfig(obj) {\n this.maxActions = 5;\n this.spacing = Enums.Spacing.Default;\n this.buttonSpacing = 20;\n this.showCard = new ShowCardActionConfig();\n this.preExpandSingleShowCardAction = false;\n this.actionsOrientation = Enums.Orientation.Horizontal;\n this.actionAlignment = Enums.ActionAlignment.Left;\n this.iconPlacement = Enums.ActionIconPlacement.LeftOfTitle;\n this.allowTitleToWrap = false;\n this.iconSize = 16;\n if (obj) {\n this.maxActions = obj[\"maxActions\"] != null ? obj[\"maxActions\"] : this.maxActions;\n this.spacing = parseHostConfigEnum(Enums.Spacing, obj.spacing && obj.spacing, Enums.Spacing.Default);\n this.buttonSpacing = obj[\"buttonSpacing\"] != null ? obj[\"buttonSpacing\"] : this.buttonSpacing;\n this.showCard = new ShowCardActionConfig(obj[\"showCard\"]);\n this.preExpandSingleShowCardAction = Utils.parseBool(obj[\"preExpandSingleShowCardAction\"], false);\n this.actionsOrientation = parseHostConfigEnum(Enums.Orientation, obj[\"actionsOrientation\"], Enums.Orientation.Horizontal);\n this.actionAlignment = parseHostConfigEnum(Enums.ActionAlignment, obj[\"actionAlignment\"], Enums.ActionAlignment.Left);\n this.iconPlacement = parseHostConfigEnum(Enums.ActionIconPlacement, obj[\"iconPlacement\"], Enums.ActionIconPlacement.LeftOfTitle);\n this.allowTitleToWrap = obj[\"allowTitleToWrap\"] != null ? obj[\"allowTitleToWrap\"] : this.allowTitleToWrap;\n try {\n var sizeAndUnit = Shared.SizeAndUnit.parse(obj[\"iconSize\"]);\n if (sizeAndUnit.unit == Enums.SizeUnit.Pixel) {\n this.iconSize = sizeAndUnit.physicalSize;\n }\n }\n catch (e) {\n // Swallow this, keep default icon size\n }\n }\n }\n ActionsConfig.prototype.toJSON = function () {\n return {\n maxActions: this.maxActions,\n spacing: Enums.Spacing[this.spacing],\n buttonSpacing: this.buttonSpacing,\n showCard: this.showCard,\n preExpandSingleShowCardAction: this.preExpandSingleShowCardAction,\n actionsOrientation: Enums.Orientation[this.actionsOrientation],\n actionAlignment: Enums.ActionAlignment[this.actionAlignment]\n };\n };\n return ActionsConfig;\n}());\nexports.ActionsConfig = ActionsConfig;\nvar ColorSetDefinition = /** @class */ (function () {\n function ColorSetDefinition(obj) {\n this.default = new TextColorDefinition();\n this.dark = new TextColorDefinition();\n this.light = new TextColorDefinition();\n this.accent = new TextColorDefinition();\n this.good = new TextColorDefinition();\n this.warning = new TextColorDefinition();\n this.attention = new TextColorDefinition();\n this.parse(obj);\n }\n ColorSetDefinition.prototype.parseSingleColor = function (obj, propertyName) {\n if (obj) {\n this[propertyName].parse(obj[propertyName]);\n }\n };\n ColorSetDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.parseSingleColor(obj, \"default\");\n this.parseSingleColor(obj, \"dark\");\n this.parseSingleColor(obj, \"light\");\n this.parseSingleColor(obj, \"accent\");\n this.parseSingleColor(obj, \"good\");\n this.parseSingleColor(obj, \"warning\");\n this.parseSingleColor(obj, \"attention\");\n }\n };\n return ColorSetDefinition;\n}());\nexports.ColorSetDefinition = ColorSetDefinition;\nvar ContainerStyleDefinition = /** @class */ (function () {\n function ContainerStyleDefinition(obj) {\n this.foregroundColors = new ColorSetDefinition({\n \"default\": { default: \"#333333\", subtle: \"#EE333333\" },\n \"dark\": { default: \"#000000\", subtle: \"#66000000\" },\n \"light\": { default: \"#FFFFFF\", subtle: \"#33000000\" },\n \"accent\": { default: \"#2E89FC\", subtle: \"#882E89FC\" },\n \"good\": { default: \"#028A02\", subtle: \"#DD027502\" },\n \"warning\": { default: \"#E69500\", subtle: \"#DDE69500\" },\n \"attention\": { default: \"#CC3300\", subtle: \"#DDCC3300\" }\n });\n this.parse(obj);\n }\n ContainerStyleDefinition.prototype.parse = function (obj) {\n if (obj) {\n this.backgroundColor = obj[\"backgroundColor\"];\n this.foregroundColors.parse(obj[\"foregroundColors\"]);\n this.highlightBackgroundColor = obj[\"highlightBackgroundColor\"];\n this.highlightForegroundColor = obj[\"highlightForegroundColor\"];\n this.borderColor = obj[\"borderColor\"];\n }\n };\n Object.defineProperty(ContainerStyleDefinition.prototype, \"isBuiltIn\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return ContainerStyleDefinition;\n}());\nexports.ContainerStyleDefinition = ContainerStyleDefinition;\nvar BuiltInContainerStyleDefinition = /** @class */ (function (_super) {\n __extends(BuiltInContainerStyleDefinition, _super);\n function BuiltInContainerStyleDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(BuiltInContainerStyleDefinition.prototype, \"isBuiltIn\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n return BuiltInContainerStyleDefinition;\n}(ContainerStyleDefinition));\nvar ContainerStyleSet = /** @class */ (function () {\n function ContainerStyleSet(obj) {\n this._allStyles = {};\n this._allStyles[Enums.ContainerStyle.Default] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Emphasis] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Accent] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Good] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Attention] = new BuiltInContainerStyleDefinition();\n this._allStyles[Enums.ContainerStyle.Warning] = new BuiltInContainerStyleDefinition();\n if (obj) {\n this._allStyles[Enums.ContainerStyle.Default].parse(obj[Enums.ContainerStyle.Default]);\n this._allStyles[Enums.ContainerStyle.Emphasis].parse(obj[Enums.ContainerStyle.Emphasis]);\n this._allStyles[Enums.ContainerStyle.Accent].parse(obj[Enums.ContainerStyle.Accent]);\n this._allStyles[Enums.ContainerStyle.Good].parse(obj[Enums.ContainerStyle.Good]);\n this._allStyles[Enums.ContainerStyle.Attention].parse(obj[Enums.ContainerStyle.Attention]);\n this._allStyles[Enums.ContainerStyle.Warning].parse(obj[Enums.ContainerStyle.Warning]);\n var customStyleArray = obj[\"customStyles\"];\n if (customStyleArray && Array.isArray(customStyleArray)) {\n for (var _i = 0, customStyleArray_1 = customStyleArray; _i < customStyleArray_1.length; _i++) {\n var customStyle = customStyleArray_1[_i];\n if (customStyle) {\n var styleName = customStyle[\"name\"];\n if (styleName && typeof styleName === \"string\") {\n if (this._allStyles.hasOwnProperty(styleName)) {\n this._allStyles[styleName].parse(customStyle[\"style\"]);\n }\n else {\n this._allStyles[styleName] = new ContainerStyleDefinition(customStyle[\"style\"]);\n }\n }\n }\n }\n }\n }\n }\n ContainerStyleSet.prototype.toJSON = function () {\n var _this = this;\n var customStyleArray = [];\n Object.keys(this._allStyles).forEach(function (key) {\n if (!_this._allStyles[key].isBuiltIn) {\n customStyleArray.push({\n name: key,\n style: _this._allStyles[key]\n });\n }\n });\n var result = {\n default: this.default,\n emphasis: this.emphasis\n };\n if (customStyleArray.length > 0) {\n result.customStyles = customStyleArray;\n }\n return result;\n };\n ContainerStyleSet.prototype.getStyleByName = function (name, defaultValue) {\n if (name && this._allStyles.hasOwnProperty(name)) {\n return this._allStyles[name];\n }\n else {\n return defaultValue ? defaultValue : this._allStyles[Enums.ContainerStyle.Default];\n }\n };\n Object.defineProperty(ContainerStyleSet.prototype, \"default\", {\n get: function () {\n return this._allStyles[Enums.ContainerStyle.Default];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ContainerStyleSet.prototype, \"emphasis\", {\n get: function () {\n return this._allStyles[Enums.ContainerStyle.Emphasis];\n },\n enumerable: false,\n configurable: true\n });\n return ContainerStyleSet;\n}());\nexports.ContainerStyleSet = ContainerStyleSet;\nvar FontTypeDefinition = /** @class */ (function () {\n function FontTypeDefinition(fontFamily) {\n this.fontFamily = \"Segoe UI,Segoe,Segoe WP,Helvetica Neue,Helvetica,sans-serif\";\n this.fontSizes = {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n };\n this.fontWeights = {\n lighter: 200,\n default: 400,\n bolder: 600\n };\n if (fontFamily) {\n this.fontFamily = fontFamily;\n }\n }\n FontTypeDefinition.prototype.parse = function (obj) {\n this.fontFamily = obj[\"fontFamily\"] || this.fontFamily;\n this.fontSizes = {\n small: obj.fontSizes && obj.fontSizes[\"small\"] || this.fontSizes.small,\n default: obj.fontSizes && obj.fontSizes[\"default\"] || this.fontSizes.default,\n medium: obj.fontSizes && obj.fontSizes[\"medium\"] || this.fontSizes.medium,\n large: obj.fontSizes && obj.fontSizes[\"large\"] || this.fontSizes.large,\n extraLarge: obj.fontSizes && obj.fontSizes[\"extraLarge\"] || this.fontSizes.extraLarge\n };\n this.fontWeights = {\n lighter: obj.fontWeights && obj.fontWeights[\"lighter\"] || this.fontWeights.lighter,\n default: obj.fontWeights && obj.fontWeights[\"default\"] || this.fontWeights.default,\n bolder: obj.fontWeights && obj.fontWeights[\"bolder\"] || this.fontWeights.bolder\n };\n };\n FontTypeDefinition.monospace = new FontTypeDefinition(\"'Courier New', Courier, monospace\");\n return FontTypeDefinition;\n}());\nexports.FontTypeDefinition = FontTypeDefinition;\nvar FontTypeSet = /** @class */ (function () {\n function FontTypeSet(obj) {\n this.default = new FontTypeDefinition();\n this.monospace = new FontTypeDefinition(\"'Courier New', Courier, monospace\");\n if (obj) {\n this.default.parse(obj[\"default\"]);\n this.monospace.parse(obj[\"monospace\"]);\n }\n }\n FontTypeSet.prototype.getStyleDefinition = function (style) {\n switch (style) {\n case Enums.FontType.Monospace:\n return this.monospace;\n case Enums.FontType.Default:\n default:\n return this.default;\n }\n };\n return FontTypeSet;\n}());\nexports.FontTypeSet = FontTypeSet;\nvar HostConfig = /** @class */ (function () {\n function HostConfig(obj) {\n this.hostCapabilities = new host_capabilities_1.HostCapabilities();\n this.choiceSetInputValueSeparator = \",\";\n this.supportsInteractivity = true;\n this.spacing = {\n small: 3,\n default: 8,\n medium: 20,\n large: 30,\n extraLarge: 40,\n padding: 15\n };\n this.separator = {\n lineThickness: 1,\n lineColor: \"#EEEEEE\"\n };\n this.imageSizes = {\n small: 40,\n medium: 80,\n large: 160\n };\n this.containerStyles = new ContainerStyleSet();\n this.inputs = new InputConfig();\n this.actions = new ActionsConfig();\n this.adaptiveCard = new AdaptiveCardConfig();\n this.imageSet = new ImageSetConfig();\n this.media = new MediaConfig();\n this.factSet = new FactSetConfig();\n this.table = new TableConfig();\n this.textStyles = new TextStyleSet();\n this.textBlock = new TextBlockConfig();\n this.alwaysAllowBleed = false;\n if (obj) {\n if (typeof obj === \"string\" || obj instanceof String) {\n obj = JSON.parse(obj);\n }\n this.choiceSetInputValueSeparator = (obj && typeof obj[\"choiceSetInputValueSeparator\"] === \"string\") ? obj[\"choiceSetInputValueSeparator\"] : this.choiceSetInputValueSeparator;\n this.supportsInteractivity = (obj && typeof obj[\"supportsInteractivity\"] === \"boolean\") ? obj[\"supportsInteractivity\"] : this.supportsInteractivity;\n this._legacyFontType = new FontTypeDefinition();\n this._legacyFontType.parse(obj);\n if (obj.fontTypes) {\n this.fontTypes = new FontTypeSet(obj.fontTypes);\n }\n if (obj.lineHeights) {\n this.lineHeights = {\n small: obj.lineHeights[\"small\"],\n default: obj.lineHeights[\"default\"],\n medium: obj.lineHeights[\"medium\"],\n large: obj.lineHeights[\"large\"],\n extraLarge: obj.lineHeights[\"extraLarge\"]\n };\n }\n ;\n this.imageSizes = {\n small: obj.imageSizes && obj.imageSizes[\"small\"] || this.imageSizes.small,\n medium: obj.imageSizes && obj.imageSizes[\"medium\"] || this.imageSizes.medium,\n large: obj.imageSizes && obj.imageSizes[\"large\"] || this.imageSizes.large,\n };\n this.containerStyles = new ContainerStyleSet(obj[\"containerStyles\"]);\n this.spacing = {\n small: obj.spacing && obj.spacing[\"small\"] || this.spacing.small,\n default: obj.spacing && obj.spacing[\"default\"] || this.spacing.default,\n medium: obj.spacing && obj.spacing[\"medium\"] || this.spacing.medium,\n large: obj.spacing && obj.spacing[\"large\"] || this.spacing.large,\n extraLarge: obj.spacing && obj.spacing[\"extraLarge\"] || this.spacing.extraLarge,\n padding: obj.spacing && obj.spacing[\"padding\"] || this.spacing.padding\n };\n this.separator = {\n lineThickness: obj.separator && obj.separator[\"lineThickness\"] || this.separator.lineThickness,\n lineColor: obj.separator && obj.separator[\"lineColor\"] || this.separator.lineColor\n };\n this.inputs = new InputConfig(obj.inputs || this.inputs);\n this.actions = new ActionsConfig(obj.actions || this.actions);\n this.adaptiveCard = new AdaptiveCardConfig(obj.adaptiveCard || this.adaptiveCard);\n this.imageSet = new ImageSetConfig(obj[\"imageSet\"]);\n this.factSet = new FactSetConfig(obj[\"factSet\"]);\n this.textStyles = new TextStyleSet(obj[\"textStyles\"]);\n this.textBlock = new TextBlockConfig(obj[\"textBlock\"]);\n }\n }\n HostConfig.prototype.getFontTypeDefinition = function (style) {\n if (this.fontTypes) {\n return this.fontTypes.getStyleDefinition(style);\n }\n else {\n return style == Enums.FontType.Monospace ? FontTypeDefinition.monospace : this._legacyFontType;\n }\n };\n HostConfig.prototype.getEffectiveSpacing = function (spacing) {\n switch (spacing) {\n case Enums.Spacing.Small:\n return this.spacing.small;\n case Enums.Spacing.Default:\n return this.spacing.default;\n case Enums.Spacing.Medium:\n return this.spacing.medium;\n case Enums.Spacing.Large:\n return this.spacing.large;\n case Enums.Spacing.ExtraLarge:\n return this.spacing.extraLarge;\n case Enums.Spacing.Padding:\n return this.spacing.padding;\n default:\n return 0;\n }\n };\n HostConfig.prototype.paddingDefinitionToSpacingDefinition = function (paddingDefinition) {\n return new Shared.SpacingDefinition(this.getEffectiveSpacing(paddingDefinition.top), this.getEffectiveSpacing(paddingDefinition.right), this.getEffectiveSpacing(paddingDefinition.bottom), this.getEffectiveSpacing(paddingDefinition.left));\n };\n HostConfig.prototype.makeCssClassNames = function () {\n var classNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classNames[_i] = arguments[_i];\n }\n var result = [];\n for (var _a = 0, classNames_1 = classNames; _a < classNames_1.length; _a++) {\n var className = classNames_1[_a];\n result.push((this.cssClassNamePrefix ? this.cssClassNamePrefix + \"-\" : \"\") + className);\n }\n return result;\n };\n HostConfig.prototype.makeCssClassName = function () {\n var classNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classNames[_i] = arguments[_i];\n }\n var result = this.makeCssClassNames.apply(this, classNames).join(\" \");\n return result ? result : \"\";\n };\n Object.defineProperty(HostConfig.prototype, \"fontFamily\", {\n get: function () {\n return this._legacyFontType.fontFamily;\n },\n set: function (value) {\n this._legacyFontType.fontFamily = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HostConfig.prototype, \"fontSizes\", {\n get: function () {\n return this._legacyFontType.fontSizes;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(HostConfig.prototype, \"fontWeights\", {\n get: function () {\n return this._legacyFontType.fontWeights;\n },\n enumerable: false,\n configurable: true\n });\n return HostConfig;\n}());\nexports.HostConfig = HostConfig;\nexports.defaultHostConfig = new HostConfig({\n supportsInteractivity: true,\n spacing: {\n small: 10,\n default: 20,\n medium: 30,\n large: 40,\n extraLarge: 50,\n padding: 20\n },\n separator: {\n lineThickness: 1,\n lineColor: \"#EEEEEE\"\n },\n fontTypes: {\n default: {\n fontFamily: \"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif\",\n fontSizes: {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n },\n fontWeights: {\n lighter: 200,\n default: 400,\n bolder: 600\n }\n },\n monospace: {\n fontFamily: \"'Courier New', Courier, monospace\",\n fontSizes: {\n small: 12,\n default: 14,\n medium: 17,\n large: 21,\n extraLarge: 26\n },\n fontWeights: {\n lighter: 200,\n default: 400,\n bolder: 600\n }\n }\n },\n imageSizes: {\n small: 40,\n medium: 80,\n large: 160\n },\n containerStyles: {\n default: {\n backgroundColor: \"#FFFFFF\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n emphasis: {\n backgroundColor: \"#08000000\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n accent: {\n backgroundColor: \"#C7DEF9\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n good: {\n backgroundColor: \"#CCFFCC\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n attention: {\n backgroundColor: \"#FFC5B2\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n },\n warning: {\n backgroundColor: \"#FFE2B2\",\n foregroundColors: {\n default: {\n default: \"#333333\",\n subtle: \"#EE333333\"\n },\n dark: {\n default: \"#000000\",\n subtle: \"#66000000\"\n },\n light: {\n default: \"#FFFFFF\",\n subtle: \"#33000000\"\n },\n accent: {\n default: \"#2E89FC\",\n subtle: \"#882E89FC\"\n },\n attention: {\n default: \"#cc3300\",\n subtle: \"#DDcc3300\"\n },\n good: {\n default: \"#028A02\",\n subtle: \"#DD027502\"\n },\n warning: {\n default: \"#e69500\",\n subtle: \"#DDe69500\"\n }\n }\n }\n },\n inputs: {\n label: {\n requiredInputs: {\n color: Enums.TextColor.Accent,\n size: Enums.TextSize.ExtraLarge,\n weight: Enums.TextWeight.Bolder,\n isSubtle: true,\n suffix: \" (required)\",\n suffixColor: Enums.TextColor.Good\n },\n optionalInputs: {\n color: Enums.TextColor.Warning,\n size: Enums.TextSize.Medium,\n weight: Enums.TextWeight.Lighter,\n isSubtle: false\n }\n },\n errorMessage: {\n color: Enums.TextColor.Accent,\n size: Enums.TextSize.Small,\n weight: Enums.TextWeight.Bolder\n }\n },\n actions: {\n maxActions: 5,\n spacing: Enums.Spacing.Default,\n buttonSpacing: 10,\n showCard: {\n actionMode: Enums.ShowCardActionMode.Inline,\n inlineTopMargin: 16\n },\n actionsOrientation: Enums.Orientation.Horizontal,\n actionAlignment: Enums.ActionAlignment.Left\n },\n adaptiveCard: {\n allowCustomStyle: false\n },\n imageSet: {\n imageSize: Enums.Size.Medium,\n maxImageHeight: 100\n },\n factSet: {\n title: {\n color: Enums.TextColor.Default,\n size: Enums.TextSize.Default,\n isSubtle: false,\n weight: Enums.TextWeight.Bolder,\n wrap: true,\n maxWidth: 150,\n },\n value: {\n color: Enums.TextColor.Default,\n size: Enums.TextSize.Default,\n isSubtle: false,\n weight: Enums.TextWeight.Default,\n wrap: true,\n },\n spacing: 10\n }\n});\n//# sourceMappingURL=host-config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GlobalRegistry = exports.CardObjectRegistry = void 0;\nvar serialization_1 = require(\"./serialization\");\nvar CardObjectRegistry = /** @class */ (function () {\n function CardObjectRegistry() {\n this._items = {};\n }\n CardObjectRegistry.prototype.findByName = function (typeName) {\n return this._items.hasOwnProperty(typeName) ? this._items[typeName] : undefined;\n };\n CardObjectRegistry.prototype.clear = function () {\n this._items = {};\n };\n CardObjectRegistry.prototype.copyTo = function (target) {\n var keys = Object.keys(this._items);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n var typeRegistration = this._items[key];\n target.register(typeRegistration.typeName, typeRegistration.objectType, typeRegistration.schemaVersion);\n }\n };\n CardObjectRegistry.prototype.register = function (typeName, objectType, schemaVersion) {\n if (schemaVersion === void 0) { schemaVersion = serialization_1.Versions.v1_0; }\n var registrationInfo = this.findByName(typeName);\n if (registrationInfo !== undefined) {\n registrationInfo.objectType = objectType;\n }\n else {\n registrationInfo = {\n typeName: typeName,\n objectType: objectType,\n schemaVersion: schemaVersion\n };\n }\n this._items[typeName] = registrationInfo;\n };\n CardObjectRegistry.prototype.unregister = function (typeName) {\n delete this._items[typeName];\n };\n CardObjectRegistry.prototype.createInstance = function (typeName, targetVersion) {\n var registrationInfo = this.findByName(typeName);\n return (registrationInfo && registrationInfo.schemaVersion.compareTo(targetVersion) <= 0) ? new registrationInfo.objectType() : undefined;\n };\n CardObjectRegistry.prototype.getItemCount = function () {\n return Object.keys(this._items).length;\n };\n CardObjectRegistry.prototype.getItemAt = function (index) {\n var _this = this;\n return Object.keys(this._items).map(function (e) { return _this._items[e]; })[index];\n };\n return CardObjectRegistry;\n}());\nexports.CardObjectRegistry = CardObjectRegistry;\nvar GlobalRegistry = /** @class */ (function () {\n function GlobalRegistry() {\n }\n GlobalRegistry.populateWithDefaultElements = function (registry) {\n registry.clear();\n GlobalRegistry.defaultElements.copyTo(registry);\n };\n GlobalRegistry.populateWithDefaultActions = function (registry) {\n registry.clear();\n GlobalRegistry.defaultActions.copyTo(registry);\n };\n Object.defineProperty(GlobalRegistry, \"elements\", {\n get: function () {\n if (!GlobalRegistry._elements) {\n GlobalRegistry._elements = new CardObjectRegistry();\n GlobalRegistry.populateWithDefaultElements(GlobalRegistry._elements);\n }\n return GlobalRegistry._elements;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlobalRegistry, \"actions\", {\n get: function () {\n if (!GlobalRegistry._actions) {\n GlobalRegistry._actions = new CardObjectRegistry();\n GlobalRegistry.populateWithDefaultActions(GlobalRegistry._actions);\n }\n return GlobalRegistry._actions;\n },\n enumerable: false,\n configurable: true\n });\n GlobalRegistry.reset = function () {\n GlobalRegistry._elements = undefined;\n GlobalRegistry._actions = undefined;\n };\n GlobalRegistry.defaultElements = new CardObjectRegistry();\n GlobalRegistry.defaultActions = new CardObjectRegistry();\n return GlobalRegistry;\n}());\nexports.GlobalRegistry = GlobalRegistry;\n//# sourceMappingURL=registry.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SerializableObject = exports.property = exports.SerializableObjectSchema = exports.CustomProperty = exports.SerializableObjectCollectionProperty = exports.SerializableObjectProperty = exports.EnumProperty = exports.ValueSetProperty = exports.StringArrayProperty = exports.PixelSizeProperty = exports.NumProperty = exports.BoolProperty = exports.StringProperty = exports.PropertyDefinition = exports.BaseSerializationContext = exports.isVersionLessOrEqual = exports.Versions = exports.Version = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar shared_1 = require(\"./shared\");\nvar Utils = require(\"./utils\");\nvar Enums = require(\"./enums\");\nvar strings_1 = require(\"./strings\");\nvar Version = /** @class */ (function () {\n function Version(major, minor, label) {\n if (major === void 0) { major = 1; }\n if (minor === void 0) { minor = 1; }\n this._isValid = true;\n this._major = major;\n this._minor = minor;\n this._label = label;\n }\n Version.parse = function (versionString, context) {\n if (!versionString) {\n return undefined;\n }\n var result = new Version();\n result._versionString = versionString;\n var regEx = /(\\d+).(\\d+)/gi;\n var matches = regEx.exec(versionString);\n if (matches != null && matches.length == 3) {\n result._major = parseInt(matches[1]);\n result._minor = parseInt(matches[2]);\n }\n else {\n result._isValid = false;\n }\n if (!result._isValid) {\n context.logParseEvent(undefined, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidVersionString(result._versionString));\n }\n return result;\n };\n Version.prototype.toString = function () {\n return !this._isValid ? this._versionString : this._major + \".\" + this._minor;\n };\n Version.prototype.toJSON = function () {\n return this.toString();\n };\n Version.prototype.compareTo = function (otherVersion) {\n if (!this.isValid || !otherVersion.isValid) {\n throw new Error(\"Cannot compare invalid version.\");\n }\n if (this.major > otherVersion.major) {\n return 1;\n }\n else if (this.major < otherVersion.major) {\n return -1;\n }\n else if (this.minor > otherVersion.minor) {\n return 1;\n }\n else if (this.minor < otherVersion.minor) {\n return -1;\n }\n return 0;\n };\n Object.defineProperty(Version.prototype, \"label\", {\n get: function () {\n return this._label ? this._label : this.toString();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"major\", {\n get: function () {\n return this._major;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"minor\", {\n get: function () {\n return this._minor;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Version.prototype, \"isValid\", {\n get: function () {\n return this._isValid;\n },\n enumerable: false,\n configurable: true\n });\n return Version;\n}());\nexports.Version = Version;\nvar Versions = /** @class */ (function () {\n function Versions() {\n }\n Versions.v1_0 = new Version(1, 0);\n Versions.v1_1 = new Version(1, 1);\n Versions.v1_2 = new Version(1, 2);\n Versions.v1_3 = new Version(1, 3);\n Versions.v1_4 = new Version(1, 4);\n Versions.v1_5 = new Version(1, 5);\n Versions.latest = Versions.v1_5;\n return Versions;\n}());\nexports.Versions = Versions;\nfunction isVersionLessOrEqual(version, targetVersion) {\n if (version instanceof Version) {\n if (targetVersion instanceof Version) {\n return targetVersion.compareTo(version) >= 0;\n }\n else {\n // Target version is *\n return true;\n }\n }\n else {\n // Version is *\n return true;\n }\n}\nexports.isVersionLessOrEqual = isVersionLessOrEqual;\nvar BaseSerializationContext = /** @class */ (function () {\n function BaseSerializationContext(targetVersion) {\n if (targetVersion === void 0) { targetVersion = Versions.latest; }\n this.targetVersion = targetVersion;\n this._validationEvents = [];\n }\n BaseSerializationContext.prototype.serializeValue = function (target, propertyName, propertyValue, defaultValue, forceDeleteIfNullOrDefault) {\n if (defaultValue === void 0) { defaultValue = undefined; }\n if (forceDeleteIfNullOrDefault === void 0) { forceDeleteIfNullOrDefault = false; }\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n if (!shared_1.GlobalSettings.enableFullJsonRoundTrip || forceDeleteIfNullOrDefault) {\n delete target[propertyName];\n }\n }\n else if (propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeString = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeBool = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeNumber = function (target, propertyName, propertyValue, defaultValue) {\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue || isNaN(propertyValue)) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = propertyValue;\n }\n };\n BaseSerializationContext.prototype.serializeEnum = function (enumType, target, propertyName, propertyValue, defaultValue) {\n if (defaultValue === void 0) { defaultValue = undefined; }\n if (propertyValue === null || propertyValue === undefined || propertyValue === defaultValue) {\n delete target[propertyName];\n }\n else {\n target[propertyName] = enumType[propertyValue];\n }\n };\n BaseSerializationContext.prototype.serializeArray = function (target, propertyName, propertyValue) {\n var items = [];\n if (propertyValue) {\n for (var _i = 0, propertyValue_1 = propertyValue; _i < propertyValue_1.length; _i++) {\n var item = propertyValue_1[_i];\n var serializedItem = undefined;\n if (item instanceof SerializableObject) {\n serializedItem = item.toJSON(this);\n }\n else if (item.toJSON) {\n serializedItem = item.toJSON();\n }\n else {\n serializedItem = item;\n }\n if (serializedItem !== undefined) {\n items.push(serializedItem);\n }\n }\n }\n if (items.length == 0) {\n if (target.hasOwnProperty(propertyName) && Array.isArray(target[propertyName])) {\n delete target[propertyName];\n }\n }\n else {\n this.serializeValue(target, propertyName, items);\n }\n };\n BaseSerializationContext.prototype.clearEvents = function () {\n this._validationEvents = [];\n };\n BaseSerializationContext.prototype.logEvent = function (source, phase, event, message) {\n this._validationEvents.push({\n source: source,\n phase: phase,\n event: event,\n message: message\n });\n };\n BaseSerializationContext.prototype.logParseEvent = function (source, event, message) {\n this.logEvent(source, Enums.ValidationPhase.Parse, event, message);\n };\n BaseSerializationContext.prototype.getEventAt = function (index) {\n return this._validationEvents[index];\n };\n Object.defineProperty(BaseSerializationContext.prototype, \"eventCount\", {\n get: function () {\n return this._validationEvents.length;\n },\n enumerable: false,\n configurable: true\n });\n return BaseSerializationContext;\n}());\nexports.BaseSerializationContext = BaseSerializationContext;\nvar SimpleSerializationContext = /** @class */ (function (_super) {\n __extends(SimpleSerializationContext, _super);\n function SimpleSerializationContext() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return SimpleSerializationContext;\n}(BaseSerializationContext));\nvar PropertyDefinition = /** @class */ (function () {\n function PropertyDefinition(targetVersion, name, defaultValue, onGetInitialValue) {\n this.targetVersion = targetVersion;\n this.name = name;\n this.defaultValue = defaultValue;\n this.onGetInitialValue = onGetInitialValue;\n this.isSerializationEnabled = true;\n this.sequentialNumber = PropertyDefinition._sequentialNumber;\n PropertyDefinition._sequentialNumber++;\n }\n PropertyDefinition.prototype.getInternalName = function () {\n return this.name;\n };\n PropertyDefinition.prototype.parse = function (sender, source, context) {\n return source[this.name];\n };\n PropertyDefinition.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, value, this.defaultValue);\n };\n PropertyDefinition._sequentialNumber = 0;\n return PropertyDefinition;\n}());\nexports.PropertyDefinition = PropertyDefinition;\nvar StringProperty = /** @class */ (function (_super) {\n __extends(StringProperty, _super);\n function StringProperty(targetVersion, name, treatEmptyAsUndefined, regEx, defaultValue, onGetInitialValue) {\n if (treatEmptyAsUndefined === void 0) { treatEmptyAsUndefined = true; }\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.treatEmptyAsUndefined = treatEmptyAsUndefined;\n _this.regEx = regEx;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n StringProperty.prototype.parse = function (sender, source, context) {\n var parsedValue = Utils.parseString(source[this.name], this.defaultValue);\n var isUndefined = parsedValue === undefined || (parsedValue === \"\" && this.treatEmptyAsUndefined);\n if (!isUndefined && this.regEx !== undefined) {\n var matches = this.regEx.exec(parsedValue);\n if (!matches) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(parsedValue, this.name));\n return undefined;\n }\n }\n return parsedValue;\n };\n StringProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeString(target, this.name, value === \"\" && this.treatEmptyAsUndefined ? undefined : value, this.defaultValue);\n };\n return StringProperty;\n}(PropertyDefinition));\nexports.StringProperty = StringProperty;\nvar BoolProperty = /** @class */ (function (_super) {\n __extends(BoolProperty, _super);\n function BoolProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n BoolProperty.prototype.parse = function (sender, source, context) {\n return Utils.parseBool(source[this.name], this.defaultValue);\n };\n BoolProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeBool(target, this.name, value, this.defaultValue);\n };\n return BoolProperty;\n}(PropertyDefinition));\nexports.BoolProperty = BoolProperty;\nvar NumProperty = /** @class */ (function (_super) {\n __extends(NumProperty, _super);\n function NumProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n NumProperty.prototype.parse = function (sender, source, context) {\n return Utils.parseNumber(source[this.name], this.defaultValue);\n };\n NumProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeNumber(target, this.name, value, this.defaultValue);\n };\n return NumProperty;\n}(PropertyDefinition));\nexports.NumProperty = NumProperty;\nvar PixelSizeProperty = /** @class */ (function (_super) {\n __extends(PixelSizeProperty, _super);\n function PixelSizeProperty() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PixelSizeProperty.prototype.parse = function (sender, source, context) {\n var result = undefined;\n var value = source[this.name];\n if (typeof value === \"string\") {\n var isValid = false;\n try {\n var size = shared_1.SizeAndUnit.parse(value, true);\n if (size.unit == Enums.SizeUnit.Pixel) {\n result = size.physicalSize;\n isValid = true;\n }\n }\n catch (_a) {\n // Do nothing. A parse error is emitted below\n }\n if (!isValid) {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(source[this.name], \"minHeight\"));\n }\n }\n return result;\n };\n PixelSizeProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeValue(target, this.name, typeof value === \"number\" && !isNaN(value) ? value + \"px\" : undefined);\n };\n return PixelSizeProperty;\n}(PropertyDefinition));\nexports.PixelSizeProperty = PixelSizeProperty;\nvar StringArrayProperty = /** @class */ (function (_super) {\n __extends(StringArrayProperty, _super);\n function StringArrayProperty(targetVersion, name, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n StringArrayProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined || !Array.isArray(sourceValue)) {\n return this.defaultValue;\n }\n var result = [];\n for (var _i = 0, sourceValue_1 = sourceValue; _i < sourceValue_1.length; _i++) {\n var value = sourceValue_1[_i];\n if (typeof value === \"string\") {\n result.push(value);\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, \"Invalid array value \\\"\" + value + \"\\\" of type \\\"\" + typeof value + \"\\\" ignored for \\\"\" + this.name + \"\\\".\");\n }\n }\n return result;\n };\n StringArrayProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeArray(target, this.name, value);\n };\n return StringArrayProperty;\n}(PropertyDefinition));\nexports.StringArrayProperty = StringArrayProperty;\nvar ValueSetProperty = /** @class */ (function (_super) {\n __extends(ValueSetProperty, _super);\n function ValueSetProperty(targetVersion, name, values, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.values = values;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n return _this;\n }\n ValueSetProperty.prototype.isValidValue = function (value, context) {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (value.toLowerCase() === versionedValue.value.toLowerCase()) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n return targetVersion.compareTo(context.targetVersion) <= 0;\n }\n }\n return false;\n };\n ValueSetProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.defaultValue;\n }\n if (typeof sourceValue === \"string\") {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (sourceValue.toLowerCase() === versionedValue.value.toLowerCase()) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n return versionedValue.value;\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(sourceValue, this.name, targetVersion.toString(), context.targetVersion.toString()));\n return this.defaultValue;\n }\n }\n }\n }\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n return this.defaultValue;\n };\n ValueSetProperty.prototype.toJSON = function (sender, target, value, context) {\n var invalidValue = false;\n if (value !== undefined) {\n invalidValue = true;\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === value) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n invalidValue = false;\n break;\n }\n else {\n context.logEvent(sender, Enums.ValidationPhase.ToJSON, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(value, this.name, targetVersion.toString(), context.targetVersion.toString()));\n }\n }\n }\n }\n if (!invalidValue) {\n context.serializeValue(target, this.name, value, this.defaultValue, true);\n }\n };\n return ValueSetProperty;\n}(PropertyDefinition));\nexports.ValueSetProperty = ValueSetProperty;\nvar EnumProperty = /** @class */ (function (_super) {\n __extends(EnumProperty, _super);\n function EnumProperty(targetVersion, name, enumType, defaultValue, values, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.enumType = enumType;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n _this._values = [];\n if (!values) {\n for (var key in enumType) {\n var keyAsNumber = parseInt(key, 10);\n if (keyAsNumber >= 0) {\n _this._values.push({ value: keyAsNumber });\n }\n }\n }\n else {\n _this._values = values;\n }\n return _this;\n }\n EnumProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (typeof sourceValue !== \"string\") {\n return this.defaultValue;\n }\n var enumValue = Utils.getEnumValueByName(this.enumType, sourceValue);\n if (enumValue !== undefined) {\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === enumValue) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n return enumValue;\n }\n else {\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.propertyValueNotSupported(sourceValue, this.name, targetVersion.toString(), context.targetVersion.toString()));\n return this.defaultValue;\n }\n }\n }\n }\n context.logParseEvent(sender, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(sourceValue, this.name));\n return this.defaultValue;\n };\n EnumProperty.prototype.toJSON = function (sender, target, value, context) {\n var invalidValue = false;\n if (value !== undefined) {\n invalidValue = true;\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var versionedValue = _a[_i];\n if (versionedValue.value === value) {\n var targetVersion = versionedValue.targetVersion ? versionedValue.targetVersion : this.targetVersion;\n if (targetVersion.compareTo(context.targetVersion) <= 0) {\n invalidValue = false;\n break;\n }\n else {\n context.logEvent(sender, Enums.ValidationPhase.ToJSON, Enums.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidPropertyValue(value, this.name));\n }\n }\n }\n }\n if (!invalidValue) {\n context.serializeEnum(this.enumType, target, this.name, value, this.defaultValue);\n }\n };\n Object.defineProperty(EnumProperty.prototype, \"values\", {\n get: function () {\n return this._values;\n },\n enumerable: false,\n configurable: true\n });\n return EnumProperty;\n}(PropertyDefinition));\nexports.EnumProperty = EnumProperty;\nvar SerializableObjectProperty = /** @class */ (function (_super) {\n __extends(SerializableObjectProperty, _super);\n function SerializableObjectProperty(targetVersion, name, objectType, nullable, defaultValue) {\n if (nullable === void 0) { nullable = false; }\n var _this = _super.call(this, targetVersion, name, defaultValue, function (sender) { return _this.nullable ? undefined : new _this.objectType(); }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.objectType = objectType;\n _this.nullable = nullable;\n return _this;\n }\n SerializableObjectProperty.prototype.parse = function (sender, source, context) {\n var sourceValue = source[this.name];\n if (sourceValue === undefined) {\n return this.onGetInitialValue ? this.onGetInitialValue(sender) : this.defaultValue;\n }\n var result = new this.objectType();\n result.parse(sourceValue, context);\n return result;\n };\n SerializableObjectProperty.prototype.toJSON = function (sender, target, value, context) {\n var serializedValue = undefined;\n if (value !== undefined && !value.hasAllDefaultValues()) {\n serializedValue = value.toJSON(context);\n }\n if (typeof serializedValue === \"object\" && Object.keys(serializedValue).length === 0) {\n serializedValue = undefined;\n }\n context.serializeValue(target, this.name, serializedValue, this.defaultValue, true);\n };\n return SerializableObjectProperty;\n}(PropertyDefinition));\nexports.SerializableObjectProperty = SerializableObjectProperty;\nvar SerializableObjectCollectionProperty = /** @class */ (function (_super) {\n __extends(SerializableObjectCollectionProperty, _super);\n function SerializableObjectCollectionProperty(targetVersion, name, objectType, onItemAdded) {\n var _this = _super.call(this, targetVersion, name, undefined, function (sender) { return []; }) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.objectType = objectType;\n _this.onItemAdded = onItemAdded;\n return _this;\n }\n SerializableObjectCollectionProperty.prototype.parse = function (sender, source, context) {\n var result = [];\n var sourceCollection = source[this.name];\n if (Array.isArray(sourceCollection)) {\n for (var _i = 0, sourceCollection_1 = sourceCollection; _i < sourceCollection_1.length; _i++) {\n var sourceItem = sourceCollection_1[_i];\n var item = new this.objectType();\n item.parse(sourceItem, context);\n result.push(item);\n if (this.onItemAdded) {\n this.onItemAdded(sender, item);\n }\n }\n }\n return result.length > 0 ? result : (this.onGetInitialValue ? this.onGetInitialValue(sender) : undefined);\n };\n SerializableObjectCollectionProperty.prototype.toJSON = function (sender, target, value, context) {\n context.serializeArray(target, this.name, value);\n };\n return SerializableObjectCollectionProperty;\n}(PropertyDefinition));\nexports.SerializableObjectCollectionProperty = SerializableObjectCollectionProperty;\nvar CustomProperty = /** @class */ (function (_super) {\n __extends(CustomProperty, _super);\n function CustomProperty(targetVersion, name, onParse, onToJSON, defaultValue, onGetInitialValue) {\n var _this = _super.call(this, targetVersion, name, defaultValue, onGetInitialValue) || this;\n _this.targetVersion = targetVersion;\n _this.name = name;\n _this.onParse = onParse;\n _this.onToJSON = onToJSON;\n _this.defaultValue = defaultValue;\n _this.onGetInitialValue = onGetInitialValue;\n if (!_this.onParse) {\n throw new Error(\"CustomPropertyDefinition instances must have an onParse handler.\");\n }\n if (!_this.onToJSON) {\n throw new Error(\"CustomPropertyDefinition instances must have an onToJSON handler.\");\n }\n return _this;\n }\n CustomProperty.prototype.parse = function (sender, source, context) {\n return this.onParse(sender, this, source, context);\n };\n CustomProperty.prototype.toJSON = function (sender, target, value, context) {\n this.onToJSON(sender, this, target, value, context);\n };\n return CustomProperty;\n}(PropertyDefinition));\nexports.CustomProperty = CustomProperty;\nvar SerializableObjectSchema = /** @class */ (function () {\n function SerializableObjectSchema() {\n this._properties = [];\n }\n SerializableObjectSchema.prototype.indexOf = function (property) {\n for (var i = 0; i < this._properties.length; i++) {\n if (this._properties[i] === property) {\n return i;\n }\n }\n return -1;\n };\n SerializableObjectSchema.prototype.add = function () {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n for (var i = 0; i < properties.length; i++) {\n if (this.indexOf(properties[i]) === -1) {\n this._properties.push(properties[i]);\n }\n }\n };\n SerializableObjectSchema.prototype.remove = function () {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n for (var _a = 0, properties_1 = properties; _a < properties_1.length; _a++) {\n var property_1 = properties_1[_a];\n while (true) {\n var index = this.indexOf(property_1);\n if (index >= 0) {\n this._properties.splice(index, 1);\n }\n else {\n break;\n }\n }\n }\n };\n SerializableObjectSchema.prototype.getItemAt = function (index) {\n return this._properties[index];\n };\n SerializableObjectSchema.prototype.getCount = function () {\n return this._properties.length;\n };\n return SerializableObjectSchema;\n}());\nexports.SerializableObjectSchema = SerializableObjectSchema;\n// This is a decorator function, used to map SerializableObject descendant class members to\n// schema properties\nfunction property(property) {\n return function (target, propertyKey) {\n var descriptor = Object.getOwnPropertyDescriptor(target, propertyKey) || {};\n if (!descriptor.get && !descriptor.set) {\n descriptor.get = function () { return this.getValue(property); };\n descriptor.set = function (value) { this.setValue(property, value); };\n Object.defineProperty(target, propertyKey, descriptor);\n }\n };\n}\nexports.property = property;\nvar SerializableObject = /** @class */ (function () {\n function SerializableObject() {\n this._propertyBag = {};\n this._rawProperties = {};\n this.maxVersion = SerializableObject.defaultMaxVersion;\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_2 = s.getItemAt(i);\n if (property_2.onGetInitialValue) {\n this.setValue(property_2, property_2.onGetInitialValue(this));\n }\n }\n }\n SerializableObject.prototype.getDefaultSerializationContext = function () {\n return new SimpleSerializationContext();\n };\n SerializableObject.prototype.populateSchema = function (schema) {\n var ctor = this.constructor;\n var properties = [];\n for (var propertyName in ctor) {\n try {\n var propertyValue = ctor[propertyName];\n if (propertyValue instanceof PropertyDefinition) {\n properties.push(propertyValue);\n }\n }\n catch (_a) {\n // If a property happens to have a getter function and\n // it throws an exception, we need to catch it here\n }\n }\n if (properties.length > 0) {\n var sortedProperties = properties.sort(function (p1, p2) {\n if (p1.sequentialNumber > p2.sequentialNumber) {\n return 1;\n }\n else if (p1.sequentialNumber < p2.sequentialNumber) {\n return -1;\n }\n return 0;\n });\n schema.add.apply(schema, sortedProperties);\n }\n if (SerializableObject.onRegisterCustomProperties) {\n SerializableObject.onRegisterCustomProperties(this, schema);\n }\n };\n SerializableObject.prototype.getValue = function (property) {\n return this._propertyBag.hasOwnProperty(property.getInternalName()) ? this._propertyBag[property.getInternalName()] : property.defaultValue;\n };\n SerializableObject.prototype.setValue = function (property, value) {\n if (value === undefined || value === null) {\n delete this._propertyBag[property.getInternalName()];\n }\n else {\n this._propertyBag[property.getInternalName()] = value;\n }\n };\n SerializableObject.prototype.internalParse = function (source, context) {\n this._propertyBag = {};\n this._rawProperties = shared_1.GlobalSettings.enableFullJsonRoundTrip ? (source ? source : {}) : {};\n if (source) {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_3 = s.getItemAt(i);\n if (property_3.isSerializationEnabled) {\n var propertyValue = property_3.onGetInitialValue ? property_3.onGetInitialValue(this) : undefined;\n if (source.hasOwnProperty(property_3.name)) {\n if (property_3.targetVersion.compareTo(context.targetVersion) <= 0) {\n propertyValue = property_3.parse(this, source, context);\n }\n else {\n context.logParseEvent(this, Enums.ValidationEvent.UnsupportedProperty, strings_1.Strings.errors.propertyNotSupported(property_3.name, property_3.targetVersion.toString(), context.targetVersion.toString()));\n }\n }\n this.setValue(property_3, propertyValue);\n }\n }\n }\n else {\n this.resetDefaultValues();\n }\n };\n SerializableObject.prototype.internalToJSON = function (target, context) {\n var s = this.getSchema();\n var serializedProperties = [];\n for (var i = 0; i < s.getCount(); i++) {\n var property_4 = s.getItemAt(i);\n // Avoid serializing the same property multiple times. This is necessary\n // because some property definitions map to the same underlying schema\n // property\n if (property_4.isSerializationEnabled && property_4.targetVersion.compareTo(context.targetVersion) <= 0 && serializedProperties.indexOf(property_4.name) === -1) {\n property_4.toJSON(this, target, this.getValue(property_4), context);\n serializedProperties.push(property_4.name);\n }\n }\n };\n SerializableObject.prototype.shouldSerialize = function (context) {\n return true;\n };\n SerializableObject.prototype.parse = function (source, context) {\n this.internalParse(source, context ? context : new SimpleSerializationContext());\n };\n SerializableObject.prototype.toJSON = function (context) {\n var effectiveContext;\n if (context && context instanceof BaseSerializationContext) {\n effectiveContext = context;\n }\n else {\n effectiveContext = this.getDefaultSerializationContext();\n effectiveContext.toJSONOriginalParam = context;\n }\n if (this.shouldSerialize(effectiveContext)) {\n var result = void 0;\n if (shared_1.GlobalSettings.enableFullJsonRoundTrip && this._rawProperties && typeof this._rawProperties === \"object\") {\n result = this._rawProperties;\n }\n else {\n result = {};\n }\n this.internalToJSON(result, effectiveContext);\n return result;\n }\n else {\n return undefined;\n }\n };\n SerializableObject.prototype.hasDefaultValue = function (property) {\n return this.getValue(property) === property.defaultValue;\n };\n SerializableObject.prototype.hasAllDefaultValues = function () {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_5 = s.getItemAt(i);\n if (!this.hasDefaultValue(property_5)) {\n return false;\n }\n }\n return true;\n };\n SerializableObject.prototype.resetDefaultValues = function () {\n var s = this.getSchema();\n for (var i = 0; i < s.getCount(); i++) {\n var property_6 = s.getItemAt(i);\n this.setValue(property_6, property_6.defaultValue);\n }\n };\n SerializableObject.prototype.setCustomProperty = function (name, value) {\n var shouldDeleteProperty = (typeof value === \"string\" && !value) || value === undefined || value === null;\n if (shouldDeleteProperty) {\n delete this._rawProperties[name];\n }\n else {\n this._rawProperties[name] = value;\n }\n };\n SerializableObject.prototype.getCustomProperty = function (name) {\n return this._rawProperties[name];\n };\n SerializableObject.prototype.getSchema = function () {\n var schema = SerializableObject._schemaCache[this.getSchemaKey()];\n if (!schema) {\n schema = new SerializableObjectSchema();\n this.populateSchema(schema);\n SerializableObject._schemaCache[this.getSchemaKey()] = schema;\n }\n return schema;\n };\n SerializableObject.defaultMaxVersion = Versions.latest;\n SerializableObject._schemaCache = {};\n return SerializableObject;\n}());\nexports.SerializableObject = SerializableObject;\n//# sourceMappingURL=serialization.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UUID = exports.SizeAndUnit = exports.PaddingDefinition = exports.SpacingDefinition = exports.StringWithSubstitutions = exports.ContentTypes = exports.GlobalSettings = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar GlobalSettings = /** @class */ (function () {\n function GlobalSettings() {\n }\n GlobalSettings.useAdvancedTextBlockTruncation = true;\n GlobalSettings.useAdvancedCardBottomTruncation = false;\n GlobalSettings.useMarkdownInRadioButtonAndCheckbox = true;\n GlobalSettings.allowMarkForTextHighlighting = false;\n GlobalSettings.alwaysBleedSeparators = false;\n GlobalSettings.enableFullJsonRoundTrip = false;\n GlobalSettings.displayInputValidationErrors = true;\n GlobalSettings.allowPreProcessingPropertyValues = false;\n GlobalSettings.setTabIndexAtCardRoot = true;\n GlobalSettings.enableFallback = true;\n GlobalSettings.useWebkitLineClamp = true;\n GlobalSettings.allowMoreThanMaxActionsInOverflowMenu = false;\n GlobalSettings.applets = {\n logEnabled: true,\n logLevel: Enums.LogLevel.Error,\n maximumRetryAttempts: 3,\n defaultTimeBetweenRetryAttempts: 3000,\n authPromptWidth: 400,\n authPromptHeight: 600,\n refresh: {\n mode: Enums.RefreshMode.Manual,\n timeBetweenAutomaticRefreshes: 3000,\n maximumConsecutiveAutomaticRefreshes: 3,\n allowManualRefreshesAfterAutomaticRefreshes: true\n }\n };\n return GlobalSettings;\n}());\nexports.GlobalSettings = GlobalSettings;\nexports.ContentTypes = {\n applicationJson: \"application/json\",\n applicationXWwwFormUrlencoded: \"application/x-www-form-urlencoded\"\n};\nvar StringWithSubstitutions = /** @class */ (function () {\n function StringWithSubstitutions() {\n this._isProcessed = false;\n }\n StringWithSubstitutions.prototype.getReferencedInputs = function (inputs, referencedInputs) {\n if (!referencedInputs) {\n throw new Error(\"The referencedInputs parameter cannot be null.\");\n }\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n var matches = new RegExp(\"\\\\{{2}(\" + input.id + \").value\\\\}{2}\", \"gi\").exec(this._original);\n if (matches != null && input.id) {\n referencedInputs[input.id] = input;\n }\n }\n };\n StringWithSubstitutions.prototype.substituteInputValues = function (inputs, contentType) {\n this._processed = this._original;\n if (this._original) {\n var regEx = /\\{{2}([a-z0-9_$@]+).value\\}{2}/gi;\n var matches = void 0;\n while ((matches = regEx.exec(this._original)) !== null) {\n for (var _i = 0, _a = Object.keys(inputs); _i < _a.length; _i++) {\n var key = _a[_i];\n if (key.toLowerCase() == matches[1].toLowerCase()) {\n var matchedInput = inputs[key];\n var valueForReplace = \"\";\n if (matchedInput.value) {\n valueForReplace = matchedInput.value;\n }\n if (contentType === exports.ContentTypes.applicationJson) {\n valueForReplace = JSON.stringify(valueForReplace);\n valueForReplace = valueForReplace.slice(1, -1);\n }\n else if (contentType === exports.ContentTypes.applicationXWwwFormUrlencoded) {\n valueForReplace = encodeURIComponent(valueForReplace);\n }\n this._processed = this._processed.replace(matches[0], valueForReplace);\n break;\n }\n }\n }\n }\n this._isProcessed = true;\n };\n StringWithSubstitutions.prototype.getOriginal = function () {\n return this._original;\n };\n StringWithSubstitutions.prototype.get = function () {\n if (!this._isProcessed) {\n return this._original;\n }\n else {\n return this._processed;\n }\n };\n StringWithSubstitutions.prototype.set = function (value) {\n this._original = value;\n this._isProcessed = false;\n };\n return StringWithSubstitutions;\n}());\nexports.StringWithSubstitutions = StringWithSubstitutions;\nvar SpacingDefinition = /** @class */ (function () {\n function SpacingDefinition(top, right, bottom, left) {\n if (top === void 0) { top = 0; }\n if (right === void 0) { right = 0; }\n if (bottom === void 0) { bottom = 0; }\n if (left === void 0) { left = 0; }\n this.left = 0;\n this.top = 0;\n this.right = 0;\n this.bottom = 0;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n return SpacingDefinition;\n}());\nexports.SpacingDefinition = SpacingDefinition;\nvar PaddingDefinition = /** @class */ (function () {\n function PaddingDefinition(top, right, bottom, left) {\n if (top === void 0) { top = Enums.Spacing.None; }\n if (right === void 0) { right = Enums.Spacing.None; }\n if (bottom === void 0) { bottom = Enums.Spacing.None; }\n if (left === void 0) { left = Enums.Spacing.None; }\n this.top = Enums.Spacing.None;\n this.right = Enums.Spacing.None;\n this.bottom = Enums.Spacing.None;\n this.left = Enums.Spacing.None;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n return PaddingDefinition;\n}());\nexports.PaddingDefinition = PaddingDefinition;\nvar SizeAndUnit = /** @class */ (function () {\n function SizeAndUnit(physicalSize, unit) {\n this.physicalSize = physicalSize;\n this.unit = unit;\n }\n SizeAndUnit.parse = function (input, requireUnitSpecifier) {\n if (requireUnitSpecifier === void 0) { requireUnitSpecifier = false; }\n var result = new SizeAndUnit(0, Enums.SizeUnit.Weight);\n if (typeof input === \"number\") {\n result.physicalSize = input;\n return result;\n }\n else if (typeof input === \"string\") {\n var regExp = /^([0-9]+)(px|\\*)?$/g;\n var matches = regExp.exec(input);\n var expectedMatchCount = requireUnitSpecifier ? 3 : 2;\n if (matches && matches.length >= expectedMatchCount) {\n result.physicalSize = parseInt(matches[1]);\n if (matches.length == 3) {\n if (matches[2] == \"px\") {\n result.unit = Enums.SizeUnit.Pixel;\n }\n }\n return result;\n }\n }\n throw new Error(\"Invalid size: \" + input);\n };\n return SizeAndUnit;\n}());\nexports.SizeAndUnit = SizeAndUnit;\n/**\n * Fast UUID generator, RFC4122 version 4 compliant.\n * @author Jeff Ward (jcward.com).\n * @license MIT license\n * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n **/\nvar UUID = /** @class */ (function () {\n function UUID() {\n }\n UUID.generate = function () {\n var d0 = Math.random() * 0xffffffff | 0;\n var d1 = Math.random() * 0xffffffff | 0;\n var d2 = Math.random() * 0xffffffff | 0;\n var d3 = Math.random() * 0xffffffff | 0;\n return UUID.lut[d0 & 0xff] + UUID.lut[d0 >> 8 & 0xff] + UUID.lut[d0 >> 16 & 0xff] + UUID.lut[d0 >> 24 & 0xff] + '-' +\n UUID.lut[d1 & 0xff] + UUID.lut[d1 >> 8 & 0xff] + '-' + UUID.lut[d1 >> 16 & 0x0f | 0x40] + UUID.lut[d1 >> 24 & 0xff] + '-' +\n UUID.lut[d2 & 0x3f | 0x80] + UUID.lut[d2 >> 8 & 0xff] + '-' + UUID.lut[d2 >> 16 & 0xff] + UUID.lut[d2 >> 24 & 0xff] +\n UUID.lut[d3 & 0xff] + UUID.lut[d3 >> 8 & 0xff] + UUID.lut[d3 >> 16 & 0xff] + UUID.lut[d3 >> 24 & 0xff];\n };\n UUID.initialize = function () {\n for (var i = 0; i < 256; i++) {\n UUID.lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n }\n };\n UUID.lut = [];\n return UUID;\n}());\nexports.UUID = UUID;\nUUID.initialize();\n//# sourceMappingURL=shared.js.map","\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Strings = void 0;\nvar Strings = /** @class */ (function () {\n function Strings() {\n }\n Strings.errors = {\n unknownElementType: function (typeName) { return \"Unknown element type \\\"\" + typeName + \"\\\". Fallback will be used if present.\"; },\n unknownActionType: function (typeName) { return \"Unknown action type \\\"\" + typeName + \"\\\". Fallback will be used if present.\"; },\n elementTypeNotAllowed: function (typeName) { return \"Element type \\\"\" + typeName + \"\\\" is not allowed in this context.\"; },\n actionTypeNotAllowed: function (typeName) { return \"Action type \\\"\" + typeName + \"\\\" is not allowed in this context.\"; },\n invalidPropertyValue: function (value, propertyName) { return \"Invalid value \\\"\" + value + \"\\\" for property \\\"\" + propertyName + \"\\\".\"; },\n showCardMustHaveCard: function () { return \"\\\"An Action.ShowCard must have its \\\"card\\\" property set to a valid AdaptiveCard object.\"; },\n invalidColumnWidth: function (invalidWidth) { return \"Invalid column width \\\"\" + invalidWidth + \"\\\" - defaulting to \\\"auto\\\".\"; },\n invalidCardVersion: function (defaultingToVersion) { return \"Invalid card version. Defaulting to \\\"\" + defaultingToVersion + \"\\\".\"; },\n invalidVersionString: function (versionString) { return \"Invalid version string \\\"\" + versionString + \"\\\".\"; },\n propertyValueNotSupported: function (value, propertyName, supportedInVersion, versionUsed) { return \"Value \\\"\" + value + \"\\\" for property \\\"\" + propertyName + \"\\\" is supported in version \" + supportedInVersion + \", but you are using version \" + versionUsed + \".\"; },\n propertyNotSupported: function (propertyName, supportedInVersion, versionUsed) { return \"Property \\\"\" + propertyName + \"\\\" is supported in version \" + supportedInVersion + \", but you are using version \" + versionUsed + \".\"; },\n indexOutOfRange: function (index) { return \"Index out of range (\" + index + \").\"; },\n elementCannotBeUsedAsInline: function () { return \"RichTextBlock.addInline: the specified card element cannot be used as a RichTextBlock inline.\"; },\n inlineAlreadyParented: function () { return \"RichTextBlock.addInline: the specified inline already belongs to another RichTextBlock.\"; },\n interactivityNotAllowed: function () { return \"Interactivity is not allowed.\"; },\n inputsMustHaveUniqueId: function () { return \"All inputs must have a unique Id.\"; },\n choiceSetMustHaveAtLeastOneChoice: function () { return \"An Input.ChoiceSet must have at least one choice defined.\"; },\n choiceSetChoicesMustHaveTitleAndValue: function () { return \"All choices in an Input.ChoiceSet must have their title and value properties set.\"; },\n propertyMustBeSet: function (propertyName) { return \"Property \\\"\" + propertyName + \"\\\" must be set.\"; },\n actionHttpHeadersMustHaveNameAndValue: function () { return \"All headers of an Action.Http must have their name and value properties set.\"; },\n tooManyActions: function (maximumActions) { return \"Maximum number of actions exceeded (\" + maximumActions + \").\"; },\n columnAlreadyBelongsToAnotherSet: function () { return \"This column already belongs to another ColumnSet.\"; },\n invalidCardType: function () { return \"Invalid or missing card type. Make sure the card's type property is set to \\\"AdaptiveCard\\\".\"; },\n unsupportedCardVersion: function (version, maxSupportedVersion) { return \"The specified card version (\" + version + \") is not supported. The maximum supported card version is \" + maxSupportedVersion + \".\"; },\n duplicateId: function (id) { return \"Duplicate Id \\\"\" + id + \"\\\".\"; },\n markdownProcessingNotEnabled: function () { return \"Markdown processing isn't enabled. Please see https://www.npmjs.com/package/adaptivecards#supporting-markdown\"; },\n processMarkdownEventRemoved: function () { return \"The processMarkdown event has been removed. Please update your code and set onProcessMarkdown instead.\"; },\n elementAlreadyParented: function () { return \"The element already belongs to another container.\"; },\n actionAlreadyParented: function () { return \"The action already belongs to another element.\"; },\n elementTypeNotStandalone: function (typeName) { return \"Elements of type \" + typeName + \" cannot be used as standalone elements.\"; }\n };\n Strings.magicCodeInputCard = {\n tryAgain: function () { return \"That didn't work... let's try again.\"; },\n pleaseLogin: function () { return \"Please login in the popup. You will obtain a magic code. Paste that code below and select \\\"Submit\\\"\"; },\n enterMagicCode: function () { return \"Enter magic code\"; },\n pleaseEnterMagicCodeYouReceived: function () { return \"Please enter the magic code you received.\"; },\n submit: function () { return \"Submit\"; },\n cancel: function () { return \"Cancel\"; },\n somethingWentWrong: function () { return \"Something went wrong. This action can't be handled.\"; },\n authenticationFailed: function () { return \"Authentication failed.\"; }\n };\n Strings.runtime = {\n automaticRefreshPaused: function () { return \"Automatic refresh paused.\"; },\n clckToRestartAutomaticRefresh: function () { return \"Click to restart.\"; },\n refreshThisCard: function () { return \"Refresh this card\"; }\n };\n Strings.hints = {\n dontUseWeightedAndStrecthedColumnsInSameSet: function () { return \"It is not recommended to use weighted and stretched columns in the same ColumnSet, because in such a situation stretched columns will always get the minimum amount of space.\"; }\n };\n Strings.defaults = {\n inlineActionTitle: function () { return \"Inline Action\"; },\n overflowButtonText: function () { return \"...\"; },\n mediaPlayerAriaLabel: function () { return \"Media content\"; },\n mediaPlayerPlayMedia: function () { return \"Play media\"; }\n };\n return Strings;\n}());\nexports.Strings = Strings;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Table = exports.TableRow = exports.TableCell = exports.StylableContainer = exports.TableColumnDefinition = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar card_elements_1 = require(\"./card-elements\");\nvar enums_1 = require(\"./enums\");\nvar registry_1 = require(\"./registry\");\nvar serialization_1 = require(\"./serialization\");\nvar shared_1 = require(\"./shared\");\nvar strings_1 = require(\"./strings\");\nvar utils_1 = require(\"./utils\");\nvar TableColumnDefinition = /** @class */ (function (_super) {\n __extends(TableColumnDefinition, _super);\n function TableColumnDefinition() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.width = new shared_1.SizeAndUnit(1, enums_1.SizeUnit.Weight);\n return _this;\n }\n TableColumnDefinition.prototype.getSchemaKey = function () {\n return \"ColumnDefinition\";\n };\n TableColumnDefinition.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n TableColumnDefinition.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n TableColumnDefinition.widthProperty = new serialization_1.CustomProperty(serialization_1.Versions.v1_5, \"width\", function (sender, property, source, context) {\n var result = property.defaultValue;\n var value = source[property.name];\n var invalidWidth = false;\n if (typeof value === \"number\" && !isNaN(value)) {\n result = new shared_1.SizeAndUnit(value, enums_1.SizeUnit.Weight);\n }\n else if (typeof value === \"string\") {\n try {\n result = shared_1.SizeAndUnit.parse(value);\n }\n catch (e) {\n invalidWidth = true;\n }\n }\n else {\n invalidWidth = true;\n }\n if (invalidWidth) {\n context.logParseEvent(sender, enums_1.ValidationEvent.InvalidPropertyValue, strings_1.Strings.errors.invalidColumnWidth(value));\n }\n return result;\n }, function (sender, property, target, value, context) {\n if (value.unit === enums_1.SizeUnit.Pixel) {\n context.serializeValue(target, \"width\", value.physicalSize + \"px\");\n }\n else {\n context.serializeNumber(target, \"width\", value.physicalSize);\n }\n }, new shared_1.SizeAndUnit(1, enums_1.SizeUnit.Weight));\n __decorate([\n serialization_1.property(TableColumnDefinition.horizontalCellContentAlignmentProperty)\n ], TableColumnDefinition.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableColumnDefinition.verticalCellContentAlignmentProperty)\n ], TableColumnDefinition.prototype, \"verticalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableColumnDefinition.widthProperty)\n ], TableColumnDefinition.prototype, \"width\", void 0);\n return TableColumnDefinition;\n}(serialization_1.SerializableObject));\nexports.TableColumnDefinition = TableColumnDefinition;\nvar StylableContainer = /** @class */ (function (_super) {\n __extends(StylableContainer, _super);\n function StylableContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._items = [];\n return _this;\n }\n StylableContainer.prototype.parseItem = function (source, context) {\n var _this = this;\n return context.parseCardObject(this, source, [], // Forbidden types not supported for elements for now\n !this.isDesignMode(), function (typeName) {\n return _this.createItemInstance(typeName);\n }, function (typeName, errorType) {\n context.logParseEvent(undefined, enums_1.ValidationEvent.ElementTypeNotAllowed, strings_1.Strings.errors.elementTypeNotAllowed(typeName));\n });\n };\n StylableContainer.prototype.internalAddItem = function (item) {\n if (!item.parent) {\n this._items.push(item);\n item.setParent(this);\n }\n else {\n throw new Error(strings_1.Strings.errors.elementAlreadyParented());\n }\n };\n StylableContainer.prototype.internalRemoveItem = function (item) {\n var itemIndex = this._items.indexOf(item);\n if (itemIndex >= 0) {\n this._items.splice(itemIndex, 1);\n item.setParent(undefined);\n this.updateLayout();\n return true;\n }\n return false;\n };\n StylableContainer.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this._items = [];\n var items = source[this.getCollectionPropertyName()];\n if (Array.isArray(items)) {\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var instance = this.parseItem(item, context);\n if (instance) {\n this._items.push(instance);\n }\n }\n }\n };\n StylableContainer.prototype.internalToJSON = function (target, context) {\n _super.prototype.internalToJSON.call(this, target, context);\n context.serializeArray(target, this.getCollectionPropertyName(), this._items);\n };\n StylableContainer.prototype.removeItem = function (item) {\n return this.internalRemoveItem(item);\n };\n StylableContainer.prototype.getItemCount = function () {\n return this._items.length;\n };\n StylableContainer.prototype.getItemAt = function (index) {\n return this._items[index];\n };\n StylableContainer.prototype.getFirstVisibleRenderedItem = function () {\n return this.getItemCount() > 0 ? this.getItemAt(0) : undefined;\n };\n StylableContainer.prototype.getLastVisibleRenderedItem = function () {\n return this.getItemCount() > 0 ? this.getItemAt(this.getItemCount() - 1) : undefined;\n };\n return StylableContainer;\n}(card_elements_1.StylableCardElementContainer));\nexports.StylableContainer = StylableContainer;\nvar TableCell = /** @class */ (function (_super) {\n __extends(TableCell, _super);\n function TableCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columnIndex = -1;\n _this._cellType = \"data\";\n return _this;\n }\n TableCell.prototype.getHasBorder = function () {\n return this.parentRow.parentTable.showGridLines;\n };\n TableCell.prototype.applyBorder = function () {\n if (this.renderedElement && this.getHasBorder()) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.parentRow.parentTable.gridStyle);\n if (styleDefinition.borderColor) {\n var borderColor = utils_1.stringToCssColor(styleDefinition.borderColor);\n if (borderColor) {\n this.renderedElement.style.borderRight = \"1px solid \" + borderColor;\n this.renderedElement.style.borderBottom = \"1px solid \" + borderColor;\n }\n }\n }\n };\n TableCell.prototype.getDefaultPadding = function () {\n return this.getHasBackground() || this.getHasBorder() ?\n new shared_1.PaddingDefinition(enums_1.Spacing.Small, enums_1.Spacing.Small, enums_1.Spacing.Small, enums_1.Spacing.Small) : _super.prototype.getDefaultPadding.call(this);\n };\n TableCell.prototype.internalRender = function () {\n var cellElement = _super.prototype.internalRender.call(this);\n if (cellElement) {\n cellElement.setAttribute(\"role\", this.cellType === \"data\" ? \"cell\" : \"columnheader\");\n cellElement.style.minWidth = \"0\";\n if (this.cellType === \"header\") {\n cellElement.setAttribute(\"scope\", \"col\");\n }\n }\n return cellElement;\n };\n TableCell.prototype.shouldSerialize = function (context) {\n return true;\n };\n TableCell.prototype.getJsonTypeName = function () {\n return \"TableCell\";\n };\n TableCell.prototype.getEffectiveTextStyleDefinition = function () {\n if (this.cellType === \"header\") {\n return this.hostConfig.textStyles.columnHeader;\n }\n return _super.prototype.getEffectiveTextStyleDefinition.call(this);\n };\n TableCell.prototype.getEffectiveHorizontalAlignment = function () {\n if (this.horizontalAlignment !== undefined) {\n return this.horizontalAlignment;\n }\n if (this.parentRow.horizontalCellContentAlignment !== undefined) {\n return this.parentRow.horizontalCellContentAlignment;\n }\n if (this.columnIndex >= 0) {\n var horizontalAlignment = this.parentRow.parentTable.getColumnAt(this.columnIndex).horizontalCellContentAlignment;\n if (horizontalAlignment !== undefined) {\n return horizontalAlignment;\n }\n }\n if (this.parentRow.parentTable.horizontalCellContentAlignment !== undefined) {\n return this.parentRow.parentTable.horizontalCellContentAlignment;\n }\n return _super.prototype.getEffectiveHorizontalAlignment.call(this);\n };\n TableCell.prototype.getEffectiveVerticalContentAlignment = function () {\n if (this.verticalContentAlignment !== undefined) {\n return this.verticalContentAlignment;\n }\n if (this.parentRow.verticalCellContentAlignment !== undefined) {\n return this.parentRow.verticalCellContentAlignment;\n }\n if (this.columnIndex >= 0) {\n var verticalAlignment = this.parentRow.parentTable.getColumnAt(this.columnIndex).verticalCellContentAlignment;\n if (verticalAlignment !== undefined) {\n return verticalAlignment;\n }\n }\n if (this.parentRow.parentTable.verticalCellContentAlignment !== undefined) {\n return this.parentRow.parentTable.verticalCellContentAlignment;\n }\n return _super.prototype.getEffectiveVerticalContentAlignment.call(this);\n };\n Object.defineProperty(TableCell.prototype, \"columnIndex\", {\n get: function () {\n return this._columnIndex;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"cellType\", {\n get: function () {\n return this._cellType;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"parentRow\", {\n get: function () {\n return this.parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableCell.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n return TableCell;\n}(card_elements_1.Container));\nexports.TableCell = TableCell;\nvar TableRow = /** @class */ (function (_super) {\n __extends(TableRow, _super);\n function TableRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n //#endregion\n TableRow.prototype.getDefaultPadding = function () {\n return new shared_1.PaddingDefinition(enums_1.Spacing.None, enums_1.Spacing.None, enums_1.Spacing.None, enums_1.Spacing.None);\n };\n TableRow.prototype.applyBackground = function () {\n if (this.renderedElement) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.style, this.hostConfig.containerStyles.getStyleByName(this.defaultStyle));\n if (styleDefinition.backgroundColor) {\n var bgColor = utils_1.stringToCssColor(styleDefinition.backgroundColor);\n this.renderedElement.style.backgroundColor = bgColor;\n }\n }\n };\n TableRow.prototype.getCollectionPropertyName = function () {\n return \"cells\";\n };\n TableRow.prototype.createItemInstance = function (typeName) {\n return !typeName || typeName === \"TableCell\" ? new TableCell() : undefined;\n };\n TableRow.prototype.internalRender = function () {\n var isFirstRow = this.getIsFirstRow();\n var cellSpacing = this.hostConfig.table.cellSpacing;\n var rowElement = document.createElement(\"div\");\n rowElement.setAttribute(\"role\", \"row\");\n rowElement.style.display = \"flex\";\n rowElement.style.flexDirection = \"row\";\n for (var i = 0; i < Math.min(this.getItemCount(), this.parentTable.getColumnCount()); i++) {\n var cell = this.getItemAt(i);\n // Cheating a bit in order to keep cellType read-only\n cell[\"_columnIndex\"] = i;\n cell[\"_cellType\"] = (this.parentTable.firstRowAsHeaders && isFirstRow) ? \"header\" : \"data\";\n var renderedCell = cell.render();\n if (renderedCell) {\n var column = this.parentTable.getColumnAt(i);\n if (column.computedWidth.unit === enums_1.SizeUnit.Pixel) {\n renderedCell.style.flex = \"0 0 \" + column.computedWidth.physicalSize + \"px\";\n }\n else {\n renderedCell.style.flex = \"1 1 \" + column.computedWidth.physicalSize + \"%\";\n }\n if (i > 0 && !this.parentTable.showGridLines && cellSpacing > 0) {\n renderedCell.style.marginLeft = cellSpacing + \"px\";\n }\n rowElement.appendChild(renderedCell);\n }\n }\n return rowElement.children.length > 0 ? rowElement : undefined;\n };\n TableRow.prototype.shouldSerialize = function (context) {\n return true;\n };\n TableRow.prototype.addCell = function (cell) {\n this.internalAddItem(cell);\n };\n TableRow.prototype.removeCellAt = function (columnIndex) {\n if (columnIndex >= 0 && columnIndex < this.getItemCount()) {\n return this.removeItem(this.getItemAt(columnIndex));\n }\n return false;\n };\n TableRow.prototype.ensureHasEnoughCells = function (cellCount) {\n while (this.getItemCount() < cellCount) {\n this.addCell(new TableCell());\n }\n };\n TableRow.prototype.getJsonTypeName = function () {\n return \"TableRow\";\n };\n TableRow.prototype.getIsFirstRow = function () {\n return this.parentTable.getItemAt(0) === this;\n };\n Object.defineProperty(TableRow.prototype, \"parentTable\", {\n get: function () {\n return this.parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TableRow.prototype, \"isStandalone\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n //#region Schema\n TableRow.styleProperty = new card_elements_1.ContainerStyleProperty(serialization_1.Versions.v1_5, \"style\");\n TableRow.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n TableRow.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n __decorate([\n serialization_1.property(TableRow.horizontalCellContentAlignmentProperty)\n ], TableRow.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(TableRow.verticalCellContentAlignmentProperty)\n ], TableRow.prototype, \"verticalCellContentAlignment\", void 0);\n return TableRow;\n}(StylableContainer));\nexports.TableRow = TableRow;\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table() {\n //#region Schema\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._columns = [];\n _this.firstRowAsHeaders = true;\n _this.showGridLines = true;\n return _this;\n }\n Object.defineProperty(Table.prototype, \"gridStyle\", {\n get: function () {\n var style = this.getValue(Table.gridStyleProperty);\n if (style && this.hostConfig.containerStyles.getStyleByName(style)) {\n return style;\n }\n return undefined;\n },\n set: function (value) {\n this.setValue(Table.gridStyleProperty, value);\n },\n enumerable: false,\n configurable: true\n });\n //#endregion\n Table.prototype.ensureRowsHaveEnoughCells = function () {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).ensureHasEnoughCells(this.getColumnCount());\n }\n };\n Table.prototype.removeCellsFromColumn = function (columnIndex) {\n for (var i = 0; i < this.getItemCount(); i++) {\n this.getItemAt(i).removeCellAt(columnIndex);\n }\n };\n Table.prototype.getCollectionPropertyName = function () {\n return \"rows\";\n };\n Table.prototype.createItemInstance = function (typeName) {\n return !typeName || typeName === \"TableRow\" ? new TableRow() : undefined;\n };\n Table.prototype.internalParse = function (source, context) {\n _super.prototype.internalParse.call(this, source, context);\n this.ensureRowsHaveEnoughCells();\n };\n Table.prototype.internalRender = function () {\n if (this.getItemCount() > 0) {\n var totalWeights = 0;\n for (var _i = 0, _a = this._columns; _i < _a.length; _i++) {\n var column = _a[_i];\n if (column.width.unit === enums_1.SizeUnit.Weight) {\n totalWeights += column.width.physicalSize;\n }\n }\n for (var _b = 0, _c = this._columns; _b < _c.length; _b++) {\n var column = _c[_b];\n if (column.width.unit === enums_1.SizeUnit.Pixel) {\n column.computedWidth = new shared_1.SizeAndUnit(column.width.physicalSize, enums_1.SizeUnit.Pixel);\n }\n else {\n column.computedWidth = new shared_1.SizeAndUnit(100 / totalWeights * column.width.physicalSize, enums_1.SizeUnit.Weight);\n }\n }\n var tableElement = document.createElement(\"div\");\n tableElement.setAttribute(\"role\", \"table\");\n tableElement.style.display = \"flex\";\n tableElement.style.flexDirection = \"column\";\n if (this.showGridLines) {\n var styleDefinition = this.hostConfig.containerStyles.getStyleByName(this.gridStyle);\n if (styleDefinition.borderColor) {\n var borderColor = utils_1.stringToCssColor(styleDefinition.borderColor);\n if (borderColor) {\n tableElement.style.borderTop = \"1px solid \" + borderColor;\n tableElement.style.borderLeft = \"1px solid \" + borderColor;\n }\n }\n }\n var cellSpacing = this.hostConfig.table.cellSpacing;\n for (var i = 0; i < this.getItemCount(); i++) {\n var renderedRow = this.getItemAt(i).render();\n if (renderedRow) {\n if (i > 0 && !this.showGridLines && cellSpacing > 0) {\n var separatorRow = document.createElement(\"div\");\n separatorRow.setAttribute(\"aria-hidden\", \"true\");\n separatorRow.style.height = cellSpacing + \"px\";\n tableElement.appendChild(separatorRow);\n }\n tableElement.appendChild(renderedRow);\n }\n }\n return tableElement;\n }\n return undefined;\n };\n Table.prototype.addColumn = function (column) {\n this._columns.push(column);\n this.ensureRowsHaveEnoughCells();\n };\n Table.prototype.removeColumn = function (column) {\n var index = this._columns.indexOf(column);\n if (index >= 0) {\n this.removeCellsFromColumn(index);\n this._columns.splice(index, 1);\n }\n };\n Table.prototype.getColumnCount = function () {\n return this._columns.length;\n };\n Table.prototype.getColumnAt = function (index) {\n return this._columns[index];\n };\n Table.prototype.addRow = function (row) {\n this.internalAddItem(row);\n row.ensureHasEnoughCells(this.getColumnCount());\n };\n Table.prototype.getJsonTypeName = function () {\n return \"Table\";\n };\n Table.columnsProperty = new serialization_1.SerializableObjectCollectionProperty(serialization_1.Versions.v1_5, \"columns\", TableColumnDefinition);\n Table.firstRowAsHeadersProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"firstRowAsHeaders\", true);\n Table.showGridLinesProperty = new serialization_1.BoolProperty(serialization_1.Versions.v1_5, \"showGridLines\", true);\n Table.gridStyleProperty = new card_elements_1.ContainerStyleProperty(serialization_1.Versions.v1_5, \"gridStyle\");\n Table.horizontalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"horizontalCellContentAlignment\", enums_1.HorizontalAlignment);\n Table.verticalCellContentAlignmentProperty = new serialization_1.EnumProperty(serialization_1.Versions.v1_5, \"verticalCellContentAlignment\", enums_1.VerticalAlignment);\n __decorate([\n serialization_1.property(Table.columnsProperty)\n ], Table.prototype, \"_columns\", void 0);\n __decorate([\n serialization_1.property(Table.firstRowAsHeadersProperty)\n ], Table.prototype, \"firstRowAsHeaders\", void 0);\n __decorate([\n serialization_1.property(Table.showGridLinesProperty)\n ], Table.prototype, \"showGridLines\", void 0);\n __decorate([\n serialization_1.property(Table.gridStyleProperty)\n ], Table.prototype, \"gridStyle\", null);\n __decorate([\n serialization_1.property(Table.horizontalCellContentAlignmentProperty)\n ], Table.prototype, \"horizontalCellContentAlignment\", void 0);\n __decorate([\n serialization_1.property(Table.verticalCellContentAlignmentProperty)\n ], Table.prototype, \"verticalCellContentAlignment\", void 0);\n return Table;\n}(StylableContainer));\nexports.Table = Table;\nregistry_1.GlobalRegistry.defaultElements.register(\"Table\", Table, serialization_1.Versions.v1_5);\n//# sourceMappingURL=table.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatText = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar AbstractTextFormatter = /** @class */ (function () {\n function AbstractTextFormatter(regularExpression) {\n this._regularExpression = regularExpression;\n }\n AbstractTextFormatter.prototype.format = function (lang, input) {\n var matches;\n if (input) {\n var result = input;\n while ((matches = this._regularExpression.exec(input)) != null) {\n result = result.replace(matches[0], this.internalFormat(lang, matches));\n }\n ;\n return result;\n }\n else {\n return input;\n }\n };\n return AbstractTextFormatter;\n}());\nvar DateFormatter = /** @class */ (function (_super) {\n __extends(DateFormatter, _super);\n function DateFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateFormatter.prototype.internalFormat = function (lang, matches) {\n var date = new Date(Date.parse(matches[1]));\n var format = matches[2] != undefined ? matches[2].toLowerCase() : \"compact\";\n if (format != \"compact\") {\n return date.toLocaleDateString(lang, { day: \"numeric\", weekday: format, month: format, year: \"numeric\" });\n }\n else {\n return date.toLocaleDateString();\n }\n };\n return DateFormatter;\n}(AbstractTextFormatter));\nvar TimeFormatter = /** @class */ (function (_super) {\n __extends(TimeFormatter, _super);\n function TimeFormatter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeFormatter.prototype.internalFormat = function (lang, matches) {\n var date = new Date(Date.parse(matches[1]));\n return date.toLocaleTimeString(lang, { hour: 'numeric', minute: '2-digit' });\n };\n return TimeFormatter;\n}(AbstractTextFormatter));\nfunction formatText(lang, text) {\n var formatters = [\n new DateFormatter(/\\{{2}DATE\\((\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|(?:(?:-|\\+)\\d{2}:\\d{2})))(?:, ?(COMPACT|LONG|SHORT))?\\)\\}{2}/g),\n new TimeFormatter(/\\{{2}TIME\\((\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|(?:(?:-|\\+)\\d{2}:\\d{2})))\\)\\}{2}/g)\n ];\n var result = text;\n for (var _i = 0, formatters_1 = formatters; _i < formatters_1.length; _i++) {\n var formatter = formatters_1[_i];\n result = formatter.format(lang, result);\n }\n return result;\n}\nexports.formatText = formatText;\n//# sourceMappingURL=text-formatters.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clearElementChildren = exports.getScrollY = exports.getScrollX = exports.getFitStatus = exports.truncate = exports.stringToCssColor = exports.parseEnum = exports.getEnumValueByName = exports.parseBool = exports.parseNumber = exports.parseString = exports.appendChild = exports.generateUniqueId = exports.isMobileOS = exports.isInternetExplorer = void 0;\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\nvar Enums = require(\"./enums\");\nvar Shared = require(\"./shared\");\nfunction isInternetExplorer() {\n // The documentMode property only exists in IE\n return window.document.documentMode !== undefined;\n}\nexports.isInternetExplorer = isInternetExplorer;\nfunction isMobileOS() {\n var userAgent = window.navigator.userAgent;\n return !!userAgent.match(/Android/i) || !!userAgent.match(/iPad/i) || !!userAgent.match(/iPhone/i);\n}\nexports.isMobileOS = isMobileOS;\n/**\n * Generate a UUID prepended with \"__ac-\"\n */\nfunction generateUniqueId() {\n return \"__ac-\" + Shared.UUID.generate();\n}\nexports.generateUniqueId = generateUniqueId;\nfunction appendChild(node, child) {\n if (child) {\n node.appendChild(child);\n }\n}\nexports.appendChild = appendChild;\nfunction parseString(obj, defaultValue) {\n return typeof obj === \"string\" ? obj : defaultValue;\n}\nexports.parseString = parseString;\nfunction parseNumber(obj, defaultValue) {\n return typeof obj === \"number\" ? obj : defaultValue;\n}\nexports.parseNumber = parseNumber;\nfunction parseBool(value, defaultValue) {\n if (typeof value === \"boolean\") {\n return value;\n }\n else if (typeof value === \"string\") {\n switch (value.toLowerCase()) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n return defaultValue;\n }\n }\n return defaultValue;\n}\nexports.parseBool = parseBool;\nfunction getEnumValueByName(enumType, name) {\n for (var key in enumType) {\n var keyAsNumber = parseInt(key, 10);\n if (keyAsNumber >= 0) {\n var value = enumType[key];\n if (value && typeof value === \"string\" && value.toLowerCase() === name.toLowerCase()) {\n return keyAsNumber;\n }\n }\n }\n return undefined;\n}\nexports.getEnumValueByName = getEnumValueByName;\nfunction parseEnum(enumType, name, defaultValue) {\n if (!name) {\n return defaultValue;\n }\n var enumValue = getEnumValueByName(enumType, name);\n return enumValue !== undefined ? enumValue : defaultValue;\n}\nexports.parseEnum = parseEnum;\nfunction stringToCssColor(color) {\n if (color) {\n var regEx = /#([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?/gi;\n var matches = regEx.exec(color);\n if (matches && matches[4]) {\n var a = parseInt(matches[1], 16) / 255;\n var r = parseInt(matches[2], 16);\n var g = parseInt(matches[3], 16);\n var b = parseInt(matches[4], 16);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + a + \")\";\n }\n }\n return color;\n}\nexports.stringToCssColor = stringToCssColor;\nfunction truncate(element, maxHeight, lineHeight) {\n var fits = function () {\n // Allow a one pixel overflow to account for rounding differences\n // between browsers\n return maxHeight - element.scrollHeight >= -1.0;\n };\n if (fits())\n return;\n var fullText = element.innerHTML;\n var truncateAt = function (idx) {\n element.innerHTML = fullText.substring(0, idx) + '...';\n };\n var breakableIndices = findBreakableIndices(fullText);\n var lo = 0;\n var hi = breakableIndices.length;\n var bestBreakIdx = 0;\n // Do a binary search for the longest string that fits\n while (lo < hi) {\n var mid = Math.floor((lo + hi) / 2);\n truncateAt(breakableIndices[mid]);\n if (fits()) {\n bestBreakIdx = breakableIndices[mid];\n lo = mid + 1;\n }\n else {\n hi = mid;\n }\n }\n truncateAt(bestBreakIdx);\n // If we have extra room, try to expand the string letter by letter\n // (covers the case where we have to break in the middle of a long word)\n if (lineHeight && maxHeight - element.scrollHeight >= lineHeight - 1.0) {\n var idx = findNextCharacter(fullText, bestBreakIdx);\n while (idx < fullText.length) {\n truncateAt(idx);\n if (fits()) {\n bestBreakIdx = idx;\n idx = findNextCharacter(fullText, idx);\n }\n else {\n break;\n }\n }\n truncateAt(bestBreakIdx);\n }\n}\nexports.truncate = truncate;\nfunction findBreakableIndices(html) {\n var results = [];\n var idx = findNextCharacter(html, -1);\n while (idx < html.length) {\n if (html[idx] == ' ') {\n results.push(idx);\n }\n idx = findNextCharacter(html, idx);\n }\n return results;\n}\nfunction findNextCharacter(html, currIdx) {\n currIdx += 1;\n // If we found the start of an HTML tag, keep advancing until we get\n // past it, so we don't end up truncating in the middle of the tag\n while (currIdx < html.length && html[currIdx] == '<') {\n while (currIdx < html.length && html[currIdx++] != '>')\n ;\n }\n return currIdx;\n}\nfunction getFitStatus(element, containerEnd) {\n var start = element.offsetTop;\n var end = start + element.clientHeight;\n if (end <= containerEnd) {\n return Enums.ContainerFitStatus.FullyInContainer;\n }\n else if (start < containerEnd) {\n return Enums.ContainerFitStatus.Overflowing;\n }\n else {\n return Enums.ContainerFitStatus.FullyOutOfContainer;\n }\n}\nexports.getFitStatus = getFitStatus;\nfunction getScrollX() {\n return window.pageXOffset;\n}\nexports.getScrollX = getScrollX;\nfunction getScrollY() {\n return window.pageYOffset;\n}\nexports.getScrollY = getScrollY;\nfunction clearElementChildren(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\nexports.clearElementChildren = clearElementChildren;\n//# sourceMappingURL=utils.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","var register = require(\"./lib/register\");\nvar addHook = require(\"./lib/add\");\nvar removeHook = require(\"./lib/remove\");\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind;\nvar bindable = bind.bind(bind);\n\nfunction bindApi(hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(\n null,\n name ? [state, name] : [state]\n );\n hook.api = { remove: removeHookRef };\n hook.remove = removeHookRef;\n [\"before\", \"error\", \"after\", \"wrap\"].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind];\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);\n });\n}\n\nfunction HookSingular() {\n var singularHookName = \"h\";\n var singularHookState = {\n registry: {},\n };\n var singularHook = register.bind(null, singularHookState, singularHookName);\n bindApi(singularHook, singularHookState, singularHookName);\n return singularHook;\n}\n\nfunction HookCollection() {\n var state = {\n registry: {},\n };\n\n var hook = register.bind(null, state);\n bindApi(hook, state);\n\n return hook;\n}\n\nvar collectionHookDeprecationMessageDisplayed = false;\nfunction Hook() {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn(\n '[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4'\n );\n collectionHookDeprecationMessageDisplayed = true;\n }\n return HookCollection();\n}\n\nHook.Singular = HookSingular.bind();\nHook.Collection = HookCollection.bind();\n\nmodule.exports = Hook;\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook;\nmodule.exports.Singular = Hook.Singular;\nmodule.exports.Collection = Hook.Collection;\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","\"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\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.core !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;","const nodeFetch = require('node-fetch')\nconst realFetch = nodeFetch.default || nodeFetch\n\nconst fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nfetch.ponyfill = true\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\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","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\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","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\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","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","'use strict';\n\n/**\n * Converts tokens for a single address into an address object\n *\n * @param {Array} tokens Tokens object\n * @return {Object} Address object\n */\nfunction _handleAddress(tokens) {\n let token;\n let isGroup = false;\n let state = 'text';\n let address;\n let addresses = [];\n let data = {\n address: [],\n comment: [],\n group: [],\n text: []\n };\n let i;\n let len;\n\n // Filter out , (comments) and regular text\n for (i = 0, len = tokens.length; i < len; i++) {\n token = tokens[i];\n if (token.type === 'operator') {\n switch (token.value) {\n case '<':\n state = 'address';\n break;\n case '(':\n state = 'comment';\n break;\n case ':':\n state = 'group';\n isGroup = true;\n break;\n default:\n state = 'text';\n }\n } else if (token.value) {\n if (state === 'address') {\n // handle use case where unquoted name includes a \"<\"\n // Apple Mail truncates everything between an unexpected < and an address\n // and so will we\n token.value = token.value.replace(/^[^<]*<\\s*/, '');\n }\n data[state].push(token.value);\n }\n }\n\n // If there is no text but a comment, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n if (isGroup) {\n // http://tools.ietf.org/html/rfc2822#appendix-A.1.3\n data.text = data.text.join(' ');\n addresses.push({\n name: data.text || (address && address.name),\n group: data.group.length ? addressparser(data.group.join(',')) : []\n });\n } else {\n // If no address was found, try to detect one from regular text\n if (!data.address.length && data.text.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n if (data.text[i].match(/^[^@\\s]+@[^@\\s]+$/)) {\n data.address = data.text.splice(i, 1);\n break;\n }\n }\n\n let _regexHandler = function (address) {\n if (!data.address.length) {\n data.address = [address.trim()];\n return ' ';\n } else {\n return address;\n }\n };\n\n // still no address\n if (!data.address.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n // fixed the regex to parse email address correctly when email address has more than one @\n data.text[i] = data.text[i].replace(/\\s*\\b[^@\\s]+@[^\\s]+\\b\\s*/, _regexHandler).trim();\n if (data.address.length) {\n break;\n }\n }\n }\n }\n\n // If there's still is no text but a comment exixts, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n // Keep only the first address occurence, push others to regular text\n if (data.address.length > 1) {\n data.text = data.text.concat(data.address.splice(1));\n }\n\n // Join values with spaces\n data.text = data.text.join(' ');\n data.address = data.address.join(' ');\n\n if (!data.address && isGroup) {\n return [];\n } else {\n address = {\n address: data.address || data.text || '',\n name: data.text || data.address || ''\n };\n\n if (address.address === address.name) {\n if ((address.address || '').match(/@/)) {\n address.name = '';\n } else {\n address.address = '';\n }\n }\n\n addresses.push(address);\n }\n }\n\n return addresses;\n}\n\n/**\n * Creates a Tokenizer object for tokenizing address field strings\n *\n * @constructor\n * @param {String} str Address field string\n */\nclass Tokenizer {\n constructor(str) {\n this.str = (str || '').toString();\n this.operatorCurrent = '';\n this.operatorExpecting = '';\n this.node = null;\n this.escaped = false;\n\n this.list = [];\n /**\n * Operator tokens and which tokens are expected to end the sequence\n */\n this.operators = {\n '\"': '\"',\n '(': ')',\n '<': '>',\n ',': '',\n ':': ';',\n // Semicolons are not a legal delimiter per the RFC2822 grammar other\n // than for terminating a group, but they are also not valid for any\n // other use in this context. Given that some mail clients have\n // historically allowed the semicolon as a delimiter equivalent to the\n // comma in their UI, it makes sense to treat them the same as a comma\n // when used outside of a group.\n ';': ''\n };\n }\n\n /**\n * Tokenizes the original input string\n *\n * @return {Array} An array of operator|text tokens\n */\n tokenize() {\n let chr,\n list = [];\n for (let i = 0, len = this.str.length; i < len; i++) {\n chr = this.str.charAt(i);\n this.checkChar(chr);\n }\n\n this.list.forEach(node => {\n node.value = (node.value || '').toString().trim();\n if (node.value) {\n list.push(node);\n }\n });\n\n return list;\n }\n\n /**\n * Checks if a character is an operator or text and acts accordingly\n *\n * @param {String} chr Character from the address field\n */\n checkChar(chr) {\n if (this.escaped) {\n // ignore next condition blocks\n } else if (chr === this.operatorExpecting) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = '';\n this.escaped = false;\n return;\n } else if (!this.operatorExpecting && chr in this.operators) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = this.operators[chr];\n this.escaped = false;\n return;\n } else if (['\"', \"'\"].includes(this.operatorExpecting) && chr === '\\\\') {\n this.escaped = true;\n return;\n }\n\n if (!this.node) {\n this.node = {\n type: 'text',\n value: ''\n };\n this.list.push(this.node);\n }\n\n if (chr === '\\n') {\n // Convert newlines to spaces. Carriage return is ignored as \\r and \\n usually\n // go together anyway and there already is a WS for \\n. Lone \\r means something is fishy.\n chr = ' ';\n }\n\n if (chr.charCodeAt(0) >= 0x21 || [' ', '\\t'].includes(chr)) {\n // skip command bytes\n this.node.value += chr;\n }\n\n this.escaped = false;\n }\n}\n\n/**\n * Parses structured e-mail addresses from an address field\n *\n * Example:\n *\n * 'Name '\n *\n * will be converted to\n *\n * [{name: 'Name', address: 'address@domain'}]\n *\n * @param {String} str Address field\n * @return {Array} An array of address objects\n */\nfunction addressparser(str, options) {\n options = options || {};\n\n let tokenizer = new Tokenizer(str);\n let tokens = tokenizer.tokenize();\n\n let addresses = [];\n let address = [];\n let parsedAddresses = [];\n\n tokens.forEach(token => {\n if (token.type === 'operator' && (token.value === ',' || token.value === ';')) {\n if (address.length) {\n addresses.push(address);\n }\n address = [];\n } else {\n address.push(token);\n }\n });\n\n if (address.length) {\n addresses.push(address);\n }\n\n addresses.forEach(address => {\n address = _handleAddress(address);\n if (address.length) {\n parsedAddresses = parsedAddresses.concat(address);\n }\n });\n\n if (options.flatten) {\n let addresses = [];\n let walkAddressList = list => {\n list.forEach(address => {\n if (address.group) {\n return walkAddressList(address.group);\n } else {\n addresses.push(address);\n }\n });\n };\n walkAddressList(parsedAddresses);\n return addresses;\n }\n\n return parsedAddresses;\n}\n\n// expose to the world\nmodule.exports = addressparser;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a base64 encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} base64 encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n return buffer.toString('base64');\n}\n\n/**\n * Adds soft line breaks to a base64 string\n *\n * @param {String} str base64 encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped base64 encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let result = [];\n let pos = 0;\n let chunkLength = lineLength * 1024;\n while (pos < str.length) {\n let wrappedLines = str\n .substr(pos, chunkLength)\n .replace(new RegExp('.{' + lineLength + '}', 'g'), '$&\\r\\n')\n .trim();\n result.push(wrappedLines);\n pos += chunkLength;\n }\n\n return result.join('\\r\\n').trim();\n}\n\n/**\n * Creates a transform stream for encoding data to base64 encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n this._remainingBytes = false;\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return setImmediate(done);\n }\n\n this.inputBytes += chunk.length;\n\n if (this._remainingBytes && this._remainingBytes.length) {\n chunk = Buffer.concat([this._remainingBytes, chunk], this._remainingBytes.length + chunk.length);\n this._remainingBytes = false;\n }\n\n if (chunk.length % 3) {\n this._remainingBytes = chunk.slice(chunk.length - (chunk.length % 3));\n chunk = chunk.slice(0, chunk.length - (chunk.length % 3));\n } else {\n this._remainingBytes = false;\n }\n\n let b64 = this._curLine + encode(chunk);\n\n if (this.options.lineLength) {\n b64 = wrap(b64, this.options.lineLength);\n\n // remove last line as it is still most probably incomplete\n let lastLF = b64.lastIndexOf('\\n');\n if (lastLF < 0) {\n this._curLine = b64;\n b64 = '';\n } else if (lastLF === b64.length - 1) {\n this._curLine = '';\n } else {\n this._curLine = b64.substr(lastLF + 1);\n b64 = b64.substr(0, lastLF + 1);\n }\n }\n\n if (b64) {\n this.outputBytes += b64.length;\n this.push(Buffer.from(b64, 'ascii'));\n }\n\n setImmediate(done);\n }\n\n _flush(done) {\n if (this._remainingBytes && this._remainingBytes.length) {\n this._curLine += encode(this._remainingBytes);\n }\n\n if (this._curLine) {\n this._curLine = wrap(this._curLine, this.options.lineLength);\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n this._curLine = '';\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","'use strict';\n\n// FIXME:\n// replace this Transform mess with a method that pipes input argument to output argument\n\nconst MessageParser = require('./message-parser');\nconst RelaxedBody = require('./relaxed-body');\nconst sign = require('./sign');\nconst PassThrough = require('stream').PassThrough;\nconst fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\n\nconst DKIM_ALGO = 'sha256';\nconst MAX_MESSAGE_SIZE = 128 * 1024; // buffer messages larger than this to disk\n\n/*\n// Usage:\n\nlet dkim = new DKIM({\n domainName: 'example.com',\n keySelector: 'key-selector',\n privateKey,\n cacheDir: '/tmp'\n});\ndkim.sign(input).pipe(process.stdout);\n\n// Where inputStream is a rfc822 message (either a stream, string or Buffer)\n// and outputStream is a DKIM signed rfc822 message\n*/\n\nclass DKIMSigner {\n constructor(options, keys, input, output) {\n this.options = options || {};\n this.keys = keys;\n\n this.cacheTreshold = Number(this.options.cacheTreshold) || MAX_MESSAGE_SIZE;\n this.hashAlgo = this.options.hashAlgo || DKIM_ALGO;\n\n this.cacheDir = this.options.cacheDir || false;\n\n this.chunks = [];\n this.chunklen = 0;\n this.readPos = 0;\n this.cachePath = this.cacheDir ? path.join(this.cacheDir, 'message.' + Date.now() + '-' + crypto.randomBytes(14).toString('hex')) : false;\n this.cache = false;\n\n this.headers = false;\n this.bodyHash = false;\n this.parser = false;\n this.relaxedBody = false;\n\n this.input = input;\n this.output = output;\n this.output.usingCache = false;\n\n this.hasErrored = false;\n\n this.input.on('error', err => {\n this.hasErrored = true;\n this.cleanup();\n output.emit('error', err);\n });\n }\n\n cleanup() {\n if (!this.cache || !this.cachePath) {\n return;\n }\n fs.unlink(this.cachePath, () => false);\n }\n\n createReadCache() {\n // pipe remainings to cache file\n this.cache = fs.createReadStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.cleanup();\n });\n this.cache.pipe(this.output);\n }\n\n sendNextChunk() {\n if (this.hasErrored) {\n return;\n }\n\n if (this.readPos >= this.chunks.length) {\n if (!this.cache) {\n return this.output.end();\n }\n return this.createReadCache();\n }\n let chunk = this.chunks[this.readPos++];\n if (this.output.write(chunk) === false) {\n return this.output.once('drain', () => {\n this.sendNextChunk();\n });\n }\n setImmediate(() => this.sendNextChunk());\n }\n\n sendSignedOutput() {\n let keyPos = 0;\n let signNextKey = () => {\n if (keyPos >= this.keys.length) {\n this.output.write(this.parser.rawHeaders);\n return setImmediate(() => this.sendNextChunk());\n }\n let key = this.keys[keyPos++];\n let dkimField = sign(this.headers, this.hashAlgo, this.bodyHash, {\n domainName: key.domainName,\n keySelector: key.keySelector,\n privateKey: key.privateKey,\n headerFieldNames: this.options.headerFieldNames,\n skipFields: this.options.skipFields\n });\n if (dkimField) {\n this.output.write(Buffer.from(dkimField + '\\r\\n'));\n }\n return setImmediate(signNextKey);\n };\n\n if (this.bodyHash && this.headers) {\n return signNextKey();\n }\n\n this.output.write(this.parser.rawHeaders);\n this.sendNextChunk();\n }\n\n createWriteCache() {\n this.output.usingCache = true;\n // pipe remainings to cache file\n this.cache = fs.createWriteStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n // drain input\n this.relaxedBody.unpipe(this.cache);\n this.relaxedBody.on('readable', () => {\n while (this.relaxedBody.read() !== null) {\n // do nothing\n }\n });\n this.hasErrored = true;\n // emit error\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.sendSignedOutput();\n });\n this.relaxedBody.removeAllListeners('readable');\n this.relaxedBody.pipe(this.cache);\n }\n\n signStream() {\n this.parser = new MessageParser();\n this.relaxedBody = new RelaxedBody({\n hashAlgo: this.hashAlgo\n });\n\n this.parser.on('headers', value => {\n this.headers = value;\n });\n\n this.relaxedBody.on('hash', value => {\n this.bodyHash = value;\n });\n\n this.relaxedBody.on('readable', () => {\n let chunk;\n if (this.cache) {\n return;\n }\n while ((chunk = this.relaxedBody.read()) !== null) {\n this.chunks.push(chunk);\n this.chunklen += chunk.length;\n if (this.chunklen >= this.cacheTreshold && this.cachePath) {\n return this.createWriteCache();\n }\n }\n });\n\n this.relaxedBody.on('end', () => {\n if (this.cache) {\n return;\n }\n this.sendSignedOutput();\n });\n\n this.parser.pipe(this.relaxedBody);\n setImmediate(() => this.input.pipe(this.parser));\n }\n}\n\nclass DKIM {\n constructor(options) {\n this.options = options || {};\n this.keys = [].concat(\n this.options.keys || {\n domainName: options.domainName,\n keySelector: options.keySelector,\n privateKey: options.privateKey\n }\n );\n }\n\n sign(input, extraOptions) {\n let output = new PassThrough();\n let inputStream = input;\n let writeValue = false;\n\n if (Buffer.isBuffer(input)) {\n writeValue = input;\n inputStream = new PassThrough();\n } else if (typeof input === 'string') {\n writeValue = Buffer.from(input);\n inputStream = new PassThrough();\n }\n\n let options = this.options;\n if (extraOptions && Object.keys(extraOptions).length) {\n options = {};\n Object.keys(this.options || {}).forEach(key => {\n options[key] = this.options[key];\n });\n Object.keys(extraOptions || {}).forEach(key => {\n if (!(key in options)) {\n options[key] = extraOptions[key];\n }\n });\n }\n\n let signer = new DKIMSigner(options, this.keys, inputStream, output);\n setImmediate(() => {\n signer.signStream();\n if (writeValue) {\n setImmediate(() => {\n inputStream.end(writeValue);\n });\n }\n });\n\n return output;\n }\n}\n\nmodule.exports = DKIM;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * MessageParser instance is a transform stream that separates message headers\n * from the rest of the body. Headers are emitted with the 'headers' event. Message\n * body is passed on as the resulting stream.\n */\nclass MessageParser extends Transform {\n constructor(options) {\n super(options);\n this.lastBytes = Buffer.alloc(4);\n this.headersParsed = false;\n this.headerBytes = 0;\n this.headerChunks = [];\n this.rawHeaders = false;\n this.bodySize = 0;\n }\n\n /**\n * Keeps count of the last 4 bytes in order to detect line breaks on chunk boundaries\n *\n * @param {Buffer} data Next data chunk from the stream\n */\n updateLastBytes(data) {\n let lblen = this.lastBytes.length;\n let nblen = Math.min(data.length, lblen);\n\n // shift existing bytes\n for (let i = 0, len = lblen - nblen; i < len; i++) {\n this.lastBytes[i] = this.lastBytes[i + nblen];\n }\n\n // add new bytes\n for (let i = 1; i <= nblen; i++) {\n this.lastBytes[lblen - i] = data[data.length - i];\n }\n }\n\n /**\n * Finds and removes message headers from the remaining body. We want to keep\n * headers separated until final delivery to be able to modify these\n *\n * @param {Buffer} data Next chunk of data\n * @return {Boolean} Returns true if headers are already found or false otherwise\n */\n checkHeaders(data) {\n if (this.headersParsed) {\n return true;\n }\n\n let lblen = this.lastBytes.length;\n let headerPos = 0;\n this.curLinePos = 0;\n for (let i = 0, len = this.lastBytes.length + data.length; i < len; i++) {\n let chr;\n if (i < lblen) {\n chr = this.lastBytes[i];\n } else {\n chr = data[i - lblen];\n }\n if (chr === 0x0a && i) {\n let pr1 = i - 1 < lblen ? this.lastBytes[i - 1] : data[i - 1 - lblen];\n let pr2 = i > 1 ? (i - 2 < lblen ? this.lastBytes[i - 2] : data[i - 2 - lblen]) : false;\n if (pr1 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n } else if (pr1 === 0x0d && pr2 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n }\n }\n }\n\n if (this.headersParsed) {\n this.headerChunks.push(data.slice(0, headerPos));\n this.rawHeaders = Buffer.concat(this.headerChunks, this.headerBytes);\n this.headerChunks = null;\n this.emit('headers', this.parseHeaders());\n if (data.length - 1 > headerPos) {\n let chunk = data.slice(headerPos);\n this.bodySize += chunk.length;\n // this would be the first chunk of data sent downstream\n setImmediate(() => this.push(chunk));\n }\n return false;\n } else {\n this.headerBytes += data.length;\n this.headerChunks.push(data);\n }\n\n // store last 4 bytes to catch header break\n this.updateLastBytes(data);\n\n return false;\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n let headersFound;\n\n try {\n headersFound = this.checkHeaders(chunk);\n } catch (E) {\n return callback(E);\n }\n\n if (headersFound) {\n this.bodySize += chunk.length;\n this.push(chunk);\n }\n\n setImmediate(callback);\n }\n\n _flush(callback) {\n if (this.headerChunks) {\n let chunk = Buffer.concat(this.headerChunks, this.headerBytes);\n this.bodySize += chunk.length;\n this.push(chunk);\n this.headerChunks = null;\n }\n callback();\n }\n\n parseHeaders() {\n let lines = (this.rawHeaders || '').toString().split(/\\r?\\n/);\n for (let i = lines.length - 1; i > 0; i--) {\n if (/^\\s/.test(lines[i])) {\n lines[i - 1] += '\\n' + lines[i];\n lines.splice(i, 1);\n }\n }\n return lines\n .filter(line => line.trim())\n .map(line => ({\n key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),\n line\n }));\n }\n}\n\nmodule.exports = MessageParser;\n","'use strict';\n\n// streams through a message body and calculates relaxed body hash\n\nconst Transform = require('stream').Transform;\nconst crypto = require('crypto');\n\nclass RelaxedBody extends Transform {\n constructor(options) {\n super();\n options = options || {};\n this.chunkBuffer = [];\n this.chunkBufferLen = 0;\n this.bodyHash = crypto.createHash(options.hashAlgo || 'sha1');\n this.remainder = '';\n this.byteLength = 0;\n\n this.debug = options.debug;\n this._debugBody = options.debug ? [] : false;\n }\n\n updateHash(chunk) {\n let bodyStr;\n\n // find next remainder\n let nextRemainder = '';\n\n // This crux finds and removes the spaces from the last line and the newline characters after the last non-empty line\n // If we get another chunk that does not match this description then we can restore the previously processed data\n let state = 'file';\n for (let i = chunk.length - 1; i >= 0; i--) {\n let c = chunk[i];\n\n if (state === 'file' && (c === 0x0a || c === 0x0d)) {\n // do nothing, found \\n or \\r at the end of chunk, stil end of file\n } else if (state === 'file' && (c === 0x09 || c === 0x20)) {\n // switch to line ending mode, this is the last non-empty line\n state = 'line';\n } else if (state === 'line' && (c === 0x09 || c === 0x20)) {\n // do nothing, found ' ' or \\t at the end of line, keep processing the last non-empty line\n } else if (state === 'file' || state === 'line') {\n // non line/file ending character found, switch to body mode\n state = 'body';\n if (i === chunk.length - 1) {\n // final char is not part of line end or file end, so do nothing\n break;\n }\n }\n\n if (i === 0) {\n // reached to the beginning of the chunk, check if it is still about the ending\n // and if the remainder also matches\n if (\n (state === 'file' && (!this.remainder || /[\\r\\n]$/.test(this.remainder))) ||\n (state === 'line' && (!this.remainder || /[ \\t]$/.test(this.remainder)))\n ) {\n // keep everything\n this.remainder += chunk.toString('binary');\n return;\n } else if (state === 'line' || state === 'file') {\n // process existing remainder as normal line but store the current chunk\n nextRemainder = chunk.toString('binary');\n chunk = false;\n break;\n }\n }\n\n if (state !== 'body') {\n continue;\n }\n\n // reached first non ending byte\n nextRemainder = chunk.slice(i + 1).toString('binary');\n chunk = chunk.slice(0, i + 1);\n break;\n }\n\n let needsFixing = !!this.remainder;\n if (chunk && !needsFixing) {\n // check if we even need to change anything\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (i && chunk[i] === 0x0a && chunk[i - 1] !== 0x0d) {\n // missing \\r before \\n\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x0d && chunk[i - 1] === 0x20) {\n // trailing WSP found\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x20 && chunk[i - 1] === 0x20) {\n // multiple spaces found, needs to be replaced with just one\n needsFixing = true;\n break;\n } else if (chunk[i] === 0x09) {\n // TAB found, needs to be replaced with a space\n needsFixing = true;\n break;\n }\n }\n }\n\n if (needsFixing) {\n bodyStr = this.remainder + (chunk ? chunk.toString('binary') : '');\n this.remainder = nextRemainder;\n bodyStr = bodyStr\n .replace(/\\r?\\n/g, '\\n') // use js line endings\n .replace(/[ \\t]*$/gm, '') // remove line endings, rtrim\n .replace(/[ \\t]+/gm, ' ') // single spaces\n .replace(/\\n/g, '\\r\\n'); // restore rfc822 line endings\n chunk = Buffer.from(bodyStr, 'binary');\n } else if (nextRemainder) {\n this.remainder = nextRemainder;\n }\n\n if (this.debug) {\n this._debugBody.push(chunk);\n }\n this.bodyHash.update(chunk);\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n this.updateHash(chunk);\n\n this.byteLength += chunk.length;\n this.push(chunk);\n callback();\n }\n\n _flush(callback) {\n // generate final hash and emit it\n if (/[\\r\\n]$/.test(this.remainder) && this.byteLength > 2) {\n // add terminating line end\n this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n if (!this.byteLength) {\n // emit empty line buffer to keep the stream flowing\n this.push(Buffer.from('\\r\\n'));\n // this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n\n this.emit('hash', this.bodyHash.digest('base64'), this.debug ? Buffer.concat(this._debugBody) : false);\n callback();\n }\n}\n\nmodule.exports = RelaxedBody;\n","'use strict';\n\nconst punycode = require('punycode');\nconst mimeFuncs = require('../mime-funcs');\nconst crypto = require('crypto');\n\n/**\n * Returns DKIM signature header line\n *\n * @param {Object} headers Parsed headers object from MessageParser\n * @param {String} bodyHash Base64 encoded hash of the message\n * @param {Object} options DKIM options\n * @param {String} options.domainName Domain name to be signed for\n * @param {String} options.keySelector DKIM key selector to use\n * @param {String} options.privateKey DKIM private key to use\n * @return {String} Complete header line\n */\n\nmodule.exports = (headers, hashAlgo, bodyHash, options) => {\n options = options || {};\n\n // all listed fields from RFC4871 #5.5\n let defaultFieldNames =\n 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +\n 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +\n 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +\n 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +\n 'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' +\n 'List-Owner:List-Archive';\n\n let fieldNames = options.headerFieldNames || defaultFieldNames;\n\n let canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);\n let dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash);\n\n let signer, signature;\n\n canonicalizedHeaderData.headers += 'dkim-signature:' + relaxedHeaderLine(dkimHeader);\n\n signer = crypto.createSign(('rsa-' + hashAlgo).toUpperCase());\n signer.update(canonicalizedHeaderData.headers);\n try {\n signature = signer.sign(options.privateKey, 'base64');\n } catch (E) {\n return false;\n }\n\n return dkimHeader + signature.replace(/(^.{73}|.{75}(?!\\r?\\n|\\r))/g, '$&\\r\\n ').trim();\n};\n\nmodule.exports.relaxedHeaders = relaxedHeaders;\n\nfunction generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyHash) {\n let dkim = [\n 'v=1',\n 'a=rsa-' + hashAlgo,\n 'c=relaxed/relaxed',\n 'd=' + punycode.toASCII(domainName),\n 'q=dns/txt',\n 's=' + keySelector,\n 'bh=' + bodyHash,\n 'h=' + fieldNames\n ].join('; ');\n\n return mimeFuncs.foldLines('DKIM-Signature: ' + dkim, 76) + ';\\r\\n b=';\n}\n\nfunction relaxedHeaders(headers, fieldNames, skipFields) {\n let includedFields = new Set();\n let skip = new Set();\n let headerFields = new Map();\n\n (skipFields || '')\n .toLowerCase()\n .split(':')\n .forEach(field => {\n skip.add(field.trim());\n });\n\n (fieldNames || '')\n .toLowerCase()\n .split(':')\n .filter(field => !skip.has(field.trim()))\n .forEach(field => {\n includedFields.add(field.trim());\n });\n\n for (let i = headers.length - 1; i >= 0; i--) {\n let line = headers[i];\n // only include the first value from bottom to top\n if (includedFields.has(line.key) && !headerFields.has(line.key)) {\n headerFields.set(line.key, relaxedHeaderLine(line.line));\n }\n }\n\n let headersList = [];\n let fields = [];\n includedFields.forEach(field => {\n if (headerFields.has(field)) {\n fields.push(field);\n headersList.push(field + ':' + headerFields.get(field));\n }\n });\n\n return {\n headers: headersList.join('\\r\\n') + '\\r\\n',\n fieldNames: fields.join(':')\n };\n}\n\nfunction relaxedHeaderLine(line) {\n return line\n .substr(line.indexOf(':') + 1)\n .replace(/\\r?\\n/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n","'use strict';\n\n// module to handle cookies\n\nconst urllib = require('url');\n\nconst SESSION_TIMEOUT = 1800; // 30 min\n\n/**\n * Creates a biskviit cookie jar for managing cookie values in memory\n *\n * @constructor\n * @param {Object} [options] Optional options object\n */\nclass Cookies {\n constructor(options) {\n this.options = options || {};\n this.cookies = [];\n }\n\n /**\n * Stores a cookie string to the cookie storage\n *\n * @param {String} cookieStr Value from the 'Set-Cookie:' header\n * @param {String} url Current URL\n */\n set(cookieStr, url) {\n let urlparts = urllib.parse(url || '');\n let cookie = this.parse(cookieStr);\n let domain;\n\n if (cookie.domain) {\n domain = cookie.domain.replace(/^\\./, '');\n\n // do not allow cross origin cookies\n if (\n // can't be valid if the requested domain is shorter than current hostname\n urlparts.hostname.length < domain.length ||\n // prefix domains with dot to be sure that partial matches are not used\n ('.' + urlparts.hostname).substr(-domain.length + 1) !== '.' + domain\n ) {\n cookie.domain = urlparts.hostname;\n }\n } else {\n cookie.domain = urlparts.hostname;\n }\n\n if (!cookie.path) {\n cookie.path = this.getPath(urlparts.pathname);\n }\n\n // if no expire date, then use sessionTimeout value\n if (!cookie.expires) {\n cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000);\n }\n\n return this.add(cookie);\n }\n\n /**\n * Returns cookie string for the 'Cookie:' header.\n *\n * @param {String} url URL to check for\n * @returns {String} Cookie header or empty string if no matches were found\n */\n get(url) {\n return this.list(url)\n .map(cookie => cookie.name + '=' + cookie.value)\n .join('; ');\n }\n\n /**\n * Lists all valied cookie objects for the specified URL\n *\n * @param {String} url URL to check for\n * @returns {Array} An array of cookie objects\n */\n list(url) {\n let result = [];\n let i;\n let cookie;\n\n for (i = this.cookies.length - 1; i >= 0; i--) {\n cookie = this.cookies[i];\n\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, i);\n continue;\n }\n\n if (this.match(cookie, url)) {\n result.unshift(cookie);\n }\n }\n\n return result;\n }\n\n /**\n * Parses cookie string from the 'Set-Cookie:' header\n *\n * @param {String} cookieStr String from the 'Set-Cookie:' header\n * @returns {Object} Cookie object\n */\n parse(cookieStr) {\n let cookie = {};\n\n (cookieStr || '')\n .toString()\n .split(';')\n .forEach(cookiePart => {\n let valueParts = cookiePart.split('=');\n let key = valueParts.shift().trim().toLowerCase();\n let value = valueParts.join('=').trim();\n let domain;\n\n if (!key) {\n // skip empty parts\n return;\n }\n\n switch (key) {\n case 'expires':\n value = new Date(value);\n // ignore date if can not parse it\n if (value.toString() !== 'Invalid Date') {\n cookie.expires = value;\n }\n break;\n\n case 'path':\n cookie.path = value;\n break;\n\n case 'domain':\n domain = value.toLowerCase();\n if (domain.length && domain.charAt(0) !== '.') {\n domain = '.' + domain; // ensure preceeding dot for user set domains\n }\n cookie.domain = domain;\n break;\n\n case 'max-age':\n cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);\n break;\n\n case 'secure':\n cookie.secure = true;\n break;\n\n case 'httponly':\n cookie.httponly = true;\n break;\n\n default:\n if (!cookie.name) {\n cookie.name = key;\n cookie.value = value;\n }\n }\n });\n\n return cookie;\n }\n\n /**\n * Checks if a cookie object is valid for a specified URL\n *\n * @param {Object} cookie Cookie object\n * @param {String} url URL to check for\n * @returns {Boolean} true if cookie is valid for specifiec URL\n */\n match(cookie, url) {\n let urlparts = urllib.parse(url || '');\n\n // check if hostname matches\n // .foo.com also matches subdomains, foo.com does not\n if (\n urlparts.hostname !== cookie.domain &&\n (cookie.domain.charAt(0) !== '.' || ('.' + urlparts.hostname).substr(-cookie.domain.length) !== cookie.domain)\n ) {\n return false;\n }\n\n // check if path matches\n let path = this.getPath(urlparts.pathname);\n if (path.substr(0, cookie.path.length) !== cookie.path) {\n return false;\n }\n\n // check secure argument\n if (cookie.secure && urlparts.protocol !== 'https:') {\n return false;\n }\n\n return true;\n }\n\n /**\n * Adds (or updates/removes if needed) a cookie object to the cookie storage\n *\n * @param {Object} cookie Cookie value to be stored\n */\n add(cookie) {\n let i;\n let len;\n\n // nothing to do here\n if (!cookie || !cookie.name) {\n return false;\n }\n\n // overwrite if has same params\n for (i = 0, len = this.cookies.length; i < len; i++) {\n if (this.compare(this.cookies[i], cookie)) {\n // check if the cookie needs to be removed instead\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, 1); // remove expired/unset cookie\n return false;\n }\n\n this.cookies[i] = cookie;\n return true;\n }\n }\n\n // add as new if not already expired\n if (!this.isExpired(cookie)) {\n this.cookies.push(cookie);\n }\n\n return true;\n }\n\n /**\n * Checks if two cookie objects are the same\n *\n * @param {Object} a Cookie to check against\n * @param {Object} b Cookie to check against\n * @returns {Boolean} True, if the cookies are the same\n */\n compare(a, b) {\n return a.name === b.name && a.path === b.path && a.domain === b.domain && a.secure === b.secure && a.httponly === a.httponly;\n }\n\n /**\n * Checks if a cookie is expired\n *\n * @param {Object} cookie Cookie object to check against\n * @returns {Boolean} True, if the cookie is expired\n */\n isExpired(cookie) {\n return (cookie.expires && cookie.expires < new Date()) || !cookie.value;\n }\n\n /**\n * Returns normalized cookie path for an URL path argument\n *\n * @param {String} pathname\n * @returns {String} Normalized path\n */\n getPath(pathname) {\n let path = (pathname || '/').split('/');\n path.pop(); // remove filename part\n path = path.join('/').trim();\n\n // ensure path prefix /\n if (path.charAt(0) !== '/') {\n path = '/' + path;\n }\n\n // ensure path suffix /\n if (path.substr(-1) !== '/') {\n path += '/';\n }\n\n return path;\n }\n}\n\nmodule.exports = Cookies;\n","'use strict';\n\nconst http = require('http');\nconst https = require('https');\nconst urllib = require('url');\nconst zlib = require('zlib');\nconst PassThrough = require('stream').PassThrough;\nconst Cookies = require('./cookies');\nconst packageData = require('../../package.json');\n\nconst MAX_REDIRECTS = 5;\n\nmodule.exports = function (url, options) {\n return nmfetch(url, options);\n};\n\nmodule.exports.Cookies = Cookies;\n\nfunction nmfetch(url, options) {\n options = options || {};\n\n options.fetchRes = options.fetchRes || new PassThrough();\n options.cookies = options.cookies || new Cookies();\n options.redirects = options.redirects || 0;\n options.maxRedirects = isNaN(options.maxRedirects) ? MAX_REDIRECTS : options.maxRedirects;\n\n if (options.cookie) {\n [].concat(options.cookie || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n options.cookie = false;\n }\n\n let fetchRes = options.fetchRes;\n let parsed = urllib.parse(url);\n let method = (options.method || '').toString().trim().toUpperCase() || 'GET';\n let finished = false;\n let cookies;\n let body;\n\n let handler = parsed.protocol === 'https:' ? https : http;\n\n let headers = {\n 'accept-encoding': 'gzip,deflate',\n 'user-agent': 'nodemailer/' + packageData.version\n };\n\n Object.keys(options.headers || {}).forEach(key => {\n headers[key.toLowerCase().trim()] = options.headers[key];\n });\n\n if (options.userAgent) {\n headers['user-agent'] = options.userAgent;\n }\n\n if (parsed.auth) {\n headers.Authorization = 'Basic ' + Buffer.from(parsed.auth).toString('base64');\n }\n\n if ((cookies = options.cookies.get(url))) {\n headers.cookie = cookies;\n }\n\n if (options.body) {\n if (options.contentType !== false) {\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n }\n\n if (typeof options.body.pipe === 'function') {\n // it's a stream\n headers['Transfer-Encoding'] = 'chunked';\n body = options.body;\n body.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n } else {\n if (options.body instanceof Buffer) {\n body = options.body;\n } else if (typeof options.body === 'object') {\n try {\n // encodeURIComponent can fail on invalid input (partial emoji etc.)\n body = Buffer.from(\n Object.keys(options.body)\n .map(key => {\n let value = options.body[key].toString().trim();\n return encodeURIComponent(key) + '=' + encodeURIComponent(value);\n })\n .join('&')\n );\n } catch (E) {\n if (finished) {\n return;\n }\n finished = true;\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n return;\n }\n } else {\n body = Buffer.from(options.body.toString().trim());\n }\n\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n headers['Content-Length'] = body.length;\n }\n // if method is not provided, use POST instead of GET\n method = (options.method || '').toString().trim().toUpperCase() || 'POST';\n }\n\n let req;\n let reqOptions = {\n method,\n host: parsed.hostname,\n path: parsed.path,\n port: parsed.port ? parsed.port : parsed.protocol === 'https:' ? 443 : 80,\n headers,\n rejectUnauthorized: false,\n agent: false\n };\n\n if (options.tls) {\n Object.keys(options.tls).forEach(key => {\n reqOptions[key] = options.tls[key];\n });\n }\n\n try {\n req = handler.request(reqOptions);\n } catch (E) {\n finished = true;\n setImmediate(() => {\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n });\n return fetchRes;\n }\n\n if (options.timeout) {\n req.setTimeout(options.timeout, () => {\n if (finished) {\n return;\n }\n finished = true;\n req.abort();\n let err = new Error('Request Timeout');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n }\n\n req.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n\n req.on('response', res => {\n let inflate;\n\n if (finished) {\n return;\n }\n\n switch (res.headers['content-encoding']) {\n case 'gzip':\n case 'deflate':\n inflate = zlib.createUnzip();\n break;\n }\n\n if (res.headers['set-cookie']) {\n [].concat(res.headers['set-cookie'] || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n }\n\n if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location) {\n // redirect\n options.redirects++;\n if (options.redirects > options.maxRedirects) {\n finished = true;\n let err = new Error('Maximum redirect count exceeded');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n // redirect does not include POST body\n options.method = 'GET';\n options.body = false;\n return nmfetch(urllib.resolve(url, res.headers.location), options);\n }\n\n fetchRes.statusCode = res.statusCode;\n fetchRes.headers = res.headers;\n\n if (res.statusCode >= 300 && !options.allowErrorResponse) {\n finished = true;\n let err = new Error('Invalid status code ' + res.statusCode);\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n\n res.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n\n if (inflate) {\n res.pipe(inflate).pipe(fetchRes);\n inflate.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n } else {\n res.pipe(fetchRes);\n }\n });\n\n setImmediate(() => {\n if (body) {\n try {\n if (typeof body.pipe === 'function') {\n return body.pipe(req);\n } else {\n req.write(body);\n }\n } catch (err) {\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n return;\n }\n }\n req.end();\n });\n\n return fetchRes;\n}\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object to generate JSON output\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass JSONTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'JSONTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'json-transport'\n });\n }\n\n /**\n *

Compiles a mailcomposer message and forwards it to handler that sends it.

\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Composing JSON structure of %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n setImmediate(() => {\n mail.normalize((err, data) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed building JSON structure for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n }\n\n delete data.envelope;\n delete data.normalizedHeaders;\n\n return done(null, {\n envelope,\n messageId,\n message: this.options.skipEncoding ? data : JSON.stringify(data)\n });\n });\n });\n }\n}\n\nmodule.exports = JSONTransport;\n","/* eslint no-undefined: 0 */\n\n'use strict';\n\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\n\n/**\n * Creates the object for composing a MimeNode instance out from the mail options\n *\n * @constructor\n * @param {Object} mail Mail options\n */\nclass MailComposer {\n constructor(mail) {\n this.mail = mail || {};\n this.message = false;\n }\n\n /**\n * Builds MimeNode instance\n */\n compile() {\n this._alternatives = this.getAlternatives();\n this._htmlNode = this._alternatives.filter(alternative => /^text\\/html\\b/i.test(alternative.contentType)).pop();\n this._attachments = this.getAttachments(!!this._htmlNode);\n\n this._useRelated = !!(this._htmlNode && this._attachments.related.length);\n this._useAlternative = this._alternatives.length > 1;\n this._useMixed = this._attachments.attached.length > 1 || (this._alternatives.length && this._attachments.attached.length === 1);\n\n // Compose MIME tree\n if (this.mail.raw) {\n this.message = new MimeNode('message/rfc822', { newline: this.mail.newline }).setRaw(this.mail.raw);\n } else if (this._useMixed) {\n this.message = this._createMixed();\n } else if (this._useAlternative) {\n this.message = this._createAlternative();\n } else if (this._useRelated) {\n this.message = this._createRelated();\n } else {\n this.message = this._createContentNode(\n false,\n []\n .concat(this._alternatives || [])\n .concat(this._attachments.attached || [])\n .shift() || {\n contentType: 'text/plain',\n content: ''\n }\n );\n }\n\n // Add custom headers\n if (this.mail.headers) {\n this.message.addHeader(this.mail.headers);\n }\n\n // Add headers to the root node, always overrides custom headers\n ['from', 'sender', 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'message-id', 'date'].forEach(header => {\n let key = header.replace(/-(\\w)/g, (o, c) => c.toUpperCase());\n if (this.mail[key]) {\n this.message.setHeader(header, this.mail[key]);\n }\n });\n\n // Sets custom envelope\n if (this.mail.envelope) {\n this.message.setEnvelope(this.mail.envelope);\n }\n\n // ensure Message-Id value\n this.message.messageId();\n\n return this.message;\n }\n\n /**\n * List all attachments. Resulting attachment objects can be used as input for MimeNode nodes\n *\n * @param {Boolean} findRelated If true separate related attachments from attached ones\n * @returns {Object} An object of arrays (`related` and `attached`)\n */\n getAttachments(findRelated) {\n let icalEvent, eventObject;\n let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {\n let data;\n let isMessageNode = /^message\\//i.test(attachment.contentType);\n\n if (/^data:/i.test(attachment.path || attachment.href)) {\n attachment = this._processDataUrl(attachment);\n }\n\n data = {\n contentType: attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin'),\n contentDisposition: attachment.contentDisposition || (isMessageNode ? 'inline' : 'attachment'),\n contentTransferEncoding: 'contentTransferEncoding' in attachment ? attachment.contentTransferEncoding : 'base64'\n };\n\n if (attachment.filename) {\n data.filename = attachment.filename;\n } else if (!isMessageNode && attachment.filename !== false) {\n data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (data.filename.indexOf('.') < 0) {\n data.filename += '.' + mimeFuncs.detectExtension(data.contentType);\n }\n }\n\n if (/^https?:\\/\\//i.test(attachment.path)) {\n attachment.href = attachment.path;\n attachment.path = undefined;\n }\n\n if (attachment.cid) {\n data.cid = attachment.cid;\n }\n\n if (attachment.raw) {\n data.raw = attachment.raw;\n } else if (attachment.path) {\n data.content = {\n path: attachment.path\n };\n } else if (attachment.href) {\n data.content = {\n href: attachment.href,\n httpHeaders: attachment.httpHeaders\n };\n } else {\n data.content = attachment.content || '';\n }\n\n if (attachment.encoding) {\n data.encoding = attachment.encoding;\n }\n\n if (attachment.headers) {\n data.headers = attachment.headers;\n }\n\n return data;\n });\n\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n eventObject.contentType = 'application/ics';\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n eventObject.filename = eventObject.filename || 'invite.ics';\n eventObject.headers['Content-Disposition'] = 'attachment';\n eventObject.headers['Content-Transfer-Encoding'] = 'base64';\n }\n\n if (!findRelated) {\n return {\n attached: attachments.concat(eventObject || []),\n related: []\n };\n } else {\n return {\n attached: attachments.filter(attachment => !attachment.cid).concat(eventObject || []),\n related: attachments.filter(attachment => !!attachment.cid)\n };\n }\n }\n\n /**\n * List alternatives. Resulting objects can be used as input for MimeNode nodes\n *\n * @returns {Array} An array of alternative elements. Includes the `text` and `html` values as well\n */\n getAlternatives() {\n let alternatives = [],\n text,\n html,\n watchHtml,\n amp,\n icalEvent,\n eventObject;\n\n if (this.mail.text) {\n if (typeof this.mail.text === 'object' && (this.mail.text.content || this.mail.text.path || this.mail.text.href || this.mail.text.raw)) {\n text = this.mail.text;\n } else {\n text = {\n content: this.mail.text\n };\n }\n text.contentType = 'text/plain; charset=utf-8';\n }\n\n if (this.mail.watchHtml) {\n if (\n typeof this.mail.watchHtml === 'object' &&\n (this.mail.watchHtml.content || this.mail.watchHtml.path || this.mail.watchHtml.href || this.mail.watchHtml.raw)\n ) {\n watchHtml = this.mail.watchHtml;\n } else {\n watchHtml = {\n content: this.mail.watchHtml\n };\n }\n watchHtml.contentType = 'text/watch-html; charset=utf-8';\n }\n\n if (this.mail.amp) {\n if (typeof this.mail.amp === 'object' && (this.mail.amp.content || this.mail.amp.path || this.mail.amp.href || this.mail.amp.raw)) {\n amp = this.mail.amp;\n } else {\n amp = {\n content: this.mail.amp\n };\n }\n amp.contentType = 'text/x-amp-html; charset=utf-8';\n }\n\n // NB! when including attachments with a calendar alternative you might end up in a blank screen on some clients\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n if (eventObject.content && typeof eventObject.content === 'object') {\n // we are going to have the same attachment twice, so mark this to be\n // resolved just once\n eventObject.content._resolve = true;\n }\n\n eventObject.filename = false;\n eventObject.contentType = 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n }\n\n if (this.mail.html) {\n if (typeof this.mail.html === 'object' && (this.mail.html.content || this.mail.html.path || this.mail.html.href || this.mail.html.raw)) {\n html = this.mail.html;\n } else {\n html = {\n content: this.mail.html\n };\n }\n html.contentType = 'text/html; charset=utf-8';\n }\n\n []\n .concat(text || [])\n .concat(watchHtml || [])\n .concat(amp || [])\n .concat(html || [])\n .concat(eventObject || [])\n .concat(this.mail.alternatives || [])\n .forEach(alternative => {\n let data;\n\n if (/^data:/i.test(alternative.path || alternative.href)) {\n alternative = this._processDataUrl(alternative);\n }\n\n data = {\n contentType: alternative.contentType || mimeFuncs.detectMimeType(alternative.filename || alternative.path || alternative.href || 'txt'),\n contentTransferEncoding: alternative.contentTransferEncoding\n };\n\n if (alternative.filename) {\n data.filename = alternative.filename;\n }\n\n if (/^https?:\\/\\//i.test(alternative.path)) {\n alternative.href = alternative.path;\n alternative.path = undefined;\n }\n\n if (alternative.raw) {\n data.raw = alternative.raw;\n } else if (alternative.path) {\n data.content = {\n path: alternative.path\n };\n } else if (alternative.href) {\n data.content = {\n href: alternative.href\n };\n } else {\n data.content = alternative.content || '';\n }\n\n if (alternative.encoding) {\n data.encoding = alternative.encoding;\n }\n\n if (alternative.headers) {\n data.headers = alternative.headers;\n }\n\n alternatives.push(data);\n });\n\n return alternatives;\n }\n\n /**\n * Builds multipart/mixed node. It should always contain different type of elements on the same level\n * eg. text + attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createMixed(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/mixed', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/mixed', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n if (this._useAlternative) {\n this._createAlternative(node);\n } else if (this._useRelated) {\n this._createRelated(node);\n }\n\n []\n .concat((!this._useAlternative && this._alternatives) || [])\n .concat(this._attachments.attached || [])\n .forEach(element => {\n // if the element is a html node from related subpart then ignore it\n if (!this._useRelated || element !== this._htmlNode) {\n this._createContentNode(node, element);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/alternative node. It should always contain same type of elements on the same level\n * eg. text + html view of the same data\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createAlternative(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/alternative', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/alternative', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._alternatives.forEach(alternative => {\n if (this._useRelated && this._htmlNode === alternative) {\n this._createRelated(node);\n } else {\n this._createContentNode(node, alternative);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/related node. It should always contain html node with related attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createRelated(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/related; type=\"text/html\"', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/related; type=\"text/html\"', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._createContentNode(node, this._htmlNode);\n\n this._attachments.related.forEach(alternative => this._createContentNode(node, alternative));\n\n return node;\n }\n\n /**\n * Creates a regular node with contents\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @param {Object} element Node data\n * @returns {Object} MimeNode node element\n */\n _createContentNode(parentNode, element) {\n element = element || {};\n element.content = element.content || '';\n\n let node;\n let encoding = (element.encoding || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!parentNode) {\n node = new MimeNode(element.contentType, {\n filename: element.filename,\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild(element.contentType, {\n filename: element.filename,\n textEncoding: this.mail.textEncoding,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n // add custom headers\n if (element.headers) {\n node.addHeader(element.headers);\n }\n\n if (element.cid) {\n node.setHeader('Content-Id', '<' + element.cid.replace(/[<>]/g, '') + '>');\n }\n\n if (element.contentTransferEncoding) {\n node.setHeader('Content-Transfer-Encoding', element.contentTransferEncoding);\n } else if (this.mail.encoding && /^text\\//i.test(element.contentType)) {\n node.setHeader('Content-Transfer-Encoding', this.mail.encoding);\n }\n\n if (!/^text\\//i.test(element.contentType) || element.contentDisposition) {\n node.setHeader('Content-Disposition', element.contentDisposition || (element.cid ? 'inline' : 'attachment'));\n }\n\n if (typeof element.content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n element.content = Buffer.from(element.content, encoding);\n }\n\n // prefer pregenerated raw content\n if (element.raw) {\n node.setRaw(element.raw);\n } else {\n node.setContent(element.content);\n }\n\n return node;\n }\n\n /**\n * Parses data uri and converts it to a Buffer\n *\n * @param {Object} element Content element\n * @return {Object} Parsed element\n */\n _processDataUrl(element) {\n let parts = (element.path || element.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);\n if (!parts) {\n return element;\n }\n\n element.content = /\\bbase64$/i.test(parts[1]) ? Buffer.from(parts[2], 'base64') : Buffer.from(decodeURIComponent(parts[2]));\n\n if ('path' in element) {\n element.path = false;\n }\n\n if ('href' in element) {\n element.href = false;\n }\n\n parts[1].split(';').forEach(item => {\n if (/^\\w+\\/[^/]+$/i.test(item)) {\n element.contentType = element.contentType || item.toLowerCase();\n }\n });\n\n return element;\n }\n}\n\nmodule.exports = MailComposer;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst shared = require('../shared');\nconst mimeTypes = require('../mime-funcs/mime-types');\nconst MailComposer = require('../mail-composer');\nconst DKIM = require('../dkim');\nconst httpProxyClient = require('../smtp-connection/http-proxy-client');\nconst util = require('util');\nconst urllib = require('url');\nconst packageData = require('../../package.json');\nconst MailMessage = require('./mail-message');\nconst net = require('net');\nconst dns = require('dns');\nconst crypto = require('crypto');\n\n/**\n * Creates an object for exposing the Mail API\n *\n * @constructor\n * @param {Object} transporter Transport object instance to pass the mails to\n */\nclass Mail extends EventEmitter {\n constructor(transporter, options, defaults) {\n super();\n\n this.options = options || {};\n this._defaults = defaults || {};\n\n this._defaultPlugins = {\n compile: [(...args) => this._convertDataImages(...args)],\n stream: []\n };\n\n this._userPlugins = {\n compile: [],\n stream: []\n };\n\n this.meta = new Map();\n\n this.dkim = this.options.dkim ? new DKIM(this.options.dkim) : false;\n\n this.transporter = transporter;\n this.transporter.mailer = this;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'mail'\n });\n\n this.logger.debug(\n {\n tnx: 'create'\n },\n 'Creating transport: %s',\n this.getVersionString()\n );\n\n // setup emit handlers for the transporter\n if (typeof this.transporter.on === 'function') {\n // deprecated log interface\n this.transporter.on('log', log => {\n this.logger.debug(\n {\n tnx: 'transport'\n },\n '%s: %s',\n log.type,\n log.message\n );\n });\n\n // transporter errors\n this.transporter.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'transport'\n },\n 'Transport Error: %s',\n err.message\n );\n this.emit('error', err);\n });\n\n // indicates if the sender has became idle\n this.transporter.on('idle', (...args) => {\n this.emit('idle', ...args);\n });\n }\n\n /**\n * Optional methods passed to the underlying transport object\n */\n ['close', 'isIdle', 'verify'].forEach(method => {\n this[method] = (...args) => {\n if (typeof this.transporter[method] === 'function') {\n if (method === 'verify' && typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n return this.transporter[method](...args);\n } else {\n this.logger.warn(\n {\n tnx: 'transport',\n methodName: method\n },\n 'Non existing method %s called for transport',\n method\n );\n return false;\n }\n };\n });\n\n // setup proxy handling\n if (this.options.proxy && typeof this.options.proxy === 'string') {\n this.setupProxy(this.options.proxy);\n }\n }\n\n use(step, plugin) {\n step = (step || '').toString();\n if (!this._userPlugins.hasOwnProperty(step)) {\n this._userPlugins[step] = [plugin];\n } else {\n this._userPlugins[step].push(plugin);\n }\n\n return this;\n }\n\n /**\n * Sends an email using the preselected transport object\n *\n * @param {Object} data E-data description\n * @param {Function?} callback Callback to run once the sending succeeded or failed\n */\n sendMail(data, callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n\n let mail = new MailMessage(this, data);\n\n this.logger.debug(\n {\n tnx: 'transport',\n name: this.transporter.name,\n version: this.transporter.version,\n action: 'send'\n },\n 'Sending mail using %s/%s',\n this.transporter.name,\n this.transporter.version\n );\n\n this._processPlugins('compile', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'compile'\n },\n 'PluginCompile Error: %s',\n err.message\n );\n return callback(err);\n }\n\n mail.message = new MailComposer(mail.data).compile();\n\n mail.setMailerHeader();\n mail.setPriorityHeaders();\n mail.setListHeaders();\n\n this._processPlugins('stream', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'stream'\n },\n 'PluginStream Error: %s',\n err.message\n );\n return callback(err);\n }\n\n if (mail.data.dkim || this.dkim) {\n mail.message.processFunc(input => {\n let dkim = mail.data.dkim ? new DKIM(mail.data.dkim) : this.dkim;\n this.logger.debug(\n {\n tnx: 'DKIM',\n messageId: mail.message.messageId(),\n dkimDomains: dkim.keys.map(key => key.keySelector + '.' + key.domainName).join(', ')\n },\n 'Signing outgoing message with %s keys',\n dkim.keys.length\n );\n return dkim.sign(input, mail.data._dkim);\n });\n }\n\n this.transporter.send(mail, (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'transport',\n action: 'send'\n },\n 'Send Error: %s',\n args[0].message\n );\n }\n callback(...args);\n });\n });\n });\n\n return promise;\n }\n\n getVersionString() {\n return util.format('%s (%s; +%s; %s/%s)', packageData.name, packageData.version, packageData.homepage, this.transporter.name, this.transporter.version);\n }\n\n _processPlugins(step, mail, callback) {\n step = (step || '').toString();\n\n if (!this._userPlugins.hasOwnProperty(step)) {\n return callback();\n }\n\n let userPlugins = this._userPlugins[step] || [];\n let defaultPlugins = this._defaultPlugins[step] || [];\n\n if (userPlugins.length) {\n this.logger.debug(\n {\n tnx: 'transaction',\n pluginCount: userPlugins.length,\n step\n },\n 'Using %s plugins for %s',\n userPlugins.length,\n step\n );\n }\n\n if (userPlugins.length + defaultPlugins.length === 0) {\n return callback();\n }\n\n let pos = 0;\n let block = 'default';\n let processPlugins = () => {\n let curplugins = block === 'default' ? defaultPlugins : userPlugins;\n if (pos >= curplugins.length) {\n if (block === 'default' && userPlugins.length) {\n block = 'user';\n pos = 0;\n curplugins = userPlugins;\n } else {\n return callback();\n }\n }\n let plugin = curplugins[pos++];\n plugin(mail, err => {\n if (err) {\n return callback(err);\n }\n processPlugins();\n });\n };\n\n processPlugins();\n }\n\n /**\n * Sets up proxy handler for a Nodemailer object\n *\n * @param {String} proxyUrl Proxy configuration url\n */\n setupProxy(proxyUrl) {\n let proxy = urllib.parse(proxyUrl);\n\n // setup socket handler for the mailer object\n this.getSocket = (options, callback) => {\n let protocol = proxy.protocol.replace(/:$/, '').toLowerCase();\n\n if (this.meta.has('proxy_handler_' + protocol)) {\n return this.meta.get('proxy_handler_' + protocol)(proxy, options, callback);\n }\n\n switch (protocol) {\n // Connect using a HTTP CONNECT method\n case 'http':\n case 'https':\n httpProxyClient(proxy.href, options.port, options.host, (err, socket) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: socket\n });\n });\n return;\n case 'socks':\n case 'socks5':\n case 'socks4':\n case 'socks4a': {\n if (!this.meta.has('proxy_socks_module')) {\n return callback(new Error('Socks module not loaded'));\n }\n let connect = ipaddress => {\n let proxyV2 = !!this.meta.get('proxy_socks_module').SocksClient;\n let socksClient = proxyV2 ? this.meta.get('proxy_socks_module').SocksClient : this.meta.get('proxy_socks_module');\n let proxyType = Number(proxy.protocol.replace(/\\D/g, '')) || 5;\n let connectionOpts = {\n proxy: {\n ipaddress,\n port: Number(proxy.port),\n type: proxyType\n },\n [proxyV2 ? 'destination' : 'target']: {\n host: options.host,\n port: options.port\n },\n command: 'connect'\n };\n\n if (proxy.auth) {\n let username = decodeURIComponent(proxy.auth.split(':').shift());\n let password = decodeURIComponent(proxy.auth.split(':').pop());\n if (proxyV2) {\n connectionOpts.proxy.userId = username;\n connectionOpts.proxy.password = password;\n } else if (proxyType === 4) {\n connectionOpts.userid = username;\n } else {\n connectionOpts.authentication = {\n username,\n password\n };\n }\n }\n\n socksClient.createConnection(connectionOpts, (err, info) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: info.socket || info\n });\n });\n };\n\n if (net.isIP(proxy.hostname)) {\n return connect(proxy.hostname);\n }\n\n return dns.resolve(proxy.hostname, (err, address) => {\n if (err) {\n return callback(err);\n }\n connect(Array.isArray(address) ? address[0] : address);\n });\n }\n }\n callback(new Error('Unknown proxy configuration'));\n };\n }\n\n _convertDataImages(mail, callback) {\n if ((!this.options.attachDataUrls && !mail.data.attachDataUrls) || !mail.data.html) {\n return callback();\n }\n mail.resolveContent(mail.data, 'html', (err, html) => {\n if (err) {\n return callback(err);\n }\n let cidCounter = 0;\n html = (html || '').toString().replace(/(]* src\\s*=[\\s\"']*)(data:([^;]+);[^\"'>\\s]+)/gi, (match, prefix, dataUri, mimeType) => {\n let cid = crypto.randomBytes(10).toString('hex') + '@localhost';\n if (!mail.data.attachments) {\n mail.data.attachments = [];\n }\n if (!Array.isArray(mail.data.attachments)) {\n mail.data.attachments = [].concat(mail.data.attachments || []);\n }\n mail.data.attachments.push({\n path: dataUri,\n cid,\n filename: 'image-' + ++cidCounter + '.' + mimeTypes.detectExtension(mimeType)\n });\n return prefix + 'cid:' + cid;\n });\n mail.data.html = html;\n callback();\n });\n }\n\n set(key, value) {\n return this.meta.set(key, value);\n }\n\n get(key) {\n return this.meta.get(key);\n }\n}\n\nmodule.exports = Mail;\n","'use strict';\n\nconst shared = require('../shared');\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\n\nclass MailMessage {\n constructor(mailer, data) {\n this.mailer = mailer;\n this.data = {};\n this.message = null;\n\n data = data || {};\n let options = mailer.options || {};\n let defaults = mailer._defaults || {};\n\n Object.keys(data).forEach(key => {\n this.data[key] = data[key];\n });\n\n this.data.headers = this.data.headers || {};\n\n // apply defaults\n Object.keys(defaults).forEach(key => {\n if (!(key in this.data)) {\n this.data[key] = defaults[key];\n } else if (key === 'headers') {\n // headers is a special case. Allow setting individual default headers\n Object.keys(defaults.headers).forEach(key => {\n if (!(key in this.data.headers)) {\n this.data.headers[key] = defaults.headers[key];\n }\n });\n }\n });\n\n // force specific keys from transporter options\n ['disableFileAccess', 'disableUrlAccess', 'normalizeHeaderKey'].forEach(key => {\n if (key in options) {\n this.data[key] = options[key];\n }\n });\n }\n\n resolveContent(...args) {\n return shared.resolveContent(...args);\n }\n\n resolveAll(callback) {\n let keys = [\n [this.data, 'html'],\n [this.data, 'text'],\n [this.data, 'watchHtml'],\n [this.data, 'amp'],\n [this.data, 'icalEvent']\n ];\n\n if (this.data.alternatives && this.data.alternatives.length) {\n this.data.alternatives.forEach((alternative, i) => {\n keys.push([this.data.alternatives, i]);\n });\n }\n\n if (this.data.attachments && this.data.attachments.length) {\n this.data.attachments.forEach((attachment, i) => {\n if (!attachment.filename) {\n attachment.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (attachment.filename.indexOf('.') < 0) {\n attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);\n }\n }\n\n if (!attachment.contentType) {\n attachment.contentType = mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');\n }\n\n keys.push([this.data.attachments, i]);\n });\n }\n\n let mimeNode = new MimeNode();\n\n let addressKeys = ['from', 'to', 'cc', 'bcc', 'sender', 'replyTo'];\n\n addressKeys.forEach(address => {\n let value;\n if (this.message) {\n value = [].concat(mimeNode._parseAddresses(this.message.getHeader(address === 'replyTo' ? 'reply-to' : address)) || []);\n } else if (this.data[address]) {\n value = [].concat(mimeNode._parseAddresses(this.data[address]) || []);\n }\n if (value && value.length) {\n this.data[address] = value;\n } else if (address in this.data) {\n this.data[address] = null;\n }\n });\n\n let singleKeys = ['from', 'sender'];\n singleKeys.forEach(address => {\n if (this.data[address]) {\n this.data[address] = this.data[address].shift();\n }\n });\n\n let pos = 0;\n let resolveNext = () => {\n if (pos >= keys.length) {\n return callback(null, this.data);\n }\n let args = keys[pos++];\n if (!args[0] || !args[0][args[1]]) {\n return resolveNext();\n }\n shared.resolveContent(...args, (err, value) => {\n if (err) {\n return callback(err);\n }\n\n let node = {\n content: value\n };\n if (args[0][args[1]] && typeof args[0][args[1]] === 'object' && !Buffer.isBuffer(args[0][args[1]])) {\n Object.keys(args[0][args[1]]).forEach(key => {\n if (!(key in node) && !['content', 'path', 'href', 'raw'].includes(key)) {\n node[key] = args[0][args[1]][key];\n }\n });\n }\n\n args[0][args[1]] = node;\n resolveNext();\n });\n };\n\n setImmediate(() => resolveNext());\n }\n\n normalize(callback) {\n let envelope = this.data.envelope || this.message.getEnvelope();\n let messageId = this.message.messageId();\n\n this.resolveAll((err, data) => {\n if (err) {\n return callback(err);\n }\n\n data.envelope = envelope;\n data.messageId = messageId;\n\n ['html', 'text', 'watchHtml', 'amp'].forEach(key => {\n if (data[key] && data[key].content) {\n if (typeof data[key].content === 'string') {\n data[key] = data[key].content;\n } else if (Buffer.isBuffer(data[key].content)) {\n data[key] = data[key].content.toString();\n }\n }\n });\n\n if (data.icalEvent && Buffer.isBuffer(data.icalEvent.content)) {\n data.icalEvent.content = data.icalEvent.content.toString('base64');\n data.icalEvent.encoding = 'base64';\n }\n\n if (data.alternatives && data.alternatives.length) {\n data.alternatives.forEach(alternative => {\n if (alternative && alternative.content && Buffer.isBuffer(alternative.content)) {\n alternative.content = alternative.content.toString('base64');\n alternative.encoding = 'base64';\n }\n });\n }\n\n if (data.attachments && data.attachments.length) {\n data.attachments.forEach(attachment => {\n if (attachment && attachment.content && Buffer.isBuffer(attachment.content)) {\n attachment.content = attachment.content.toString('base64');\n attachment.encoding = 'base64';\n }\n });\n }\n\n data.normalizedHeaders = {};\n Object.keys(data.headers || {}).forEach(key => {\n let value = [].concat(data.headers[key] || []).shift();\n value = (value && value.value) || value;\n if (value) {\n if (['references', 'in-reply-to', 'message-id', 'content-id'].includes(key)) {\n value = this.message._encodeHeaderValue(key, value);\n }\n data.normalizedHeaders[key] = value;\n }\n });\n\n if (data.list && typeof data.list === 'object') {\n let listHeaders = this._getListHeaders(data.list);\n listHeaders.forEach(entry => {\n data.normalizedHeaders[entry.key] = entry.value.map(val => (val && val.value) || val).join(', ');\n });\n }\n\n if (data.references) {\n data.normalizedHeaders.references = this.message._encodeHeaderValue('references', data.references);\n }\n\n if (data.inReplyTo) {\n data.normalizedHeaders['in-reply-to'] = this.message._encodeHeaderValue('in-reply-to', data.inReplyTo);\n }\n\n return callback(null, data);\n });\n }\n\n setMailerHeader() {\n if (!this.message || !this.data.xMailer) {\n return;\n }\n this.message.setHeader('X-Mailer', this.data.xMailer);\n }\n\n setPriorityHeaders() {\n if (!this.message || !this.data.priority) {\n return;\n }\n switch ((this.data.priority || '').toString().toLowerCase()) {\n case 'high':\n this.message.setHeader('X-Priority', '1 (Highest)');\n this.message.setHeader('X-MSMail-Priority', 'High');\n this.message.setHeader('Importance', 'High');\n break;\n case 'low':\n this.message.setHeader('X-Priority', '5 (Lowest)');\n this.message.setHeader('X-MSMail-Priority', 'Low');\n this.message.setHeader('Importance', 'Low');\n break;\n default:\n // do not add anything, since all messages are 'Normal' by default\n }\n }\n\n setListHeaders() {\n if (!this.message || !this.data.list || typeof this.data.list !== 'object') {\n return;\n }\n // add optional List-* headers\n if (this.data.list && typeof this.data.list === 'object') {\n this._getListHeaders(this.data.list).forEach(listHeader => {\n listHeader.value.forEach(value => {\n this.message.addHeader(listHeader.key, value);\n });\n });\n }\n }\n\n _getListHeaders(listData) {\n // make sure an url looks like \n return Object.keys(listData).map(key => ({\n key: 'list-' + key.toLowerCase().trim(),\n value: [].concat(listData[key] || []).map(value => ({\n prepared: true,\n foldLines: true,\n value: []\n .concat(value || [])\n .map(value => {\n if (typeof value === 'string') {\n value = {\n url: value\n };\n }\n\n if (value && value.url) {\n if (key.toLowerCase().trim() === 'id') {\n // List-ID: \"comment\" \n let comment = value.comment || '';\n if (mimeFuncs.isPlainText(comment)) {\n comment = '\"' + comment + '\"';\n } else {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return (value.comment ? comment + ' ' : '') + this._formatListUrl(value.url).replace(/^<[^:]+\\/{,2}/, '');\n }\n\n // List-*: (comment)\n let comment = value.comment || '';\n if (!mimeFuncs.isPlainText(comment)) {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return this._formatListUrl(value.url) + (value.comment ? ' (' + comment + ')' : '');\n }\n\n return '';\n })\n .filter(value => value)\n .join(', ')\n }))\n }));\n }\n\n _formatListUrl(url) {\n url = url.replace(/[\\s<]+|[\\s>]+/g, '');\n if (/^(https?|mailto|ftp):/.test(url)) {\n return '<' + url + '>';\n }\n if (/^[^@]+@[^@]+$/.test(url)) {\n return '';\n }\n\n return '';\n }\n}\n\nmodule.exports = MailMessage;\n","/* eslint no-control-regex:0 */\n\n'use strict';\n\nconst base64 = require('../base64');\nconst qp = require('../qp');\nconst mimeTypes = require('./mime-types');\n\nmodule.exports = {\n /**\n * Checks if a value is plaintext string (uses only printable 7bit chars)\n *\n * @param {String} value String to be tested\n * @returns {Boolean} true if it is a plaintext string\n */\n isPlainText(value, isParam) {\n const re = isParam ? /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\"\\u0080-\\uFFFF]/ : /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\u0080-\\uFFFF]/;\n if (typeof value !== 'string' || re.test(value)) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a multi line string containes lines longer than the selected value.\n *\n * Useful when detecting if a mail message needs any processing at all –\n * if only plaintext characters are used and lines are short, then there is\n * no need to encode the values in any way. If the value is plaintext but has\n * longer lines then allowed, then use format=flowed\n *\n * @param {Number} lineLength Max line length to check for\n * @returns {Boolean} Returns true if there is at least one line longer than lineLength chars\n */\n hasLongerLines(str, lineLength) {\n if (str.length > 128 * 1024) {\n // do not test strings longer than 128kB\n return true;\n }\n return new RegExp('^.{' + (lineLength + 1) + ',}', 'm').test(str);\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047)\n *\n * @param {String|Buffer} data String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @return {String} Single or several mime words joined together\n */\n encodeWord(data, mimeWordEncoding, maxLength) {\n mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);\n maxLength = maxLength || 0;\n\n let encodedStr;\n let toCharset = 'UTF-8';\n\n if (maxLength && maxLength > 7 + toCharset.length) {\n maxLength -= 7 + toCharset.length;\n }\n\n if (mimeWordEncoding === 'Q') {\n // https://tools.ietf.org/html/rfc2047#section-5 rule (3)\n encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\\-/=]/gi, chr => {\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n if (chr === ' ') {\n return '_';\n } else {\n return '=' + (ord.length === 1 ? '0' + ord : ord);\n }\n });\n } else if (mimeWordEncoding === 'B') {\n encodedStr = typeof data === 'string' ? data : base64.encode(data);\n maxLength = maxLength ? Math.max(3, ((maxLength - (maxLength % 4)) / 4) * 3) : 0;\n }\n\n if (maxLength && (mimeWordEncoding !== 'B' ? encodedStr : base64.encode(data)).length > maxLength) {\n if (mimeWordEncoding === 'Q') {\n encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n // RFC2047 6.3 (2) states that encoded-word must include an integral number of characters, so no chopping unicode sequences\n let parts = [];\n let lpart = '';\n for (let i = 0, len = encodedStr.length; i < len; i++) {\n let chr = encodedStr.charAt(i);\n // check if we can add this character to the existing string\n // without breaking byte length limit\n if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {\n lpart += chr;\n } else {\n // we hit the length limit, so push the existing string and start over\n parts.push(base64.encode(lpart));\n lpart = chr;\n }\n }\n if (lpart) {\n parts.push(base64.encode(lpart));\n }\n\n if (parts.length > 1) {\n encodedStr = parts.join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n encodedStr = parts.join('');\n }\n }\n } else if (mimeWordEncoding === 'B') {\n encodedStr = base64.encode(data);\n }\n\n return '=?' + toCharset + '?' + mimeWordEncoding + '?' + encodedStr + (encodedStr.substr(-2) === '?=' ? '' : '?=');\n },\n\n /**\n * Finds word sequences with non ascii text and converts these to mime words\n *\n * @param {String} value String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match\n * @return {String} String with possible mime words\n */\n encodeWords(value, mimeWordEncoding, maxLength, encodeAll) {\n maxLength = maxLength || 0;\n\n let encodedValue;\n\n // find first word with a non-printable ascii or special symbol in it\n let firstMatch = value.match(/(?:^|\\s)([^\\s]*[\"\\u0080-\\uFFFF])/);\n if (!firstMatch) {\n return value;\n }\n\n if (encodeAll) {\n // if it is requested to encode everything or the string contains something that resebles encoded word, then encode everything\n\n return this.encodeWord(value, mimeWordEncoding, maxLength);\n }\n\n // find the last word with a non-printable ascii in it\n let lastMatch = value.match(/([\"\\u0080-\\uFFFF][^\\s]*)[^\"\\u0080-\\uFFFF]*$/);\n if (!lastMatch) {\n // should not happen\n return value;\n }\n\n let startIndex =\n firstMatch.index +\n (\n firstMatch[0].match(/[^\\s]/) || {\n index: 0\n }\n ).index;\n let endIndex = lastMatch.index + (lastMatch[1] || '').length;\n\n encodedValue =\n (startIndex ? value.substr(0, startIndex) : '') +\n this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || 'Q', maxLength) +\n (endIndex < value.length ? value.substr(endIndex) : '');\n\n return encodedValue;\n },\n\n /**\n * Joins parsed header value together as 'value; param1=value1; param2=value2'\n * PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.\n * Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html\n * @param {Object} structured Parsed header value\n * @return {String} joined header value\n */\n buildHeaderValue(structured) {\n let paramsArray = [];\n\n Object.keys(structured.params || {}).forEach(param => {\n // filename might include unicode characters so it is a special case\n // other values probably do not\n let value = structured.params[param];\n if (!this.isPlainText(value, true) || value.length >= 75) {\n this.buildHeaderParam(param, value, 50).forEach(encodedParam => {\n if (!/[\\s\"\\\\;:/=(),<>@[\\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {\n paramsArray.push(encodedParam.key + '=' + encodedParam.value);\n } else {\n paramsArray.push(encodedParam.key + '=' + JSON.stringify(encodedParam.value));\n }\n });\n } else if (/[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(value)) {\n paramsArray.push(param + '=' + JSON.stringify(value));\n } else {\n paramsArray.push(param + '=' + value);\n }\n });\n\n return structured.value + (paramsArray.length ? '; ' + paramsArray.join('; ') : '');\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)\n * Useful for splitting long parameter values.\n *\n * For example\n * title=\"unicode string\"\n * becomes\n * title*0*=utf-8''unicode\n * title*1*=%20string\n *\n * @param {String|Buffer} data String to be encoded\n * @param {Number} [maxLength=50] Max length for generated chunks\n * @param {String} [fromCharset='UTF-8'] Source sharacter set\n * @return {Array} A list of encoded keys and headers\n */\n buildHeaderParam(key, data, maxLength) {\n let list = [];\n let encodedStr = typeof data === 'string' ? data : (data || '').toString();\n let encodedStrArr;\n let chr, ord;\n let line;\n let startPos = 0;\n let i, len;\n\n maxLength = maxLength || 50;\n\n // process ascii only text\n if (this.isPlainText(data, true)) {\n // check if conversion is even needed\n if (encodedStr.length <= maxLength) {\n return [\n {\n key,\n value: encodedStr\n }\n ];\n }\n\n encodedStr = encodedStr.replace(new RegExp('.{' + maxLength + '}', 'g'), str => {\n list.push({\n line: str\n });\n return '';\n });\n\n if (encodedStr) {\n list.push({\n line: encodedStr\n });\n }\n } else {\n if (/[\\uD800-\\uDBFF]/.test(encodedStr)) {\n // string containts surrogate pairs, so normalize it to an array of bytes\n encodedStrArr = [];\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr.charAt(i);\n ord = chr.charCodeAt(0);\n if (ord >= 0xd800 && ord <= 0xdbff && i < len - 1) {\n chr += encodedStr.charAt(i + 1);\n encodedStrArr.push(chr);\n i++;\n } else {\n encodedStrArr.push(chr);\n }\n }\n encodedStr = encodedStrArr;\n }\n\n // first line includes the charset and language info and needs to be encoded\n // even if it does not contain any unicode characters\n line = 'utf-8\\x27\\x27';\n let encoded = true;\n startPos = 0;\n\n // process text with unicode or special chars\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr[i];\n\n if (encoded) {\n chr = this.safeEncodeURIComponent(chr);\n } else {\n // try to urlencode current char\n chr = chr === ' ' ? chr : this.safeEncodeURIComponent(chr);\n // By default it is not required to encode a line, the need\n // only appears when the string contains unicode or special chars\n // in this case we start processing the line over and encode all chars\n if (chr !== encodedStr[i]) {\n // Check if it is even possible to add the encoded char to the line\n // If not, there is no reason to use this line, just push it to the list\n // and start a new line with the char that needs encoding\n if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = '';\n startPos = i - 1;\n } else {\n encoded = true;\n i = startPos;\n line = '';\n continue;\n }\n }\n }\n\n // if the line is already too long, push it to the list and start a new one\n if ((line + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = chr = encodedStr[i] === ' ' ? ' ' : this.safeEncodeURIComponent(encodedStr[i]);\n if (chr === encodedStr[i]) {\n encoded = false;\n startPos = i - 1;\n } else {\n encoded = true;\n }\n } else {\n line += chr;\n }\n }\n\n if (line) {\n list.push({\n line,\n encoded\n });\n }\n }\n\n return list.map((item, i) => ({\n // encoded lines: {name}*{part}*\n // unencoded lines: {name}*{part}\n // if any line needs to be encoded then the first line (part==0) is always encoded\n key: key + '*' + i + (item.encoded ? '*' : ''),\n value: item.line\n }));\n },\n\n /**\n * Parses a header value with key=value arguments into a structured\n * object.\n *\n * parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') ->\n * {\n * 'value': 'text/plain',\n * 'params': {\n * 'charset': 'UTF-8'\n * }\n * }\n *\n * @param {String} str Header value\n * @return {Object} Header value as a parsed structure\n */\n parseHeaderValue(str) {\n let response = {\n value: false,\n params: {}\n };\n let key = false;\n let value = '';\n let type = 'value';\n let quote = false;\n let escaped = false;\n let chr;\n\n for (let i = 0, len = str.length; i < len; i++) {\n chr = str.charAt(i);\n if (type === 'key') {\n if (chr === '=') {\n key = value.trim().toLowerCase();\n type = 'value';\n value = '';\n continue;\n }\n value += chr;\n } else {\n if (escaped) {\n value += chr;\n } else if (chr === '\\\\') {\n escaped = true;\n continue;\n } else if (quote && chr === quote) {\n quote = false;\n } else if (!quote && chr === '\"') {\n quote = chr;\n } else if (!quote && chr === ';') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n type = 'key';\n value = '';\n } else {\n value += chr;\n }\n escaped = false;\n }\n }\n\n if (type === 'value') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n } else if (value.trim()) {\n response.params[value.trim().toLowerCase()] = '';\n }\n\n // handle parameter value continuations\n // https://tools.ietf.org/html/rfc2231#section-3\n\n // preprocess values\n Object.keys(response.params).forEach(key => {\n let actualKey, nr, match, value;\n if ((match = key.match(/(\\*(\\d+)|\\*(\\d+)\\*|\\*)$/))) {\n actualKey = key.substr(0, match.index);\n nr = Number(match[2] || match[3]) || 0;\n\n if (!response.params[actualKey] || typeof response.params[actualKey] !== 'object') {\n response.params[actualKey] = {\n charset: false,\n values: []\n };\n }\n\n value = response.params[key];\n\n if (nr === 0 && match[0].substr(-1) === '*' && (match = value.match(/^([^']*)'[^']*'(.*)$/))) {\n response.params[actualKey].charset = match[1] || 'iso-8859-1';\n value = match[2];\n }\n\n response.params[actualKey].values[nr] = value;\n\n // remove the old reference\n delete response.params[key];\n }\n });\n\n // concatenate split rfc2231 strings and convert encoded strings to mime encoded words\n Object.keys(response.params).forEach(key => {\n let value;\n if (response.params[key] && Array.isArray(response.params[key].values)) {\n value = response.params[key].values.map(val => val || '').join('');\n\n if (response.params[key].charset) {\n // convert \"%AB\" to \"=?charset?Q?=AB?=\"\n response.params[key] =\n '=?' +\n response.params[key].charset +\n '?Q?' +\n value\n // fix invalidly encoded chars\n .replace(/[=?_\\s]/g, s => {\n let c = s.charCodeAt(0).toString(16);\n if (s === ' ') {\n return '_';\n } else {\n return '%' + (c.length < 2 ? '0' : '') + c;\n }\n })\n // change from urlencoding to percent encoding\n .replace(/%/g, '=') +\n '?=';\n } else {\n response.params[key] = value;\n }\n }\n });\n\n return response;\n },\n\n /**\n * Returns file extension for a content type string. If no suitable extensions\n * are found, 'bin' is used as the default extension\n *\n * @param {String} mimeType Content type to be checked for\n * @return {String} File extension\n */\n detectExtension: mimeType => mimeTypes.detectExtension(mimeType),\n\n /**\n * Returns content type for a file extension. If no suitable content types\n * are found, 'application/octet-stream' is used as the default content type\n *\n * @param {String} extension Extension to be checked for\n * @return {String} File extension\n */\n detectMimeType: extension => mimeTypes.detectMimeType(extension),\n\n /**\n * Folds long lines, useful for folding header lines (afterSpace=false) and\n * flowed text (afterSpace=true)\n *\n * @param {String} str String to be folded\n * @param {Number} [lineLength=76] Maximum length of a line\n * @param {Boolean} afterSpace If true, leave a space in th end of a line\n * @return {String} String with folded lines\n */\n foldLines(str, lineLength, afterSpace) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n let pos = 0,\n len = str.length,\n result = '',\n line,\n match;\n\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if (line.length < lineLength) {\n result += line;\n break;\n }\n if ((match = line.match(/^[^\\n\\r]*(\\r?\\n|\\r)/))) {\n line = match[0];\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.match(/(\\s+)[^\\s]*$/)) && match[0].length - (afterSpace ? (match[1] || '').length : 0) < line.length) {\n line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || '').length : 0)));\n } else if ((match = str.substr(pos + line.length).match(/^[^\\s]+(\\s*)/))) {\n line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || '').length : 0));\n }\n\n result += line;\n pos += line.length;\n if (pos < len) {\n result += '\\r\\n';\n }\n }\n\n return result;\n },\n\n /**\n * Splits a mime encoded string. Needed for dividing mime words into smaller chunks\n *\n * @param {String} str Mime encoded string to be split up\n * @param {Number} maxlen Maximum length of characters for one part (minimum 12)\n * @return {Array} Split string\n */\n splitMimeEncodedString: (str, maxlen) => {\n let curLine,\n match,\n chr,\n done,\n lines = [];\n\n // require at least 12 symbols to fit possible 4 octet UTF-8 sequences\n maxlen = Math.max(maxlen || 0, 12);\n\n while (str.length) {\n curLine = str.substr(0, maxlen);\n\n // move incomplete escaped char back to main\n if ((match = curLine.match(/[=][0-9A-F]?$/i))) {\n curLine = curLine.substr(0, match.index);\n }\n\n done = false;\n while (!done) {\n done = true;\n // check if not middle of a unicode char sequence\n if ((match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i))) {\n chr = parseInt(match[1], 16);\n // invalid sequence, move one char back anc recheck\n if (chr < 0xc2 && chr > 0x7f) {\n curLine = curLine.substr(0, curLine.length - 3);\n done = false;\n }\n }\n }\n\n if (curLine.length) {\n lines.push(curLine);\n }\n str = str.substr(curLine.length);\n }\n\n return lines;\n },\n\n encodeURICharComponent: chr => {\n let res = '';\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n\n if (ord.length % 2) {\n ord = '0' + ord;\n }\n\n if (ord.length > 2) {\n for (let i = 0, len = ord.length / 2; i < len; i++) {\n res += '%' + ord.substr(i, 2);\n }\n } else {\n res += '%' + ord;\n }\n\n return res;\n },\n\n safeEncodeURIComponent(str) {\n str = (str || '').toString();\n\n try {\n // might throw if we try to encode invalid sequences, eg. partial emoji\n str = encodeURIComponent(str);\n } catch (E) {\n // should never run\n return str.replace(/[^\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]+/g, '');\n }\n\n // ensure chars that are not handled by encodeURICompent are converted as well\n return str.replace(/[\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]/g, chr => this.encodeURICharComponent(chr));\n }\n};\n","/* eslint quote-props: 0 */\n\n'use strict';\n\nconst path = require('path');\n\nconst defaultMimeType = 'application/octet-stream';\nconst defaultExtension = 'bin';\n\nconst mimeTypes = new Map([\n ['application/acad', 'dwg'],\n ['application/applixware', 'aw'],\n ['application/arj', 'arj'],\n ['application/atom+xml', 'xml'],\n ['application/atomcat+xml', 'atomcat'],\n ['application/atomsvc+xml', 'atomsvc'],\n ['application/base64', ['mm', 'mme']],\n ['application/binhex', 'hqx'],\n ['application/binhex4', 'hqx'],\n ['application/book', ['book', 'boo']],\n ['application/ccxml+xml,', 'ccxml'],\n ['application/cdf', 'cdf'],\n ['application/cdmi-capability', 'cdmia'],\n ['application/cdmi-container', 'cdmic'],\n ['application/cdmi-domain', 'cdmid'],\n ['application/cdmi-object', 'cdmio'],\n ['application/cdmi-queue', 'cdmiq'],\n ['application/clariscad', 'ccad'],\n ['application/commonground', 'dp'],\n ['application/cu-seeme', 'cu'],\n ['application/davmount+xml', 'davmount'],\n ['application/drafting', 'drw'],\n ['application/dsptype', 'tsp'],\n ['application/dssc+der', 'dssc'],\n ['application/dssc+xml', 'xdssc'],\n ['application/dxf', 'dxf'],\n ['application/ecmascript', ['js', 'es']],\n ['application/emma+xml', 'emma'],\n ['application/envoy', 'evy'],\n ['application/epub+zip', 'epub'],\n ['application/excel', ['xls', 'xl', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/exi', 'exi'],\n ['application/font-tdpfr', 'pfr'],\n ['application/fractals', 'fif'],\n ['application/freeloader', 'frl'],\n ['application/futuresplash', 'spl'],\n ['application/gnutar', 'tgz'],\n ['application/groupwise', 'vew'],\n ['application/hlp', 'hlp'],\n ['application/hta', 'hta'],\n ['application/hyperstudio', 'stk'],\n ['application/i-deas', 'unv'],\n ['application/iges', ['iges', 'igs']],\n ['application/inf', 'inf'],\n ['application/internet-property-stream', 'acx'],\n ['application/ipfix', 'ipfix'],\n ['application/java', 'class'],\n ['application/java-archive', 'jar'],\n ['application/java-byte-code', 'class'],\n ['application/java-serialized-object', 'ser'],\n ['application/java-vm', 'class'],\n ['application/javascript', 'js'],\n ['application/json', 'json'],\n ['application/lha', 'lha'],\n ['application/lzx', 'lzx'],\n ['application/mac-binary', 'bin'],\n ['application/mac-binhex', 'hqx'],\n ['application/mac-binhex40', 'hqx'],\n ['application/mac-compactpro', 'cpt'],\n ['application/macbinary', 'bin'],\n ['application/mads+xml', 'mads'],\n ['application/marc', 'mrc'],\n ['application/marcxml+xml', 'mrcx'],\n ['application/mathematica', 'ma'],\n ['application/mathml+xml', 'mathml'],\n ['application/mbedlet', 'mbd'],\n ['application/mbox', 'mbox'],\n ['application/mcad', 'mcd'],\n ['application/mediaservercontrol+xml', 'mscml'],\n ['application/metalink4+xml', 'meta4'],\n ['application/mets+xml', 'mets'],\n ['application/mime', 'aps'],\n ['application/mods+xml', 'mods'],\n ['application/mp21', 'm21'],\n ['application/mp4', 'mp4'],\n ['application/mspowerpoint', ['ppt', 'pot', 'pps', 'ppz']],\n ['application/msword', ['doc', 'dot', 'w6w', 'wiz', 'word']],\n ['application/mswrite', 'wri'],\n ['application/mxf', 'mxf'],\n ['application/netmc', 'mcp'],\n ['application/octet-stream', ['*']],\n ['application/oda', 'oda'],\n ['application/oebps-package+xml', 'opf'],\n ['application/ogg', 'ogx'],\n ['application/olescript', 'axs'],\n ['application/onenote', 'onetoc'],\n ['application/patch-ops-error+xml', 'xer'],\n ['application/pdf', 'pdf'],\n ['application/pgp-encrypted', 'asc'],\n ['application/pgp-signature', 'pgp'],\n ['application/pics-rules', 'prf'],\n ['application/pkcs-12', 'p12'],\n ['application/pkcs-crl', 'crl'],\n ['application/pkcs10', 'p10'],\n ['application/pkcs7-mime', ['p7c', 'p7m']],\n ['application/pkcs7-signature', 'p7s'],\n ['application/pkcs8', 'p8'],\n ['application/pkix-attr-cert', 'ac'],\n ['application/pkix-cert', ['cer', 'crt']],\n ['application/pkix-crl', 'crl'],\n ['application/pkix-pkipath', 'pkipath'],\n ['application/pkixcmp', 'pki'],\n ['application/plain', 'text'],\n ['application/pls+xml', 'pls'],\n ['application/postscript', ['ps', 'ai', 'eps']],\n ['application/powerpoint', 'ppt'],\n ['application/pro_eng', ['part', 'prt']],\n ['application/prs.cww', 'cww'],\n ['application/pskc+xml', 'pskcxml'],\n ['application/rdf+xml', 'rdf'],\n ['application/reginfo+xml', 'rif'],\n ['application/relax-ng-compact-syntax', 'rnc'],\n ['application/resource-lists+xml', 'rl'],\n ['application/resource-lists-diff+xml', 'rld'],\n ['application/ringing-tones', 'rng'],\n ['application/rls-services+xml', 'rs'],\n ['application/rsd+xml', 'rsd'],\n ['application/rss+xml', 'xml'],\n ['application/rtf', ['rtf', 'rtx']],\n ['application/sbml+xml', 'sbml'],\n ['application/scvp-cv-request', 'scq'],\n ['application/scvp-cv-response', 'scs'],\n ['application/scvp-vp-request', 'spq'],\n ['application/scvp-vp-response', 'spp'],\n ['application/sdp', 'sdp'],\n ['application/sea', 'sea'],\n ['application/set', 'set'],\n ['application/set-payment-initiation', 'setpay'],\n ['application/set-registration-initiation', 'setreg'],\n ['application/shf+xml', 'shf'],\n ['application/sla', 'stl'],\n ['application/smil', ['smi', 'smil']],\n ['application/smil+xml', 'smi'],\n ['application/solids', 'sol'],\n ['application/sounder', 'sdr'],\n ['application/sparql-query', 'rq'],\n ['application/sparql-results+xml', 'srx'],\n ['application/srgs', 'gram'],\n ['application/srgs+xml', 'grxml'],\n ['application/sru+xml', 'sru'],\n ['application/ssml+xml', 'ssml'],\n ['application/step', ['step', 'stp']],\n ['application/streamingmedia', 'ssm'],\n ['application/tei+xml', 'tei'],\n ['application/thraud+xml', 'tfi'],\n ['application/timestamped-data', 'tsd'],\n ['application/toolbook', 'tbk'],\n ['application/vda', 'vda'],\n ['application/vnd.3gpp.pic-bw-large', 'plb'],\n ['application/vnd.3gpp.pic-bw-small', 'psb'],\n ['application/vnd.3gpp.pic-bw-var', 'pvb'],\n ['application/vnd.3gpp2.tcap', 'tcap'],\n ['application/vnd.3m.post-it-notes', 'pwn'],\n ['application/vnd.accpac.simply.aso', 'aso'],\n ['application/vnd.accpac.simply.imp', 'imp'],\n ['application/vnd.acucobol', 'acu'],\n ['application/vnd.acucorp', 'atc'],\n ['application/vnd.adobe.air-application-installer-package+zip', 'air'],\n ['application/vnd.adobe.fxp', 'fxp'],\n ['application/vnd.adobe.xdp+xml', 'xdp'],\n ['application/vnd.adobe.xfdf', 'xfdf'],\n ['application/vnd.ahead.space', 'ahead'],\n ['application/vnd.airzip.filesecure.azf', 'azf'],\n ['application/vnd.airzip.filesecure.azs', 'azs'],\n ['application/vnd.amazon.ebook', 'azw'],\n ['application/vnd.americandynamics.acc', 'acc'],\n ['application/vnd.amiga.ami', 'ami'],\n ['application/vnd.android.package-archive', 'apk'],\n ['application/vnd.anser-web-certificate-issue-initiation', 'cii'],\n ['application/vnd.anser-web-funds-transfer-initiation', 'fti'],\n ['application/vnd.antix.game-component', 'atx'],\n ['application/vnd.apple.installer+xml', 'mpkg'],\n ['application/vnd.apple.mpegurl', 'm3u8'],\n ['application/vnd.aristanetworks.swi', 'swi'],\n ['application/vnd.audiograph', 'aep'],\n ['application/vnd.blueice.multipass', 'mpm'],\n ['application/vnd.bmi', 'bmi'],\n ['application/vnd.businessobjects', 'rep'],\n ['application/vnd.chemdraw+xml', 'cdxml'],\n ['application/vnd.chipnuts.karaoke-mmd', 'mmd'],\n ['application/vnd.cinderella', 'cdy'],\n ['application/vnd.claymore', 'cla'],\n ['application/vnd.cloanto.rp9', 'rp9'],\n ['application/vnd.clonk.c4group', 'c4g'],\n ['application/vnd.cluetrust.cartomobile-config', 'c11amc'],\n ['application/vnd.cluetrust.cartomobile-config-pkg', 'c11amz'],\n ['application/vnd.commonspace', 'csp'],\n ['application/vnd.contact.cmsg', 'cdbcmsg'],\n ['application/vnd.cosmocaller', 'cmc'],\n ['application/vnd.crick.clicker', 'clkx'],\n ['application/vnd.crick.clicker.keyboard', 'clkk'],\n ['application/vnd.crick.clicker.palette', 'clkp'],\n ['application/vnd.crick.clicker.template', 'clkt'],\n ['application/vnd.crick.clicker.wordbank', 'clkw'],\n ['application/vnd.criticaltools.wbs+xml', 'wbs'],\n ['application/vnd.ctc-posml', 'pml'],\n ['application/vnd.cups-ppd', 'ppd'],\n ['application/vnd.curl.car', 'car'],\n ['application/vnd.curl.pcurl', 'pcurl'],\n ['application/vnd.data-vision.rdz', 'rdz'],\n ['application/vnd.denovo.fcselayout-link', 'fe_launch'],\n ['application/vnd.dna', 'dna'],\n ['application/vnd.dolby.mlp', 'mlp'],\n ['application/vnd.dpgraph', 'dpg'],\n ['application/vnd.dreamfactory', 'dfac'],\n ['application/vnd.dvb.ait', 'ait'],\n ['application/vnd.dvb.service', 'svc'],\n ['application/vnd.dynageo', 'geo'],\n ['application/vnd.ecowin.chart', 'mag'],\n ['application/vnd.enliven', 'nml'],\n ['application/vnd.epson.esf', 'esf'],\n ['application/vnd.epson.msf', 'msf'],\n ['application/vnd.epson.quickanime', 'qam'],\n ['application/vnd.epson.salt', 'slt'],\n ['application/vnd.epson.ssf', 'ssf'],\n ['application/vnd.eszigno3+xml', 'es3'],\n ['application/vnd.ezpix-album', 'ez2'],\n ['application/vnd.ezpix-package', 'ez3'],\n ['application/vnd.fdf', 'fdf'],\n ['application/vnd.fdsn.seed', 'seed'],\n ['application/vnd.flographit', 'gph'],\n ['application/vnd.fluxtime.clip', 'ftc'],\n ['application/vnd.framemaker', 'fm'],\n ['application/vnd.frogans.fnc', 'fnc'],\n ['application/vnd.frogans.ltf', 'ltf'],\n ['application/vnd.fsc.weblaunch', 'fsc'],\n ['application/vnd.fujitsu.oasys', 'oas'],\n ['application/vnd.fujitsu.oasys2', 'oa2'],\n ['application/vnd.fujitsu.oasys3', 'oa3'],\n ['application/vnd.fujitsu.oasysgp', 'fg5'],\n ['application/vnd.fujitsu.oasysprs', 'bh2'],\n ['application/vnd.fujixerox.ddd', 'ddd'],\n ['application/vnd.fujixerox.docuworks', 'xdw'],\n ['application/vnd.fujixerox.docuworks.binder', 'xbd'],\n ['application/vnd.fuzzysheet', 'fzs'],\n ['application/vnd.genomatix.tuxedo', 'txd'],\n ['application/vnd.geogebra.file', 'ggb'],\n ['application/vnd.geogebra.tool', 'ggt'],\n ['application/vnd.geometry-explorer', 'gex'],\n ['application/vnd.geonext', 'gxt'],\n ['application/vnd.geoplan', 'g2w'],\n ['application/vnd.geospace', 'g3w'],\n ['application/vnd.gmx', 'gmx'],\n ['application/vnd.google-earth.kml+xml', 'kml'],\n ['application/vnd.google-earth.kmz', 'kmz'],\n ['application/vnd.grafeq', 'gqf'],\n ['application/vnd.groove-account', 'gac'],\n ['application/vnd.groove-help', 'ghf'],\n ['application/vnd.groove-identity-message', 'gim'],\n ['application/vnd.groove-injector', 'grv'],\n ['application/vnd.groove-tool-message', 'gtm'],\n ['application/vnd.groove-tool-template', 'tpl'],\n ['application/vnd.groove-vcard', 'vcg'],\n ['application/vnd.hal+xml', 'hal'],\n ['application/vnd.handheld-entertainment+xml', 'zmm'],\n ['application/vnd.hbci', 'hbci'],\n ['application/vnd.hhe.lesson-player', 'les'],\n ['application/vnd.hp-hpgl', ['hgl', 'hpg', 'hpgl']],\n ['application/vnd.hp-hpid', 'hpid'],\n ['application/vnd.hp-hps', 'hps'],\n ['application/vnd.hp-jlyt', 'jlt'],\n ['application/vnd.hp-pcl', 'pcl'],\n ['application/vnd.hp-pclxl', 'pclxl'],\n ['application/vnd.hydrostatix.sof-data', 'sfd-hdstx'],\n ['application/vnd.hzn-3d-crossword', 'x3d'],\n ['application/vnd.ibm.minipay', 'mpy'],\n ['application/vnd.ibm.modcap', 'afp'],\n ['application/vnd.ibm.rights-management', 'irm'],\n ['application/vnd.ibm.secure-container', 'sc'],\n ['application/vnd.iccprofile', 'icc'],\n ['application/vnd.igloader', 'igl'],\n ['application/vnd.immervision-ivp', 'ivp'],\n ['application/vnd.immervision-ivu', 'ivu'],\n ['application/vnd.insors.igm', 'igm'],\n ['application/vnd.intercon.formnet', 'xpw'],\n ['application/vnd.intergeo', 'i2g'],\n ['application/vnd.intu.qbo', 'qbo'],\n ['application/vnd.intu.qfx', 'qfx'],\n ['application/vnd.ipunplugged.rcprofile', 'rcprofile'],\n ['application/vnd.irepository.package+xml', 'irp'],\n ['application/vnd.is-xpr', 'xpr'],\n ['application/vnd.isac.fcs', 'fcs'],\n ['application/vnd.jam', 'jam'],\n ['application/vnd.jcp.javame.midlet-rms', 'rms'],\n ['application/vnd.jisp', 'jisp'],\n ['application/vnd.joost.joda-archive', 'joda'],\n ['application/vnd.kahootz', 'ktz'],\n ['application/vnd.kde.karbon', 'karbon'],\n ['application/vnd.kde.kchart', 'chrt'],\n ['application/vnd.kde.kformula', 'kfo'],\n ['application/vnd.kde.kivio', 'flw'],\n ['application/vnd.kde.kontour', 'kon'],\n ['application/vnd.kde.kpresenter', 'kpr'],\n ['application/vnd.kde.kspread', 'ksp'],\n ['application/vnd.kde.kword', 'kwd'],\n ['application/vnd.kenameaapp', 'htke'],\n ['application/vnd.kidspiration', 'kia'],\n ['application/vnd.kinar', 'kne'],\n ['application/vnd.koan', 'skp'],\n ['application/vnd.kodak-descriptor', 'sse'],\n ['application/vnd.las.las+xml', 'lasxml'],\n ['application/vnd.llamagraphics.life-balance.desktop', 'lbd'],\n ['application/vnd.llamagraphics.life-balance.exchange+xml', 'lbe'],\n ['application/vnd.lotus-1-2-3', '123'],\n ['application/vnd.lotus-approach', 'apr'],\n ['application/vnd.lotus-freelance', 'pre'],\n ['application/vnd.lotus-notes', 'nsf'],\n ['application/vnd.lotus-organizer', 'org'],\n ['application/vnd.lotus-screencam', 'scm'],\n ['application/vnd.lotus-wordpro', 'lwp'],\n ['application/vnd.macports.portpkg', 'portpkg'],\n ['application/vnd.mcd', 'mcd'],\n ['application/vnd.medcalcdata', 'mc1'],\n ['application/vnd.mediastation.cdkey', 'cdkey'],\n ['application/vnd.mfer', 'mwf'],\n ['application/vnd.mfmp', 'mfm'],\n ['application/vnd.micrografx.flo', 'flo'],\n ['application/vnd.micrografx.igx', 'igx'],\n ['application/vnd.mif', 'mif'],\n ['application/vnd.mobius.daf', 'daf'],\n ['application/vnd.mobius.dis', 'dis'],\n ['application/vnd.mobius.mbk', 'mbk'],\n ['application/vnd.mobius.mqy', 'mqy'],\n ['application/vnd.mobius.msl', 'msl'],\n ['application/vnd.mobius.plc', 'plc'],\n ['application/vnd.mobius.txf', 'txf'],\n ['application/vnd.mophun.application', 'mpn'],\n ['application/vnd.mophun.certificate', 'mpc'],\n ['application/vnd.mozilla.xul+xml', 'xul'],\n ['application/vnd.ms-artgalry', 'cil'],\n ['application/vnd.ms-cab-compressed', 'cab'],\n ['application/vnd.ms-excel', ['xls', 'xla', 'xlc', 'xlm', 'xlt', 'xlw', 'xlb', 'xll']],\n ['application/vnd.ms-excel.addin.macroenabled.12', 'xlam'],\n ['application/vnd.ms-excel.sheet.binary.macroenabled.12', 'xlsb'],\n ['application/vnd.ms-excel.sheet.macroenabled.12', 'xlsm'],\n ['application/vnd.ms-excel.template.macroenabled.12', 'xltm'],\n ['application/vnd.ms-fontobject', 'eot'],\n ['application/vnd.ms-htmlhelp', 'chm'],\n ['application/vnd.ms-ims', 'ims'],\n ['application/vnd.ms-lrm', 'lrm'],\n ['application/vnd.ms-officetheme', 'thmx'],\n ['application/vnd.ms-outlook', 'msg'],\n ['application/vnd.ms-pki.certstore', 'sst'],\n ['application/vnd.ms-pki.pko', 'pko'],\n ['application/vnd.ms-pki.seccat', 'cat'],\n ['application/vnd.ms-pki.stl', 'stl'],\n ['application/vnd.ms-pkicertstore', 'sst'],\n ['application/vnd.ms-pkiseccat', 'cat'],\n ['application/vnd.ms-pkistl', 'stl'],\n ['application/vnd.ms-powerpoint', ['ppt', 'pot', 'pps', 'ppa', 'pwz']],\n ['application/vnd.ms-powerpoint.addin.macroenabled.12', 'ppam'],\n ['application/vnd.ms-powerpoint.presentation.macroenabled.12', 'pptm'],\n ['application/vnd.ms-powerpoint.slide.macroenabled.12', 'sldm'],\n ['application/vnd.ms-powerpoint.slideshow.macroenabled.12', 'ppsm'],\n ['application/vnd.ms-powerpoint.template.macroenabled.12', 'potm'],\n ['application/vnd.ms-project', 'mpp'],\n ['application/vnd.ms-word.document.macroenabled.12', 'docm'],\n ['application/vnd.ms-word.template.macroenabled.12', 'dotm'],\n ['application/vnd.ms-works', ['wks', 'wcm', 'wdb', 'wps']],\n ['application/vnd.ms-wpl', 'wpl'],\n ['application/vnd.ms-xpsdocument', 'xps'],\n ['application/vnd.mseq', 'mseq'],\n ['application/vnd.musician', 'mus'],\n ['application/vnd.muvee.style', 'msty'],\n ['application/vnd.neurolanguage.nlu', 'nlu'],\n ['application/vnd.noblenet-directory', 'nnd'],\n ['application/vnd.noblenet-sealer', 'nns'],\n ['application/vnd.noblenet-web', 'nnw'],\n ['application/vnd.nokia.configuration-message', 'ncm'],\n ['application/vnd.nokia.n-gage.data', 'ngdat'],\n ['application/vnd.nokia.n-gage.symbian.install', 'n-gage'],\n ['application/vnd.nokia.radio-preset', 'rpst'],\n ['application/vnd.nokia.radio-presets', 'rpss'],\n ['application/vnd.nokia.ringing-tone', 'rng'],\n ['application/vnd.novadigm.edm', 'edm'],\n ['application/vnd.novadigm.edx', 'edx'],\n ['application/vnd.novadigm.ext', 'ext'],\n ['application/vnd.oasis.opendocument.chart', 'odc'],\n ['application/vnd.oasis.opendocument.chart-template', 'otc'],\n ['application/vnd.oasis.opendocument.database', 'odb'],\n ['application/vnd.oasis.opendocument.formula', 'odf'],\n ['application/vnd.oasis.opendocument.formula-template', 'odft'],\n ['application/vnd.oasis.opendocument.graphics', 'odg'],\n ['application/vnd.oasis.opendocument.graphics-template', 'otg'],\n ['application/vnd.oasis.opendocument.image', 'odi'],\n ['application/vnd.oasis.opendocument.image-template', 'oti'],\n ['application/vnd.oasis.opendocument.presentation', 'odp'],\n ['application/vnd.oasis.opendocument.presentation-template', 'otp'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'ods'],\n ['application/vnd.oasis.opendocument.spreadsheet-template', 'ots'],\n ['application/vnd.oasis.opendocument.text', 'odt'],\n ['application/vnd.oasis.opendocument.text-master', 'odm'],\n ['application/vnd.oasis.opendocument.text-template', 'ott'],\n ['application/vnd.oasis.opendocument.text-web', 'oth'],\n ['application/vnd.olpc-sugar', 'xo'],\n ['application/vnd.oma.dd2+xml', 'dd2'],\n ['application/vnd.openofficeorg.extension', 'oxt'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slide', 'sldx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.template', 'potx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotx'],\n ['application/vnd.osgeo.mapguide.package', 'mgp'],\n ['application/vnd.osgi.dp', 'dp'],\n ['application/vnd.palm', 'pdb'],\n ['application/vnd.pawaafile', 'paw'],\n ['application/vnd.pg.format', 'str'],\n ['application/vnd.pg.osasli', 'ei6'],\n ['application/vnd.picsel', 'efif'],\n ['application/vnd.pmi.widget', 'wg'],\n ['application/vnd.pocketlearn', 'plf'],\n ['application/vnd.powerbuilder6', 'pbd'],\n ['application/vnd.previewsystems.box', 'box'],\n ['application/vnd.proteus.magazine', 'mgz'],\n ['application/vnd.publishare-delta-tree', 'qps'],\n ['application/vnd.pvi.ptid1', 'ptid'],\n ['application/vnd.quark.quarkxpress', 'qxd'],\n ['application/vnd.realvnc.bed', 'bed'],\n ['application/vnd.recordare.musicxml', 'mxl'],\n ['application/vnd.recordare.musicxml+xml', 'musicxml'],\n ['application/vnd.rig.cryptonote', 'cryptonote'],\n ['application/vnd.rim.cod', 'cod'],\n ['application/vnd.rn-realmedia', 'rm'],\n ['application/vnd.rn-realplayer', 'rnx'],\n ['application/vnd.route66.link66+xml', 'link66'],\n ['application/vnd.sailingtracker.track', 'st'],\n ['application/vnd.seemail', 'see'],\n ['application/vnd.sema', 'sema'],\n ['application/vnd.semd', 'semd'],\n ['application/vnd.semf', 'semf'],\n ['application/vnd.shana.informed.formdata', 'ifm'],\n ['application/vnd.shana.informed.formtemplate', 'itp'],\n ['application/vnd.shana.informed.interchange', 'iif'],\n ['application/vnd.shana.informed.package', 'ipk'],\n ['application/vnd.simtech-mindmapper', 'twd'],\n ['application/vnd.smaf', 'mmf'],\n ['application/vnd.smart.teacher', 'teacher'],\n ['application/vnd.solent.sdkm+xml', 'sdkm'],\n ['application/vnd.spotfire.dxp', 'dxp'],\n ['application/vnd.spotfire.sfs', 'sfs'],\n ['application/vnd.stardivision.calc', 'sdc'],\n ['application/vnd.stardivision.draw', 'sda'],\n ['application/vnd.stardivision.impress', 'sdd'],\n ['application/vnd.stardivision.math', 'smf'],\n ['application/vnd.stardivision.writer', 'sdw'],\n ['application/vnd.stardivision.writer-global', 'sgl'],\n ['application/vnd.stepmania.stepchart', 'sm'],\n ['application/vnd.sun.xml.calc', 'sxc'],\n ['application/vnd.sun.xml.calc.template', 'stc'],\n ['application/vnd.sun.xml.draw', 'sxd'],\n ['application/vnd.sun.xml.draw.template', 'std'],\n ['application/vnd.sun.xml.impress', 'sxi'],\n ['application/vnd.sun.xml.impress.template', 'sti'],\n ['application/vnd.sun.xml.math', 'sxm'],\n ['application/vnd.sun.xml.writer', 'sxw'],\n ['application/vnd.sun.xml.writer.global', 'sxg'],\n ['application/vnd.sun.xml.writer.template', 'stw'],\n ['application/vnd.sus-calendar', 'sus'],\n ['application/vnd.svd', 'svd'],\n ['application/vnd.symbian.install', 'sis'],\n ['application/vnd.syncml+xml', 'xsm'],\n ['application/vnd.syncml.dm+wbxml', 'bdm'],\n ['application/vnd.syncml.dm+xml', 'xdm'],\n ['application/vnd.tao.intent-module-archive', 'tao'],\n ['application/vnd.tmobile-livetv', 'tmo'],\n ['application/vnd.trid.tpt', 'tpt'],\n ['application/vnd.triscape.mxs', 'mxs'],\n ['application/vnd.trueapp', 'tra'],\n ['application/vnd.ufdl', 'ufd'],\n ['application/vnd.uiq.theme', 'utz'],\n ['application/vnd.umajin', 'umj'],\n ['application/vnd.unity', 'unityweb'],\n ['application/vnd.uoml+xml', 'uoml'],\n ['application/vnd.vcx', 'vcx'],\n ['application/vnd.visio', 'vsd'],\n ['application/vnd.visionary', 'vis'],\n ['application/vnd.vsf', 'vsf'],\n ['application/vnd.wap.wbxml', 'wbxml'],\n ['application/vnd.wap.wmlc', 'wmlc'],\n ['application/vnd.wap.wmlscriptc', 'wmlsc'],\n ['application/vnd.webturbo', 'wtb'],\n ['application/vnd.wolfram.player', 'nbp'],\n ['application/vnd.wordperfect', 'wpd'],\n ['application/vnd.wqd', 'wqd'],\n ['application/vnd.wt.stf', 'stf'],\n ['application/vnd.xara', ['web', 'xar']],\n ['application/vnd.xfdl', 'xfdl'],\n ['application/vnd.yamaha.hv-dic', 'hvd'],\n ['application/vnd.yamaha.hv-script', 'hvs'],\n ['application/vnd.yamaha.hv-voice', 'hvp'],\n ['application/vnd.yamaha.openscoreformat', 'osf'],\n ['application/vnd.yamaha.openscoreformat.osfpvg+xml', 'osfpvg'],\n ['application/vnd.yamaha.smaf-audio', 'saf'],\n ['application/vnd.yamaha.smaf-phrase', 'spf'],\n ['application/vnd.yellowriver-custom-menu', 'cmp'],\n ['application/vnd.zul', 'zir'],\n ['application/vnd.zzazz.deck+xml', 'zaz'],\n ['application/vocaltec-media-desc', 'vmd'],\n ['application/vocaltec-media-file', 'vmf'],\n ['application/voicexml+xml', 'vxml'],\n ['application/widget', 'wgt'],\n ['application/winhlp', 'hlp'],\n ['application/wordperfect', ['wp', 'wp5', 'wp6', 'wpd']],\n ['application/wordperfect6.0', ['w60', 'wp5']],\n ['application/wordperfect6.1', 'w61'],\n ['application/wsdl+xml', 'wsdl'],\n ['application/wspolicy+xml', 'wspolicy'],\n ['application/x-123', 'wk1'],\n ['application/x-7z-compressed', '7z'],\n ['application/x-abiword', 'abw'],\n ['application/x-ace-compressed', 'ace'],\n ['application/x-aim', 'aim'],\n ['application/x-authorware-bin', 'aab'],\n ['application/x-authorware-map', 'aam'],\n ['application/x-authorware-seg', 'aas'],\n ['application/x-bcpio', 'bcpio'],\n ['application/x-binary', 'bin'],\n ['application/x-binhex40', 'hqx'],\n ['application/x-bittorrent', 'torrent'],\n ['application/x-bsh', ['bsh', 'sh', 'shar']],\n ['application/x-bytecode.elisp', 'elc'],\n ['application/x-bytecode.python', 'pyc'],\n ['application/x-bzip', 'bz'],\n ['application/x-bzip2', ['boz', 'bz2']],\n ['application/x-cdf', 'cdf'],\n ['application/x-cdlink', 'vcd'],\n ['application/x-chat', ['cha', 'chat']],\n ['application/x-chess-pgn', 'pgn'],\n ['application/x-cmu-raster', 'ras'],\n ['application/x-cocoa', 'cco'],\n ['application/x-compactpro', 'cpt'],\n ['application/x-compress', 'z'],\n ['application/x-compressed', ['tgz', 'gz', 'z', 'zip']],\n ['application/x-conference', 'nsc'],\n ['application/x-cpio', 'cpio'],\n ['application/x-cpt', 'cpt'],\n ['application/x-csh', 'csh'],\n ['application/x-debian-package', 'deb'],\n ['application/x-deepv', 'deepv'],\n ['application/x-director', ['dir', 'dcr', 'dxr']],\n ['application/x-doom', 'wad'],\n ['application/x-dtbncx+xml', 'ncx'],\n ['application/x-dtbook+xml', 'dtb'],\n ['application/x-dtbresource+xml', 'res'],\n ['application/x-dvi', 'dvi'],\n ['application/x-elc', 'elc'],\n ['application/x-envoy', ['env', 'evy']],\n ['application/x-esrehber', 'es'],\n ['application/x-excel', ['xls', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/x-font-bdf', 'bdf'],\n ['application/x-font-ghostscript', 'gsf'],\n ['application/x-font-linux-psf', 'psf'],\n ['application/x-font-otf', 'otf'],\n ['application/x-font-pcf', 'pcf'],\n ['application/x-font-snf', 'snf'],\n ['application/x-font-ttf', 'ttf'],\n ['application/x-font-type1', 'pfa'],\n ['application/x-font-woff', 'woff'],\n ['application/x-frame', 'mif'],\n ['application/x-freelance', 'pre'],\n ['application/x-futuresplash', 'spl'],\n ['application/x-gnumeric', 'gnumeric'],\n ['application/x-gsp', 'gsp'],\n ['application/x-gss', 'gss'],\n ['application/x-gtar', 'gtar'],\n ['application/x-gzip', ['gz', 'gzip']],\n ['application/x-hdf', 'hdf'],\n ['application/x-helpfile', ['help', 'hlp']],\n ['application/x-httpd-imap', 'imap'],\n ['application/x-ima', 'ima'],\n ['application/x-internet-signup', ['ins', 'isp']],\n ['application/x-internett-signup', 'ins'],\n ['application/x-inventor', 'iv'],\n ['application/x-ip2', 'ip'],\n ['application/x-iphone', 'iii'],\n ['application/x-java-class', 'class'],\n ['application/x-java-commerce', 'jcm'],\n ['application/x-java-jnlp-file', 'jnlp'],\n ['application/x-javascript', 'js'],\n ['application/x-koan', ['skd', 'skm', 'skp', 'skt']],\n ['application/x-ksh', 'ksh'],\n ['application/x-latex', ['latex', 'ltx']],\n ['application/x-lha', 'lha'],\n ['application/x-lisp', 'lsp'],\n ['application/x-livescreen', 'ivy'],\n ['application/x-lotus', 'wq1'],\n ['application/x-lotusscreencam', 'scm'],\n ['application/x-lzh', 'lzh'],\n ['application/x-lzx', 'lzx'],\n ['application/x-mac-binhex40', 'hqx'],\n ['application/x-macbinary', 'bin'],\n ['application/x-magic-cap-package-1.0', 'mc$'],\n ['application/x-mathcad', 'mcd'],\n ['application/x-meme', 'mm'],\n ['application/x-midi', ['mid', 'midi']],\n ['application/x-mif', 'mif'],\n ['application/x-mix-transfer', 'nix'],\n ['application/x-mobipocket-ebook', 'prc'],\n ['application/x-mplayer2', 'asx'],\n ['application/x-ms-application', 'application'],\n ['application/x-ms-wmd', 'wmd'],\n ['application/x-ms-wmz', 'wmz'],\n ['application/x-ms-xbap', 'xbap'],\n ['application/x-msaccess', 'mdb'],\n ['application/x-msbinder', 'obd'],\n ['application/x-mscardfile', 'crd'],\n ['application/x-msclip', 'clp'],\n ['application/x-msdownload', ['exe', 'dll']],\n ['application/x-msexcel', ['xls', 'xla', 'xlw']],\n ['application/x-msmediaview', ['mvb', 'm13', 'm14']],\n ['application/x-msmetafile', 'wmf'],\n ['application/x-msmoney', 'mny'],\n ['application/x-mspowerpoint', 'ppt'],\n ['application/x-mspublisher', 'pub'],\n ['application/x-msschedule', 'scd'],\n ['application/x-msterminal', 'trm'],\n ['application/x-mswrite', 'wri'],\n ['application/x-navi-animation', 'ani'],\n ['application/x-navidoc', 'nvd'],\n ['application/x-navimap', 'map'],\n ['application/x-navistyle', 'stl'],\n ['application/x-netcdf', ['cdf', 'nc']],\n ['application/x-newton-compatible-pkg', 'pkg'],\n ['application/x-nokia-9000-communicator-add-on-software', 'aos'],\n ['application/x-omc', 'omc'],\n ['application/x-omcdatamaker', 'omcd'],\n ['application/x-omcregerator', 'omcr'],\n ['application/x-pagemaker', ['pm4', 'pm5']],\n ['application/x-pcl', 'pcl'],\n ['application/x-perfmon', ['pma', 'pmc', 'pml', 'pmr', 'pmw']],\n ['application/x-pixclscript', 'plx'],\n ['application/x-pkcs10', 'p10'],\n ['application/x-pkcs12', ['p12', 'pfx']],\n ['application/x-pkcs7-certificates', ['p7b', 'spc']],\n ['application/x-pkcs7-certreqresp', 'p7r'],\n ['application/x-pkcs7-mime', ['p7m', 'p7c']],\n ['application/x-pkcs7-signature', ['p7s', 'p7a']],\n ['application/x-pointplus', 'css'],\n ['application/x-portable-anymap', 'pnm'],\n ['application/x-project', ['mpc', 'mpt', 'mpv', 'mpx']],\n ['application/x-qpro', 'wb1'],\n ['application/x-rar-compressed', 'rar'],\n ['application/x-rtf', 'rtf'],\n ['application/x-sdp', 'sdp'],\n ['application/x-sea', 'sea'],\n ['application/x-seelogo', 'sl'],\n ['application/x-sh', 'sh'],\n ['application/x-shar', ['shar', 'sh']],\n ['application/x-shockwave-flash', 'swf'],\n ['application/x-silverlight-app', 'xap'],\n ['application/x-sit', 'sit'],\n ['application/x-sprite', ['spr', 'sprite']],\n ['application/x-stuffit', 'sit'],\n ['application/x-stuffitx', 'sitx'],\n ['application/x-sv4cpio', 'sv4cpio'],\n ['application/x-sv4crc', 'sv4crc'],\n ['application/x-tar', 'tar'],\n ['application/x-tbook', ['sbk', 'tbk']],\n ['application/x-tcl', 'tcl'],\n ['application/x-tex', 'tex'],\n ['application/x-tex-tfm', 'tfm'],\n ['application/x-texinfo', ['texi', 'texinfo']],\n ['application/x-troff', ['roff', 't', 'tr']],\n ['application/x-troff-man', 'man'],\n ['application/x-troff-me', 'me'],\n ['application/x-troff-ms', 'ms'],\n ['application/x-troff-msvideo', 'avi'],\n ['application/x-ustar', 'ustar'],\n ['application/x-visio', ['vsd', 'vst', 'vsw']],\n ['application/x-vnd.audioexplosion.mzz', 'mzz'],\n ['application/x-vnd.ls-xpix', 'xpix'],\n ['application/x-vrml', 'vrml'],\n ['application/x-wais-source', ['src', 'wsrc']],\n ['application/x-winhelp', 'hlp'],\n ['application/x-wintalk', 'wtk'],\n ['application/x-world', ['wrl', 'svr']],\n ['application/x-wpwin', 'wpd'],\n ['application/x-wri', 'wri'],\n ['application/x-x509-ca-cert', ['cer', 'crt', 'der']],\n ['application/x-x509-user-cert', 'crt'],\n ['application/x-xfig', 'fig'],\n ['application/x-xpinstall', 'xpi'],\n ['application/x-zip-compressed', 'zip'],\n ['application/xcap-diff+xml', 'xdf'],\n ['application/xenc+xml', 'xenc'],\n ['application/xhtml+xml', 'xhtml'],\n ['application/xml', 'xml'],\n ['application/xml-dtd', 'dtd'],\n ['application/xop+xml', 'xop'],\n ['application/xslt+xml', 'xslt'],\n ['application/xspf+xml', 'xspf'],\n ['application/xv+xml', 'mxml'],\n ['application/yang', 'yang'],\n ['application/yin+xml', 'yin'],\n ['application/ynd.ms-pkipko', 'pko'],\n ['application/zip', 'zip'],\n ['audio/adpcm', 'adp'],\n ['audio/aiff', ['aiff', 'aif', 'aifc']],\n ['audio/basic', ['snd', 'au']],\n ['audio/it', 'it'],\n ['audio/make', ['funk', 'my', 'pfunk']],\n ['audio/make.my.funk', 'pfunk'],\n ['audio/mid', ['mid', 'rmi']],\n ['audio/midi', ['midi', 'kar', 'mid']],\n ['audio/mod', 'mod'],\n ['audio/mp4', 'mp4a'],\n ['audio/mpeg', ['mpga', 'mp3', 'm2a', 'mp2', 'mpa', 'mpg']],\n ['audio/mpeg3', 'mp3'],\n ['audio/nspaudio', ['la', 'lma']],\n ['audio/ogg', 'oga'],\n ['audio/s3m', 's3m'],\n ['audio/tsp-audio', 'tsi'],\n ['audio/tsplayer', 'tsp'],\n ['audio/vnd.dece.audio', 'uva'],\n ['audio/vnd.digital-winds', 'eol'],\n ['audio/vnd.dra', 'dra'],\n ['audio/vnd.dts', 'dts'],\n ['audio/vnd.dts.hd', 'dtshd'],\n ['audio/vnd.lucent.voice', 'lvp'],\n ['audio/vnd.ms-playready.media.pya', 'pya'],\n ['audio/vnd.nuera.ecelp4800', 'ecelp4800'],\n ['audio/vnd.nuera.ecelp7470', 'ecelp7470'],\n ['audio/vnd.nuera.ecelp9600', 'ecelp9600'],\n ['audio/vnd.qcelp', 'qcp'],\n ['audio/vnd.rip', 'rip'],\n ['audio/voc', 'voc'],\n ['audio/voxware', 'vox'],\n ['audio/wav', 'wav'],\n ['audio/webm', 'weba'],\n ['audio/x-aac', 'aac'],\n ['audio/x-adpcm', 'snd'],\n ['audio/x-aiff', ['aiff', 'aif', 'aifc']],\n ['audio/x-au', 'au'],\n ['audio/x-gsm', ['gsd', 'gsm']],\n ['audio/x-jam', 'jam'],\n ['audio/x-liveaudio', 'lam'],\n ['audio/x-mid', ['mid', 'midi']],\n ['audio/x-midi', ['midi', 'mid']],\n ['audio/x-mod', 'mod'],\n ['audio/x-mpeg', 'mp2'],\n ['audio/x-mpeg-3', 'mp3'],\n ['audio/x-mpegurl', 'm3u'],\n ['audio/x-mpequrl', 'm3u'],\n ['audio/x-ms-wax', 'wax'],\n ['audio/x-ms-wma', 'wma'],\n ['audio/x-nspaudio', ['la', 'lma']],\n ['audio/x-pn-realaudio', ['ra', 'ram', 'rm', 'rmm', 'rmp']],\n ['audio/x-pn-realaudio-plugin', ['ra', 'rmp', 'rpm']],\n ['audio/x-psid', 'sid'],\n ['audio/x-realaudio', 'ra'],\n ['audio/x-twinvq', 'vqf'],\n ['audio/x-twinvq-plugin', ['vqe', 'vql']],\n ['audio/x-vnd.audioexplosion.mjuicemediafile', 'mjf'],\n ['audio/x-voc', 'voc'],\n ['audio/x-wav', 'wav'],\n ['audio/xm', 'xm'],\n ['chemical/x-cdx', 'cdx'],\n ['chemical/x-cif', 'cif'],\n ['chemical/x-cmdf', 'cmdf'],\n ['chemical/x-cml', 'cml'],\n ['chemical/x-csml', 'csml'],\n ['chemical/x-pdb', ['pdb', 'xyz']],\n ['chemical/x-xyz', 'xyz'],\n ['drawing/x-dwf', 'dwf'],\n ['i-world/i-vrml', 'ivr'],\n ['image/bmp', ['bmp', 'bm']],\n ['image/cgm', 'cgm'],\n ['image/cis-cod', 'cod'],\n ['image/cmu-raster', ['ras', 'rast']],\n ['image/fif', 'fif'],\n ['image/florian', ['flo', 'turbot']],\n ['image/g3fax', 'g3'],\n ['image/gif', 'gif'],\n ['image/ief', ['ief', 'iefs']],\n ['image/jpeg', ['jpeg', 'jpe', 'jpg', 'jfif', 'jfif-tbnl']],\n ['image/jutvision', 'jut'],\n ['image/ktx', 'ktx'],\n ['image/naplps', ['nap', 'naplps']],\n ['image/pict', ['pic', 'pict']],\n ['image/pipeg', 'jfif'],\n ['image/pjpeg', ['jfif', 'jpe', 'jpeg', 'jpg']],\n ['image/png', ['png', 'x-png']],\n ['image/prs.btif', 'btif'],\n ['image/svg+xml', 'svg'],\n ['image/tiff', ['tif', 'tiff']],\n ['image/vasa', 'mcf'],\n ['image/vnd.adobe.photoshop', 'psd'],\n ['image/vnd.dece.graphic', 'uvi'],\n ['image/vnd.djvu', 'djvu'],\n ['image/vnd.dvb.subtitle', 'sub'],\n ['image/vnd.dwg', ['dwg', 'dxf', 'svf']],\n ['image/vnd.dxf', 'dxf'],\n ['image/vnd.fastbidsheet', 'fbs'],\n ['image/vnd.fpx', 'fpx'],\n ['image/vnd.fst', 'fst'],\n ['image/vnd.fujixerox.edmics-mmr', 'mmr'],\n ['image/vnd.fujixerox.edmics-rlc', 'rlc'],\n ['image/vnd.ms-modi', 'mdi'],\n ['image/vnd.net-fpx', ['fpx', 'npx']],\n ['image/vnd.rn-realflash', 'rf'],\n ['image/vnd.rn-realpix', 'rp'],\n ['image/vnd.wap.wbmp', 'wbmp'],\n ['image/vnd.xiff', 'xif'],\n ['image/webp', 'webp'],\n ['image/x-cmu-raster', 'ras'],\n ['image/x-cmx', 'cmx'],\n ['image/x-dwg', ['dwg', 'dxf', 'svf']],\n ['image/x-freehand', 'fh'],\n ['image/x-icon', 'ico'],\n ['image/x-jg', 'art'],\n ['image/x-jps', 'jps'],\n ['image/x-niff', ['niff', 'nif']],\n ['image/x-pcx', 'pcx'],\n ['image/x-pict', ['pct', 'pic']],\n ['image/x-portable-anymap', 'pnm'],\n ['image/x-portable-bitmap', 'pbm'],\n ['image/x-portable-graymap', 'pgm'],\n ['image/x-portable-greymap', 'pgm'],\n ['image/x-portable-pixmap', 'ppm'],\n ['image/x-quicktime', ['qif', 'qti', 'qtif']],\n ['image/x-rgb', 'rgb'],\n ['image/x-tiff', ['tif', 'tiff']],\n ['image/x-windows-bmp', 'bmp'],\n ['image/x-xbitmap', 'xbm'],\n ['image/x-xbm', 'xbm'],\n ['image/x-xpixmap', ['xpm', 'pm']],\n ['image/x-xwd', 'xwd'],\n ['image/x-xwindowdump', 'xwd'],\n ['image/xbm', 'xbm'],\n ['image/xpm', 'xpm'],\n ['message/rfc822', ['eml', 'mht', 'mhtml', 'nws', 'mime']],\n ['model/iges', ['iges', 'igs']],\n ['model/mesh', 'msh'],\n ['model/vnd.collada+xml', 'dae'],\n ['model/vnd.dwf', 'dwf'],\n ['model/vnd.gdl', 'gdl'],\n ['model/vnd.gtw', 'gtw'],\n ['model/vnd.mts', 'mts'],\n ['model/vnd.vtu', 'vtu'],\n ['model/vrml', ['vrml', 'wrl', 'wrz']],\n ['model/x-pov', 'pov'],\n ['multipart/x-gzip', 'gzip'],\n ['multipart/x-ustar', 'ustar'],\n ['multipart/x-zip', 'zip'],\n ['music/crescendo', ['mid', 'midi']],\n ['music/x-karaoke', 'kar'],\n ['paleovu/x-pv', 'pvu'],\n ['text/asp', 'asp'],\n ['text/calendar', 'ics'],\n ['text/css', 'css'],\n ['text/csv', 'csv'],\n ['text/ecmascript', 'js'],\n ['text/h323', '323'],\n ['text/html', ['html', 'htm', 'stm', 'acgi', 'htmls', 'htx', 'shtml']],\n ['text/iuls', 'uls'],\n ['text/javascript', 'js'],\n ['text/mcf', 'mcf'],\n ['text/n3', 'n3'],\n ['text/pascal', 'pas'],\n [\n 'text/plain',\n [\n 'txt',\n 'bas',\n 'c',\n 'h',\n 'c++',\n 'cc',\n 'com',\n 'conf',\n 'cxx',\n 'def',\n 'f',\n 'f90',\n 'for',\n 'g',\n 'hh',\n 'idc',\n 'jav',\n 'java',\n 'list',\n 'log',\n 'lst',\n 'm',\n 'mar',\n 'pl',\n 'sdml',\n 'text'\n ]\n ],\n ['text/plain-bas', 'par'],\n ['text/prs.lines.tag', 'dsc'],\n ['text/richtext', ['rtx', 'rt', 'rtf']],\n ['text/scriplet', 'wsc'],\n ['text/scriptlet', 'sct'],\n ['text/sgml', ['sgm', 'sgml']],\n ['text/tab-separated-values', 'tsv'],\n ['text/troff', 't'],\n ['text/turtle', 'ttl'],\n ['text/uri-list', ['uni', 'unis', 'uri', 'uris']],\n ['text/vnd.abc', 'abc'],\n ['text/vnd.curl', 'curl'],\n ['text/vnd.curl.dcurl', 'dcurl'],\n ['text/vnd.curl.mcurl', 'mcurl'],\n ['text/vnd.curl.scurl', 'scurl'],\n ['text/vnd.fly', 'fly'],\n ['text/vnd.fmi.flexstor', 'flx'],\n ['text/vnd.graphviz', 'gv'],\n ['text/vnd.in3d.3dml', '3dml'],\n ['text/vnd.in3d.spot', 'spot'],\n ['text/vnd.rn-realtext', 'rt'],\n ['text/vnd.sun.j2me.app-descriptor', 'jad'],\n ['text/vnd.wap.wml', 'wml'],\n ['text/vnd.wap.wmlscript', 'wmls'],\n ['text/webviewhtml', 'htt'],\n ['text/x-asm', ['asm', 's']],\n ['text/x-audiosoft-intra', 'aip'],\n ['text/x-c', ['c', 'cc', 'cpp']],\n ['text/x-component', 'htc'],\n ['text/x-fortran', ['for', 'f', 'f77', 'f90']],\n ['text/x-h', ['h', 'hh']],\n ['text/x-java-source', ['java', 'jav']],\n ['text/x-java-source,java', 'java'],\n ['text/x-la-asf', 'lsx'],\n ['text/x-m', 'm'],\n ['text/x-pascal', 'p'],\n ['text/x-script', 'hlb'],\n ['text/x-script.csh', 'csh'],\n ['text/x-script.elisp', 'el'],\n ['text/x-script.guile', 'scm'],\n ['text/x-script.ksh', 'ksh'],\n ['text/x-script.lisp', 'lsp'],\n ['text/x-script.perl', 'pl'],\n ['text/x-script.perl-module', 'pm'],\n ['text/x-script.phyton', 'py'],\n ['text/x-script.rexx', 'rexx'],\n ['text/x-script.scheme', 'scm'],\n ['text/x-script.sh', 'sh'],\n ['text/x-script.tcl', 'tcl'],\n ['text/x-script.tcsh', 'tcsh'],\n ['text/x-script.zsh', 'zsh'],\n ['text/x-server-parsed-html', ['shtml', 'ssi']],\n ['text/x-setext', 'etx'],\n ['text/x-sgml', ['sgm', 'sgml']],\n ['text/x-speech', ['spc', 'talk']],\n ['text/x-uil', 'uil'],\n ['text/x-uuencode', ['uu', 'uue']],\n ['text/x-vcalendar', 'vcs'],\n ['text/x-vcard', 'vcf'],\n ['text/xml', 'xml'],\n ['video/3gpp', '3gp'],\n ['video/3gpp2', '3g2'],\n ['video/animaflex', 'afl'],\n ['video/avi', 'avi'],\n ['video/avs-video', 'avs'],\n ['video/dl', 'dl'],\n ['video/fli', 'fli'],\n ['video/gl', 'gl'],\n ['video/h261', 'h261'],\n ['video/h263', 'h263'],\n ['video/h264', 'h264'],\n ['video/jpeg', 'jpgv'],\n ['video/jpm', 'jpm'],\n ['video/mj2', 'mj2'],\n ['video/mp4', 'mp4'],\n ['video/mpeg', ['mpeg', 'mp2', 'mpa', 'mpe', 'mpg', 'mpv2', 'm1v', 'm2v', 'mp3']],\n ['video/msvideo', 'avi'],\n ['video/ogg', 'ogv'],\n ['video/quicktime', ['mov', 'qt', 'moov']],\n ['video/vdo', 'vdo'],\n ['video/vivo', ['viv', 'vivo']],\n ['video/vnd.dece.hd', 'uvh'],\n ['video/vnd.dece.mobile', 'uvm'],\n ['video/vnd.dece.pd', 'uvp'],\n ['video/vnd.dece.sd', 'uvs'],\n ['video/vnd.dece.video', 'uvv'],\n ['video/vnd.fvt', 'fvt'],\n ['video/vnd.mpegurl', 'mxu'],\n ['video/vnd.ms-playready.media.pyv', 'pyv'],\n ['video/vnd.rn-realvideo', 'rv'],\n ['video/vnd.uvvu.mp4', 'uvu'],\n ['video/vnd.vivo', ['viv', 'vivo']],\n ['video/vosaic', 'vos'],\n ['video/webm', 'webm'],\n ['video/x-amt-demorun', 'xdr'],\n ['video/x-amt-showrun', 'xsr'],\n ['video/x-atomic3d-feature', 'fmf'],\n ['video/x-dl', 'dl'],\n ['video/x-dv', ['dif', 'dv']],\n ['video/x-f4v', 'f4v'],\n ['video/x-fli', 'fli'],\n ['video/x-flv', 'flv'],\n ['video/x-gl', 'gl'],\n ['video/x-isvideo', 'isu'],\n ['video/x-la-asf', ['lsf', 'lsx']],\n ['video/x-m4v', 'm4v'],\n ['video/x-motion-jpeg', 'mjpg'],\n ['video/x-mpeg', ['mp3', 'mp2']],\n ['video/x-mpeq2a', 'mp2'],\n ['video/x-ms-asf', ['asf', 'asr', 'asx']],\n ['video/x-ms-asf-plugin', 'asx'],\n ['video/x-ms-wm', 'wm'],\n ['video/x-ms-wmv', 'wmv'],\n ['video/x-ms-wmx', 'wmx'],\n ['video/x-ms-wvx', 'wvx'],\n ['video/x-msvideo', 'avi'],\n ['video/x-qtc', 'qtc'],\n ['video/x-scm', 'scm'],\n ['video/x-sgi-movie', ['movie', 'mv']],\n ['windows/metafile', 'wmf'],\n ['www/mime', 'mime'],\n ['x-conference/x-cooltalk', 'ice'],\n ['x-music/x-midi', ['mid', 'midi']],\n ['x-world/x-3dmf', ['3dm', '3dmf', 'qd3', 'qd3d']],\n ['x-world/x-svr', 'svr'],\n ['x-world/x-vrml', ['flr', 'vrml', 'wrl', 'wrz', 'xaf', 'xof']],\n ['x-world/x-vrt', 'vrt'],\n ['xgl/drawing', 'xgz'],\n ['xgl/movie', 'xmz']\n]);\nconst extensions = new Map([\n ['123', 'application/vnd.lotus-1-2-3'],\n ['323', 'text/h323'],\n ['*', 'application/octet-stream'],\n ['3dm', 'x-world/x-3dmf'],\n ['3dmf', 'x-world/x-3dmf'],\n ['3dml', 'text/vnd.in3d.3dml'],\n ['3g2', 'video/3gpp2'],\n ['3gp', 'video/3gpp'],\n ['7z', 'application/x-7z-compressed'],\n ['a', 'application/octet-stream'],\n ['aab', 'application/x-authorware-bin'],\n ['aac', 'audio/x-aac'],\n ['aam', 'application/x-authorware-map'],\n ['aas', 'application/x-authorware-seg'],\n ['abc', 'text/vnd.abc'],\n ['abw', 'application/x-abiword'],\n ['ac', 'application/pkix-attr-cert'],\n ['acc', 'application/vnd.americandynamics.acc'],\n ['ace', 'application/x-ace-compressed'],\n ['acgi', 'text/html'],\n ['acu', 'application/vnd.acucobol'],\n ['acx', 'application/internet-property-stream'],\n ['adp', 'audio/adpcm'],\n ['aep', 'application/vnd.audiograph'],\n ['afl', 'video/animaflex'],\n ['afp', 'application/vnd.ibm.modcap'],\n ['ahead', 'application/vnd.ahead.space'],\n ['ai', 'application/postscript'],\n ['aif', ['audio/aiff', 'audio/x-aiff']],\n ['aifc', ['audio/aiff', 'audio/x-aiff']],\n ['aiff', ['audio/aiff', 'audio/x-aiff']],\n ['aim', 'application/x-aim'],\n ['aip', 'text/x-audiosoft-intra'],\n ['air', 'application/vnd.adobe.air-application-installer-package+zip'],\n ['ait', 'application/vnd.dvb.ait'],\n ['ami', 'application/vnd.amiga.ami'],\n ['ani', 'application/x-navi-animation'],\n ['aos', 'application/x-nokia-9000-communicator-add-on-software'],\n ['apk', 'application/vnd.android.package-archive'],\n ['application', 'application/x-ms-application'],\n ['apr', 'application/vnd.lotus-approach'],\n ['aps', 'application/mime'],\n ['arc', 'application/octet-stream'],\n ['arj', ['application/arj', 'application/octet-stream']],\n ['art', 'image/x-jg'],\n ['asf', 'video/x-ms-asf'],\n ['asm', 'text/x-asm'],\n ['aso', 'application/vnd.accpac.simply.aso'],\n ['asp', 'text/asp'],\n ['asr', 'video/x-ms-asf'],\n ['asx', ['video/x-ms-asf', 'application/x-mplayer2', 'video/x-ms-asf-plugin']],\n ['atc', 'application/vnd.acucorp'],\n ['atomcat', 'application/atomcat+xml'],\n ['atomsvc', 'application/atomsvc+xml'],\n ['atx', 'application/vnd.antix.game-component'],\n ['au', ['audio/basic', 'audio/x-au']],\n ['avi', ['video/avi', 'video/msvideo', 'application/x-troff-msvideo', 'video/x-msvideo']],\n ['avs', 'video/avs-video'],\n ['aw', 'application/applixware'],\n ['axs', 'application/olescript'],\n ['azf', 'application/vnd.airzip.filesecure.azf'],\n ['azs', 'application/vnd.airzip.filesecure.azs'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bas', 'text/plain'],\n ['bcpio', 'application/x-bcpio'],\n ['bdf', 'application/x-font-bdf'],\n ['bdm', 'application/vnd.syncml.dm+wbxml'],\n ['bed', 'application/vnd.realvnc.bed'],\n ['bh2', 'application/vnd.fujitsu.oasysprs'],\n ['bin', ['application/octet-stream', 'application/mac-binary', 'application/macbinary', 'application/x-macbinary', 'application/x-binary']],\n ['bm', 'image/bmp'],\n ['bmi', 'application/vnd.bmi'],\n ['bmp', ['image/bmp', 'image/x-windows-bmp']],\n ['boo', 'application/book'],\n ['book', 'application/book'],\n ['box', 'application/vnd.previewsystems.box'],\n ['boz', 'application/x-bzip2'],\n ['bsh', 'application/x-bsh'],\n ['btif', 'image/prs.btif'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['c', ['text/plain', 'text/x-c']],\n ['c++', 'text/plain'],\n ['c11amc', 'application/vnd.cluetrust.cartomobile-config'],\n ['c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg'],\n ['c4g', 'application/vnd.clonk.c4group'],\n ['cab', 'application/vnd.ms-cab-compressed'],\n ['car', 'application/vnd.curl.car'],\n ['cat', ['application/vnd.ms-pkiseccat', 'application/vnd.ms-pki.seccat']],\n ['cc', ['text/plain', 'text/x-c']],\n ['ccad', 'application/clariscad'],\n ['cco', 'application/x-cocoa'],\n ['ccxml', 'application/ccxml+xml,'],\n ['cdbcmsg', 'application/vnd.contact.cmsg'],\n ['cdf', ['application/cdf', 'application/x-cdf', 'application/x-netcdf']],\n ['cdkey', 'application/vnd.mediastation.cdkey'],\n ['cdmia', 'application/cdmi-capability'],\n ['cdmic', 'application/cdmi-container'],\n ['cdmid', 'application/cdmi-domain'],\n ['cdmio', 'application/cdmi-object'],\n ['cdmiq', 'application/cdmi-queue'],\n ['cdx', 'chemical/x-cdx'],\n ['cdxml', 'application/vnd.chemdraw+xml'],\n ['cdy', 'application/vnd.cinderella'],\n ['cer', ['application/pkix-cert', 'application/x-x509-ca-cert']],\n ['cgm', 'image/cgm'],\n ['cha', 'application/x-chat'],\n ['chat', 'application/x-chat'],\n ['chm', 'application/vnd.ms-htmlhelp'],\n ['chrt', 'application/vnd.kde.kchart'],\n ['cif', 'chemical/x-cif'],\n ['cii', 'application/vnd.anser-web-certificate-issue-initiation'],\n ['cil', 'application/vnd.ms-artgalry'],\n ['cla', 'application/vnd.claymore'],\n ['class', ['application/octet-stream', 'application/java', 'application/java-byte-code', 'application/java-vm', 'application/x-java-class']],\n ['clkk', 'application/vnd.crick.clicker.keyboard'],\n ['clkp', 'application/vnd.crick.clicker.palette'],\n ['clkt', 'application/vnd.crick.clicker.template'],\n ['clkw', 'application/vnd.crick.clicker.wordbank'],\n ['clkx', 'application/vnd.crick.clicker'],\n ['clp', 'application/x-msclip'],\n ['cmc', 'application/vnd.cosmocaller'],\n ['cmdf', 'chemical/x-cmdf'],\n ['cml', 'chemical/x-cml'],\n ['cmp', 'application/vnd.yellowriver-custom-menu'],\n ['cmx', 'image/x-cmx'],\n ['cod', ['image/cis-cod', 'application/vnd.rim.cod']],\n ['com', ['application/octet-stream', 'text/plain']],\n ['conf', 'text/plain'],\n ['cpio', 'application/x-cpio'],\n ['cpp', 'text/x-c'],\n ['cpt', ['application/mac-compactpro', 'application/x-compactpro', 'application/x-cpt']],\n ['crd', 'application/x-mscardfile'],\n ['crl', ['application/pkix-crl', 'application/pkcs-crl']],\n ['crt', ['application/pkix-cert', 'application/x-x509-user-cert', 'application/x-x509-ca-cert']],\n ['cryptonote', 'application/vnd.rig.cryptonote'],\n ['csh', ['text/x-script.csh', 'application/x-csh']],\n ['csml', 'chemical/x-csml'],\n ['csp', 'application/vnd.commonspace'],\n ['css', ['text/css', 'application/x-pointplus']],\n ['csv', 'text/csv'],\n ['cu', 'application/cu-seeme'],\n ['curl', 'text/vnd.curl'],\n ['cww', 'application/prs.cww'],\n ['cxx', 'text/plain'],\n ['dae', 'model/vnd.collada+xml'],\n ['daf', 'application/vnd.mobius.daf'],\n ['davmount', 'application/davmount+xml'],\n ['dcr', 'application/x-director'],\n ['dcurl', 'text/vnd.curl.dcurl'],\n ['dd2', 'application/vnd.oma.dd2+xml'],\n ['ddd', 'application/vnd.fujixerox.ddd'],\n ['deb', 'application/x-debian-package'],\n ['deepv', 'application/x-deepv'],\n ['def', 'text/plain'],\n ['der', 'application/x-x509-ca-cert'],\n ['dfac', 'application/vnd.dreamfactory'],\n ['dif', 'video/x-dv'],\n ['dir', 'application/x-director'],\n ['dis', 'application/vnd.mobius.dis'],\n ['djvu', 'image/vnd.djvu'],\n ['dl', ['video/dl', 'video/x-dl']],\n ['dll', 'application/x-msdownload'],\n ['dms', 'application/octet-stream'],\n ['dna', 'application/vnd.dna'],\n ['doc', 'application/msword'],\n ['docm', 'application/vnd.ms-word.document.macroenabled.12'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['dot', 'application/msword'],\n ['dotm', 'application/vnd.ms-word.template.macroenabled.12'],\n ['dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'],\n ['dp', ['application/commonground', 'application/vnd.osgi.dp']],\n ['dpg', 'application/vnd.dpgraph'],\n ['dra', 'audio/vnd.dra'],\n ['drw', 'application/drafting'],\n ['dsc', 'text/prs.lines.tag'],\n ['dssc', 'application/dssc+der'],\n ['dtb', 'application/x-dtbook+xml'],\n ['dtd', 'application/xml-dtd'],\n ['dts', 'audio/vnd.dts'],\n ['dtshd', 'audio/vnd.dts.hd'],\n ['dump', 'application/octet-stream'],\n ['dv', 'video/x-dv'],\n ['dvi', 'application/x-dvi'],\n ['dwf', ['model/vnd.dwf', 'drawing/x-dwf']],\n ['dwg', ['application/acad', 'image/vnd.dwg', 'image/x-dwg']],\n ['dxf', ['application/dxf', 'image/vnd.dwg', 'image/vnd.dxf', 'image/x-dwg']],\n ['dxp', 'application/vnd.spotfire.dxp'],\n ['dxr', 'application/x-director'],\n ['ecelp4800', 'audio/vnd.nuera.ecelp4800'],\n ['ecelp7470', 'audio/vnd.nuera.ecelp7470'],\n ['ecelp9600', 'audio/vnd.nuera.ecelp9600'],\n ['edm', 'application/vnd.novadigm.edm'],\n ['edx', 'application/vnd.novadigm.edx'],\n ['efif', 'application/vnd.picsel'],\n ['ei6', 'application/vnd.pg.osasli'],\n ['el', 'text/x-script.elisp'],\n ['elc', ['application/x-elc', 'application/x-bytecode.elisp']],\n ['eml', 'message/rfc822'],\n ['emma', 'application/emma+xml'],\n ['env', 'application/x-envoy'],\n ['eol', 'audio/vnd.digital-winds'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['eps', 'application/postscript'],\n ['epub', 'application/epub+zip'],\n ['es', ['application/ecmascript', 'application/x-esrehber']],\n ['es3', 'application/vnd.eszigno3+xml'],\n ['esf', 'application/vnd.epson.esf'],\n ['etx', 'text/x-setext'],\n ['evy', ['application/envoy', 'application/x-envoy']],\n ['exe', ['application/octet-stream', 'application/x-msdownload']],\n ['exi', 'application/exi'],\n ['ext', 'application/vnd.novadigm.ext'],\n ['ez2', 'application/vnd.ezpix-album'],\n ['ez3', 'application/vnd.ezpix-package'],\n ['f', ['text/plain', 'text/x-fortran']],\n ['f4v', 'video/x-f4v'],\n ['f77', 'text/x-fortran'],\n ['f90', ['text/plain', 'text/x-fortran']],\n ['fbs', 'image/vnd.fastbidsheet'],\n ['fcs', 'application/vnd.isac.fcs'],\n ['fdf', 'application/vnd.fdf'],\n ['fe_launch', 'application/vnd.denovo.fcselayout-link'],\n ['fg5', 'application/vnd.fujitsu.oasysgp'],\n ['fh', 'image/x-freehand'],\n ['fif', ['application/fractals', 'image/fif']],\n ['fig', 'application/x-xfig'],\n ['fli', ['video/fli', 'video/x-fli']],\n ['flo', ['image/florian', 'application/vnd.micrografx.flo']],\n ['flr', 'x-world/x-vrml'],\n ['flv', 'video/x-flv'],\n ['flw', 'application/vnd.kde.kivio'],\n ['flx', 'text/vnd.fmi.flexstor'],\n ['fly', 'text/vnd.fly'],\n ['fm', 'application/vnd.framemaker'],\n ['fmf', 'video/x-atomic3d-feature'],\n ['fnc', 'application/vnd.frogans.fnc'],\n ['for', ['text/plain', 'text/x-fortran']],\n ['fpx', ['image/vnd.fpx', 'image/vnd.net-fpx']],\n ['frl', 'application/freeloader'],\n ['fsc', 'application/vnd.fsc.weblaunch'],\n ['fst', 'image/vnd.fst'],\n ['ftc', 'application/vnd.fluxtime.clip'],\n ['fti', 'application/vnd.anser-web-funds-transfer-initiation'],\n ['funk', 'audio/make'],\n ['fvt', 'video/vnd.fvt'],\n ['fxp', 'application/vnd.adobe.fxp'],\n ['fzs', 'application/vnd.fuzzysheet'],\n ['g', 'text/plain'],\n ['g2w', 'application/vnd.geoplan'],\n ['g3', 'image/g3fax'],\n ['g3w', 'application/vnd.geospace'],\n ['gac', 'application/vnd.groove-account'],\n ['gdl', 'model/vnd.gdl'],\n ['geo', 'application/vnd.dynageo'],\n ['gex', 'application/vnd.geometry-explorer'],\n ['ggb', 'application/vnd.geogebra.file'],\n ['ggt', 'application/vnd.geogebra.tool'],\n ['ghf', 'application/vnd.groove-help'],\n ['gif', 'image/gif'],\n ['gim', 'application/vnd.groove-identity-message'],\n ['gl', ['video/gl', 'video/x-gl']],\n ['gmx', 'application/vnd.gmx'],\n ['gnumeric', 'application/x-gnumeric'],\n ['gph', 'application/vnd.flographit'],\n ['gqf', 'application/vnd.grafeq'],\n ['gram', 'application/srgs'],\n ['grv', 'application/vnd.groove-injector'],\n ['grxml', 'application/srgs+xml'],\n ['gsd', 'audio/x-gsm'],\n ['gsf', 'application/x-font-ghostscript'],\n ['gsm', 'audio/x-gsm'],\n ['gsp', 'application/x-gsp'],\n ['gss', 'application/x-gss'],\n ['gtar', 'application/x-gtar'],\n ['gtm', 'application/vnd.groove-tool-message'],\n ['gtw', 'model/vnd.gtw'],\n ['gv', 'text/vnd.graphviz'],\n ['gxt', 'application/vnd.geonext'],\n ['gz', ['application/x-gzip', 'application/x-compressed']],\n ['gzip', ['multipart/x-gzip', 'application/x-gzip']],\n ['h', ['text/plain', 'text/x-h']],\n ['h261', 'video/h261'],\n ['h263', 'video/h263'],\n ['h264', 'video/h264'],\n ['hal', 'application/vnd.hal+xml'],\n ['hbci', 'application/vnd.hbci'],\n ['hdf', 'application/x-hdf'],\n ['help', 'application/x-helpfile'],\n ['hgl', 'application/vnd.hp-hpgl'],\n ['hh', ['text/plain', 'text/x-h']],\n ['hlb', 'text/x-script'],\n ['hlp', ['application/winhlp', 'application/hlp', 'application/x-helpfile', 'application/x-winhelp']],\n ['hpg', 'application/vnd.hp-hpgl'],\n ['hpgl', 'application/vnd.hp-hpgl'],\n ['hpid', 'application/vnd.hp-hpid'],\n ['hps', 'application/vnd.hp-hps'],\n [\n 'hqx',\n [\n 'application/mac-binhex40',\n 'application/binhex',\n 'application/binhex4',\n 'application/mac-binhex',\n 'application/x-binhex40',\n 'application/x-mac-binhex40'\n ]\n ],\n ['hta', 'application/hta'],\n ['htc', 'text/x-component'],\n ['htke', 'application/vnd.kenameaapp'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['htmls', 'text/html'],\n ['htt', 'text/webviewhtml'],\n ['htx', 'text/html'],\n ['hvd', 'application/vnd.yamaha.hv-dic'],\n ['hvp', 'application/vnd.yamaha.hv-voice'],\n ['hvs', 'application/vnd.yamaha.hv-script'],\n ['i2g', 'application/vnd.intergeo'],\n ['icc', 'application/vnd.iccprofile'],\n ['ice', 'x-conference/x-cooltalk'],\n ['ico', 'image/x-icon'],\n ['ics', 'text/calendar'],\n ['idc', 'text/plain'],\n ['ief', 'image/ief'],\n ['iefs', 'image/ief'],\n ['ifm', 'application/vnd.shana.informed.formdata'],\n ['iges', ['application/iges', 'model/iges']],\n ['igl', 'application/vnd.igloader'],\n ['igm', 'application/vnd.insors.igm'],\n ['igs', ['application/iges', 'model/iges']],\n ['igx', 'application/vnd.micrografx.igx'],\n ['iif', 'application/vnd.shana.informed.interchange'],\n ['iii', 'application/x-iphone'],\n ['ima', 'application/x-ima'],\n ['imap', 'application/x-httpd-imap'],\n ['imp', 'application/vnd.accpac.simply.imp'],\n ['ims', 'application/vnd.ms-ims'],\n ['inf', 'application/inf'],\n ['ins', ['application/x-internet-signup', 'application/x-internett-signup']],\n ['ip', 'application/x-ip2'],\n ['ipfix', 'application/ipfix'],\n ['ipk', 'application/vnd.shana.informed.package'],\n ['irm', 'application/vnd.ibm.rights-management'],\n ['irp', 'application/vnd.irepository.package+xml'],\n ['isp', 'application/x-internet-signup'],\n ['isu', 'video/x-isvideo'],\n ['it', 'audio/it'],\n ['itp', 'application/vnd.shana.informed.formtemplate'],\n ['iv', 'application/x-inventor'],\n ['ivp', 'application/vnd.immervision-ivp'],\n ['ivr', 'i-world/i-vrml'],\n ['ivu', 'application/vnd.immervision-ivu'],\n ['ivy', 'application/x-livescreen'],\n ['jad', 'text/vnd.sun.j2me.app-descriptor'],\n ['jam', ['application/vnd.jam', 'audio/x-jam']],\n ['jar', 'application/java-archive'],\n ['jav', ['text/plain', 'text/x-java-source']],\n ['java', ['text/plain', 'text/x-java-source,java', 'text/x-java-source']],\n ['jcm', 'application/x-java-commerce'],\n ['jfif', ['image/pipeg', 'image/jpeg', 'image/pjpeg']],\n ['jfif-tbnl', 'image/jpeg'],\n ['jisp', 'application/vnd.jisp'],\n ['jlt', 'application/vnd.hp-jlyt'],\n ['jnlp', 'application/x-java-jnlp-file'],\n ['joda', 'application/vnd.joost.joda-archive'],\n ['jpe', ['image/jpeg', 'image/pjpeg']],\n ['jpeg', ['image/jpeg', 'image/pjpeg']],\n ['jpg', ['image/jpeg', 'image/pjpeg']],\n ['jpgv', 'video/jpeg'],\n ['jpm', 'video/jpm'],\n ['jps', 'image/x-jps'],\n ['js', ['application/javascript', 'application/ecmascript', 'text/javascript', 'text/ecmascript', 'application/x-javascript']],\n ['json', 'application/json'],\n ['jut', 'image/jutvision'],\n ['kar', ['audio/midi', 'music/x-karaoke']],\n ['karbon', 'application/vnd.kde.karbon'],\n ['kfo', 'application/vnd.kde.kformula'],\n ['kia', 'application/vnd.kidspiration'],\n ['kml', 'application/vnd.google-earth.kml+xml'],\n ['kmz', 'application/vnd.google-earth.kmz'],\n ['kne', 'application/vnd.kinar'],\n ['kon', 'application/vnd.kde.kontour'],\n ['kpr', 'application/vnd.kde.kpresenter'],\n ['ksh', ['application/x-ksh', 'text/x-script.ksh']],\n ['ksp', 'application/vnd.kde.kspread'],\n ['ktx', 'image/ktx'],\n ['ktz', 'application/vnd.kahootz'],\n ['kwd', 'application/vnd.kde.kword'],\n ['la', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['lam', 'audio/x-liveaudio'],\n ['lasxml', 'application/vnd.las.las+xml'],\n ['latex', 'application/x-latex'],\n ['lbd', 'application/vnd.llamagraphics.life-balance.desktop'],\n ['lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml'],\n ['les', 'application/vnd.hhe.lesson-player'],\n ['lha', ['application/octet-stream', 'application/lha', 'application/x-lha']],\n ['lhx', 'application/octet-stream'],\n ['link66', 'application/vnd.route66.link66+xml'],\n ['list', 'text/plain'],\n ['lma', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['log', 'text/plain'],\n ['lrm', 'application/vnd.ms-lrm'],\n ['lsf', 'video/x-la-asf'],\n ['lsp', ['application/x-lisp', 'text/x-script.lisp']],\n ['lst', 'text/plain'],\n ['lsx', ['video/x-la-asf', 'text/x-la-asf']],\n ['ltf', 'application/vnd.frogans.ltf'],\n ['ltx', 'application/x-latex'],\n ['lvp', 'audio/vnd.lucent.voice'],\n ['lwp', 'application/vnd.lotus-wordpro'],\n ['lzh', ['application/octet-stream', 'application/x-lzh']],\n ['lzx', ['application/lzx', 'application/octet-stream', 'application/x-lzx']],\n ['m', ['text/plain', 'text/x-m']],\n ['m13', 'application/x-msmediaview'],\n ['m14', 'application/x-msmediaview'],\n ['m1v', 'video/mpeg'],\n ['m21', 'application/mp21'],\n ['m2a', 'audio/mpeg'],\n ['m2v', 'video/mpeg'],\n ['m3u', ['audio/x-mpegurl', 'audio/x-mpequrl']],\n ['m3u8', 'application/vnd.apple.mpegurl'],\n ['m4v', 'video/x-m4v'],\n ['ma', 'application/mathematica'],\n ['mads', 'application/mads+xml'],\n ['mag', 'application/vnd.ecowin.chart'],\n ['man', 'application/x-troff-man'],\n ['map', 'application/x-navimap'],\n ['mar', 'text/plain'],\n ['mathml', 'application/mathml+xml'],\n ['mbd', 'application/mbedlet'],\n ['mbk', 'application/vnd.mobius.mbk'],\n ['mbox', 'application/mbox'],\n ['mc$', 'application/x-magic-cap-package-1.0'],\n ['mc1', 'application/vnd.medcalcdata'],\n ['mcd', ['application/mcad', 'application/vnd.mcd', 'application/x-mathcad']],\n ['mcf', ['image/vasa', 'text/mcf']],\n ['mcp', 'application/netmc'],\n ['mcurl', 'text/vnd.curl.mcurl'],\n ['mdb', 'application/x-msaccess'],\n ['mdi', 'image/vnd.ms-modi'],\n ['me', 'application/x-troff-me'],\n ['meta4', 'application/metalink4+xml'],\n ['mets', 'application/mets+xml'],\n ['mfm', 'application/vnd.mfmp'],\n ['mgp', 'application/vnd.osgeo.mapguide.package'],\n ['mgz', 'application/vnd.proteus.magazine'],\n ['mht', 'message/rfc822'],\n ['mhtml', 'message/rfc822'],\n ['mid', ['audio/mid', 'audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['midi', ['audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['mif', ['application/vnd.mif', 'application/x-mif', 'application/x-frame']],\n ['mime', ['message/rfc822', 'www/mime']],\n ['mj2', 'video/mj2'],\n ['mjf', 'audio/x-vnd.audioexplosion.mjuicemediafile'],\n ['mjpg', 'video/x-motion-jpeg'],\n ['mlp', 'application/vnd.dolby.mlp'],\n ['mm', ['application/base64', 'application/x-meme']],\n ['mmd', 'application/vnd.chipnuts.karaoke-mmd'],\n ['mme', 'application/base64'],\n ['mmf', 'application/vnd.smaf'],\n ['mmr', 'image/vnd.fujixerox.edmics-mmr'],\n ['mny', 'application/x-msmoney'],\n ['mod', ['audio/mod', 'audio/x-mod']],\n ['mods', 'application/mods+xml'],\n ['moov', 'video/quicktime'],\n ['mov', 'video/quicktime'],\n ['movie', 'video/x-sgi-movie'],\n ['mp2', ['video/mpeg', 'audio/mpeg', 'video/x-mpeg', 'audio/x-mpeg', 'video/x-mpeq2a']],\n ['mp3', ['audio/mpeg', 'audio/mpeg3', 'video/mpeg', 'audio/x-mpeg-3', 'video/x-mpeg']],\n ['mp4', ['video/mp4', 'application/mp4']],\n ['mp4a', 'audio/mp4'],\n ['mpa', ['video/mpeg', 'audio/mpeg']],\n ['mpc', ['application/vnd.mophun.certificate', 'application/x-project']],\n ['mpe', 'video/mpeg'],\n ['mpeg', 'video/mpeg'],\n ['mpg', ['video/mpeg', 'audio/mpeg']],\n ['mpga', 'audio/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['mpm', 'application/vnd.blueice.multipass'],\n ['mpn', 'application/vnd.mophun.application'],\n ['mpp', 'application/vnd.ms-project'],\n ['mpt', 'application/x-project'],\n ['mpv', 'application/x-project'],\n ['mpv2', 'video/mpeg'],\n ['mpx', 'application/x-project'],\n ['mpy', 'application/vnd.ibm.minipay'],\n ['mqy', 'application/vnd.mobius.mqy'],\n ['mrc', 'application/marc'],\n ['mrcx', 'application/marcxml+xml'],\n ['ms', 'application/x-troff-ms'],\n ['mscml', 'application/mediaservercontrol+xml'],\n ['mseq', 'application/vnd.mseq'],\n ['msf', 'application/vnd.epson.msf'],\n ['msg', 'application/vnd.ms-outlook'],\n ['msh', 'model/mesh'],\n ['msl', 'application/vnd.mobius.msl'],\n ['msty', 'application/vnd.muvee.style'],\n ['mts', 'model/vnd.mts'],\n ['mus', 'application/vnd.musician'],\n ['musicxml', 'application/vnd.recordare.musicxml+xml'],\n ['mv', 'video/x-sgi-movie'],\n ['mvb', 'application/x-msmediaview'],\n ['mwf', 'application/vnd.mfer'],\n ['mxf', 'application/mxf'],\n ['mxl', 'application/vnd.recordare.musicxml'],\n ['mxml', 'application/xv+xml'],\n ['mxs', 'application/vnd.triscape.mxs'],\n ['mxu', 'video/vnd.mpegurl'],\n ['my', 'audio/make'],\n ['mzz', 'application/x-vnd.audioexplosion.mzz'],\n ['n-gage', 'application/vnd.nokia.n-gage.symbian.install'],\n ['n3', 'text/n3'],\n ['nap', 'image/naplps'],\n ['naplps', 'image/naplps'],\n ['nbp', 'application/vnd.wolfram.player'],\n ['nc', 'application/x-netcdf'],\n ['ncm', 'application/vnd.nokia.configuration-message'],\n ['ncx', 'application/x-dtbncx+xml'],\n ['ngdat', 'application/vnd.nokia.n-gage.data'],\n ['nif', 'image/x-niff'],\n ['niff', 'image/x-niff'],\n ['nix', 'application/x-mix-transfer'],\n ['nlu', 'application/vnd.neurolanguage.nlu'],\n ['nml', 'application/vnd.enliven'],\n ['nnd', 'application/vnd.noblenet-directory'],\n ['nns', 'application/vnd.noblenet-sealer'],\n ['nnw', 'application/vnd.noblenet-web'],\n ['npx', 'image/vnd.net-fpx'],\n ['nsc', 'application/x-conference'],\n ['nsf', 'application/vnd.lotus-notes'],\n ['nvd', 'application/x-navidoc'],\n ['nws', 'message/rfc822'],\n ['o', 'application/octet-stream'],\n ['oa2', 'application/vnd.fujitsu.oasys2'],\n ['oa3', 'application/vnd.fujitsu.oasys3'],\n ['oas', 'application/vnd.fujitsu.oasys'],\n ['obd', 'application/x-msbinder'],\n ['oda', 'application/oda'],\n ['odb', 'application/vnd.oasis.opendocument.database'],\n ['odc', 'application/vnd.oasis.opendocument.chart'],\n ['odf', 'application/vnd.oasis.opendocument.formula'],\n ['odft', 'application/vnd.oasis.opendocument.formula-template'],\n ['odg', 'application/vnd.oasis.opendocument.graphics'],\n ['odi', 'application/vnd.oasis.opendocument.image'],\n ['odm', 'application/vnd.oasis.opendocument.text-master'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['omc', 'application/x-omc'],\n ['omcd', 'application/x-omcdatamaker'],\n ['omcr', 'application/x-omcregerator'],\n ['onetoc', 'application/onenote'],\n ['opf', 'application/oebps-package+xml'],\n ['org', 'application/vnd.lotus-organizer'],\n ['osf', 'application/vnd.yamaha.openscoreformat'],\n ['osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml'],\n ['otc', 'application/vnd.oasis.opendocument.chart-template'],\n ['otf', 'application/x-font-otf'],\n ['otg', 'application/vnd.oasis.opendocument.graphics-template'],\n ['oth', 'application/vnd.oasis.opendocument.text-web'],\n ['oti', 'application/vnd.oasis.opendocument.image-template'],\n ['otp', 'application/vnd.oasis.opendocument.presentation-template'],\n ['ots', 'application/vnd.oasis.opendocument.spreadsheet-template'],\n ['ott', 'application/vnd.oasis.opendocument.text-template'],\n ['oxt', 'application/vnd.openofficeorg.extension'],\n ['p', 'text/x-pascal'],\n ['p10', ['application/pkcs10', 'application/x-pkcs10']],\n ['p12', ['application/pkcs-12', 'application/x-pkcs12']],\n ['p7a', 'application/x-pkcs7-signature'],\n ['p7b', 'application/x-pkcs7-certificates'],\n ['p7c', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7m', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7r', 'application/x-pkcs7-certreqresp'],\n ['p7s', ['application/pkcs7-signature', 'application/x-pkcs7-signature']],\n ['p8', 'application/pkcs8'],\n ['par', 'text/plain-bas'],\n ['part', 'application/pro_eng'],\n ['pas', 'text/pascal'],\n ['paw', 'application/vnd.pawaafile'],\n ['pbd', 'application/vnd.powerbuilder6'],\n ['pbm', 'image/x-portable-bitmap'],\n ['pcf', 'application/x-font-pcf'],\n ['pcl', ['application/vnd.hp-pcl', 'application/x-pcl']],\n ['pclxl', 'application/vnd.hp-pclxl'],\n ['pct', 'image/x-pict'],\n ['pcurl', 'application/vnd.curl.pcurl'],\n ['pcx', 'image/x-pcx'],\n ['pdb', ['application/vnd.palm', 'chemical/x-pdb']],\n ['pdf', 'application/pdf'],\n ['pfa', 'application/x-font-type1'],\n ['pfr', 'application/font-tdpfr'],\n ['pfunk', ['audio/make', 'audio/make.my.funk']],\n ['pfx', 'application/x-pkcs12'],\n ['pgm', ['image/x-portable-graymap', 'image/x-portable-greymap']],\n ['pgn', 'application/x-chess-pgn'],\n ['pgp', 'application/pgp-signature'],\n ['pic', ['image/pict', 'image/x-pict']],\n ['pict', 'image/pict'],\n ['pkg', 'application/x-newton-compatible-pkg'],\n ['pki', 'application/pkixcmp'],\n ['pkipath', 'application/pkix-pkipath'],\n ['pko', ['application/ynd.ms-pkipko', 'application/vnd.ms-pki.pko']],\n ['pl', ['text/plain', 'text/x-script.perl']],\n ['plb', 'application/vnd.3gpp.pic-bw-large'],\n ['plc', 'application/vnd.mobius.plc'],\n ['plf', 'application/vnd.pocketlearn'],\n ['pls', 'application/pls+xml'],\n ['plx', 'application/x-pixclscript'],\n ['pm', ['text/x-script.perl-module', 'image/x-xpixmap']],\n ['pm4', 'application/x-pagemaker'],\n ['pm5', 'application/x-pagemaker'],\n ['pma', 'application/x-perfmon'],\n ['pmc', 'application/x-perfmon'],\n ['pml', ['application/vnd.ctc-posml', 'application/x-perfmon']],\n ['pmr', 'application/x-perfmon'],\n ['pmw', 'application/x-perfmon'],\n ['png', 'image/png'],\n ['pnm', ['application/x-portable-anymap', 'image/x-portable-anymap']],\n ['portpkg', 'application/vnd.macports.portpkg'],\n ['pot', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['potm', 'application/vnd.ms-powerpoint.template.macroenabled.12'],\n ['potx', 'application/vnd.openxmlformats-officedocument.presentationml.template'],\n ['pov', 'model/x-pov'],\n ['ppa', 'application/vnd.ms-powerpoint'],\n ['ppam', 'application/vnd.ms-powerpoint.addin.macroenabled.12'],\n ['ppd', 'application/vnd.cups-ppd'],\n ['ppm', 'image/x-portable-pixmap'],\n ['pps', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['ppsm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12'],\n ['ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'],\n ['ppt', ['application/vnd.ms-powerpoint', 'application/mspowerpoint', 'application/powerpoint', 'application/x-mspowerpoint']],\n ['pptm', 'application/vnd.ms-powerpoint.presentation.macroenabled.12'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['ppz', 'application/mspowerpoint'],\n ['prc', 'application/x-mobipocket-ebook'],\n ['pre', ['application/vnd.lotus-freelance', 'application/x-freelance']],\n ['prf', 'application/pics-rules'],\n ['prt', 'application/pro_eng'],\n ['ps', 'application/postscript'],\n ['psb', 'application/vnd.3gpp.pic-bw-small'],\n ['psd', ['application/octet-stream', 'image/vnd.adobe.photoshop']],\n ['psf', 'application/x-font-linux-psf'],\n ['pskcxml', 'application/pskc+xml'],\n ['ptid', 'application/vnd.pvi.ptid1'],\n ['pub', 'application/x-mspublisher'],\n ['pvb', 'application/vnd.3gpp.pic-bw-var'],\n ['pvu', 'paleovu/x-pv'],\n ['pwn', 'application/vnd.3m.post-it-notes'],\n ['pwz', 'application/vnd.ms-powerpoint'],\n ['py', 'text/x-script.phyton'],\n ['pya', 'audio/vnd.ms-playready.media.pya'],\n ['pyc', 'application/x-bytecode.python'],\n ['pyv', 'video/vnd.ms-playready.media.pyv'],\n ['qam', 'application/vnd.epson.quickanime'],\n ['qbo', 'application/vnd.intu.qbo'],\n ['qcp', 'audio/vnd.qcelp'],\n ['qd3', 'x-world/x-3dmf'],\n ['qd3d', 'x-world/x-3dmf'],\n ['qfx', 'application/vnd.intu.qfx'],\n ['qif', 'image/x-quicktime'],\n ['qps', 'application/vnd.publishare-delta-tree'],\n ['qt', 'video/quicktime'],\n ['qtc', 'video/x-qtc'],\n ['qti', 'image/x-quicktime'],\n ['qtif', 'image/x-quicktime'],\n ['qxd', 'application/vnd.quark.quarkxpress'],\n ['ra', ['audio/x-realaudio', 'audio/x-pn-realaudio', 'audio/x-pn-realaudio-plugin']],\n ['ram', 'audio/x-pn-realaudio'],\n ['rar', 'application/x-rar-compressed'],\n ['ras', ['image/cmu-raster', 'application/x-cmu-raster', 'image/x-cmu-raster']],\n ['rast', 'image/cmu-raster'],\n ['rcprofile', 'application/vnd.ipunplugged.rcprofile'],\n ['rdf', 'application/rdf+xml'],\n ['rdz', 'application/vnd.data-vision.rdz'],\n ['rep', 'application/vnd.businessobjects'],\n ['res', 'application/x-dtbresource+xml'],\n ['rexx', 'text/x-script.rexx'],\n ['rf', 'image/vnd.rn-realflash'],\n ['rgb', 'image/x-rgb'],\n ['rif', 'application/reginfo+xml'],\n ['rip', 'audio/vnd.rip'],\n ['rl', 'application/resource-lists+xml'],\n ['rlc', 'image/vnd.fujixerox.edmics-rlc'],\n ['rld', 'application/resource-lists-diff+xml'],\n ['rm', ['application/vnd.rn-realmedia', 'audio/x-pn-realaudio']],\n ['rmi', 'audio/mid'],\n ['rmm', 'audio/x-pn-realaudio'],\n ['rmp', ['audio/x-pn-realaudio-plugin', 'audio/x-pn-realaudio']],\n ['rms', 'application/vnd.jcp.javame.midlet-rms'],\n ['rnc', 'application/relax-ng-compact-syntax'],\n ['rng', ['application/ringing-tones', 'application/vnd.nokia.ringing-tone']],\n ['rnx', 'application/vnd.rn-realplayer'],\n ['roff', 'application/x-troff'],\n ['rp', 'image/vnd.rn-realpix'],\n ['rp9', 'application/vnd.cloanto.rp9'],\n ['rpm', 'audio/x-pn-realaudio-plugin'],\n ['rpss', 'application/vnd.nokia.radio-presets'],\n ['rpst', 'application/vnd.nokia.radio-preset'],\n ['rq', 'application/sparql-query'],\n ['rs', 'application/rls-services+xml'],\n ['rsd', 'application/rsd+xml'],\n ['rt', ['text/richtext', 'text/vnd.rn-realtext']],\n ['rtf', ['application/rtf', 'text/richtext', 'application/x-rtf']],\n ['rtx', ['text/richtext', 'application/rtf']],\n ['rv', 'video/vnd.rn-realvideo'],\n ['s', 'text/x-asm'],\n ['s3m', 'audio/s3m'],\n ['saf', 'application/vnd.yamaha.smaf-audio'],\n ['saveme', 'application/octet-stream'],\n ['sbk', 'application/x-tbook'],\n ['sbml', 'application/sbml+xml'],\n ['sc', 'application/vnd.ibm.secure-container'],\n ['scd', 'application/x-msschedule'],\n ['scm', ['application/vnd.lotus-screencam', 'video/x-scm', 'text/x-script.guile', 'application/x-lotusscreencam', 'text/x-script.scheme']],\n ['scq', 'application/scvp-cv-request'],\n ['scs', 'application/scvp-cv-response'],\n ['sct', 'text/scriptlet'],\n ['scurl', 'text/vnd.curl.scurl'],\n ['sda', 'application/vnd.stardivision.draw'],\n ['sdc', 'application/vnd.stardivision.calc'],\n ['sdd', 'application/vnd.stardivision.impress'],\n ['sdkm', 'application/vnd.solent.sdkm+xml'],\n ['sdml', 'text/plain'],\n ['sdp', ['application/sdp', 'application/x-sdp']],\n ['sdr', 'application/sounder'],\n ['sdw', 'application/vnd.stardivision.writer'],\n ['sea', ['application/sea', 'application/x-sea']],\n ['see', 'application/vnd.seemail'],\n ['seed', 'application/vnd.fdsn.seed'],\n ['sema', 'application/vnd.sema'],\n ['semd', 'application/vnd.semd'],\n ['semf', 'application/vnd.semf'],\n ['ser', 'application/java-serialized-object'],\n ['set', 'application/set'],\n ['setpay', 'application/set-payment-initiation'],\n ['setreg', 'application/set-registration-initiation'],\n ['sfd-hdstx', 'application/vnd.hydrostatix.sof-data'],\n ['sfs', 'application/vnd.spotfire.sfs'],\n ['sgl', 'application/vnd.stardivision.writer-global'],\n ['sgm', ['text/sgml', 'text/x-sgml']],\n ['sgml', ['text/sgml', 'text/x-sgml']],\n ['sh', ['application/x-shar', 'application/x-bsh', 'application/x-sh', 'text/x-script.sh']],\n ['shar', ['application/x-bsh', 'application/x-shar']],\n ['shf', 'application/shf+xml'],\n ['shtml', ['text/html', 'text/x-server-parsed-html']],\n ['sid', 'audio/x-psid'],\n ['sis', 'application/vnd.symbian.install'],\n ['sit', ['application/x-stuffit', 'application/x-sit']],\n ['sitx', 'application/x-stuffitx'],\n ['skd', 'application/x-koan'],\n ['skm', 'application/x-koan'],\n ['skp', ['application/vnd.koan', 'application/x-koan']],\n ['skt', 'application/x-koan'],\n ['sl', 'application/x-seelogo'],\n ['sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12'],\n ['sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide'],\n ['slt', 'application/vnd.epson.salt'],\n ['sm', 'application/vnd.stepmania.stepchart'],\n ['smf', 'application/vnd.stardivision.math'],\n ['smi', ['application/smil', 'application/smil+xml']],\n ['smil', 'application/smil'],\n ['snd', ['audio/basic', 'audio/x-adpcm']],\n ['snf', 'application/x-font-snf'],\n ['sol', 'application/solids'],\n ['spc', ['text/x-speech', 'application/x-pkcs7-certificates']],\n ['spf', 'application/vnd.yamaha.smaf-phrase'],\n ['spl', ['application/futuresplash', 'application/x-futuresplash']],\n ['spot', 'text/vnd.in3d.spot'],\n ['spp', 'application/scvp-vp-response'],\n ['spq', 'application/scvp-vp-request'],\n ['spr', 'application/x-sprite'],\n ['sprite', 'application/x-sprite'],\n ['src', 'application/x-wais-source'],\n ['sru', 'application/sru+xml'],\n ['srx', 'application/sparql-results+xml'],\n ['sse', 'application/vnd.kodak-descriptor'],\n ['ssf', 'application/vnd.epson.ssf'],\n ['ssi', 'text/x-server-parsed-html'],\n ['ssm', 'application/streamingmedia'],\n ['ssml', 'application/ssml+xml'],\n ['sst', ['application/vnd.ms-pkicertstore', 'application/vnd.ms-pki.certstore']],\n ['st', 'application/vnd.sailingtracker.track'],\n ['stc', 'application/vnd.sun.xml.calc.template'],\n ['std', 'application/vnd.sun.xml.draw.template'],\n ['step', 'application/step'],\n ['stf', 'application/vnd.wt.stf'],\n ['sti', 'application/vnd.sun.xml.impress.template'],\n ['stk', 'application/hyperstudio'],\n ['stl', ['application/vnd.ms-pkistl', 'application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle']],\n ['stm', 'text/html'],\n ['stp', 'application/step'],\n ['str', 'application/vnd.pg.format'],\n ['stw', 'application/vnd.sun.xml.writer.template'],\n ['sub', 'image/vnd.dvb.subtitle'],\n ['sus', 'application/vnd.sus-calendar'],\n ['sv4cpio', 'application/x-sv4cpio'],\n ['sv4crc', 'application/x-sv4crc'],\n ['svc', 'application/vnd.dvb.service'],\n ['svd', 'application/vnd.svd'],\n ['svf', ['image/vnd.dwg', 'image/x-dwg']],\n ['svg', 'image/svg+xml'],\n ['svr', ['x-world/x-svr', 'application/x-world']],\n ['swf', 'application/x-shockwave-flash'],\n ['swi', 'application/vnd.aristanetworks.swi'],\n ['sxc', 'application/vnd.sun.xml.calc'],\n ['sxd', 'application/vnd.sun.xml.draw'],\n ['sxg', 'application/vnd.sun.xml.writer.global'],\n ['sxi', 'application/vnd.sun.xml.impress'],\n ['sxm', 'application/vnd.sun.xml.math'],\n ['sxw', 'application/vnd.sun.xml.writer'],\n ['t', ['text/troff', 'application/x-troff']],\n ['talk', 'text/x-speech'],\n ['tao', 'application/vnd.tao.intent-module-archive'],\n ['tar', 'application/x-tar'],\n ['tbk', ['application/toolbook', 'application/x-tbook']],\n ['tcap', 'application/vnd.3gpp2.tcap'],\n ['tcl', ['text/x-script.tcl', 'application/x-tcl']],\n ['tcsh', 'text/x-script.tcsh'],\n ['teacher', 'application/vnd.smart.teacher'],\n ['tei', 'application/tei+xml'],\n ['tex', 'application/x-tex'],\n ['texi', 'application/x-texinfo'],\n ['texinfo', 'application/x-texinfo'],\n ['text', ['application/plain', 'text/plain']],\n ['tfi', 'application/thraud+xml'],\n ['tfm', 'application/x-tex-tfm'],\n ['tgz', ['application/gnutar', 'application/x-compressed']],\n ['thmx', 'application/vnd.ms-officetheme'],\n ['tif', ['image/tiff', 'image/x-tiff']],\n ['tiff', ['image/tiff', 'image/x-tiff']],\n ['tmo', 'application/vnd.tmobile-livetv'],\n ['torrent', 'application/x-bittorrent'],\n ['tpl', 'application/vnd.groove-tool-template'],\n ['tpt', 'application/vnd.trid.tpt'],\n ['tr', 'application/x-troff'],\n ['tra', 'application/vnd.trueapp'],\n ['trm', 'application/x-msterminal'],\n ['tsd', 'application/timestamped-data'],\n ['tsi', 'audio/tsp-audio'],\n ['tsp', ['application/dsptype', 'audio/tsplayer']],\n ['tsv', 'text/tab-separated-values'],\n ['ttf', 'application/x-font-ttf'],\n ['ttl', 'text/turtle'],\n ['turbot', 'image/florian'],\n ['twd', 'application/vnd.simtech-mindmapper'],\n ['txd', 'application/vnd.genomatix.tuxedo'],\n ['txf', 'application/vnd.mobius.txf'],\n ['txt', 'text/plain'],\n ['ufd', 'application/vnd.ufdl'],\n ['uil', 'text/x-uil'],\n ['uls', 'text/iuls'],\n ['umj', 'application/vnd.umajin'],\n ['uni', 'text/uri-list'],\n ['unis', 'text/uri-list'],\n ['unityweb', 'application/vnd.unity'],\n ['unv', 'application/i-deas'],\n ['uoml', 'application/vnd.uoml+xml'],\n ['uri', 'text/uri-list'],\n ['uris', 'text/uri-list'],\n ['ustar', ['application/x-ustar', 'multipart/x-ustar']],\n ['utz', 'application/vnd.uiq.theme'],\n ['uu', ['application/octet-stream', 'text/x-uuencode']],\n ['uue', 'text/x-uuencode'],\n ['uva', 'audio/vnd.dece.audio'],\n ['uvh', 'video/vnd.dece.hd'],\n ['uvi', 'image/vnd.dece.graphic'],\n ['uvm', 'video/vnd.dece.mobile'],\n ['uvp', 'video/vnd.dece.pd'],\n ['uvs', 'video/vnd.dece.sd'],\n ['uvu', 'video/vnd.uvvu.mp4'],\n ['uvv', 'video/vnd.dece.video'],\n ['vcd', 'application/x-cdlink'],\n ['vcf', 'text/x-vcard'],\n ['vcg', 'application/vnd.groove-vcard'],\n ['vcs', 'text/x-vcalendar'],\n ['vcx', 'application/vnd.vcx'],\n ['vda', 'application/vda'],\n ['vdo', 'video/vdo'],\n ['vew', 'application/groupwise'],\n ['vis', 'application/vnd.visionary'],\n ['viv', ['video/vivo', 'video/vnd.vivo']],\n ['vivo', ['video/vivo', 'video/vnd.vivo']],\n ['vmd', 'application/vocaltec-media-desc'],\n ['vmf', 'application/vocaltec-media-file'],\n ['voc', ['audio/voc', 'audio/x-voc']],\n ['vos', 'video/vosaic'],\n ['vox', 'audio/voxware'],\n ['vqe', 'audio/x-twinvq-plugin'],\n ['vqf', 'audio/x-twinvq'],\n ['vql', 'audio/x-twinvq-plugin'],\n ['vrml', ['model/vrml', 'x-world/x-vrml', 'application/x-vrml']],\n ['vrt', 'x-world/x-vrt'],\n ['vsd', ['application/vnd.visio', 'application/x-visio']],\n ['vsf', 'application/vnd.vsf'],\n ['vst', 'application/x-visio'],\n ['vsw', 'application/x-visio'],\n ['vtu', 'model/vnd.vtu'],\n ['vxml', 'application/voicexml+xml'],\n ['w60', 'application/wordperfect6.0'],\n ['w61', 'application/wordperfect6.1'],\n ['w6w', 'application/msword'],\n ['wad', 'application/x-doom'],\n ['wav', ['audio/wav', 'audio/x-wav']],\n ['wax', 'audio/x-ms-wax'],\n ['wb1', 'application/x-qpro'],\n ['wbmp', 'image/vnd.wap.wbmp'],\n ['wbs', 'application/vnd.criticaltools.wbs+xml'],\n ['wbxml', 'application/vnd.wap.wbxml'],\n ['wcm', 'application/vnd.ms-works'],\n ['wdb', 'application/vnd.ms-works'],\n ['web', 'application/vnd.xara'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['wg', 'application/vnd.pmi.widget'],\n ['wgt', 'application/widget'],\n ['wiz', 'application/msword'],\n ['wk1', 'application/x-123'],\n ['wks', 'application/vnd.ms-works'],\n ['wm', 'video/x-ms-wm'],\n ['wma', 'audio/x-ms-wma'],\n ['wmd', 'application/x-ms-wmd'],\n ['wmf', ['windows/metafile', 'application/x-msmetafile']],\n ['wml', 'text/vnd.wap.wml'],\n ['wmlc', 'application/vnd.wap.wmlc'],\n ['wmls', 'text/vnd.wap.wmlscript'],\n ['wmlsc', 'application/vnd.wap.wmlscriptc'],\n ['wmv', 'video/x-ms-wmv'],\n ['wmx', 'video/x-ms-wmx'],\n ['wmz', 'application/x-ms-wmz'],\n ['woff', 'application/x-font-woff'],\n ['word', 'application/msword'],\n ['wp', 'application/wordperfect'],\n ['wp5', ['application/wordperfect', 'application/wordperfect6.0']],\n ['wp6', 'application/wordperfect'],\n ['wpd', ['application/wordperfect', 'application/vnd.wordperfect', 'application/x-wpwin']],\n ['wpl', 'application/vnd.ms-wpl'],\n ['wps', 'application/vnd.ms-works'],\n ['wq1', 'application/x-lotus'],\n ['wqd', 'application/vnd.wqd'],\n ['wri', ['application/mswrite', 'application/x-wri', 'application/x-mswrite']],\n ['wrl', ['model/vrml', 'x-world/x-vrml', 'application/x-world']],\n ['wrz', ['model/vrml', 'x-world/x-vrml']],\n ['wsc', 'text/scriplet'],\n ['wsdl', 'application/wsdl+xml'],\n ['wspolicy', 'application/wspolicy+xml'],\n ['wsrc', 'application/x-wais-source'],\n ['wtb', 'application/vnd.webturbo'],\n ['wtk', 'application/x-wintalk'],\n ['wvx', 'video/x-ms-wvx'],\n ['x-png', 'image/png'],\n ['x3d', 'application/vnd.hzn-3d-crossword'],\n ['xaf', 'x-world/x-vrml'],\n ['xap', 'application/x-silverlight-app'],\n ['xar', 'application/vnd.xara'],\n ['xbap', 'application/x-ms-xbap'],\n ['xbd', 'application/vnd.fujixerox.docuworks.binder'],\n ['xbm', ['image/xbm', 'image/x-xbm', 'image/x-xbitmap']],\n ['xdf', 'application/xcap-diff+xml'],\n ['xdm', 'application/vnd.syncml.dm+xml'],\n ['xdp', 'application/vnd.adobe.xdp+xml'],\n ['xdr', 'video/x-amt-demorun'],\n ['xdssc', 'application/dssc+xml'],\n ['xdw', 'application/vnd.fujixerox.docuworks'],\n ['xenc', 'application/xenc+xml'],\n ['xer', 'application/patch-ops-error+xml'],\n ['xfdf', 'application/vnd.adobe.xfdf'],\n ['xfdl', 'application/vnd.xfdl'],\n ['xgz', 'xgl/drawing'],\n ['xhtml', 'application/xhtml+xml'],\n ['xif', 'image/vnd.xiff'],\n ['xl', 'application/excel'],\n ['xla', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlam', 'application/vnd.ms-excel.addin.macroenabled.12'],\n ['xlb', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlc', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xld', ['application/excel', 'application/x-excel']],\n ['xlk', ['application/excel', 'application/x-excel']],\n ['xll', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlm', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xls', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlsb', 'application/vnd.ms-excel.sheet.binary.macroenabled.12'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroenabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xlt', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xltm', 'application/vnd.ms-excel.template.macroenabled.12'],\n ['xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'],\n ['xlv', ['application/excel', 'application/x-excel']],\n ['xlw', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xm', 'audio/xm'],\n ['xml', ['application/xml', 'text/xml', 'application/atom+xml', 'application/rss+xml']],\n ['xmz', 'xgl/movie'],\n ['xo', 'application/vnd.olpc-sugar'],\n ['xof', 'x-world/x-vrml'],\n ['xop', 'application/xop+xml'],\n ['xpi', 'application/x-xpinstall'],\n ['xpix', 'application/x-vnd.ls-xpix'],\n ['xpm', ['image/xpm', 'image/x-xpixmap']],\n ['xpr', 'application/vnd.is-xpr'],\n ['xps', 'application/vnd.ms-xpsdocument'],\n ['xpw', 'application/vnd.intercon.formnet'],\n ['xslt', 'application/xslt+xml'],\n ['xsm', 'application/vnd.syncml+xml'],\n ['xspf', 'application/xspf+xml'],\n ['xsr', 'video/x-amt-showrun'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['xwd', ['image/x-xwd', 'image/x-xwindowdump']],\n ['xyz', ['chemical/x-xyz', 'chemical/x-pdb']],\n ['yang', 'application/yang'],\n ['yin', 'application/yin+xml'],\n ['z', ['application/x-compressed', 'application/x-compress']],\n ['zaz', 'application/vnd.zzazz.deck+xml'],\n ['zip', ['application/zip', 'multipart/x-zip', 'application/x-zip-compressed', 'application/x-compressed']],\n ['zir', 'application/vnd.zul'],\n ['zmm', 'application/vnd.handheld-entertainment+xml'],\n ['zoo', 'application/octet-stream'],\n ['zsh', 'text/x-script.zsh']\n]);\n\nmodule.exports = {\n detectMimeType(filename) {\n if (!filename) {\n return defaultMimeType;\n }\n\n let parsed = path.parse(filename);\n let extension = (parsed.ext.substr(1) || parsed.name || '').split('?').shift().trim().toLowerCase();\n let value = defaultMimeType;\n\n if (extensions.has(extension)) {\n value = extensions.get(extension);\n }\n\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n },\n\n detectExtension(mimeType) {\n if (!mimeType) {\n return defaultExtension;\n }\n let parts = (mimeType || '').toLowerCase().trim().split('/');\n let rootType = parts.shift().trim();\n let subType = parts.join('/').trim();\n\n if (mimeTypes.has(rootType + '/' + subType)) {\n let value = mimeTypes.get(rootType + '/' + subType);\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n }\n\n switch (rootType) {\n case 'text':\n return 'txt';\n default:\n return 'bin';\n }\n }\n};\n","/* eslint no-undefined: 0, prefer-spread: 0, no-control-regex: 0 */\n\n'use strict';\n\nconst crypto = require('crypto');\nconst fs = require('fs');\nconst punycode = require('punycode');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\nconst mimeFuncs = require('../mime-funcs');\nconst qp = require('../qp');\nconst base64 = require('../base64');\nconst addressparser = require('../addressparser');\nconst nmfetch = require('../fetch');\nconst LastNewline = require('./last-newline');\n\nconst LeWindows = require('./le-windows');\nconst LeUnix = require('./le-unix');\n\n/**\n * Creates a new mime tree node. Assumes 'multipart/*' as the content type\n * if it is a branch, anything else counts as leaf. If rootNode is missing from\n * the options, assumes this is the root.\n *\n * @param {String} contentType Define the content type for the node. Can be left blank for attachments (derived from filename)\n * @param {Object} [options] optional options\n * @param {Object} [options.rootNode] root node for this tree\n * @param {Object} [options.parentNode] immediate parent for this node\n * @param {Object} [options.filename] filename for an attachment node\n * @param {String} [options.baseBoundary] shared part of the unique multipart boundary\n * @param {Boolean} [options.keepBcc] If true, do not exclude Bcc from the generated headers\n * @param {Function} [options.normalizeHeaderKey] method to normalize header keys for custom caseing\n * @param {String} [options.textEncoding] either 'Q' (the default) or 'B'\n */\nclass MimeNode {\n constructor(contentType, options) {\n this.nodeCounter = 0;\n\n options = options || {};\n\n /**\n * shared part of the unique multipart boundary\n */\n this.baseBoundary = options.baseBoundary || crypto.randomBytes(8).toString('hex');\n this.boundaryPrefix = options.boundaryPrefix || '--_NmP';\n\n this.disableFileAccess = !!options.disableFileAccess;\n this.disableUrlAccess = !!options.disableUrlAccess;\n\n this.normalizeHeaderKey = options.normalizeHeaderKey;\n\n /**\n * If date headers is missing and current node is the root, this value is used instead\n */\n this.date = new Date();\n\n /**\n * Root node for current mime tree\n */\n this.rootNode = options.rootNode || this;\n\n /**\n * If true include Bcc in generated headers (if available)\n */\n this.keepBcc = !!options.keepBcc;\n\n /**\n * If filename is specified but contentType is not (probably an attachment)\n * detect the content type from filename extension\n */\n if (options.filename) {\n /**\n * Filename for this node. Useful with attachments\n */\n this.filename = options.filename;\n if (!contentType) {\n contentType = mimeFuncs.detectMimeType(this.filename.split('.').pop());\n }\n }\n\n /**\n * Indicates which encoding should be used for header strings: \"Q\" or \"B\"\n */\n this.textEncoding = (options.textEncoding || '').toString().trim().charAt(0).toUpperCase();\n\n /**\n * Immediate parent for this node (or undefined if not set)\n */\n this.parentNode = options.parentNode;\n\n /**\n * Hostname for default message-id values\n */\n this.hostname = options.hostname;\n\n /**\n * If set to 'win' then uses \\r\\n, if 'linux' then \\n. If not set (or `raw` is used) then newlines are kept as is.\n */\n this.newline = options.newline;\n\n /**\n * An array for possible child nodes\n */\n this.childNodes = [];\n\n /**\n * Used for generating unique boundaries (prepended to the shared base)\n */\n this._nodeId = ++this.rootNode.nodeCounter;\n\n /**\n * A list of header values for this node in the form of [{key:'', value:''}]\n */\n this._headers = [];\n\n /**\n * True if the content only uses ASCII printable characters\n * @type {Boolean}\n */\n this._isPlainText = false;\n\n /**\n * True if the content is plain text but has longer lines than allowed\n * @type {Boolean}\n */\n this._hasLongLines = false;\n\n /**\n * If set, use instead this value for envelopes instead of generating one\n * @type {Boolean}\n */\n this._envelope = false;\n\n /**\n * If set then use this value as the stream content instead of building it\n * @type {String|Buffer|Stream}\n */\n this._raw = false;\n\n /**\n * Additional transform streams that the message will be piped before\n * exposing by createReadStream\n * @type {Array}\n */\n this._transforms = [];\n\n /**\n * Additional process functions that the message will be piped through before\n * exposing by createReadStream. These functions are run after transforms\n * @type {Array}\n */\n this._processFuncs = [];\n\n /**\n * If content type is set (or derived from the filename) add it to headers\n */\n if (contentType) {\n this.setHeader('Content-Type', contentType);\n }\n }\n\n /////// PUBLIC METHODS\n\n /**\n * Creates and appends a child node.Arguments provided are passed to MimeNode constructor\n *\n * @param {String} [contentType] Optional content type\n * @param {Object} [options] Optional options object\n * @return {Object} Created node object\n */\n createChild(contentType, options) {\n if (!options && typeof contentType === 'object') {\n options = contentType;\n contentType = undefined;\n }\n let node = new MimeNode(contentType, options);\n this.appendChild(node);\n return node;\n }\n\n /**\n * Appends an existing node to the mime tree. Removes the node from an existing\n * tree if needed\n *\n * @param {Object} childNode node to be appended\n * @return {Object} Appended node object\n */\n appendChild(childNode) {\n if (childNode.rootNode !== this.rootNode) {\n childNode.rootNode = this.rootNode;\n childNode._nodeId = ++this.rootNode.nodeCounter;\n }\n\n childNode.parentNode = this;\n\n this.childNodes.push(childNode);\n return childNode;\n }\n\n /**\n * Replaces current node with another node\n *\n * @param {Object} node Replacement node\n * @return {Object} Replacement node\n */\n replace(node) {\n if (node === this) {\n return this;\n }\n\n this.parentNode.childNodes.forEach((childNode, i) => {\n if (childNode === this) {\n node.rootNode = this.rootNode;\n node.parentNode = this.parentNode;\n node._nodeId = this._nodeId;\n\n this.rootNode = this;\n this.parentNode = undefined;\n\n node.parentNode.childNodes[i] = node;\n }\n });\n\n return node;\n }\n\n /**\n * Removes current node from the mime tree\n *\n * @return {Object} removed node\n */\n remove() {\n if (!this.parentNode) {\n return this;\n }\n\n for (let i = this.parentNode.childNodes.length - 1; i >= 0; i--) {\n if (this.parentNode.childNodes[i] === this) {\n this.parentNode.childNodes.splice(i, 1);\n this.parentNode = undefined;\n this.rootNode = this;\n return this;\n }\n }\n }\n\n /**\n * Sets a header value. If the value for selected key exists, it is overwritten.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n setHeader(key, value) {\n let added = false,\n headerValue;\n\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && 'value' in key) {\n this.setHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.setHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.setHeader(i, key[i]);\n });\n }\n return this;\n }\n\n key = this._normalizeHeaderKey(key);\n\n headerValue = {\n key,\n value\n };\n\n // Check if the value exists and overwrite\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n if (!added) {\n // replace the first match\n this._headers[i] = headerValue;\n added = true;\n } else {\n // remove following matches\n this._headers.splice(i, 1);\n i--;\n len--;\n }\n }\n }\n\n // match not found, append the value\n if (!added) {\n this._headers.push(headerValue);\n }\n\n return this;\n }\n\n /**\n * Adds a header value. If the value for selected key exists, the value is appended\n * as a new field and old one is not touched.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n addHeader(key, value) {\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && key.value) {\n this.addHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.addHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.addHeader(i, key[i]);\n });\n }\n return this;\n } else if (Array.isArray(value)) {\n value.forEach(val => {\n this.addHeader(key, val);\n });\n return this;\n }\n\n this._headers.push({\n key: this._normalizeHeaderKey(key),\n value\n });\n\n return this;\n }\n\n /**\n * Retrieves the first mathcing value of a selected key\n *\n * @param {String} key Key to search for\n * @retun {String} Value for the key\n */\n getHeader(key) {\n key = this._normalizeHeaderKey(key);\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n return this._headers[i].value;\n }\n }\n }\n\n /**\n * Sets body content for current node. If the value is a string, charset is added automatically\n * to Content-Type (if it is text/*). If the value is a Buffer, you need to specify\n * the charset yourself\n *\n * @param (String|Buffer) content Body content\n * @return {Object} current node\n */\n setContent(content) {\n this.content = content;\n if (typeof this.content.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this.content.removeListener('error', this._contentErrorHandler);\n this.content = err;\n };\n this.content.once('error', this._contentErrorHandler);\n } else if (typeof this.content === 'string') {\n this._isPlainText = mimeFuncs.isPlainText(this.content);\n if (this._isPlainText && mimeFuncs.hasLongerLines(this.content, 76)) {\n // If there are lines longer than 76 symbols/bytes do not use 7bit\n this._hasLongLines = true;\n }\n }\n return this;\n }\n\n build(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let stream = this.createReadStream();\n let buf = [];\n let buflen = 0;\n let returned = false;\n\n stream.on('readable', () => {\n let chunk;\n\n while ((chunk = stream.read()) !== null) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n\n return callback(err);\n });\n\n stream.once('end', chunk => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (chunk && chunk.length) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n return callback(null, Buffer.concat(buf, buflen));\n });\n\n return promise;\n }\n\n getTransferEncoding() {\n let transferEncoding = false;\n let contentType = (this.getHeader('Content-Type') || '').toString().toLowerCase().trim();\n\n if (this.content) {\n transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '').toString().toLowerCase().trim();\n if (!transferEncoding || !['base64', 'quoted-printable'].includes(transferEncoding)) {\n if (/^text\\//i.test(contentType)) {\n // If there are no special symbols, no need to modify the text\n if (this._isPlainText && !this._hasLongLines) {\n transferEncoding = '7bit';\n } else if (typeof this.content === 'string' || this.content instanceof Buffer) {\n // detect preferred encoding for string value\n transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64';\n } else {\n // we can not check content for a stream, so either use preferred encoding or fallback to QP\n transferEncoding = this.textEncoding === 'B' ? 'base64' : 'quoted-printable';\n }\n } else if (!/^(multipart|message)\\//i.test(contentType)) {\n transferEncoding = transferEncoding || 'base64';\n }\n }\n }\n return transferEncoding;\n }\n\n /**\n * Builds the header block for the mime node. Append \\r\\n\\r\\n before writing the content\n *\n * @returns {String} Headers\n */\n buildHeaders() {\n let transferEncoding = this.getTransferEncoding();\n let headers = [];\n\n if (transferEncoding) {\n this.setHeader('Content-Transfer-Encoding', transferEncoding);\n }\n\n if (this.filename && !this.getHeader('Content-Disposition')) {\n this.setHeader('Content-Disposition', 'attachment');\n }\n\n // Ensure mandatory header fields\n if (this.rootNode === this) {\n if (!this.getHeader('Date')) {\n this.setHeader('Date', this.date.toUTCString().replace(/GMT/, '+0000'));\n }\n\n // ensure that Message-Id is present\n this.messageId();\n\n if (!this.getHeader('MIME-Version')) {\n this.setHeader('MIME-Version', '1.0');\n }\n }\n\n this._headers.forEach(header => {\n let key = header.key;\n let value = header.value;\n let structured;\n let param;\n let options = {};\n let formattedHeaders = ['From', 'Sender', 'To', 'Cc', 'Bcc', 'Reply-To', 'Date', 'References'];\n\n if (value && typeof value === 'object' && !formattedHeaders.includes(key)) {\n Object.keys(value).forEach(key => {\n if (key !== 'value') {\n options[key] = value[key];\n }\n });\n value = (value.value || '').toString();\n if (!value.trim()) {\n return;\n }\n }\n\n if (options.prepared) {\n // header value is\n if (options.foldLines) {\n headers.push(mimeFuncs.foldLines(key + ': ' + value));\n } else {\n headers.push(key + ': ' + value);\n }\n return;\n }\n\n switch (header.key) {\n case 'Content-Disposition':\n structured = mimeFuncs.parseHeaderValue(value);\n if (this.filename) {\n structured.params.filename = this.filename;\n }\n value = mimeFuncs.buildHeaderValue(structured);\n break;\n\n case 'Content-Type':\n structured = mimeFuncs.parseHeaderValue(value);\n\n this._handleContentType(structured);\n\n if (structured.value.match(/^text\\/plain\\b/) && typeof this.content === 'string' && /[\\u0080-\\uFFFF]/.test(this.content)) {\n structured.params.charset = 'utf-8';\n }\n\n value = mimeFuncs.buildHeaderValue(structured);\n\n if (this.filename) {\n // add support for non-compliant clients like QQ webmail\n // we can't build the value with buildHeaderValue as the value is non standard and\n // would be converted to parameter continuation encoding that we do not want\n param = this._encodeWords(this.filename);\n\n if (param !== this.filename || /[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(param)) {\n // include value in quotes if needed\n param = '\"' + param + '\"';\n }\n value += '; name=' + param;\n }\n break;\n\n case 'Bcc':\n if (!this.keepBcc) {\n // skip BCC values\n return;\n }\n break;\n }\n\n value = this._encodeHeaderValue(key, value);\n\n // skip empty lines\n if (!(value || '').toString().trim()) {\n return;\n }\n\n if (typeof this.normalizeHeaderKey === 'function') {\n let normalized = this.normalizeHeaderKey(key, value);\n if (normalized && typeof normalized === 'string' && normalized.length) {\n key = normalized;\n }\n }\n\n headers.push(mimeFuncs.foldLines(key + ': ' + value, 76));\n });\n\n return headers.join('\\r\\n');\n }\n\n /**\n * Streams the rfc2822 message from the current node. If this is a root node,\n * mandatory header fields are set if missing (Date, Message-Id, MIME-Version)\n *\n * @return {String} Compiled message\n */\n createReadStream(options) {\n options = options || {};\n\n let stream = new PassThrough(options);\n let outputStream = stream;\n let transform;\n\n this.stream(stream, options, err => {\n if (err) {\n outputStream.emit('error', err);\n return;\n }\n stream.end();\n });\n\n for (let i = 0, len = this._transforms.length; i < len; i++) {\n transform = typeof this._transforms[i] === 'function' ? this._transforms[i]() : this._transforms[i];\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n }\n\n // ensure terminating newline after possible user transforms\n transform = new LastNewline();\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n\n // dkim and stuff\n for (let i = 0, len = this._processFuncs.length; i < len; i++) {\n transform = this._processFuncs[i];\n outputStream = transform(outputStream);\n }\n\n if (this.newline) {\n const winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes(this.newline.toString().toLowerCase());\n const newlineTransform = winbreak ? new LeWindows() : new LeUnix();\n\n const stream = outputStream.pipe(newlineTransform);\n outputStream.on('error', err => stream.emit('error', err));\n return stream;\n }\n\n return outputStream;\n }\n\n /**\n * Appends a transform stream object to the transforms list. Final output\n * is passed through this stream before exposing\n *\n * @param {Object} transform Read-Write stream\n */\n transform(transform) {\n this._transforms.push(transform);\n }\n\n /**\n * Appends a post process function. The functon is run after transforms and\n * uses the following syntax\n *\n * processFunc(input) -> outputStream\n *\n * @param {Object} processFunc Read-Write stream\n */\n processFunc(processFunc) {\n this._processFuncs.push(processFunc);\n }\n\n stream(outputStream, options, done) {\n let transferEncoding = this.getTransferEncoding();\n let contentStream;\n let localStream;\n\n // protect actual callback against multiple triggering\n let returned = false;\n let callback = err => {\n if (returned) {\n return;\n }\n returned = true;\n done(err);\n };\n\n // for multipart nodes, push child nodes\n // for content nodes end the stream\n let finalize = () => {\n let childId = 0;\n let processChildNode = () => {\n if (childId >= this.childNodes.length) {\n outputStream.write('\\r\\n--' + this.boundary + '--\\r\\n');\n return callback();\n }\n let child = this.childNodes[childId++];\n outputStream.write((childId > 1 ? '\\r\\n' : '') + '--' + this.boundary + '\\r\\n');\n child.stream(outputStream, options, err => {\n if (err) {\n return callback(err);\n }\n setImmediate(processChildNode);\n });\n };\n\n if (this.multipart) {\n setImmediate(processChildNode);\n } else {\n return callback();\n }\n };\n\n // pushes node content\n let sendContent = () => {\n if (this.content) {\n if (Object.prototype.toString.call(this.content) === '[object Error]') {\n // content is already errored\n return callback(this.content);\n }\n\n if (typeof this.content.pipe === 'function') {\n this.content.removeListener('error', this._contentErrorHandler);\n this._contentErrorHandler = err => callback(err);\n this.content.once('error', this._contentErrorHandler);\n }\n\n let createStream = () => {\n if (['quoted-printable', 'base64'].includes(transferEncoding)) {\n contentStream = new (transferEncoding === 'base64' ? base64 : qp).Encoder(options);\n\n contentStream.pipe(outputStream, {\n end: false\n });\n contentStream.once('end', finalize);\n contentStream.once('error', err => callback(err));\n\n localStream = this._getStream(this.content);\n localStream.pipe(contentStream);\n } else {\n // anything that is not QP or Base54 passes as-is\n localStream = this._getStream(this.content);\n localStream.pipe(outputStream, {\n end: false\n });\n localStream.once('end', finalize);\n }\n\n localStream.once('error', err => callback(err));\n };\n\n if (this.content._resolve) {\n let chunks = [];\n let chunklen = 0;\n let returned = false;\n let sourceStream = this._getStream(this.content);\n sourceStream.on('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(err);\n });\n sourceStream.on('readable', () => {\n let chunk;\n while ((chunk = sourceStream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n sourceStream.on('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n this.content._resolve = false;\n this.content._resolvedValue = Buffer.concat(chunks, chunklen);\n setImmediate(createStream);\n });\n } else {\n setImmediate(createStream);\n }\n return;\n } else {\n return setImmediate(finalize);\n }\n };\n\n if (this._raw) {\n setImmediate(() => {\n if (Object.prototype.toString.call(this._raw) === '[object Error]') {\n // content is already errored\n return callback(this._raw);\n }\n\n // remove default error handler (if set)\n if (typeof this._raw.pipe === 'function') {\n this._raw.removeListener('error', this._contentErrorHandler);\n }\n\n let raw = this._getStream(this._raw);\n raw.pipe(outputStream, {\n end: false\n });\n raw.on('error', err => outputStream.emit('error', err));\n raw.on('end', finalize);\n });\n } else {\n outputStream.write(this.buildHeaders() + '\\r\\n\\r\\n');\n setImmediate(sendContent);\n }\n }\n\n /**\n * Sets envelope to be used instead of the generated one\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n setEnvelope(envelope) {\n let list;\n\n this._envelope = {\n from: false,\n to: []\n };\n\n if (envelope.from) {\n list = [];\n this._convertAddresses(this._parseAddresses(envelope.from), list);\n list = list.filter(address => address && address.address);\n if (list.length && list[0]) {\n this._envelope.from = list[0].address;\n }\n }\n ['to', 'cc', 'bcc'].forEach(key => {\n if (envelope[key]) {\n this._convertAddresses(this._parseAddresses(envelope[key]), this._envelope.to);\n }\n });\n\n this._envelope.to = this._envelope.to.map(to => to.address).filter(address => address);\n\n let standardFields = ['to', 'cc', 'bcc', 'from'];\n Object.keys(envelope).forEach(key => {\n if (!standardFields.includes(key)) {\n this._envelope[key] = envelope[key];\n }\n });\n\n return this;\n }\n\n /**\n * Generates and returns an object with parsed address fields\n *\n * @return {Object} Address object\n */\n getAddresses() {\n let addresses = {};\n\n this._headers.forEach(header => {\n let key = header.key.toLowerCase();\n if (['from', 'sender', 'reply-to', 'to', 'cc', 'bcc'].includes(key)) {\n if (!Array.isArray(addresses[key])) {\n addresses[key] = [];\n }\n\n this._convertAddresses(this._parseAddresses(header.value), addresses[key]);\n }\n });\n\n return addresses;\n }\n\n /**\n * Generates and returns SMTP envelope with the sender address and a list of recipients addresses\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n getEnvelope() {\n if (this._envelope) {\n return this._envelope;\n }\n\n let envelope = {\n from: false,\n to: []\n };\n this._headers.forEach(header => {\n let list = [];\n if (header.key === 'From' || (!envelope.from && ['Reply-To', 'Sender'].includes(header.key))) {\n this._convertAddresses(this._parseAddresses(header.value), list);\n if (list.length && list[0]) {\n envelope.from = list[0].address;\n }\n } else if (['To', 'Cc', 'Bcc'].includes(header.key)) {\n this._convertAddresses(this._parseAddresses(header.value), envelope.to);\n }\n });\n\n envelope.to = envelope.to.map(to => to.address);\n\n return envelope;\n }\n\n /**\n * Returns Message-Id value. If it does not exist, then creates one\n *\n * @return {String} Message-Id value\n */\n messageId() {\n let messageId = this.getHeader('Message-ID');\n // You really should define your own Message-Id field!\n if (!messageId) {\n messageId = this._generateMessageId();\n this.setHeader('Message-ID', messageId);\n }\n return messageId;\n }\n\n /**\n * Sets pregenerated content that will be used as the output of this node\n *\n * @param {String|Buffer|Stream} Raw MIME contents\n */\n setRaw(raw) {\n this._raw = raw;\n\n if (this._raw && typeof this._raw.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this._raw.removeListener('error', this._contentErrorHandler);\n this._raw = err;\n };\n this._raw.once('error', this._contentErrorHandler);\n }\n\n return this;\n }\n\n /////// PRIVATE METHODS\n\n /**\n * Detects and returns handle to a stream related with the content.\n *\n * @param {Mixed} content Node content\n * @returns {Object} Stream object\n */\n _getStream(content) {\n let contentStream;\n\n if (content._resolvedValue) {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n setImmediate(() => contentStream.end(content._resolvedValue));\n return contentStream;\n } else if (typeof content.pipe === 'function') {\n // assume as stream\n return content;\n } else if (content && typeof content.path === 'string' && !content.href) {\n if (this.disableFileAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('File access rejected for ' + content.path)));\n return contentStream;\n }\n // read file\n return fs.createReadStream(content.path);\n } else if (content && typeof content.href === 'string') {\n if (this.disableUrlAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('Url access rejected for ' + content.href)));\n return contentStream;\n }\n // fetch URL\n return nmfetch(content.href, { headers: content.httpHeaders });\n } else {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n setImmediate(() => contentStream.end(content || ''));\n return contentStream;\n }\n }\n\n /**\n * Parses addresses. Takes in a single address or an array or an\n * array of address arrays (eg. To: [[first group], [second group],...])\n *\n * @param {Mixed} addresses Addresses to be parsed\n * @return {Array} An array of address objects\n */\n _parseAddresses(addresses) {\n return [].concat.apply(\n [],\n [].concat(addresses).map(address => {\n // eslint-disable-line prefer-spread\n if (address && address.address) {\n address.address = this._normalizeAddress(address.address);\n address.name = address.name || '';\n return [address];\n }\n return addressparser(address);\n })\n );\n }\n\n /**\n * Normalizes a header key, uses Camel-Case form, except for uppercase MIME-\n *\n * @param {String} key Key to be normalized\n * @return {String} key in Camel-Case form\n */\n _normalizeHeaderKey(key) {\n key = (key || '')\n .toString()\n // no newlines in keys\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim()\n .toLowerCase()\n // use uppercase words, except MIME\n .replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())\n // special case\n .replace(/^Content-Features$/i, 'Content-features');\n\n return key;\n }\n\n /**\n * Checks if the content type is multipart and defines boundary if needed.\n * Doesn't return anything, modifies object argument instead.\n *\n * @param {Object} structured Parsed header value for 'Content-Type' key\n */\n _handleContentType(structured) {\n this.contentType = structured.value.trim().toLowerCase();\n\n this.multipart = /^multipart\\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;\n\n if (this.multipart) {\n this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary();\n } else {\n this.boundary = false;\n }\n }\n\n /**\n * Generates a multipart boundary value\n *\n * @return {String} boundary value\n */\n _generateBoundary() {\n return this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary + '-Part_' + this._nodeId;\n }\n\n /**\n * Encodes a header value for use in the generated rfc2822 email.\n *\n * @param {String} key Header key\n * @param {String} value Header value\n */\n _encodeHeaderValue(key, value) {\n key = this._normalizeHeaderKey(key);\n\n switch (key) {\n // Structured headers\n case 'From':\n case 'Sender':\n case 'To':\n case 'Cc':\n case 'Bcc':\n case 'Reply-To':\n return this._convertAddresses(this._parseAddresses(value));\n\n // values enclosed in <>\n case 'Message-ID':\n case 'In-Reply-To':\n case 'Content-Id':\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n if (value.charAt(0) !== '<') {\n value = '<' + value;\n }\n\n if (value.charAt(value.length - 1) !== '>') {\n value = value + '>';\n }\n return value;\n\n // space separated list of values enclosed in <>\n case 'References':\n value = [].concat\n .apply(\n [],\n [].concat(value || '').map(elm => {\n // eslint-disable-line prefer-spread\n elm = (elm || '')\n .toString()\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim();\n return elm.replace(/<[^>]*>/g, str => str.replace(/\\s/g, '')).split(/\\s+/);\n })\n )\n .map(elm => {\n if (elm.charAt(0) !== '<') {\n elm = '<' + elm;\n }\n if (elm.charAt(elm.length - 1) !== '>') {\n elm = elm + '>';\n }\n return elm;\n });\n\n return value.join(' ').trim();\n\n case 'Date':\n if (Object.prototype.toString.call(value) === '[object Date]') {\n return value.toUTCString().replace(/GMT/, '+0000');\n }\n\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n return this._encodeWords(value);\n\n case 'Content-Type':\n case 'Content-Disposition':\n // if it includes a filename then it is already encoded\n return (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n default:\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n // encodeWords only encodes if needed, otherwise the original string is returned\n return this._encodeWords(value);\n }\n }\n\n /**\n * Rebuilds address object using punycode and other adjustments\n *\n * @param {Array} addresses An array of address objects\n * @param {Array} [uniqueList] An array to be populated with addresses\n * @return {String} address string\n */\n _convertAddresses(addresses, uniqueList) {\n let values = [];\n\n uniqueList = uniqueList || [];\n\n [].concat(addresses || []).forEach(address => {\n if (address.address) {\n address.address = this._normalizeAddress(address.address);\n\n if (!address.name) {\n values.push(address.address.indexOf(' ') >= 0 ? `<${address.address}>` : `${address.address}`);\n } else if (address.name) {\n values.push(`${this._encodeAddressName(address.name)} <${address.address}>`);\n }\n\n if (address.address) {\n if (!uniqueList.filter(a => a.address === address.address).length) {\n uniqueList.push(address);\n }\n }\n } else if (address.group) {\n let groupListAddresses = (address.group.length ? this._convertAddresses(address.group, uniqueList) : '').trim();\n values.push(`${this._encodeAddressName(address.name)}:${groupListAddresses};`);\n }\n });\n\n return values.join(', ');\n }\n\n /**\n * Normalizes an email address\n *\n * @param {Array} address An array of address objects\n * @return {String} address string\n */\n _normalizeAddress(address) {\n address = (address || '')\n .toString()\n .replace(/[\\x00-\\x1F<>]+/g, ' ') // remove unallowed characters\n .trim();\n\n let lastAt = address.lastIndexOf('@');\n if (lastAt < 0) {\n // Bare username\n return address;\n }\n\n let user = address.substr(0, lastAt);\n let domain = address.substr(lastAt + 1);\n\n // Usernames are not touched and are kept as is even if these include unicode\n // Domains are punycoded by default\n // 'jõgeva.ee' will be converted to 'xn--jgeva-dua.ee'\n // non-unicode domains are left as is\n\n let encodedDomain;\n\n try {\n encodedDomain = punycode.toASCII(domain.toLowerCase());\n } catch (err) {\n // keep as is?\n }\n\n if (user.indexOf(' ') >= 0) {\n if (user.charAt(0) !== '\"') {\n user = '\"' + user;\n }\n if (user.substr(-1) !== '\"') {\n user = user + '\"';\n }\n }\n\n return `${user}@${encodedDomain}`;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeAddressName(name) {\n if (!/^[\\w ']*$/.test(name)) {\n if (/^[\\x20-\\x7e]*$/.test(name)) {\n return '\"' + name.replace(/([\\\\\"])/g, '\\\\$1') + '\"';\n } else {\n return mimeFuncs.encodeWord(name, this._getTextEncoding(name), 52);\n }\n }\n return name;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeWords(value) {\n // set encodeAll parameter to true even though it is against the recommendation of RFC2047,\n // by default only words that include non-ascii should be converted into encoded words\n // but some clients (eg. Zimbra) do not handle it properly and remove surrounding whitespace\n return mimeFuncs.encodeWords(value, this._getTextEncoding(value), 52, true);\n }\n\n /**\n * Detects best mime encoding for a text value\n *\n * @param {String} value Value to check for\n * @return {String} either 'Q' or 'B'\n */\n _getTextEncoding(value) {\n value = (value || '').toString();\n\n let encoding = this.textEncoding;\n let latinLen;\n let nonLatinLen;\n\n if (!encoding) {\n // count latin alphabet symbols and 8-bit range symbols + control symbols\n // if there are more latin characters, then use quoted-printable\n // encoding, otherwise use base64\n nonLatinLen = (value.match(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\u0080-\\uFFFF]/g) || []).length; // eslint-disable-line no-control-regex\n latinLen = (value.match(/[a-z]/gi) || []).length;\n // if there are more latin symbols than binary/unicode, then prefer Q, otherwise B\n encoding = nonLatinLen < latinLen ? 'Q' : 'B';\n }\n return encoding;\n }\n\n /**\n * Generates a message id\n *\n * @return {String} Random Message-ID value\n */\n _generateMessageId() {\n return (\n '<' +\n [2, 2, 2, 6].reduce(\n // crux to generate UUID-like random strings\n (prev, len) => prev + '-' + crypto.randomBytes(len).toString('hex'),\n crypto.randomBytes(4).toString('hex')\n ) +\n '@' +\n // try to use the domain of the FROM address or fallback to server hostname\n (this.getEnvelope().from || this.hostname || 'localhost').split('@').pop() +\n '>'\n );\n }\n}\n\nmodule.exports = MimeNode;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\nclass LastNewline extends Transform {\n constructor() {\n super();\n this.lastByte = false;\n }\n\n _transform(chunk, encoding, done) {\n if (chunk.length) {\n this.lastByte = chunk[chunk.length - 1];\n }\n\n this.push(chunk);\n done();\n }\n\n _flush(done) {\n if (this.lastByte === 0x0a) {\n return done();\n }\n if (this.lastByte === 0x0d) {\n this.push(Buffer.from('\\n'));\n return done();\n }\n this.push(Buffer.from('\\r\\n'));\n return done();\n }\n}\n\nmodule.exports = LastNewline;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only is used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0d) {\n // \\n\n buf = chunk.slice(lastPos, i);\n lastPos = i + 1;\n this.push(buf);\n }\n }\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0a) {\n // \\n\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n this.push(buf);\n }\n this.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","'use strict';\n\nconst Mailer = require('./mailer');\nconst shared = require('./shared');\nconst SMTPPool = require('./smtp-pool');\nconst SMTPTransport = require('./smtp-transport');\nconst SendmailTransport = require('./sendmail-transport');\nconst StreamTransport = require('./stream-transport');\nconst JSONTransport = require('./json-transport');\nconst SESTransport = require('./ses-transport');\nconst nmfetch = require('./fetch');\nconst packageData = require('../package.json');\n\nconst ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\\/+$/, '');\nconst ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\\/+$/, '');\nconst ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());\n\nlet testAccount = false;\n\nmodule.exports.createTransport = function (transporter, defaults) {\n let urlConfig;\n let options;\n let mailer;\n\n if (\n // provided transporter is a configuration object, not transporter plugin\n (typeof transporter === 'object' && typeof transporter.send !== 'function') ||\n // provided transporter looks like a connection url\n (typeof transporter === 'string' && /^(smtps?|direct):/i.test(transporter))\n ) {\n if ((urlConfig = typeof transporter === 'string' ? transporter : transporter.url)) {\n // parse a configuration URL into configuration options\n options = shared.parseConnectionUrl(urlConfig);\n } else {\n options = transporter;\n }\n\n if (options.pool) {\n transporter = new SMTPPool(options);\n } else if (options.sendmail) {\n transporter = new SendmailTransport(options);\n } else if (options.streamTransport) {\n transporter = new StreamTransport(options);\n } else if (options.jsonTransport) {\n transporter = new JSONTransport(options);\n } else if (options.SES) {\n transporter = new SESTransport(options);\n } else {\n transporter = new SMTPTransport(options);\n }\n }\n\n mailer = new Mailer(transporter, options, defaults);\n\n return mailer;\n};\n\nmodule.exports.createTestAccount = function (apiUrl, callback) {\n let promise;\n\n if (!callback && typeof apiUrl === 'function') {\n callback = apiUrl;\n apiUrl = false;\n }\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (ETHEREAL_CACHE && testAccount) {\n setImmediate(() => callback(null, testAccount));\n return promise;\n }\n\n apiUrl = apiUrl || ETHEREAL_API;\n\n let chunks = [];\n let chunklen = 0;\n\n let req = nmfetch(apiUrl + '/user', {\n contentType: 'application/json',\n method: 'POST',\n body: Buffer.from(\n JSON.stringify({\n requestor: packageData.name,\n version: packageData.version\n })\n )\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => callback(err));\n\n req.once('end', () => {\n let res = Buffer.concat(chunks, chunklen);\n let data;\n let err;\n try {\n data = JSON.parse(res.toString());\n } catch (E) {\n err = E;\n }\n if (err) {\n return callback(err);\n }\n if (data.status !== 'success' || data.error) {\n return callback(new Error(data.error || 'Request failed'));\n }\n delete data.status;\n testAccount = data;\n callback(null, testAccount);\n });\n\n return promise;\n};\n\nmodule.exports.getTestMessageUrl = function (info) {\n if (!info || !info.response) {\n return false;\n }\n\n let infoProps = new Map();\n info.response.replace(/\\[([^\\]]+)\\]$/, (m, props) => {\n props.replace(/\\b([A-Z0-9]+)=([^\\s]+)/g, (m, key, value) => {\n infoProps.set(key, value);\n });\n });\n\n if (infoProps.has('STATUS') && infoProps.has('MSGID')) {\n return (testAccount.web || ETHEREAL_WEB) + '/message/' + infoProps.get('MSGID');\n }\n\n return false;\n};\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a Quoted-Printable encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} Quoted-Printable encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n // usable characters that do not need encoding\n let ranges = [\n // https://tools.ietf.org/html/rfc2045#section-6.7\n [0x09], // \n [0x0a], // \n [0x0d], // \n [0x20, 0x3c], // !\"#$%&'()*+,-./0123456789:;\n [0x3e, 0x7e] // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\n ];\n let result = '';\n let ord;\n\n for (let i = 0, len = buffer.length; i < len; i++) {\n ord = buffer[i];\n // if the char is in allowed range, then keep as is, unless it is a WS in the end of a line\n if (checkRanges(ord, ranges) && !((ord === 0x20 || ord === 0x09) && (i === len - 1 || buffer[i + 1] === 0x0a || buffer[i + 1] === 0x0d))) {\n result += String.fromCharCode(ord);\n continue;\n }\n result += '=' + (ord < 0x10 ? '0' : '') + ord.toString(16).toUpperCase();\n }\n\n return result;\n}\n\n/**\n * Adds soft line breaks to a Quoted-Printable string\n *\n * @param {String} str Quoted-Printable encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped Quoted-Printable encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let pos = 0;\n let len = str.length;\n let match, code, line;\n let lineMargin = Math.floor(lineLength / 3);\n let result = '';\n\n // insert soft linebreaks where needed\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if ((match = line.match(/\\r\\n/))) {\n line = line.substr(0, match.index + match[0].length);\n result += line;\n pos += line.length;\n continue;\n }\n\n if (line.substr(-1) === '\\n') {\n // nothing to change here\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.substr(-lineMargin).match(/\\n.*?$/))) {\n // truncate to nearest line break\n line = line.substr(0, line.length - (match[0].length - 1));\n result += line;\n pos += line.length;\n continue;\n } else if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \\t.,!?][^ \\t.,!?]*$/))) {\n // truncate to nearest space\n line = line.substr(0, line.length - (match[0].length - 1));\n } else if (line.match(/[=][\\da-f]{0,2}$/i)) {\n // push incomplete encoding sequences to the next line\n if ((match = line.match(/[=][\\da-f]{0,1}$/i))) {\n line = line.substr(0, line.length - match[0].length);\n }\n\n // ensure that utf-8 sequences are not split\n while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\\da-f]{2}){1,4}$/i) && (match = line.match(/[=][\\da-f]{2}$/gi))) {\n code = parseInt(match[0].substr(1, 2), 16);\n if (code < 128) {\n break;\n }\n\n line = line.substr(0, line.length - 3);\n\n if (code >= 0xc0) {\n break;\n }\n }\n }\n\n if (pos + line.length < len && line.substr(-1) !== '\\n') {\n if (line.length === lineLength && line.match(/[=][\\da-f]{2}$/i)) {\n line = line.substr(0, line.length - 3);\n } else if (line.length === lineLength) {\n line = line.substr(0, line.length - 1);\n }\n pos += line.length;\n line += '=\\r\\n';\n } else {\n pos += line.length;\n }\n\n result += line;\n }\n\n return result;\n}\n\n/**\n * Helper function to check if a number is inside provided ranges\n *\n * @param {Number} nr Number to check for\n * @param {Array} ranges An Array of allowed values\n * @returns {Boolean} True if the value was found inside allowed ranges, false otherwise\n */\nfunction checkRanges(nr, ranges) {\n for (let i = ranges.length - 1; i >= 0; i--) {\n if (!ranges[i].length) {\n continue;\n }\n if (ranges[i].length === 1 && nr === ranges[i][0]) {\n return true;\n }\n if (ranges[i].length === 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Creates a transform stream for encoding data to Quoted-Printable encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n let qp;\n\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n this.inputBytes += chunk.length;\n\n if (this.options.lineLength) {\n qp = this._curLine + encode(chunk);\n qp = wrap(qp, this.options.lineLength);\n qp = qp.replace(/(^|\\n)([^\\n]*)$/, (match, lineBreak, lastLine) => {\n this._curLine = lastLine;\n return lineBreak;\n });\n\n if (qp) {\n this.outputBytes += qp.length;\n this.push(qp);\n }\n } else {\n qp = encode(chunk);\n this.outputBytes += qp.length;\n this.push(qp, 'ascii');\n }\n\n done();\n }\n\n _flush(done) {\n if (this._curLine) {\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","'use strict';\n\nconst spawn = require('child_process').spawn;\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for Sendmail\n *\n * Possible options can be the following:\n *\n * * **path** optional path to sendmail binary\n * * **newline** either 'windows' or 'unix'\n * * **args** an array of arguments for the sendmail binary\n *\n * @constructor\n * @param {Object} optional config parameter for Sendmail\n */\nclass SendmailTransport {\n constructor(options) {\n options = options || {};\n\n // use a reference to spawn for mocking purposes\n this._spawn = spawn;\n\n this.options = options || {};\n\n this.name = 'Sendmail';\n this.version = packageData.version;\n\n this.path = 'sendmail';\n this.args = false;\n this.winbreak = false;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'sendmail'\n });\n\n if (options) {\n if (typeof options === 'string') {\n this.path = options;\n } else if (typeof options === 'object') {\n if (options.path) {\n this.path = options.path;\n }\n if (Array.isArray(options.args)) {\n this.args = options.args;\n }\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n }\n }\n\n /**\n *

Compiles a mailcomposer message and forwards it to handler that sends it.

\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n let args;\n let sendmail;\n let returned;\n\n const hasInvalidAddresses = []\n .concat(envelope.from || [])\n .concat(envelope.to || [])\n .some(addr => /^-/.test(addr));\n if (hasInvalidAddresses) {\n return done(new Error('Can not send mail. Invalid envelope addresses.'));\n }\n\n if (this.args) {\n // force -i to keep single dots\n args = ['-i'].concat(this.args).concat(envelope.to);\n } else {\n args = ['-i'].concat(envelope.from ? ['-f', envelope.from] : []).concat(envelope.to);\n }\n\n let callback = err => {\n if (returned) {\n // ignore any additional responses, already done\n return;\n }\n returned = true;\n if (typeof done === 'function') {\n if (err) {\n return done(err);\n } else {\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n response: 'Messages queued for delivery'\n });\n }\n }\n };\n\n try {\n sendmail = this._spawn(this.path, args);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred while spawning sendmail. %s',\n E.message\n );\n return callback(E);\n }\n\n if (sendmail) {\n sendmail.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred when sending message %s. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n sendmail.once('exit', code => {\n if (!code) {\n return callback();\n }\n let err;\n if (code === 127) {\n err = new Error('Sendmail command not found, process exited with code ' + code);\n } else {\n err = new Error('Sendmail exited with code ' + code);\n }\n\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error sending message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n sendmail.once('close', callback);\n\n sendmail.stdin.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when piping message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let sourceStream = mail.message.createReadStream();\n sourceStream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when generating message %s. %s',\n messageId,\n err.message\n );\n sendmail.kill('SIGINT'); // do not deliver the message\n callback(err);\n });\n\n sourceStream.pipe(sendmail.stdin);\n } else {\n return callback(new Error('sendmail was not found'));\n }\n }\n}\n\nmodule.exports = SendmailTransport;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\nconst LeWindows = require('../mime-node/le-windows');\n\n/**\n * Generates a Transport object for AWS SES\n *\n * Possible options can be the following:\n *\n * * **sendingRate** optional Number specifying how many messages per second should be delivered to SES\n * * **maxConnections** optional Number specifying max number of parallel connections to SES\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass SESTransport extends EventEmitter {\n constructor(options) {\n super();\n options = options || {};\n\n this.options = options || {};\n this.ses = this.options.SES;\n\n this.name = 'SESTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'ses-transport'\n });\n\n // parallel sending connections\n this.maxConnections = Number(this.options.maxConnections) || Infinity;\n this.connections = 0;\n\n // max messages per second\n this.sendingRate = Number(this.options.sendingRate) || Infinity;\n this.sendingRateTTL = null;\n this.rateInterval = 1000; // milliseconds\n this.rateMessages = [];\n\n this.pending = [];\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Schedules a sending of a message\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, callback) {\n if (this.connections >= this.maxConnections) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n if (!this._checkSendingRate()) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n this._send(mail, (...args) => {\n setImmediate(() => callback(...args));\n this._sent();\n });\n }\n\n _checkRatedQueue() {\n if (this.connections >= this.maxConnections || !this._checkSendingRate()) {\n return;\n }\n\n if (!this.pending.length) {\n if (!this.idling) {\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n let next = this.pending.shift();\n this._send(next.mail, (...args) => {\n setImmediate(() => next.callback(...args));\n this._sent();\n });\n }\n\n _checkSendingRate() {\n clearTimeout(this.sendingRateTTL);\n\n let now = Date.now();\n let oldest = false;\n // delete older messages\n for (let i = this.rateMessages.length - 1; i >= 0; i--) {\n if (this.rateMessages[i].ts >= now - this.rateInterval && (!oldest || this.rateMessages[i].ts < oldest)) {\n oldest = this.rateMessages[i].ts;\n }\n\n if (this.rateMessages[i].ts < now - this.rateInterval && !this.rateMessages[i].pending) {\n this.rateMessages.splice(i, 1);\n }\n }\n\n if (this.rateMessages.length < this.sendingRate) {\n return true;\n }\n\n let delay = Math.max(oldest + 1001, now + 20);\n this.sendingRateTTL = setTimeout(() => this._checkRatedQueue(), now - delay);\n\n try {\n this.sendingRateTTL.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n\n return false;\n }\n\n _sent() {\n this.connections--;\n this._checkRatedQueue();\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to SES\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n _send(mail, callback) {\n let statObject = {\n ts: Date.now(),\n pending: true\n };\n this.connections++;\n this.rateMessages.push(statObject);\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let getRawMessage = next => {\n // do not use Message-ID and Date in DKIM signature\n if (!mail.data._dkim) {\n mail.data._dkim = {};\n }\n if (mail.data._dkim.skipFields && typeof mail.data._dkim.skipFields === 'string') {\n mail.data._dkim.skipFields += ':date:message-id';\n } else {\n mail.data._dkim.skipFields = 'date:message-id';\n }\n\n let sourceStream = mail.message.createReadStream();\n let stream = sourceStream.pipe(new LeWindows());\n let chunks = [];\n let chunklen = 0;\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n sourceStream.once('error', err => stream.emit('error', err));\n\n stream.once('error', err => {\n next(err);\n });\n\n stream.once('end', () => next(null, Buffer.concat(chunks, chunklen)));\n };\n\n setImmediate(() =>\n getRawMessage((err, raw) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n return callback(err);\n }\n\n let sesMessage = {\n RawMessage: {\n // required\n Data: raw // required\n },\n Source: envelope.from,\n Destinations: envelope.to\n };\n\n Object.keys(mail.data.ses || {}).forEach(key => {\n sesMessage[key] = mail.data.ses[key];\n });\n\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n let getRegion = cb => {\n if (ses.config && typeof ses.config.region === 'function') {\n // promise\n return ses.config\n .region()\n .then(region => cb(null, region))\n .catch(err => cb(err));\n }\n return cb(null, (ses.config && ses.config.region) || 'us-east-1');\n };\n\n getRegion((err, region) => {\n if (err || !region) {\n region = 'us-east-1';\n }\n\n let sendPromise;\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));\n } else {\n // v2 API\n sendPromise = ses.sendRawEmail(sesMessage).promise();\n }\n\n sendPromise\n .then(data => {\n if (region === 'us-east-1') {\n region = 'email';\n }\n\n statObject.pending = false;\n callback(null, {\n envelope: {\n from: envelope.from,\n to: envelope.to\n },\n messageId: '<' + data.MessageId + (!/@/.test(data.MessageId) ? '@' + region + '.amazonses.com' : '') + '>',\n response: data.MessageId,\n raw\n });\n })\n .catch(err => {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n callback(err);\n });\n });\n })\n );\n }\n\n /**\n * Verifies SES configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n const sesMessage = {\n RawMessage: {\n // required\n Data: 'From: invalid@invalid\\r\\nTo: invalid@invalid\\r\\n Subject: Invalid\\r\\n\\r\\nInvalid'\n },\n Source: 'invalid@invalid',\n Destinations: ['invalid@invalid']\n };\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n const cb = err => {\n if (err && (err.code || err.Code) !== 'InvalidParameterValue') {\n return callback(err);\n }\n return callback(null, true);\n };\n\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sesMessage.RawMessage.Data = Buffer.from(sesMessage.RawMessage.Data);\n ses.send(new aws.SendRawEmailCommand(sesMessage), cb);\n } else {\n // v2 API\n ses.sendRawEmail(sesMessage, cb);\n }\n\n return promise;\n }\n}\n\nmodule.exports = SESTransport;\n","/* eslint no-console: 0 */\n\n'use strict';\n\nconst urllib = require('url');\nconst util = require('util');\nconst fs = require('fs');\nconst nmfetch = require('../fetch');\nconst dns = require('dns');\nconst net = require('net');\nconst os = require('os');\n\nconst DNS_TTL = 5 * 60 * 1000;\n\nlet networkInterfaces;\ntry {\n networkInterfaces = os.networkInterfaces();\n} catch (err) {\n // fails on some systems\n}\n\nmodule.exports.networkInterfaces = networkInterfaces;\n\nconst isFamilySupported = (family, allowInternal) => {\n let networkInterfaces = module.exports.networkInterfaces;\n if (!networkInterfaces) {\n // hope for the best\n return true;\n }\n\n const familySupported =\n // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6\n Object.keys(networkInterfaces)\n .map(key => networkInterfaces[key])\n // crux that replaces .flat() as it is not supported in older Node versions (v10 and older)\n .reduce((acc, val) => acc.concat(val), [])\n .filter(i => !i.internal || allowInternal)\n .filter(i => i.family === 'IPv' + family || i.family === family).length > 0;\n\n return familySupported;\n};\n\nconst resolver = (family, hostname, options, callback) => {\n options = options || {};\n const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces);\n\n if (!familySupported) {\n return callback(null, []);\n }\n\n dns['resolve' + family](hostname, (err, addresses) => {\n if (err) {\n switch (err.code) {\n case dns.NODATA:\n case dns.NOTFOUND:\n case dns.NOTIMP:\n case dns.SERVFAIL:\n case dns.CONNREFUSED:\n case 'EAI_AGAIN':\n return callback(null, []);\n }\n return callback(err);\n }\n return callback(null, Array.isArray(addresses) ? addresses : [].concat(addresses || []));\n });\n};\n\nconst dnsCache = (module.exports.dnsCache = new Map());\n\nconst formatDNSValue = (value, extra) => {\n if (!value) {\n return Object.assign({}, extra || {});\n }\n\n return Object.assign(\n {\n servername: value.servername,\n host:\n !value.addresses || !value.addresses.length\n ? null\n : value.addresses.length === 1\n ? value.addresses[0]\n : value.addresses[Math.floor(Math.random() * value.addresses.length)]\n },\n extra || {}\n );\n};\n\nmodule.exports.resolveHostname = (options, callback) => {\n options = options || {};\n\n if (!options.host && options.servername) {\n options.host = options.servername;\n }\n\n if (!options.host || net.isIP(options.host)) {\n // nothing to do here\n let value = {\n addresses: [options.host],\n servername: options.servername || false\n };\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n let cached;\n if (dnsCache.has(options.host)) {\n cached = dnsCache.get(options.host);\n\n if (!cached.expires || cached.expires >= Date.now()) {\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n }\n\n resolver(4, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n resolver(6, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n try {\n dns.lookup(options.host, { all: true }, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n let address = addresses\n ? addresses\n .filter(addr => isFamilySupported(addr.family))\n .map(addr => addr.address)\n .shift()\n : false;\n\n if (addresses && addresses.length && !address) {\n // there are addresses but none can be used\n let err = new Error(`Can not use IPv${addresses[0].family} addresses with current network`);\n return callback(err);\n }\n\n if (!address && cached) {\n // nothing was found, fallback to cached value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n\n let value = {\n addresses: address ? [address] : [options.host],\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n });\n } catch (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n });\n });\n};\n/**\n * Parses connection url to a structured configuration object\n *\n * @param {String} str Connection url\n * @return {Object} Configuration object\n */\nmodule.exports.parseConnectionUrl = str => {\n str = str || '';\n let options = {};\n\n [urllib.parse(str, true)].forEach(url => {\n let auth;\n\n switch (url.protocol) {\n case 'smtp:':\n options.secure = false;\n break;\n case 'smtps:':\n options.secure = true;\n break;\n case 'direct:':\n options.direct = true;\n break;\n }\n\n if (!isNaN(url.port) && Number(url.port)) {\n options.port = Number(url.port);\n }\n\n if (url.hostname) {\n options.host = url.hostname;\n }\n\n if (url.auth) {\n auth = url.auth.split(':');\n\n if (!options.auth) {\n options.auth = {};\n }\n\n options.auth.user = auth.shift();\n options.auth.pass = auth.join(':');\n }\n\n Object.keys(url.query || {}).forEach(key => {\n let obj = options;\n let lKey = key;\n let value = url.query[key];\n\n if (!isNaN(value)) {\n value = Number(value);\n }\n\n switch (value) {\n case 'true':\n value = true;\n break;\n case 'false':\n value = false;\n break;\n }\n\n // tls is nested object\n if (key.indexOf('tls.') === 0) {\n lKey = key.substr(4);\n if (!options.tls) {\n options.tls = {};\n }\n obj = options.tls;\n } else if (key.indexOf('.') >= 0) {\n // ignore nested properties besides tls\n return;\n }\n\n if (!(lKey in obj)) {\n obj[lKey] = value;\n }\n });\n });\n\n return options;\n};\n\nmodule.exports._logFunc = (logger, level, defaults, data, message, ...args) => {\n let entry = {};\n\n Object.keys(defaults || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = defaults[key];\n }\n });\n\n Object.keys(data || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = data[key];\n }\n });\n\n logger[level](entry, message, ...args);\n};\n\n/**\n * Returns a bunyan-compatible logger interface. Uses either provided logger or\n * creates a default console logger\n *\n * @param {Object} [options] Options object that might include 'logger' value\n * @return {Object} bunyan compatible logger\n */\nmodule.exports.getLogger = (options, defaults) => {\n options = options || {};\n\n let response = {};\n let levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];\n\n if (!options.logger) {\n // use vanity logger\n levels.forEach(level => {\n response[level] = () => false;\n });\n return response;\n }\n\n let logger = options.logger;\n\n if (options.logger === true) {\n // create console logger\n logger = createDefaultLogger(levels);\n }\n\n levels.forEach(level => {\n response[level] = (data, message, ...args) => {\n module.exports._logFunc(logger, level, defaults, data, message, ...args);\n };\n });\n\n return response;\n};\n\n/**\n * Wrapper for creating a callback that either resolves or rejects a promise\n * based on input\n *\n * @param {Function} resolve Function to run if callback is called\n * @param {Function} reject Function to run if callback ends with an error\n */\nmodule.exports.callbackPromise = (resolve, reject) =>\n function () {\n let args = Array.from(arguments);\n let err = args.shift();\n if (err) {\n reject(err);\n } else {\n resolve(...args);\n }\n };\n\n/**\n * Resolves a String or a Buffer value for content value. Useful if the value\n * is a Stream or a file or an URL. If the value is a Stream, overwrites\n * the stream object with the resolved value (you can't stream a value twice).\n *\n * This is useful when you want to create a plugin that needs a content value,\n * for example the `html` or `text` value as a String or a Buffer but not as\n * a file path or an URL.\n *\n * @param {Object} data An object or an Array you want to resolve an element for\n * @param {String|Number} key Property name or an Array index\n * @param {Function} callback Callback function with (err, value)\n */\nmodule.exports.resolveContent = (data, key, callback) => {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = module.exports.callbackPromise(resolve, reject);\n });\n }\n\n let content = (data && data[key] && data[key].content) || data[key];\n let contentStream;\n let encoding = ((typeof data[key] === 'object' && data[key].encoding) || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!content) {\n return callback(null, content);\n }\n\n if (typeof content === 'object') {\n if (typeof content.pipe === 'function') {\n return resolveStream(content, (err, value) => {\n if (err) {\n return callback(err);\n }\n // we can't stream twice the same content, so we need\n // to replace the stream object with the streaming result\n if (data[key].content) {\n data[key].content = value;\n } else {\n data[key] = value;\n }\n callback(null, value);\n });\n } else if (/^https?:\\/\\//i.test(content.path || content.href)) {\n contentStream = nmfetch(content.path || content.href);\n return resolveStream(contentStream, callback);\n } else if (/^data:/i.test(content.path || content.href)) {\n let parts = (content.path || content.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);\n if (!parts) {\n return callback(null, Buffer.from(0));\n }\n return callback(null, /\\bbase64$/i.test(parts[1]) ? Buffer.from(parts[2], 'base64') : Buffer.from(decodeURIComponent(parts[2])));\n } else if (content.path) {\n return resolveStream(fs.createReadStream(content.path), callback);\n }\n }\n\n if (typeof data[key].content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n content = Buffer.from(data[key].content, encoding);\n }\n\n // default action, return as is\n setImmediate(() => callback(null, content));\n\n return promise;\n};\n\n/**\n * Copies properties from source objects to target objects\n */\nmodule.exports.assign = function (/* target, ... sources */) {\n let args = Array.from(arguments);\n let target = args.shift() || {};\n\n args.forEach(source => {\n Object.keys(source || {}).forEach(key => {\n if (['tls', 'auth'].includes(key) && source[key] && typeof source[key] === 'object') {\n // tls and auth are special keys that need to be enumerated separately\n // other objects are passed as is\n if (!target[key]) {\n // ensure that target has this key\n target[key] = {};\n }\n Object.keys(source[key]).forEach(subKey => {\n target[key][subKey] = source[key][subKey];\n });\n } else {\n target[key] = source[key];\n }\n });\n });\n return target;\n};\n\nmodule.exports.encodeXText = str => {\n // ! 0x21\n // + 0x2B\n // = 0x3D\n // ~ 0x7E\n if (!/[^\\x21-\\x2A\\x2C-\\x3C\\x3E-\\x7E]/.test(str)) {\n return str;\n }\n let buf = Buffer.from(str);\n let result = '';\n for (let i = 0, len = buf.length; i < len; i++) {\n let c = buf[i];\n if (c < 0x21 || c > 0x7e || c === 0x2b || c === 0x3d) {\n result += '+' + (c < 0x10 ? '0' : '') + c.toString(16).toUpperCase();\n } else {\n result += String.fromCharCode(c);\n }\n }\n return result;\n};\n\n/**\n * Streams a stream value into a Buffer\n *\n * @param {Object} stream Readable stream\n * @param {Function} callback Callback function with (err, value)\n */\nfunction resolveStream(stream, callback) {\n let responded = false;\n let chunks = [];\n let chunklen = 0;\n\n stream.on('error', err => {\n if (responded) {\n return;\n }\n\n responded = true;\n callback(err);\n });\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.on('end', () => {\n if (responded) {\n return;\n }\n responded = true;\n\n let value;\n\n try {\n value = Buffer.concat(chunks, chunklen);\n } catch (E) {\n return callback(E);\n }\n callback(null, value);\n });\n}\n\n/**\n * Generates a bunyan-like logger that prints to console\n *\n * @returns {Object} Bunyan logger instance\n */\nfunction createDefaultLogger(levels) {\n let levelMaxLen = 0;\n let levelNames = new Map();\n levels.forEach(level => {\n if (level.length > levelMaxLen) {\n levelMaxLen = level.length;\n }\n });\n\n levels.forEach(level => {\n let levelName = level.toUpperCase();\n if (levelName.length < levelMaxLen) {\n levelName += ' '.repeat(levelMaxLen - levelName.length);\n }\n levelNames.set(level, levelName);\n });\n\n let print = (level, entry, message, ...args) => {\n let prefix = '';\n if (entry) {\n if (entry.tnx === 'server') {\n prefix = 'S: ';\n } else if (entry.tnx === 'client') {\n prefix = 'C: ';\n }\n\n if (entry.sid) {\n prefix = '[' + entry.sid + '] ' + prefix;\n }\n\n if (entry.cid) {\n prefix = '[#' + entry.cid + '] ' + prefix;\n }\n }\n\n message = util.format(message, ...args);\n message.split(/\\r?\\n/).forEach(line => {\n console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);\n });\n };\n\n let logger = {};\n levels.forEach(level => {\n logger[level] = print.bind(null, level);\n });\n\n return logger;\n}\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Escapes dots in the beginning of lines. Ends the stream with .\n * Also makes sure that only sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass DataStream extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this._curLine = '';\n\n this.inByteCount = 0;\n this.outByteCount = 0;\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let chunks = [];\n let chunklen = 0;\n let i,\n len,\n lastPos = 0;\n let buf;\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk);\n }\n\n this.inByteCount += chunk.length;\n\n for (i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x2e) {\n // .\n if ((i && chunk[i - 1] === 0x0a) || (!i && (!this.lastByte || this.lastByte === 0x0a))) {\n buf = chunk.slice(lastPos, i + 1);\n chunks.push(buf);\n chunks.push(Buffer.from('.'));\n chunklen += buf.length + 1;\n lastPos = i + 1;\n }\n } else if (chunk[i] === 0x0a) {\n // .\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n chunks.push(buf);\n chunklen += buf.length + 2;\n } else {\n chunklen += 2;\n }\n chunks.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (chunklen) {\n // add last piece\n if (lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n chunks.push(buf);\n chunklen += buf.length;\n }\n\n this.outByteCount += chunklen;\n this.push(Buffer.concat(chunks, chunklen));\n } else {\n this.outByteCount += chunk.length;\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n\n /**\n * Finalizes the stream with a dot on a single line\n */\n _flush(done) {\n let buf;\n if (this.lastByte === 0x0a) {\n buf = Buffer.from('.\\r\\n');\n } else if (this.lastByte === 0x0d) {\n buf = Buffer.from('\\n.\\r\\n');\n } else {\n buf = Buffer.from('\\r\\n.\\r\\n');\n }\n this.outByteCount += buf.length;\n this.push(buf);\n done();\n }\n}\n\nmodule.exports = DataStream;\n","'use strict';\n\n/**\n * Minimal HTTP/S proxy client\n */\n\nconst net = require('net');\nconst tls = require('tls');\nconst urllib = require('url');\n\n/**\n * Establishes proxied connection to destinationPort\n *\n * httpProxyClient(\"http://localhost:3128/\", 80, \"google.com\", function(err, socket){\n * socket.write(\"GET / HTTP/1.0\\r\\n\\r\\n\");\n * });\n *\n * @param {String} proxyUrl proxy configuration, etg \"http://proxy.host:3128/\"\n * @param {Number} destinationPort Port to open in destination host\n * @param {String} destinationHost Destination hostname\n * @param {Function} callback Callback to run with the rocket object once connection is established\n */\nfunction httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {\n let proxy = urllib.parse(proxyUrl);\n\n // create a socket connection to the proxy server\n let options;\n let connect;\n let socket;\n\n options = {\n host: proxy.hostname,\n port: Number(proxy.port) ? Number(proxy.port) : proxy.protocol === 'https:' ? 443 : 80\n };\n\n if (proxy.protocol === 'https:') {\n // we can use untrusted proxies as long as we verify actual SMTP certificates\n options.rejectUnauthorized = false;\n connect = tls.connect.bind(tls);\n } else {\n connect = net.connect.bind(net);\n }\n\n // Error harness for initial connection. Once connection is established, the responsibility\n // to handle errors is passed to whoever uses this socket\n let finished = false;\n let tempSocketErr = err => {\n if (finished) {\n return;\n }\n finished = true;\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n callback(err);\n };\n\n let timeoutErr = () => {\n let err = new Error('Proxy socket timed out');\n err.code = 'ETIMEDOUT';\n tempSocketErr(err);\n };\n\n socket = connect(options, () => {\n if (finished) {\n return;\n }\n\n let reqHeaders = {\n Host: destinationHost + ':' + destinationPort,\n Connection: 'close'\n };\n if (proxy.auth) {\n reqHeaders['Proxy-Authorization'] = 'Basic ' + Buffer.from(proxy.auth).toString('base64');\n }\n\n socket.write(\n // HTTP method\n 'CONNECT ' +\n destinationHost +\n ':' +\n destinationPort +\n ' HTTP/1.1\\r\\n' +\n // HTTP request headers\n Object.keys(reqHeaders)\n .map(key => key + ': ' + reqHeaders[key])\n .join('\\r\\n') +\n // End request\n '\\r\\n\\r\\n'\n );\n\n let headers = '';\n let onSocketData = chunk => {\n let match;\n let remainder;\n\n if (finished) {\n return;\n }\n\n headers += chunk.toString('binary');\n if ((match = headers.match(/\\r\\n\\r\\n/))) {\n socket.removeListener('data', onSocketData);\n\n remainder = headers.substr(match.index + match[0].length);\n headers = headers.substr(0, match.index);\n if (remainder) {\n socket.unshift(Buffer.from(remainder, 'binary'));\n }\n\n // proxy connection is now established\n finished = true;\n\n // check response code\n match = headers.match(/^HTTP\\/\\d+\\.\\d+ (\\d+)/i);\n if (!match || (match[1] || '').charAt(0) !== '2') {\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n return callback(new Error('Invalid response from proxy' + ((match && ': ' + match[1]) || '')));\n }\n\n socket.removeListener('error', tempSocketErr);\n socket.removeListener('timeout', timeoutErr);\n socket.setTimeout(0);\n\n return callback(null, socket);\n }\n };\n socket.on('data', onSocketData);\n });\n\n socket.setTimeout(httpProxyClient.timeout || 30 * 1000);\n socket.on('timeout', timeoutErr);\n\n socket.once('error', tempSocketErr);\n}\n\nmodule.exports = httpProxyClient;\n","'use strict';\n\nconst packageInfo = require('../../package.json');\nconst EventEmitter = require('events').EventEmitter;\nconst net = require('net');\nconst tls = require('tls');\nconst os = require('os');\nconst crypto = require('crypto');\nconst DataStream = require('./data-stream');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\n// default timeout values in ms\nconst CONNECTION_TIMEOUT = 2 * 60 * 1000; // how much to wait for the connection to be established\nconst SOCKET_TIMEOUT = 10 * 60 * 1000; // how much to wait for socket inactivity before disconnecting the client\nconst GREETING_TIMEOUT = 30 * 1000; // how much to wait after connection is established but SMTP greeting is not receieved\n\n/**\n * Generates a SMTP connection object\n *\n * Optional options object takes the following possible properties:\n *\n * * **port** - is the port to connect to (defaults to 587 or 465)\n * * **host** - is the hostname or IP address to connect to (defaults to 'localhost')\n * * **secure** - use SSL\n * * **ignoreTLS** - ignore server support for STARTTLS\n * * **requireTLS** - forces the client to use STARTTLS\n * * **name** - the name of the client server\n * * **localAddress** - outbound address to bind to (see: http://nodejs.org/api/net.html#net_net_connect_options_connectionlistener)\n * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 10000)\n * * **connectionTimeout** - how many milliseconds to wait for the connection to establish\n * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 1 hour)\n * * **lmtp** - if true, uses LMTP instead of SMTP protocol\n * * **logger** - bunyan compatible logger interface\n * * **debug** - if true pass SMTP traffic to the logger\n * * **tls** - options for createCredentials\n * * **socket** - existing socket to use instead of creating a new one (see: http://nodejs.org/api/net.html#net_class_net_socket)\n * * **secured** - boolean indicates that the provided socket has already been upgraded to tls\n *\n * @constructor\n * @namespace SMTP Client module\n * @param {Object} [options] Option properties\n */\nclass SMTPConnection extends EventEmitter {\n constructor(options) {\n super(options);\n\n this.id = crypto.randomBytes(8).toString('base64').replace(/\\W/g, '');\n this.stage = 'init';\n\n this.options = options || {};\n\n this.secureConnection = !!this.options.secure;\n this.alreadySecured = !!this.options.secured;\n\n this.port = Number(this.options.port) || (this.secureConnection ? 465 : 587);\n this.host = this.options.host || 'localhost';\n\n this.allowInternalNetworkInterfaces = this.options.allowInternalNetworkInterfaces || false;\n\n if (typeof this.options.secure === 'undefined' && this.port === 465) {\n // if secure option is not set but port is 465, then default to secure\n this.secureConnection = true;\n }\n\n this.name = this.options.name || this._getHostname();\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-connection',\n sid: this.id\n });\n\n this.customAuth = new Map();\n Object.keys(this.options.customAuth || {}).forEach(key => {\n let mapKey = (key || '').toString().trim().toUpperCase();\n if (!mapKey) {\n return;\n }\n this.customAuth.set(mapKey, this.options.customAuth[key]);\n });\n\n /**\n * Expose version nr, just for the reference\n * @type {String}\n */\n this.version = packageInfo.version;\n\n /**\n * If true, then the user is authenticated\n * @type {Boolean}\n */\n this.authenticated = false;\n\n /**\n * If set to true, this instance is no longer active\n * @private\n */\n this.destroyed = false;\n\n /**\n * Defines if the current connection is secure or not. If not,\n * STARTTLS can be used if available\n * @private\n */\n this.secure = !!this.secureConnection;\n\n /**\n * Store incomplete messages coming from the server\n * @private\n */\n this._remainder = '';\n\n /**\n * Unprocessed responses from the server\n * @type {Array}\n */\n this._responseQueue = [];\n\n this.lastServerResponse = false;\n\n /**\n * The socket connecting to the server\n * @publick\n */\n this._socket = false;\n\n /**\n * Lists supported auth mechanisms\n * @private\n */\n this._supportedAuth = [];\n\n /**\n * Set to true, if EHLO response includes \"AUTH\".\n * If false then authentication is not tried\n */\n this.allowsAuth = false;\n\n /**\n * Includes current envelope (from, to)\n * @private\n */\n this._envelope = false;\n\n /**\n * Lists supported extensions\n * @private\n */\n this._supportedExtensions = [];\n\n /**\n * Defines the maximum allowed size for a single message\n * @private\n */\n this._maxAllowedSize = 0;\n\n /**\n * Function queue to run if a data chunk comes from the server\n * @private\n */\n this._responseActions = [];\n this._recipientQueue = [];\n\n /**\n * Timeout variable for waiting the greeting\n * @private\n */\n this._greetingTimeout = false;\n\n /**\n * Timeout variable for waiting the connection to start\n * @private\n */\n this._connectionTimeout = false;\n\n /**\n * If the socket is deemed already closed\n * @private\n */\n this._destroyed = false;\n\n /**\n * If the socket is already being closed\n * @private\n */\n this._closing = false;\n\n /**\n * Callbacks for socket's listeners\n */\n this._onSocketData = chunk => this._onData(chunk);\n this._onSocketError = error => this._onError(error, 'ESOCKET', false, 'CONN');\n this._onSocketClose = () => this._onClose();\n this._onSocketEnd = () => this._onEnd();\n this._onSocketTimeout = () => this._onTimeout();\n }\n\n /**\n * Creates a connection to a SMTP server and sets up connection\n * listener\n */\n connect(connectCallback) {\n if (typeof connectCallback === 'function') {\n this.once('connect', () => {\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'SMTP handshake finished'\n );\n connectCallback();\n });\n\n const isDestroyedMessage = this._isDestroyedMessage('connect');\n if (isDestroyedMessage) {\n return connectCallback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'CONN'));\n }\n }\n\n let opts = {\n port: this.port,\n host: this.host,\n allowInternalNetworkInterfaces: this.allowInternalNetworkInterfaces\n };\n\n if (this.options.localAddress) {\n opts.localAddress = this.options.localAddress;\n }\n\n let setupConnectionHandlers = () => {\n this._connectionTimeout = setTimeout(() => {\n this._onError('Connection timeout', 'ETIMEDOUT', false, 'CONN');\n }, this.options.connectionTimeout || CONNECTION_TIMEOUT);\n\n this._socket.on('error', this._onSocketError);\n };\n\n if (this.options.connection) {\n // connection is already opened\n this._socket = this.options.connection;\n if (this.secureConnection && !this.alreadySecured) {\n setImmediate(() =>\n this._upgradeConnection(err => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'CONN');\n return;\n }\n this._onConnect();\n })\n );\n } else {\n setImmediate(() => this._onConnect());\n }\n return;\n } else if (this.options.socket) {\n // socket object is set up but not yet connected\n this._socket = this.options.socket;\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket.connect(this.port, this.host, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else if (this.secureConnection) {\n // connect using tls\n if (this.options.tls) {\n Object.keys(this.options.tls).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n }\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = tls.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else {\n // connect using plaintext\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = net.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n }\n }\n\n /**\n * Sends QUIT\n */\n quit() {\n this._sendCommand('QUIT');\n this._responseActions.push(this.close);\n }\n\n /**\n * Closes the connection to the server\n */\n close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }\n\n /**\n * Authenticate user\n */\n login(authData, callback) {\n const isDestroyedMessage = this._isDestroyedMessage('login');\n if (isDestroyedMessage) {\n return callback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n this._auth = authData || {};\n // Select SASL authentication method\n this._authMethod = (this._auth.method || '').toString().trim().toUpperCase() || false;\n\n if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {\n this._authMethod = 'XOAUTH2';\n } else if (!this._authMethod || (this._authMethod === 'XOAUTH2' && !this._auth.oauth2)) {\n // use first supported\n this._authMethod = (this._supportedAuth[0] || 'PLAIN').toUpperCase().trim();\n }\n\n if (this._authMethod !== 'XOAUTH2' && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) {\n if (this._auth.user && this._auth.pass) {\n this._auth.credentials = {\n user: this._auth.user,\n pass: this._auth.pass,\n options: this._auth.options\n };\n } else {\n return callback(this._formatError('Missing credentials for \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n }\n\n if (this.customAuth.has(this._authMethod)) {\n let handler = this.customAuth.get(this._authMethod);\n let lastResponse;\n let returned = false;\n\n let resolve = () => {\n if (returned) {\n return;\n }\n returned = true;\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n };\n\n let reject = err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(this._formatError(err, 'EAUTH', lastResponse, 'AUTH ' + this._authMethod));\n };\n\n let handlerResponse = handler({\n auth: this._auth,\n method: this._authMethod,\n\n extensions: [].concat(this._supportedExtensions),\n authMethods: [].concat(this._supportedAuth),\n maxAllowedSize: this._maxAllowedSize || false,\n\n sendCommand: (cmd, done) => {\n let promise;\n\n if (!done) {\n promise = new Promise((resolve, reject) => {\n done = shared.callbackPromise(resolve, reject);\n });\n }\n\n this._responseActions.push(str => {\n lastResponse = str;\n\n let codes = str.match(/^(\\d+)(?:\\s(\\d+\\.\\d+\\.\\d+))?\\s/);\n let data = {\n command: cmd,\n response: str\n };\n if (codes) {\n data.status = Number(codes[1]) || 0;\n if (codes[2]) {\n data.code = codes[2];\n }\n data.text = str.substr(codes[0].length);\n } else {\n data.text = str;\n data.status = 0; // just in case we need to perform numeric comparisons\n }\n done(null, data);\n });\n setImmediate(() => this._sendCommand(cmd));\n\n return promise;\n },\n\n resolve,\n reject\n });\n\n if (handlerResponse && typeof handlerResponse.catch === 'function') {\n // a promise was returned\n handlerResponse.then(resolve).catch(reject);\n }\n\n return;\n }\n\n switch (this._authMethod) {\n case 'XOAUTH2':\n this._handleXOauth2Token(false, callback);\n return;\n case 'LOGIN':\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_USER(str, callback);\n });\n this._sendCommand('AUTH LOGIN');\n return;\n case 'PLAIN':\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n this._sendCommand(\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n this._auth.credentials.pass,\n 'utf-8'\n ).toString('base64'),\n // log entry without passwords\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n '/* secret */',\n 'utf-8'\n ).toString('base64')\n );\n return;\n case 'CRAM-MD5':\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5(str, callback);\n });\n this._sendCommand('AUTH CRAM-MD5');\n return;\n }\n\n return callback(this._formatError('Unknown authentication method \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n\n /**\n * Sends a message\n *\n * @param {Object} envelope Envelope object, {from: addr, to: [addr]}\n * @param {Object} message String, Buffer or a Stream\n * @param {Function} callback Callback to return once sending is completed\n */\n send(envelope, message, done) {\n if (!message) {\n return done(this._formatError('Empty message', 'EMESSAGE', false, 'API'));\n }\n\n const isDestroyedMessage = this._isDestroyedMessage('send message');\n if (isDestroyedMessage) {\n return done(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n // reject larger messages than allowed\n if (this._maxAllowedSize && envelope.size > this._maxAllowedSize) {\n return setImmediate(() => {\n done(this._formatError('Message size larger than allowed ' + this._maxAllowedSize, 'EMESSAGE', false, 'MAIL FROM'));\n });\n }\n\n // ensure that callback is only called once\n let returned = false;\n let callback = function () {\n if (returned) {\n return;\n }\n returned = true;\n\n done(...arguments);\n };\n\n if (typeof message.on === 'function') {\n message.on('error', err => callback(this._formatError(err, 'ESTREAM', false, 'API')));\n }\n\n let startTime = Date.now();\n this._setEnvelope(envelope, (err, info) => {\n if (err) {\n return callback(err);\n }\n let envelopeTime = Date.now();\n let stream = this._createSendStream((err, str) => {\n if (err) {\n return callback(err);\n }\n\n info.envelopeTime = envelopeTime - startTime;\n info.messageTime = Date.now() - envelopeTime;\n info.messageSize = stream.outByteCount;\n info.response = str;\n\n return callback(null, info);\n });\n if (typeof message.pipe === 'function') {\n message.pipe(stream);\n } else {\n stream.write(message);\n stream.end();\n }\n });\n }\n\n /**\n * Resets connection state\n *\n * @param {Function} callback Callback to return once connection is reset\n */\n reset(callback) {\n this._sendCommand('RSET');\n this._responseActions.push(str => {\n if (str.charAt(0) !== '2') {\n return callback(this._formatError('Could not reset session state. response=' + str, 'EPROTOCOL', str, 'RSET'));\n }\n this._envelope = false;\n return callback(null, true);\n });\n }\n\n /**\n * Connection listener that is run when the connection to\n * the server is opened\n *\n * @event\n */\n _onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }\n\n /**\n * 'data' listener for data coming from the server\n *\n * @event\n * @param {Buffer} chunk Data chunk coming from the server\n */\n _onData(chunk) {\n if (this._destroyed || !chunk || !chunk.length) {\n return;\n }\n\n let data = (chunk || '').toString('binary');\n let lines = (this._remainder + data).split(/\\r?\\n/);\n let lastline;\n\n this._remainder = lines.pop();\n\n for (let i = 0, len = lines.length; i < len; i++) {\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n this._responseQueue[this._responseQueue.length - 1] += '\\n' + lines[i];\n continue;\n }\n }\n this._responseQueue.push(lines[i]);\n }\n\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n return;\n }\n }\n\n this._processResponse();\n }\n\n /**\n * 'error' listener for the socket\n *\n * @event\n * @param {Error} err Error object\n * @param {String} type Error name\n */\n _onError(err, type, data, command) {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n\n if (this._destroyed) {\n // just ignore, already closed\n // this might happen when a socket is canceled because of reached timeout\n // but the socket timeout error itself receives only after\n return;\n }\n\n err = this._formatError(err, type, data, command);\n\n this.logger.error(data, err.message);\n\n this.emit('error', err);\n this.close();\n }\n\n _formatError(message, type, response, command) {\n let err;\n\n if (/Error\\]$/i.test(Object.prototype.toString.call(message))) {\n err = message;\n } else {\n err = new Error(message);\n }\n\n if (type && type !== 'Error') {\n err.code = type;\n }\n\n if (response) {\n err.response = response;\n err.message += ': ' + response;\n }\n\n let responseCode = (typeof response === 'string' && Number((response.match(/^\\d+/) || [])[0])) || false;\n if (responseCode) {\n err.responseCode = responseCode;\n }\n\n if (command) {\n err.command = command;\n }\n\n return err;\n }\n\n /**\n * 'close' listener for the socket\n *\n * @event\n */\n _onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }\n\n /**\n * 'end' listener for the socket\n *\n * @event\n */\n _onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }\n\n /**\n * 'timeout' listener for the socket\n *\n * @event\n */\n _onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }\n\n /**\n * Destroys the client, emits 'end'\n */\n _destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }\n\n /**\n * Upgrades the connection to TLS\n *\n * @param {Function} callback Callback function to run when the connection\n * has been secured\n */\n _upgradeConnection(callback) {\n // do not remove all listeners or it breaks node v0.10 as there's\n // apparently a 'finish' event set that would be cleared as well\n\n // we can safely keep 'error', 'end', 'close' etc. events\n this._socket.removeListener('data', this._onSocketData); // incoming data is going to be gibberish from this point onwards\n this._socket.removeListener('timeout', this._onSocketTimeout); // timeout will be re-set for the new socket object\n\n let socketPlain = this._socket;\n let opts = {\n socket: this._socket,\n host: this.host\n };\n\n Object.keys(this.options.tls || {}).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n\n this.upgrading = true;\n // tls.connect is not an asynchronous function however it may still throw errors and requires to be wrapped with try/catch\n try {\n this._socket = tls.connect(opts, () => {\n this.secure = true;\n this.upgrading = false;\n this._socket.on('data', this._onSocketData);\n\n socketPlain.removeListener('close', this._onSocketClose);\n socketPlain.removeListener('end', this._onSocketEnd);\n\n return callback(null, true);\n });\n } catch (err) {\n return callback(err);\n }\n\n this._socket.on('error', this._onSocketError);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT); // 10 min.\n this._socket.on('timeout', this._onSocketTimeout);\n\n // resume in case the socket was paused\n socketPlain.resume();\n }\n\n /**\n * Processes queued responses from the server\n *\n * @param {Boolean} force If true, ignores _processing flag\n */\n _processResponse() {\n if (!this._responseQueue.length) {\n return false;\n }\n\n let str = (this.lastServerResponse = (this._responseQueue.shift() || '').toString());\n\n if (/^\\d+-/.test(str.split('\\n').pop())) {\n // keep waiting for the final part of multiline response\n return;\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'server'\n },\n str.replace(/\\r?\\n$/, '')\n );\n }\n\n if (!str.trim()) {\n // skip unexpected empty lines\n setImmediate(() => this._processResponse(true));\n }\n\n let action = this._responseActions.shift();\n\n if (typeof action === 'function') {\n action.call(this, str);\n setImmediate(() => this._processResponse(true));\n } else {\n return this._onError(new Error('Unexpected Response'), 'EPROTOCOL', str, 'CONN');\n }\n }\n\n /**\n * Send a command to the server, append \\r\\n\n *\n * @param {String} str String to be sent to the server\n * @param {String} logStr Optional string to be used for logging instead of the actual string\n */\n _sendCommand(str, logStr) {\n if (this._destroyed) {\n // Connection already closed, can't send any more data\n return;\n }\n\n if (this._socket.destroyed) {\n return this.close();\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'client'\n },\n (logStr || str || '').toString().replace(/\\r?\\n$/, '')\n );\n }\n\n this._socket.write(Buffer.from(str + '\\r\\n', 'utf-8'));\n }\n\n /**\n * Initiates a new message by submitting envelope data, starting with\n * MAIL FROM: command\n *\n * @param {Object} envelope Envelope object in the form of\n * {from:'...', to:['...']}\n * or\n * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']}\n */\n _setEnvelope(envelope, callback) {\n let args = [];\n let useSmtpUtf8 = false;\n\n this._envelope = envelope || {};\n this._envelope.from = ((this._envelope.from && this._envelope.from.address) || this._envelope.from || '').toString().trim();\n\n this._envelope.to = [].concat(this._envelope.to || []).map(to => ((to && to.address) || to || '').toString().trim());\n\n if (!this._envelope.to.length) {\n return callback(this._formatError('No recipients defined', 'EENVELOPE', false, 'API'));\n }\n\n if (this._envelope.from && /[\\r\\n<>]/.test(this._envelope.from)) {\n return callback(this._formatError('Invalid sender ' + JSON.stringify(this._envelope.from), 'EENVELOPE', false, 'API'));\n }\n\n // check if the sender address uses only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n useSmtpUtf8 = true;\n }\n\n for (let i = 0, len = this._envelope.to.length; i < len; i++) {\n if (!this._envelope.to[i] || /[\\r\\n<>]/.test(this._envelope.to[i])) {\n return callback(this._formatError('Invalid recipient ' + JSON.stringify(this._envelope.to[i]), 'EENVELOPE', false, 'API'));\n }\n\n // check if the recipients addresses use only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.to[i])) {\n useSmtpUtf8 = true;\n }\n }\n\n // clone the recipients array for latter manipulation\n this._envelope.rcptQueue = JSON.parse(JSON.stringify(this._envelope.to || []));\n this._envelope.rejected = [];\n this._envelope.rejectedErrors = [];\n this._envelope.accepted = [];\n\n if (this._envelope.dsn) {\n try {\n this._envelope.dsn = this._setDsnEnvelope(this._envelope.dsn);\n } catch (err) {\n return callback(this._formatError('Invalid DSN ' + err.message, 'EENVELOPE', false, 'API'));\n }\n }\n\n this._responseActions.push(str => {\n this._actionMAIL(str, callback);\n });\n\n // If the server supports SMTPUTF8 and the envelope includes an internationalized\n // email address then append SMTPUTF8 keyword to the MAIL FROM command\n if (useSmtpUtf8 && this._supportedExtensions.includes('SMTPUTF8')) {\n args.push('SMTPUTF8');\n this._usingSmtpUtf8 = true;\n }\n\n // If the server supports 8BITMIME and the message might contain non-ascii bytes\n // then append the 8BITMIME keyword to the MAIL FROM command\n if (this._envelope.use8BitMime && this._supportedExtensions.includes('8BITMIME')) {\n args.push('BODY=8BITMIME');\n this._using8BitMime = true;\n }\n\n if (this._envelope.size && this._supportedExtensions.includes('SIZE')) {\n args.push('SIZE=' + this._envelope.size);\n }\n\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the MAIL FROM command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.ret) {\n args.push('RET=' + shared.encodeXText(this._envelope.dsn.ret));\n }\n if (this._envelope.dsn.envid) {\n args.push('ENVID=' + shared.encodeXText(this._envelope.dsn.envid));\n }\n }\n\n this._sendCommand('MAIL FROM:<' + this._envelope.from + '>' + (args.length ? ' ' + args.join(' ') : ''));\n }\n\n _setDsnEnvelope(params) {\n let ret = (params.ret || params.return || '').toString().toUpperCase() || null;\n if (ret) {\n switch (ret) {\n case 'HDRS':\n case 'HEADERS':\n ret = 'HDRS';\n break;\n case 'FULL':\n case 'BODY':\n ret = 'FULL';\n break;\n }\n }\n\n if (ret && !['FULL', 'HDRS'].includes(ret)) {\n throw new Error('ret: ' + JSON.stringify(ret));\n }\n\n let envid = (params.envid || params.id || '').toString() || null;\n\n let notify = params.notify || null;\n if (notify) {\n if (typeof notify === 'string') {\n notify = notify.split(',');\n }\n notify = notify.map(n => n.trim().toUpperCase());\n let validNotify = ['NEVER', 'SUCCESS', 'FAILURE', 'DELAY'];\n let invaliNotify = notify.filter(n => !validNotify.includes(n));\n if (invaliNotify.length || (notify.length > 1 && notify.includes('NEVER'))) {\n throw new Error('notify: ' + JSON.stringify(notify.join(',')));\n }\n notify = notify.join(',');\n }\n\n let orcpt = (params.recipient || params.orcpt || '').toString() || null;\n if (orcpt && orcpt.indexOf(';') < 0) {\n orcpt = 'rfc822;' + orcpt;\n }\n\n return {\n ret,\n envid,\n notify,\n orcpt\n };\n }\n\n _getDsnRcptToArgs() {\n let args = [];\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the RCPT TO command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.notify) {\n args.push('NOTIFY=' + shared.encodeXText(this._envelope.dsn.notify));\n }\n if (this._envelope.dsn.orcpt) {\n args.push('ORCPT=' + shared.encodeXText(this._envelope.dsn.orcpt));\n }\n }\n return args.length ? ' ' + args.join(' ') : '';\n }\n\n _createSendStream(callback) {\n let dataStream = new DataStream();\n let logStream;\n\n if (this.options.lmtp) {\n this._envelope.accepted.forEach((recipient, i) => {\n let final = i === this._envelope.accepted.length - 1;\n this._responseActions.push(str => {\n this._actionLMTPStream(recipient, final, str, callback);\n });\n });\n } else {\n this._responseActions.push(str => {\n this._actionSMTPStream(str, callback);\n });\n }\n\n dataStream.pipe(this._socket, {\n end: false\n });\n\n if (this.options.debug) {\n logStream = new PassThrough();\n logStream.on('readable', () => {\n let chunk;\n while ((chunk = logStream.read())) {\n this.logger.debug(\n {\n tnx: 'message'\n },\n chunk.toString('binary').replace(/\\r?\\n$/, '')\n );\n }\n });\n dataStream.pipe(logStream);\n }\n\n dataStream.once('end', () => {\n this.logger.info(\n {\n tnx: 'message',\n inByteCount: dataStream.inByteCount,\n outByteCount: dataStream.outByteCount\n },\n '<%s bytes encoded mime message (source size %s bytes)>',\n dataStream.outByteCount,\n dataStream.inByteCount\n );\n });\n\n return dataStream;\n }\n\n /** ACTIONS **/\n\n /**\n * Will be run after the connection is created and the server sends\n * a greeting. If the incoming message starts with 220 initiate\n * SMTP session by sending EHLO command\n *\n * @param {String} str Message from the server\n */\n _actionGreeting(str) {\n clearTimeout(this._greetingTimeout);\n\n if (str.substr(0, 3) !== '220') {\n this._onError(new Error('Invalid greeting. response=' + str), 'EPROTOCOL', str, 'CONN');\n return;\n }\n\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n }\n\n /**\n * Handles server response for LHLO command. If it yielded in\n * error, emit 'error', otherwise treat this as an EHLO response\n *\n * @param {String} str Message from the server\n */\n _actionLHLO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid LHLO. response=' + str), 'EPROTOCOL', str, 'LHLO');\n return;\n }\n\n this._actionEHLO(str);\n }\n\n /**\n * Handles server response for EHLO command. If it yielded in\n * error, try HELO instead, otherwise initiate TLS negotiation\n * if STARTTLS is supported by the server or move into the\n * authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionEHLO(str) {\n let match;\n\n if (str.substr(0, 3) === '421') {\n this._onError(new Error('Server terminates connection. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n if (this.options.requireTLS) {\n this._onError(new Error('EHLO failed but HELO does not support required STARTTLS. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n // Try HELO instead\n this._responseActions.push(this._actionHELO);\n this._sendCommand('HELO ' + this.name);\n return;\n }\n\n // Detect if the server supports STARTTLS\n if (!this.secure && !this.options.ignoreTLS && (/[ -]STARTTLS\\b/im.test(str) || this.options.requireTLS)) {\n this._sendCommand('STARTTLS');\n this._responseActions.push(this._actionSTARTTLS);\n return;\n }\n\n // Detect if the server supports SMTPUTF8\n if (/[ -]SMTPUTF8\\b/im.test(str)) {\n this._supportedExtensions.push('SMTPUTF8');\n }\n\n // Detect if the server supports DSN\n if (/[ -]DSN\\b/im.test(str)) {\n this._supportedExtensions.push('DSN');\n }\n\n // Detect if the server supports 8BITMIME\n if (/[ -]8BITMIME\\b/im.test(str)) {\n this._supportedExtensions.push('8BITMIME');\n }\n\n // Detect if the server supports PIPELINING\n if (/[ -]PIPELINING\\b/im.test(str)) {\n this._supportedExtensions.push('PIPELINING');\n }\n\n // Detect if the server supports AUTH\n if (/[ -]AUTH\\b/i.test(str)) {\n this.allowsAuth = true;\n }\n\n // Detect if the server supports PLAIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)PLAIN/i.test(str)) {\n this._supportedAuth.push('PLAIN');\n }\n\n // Detect if the server supports LOGIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)LOGIN/i.test(str)) {\n this._supportedAuth.push('LOGIN');\n }\n\n // Detect if the server supports CRAM-MD5 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)CRAM-MD5/i.test(str)) {\n this._supportedAuth.push('CRAM-MD5');\n }\n\n // Detect if the server supports XOAUTH2 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)XOAUTH2/i.test(str)) {\n this._supportedAuth.push('XOAUTH2');\n }\n\n // Detect if the server supports SIZE extensions (and the max allowed size)\n if ((match = str.match(/[ -]SIZE(?:[ \\t]+(\\d+))?/im))) {\n this._supportedExtensions.push('SIZE');\n this._maxAllowedSize = Number(match[1]) || 0;\n }\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for HELO command. If it yielded in\n * error, emit 'error', otherwise move into the authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionHELO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid HELO. response=' + str), 'EPROTOCOL', str, 'HELO');\n return;\n }\n\n // assume that authentication is enabled (most probably is not though)\n this.allowsAuth = true;\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for STARTTLS command. If there's an error\n * try HELO instead, otherwise initiate TLS upgrade. If the upgrade\n * succeedes restart the EHLO\n *\n * @param {String} str Message from the server\n */\n _actionSTARTTLS(str) {\n if (str.charAt(0) !== '2') {\n if (this.options.opportunisticTLS) {\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Failed STARTTLS upgrade, continuing unencrypted'\n );\n return this.emit('connect');\n }\n this._onError(new Error('Error upgrading connection with STARTTLS'), 'ETLS', str, 'STARTTLS');\n return;\n }\n\n this._upgradeConnection((err, secured) => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'STARTTLS');\n return;\n }\n\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Connection upgraded with STARTTLS'\n );\n\n if (secured) {\n // restart session\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n } else {\n this.emit('connect');\n }\n });\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 VXNlcm5hbWU6' (base64 for 'Username:'). Data to be sent as\n * response needs to be base64 encoded username. We do not need\n * exact match but settle with 334 response in general as some\n * hosts invalidly use a longer message than VXNlcm5hbWU6\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_USER(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 VXNlcm5hbWU6'\n callback(this._formatError('Invalid login sequence while waiting for \"334 VXNlcm5hbWU6\"', 'EAUTH', str, 'AUTH LOGIN'));\n return;\n }\n\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_PASS(str, callback);\n });\n\n this._sendCommand(Buffer.from(this._auth.credentials.user + '', 'utf-8').toString('base64'));\n }\n\n /**\n * Handle the response for AUTH CRAM-MD5 command. We are expecting\n * '334 '. Data to be sent as response needs to be\n * base64 decoded challenge string, MD5 hashed using the password as\n * a HMAC key, prefixed by the username and a space, and finally all\n * base64 encoded again.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5(str, callback) {\n let challengeMatch = str.match(/^334\\s+(.+)$/);\n let challengeString = '';\n\n if (!challengeMatch) {\n return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH CRAM-MD5'));\n } else {\n challengeString = challengeMatch[1];\n }\n\n // Decode from base64\n let base64decoded = Buffer.from(challengeString, 'base64').toString('ascii'),\n hmacMD5 = crypto.createHmac('md5', this._auth.credentials.pass);\n\n hmacMD5.update(base64decoded);\n\n let prepended = this._auth.credentials.user + ' ' + hmacMD5.digest('hex');\n\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5_PASS(str, callback);\n });\n\n this._sendCommand(\n Buffer.from(prepended).toString('base64'),\n // hidden hash for logs\n Buffer.from(this._auth.credentials.user + ' /* secret */').toString('base64')\n );\n }\n\n /**\n * Handles the response to CRAM-MD5 authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5_PASS(str, callback) {\n if (!str.match(/^235\\s+/)) {\n return callback(this._formatError('Invalid login sequence while waiting for \"235\"', 'EAUTH', str, 'AUTH CRAM-MD5'));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 UGFzc3dvcmQ6' (base64 for 'Password:'). Data to be sent as\n * response needs to be base64 encoded password.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_PASS(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 UGFzc3dvcmQ6'\n return callback(this._formatError('Invalid login sequence while waiting for \"334 UGFzc3dvcmQ6\"', 'EAUTH', str, 'AUTH LOGIN'));\n }\n\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n\n this._sendCommand(\n Buffer.from((this._auth.credentials.pass || '').toString(), 'utf-8').toString('base64'),\n // Hidden pass for logs\n Buffer.from('/* secret */', 'utf-8').toString('base64')\n );\n }\n\n /**\n * Handles the response for authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTHComplete(str, isRetry, callback) {\n if (!callback && typeof isRetry === 'function') {\n callback = isRetry;\n isRetry = false;\n }\n\n if (str.substr(0, 3) === '334') {\n this._responseActions.push(str => {\n if (isRetry || this._authMethod !== 'XOAUTH2') {\n this._actionAUTHComplete(str, true, callback);\n } else {\n // fetch a new OAuth2 access token\n setImmediate(() => this._handleXOauth2Token(true, callback));\n }\n });\n this._sendCommand('');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError('Invalid login', 'EAUTH', str, 'AUTH ' + this._authMethod));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle response for a MAIL FROM: command\n *\n * @param {String} str Message from the server\n */\n _actionMAIL(str, callback) {\n let message, curRecipient;\n if (Number(str.charAt(0)) !== 2) {\n if (this._usingSmtpUtf8 && /^550 /.test(str) && /[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Mail command failed';\n }\n return callback(this._formatError(message, 'EENVELOPE', str, 'MAIL FROM'));\n }\n\n if (!this._envelope.rcptQueue.length) {\n return callback(this._formatError('Can\\x27t send mail - no recipients defined', 'EENVELOPE', false, 'API'));\n } else {\n this._recipientQueue = [];\n\n if (this._supportedExtensions.includes('PIPELINING')) {\n while (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n } else {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n }\n\n /**\n * Handle response for a RCPT TO: command\n *\n * @param {String} str Message from the server\n */\n _actionRCPT(str, callback) {\n let message,\n err,\n curRecipient = this._recipientQueue.shift();\n if (Number(str.charAt(0)) !== 2) {\n // this is a soft error\n if (this._usingSmtpUtf8 && /^553 /.test(str) && /[\\x80-\\uFFFF]/.test(curRecipient)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Recipient command failed';\n }\n this._envelope.rejected.push(curRecipient);\n // store error for the failed recipient\n err = this._formatError(message, 'EENVELOPE', str, 'RCPT TO');\n err.recipient = curRecipient;\n this._envelope.rejectedErrors.push(err);\n } else {\n this._envelope.accepted.push(curRecipient);\n }\n\n if (!this._envelope.rcptQueue.length && !this._recipientQueue.length) {\n if (this._envelope.rejected.length < this._envelope.to.length) {\n this._responseActions.push(str => {\n this._actionDATA(str, callback);\n });\n this._sendCommand('DATA');\n } else {\n err = this._formatError('Can\\x27t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO');\n err.rejected = this._envelope.rejected;\n err.rejectedErrors = this._envelope.rejectedErrors;\n return callback(err);\n }\n } else if (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n\n /**\n * Handle response for a DATA command\n *\n * @param {String} str Message from the server\n */\n _actionDATA(str, callback) {\n // response should be 354 but according to this issue https://github.com/eleith/emailjs/issues/24\n // some servers might use 250 instead, so lets check for 2 or 3 as the first digit\n if (!/^[23]/.test(str)) {\n return callback(this._formatError('Data command failed', 'EENVELOPE', str, 'DATA'));\n }\n\n let response = {\n accepted: this._envelope.accepted,\n rejected: this._envelope.rejected\n };\n\n if (this._envelope.rejectedErrors.length) {\n response.rejectedErrors = this._envelope.rejectedErrors;\n }\n\n callback(null, response);\n }\n\n /**\n * Handle response for a DATA stream when using SMTP\n * We expect a single response that defines if the sending succeeded or failed\n *\n * @param {String} str Message from the server\n */\n _actionSMTPStream(str, callback) {\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n return callback(this._formatError('Message failed', 'EMESSAGE', str, 'DATA'));\n } else {\n // Message sent succesfully\n return callback(null, str);\n }\n }\n\n /**\n * Handle response for a DATA stream\n * We expect a separate response for every recipient. All recipients can either\n * succeed or fail separately\n *\n * @param {String} recipient The recipient this response applies to\n * @param {Boolean} final Is this the final recipient?\n * @param {String} str Message from the server\n */\n _actionLMTPStream(recipient, final, str, callback) {\n let err;\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n err = this._formatError('Message failed for recipient ' + recipient, 'EMESSAGE', str, 'DATA');\n err.recipient = recipient;\n this._envelope.rejected.push(recipient);\n this._envelope.rejectedErrors.push(err);\n for (let i = 0, len = this._envelope.accepted.length; i < len; i++) {\n if (this._envelope.accepted[i] === recipient) {\n this._envelope.accepted.splice(i, 1);\n }\n }\n }\n if (final) {\n return callback(null, str);\n }\n }\n\n _handleXOauth2Token(isRetry, callback) {\n this._auth.oauth2.getToken(isRetry, (err, accessToken) => {\n if (err) {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError(err, 'EAUTH', false, 'AUTH XOAUTH2'));\n }\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, isRetry, callback);\n });\n this._sendCommand(\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token(accessToken),\n // Hidden for logs\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token('/* secret */')\n );\n });\n }\n\n /**\n *\n * @param {string} command\n * @private\n */\n _isDestroyedMessage(command) {\n if (this._destroyed) {\n return 'Cannot ' + command + ' - smtp connection is already destroyed.';\n }\n\n if (this._socket) {\n if (this._socket.destroyed) {\n return 'Cannot ' + command + ' - smtp connection socket is already destroyed.';\n }\n\n if (!this._socket.writable) {\n return 'Cannot ' + command + ' - smtp connection socket is already half-closed.';\n }\n }\n }\n\n _getHostname() {\n // defaul hostname is machine hostname or [IP]\n let defaultHostname;\n try {\n defaultHostname = os.hostname() || '';\n } catch (err) {\n // fails on windows 7\n defaultHostname = 'localhost';\n }\n\n // ignore if not FQDN\n if (!defaultHostname || defaultHostname.indexOf('.') < 0) {\n defaultHostname = '[127.0.0.1]';\n }\n\n // IP should be enclosed in []\n if (defaultHostname.match(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/)) {\n defaultHostname = '[' + defaultHostname + ']';\n }\n\n return defaultHostname;\n }\n}\n\nmodule.exports = SMTPConnection;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst PoolResource = require('./pool-resource');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP pool transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options SMTP Connection options\n */\nclass SMTPPool extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.options.maxConnections = this.options.maxConnections || 5;\n this.options.maxMessages = this.options.maxMessages || 100;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-pool'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP (pool)';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n this._rateLimit = {\n counter: 0,\n timeout: null,\n waiting: [],\n checkpoint: false,\n delta: Number(this.options.rateDelta) || 1000,\n limit: Number(this.options.rateLimit) || 0\n };\n this._closed = false;\n this._queue = [];\n this._connections = [];\n this._connectionCounter = 0;\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n /**\n * Queues an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (this._closed) {\n return false;\n }\n\n this._queue.push({\n mail,\n requeueAttempts: 0,\n callback\n });\n\n if (this.idling && this._queue.length >= this.options.maxConnections) {\n this.idling = false;\n }\n\n setImmediate(() => this._processMessages());\n\n return true;\n }\n\n /**\n * Closes all connections in the pool. If there is a message being sent, the connection\n * is closed later\n */\n close() {\n let connection;\n let len = this._connections.length;\n this._closed = true;\n\n // clear rate limit timer if it exists\n clearTimeout(this._rateLimit.timeout);\n\n if (!len && !this._queue.length) {\n return;\n }\n\n // remove all available connections\n for (let i = len - 1; i >= 0; i--) {\n if (this._connections[i] && this._connections[i].available) {\n connection = this._connections[i];\n connection.close();\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'removed'\n },\n 'Connection #%s removed',\n connection.id\n );\n }\n }\n\n if (len && !this._connections.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'All connections removed'\n );\n }\n\n if (!this._queue.length) {\n return;\n }\n\n // make sure that entire queue would be cleaned\n let invokeCallbacks = () => {\n if (!this._queue.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'Pending queue entries cleared'\n );\n return;\n }\n let entry = this._queue.shift();\n if (entry && typeof entry.callback === 'function') {\n try {\n entry.callback(new Error('Connection pool was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n }\n setImmediate(invokeCallbacks);\n };\n setImmediate(invokeCallbacks);\n }\n\n /**\n * Check the queue and available connections. If there is a message to be sent and there is\n * an available connection, then use this connection to send the mail\n */\n _processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }\n\n /**\n * Creates a new pool resource\n */\n _createConnection() {\n let connection = new PoolResource(this);\n\n connection.id = ++this._connectionCounter;\n\n this.logger.info(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'conection'\n },\n 'Created new pool resource #%s',\n connection.id\n );\n\n // resource comes available\n connection.on('available', () => {\n this.logger.debug(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'available'\n },\n 'Connection #%s became available',\n connection.id\n );\n\n if (this._closed) {\n // if already closed run close() that will remove this connections from connections list\n this.close();\n } else {\n // check if there's anything else to send\n this._processMessages();\n }\n });\n\n // resource is terminated with an error\n connection.once('error', err => {\n if (err.code !== 'EMAXLIMIT') {\n this.logger.error(\n {\n err,\n tnx: 'pool',\n cid: connection.id\n },\n 'Pool Error for #%s: %s',\n connection.id,\n err.message\n );\n } else {\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'maxlimit'\n },\n 'Max messages limit exchausted for #%s',\n connection.id\n );\n }\n\n if (connection.queueEntry) {\n try {\n connection.queueEntry.callback(err);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n\n // remove the erroneus connection from connections list\n this._removeConnection(connection);\n\n this._continueProcessing();\n });\n\n connection.once('close', () => {\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'closed'\n },\n 'Connection #%s was closed',\n connection.id\n );\n\n this._removeConnection(connection);\n\n if (connection.queueEntry) {\n // If the connection closed when sending, add the message to the queue again\n // if max number of requeues is not reached yet\n // Note that we must wait a bit.. because the callback of the 'error' handler might be called\n // in the next event loop\n setTimeout(() => {\n if (connection.queueEntry) {\n if (this._shouldRequeuOnConnectionClose(connection.queueEntry)) {\n this._requeueEntryOnConnectionClose(connection);\n } else {\n this._failDeliveryOnConnectionClose(connection);\n }\n }\n this._continueProcessing();\n }, 50);\n } else {\n this._continueProcessing();\n }\n });\n\n this._connections.push(connection);\n\n return connection;\n }\n\n _shouldRequeuOnConnectionClose(queueEntry) {\n if (this.options.maxRequeues === undefined || this.options.maxRequeues < 0) {\n return true;\n }\n\n return queueEntry.requeueAttempts < this.options.maxRequeues;\n }\n\n _failDeliveryOnConnectionClose(connection) {\n if (connection.queueEntry && connection.queueEntry.callback) {\n try {\n connection.queueEntry.callback(new Error('Reached maximum number of retries after connection was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n messageId: connection.queueEntry.messageId,\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n }\n\n _requeueEntryOnConnectionClose(connection) {\n connection.queueEntry.requeueAttempts = connection.queueEntry.requeueAttempts + 1;\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: connection.queueEntry.messageId,\n action: 'requeue'\n },\n 'Re-queued message <%s> for #%s. Attempt: #%s',\n connection.queueEntry.messageId,\n connection.id,\n connection.queueEntry.requeueAttempts\n );\n this._queue.unshift(connection.queueEntry);\n connection.queueEntry = false;\n }\n\n /**\n * Continue to process message if the pool hasn't closed\n */\n _continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }\n\n /**\n * Remove resource from pool\n *\n * @param {Object} connection The PoolResource to remove\n */\n _removeConnection(connection) {\n let index = this._connections.indexOf(connection);\n\n if (index !== -1) {\n this._connections.splice(index, 1);\n }\n }\n\n /**\n * Checks if connections have hit current rate limit and if so, queues the availability callback\n *\n * @param {Function} callback Callback function to run once rate limiter has been cleared\n */\n _checkRateLimit(callback) {\n if (!this._rateLimit.limit) {\n return callback();\n }\n\n let now = Date.now();\n\n if (this._rateLimit.counter < this._rateLimit.limit) {\n return callback();\n }\n\n this._rateLimit.waiting.push(callback);\n\n if (this._rateLimit.checkpoint <= now - this._rateLimit.delta) {\n return this._clearRateLimit();\n } else if (!this._rateLimit.timeout) {\n this._rateLimit.timeout = setTimeout(() => this._clearRateLimit(), this._rateLimit.delta - (now - this._rateLimit.checkpoint));\n this._rateLimit.checkpoint = now;\n }\n }\n\n /**\n * Clears current rate limit limitation and runs paused callback\n */\n _clearRateLimit() {\n clearTimeout(this._rateLimit.timeout);\n this._rateLimit.timeout = null;\n this._rateLimit.counter = 0;\n this._rateLimit.checkpoint = false;\n\n // resume all paused connections\n while (this._rateLimit.waiting.length) {\n let cb = this._rateLimit.waiting.shift();\n setImmediate(cb);\n }\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let auth = new PoolResource(this).auth;\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!auth && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n}\n\n// expose to the world\nmodule.exports = SMTPPool;\n","'use strict';\n\nconst SMTPConnection = require('../smtp-connection');\nconst assign = require('../shared').assign;\nconst XOAuth2 = require('../xoauth2');\nconst EventEmitter = require('events');\n\n/**\n * Creates an element for the pool\n *\n * @constructor\n * @param {Object} options SMTPPool instance\n */\nclass PoolResource extends EventEmitter {\n constructor(pool) {\n super();\n\n this.pool = pool;\n this.options = pool.options;\n this.logger = this.pool.logger;\n\n if (this.options.auth) {\n switch ((this.options.auth.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n let oauth2 = new XOAuth2(this.options.auth, this.logger);\n oauth2.provisionCallback = (this.pool.mailer && this.pool.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n this.auth = {\n type: 'OAUTH2',\n user: this.options.auth.user,\n oauth2,\n method: 'XOAUTH2'\n };\n oauth2.on('token', token => this.pool.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n break;\n }\n default:\n if (!this.options.auth.user && !this.options.auth.pass) {\n break;\n }\n this.auth = {\n type: (this.options.auth.type || '').toString().toUpperCase() || 'LOGIN',\n user: this.options.auth.user,\n credentials: {\n user: this.options.auth.user || '',\n pass: this.options.auth.pass,\n options: this.options.auth.options\n },\n method: (this.options.auth.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n this._connection = false;\n this._connected = false;\n\n this.messages = 0;\n this.available = true;\n }\n\n /**\n * Initiates a connection to the SMTP server\n *\n * @param {Function} callback Callback function to run once the connection is established or failed\n */\n connect(callback) {\n this.pool.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n this.connection = new SMTPConnection(options);\n\n this.connection.once('error', err => {\n this.emit('error', err);\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n this.connection.once('end', () => {\n this.close();\n if (returned) {\n return;\n }\n returned = true;\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (this.connection && this.connection._socket && this.connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n this.connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (this.auth && (this.connection.allowsAuth || options.forceAuth)) {\n this.connection.login(this.auth, err => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n this._connected = true;\n callback(null, true);\n });\n } else {\n returned = true;\n this._connected = true;\n return callback(null, true);\n }\n });\n });\n }\n\n /**\n * Sends an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (!this._connected) {\n return this.connect(err => {\n if (err) {\n return callback(err);\n }\n return this.send(mail, callback);\n });\n }\n\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId,\n cid: this.id\n },\n 'Sending message %s using #%s to <%s>',\n messageId,\n this.id,\n recipients.join(', ')\n );\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n this.messages++;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n\n setImmediate(() => {\n let err;\n if (this.messages >= this.options.maxMessages) {\n err = new Error('Resource exhausted');\n err.code = 'EMAXLIMIT';\n this.connection.close();\n this.emit('error', err);\n } else {\n this.pool._checkRateLimit(() => {\n this.available = true;\n this.emit('available');\n });\n }\n });\n\n callback(null, info);\n });\n }\n\n /**\n * Closes the connection\n */\n close() {\n this._connected = false;\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n if (this.connection) {\n this.connection.close();\n }\n this.emit('close');\n }\n}\n\nmodule.exports = PoolResource;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst XOAuth2 = require('../xoauth2');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options Connection options\n */\nclass SMTPTransport extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-transport'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n if (this.options.auth) {\n this.auth = this.getAuth({});\n }\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n getAuth(authOpts) {\n if (!authOpts) {\n return this.auth;\n }\n\n let hasAuth = false;\n let authData = {};\n\n if (this.options.auth && typeof this.options.auth === 'object') {\n Object.keys(this.options.auth).forEach(key => {\n hasAuth = true;\n authData[key] = this.options.auth[key];\n });\n }\n\n if (authOpts && typeof authOpts === 'object') {\n Object.keys(authOpts).forEach(key => {\n hasAuth = true;\n authData[key] = authOpts[key];\n });\n }\n\n if (!hasAuth) {\n return false;\n }\n\n switch ((authData.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n if (!authData.service && !authData.user) {\n return false;\n }\n let oauth2 = new XOAuth2(authData, this.logger);\n oauth2.provisionCallback = (this.mailer && this.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n oauth2.on('token', token => this.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n return {\n type: 'OAUTH2',\n user: authData.user,\n oauth2,\n method: 'XOAUTH2'\n };\n }\n default:\n return {\n type: (authData.type || '').toString().toUpperCase() || 'LOGIN',\n user: authData.user,\n credentials: {\n user: authData.user || '',\n pass: authData.pass,\n options: authData.options\n },\n method: (authData.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n /**\n * Sends an e-mail using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n // only copy options if we need to modify it\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n returned = true;\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (connection && connection._socket && connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n let sendMessage = () => {\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n returned = true;\n connection.close();\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n return callback(err);\n }\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n try {\n return callback(null, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback'\n },\n 'Callback error for %s: %s',\n messageId,\n E.message\n );\n }\n });\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let auth = this.getAuth(mail.data.auth);\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (auth && auth !== this.auth && auth.oauth2) {\n auth.oauth2.removeAllListeners();\n }\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n sendMessage();\n });\n } else {\n sendMessage();\n }\n });\n });\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let authData = this.getAuth({});\n\n if (authData && (connection.allowsAuth || options.forceAuth)) {\n connection.login(authData, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!authData && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n\n /**\n * Releases resources\n */\n close() {\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n this.emit('close');\n }\n}\n\n// expose to the world\nmodule.exports = SMTPTransport;\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for streaming\n *\n * Possible options can be the following:\n *\n * * **buffer** if true, then returns the message as a Buffer object instead of a stream\n * * **newline** either 'windows' or 'unix'\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass StreamTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'StreamTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'stream-transport'\n });\n\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to handler that sends it\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // We probably need this in the output\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s> using %s line breaks',\n messageId,\n recipients.join(', '),\n this.winbreak ? '' : ''\n );\n\n setImmediate(() => {\n let stream;\n\n try {\n stream = mail.message.createReadStream();\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'send',\n messageId\n },\n 'Creating send stream failed for %s. %s',\n messageId,\n E.message\n );\n return done(E);\n }\n\n if (!this.options.buffer) {\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n });\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: stream\n });\n }\n\n let chunks = [];\n let chunklen = 0;\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n });\n\n stream.on('end', () =>\n done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: Buffer.concat(chunks, chunklen)\n })\n );\n });\n }\n}\n\nmodule.exports = StreamTransport;\n","'use strict';\n\nconst services = require('./services.json');\nconst normalized = {};\n\nObject.keys(services).forEach(key => {\n let service = services[key];\n\n normalized[normalizeKey(key)] = normalizeService(service);\n\n [].concat(service.aliases || []).forEach(alias => {\n normalized[normalizeKey(alias)] = normalizeService(service);\n });\n\n [].concat(service.domains || []).forEach(domain => {\n normalized[normalizeKey(domain)] = normalizeService(service);\n });\n});\n\nfunction normalizeKey(key) {\n return key.replace(/[^a-zA-Z0-9.-]/g, '').toLowerCase();\n}\n\nfunction normalizeService(service) {\n let filter = ['domains', 'aliases'];\n let response = {};\n\n Object.keys(service).forEach(key => {\n if (filter.indexOf(key) < 0) {\n response[key] = service[key];\n }\n });\n\n return response;\n}\n\n/**\n * Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or\n * an email address (like 'test@googlemail.com').\n *\n * @param {String} key [description]\n * @returns {Object} SMTP config or false if not found\n */\nmodule.exports = function (key) {\n key = normalizeKey(key.split('@').pop());\n return normalized[key] || false;\n};\n","'use strict';\n\nconst Stream = require('stream').Stream;\nconst nmfetch = require('../fetch');\nconst crypto = require('crypto');\nconst shared = require('../shared');\n\n/**\n * XOAUTH2 access_token generator for Gmail.\n * Create client ID for web applications in Google API console to use it.\n * See Offline Access for receiving the needed refreshToken for an user\n * https://developers.google.com/accounts/docs/OAuth2WebServer#offline\n *\n * Usage for generating access tokens with a custom method using provisionCallback:\n * provisionCallback(user, renew, callback)\n * * user is the username to get the token for\n * * renew is a boolean that if true indicates that existing token failed and needs to be renewed\n * * callback is the callback to run with (error, accessToken [, expires])\n * * accessToken is a string\n * * expires is an optional expire time in milliseconds\n * If provisionCallback is used, then Nodemailer does not try to attempt generating the token by itself\n *\n * @constructor\n * @param {Object} options Client information for token generation\n * @param {String} options.user User e-mail address\n * @param {String} options.clientId Client ID value\n * @param {String} options.clientSecret Client secret value\n * @param {String} options.refreshToken Refresh token for an user\n * @param {String} options.accessUrl Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token'\n * @param {String} options.accessToken An existing valid accessToken\n * @param {String} options.privateKey Private key for JSW\n * @param {Number} options.expires Optional Access Token expire time in ms\n * @param {Number} options.timeout Optional TTL for Access Token in seconds\n * @param {Function} options.provisionCallback Function to run when a new access token is required\n */\nclass XOAuth2 extends Stream {\n constructor(options, logger) {\n super();\n\n this.options = options || {};\n\n if (options && options.serviceClient) {\n if (!options.privateKey || !options.user) {\n setImmediate(() => this.emit('error', new Error('Options \"privateKey\" and \"user\" are required for service account!')));\n return;\n }\n\n let serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600);\n this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60;\n }\n\n this.logger = shared.getLogger(\n {\n logger\n },\n {\n component: this.options.component || 'OAuth2'\n }\n );\n\n this.provisionCallback = typeof this.options.provisionCallback === 'function' ? this.options.provisionCallback : false;\n\n this.options.accessUrl = this.options.accessUrl || 'https://accounts.google.com/o/oauth2/token';\n this.options.customHeaders = this.options.customHeaders || {};\n this.options.customParams = this.options.customParams || {};\n\n this.accessToken = this.options.accessToken || false;\n\n if (this.options.expires && Number(this.options.expires)) {\n this.expires = this.options.expires;\n } else {\n let timeout = Math.max(Number(this.options.timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n }\n }\n\n /**\n * Returns or generates (if previous has expired) a XOAuth2 token\n *\n * @param {Boolean} renew If false then use cached access token (if available)\n * @param {Function} callback Callback function with error object and token string\n */\n getToken(renew, callback) {\n if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) {\n return callback(null, this.accessToken);\n }\n\n let generateCallback = (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Failed generating new Access Token for %s',\n this.options.user\n );\n } else {\n this.logger.info(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Generated new Access Token for %s',\n this.options.user\n );\n }\n callback(...args);\n };\n\n if (this.provisionCallback) {\n this.provisionCallback(this.options.user, !!renew, (err, accessToken, expires) => {\n if (!err && accessToken) {\n this.accessToken = accessToken;\n this.expires = expires || 0;\n }\n generateCallback(err, accessToken);\n });\n } else {\n this.generateToken(generateCallback);\n }\n }\n\n /**\n * Updates token values\n *\n * @param {String} accessToken New access token\n * @param {Number} timeout Access token lifetime in seconds\n *\n * Emits 'token': { user: User email-address, accessToken: the new accessToken, timeout: TTL in seconds}\n */\n updateToken(accessToken, timeout) {\n this.accessToken = accessToken;\n timeout = Math.max(Number(timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n\n this.emit('token', {\n user: this.options.user,\n accessToken: accessToken || '',\n expires: this.expires\n });\n }\n\n /**\n * Generates a new XOAuth2 token with the credentials provided at initialization\n *\n * @param {Function} callback Callback function with error object and token string\n */\n generateToken(callback) {\n let urlOptions;\n let loggedUrlOptions;\n if (this.options.serviceClient) {\n // service account - https://developers.google.com/identity/protocols/OAuth2ServiceAccount\n let iat = Math.floor(Date.now() / 1000); // unix time\n let tokenData = {\n iss: this.options.serviceClient,\n scope: this.options.scope || 'https://mail.google.com/',\n sub: this.options.user,\n aud: this.options.accessUrl,\n iat,\n exp: iat + this.options.serviceRequestTimeout\n };\n let token;\n try {\n token = this.jwtSignRS256(tokenData);\n } catch (err) {\n return callback(new Error('Can\\x27t generate token. Check your auth options'));\n }\n\n urlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: token\n };\n\n loggedUrlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: tokenData\n };\n } else {\n if (!this.options.refreshToken) {\n return callback(new Error('Can\\x27t create new access token for user'));\n }\n\n // web app - https://developers.google.com/identity/protocols/OAuth2WebServer\n urlOptions = {\n client_id: this.options.clientId || '',\n client_secret: this.options.clientSecret || '',\n refresh_token: this.options.refreshToken,\n grant_type: 'refresh_token'\n };\n\n loggedUrlOptions = {\n client_id: this.options.clientId || '',\n client_secret: (this.options.clientSecret || '').substr(0, 6) + '...',\n refresh_token: (this.options.refreshToken || '').substr(0, 6) + '...',\n grant_type: 'refresh_token'\n };\n }\n\n Object.keys(this.options.customParams).forEach(key => {\n urlOptions[key] = this.options.customParams[key];\n loggedUrlOptions[key] = this.options.customParams[key];\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'generate'\n },\n 'Requesting token using: %s',\n JSON.stringify(loggedUrlOptions)\n );\n\n this.postRequest(this.options.accessUrl, urlOptions, this.options, (error, body) => {\n let data;\n\n if (error) {\n return callback(error);\n }\n\n try {\n data = JSON.parse(body.toString());\n } catch (E) {\n return callback(E);\n }\n\n if (!data || typeof data !== 'object') {\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n (body || '').toString()\n );\n return callback(new Error('Invalid authentication response'));\n }\n\n let logData = {};\n Object.keys(data).forEach(key => {\n if (key !== 'access_token') {\n logData[key] = data[key];\n } else {\n logData[key] = (data[key] || '').toString().substr(0, 6) + '...';\n }\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n JSON.stringify(logData)\n );\n\n if (data.error) {\n // Error Response : https://tools.ietf.org/html/rfc6749#section-5.2\n let errorMessage = data.error;\n if (data.error_description) {\n errorMessage += ': ' + data.error_description;\n }\n if (data.error_uri) {\n errorMessage += ' (' + data.error_uri + ')';\n }\n return callback(new Error(errorMessage));\n }\n\n if (data.access_token) {\n this.updateToken(data.access_token, data.expires_in);\n return callback(null, this.accessToken);\n }\n\n return callback(new Error('No access token'));\n });\n }\n\n /**\n * Converts an access_token and user id into a base64 encoded XOAuth2 token\n *\n * @param {String} [accessToken] Access token string\n * @return {String} Base64 encoded token for IMAP or SMTP login\n */\n buildXOAuth2Token(accessToken) {\n let authData = ['user=' + (this.options.user || ''), 'auth=Bearer ' + (accessToken || this.accessToken), '', ''];\n return Buffer.from(authData.join('\\x01'), 'utf-8').toString('base64');\n }\n\n /**\n * Custom POST request handler.\n * This is only needed to keep paths short in Windows – usually this module\n * is a dependency of a dependency and if it tries to require something\n * like the request module the paths get way too long to handle for Windows.\n * As we do only a simple POST request we do not actually require complicated\n * logic support (no redirects, no nothing) anyway.\n *\n * @param {String} url Url to POST to\n * @param {String|Buffer} payload Payload to POST\n * @param {Function} callback Callback function with (err, buff)\n */\n postRequest(url, payload, params, callback) {\n let returned = false;\n\n let chunks = [];\n let chunklen = 0;\n\n let req = nmfetch(url, {\n method: 'post',\n headers: params.customHeaders,\n body: payload,\n allowErrorResponse: true\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n req.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(null, Buffer.concat(chunks, chunklen));\n });\n }\n\n /**\n * Encodes a buffer or a string into Base64url format\n *\n * @param {Buffer|String} data The data to convert\n * @return {String} The encoded string\n */\n toBase64URL(data) {\n if (typeof data === 'string') {\n data = Buffer.from(data);\n }\n\n return data\n .toString('base64')\n .replace(/[=]+/g, '') // remove '='s\n .replace(/\\+/g, '-') // '+' → '-'\n .replace(/\\//g, '_'); // '/' → '_'\n }\n\n /**\n * Creates a JSON Web Token signed with RS256 (SHA256 + RSA)\n *\n * @param {Object} payload The payload to include in the generated token\n * @return {String} The generated and signed token\n */\n jwtSignRS256(payload) {\n payload = ['{\"alg\":\"RS256\",\"typ\":\"JWT\"}', JSON.stringify(payload)].map(val => this.toBase64URL(val)).join('.');\n let signature = crypto.createSign('RSA-SHA256').update(payload).sign(this.options.privateKey);\n return payload + '.' + this.toBase64URL(signature);\n }\n}\n\nmodule.exports = XOAuth2;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\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(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\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 (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\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', 'GITHUB_ACTIONS', 'BUILDKITE'].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\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n",null,"module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"crypto\");","module.exports = require(\"dns\");","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(\"punycode\");","module.exports = require(\"stream\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// 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\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file