UNPKG

@peculiar/fortify-webcomponents

Version:

Web-components for creating CSR or Certificate and viewing certificates list using Fortify

63 lines (59 loc) 170 kB
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,i){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i["throw"](e))}catch(e){a(e)}}function c(e){e.done?r(e.value):n(e.value).then(s,o)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=o(0),s["throw"]=o(1),s["return"]=o(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return c([e,t])}}function c(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(i=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++){if(a||!(i in t)){if(!a)a=Array.prototype.slice.call(t,0,i);a[i]=t[i]}}return e.concat(a||Array.prototype.slice.call(t))};var _e; /*! * © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License */import{k as commonjsGlobal,bo as __decorate,bd as id_ce_certificatePolicies,bf as id_ce_basicConstraints,b9 as id_ce_extKeyUsage,b5 as id_ce_keyUsage,a$ as id_ce_subjectKeyIdentifier,bg as id_ce_authorityKeyIdentifier,b1 as id_ce_subjectAltName,bc as id_ce_cRLDistributionPoints,bh as id_pe_authorityInfoAccess,b6 as id_ce_issuerAltName,H as id_pkcs9_at_challengePassword,F as id_pkcs9_at_extensionRequest,bp as AlgorithmIdentifier,bq as ecdsaWithSHA512,br as ecdsaWithSHA384,bs as ecdsaWithSHA256,bt as ecdsaWithSHA1,a as AsnConvert,i as id_ecPublicKey,E as ECParameters,bu as id_secp521r1,bv as id_secp384r1,bw as id_secp256r1,bx as id_ecdsaWithSHA512,by as id_ecdsaWithSHA384,bz as id_ecdsaWithSHA256,bA as id_ecdsaWithSHA1,b as buildExports,aD as CertificatePolicies,bB as PolicyInformation,bC as RsaSaPssParams,bD as id_mgf1,bE as id_RSASSA_PSS,bF as id_sha512WithRSAEncryption,bG as id_sha384WithRSAEncryption,bH as id_sha256WithRSAEncryption,bI as id_sha1WithRSAEncryption,c as id_rsaEncryption,bJ as id_sha512,bK as id_sha384,bL as id_sha256,bM as id_sha1,aF as BasicConstraints,az as ExtendedKeyUsage$1,av as KeyUsage,ap as SubjectKeyIdentifier,aG as AuthorityKeyIdentifier,bN as KeyIdentifier,bO as GeneralNames$1,ar as SubjectAlternativeName,bP as DistributionPoint,bQ as DistributionPointName,bR as GeneralName$1,aC as CRLDistributionPoints,aH as AuthorityInfoAccessSyntax,bS as id_ad_caRepository,bT as id_ad_timeStamping,bU as id_ad_caIssuers,bV as id_ad_ocsp,u as ChallengePassword,bW as Extensions,a4 as Extension$2,bX as ECDSASigValue,O as OctetString,bY as SubjectPublicKeyInfo,R as RSAPublicKey,bZ as OtherName,b_ as AsnUtf8StringConverter,bn as Name$1,b$ as DirectoryString,c0 as AccessDescription,q as Attribute$1,c1 as __classPrivateFieldGet$1,c2 as __classPrivateFieldSet$1,c3 as RelativeDistinguishedName,c4 as AttributeTypeAndValue,C as Certificate,c5 as TBSCertificate,c6 as Validity,c7 as Version,a0 as CertificationRequest,c8 as CertificationRequestInfo,c9 as id_kp_OCSPSigning,ca as id_kp_timeStamping,cb as id_kp_emailProtection,cc as id_kp_codeSigning,cd as id_kp_clientAuth,ce as id_kp_serverAuth,cf as id_ecdsaWithSHA224,cg as id_sha224WithRSAEncryption,ch as id_sha224,r as AsnParser,a_ as id_pe_qcStatements,ao as QCStatements}from"./ssh_certificate-CDwMJyak.js";import{a as id_signedData}from"./object_identifiers-CvvoEL7F.js";import{h}from"./index-BA3hMeq-.js";import{getString}from"./index.js";import{T as Typography}from"./typography-BgpGT7g-.js"; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */if(!Uint8Array.prototype.slice){Object.defineProperty(Uint8Array.prototype,"slice",{value:function(e,t){return new Uint8Array(Array.prototype.slice.call(this,e,t))}})}var polyfillInit=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!!window["protobuf"])return[3,2];return[4,import("./protobuf-14r5d9Hn.js").then((function(e){return e.p}))];case 1:e.sent();e.label=2;case 2:if(!!window["WebcryptoSocket"])return[3,4];return[4,import("./webcrypto-socket-MMsUlh4G.js")];case 3:e.sent();e.label=4;case 4:return[2]}}))}))};var appleIphone=/iPhone/i;var appleIpod=/iPod/i;var appleTablet=/iPad/i;var appleUniversal=/\biOS-universal(?:.+)Mac\b/i;var androidPhone=/\bAndroid(?:.+)Mobile\b/i;var androidTablet=/Android/i;var amazonPhone=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i;var amazonTablet=/Silk/i;var windowsPhone=/Windows Phone/i;var windowsTablet=/\bWindows(?:.+)ARM\b/i;var otherBlackBerry=/BlackBerry/i;var otherBlackBerry10=/BB10/i;var otherOpera=/Opera Mini/i;var otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i;var otherFirefox=/Mobile(?:.+)Firefox\b/i;var isAppleTabletOnIos13=function(e){return typeof e!=="undefined"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints==="number"&&e.maxTouchPoints>1&&typeof MSStream==="undefined"};function createMatch(e){return function(t){return t.test(e)}}function isMobile(e){var t={userAgent:"",platform:"",maxTouchPoints:0};if(!e&&typeof navigator!=="undefined"){t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}}else if(typeof e==="string"){t.userAgent=e}else if(e&&e.userAgent){t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}}var r=t.userAgent;var i=r.split("[FBAN");if(typeof i[1]!=="undefined"){r=i[0]}i=r.split("Twitter");if(typeof i[1]!=="undefined"){r=i[0]}var n=createMatch(r);var a={apple:{phone:n(appleIphone)&&!n(windowsPhone),ipod:n(appleIpod),tablet:!n(appleIphone)&&(n(appleTablet)||isAppleTabletOnIos13(t))&&!n(windowsPhone),universal:n(appleUniversal),device:(n(appleIphone)||n(appleIpod)||n(appleTablet)||n(appleUniversal)||isAppleTabletOnIos13(t))&&!n(windowsPhone)},amazon:{phone:n(amazonPhone),tablet:!n(amazonPhone)&&n(amazonTablet),device:n(amazonPhone)||n(amazonTablet)},android:{phone:!n(windowsPhone)&&n(amazonPhone)||!n(windowsPhone)&&n(androidPhone),tablet:!n(windowsPhone)&&!n(amazonPhone)&&!n(androidPhone)&&(n(amazonTablet)||n(androidTablet)),device:!n(windowsPhone)&&(n(amazonPhone)||n(amazonTablet)||n(androidPhone)||n(androidTablet))||n(/\bokhttp\b/i)},windows:{phone:n(windowsPhone),tablet:n(windowsTablet),device:n(windowsPhone)||n(windowsTablet)},other:{blackberry:n(otherBlackBerry),blackberry10:n(otherBlackBerry10),opera:n(otherOpera),firefox:n(otherFirefox),chrome:n(otherChrome),device:n(otherBlackBerry)||n(otherBlackBerry10)||n(otherOpera)||n(otherFirefox)||n(otherChrome)},any:false,phone:false,tablet:false};a.any=a.apple.device||a.android.device||a.windows.device||a.other.device;a.phone=a.apple.phone||a.android.phone||a.windows.phone;a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet;return a}var _Reflect={}; /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var hasRequired_Reflect;function require_Reflect(){if(hasRequired_Reflect)return _Reflect;hasRequired_Reflect=1;var e;(function(e){(function(t){var r=typeof globalThis==="object"?globalThis:typeof commonjsGlobal==="object"?commonjsGlobal:typeof self==="object"?self:typeof this==="object"?this:o();var i=n(e);if(typeof r.Reflect!=="undefined"){i=n(r.Reflect,i)}t(i,r);if(typeof r.Reflect==="undefined"){r.Reflect=e}function n(e,t){return function(r,i){Object.defineProperty(e,r,{configurable:true,writable:true,value:i});if(t)t(r,i)}}function a(){try{return Function("return this;")()}catch(e){}}function s(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}function o(){return a()||s()}})((function(e,t){var r=Object.prototype.hasOwnProperty;var i=typeof Symbol==="function";var n=i&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var a=i&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var s=typeof Object.create==="function";var o={__proto__:[]}instanceof Array;var c=!s&&!o;var u={create:s?function(){return he(Object.create(null))}:o?function(){return he({__proto__:null})}:function(){return he({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:undefined}:function(e,t){return e[t]}};var f=Object.getPrototypeOf(Function);var h=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:ce();var v=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:ue();var l=typeof WeakMap==="function"?WeakMap:fe();var d=i?Symbol.for("@reflect-metadata:registry"):undefined;var _=ne();var p=ae(_);function m(e,t,r,i){if(!j(r)){if(!W(e))throw new TypeError;if(!M(t))throw new TypeError;if(!M(i)&&!j(i)&&!G(i))throw new TypeError;if(G(i))i=undefined;r=X(r);return k(e,t,r,i)}else{if(!W(e))throw new TypeError;if(!q(t))throw new TypeError;return x(e,t)}}e("decorate",m);function b(e,t){function r(r,i){if(!M(r))throw new TypeError;if(!j(i)&&!V(i))throw new TypeError;I(e,t,r,i)}return r}e("metadata",b);function y(e,t,r,i){if(!M(r))throw new TypeError;if(!j(i))i=X(i);return I(e,t,r,i)}e("defineMetadata",y);function g(e,t,r){if(!M(t))throw new TypeError;if(!j(r))r=X(r);return R(e,t,r)}e("hasMetadata",g);function w(e,t,r){if(!M(t))throw new TypeError;if(!j(r))r=X(r);return z(e,t,r)}e("hasOwnMetadata",w);function A(e,t,r){if(!M(t))throw new TypeError;if(!j(r))r=X(r);return T(e,t,r)}e("getMetadata",A);function P(e,t,r){if(!M(t))throw new TypeError;if(!j(r))r=X(r);return N(e,t,r)}e("getOwnMetadata",P);function C(e,t){if(!M(e))throw new TypeError;if(!j(t))t=X(t);return F(e,t)}e("getMetadataKeys",C);function E(e,t){if(!M(e))throw new TypeError;if(!j(t))t=X(t);return D(e,t)}e("getOwnMetadataKeys",E);function S(e,t,r){if(!M(t))throw new TypeError;if(!j(r))r=X(r);if(!M(t))throw new TypeError;if(!j(r))r=X(r);var i=oe(t,r,false);if(j(i))return false;return i.OrdinaryDeleteMetadata(e,t,r)}e("deleteMetadata",S);function x(e,t){for(var r=e.length-1;r>=0;--r){var i=e[r];var n=i(t);if(!j(n)&&!G(n)){if(!q(n))throw new TypeError;t=n}}return t}function k(e,t,r,i){for(var n=e.length-1;n>=0;--n){var a=e[n];var s=a(t,r,i);if(!j(s)&&!G(s)){if(!M(s))throw new TypeError;i=s}}return i}function R(e,t,r){var i=z(e,t,r);if(i)return true;var n=re(t);if(!G(n))return R(e,n,r);return false}function z(e,t,r){var i=oe(t,r,false);if(j(i))return false;return U(i.OrdinaryHasOwnMetadata(e,t,r))}function T(e,t,r){var i=z(e,t,r);if(i)return N(e,t,r);var n=re(t);if(!G(n))return T(e,n,r);return undefined}function N(e,t,r){var i=oe(t,r,false);if(j(i))return;return i.OrdinaryGetOwnMetadata(e,t,r)}function I(e,t,r,i){var n=oe(r,i,true);n.OrdinaryDefineOwnMetadata(e,t,r,i)}function F(e,t){var r=D(e,t);var i=re(e);if(i===null)return r;var n=F(i,t);if(n.length<=0)return r;if(r.length<=0)return n;var a=new v;var s=[];for(var o=0,c=r;o<c.length;o++){var u=c[o];var f=a.has(u);if(!f){a.add(u);s.push(u)}}for(var h=0,l=n;h<l.length;h++){var u=l[h];var f=a.has(u);if(!f){a.add(u);s.push(u)}}return s}function D(e,t){var r=oe(e,t,false);if(!r){return[]}return r.OrdinaryOwnMetadataKeys(e,t)}function O(e){if(e===null)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return e===null?1:6;default:return 6}}function j(e){return e===undefined}function G(e){return e===null}function $(e){return typeof e==="symbol"}function M(e){return typeof e==="object"?e!==null:typeof e==="function"}function K(e,t){switch(O(e)){case 0:return e;case 1:return e;case 2:return e;case 3:return e;case 4:return e;case 5:return e}var r="string";var i=Q(e,n);if(i!==undefined){var a=i.call(e,r);if(M(a))throw new TypeError;return a}return H(e)}function H(e,t){var r,i,n;{var a=e.toString;if(L(a)){var i=a.call(e);if(!M(i))return i}var r=e.valueOf;if(L(r)){var i=r.call(e);if(!M(i))return i}}throw new TypeError}function U(e){return!!e}function B(e){return""+e}function X(e){var t=K(e);if($(t))return t;return B(t)}function W(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:Object.prototype.toString.call(e)==="[object Array]"}function L(e){return typeof e==="function"}function q(e){return typeof e==="function"}function V(e){switch(O(e)){case 3:return true;case 4:return true;default:return false}}function Z(e,t){return e===t||e!==e&&t!==t}function Q(e,t){var r=e[t];if(r===undefined||r===null)return undefined;if(!L(r))throw new TypeError;return r}function Y(e){var t=Q(e,a);if(!L(t))throw new TypeError;var r=t.call(e);if(!M(r))throw new TypeError;return r}function J(e){return e.value}function ee(e){var t=e.next();return t.done?false:t}function te(e){var t=e["return"];if(t)t.call(e)}function re(e){var t=Object.getPrototypeOf(e);if(typeof e!=="function"||e===f)return t;if(t!==f)return t;var r=e.prototype;var i=r&&Object.getPrototypeOf(r);if(i==null||i===Object.prototype)return t;var n=i.constructor;if(typeof n!=="function")return t;if(n===e)return t;return n}function ie(){var e;if(!j(d)&&typeof t.Reflect!=="undefined"&&!(d in t.Reflect)&&typeof t.Reflect.defineMetadata==="function"){e=se(t.Reflect)}var r;var i;var n;var a=new l;var s={registerProvider:o,getProvider:u,setProvider:_};return s;function o(t){if(!Object.isExtensible(s)){throw new Error("Cannot add provider to a frozen registry.")}switch(true){case e===t:break;case j(r):r=t;break;case r===t:break;case j(i):i=t;break;case i===t:break;default:if(n===undefined)n=new v;n.add(t);break}}function c(t,a){if(!j(r)){if(r.isProviderFor(t,a))return r;if(!j(i)){if(i.isProviderFor(t,a))return r;if(!j(n)){var s=Y(n);while(true){var o=ee(s);if(!o){return undefined}var c=J(o);if(c.isProviderFor(t,a)){te(s);return c}}}}}if(!j(e)&&e.isProviderFor(t,a)){return e}return undefined}function u(e,t){var r=a.get(e);var i;if(!j(r)){i=r.get(t)}if(!j(i)){return i}i=c(e,t);if(!j(i)){if(j(r)){r=new h;a.set(e,r)}r.set(t,i)}return i}function f(e){if(j(e))throw new TypeError;return r===e||i===e||!j(n)&&n.has(e)}function _(e,t,r){if(!f(r)){throw new Error("Metadata provider not registered.")}var i=u(e,t);if(i!==r){if(!j(i)){return false}var n=a.get(e);if(j(n)){n=new h;a.set(e,n)}n.set(t,r)}return true}}function ne(){var e;if(!j(d)&&M(t.Reflect)&&Object.isExtensible(t.Reflect)){e=t.Reflect[d]}if(j(e)){e=ie()}if(!j(d)&&M(t.Reflect)&&Object.isExtensible(t.Reflect)){Object.defineProperty(t.Reflect,d,{enumerable:false,configurable:false,writable:false,value:e})}return e}function ae(e){var t=new l;var r={isProviderFor:function(e,r){var i=t.get(e);if(j(i))return false;return i.has(r)},OrdinaryDefineOwnMetadata:s,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:a,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:c};_.registerProvider(r);return r;function i(i,n,a){var s=t.get(i);var o=false;if(j(s)){if(!a)return undefined;s=new h;t.set(i,s);o=true}var c=s.get(n);if(j(c)){if(!a)return undefined;c=new h;s.set(n,c);if(!e.setProvider(i,n,r)){s.delete(n);if(o){t.delete(i)}throw new Error("Wrong provider for target.")}}return c}function n(e,t,r){var n=i(t,r,false);if(j(n))return false;return U(n.has(e))}function a(e,t,r){var n=i(t,r,false);if(j(n))return undefined;return n.get(e)}function s(e,t,r,n){var a=i(r,n,true);a.set(e,t)}function o(e,t){var r=[];var n=i(e,t,false);if(j(n))return r;var a=n.keys();var s=Y(a);var o=0;while(true){var c=ee(s);if(!c){r.length=o;return r}var u=J(c);try{r[o]=u}catch(e){try{te(s)}finally{throw e}}o++}}function c(e,r,n){var a=i(r,n,false);if(j(a))return false;if(!a.delete(e))return false;if(a.size===0){var s=t.get(r);if(!j(s)){s.delete(n);if(s.size===0){t.delete(s)}}}return true}}function se(e){var t=e.defineMetadata,r=e.hasOwnMetadata,i=e.getOwnMetadata,n=e.getOwnMetadataKeys,a=e.deleteMetadata;var s=new l;var o={isProviderFor:function(e,t){var r=s.get(e);if(!j(r)&&r.has(t)){return true}if(n(e,t).length){if(j(r)){r=new v;s.set(e,r)}r.add(t);return true}return false},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:i,OrdinaryOwnMetadataKeys:n,OrdinaryDeleteMetadata:a};return o}function oe(e,t,r){var i=_.getProvider(e,t);if(!j(i)){return i}if(r){if(_.setProvider(e,t,p)){return p}throw new Error("Illegal state.")}return undefined}function ce(){var e={};var t=[];var r=function(){function e(e,t,r){this._index=0;this._keys=e;this._values=t;this._selector=r}e.prototype["@@iterator"]=function(){return this};e.prototype[a]=function(){return this};e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);if(e+1>=this._keys.length){this._index=-1;this._keys=t;this._values=t}else{this._index++}return{value:r,done:false}}return{value:undefined,done:true}};e.prototype.throw=function(e){if(this._index>=0){this._index=-1;this._keys=t;this._values=t}throw e};e.prototype.return=function(e){if(this._index>=0){this._index=-1;this._keys=t;this._values=t}return{value:e,done:true}};return e}();var i=function(){function t(){this._keys=[];this._values=[];this._cacheKey=e;this._cacheIndex=-2}Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:true,configurable:true});t.prototype.has=function(e){return this._find(e,false)>=0};t.prototype.get=function(e){var t=this._find(e,false);return t>=0?this._values[t]:undefined};t.prototype.set=function(e,t){var r=this._find(e,true);this._values[r]=t;return this};t.prototype.delete=function(t){var r=this._find(t,false);if(r>=0){var i=this._keys.length;for(var n=r+1;n<i;n++){this._keys[n-1]=this._keys[n];this._values[n-1]=this._values[n]}this._keys.length--;this._values.length--;if(Z(t,this._cacheKey)){this._cacheKey=e;this._cacheIndex=-2}return true}return false};t.prototype.clear=function(){this._keys.length=0;this._values.length=0;this._cacheKey=e;this._cacheIndex=-2};t.prototype.keys=function(){return new r(this._keys,this._values,n)};t.prototype.values=function(){return new r(this._keys,this._values,s)};t.prototype.entries=function(){return new r(this._keys,this._values,o)};t.prototype["@@iterator"]=function(){return this.entries()};t.prototype[a]=function(){return this.entries()};t.prototype._find=function(e,t){if(!Z(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++){if(Z(this._keys[r],e)){this._cacheIndex=r;break}}}if(this._cacheIndex<0&&t){this._cacheIndex=this._keys.length;this._keys.push(e);this._values.push(undefined)}return this._cacheIndex};return t}();return i;function n(e,t){return e}function s(e,t){return t}function o(e,t){return[e,t]}}function ue(){var e=function(){function e(){this._map=new h}Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:true,configurable:true});e.prototype.has=function(e){return this._map.has(e)};e.prototype.add=function(e){return this._map.set(e,e),this};e.prototype.delete=function(e){return this._map.delete(e)};e.prototype.clear=function(){this._map.clear()};e.prototype.keys=function(){return this._map.keys()};e.prototype.values=function(){return this._map.keys()};e.prototype.entries=function(){return this._map.entries()};e.prototype["@@iterator"]=function(){return this.keys()};e.prototype[a]=function(){return this.keys()};return e}();return e}function fe(){var e=16;var t=u.create();var i=n();return function(){function e(){this._key=n()}e.prototype.has=function(e){var t=a(e,false);return t!==undefined?u.has(t,this._key):false};e.prototype.get=function(e){var t=a(e,false);return t!==undefined?u.get(t,this._key):undefined};e.prototype.set=function(e,t){var r=a(e,true);r[this._key]=t;return this};e.prototype.delete=function(e){var t=a(e,false);return t!==undefined?delete t[this._key]:false};e.prototype.clear=function(){this._key=n()};return e}();function n(){var e;do{e="@@WeakMap@@"+c()}while(u.has(t,e));t[e]=true;return e}function a(e,t){if(!r.call(e,i)){if(!t)return undefined;Object.defineProperty(e,i,{value:u.create()})}return e[i]}function s(e,t){for(var r=0;r<t;++r)e[r]=Math.random()*255|0;return e}function o(e){if(typeof Uint8Array==="function"){var t=new Uint8Array(e);if(typeof crypto!=="undefined"){crypto.getRandomValues(t)}else if(typeof msCrypto!=="undefined"){msCrypto.getRandomValues(t)}else{s(t,e)}return t}return s(new Array(e),e)}function c(){var t=o(e);t[6]=t[6]&79|64;t[8]=t[8]&191|128;var r="";for(var i=0;i<e;++i){var n=t[i];if(i===4||i===6||i===8)r+="-";if(n<16)r+="0";r+=n.toString(16).toLowerCase()}return r}}function he(e){e.__=undefined;delete e.__;return e}}))})(e||(e={}));return _Reflect}require_Reflect();var Lifecycle;(function(e){e[e["Transient"]=0]="Transient";e[e["Singleton"]=1]="Singleton";e[e["ResolutionScoped"]=2]="ResolutionScoped";e[e["ContainerScoped"]=3]="ContainerScoped"})(Lifecycle||(Lifecycle={}));var Lifecycle$1=Lifecycle;var INJECTION_TOKEN_METADATA_KEY="injectionTokens";function getParamInfo(e){var t=Reflect.getMetadata("design:paramtypes",e)||[];var r=Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY,e)||{};Object.keys(r).forEach((function(e){t[+e]=r[e]}));return t} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function __awaiter(e,t,r,i){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(t,r){function a(e){try{o(i.next(e))}catch(e){r(e)}}function s(e){try{o(i["throw"](e))}catch(e){r(e)}}function o(e){e.done?t(e.value):n(e.value).then(a,s)}o((i=i.apply(e,[])).next())}))}function isClassProvider(e){return!!e.useClass}function isFactoryProvider(e){return!!e.useFactory}var DelayedConstructor=function(){function e(e){this.wrap=e;this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}e.prototype.createProxy=function(e){var t=this;var r={};var i=false;var n;var a=function(){if(!i){n=e(t.wrap());i=true}return n};return new Proxy(r,this.createHandler(a))};e.prototype.createHandler=function(e){var t={};var r=function(r){t[r]=function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}t[0]=e();var n=Reflect[r];return n.apply(void 0,t)}};this.reflectMethods.forEach(r);return t};return e}();function isNormalToken(e){return typeof e==="string"||typeof e==="symbol"}function isTokenDescriptor(e){return typeof e==="object"&&"token"in e&&"multiple"in e}function isTransformDescriptor(e){return typeof e==="object"&&"token"in e&&"transform"in e}function isConstructorToken(e){return typeof e==="function"||e instanceof DelayedConstructor}function isTokenProvider(e){return!!e.useToken}function isValueProvider(e){return e.useValue!=undefined}function isProvider(e){return isClassProvider(e)||isValueProvider(e)||isTokenProvider(e)||isFactoryProvider(e)}var RegistryBase=function(){function e(){this._registryMap=new Map}e.prototype.entries=function(){return this._registryMap.entries()};e.prototype.getAll=function(e){this.ensure(e);return this._registryMap.get(e)};e.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null};e.prototype.set=function(e,t){this.ensure(e);this._registryMap.get(e).push(t)};e.prototype.setAll=function(e,t){this._registryMap.set(e,t)};e.prototype.has=function(e){this.ensure(e);return this._registryMap.get(e).length>0};e.prototype.clear=function(){this._registryMap.clear()};e.prototype.ensure=function(e){if(!this._registryMap.has(e)){this._registryMap.set(e,[])}};return e}();var Registry=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(RegistryBase);var ResolutionContext=function(){function e(){this.scopedResolutions=new Map}return e}();function formatDependency(e,t){if(e===null){return"at position #".concat(t)}var r=e.split(",")[t].trim();return'"'.concat(r,'" at position #').concat(t)}function composeErrorMessage(e,t,r){if(r===void 0){r=" "}return __spreadArray([e],t.message.split("\n").map((function(e){return r+e})),true).join("\n")}function formatErrorCtor(e,t,r){var i=e.toString().match(/constructor\(([\w, ]+)\)/)||[],n=i[1],a=n===void 0?null:n;var s=formatDependency(a,t);return composeErrorMessage("Cannot inject the dependency ".concat(s,' of "').concat(e.name,'" constructor. Reason:'),r)}function isDisposable(e){if(typeof e.dispose!=="function")return false;var t=e.dispose;if(t.length>0){return false}return true}var PreResolutionInterceptors=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(RegistryBase);var PostResolutionInterceptors=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(RegistryBase);var Interceptors=function(){function e(){this.preResolution=new PreResolutionInterceptors;this.postResolution=new PostResolutionInterceptors}return e}();var typeInfo=new Map;var InternalDependencyContainer=function(){function e(e){this.parent=e;this._registry=new Registry;this.interceptors=new Interceptors;this.disposed=false;this.disposables=new Set}e.prototype.register=function(e,t,r){if(r===void 0){r={lifecycle:Lifecycle$1.Transient}}this.ensureNotDisposed();var i;if(!isProvider(t)){i={useClass:t}}else{i=t}if(isTokenProvider(i)){var n=[e];var a=i;while(a!=null){var s=a.useToken;if(n.includes(s)){throw new Error("Token registration cycle detected! ".concat(__spreadArray(__spreadArray([],n,true),[s],false).join(" -> ")))}n.push(s);var o=this._registry.get(s);if(o&&isTokenProvider(o.provider)){a=o.provider}else{a=null}}}if(r.lifecycle===Lifecycle$1.Singleton||r.lifecycle==Lifecycle$1.ContainerScoped||r.lifecycle==Lifecycle$1.ResolutionScoped){if(isValueProvider(i)||isFactoryProvider(i)){throw new Error('Cannot use lifecycle "'.concat(Lifecycle$1[r.lifecycle],'" with ValueProviders or FactoryProviders'))}}this._registry.set(e,{provider:i,options:r});return this};e.prototype.registerType=function(e,t){this.ensureNotDisposed();if(isNormalToken(t)){return this.register(e,{useToken:t})}return this.register(e,{useClass:t})};e.prototype.registerInstance=function(e,t){this.ensureNotDisposed();return this.register(e,{useValue:t})};e.prototype.registerSingleton=function(e,t){this.ensureNotDisposed();if(isNormalToken(e)){if(isNormalToken(t)){return this.register(e,{useToken:t},{lifecycle:Lifecycle$1.Singleton})}else if(t){return this.register(e,{useClass:t},{lifecycle:Lifecycle$1.Singleton})}throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=e;if(t&&!isNormalToken(t)){r=t}return this.register(e,{useClass:r},{lifecycle:Lifecycle$1.Singleton})};e.prototype.resolve=function(e,t,r){if(t===void 0){t=new ResolutionContext}if(r===void 0){r=false}this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&isNormalToken(e)){if(r){return undefined}throw new Error('Attempted to resolve unregistered dependency token: "'.concat(e.toString(),'"'))}this.executePreResolutionInterceptor(e,"Single");if(i){var n=this.resolveRegistration(i,t);this.executePostResolutionInterceptor(e,n,"Single");return n}if(isConstructorToken(e)){var n=this.construct(e,t);this.executePostResolutionInterceptor(e,n,"Single");return n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")};e.prototype.executePreResolutionInterceptor=function(e,t){if(this.interceptors.preResolution.has(e)){var r=[];for(var i=0,n=this.interceptors.preResolution.getAll(e);i<n.length;i++){var a=n[i];if(a.options.frequency!="Once"){r.push(a)}a.callback(e,t)}this.interceptors.preResolution.setAll(e,r)}};e.prototype.executePostResolutionInterceptor=function(e,t,r){if(this.interceptors.postResolution.has(e)){var i=[];for(var n=0,a=this.interceptors.postResolution.getAll(e);n<a.length;n++){var s=a[n];if(s.options.frequency!="Once"){i.push(s)}s.callback(e,t,r)}this.interceptors.postResolution.setAll(e,i)}};e.prototype.resolveRegistration=function(e,t){this.ensureNotDisposed();if(e.options.lifecycle===Lifecycle$1.ResolutionScoped&&t.scopedResolutions.has(e)){return t.scopedResolutions.get(e)}var r=e.options.lifecycle===Lifecycle$1.Singleton;var i=e.options.lifecycle===Lifecycle$1.ContainerScoped;var n=r||i;var a;if(isValueProvider(e.provider)){a=e.provider.useValue}else if(isTokenProvider(e.provider)){a=n?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t)}else if(isClassProvider(e.provider)){a=n?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t)}else if(isFactoryProvider(e.provider)){a=e.provider.useFactory(this)}else{a=this.construct(e.provider,t)}if(e.options.lifecycle===Lifecycle$1.ResolutionScoped){t.scopedResolutions.set(e,a)}return a};e.prototype.resolveAll=function(e,t,r){var i=this;if(t===void 0){t=new ResolutionContext}if(r===void 0){r=false}this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&isNormalToken(e)){if(r){return[]}throw new Error('Attempted to resolve unregistered dependency token: "'.concat(e.toString(),'"'))}this.executePreResolutionInterceptor(e,"All");if(n){var a=n.map((function(e){return i.resolveRegistration(e,t)}));this.executePostResolutionInterceptor(e,a,"All");return a}var s=[this.construct(e,t)];this.executePostResolutionInterceptor(e,s,"All");return s};e.prototype.isRegistered=function(e,t){if(t===void 0){t=false}this.ensureNotDisposed();return this._registry.has(e)||t&&(this.parent||false)&&this.parent.isRegistered(e,true)};e.prototype.reset=function(){this.ensureNotDisposed();this._registry.clear();this.interceptors.preResolution.clear();this.interceptors.postResolution.clear()};e.prototype.clearInstances=function(){this.ensureNotDisposed();for(var e=0,t=this._registry.entries();e<t.length;e++){var r=t[e],i=r[0],n=r[1];this._registry.setAll(i,n.filter((function(e){return!isValueProvider(e.provider)})).map((function(e){e.instance=undefined;return e})))}};e.prototype.createChildContainer=function(){this.ensureNotDisposed();var t=new e(this);for(var r=0,i=this._registry.entries();r<i.length;r++){var n=i[r],a=n[0],s=n[1];if(s.some((function(e){var t=e.options;return t.lifecycle===Lifecycle$1.ContainerScoped}))){t._registry.setAll(a,s.map((function(e){if(e.options.lifecycle===Lifecycle$1.ContainerScoped){return{provider:e.provider,options:e.options}}return e})))}}return t};e.prototype.beforeResolution=function(e,t,r){if(r===void 0){r={frequency:"Always"}}this.interceptors.preResolution.set(e,{callback:t,options:r})};e.prototype.afterResolution=function(e,t,r){if(r===void 0){r={frequency:"Always"}}this.interceptors.postResolution.set(e,{callback:t,options:r})};e.prototype.dispose=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.disposed=true;e=[];this.disposables.forEach((function(t){var r=t.dispose();if(r){e.push(r)}}));return[4,Promise.all(e)];case 1:t.sent();return[2]}}))}))};e.prototype.getRegistration=function(e){if(this.isRegistered(e)){return this._registry.get(e)}if(this.parent){return this.parent.getRegistration(e)}return null};e.prototype.getAllRegistrations=function(e){if(this.isRegistered(e)){return this._registry.getAll(e)}if(this.parent){return this.parent.getAllRegistrations(e)}return null};e.prototype.construct=function(e,t){var r=this;if(e instanceof DelayedConstructor){return e.createProxy((function(e){return r.resolve(e,t)}))}var i=function(){var i=typeInfo.get(e);if(!i||i.length===0){if(e.length===0){return new e}else{throw new Error('TypeInfo not known for "'.concat(e.name,'"'))}}var n=i.map(r.resolveParams(t,e));return new(e.bind.apply(e,__spreadArray([void 0],n,false)))}();if(isDisposable(i)){this.disposables.add(i)}return i};e.prototype.resolveParams=function(e,t){var r=this;return function(i,n){var a,s,o;try{if(isTokenDescriptor(i)){if(isTransformDescriptor(i)){return i.multiple?(a=r.resolve(i.transform)).transform.apply(a,__spreadArray([r.resolveAll(i.token,new ResolutionContext,i.isOptional)],i.transformArgs,false)):(s=r.resolve(i.transform)).transform.apply(s,__spreadArray([r.resolve(i.token,e,i.isOptional)],i.transformArgs,false))}else{return i.multiple?r.resolveAll(i.token,new ResolutionContext,i.isOptional):r.resolve(i.token,e,i.isOptional)}}else if(isTransformDescriptor(i)){return(o=r.resolve(i.transform,e)).transform.apply(o,__spreadArray([r.resolve(i.token,e)],i.transformArgs,false))}return r.resolve(i,e)}catch(e){throw new Error(formatErrorCtor(t,n,e))}}};e.prototype.ensureNotDisposed=function(){if(this.disposed){throw new Error("This container has been disposed, you cannot interact with a disposed container")}};return e}();var instance=new InternalDependencyContainer;function injectable(e){return function(e){typeInfo.set(e,getParamInfo(e))}}if(typeof Reflect==="undefined"||!Reflect.getMetadata){throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.")} /*! * MIT License * * Copyright (c) Peculiar Ventures. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */var diAlgorithm="crypto.algorithm";var AlgorithmProvider=function(){function e(){}e.prototype.getAlgorithms=function(){return instance.resolveAll(diAlgorithm)};e.prototype.toAsnAlgorithm=function(e){for(var t=0,r=this.getAlgorithms();t<r.length;t++){var i=r[t];var n=i.toAsnAlgorithm(e);if(n){return n}}if(/^[0-9.]+$/.test(e.name)){var n=new AlgorithmIdentifier({algorithm:e.name});if("parameters"in e){var a=e;n.parameters=a.parameters}return n}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")};e.prototype.toWebAlgorithm=function(e){for(var t=0,r=this.getAlgorithms();t<r.length;t++){var i=r[t];var n=i.toWebAlgorithm(e);if(n){return n}}var a={name:e.algorithm,parameters:e.parameters};return a};return e}();var diAlgorithmProvider="crypto.algorithmProvider";instance.registerSingleton(diAlgorithmProvider,AlgorithmProvider);var EcAlgorithm_1;var idVersionOne="1.3.36.3.3.2.8.1.1";var idBrainpoolP160r1="".concat(idVersionOne,".1");var idBrainpoolP160t1="".concat(idVersionOne,".2");var idBrainpoolP192r1="".concat(idVersionOne,".3");var idBrainpoolP192t1="".concat(idVersionOne,".4");var idBrainpoolP224r1="".concat(idVersionOne,".5");var idBrainpoolP224t1="".concat(idVersionOne,".6");var idBrainpoolP256r1="".concat(idVersionOne,".7");var idBrainpoolP256t1="".concat(idVersionOne,".8");var idBrainpoolP320r1="".concat(idVersionOne,".9");var idBrainpoolP320t1="".concat(idVersionOne,".10");var idBrainpoolP384r1="".concat(idVersionOne,".11");var idBrainpoolP384t1="".concat(idVersionOne,".12");var idBrainpoolP512r1="".concat(idVersionOne,".13");var idBrainpoolP512t1="".concat(idVersionOne,".14");var brainpoolP160r1="brainpoolP160r1";var brainpoolP160t1="brainpoolP160t1";var brainpoolP192r1="brainpoolP192r1";var brainpoolP192t1="brainpoolP192t1";var brainpoolP224r1="brainpoolP224r1";var brainpoolP224t1="brainpoolP224t1";var brainpoolP256r1="brainpoolP256r1";var brainpoolP256t1="brainpoolP256t1";var brainpoolP320r1="brainpoolP320r1";var brainpoolP320t1="brainpoolP320t1";var brainpoolP384r1="brainpoolP384r1";var brainpoolP384t1="brainpoolP384t1";var brainpoolP512r1="brainpoolP512r1";var brainpoolP512t1="brainpoolP512t1";var ECDSA="ECDSA";var EcAlgorithm=EcAlgorithm_1=function(){function e(){}e.prototype.toAsnAlgorithm=function(e){switch(e.name.toLowerCase()){case ECDSA.toLowerCase():if("hash"in e){var t=typeof e.hash==="string"?e.hash:e.hash.name;switch(t.toLowerCase()){case"sha-1":return ecdsaWithSHA1;case"sha-256":return ecdsaWithSHA256;case"sha-384":return ecdsaWithSHA384;case"sha-512":return ecdsaWithSHA512}}else if("namedCurve"in e){var r="";switch(e.namedCurve){case"P-256":r=id_secp256r1;break;case"K-256":r=EcAlgorithm_1.SECP256K1;break;case"P-384":r=id_secp384r1;break;case"P-521":r=id_secp521r1;break;case brainpoolP160r1:r=idBrainpoolP160r1;break;case brainpoolP160t1:r=idBrainpoolP160t1;break;case brainpoolP192r1:r=idBrainpoolP192r1;break;case brainpoolP192t1:r=idBrainpoolP192t1;break;case brainpoolP224r1:r=idBrainpoolP224r1;break;case brainpoolP224t1:r=idBrainpoolP224t1;break;case brainpoolP256r1:r=idBrainpoolP256r1;break;case brainpoolP256t1:r=idBrainpoolP256t1;break;case brainpoolP320r1:r=idBrainpoolP320r1;break;case brainpoolP320t1:r=idBrainpoolP320t1;break;case brainpoolP384r1:r=idBrainpoolP384r1;break;case brainpoolP384t1:r=idBrainpoolP384t1;break;case brainpoolP512r1:r=idBrainpoolP512r1;break;case brainpoolP512t1:r=idBrainpoolP512t1;break}if(r){return new AlgorithmIdentifier({algorithm:id_ecPublicKey,parameters:AsnConvert.serialize(new ECParameters({namedCurve:r}))})}}}return null};e.prototype.toWebAlgorithm=function(e){switch(e.algorithm){case id_ecdsaWithSHA1:return{name:ECDSA,hash:{name:"SHA-1"}};case id_ecdsaWithSHA256:return{name:ECDSA,hash:{name:"SHA-256"}};case id_ecdsaWithSHA384:return{name:ECDSA,hash:{name:"SHA-384"}};case id_ecdsaWithSHA512:return{name:ECDSA,hash:{name:"SHA-512"}};case id_ecPublicKey:{if(!e.parameters){throw new TypeError("Cannot get required parameters from EC algorithm")}var t=AsnConvert.parse(e.parameters,ECParameters);switch(t.namedCurve){case id_secp256r1:return{name:ECDSA,namedCurve:"P-256"};case EcAlgorithm_1.SECP256K1:return{name:ECDSA,namedCurve:"K-256"};case id_secp384r1:return{name:ECDSA,namedCurve:"P-384"};case id_secp521r1:return{name:ECDSA,namedCurve:"P-521"};case idBrainpoolP160r1:return{name:ECDSA,namedCurve:brainpoolP160r1};case idBrainpoolP160t1:return{name:ECDSA,namedCurve:brainpoolP160t1};case idBrainpoolP192r1:return{name:ECDSA,namedCurve:brainpoolP192r1};case idBrainpoolP192t1:return{name:ECDSA,namedCurve:brainpoolP192t1};case idBrainpoolP224r1:return{name:ECDSA,namedCurve:brainpoolP224r1};case idBrainpoolP224t1:return{name:ECDSA,namedCurve:brainpoolP224t1};case idBrainpoolP256r1:return{name:ECDSA,namedCurve:brainpoolP256r1};case idBrainpoolP256t1:return{name:ECDSA,namedCurve:brainpoolP256t1};case idBrainpoolP320r1:return{name:ECDSA,namedCurve:brainpoolP320r1};case idBrainpoolP320t1:return{name:ECDSA,namedCurve:brainpoolP320t1};case idBrainpoolP384r1:return{name:ECDSA,namedCurve:brainpoolP384r1};case idBrainpoolP384t1:return{name:ECDSA,namedCurve:brainpoolP384t1};case idBrainpoolP512r1:return{name:ECDSA,namedCurve:brainpoolP512r1};case idBrainpoolP512t1:return{name:ECDSA,namedCurve:brainpoolP512t1}}}}return null};return e}();EcAlgorithm.SECP256K1="1.3.132.0.10";EcAlgorithm=EcAlgorithm_1=__decorate([injectable()],EcAlgorithm);instance.registerSingleton(diAlgorithm,EcAlgorithm);var NAME=Symbol("name");var VALUE=Symbol("value");var TextObject=function(){function e(e,t,r){if(t===void 0){t={}}if(r===void 0){r=""}this[NAME]=e;this[VALUE]=r;for(var i in t){this[i]=t[i]}}return e}();TextObject.NAME=NAME;TextObject.VALUE=VALUE;var DefaultAlgorithmSerializer=function(){function e(){}e.toTextObject=function(e){var t=new TextObject("Algorithm Identifier",{},OidSerializer.toString(e.algorithm));if(e.parameters){switch(e.algorithm){case id_ecPublicKey:{var r=(new EcAlgorithm).toWebAlgorithm(e);if(r&&"namedCurve"in r){t["Named Curve"]=r.namedCurve}else{t["Parameters"]=e.parameters}break}default:t["Parameters"]=e.parameters}}return t};return e}();var OidSerializer=function(){function e(){}e.toString=function(e){var t=this.items[e];if(t){return t}return e};return e}();OidSerializer.items=(_e={},_e[id_sha1]="sha1",_e[id_sha224]="sha224",_e[id_sha256]="sha256",_e[id_sha384]="sha384",_e[id_sha512]="sha512",_e[id_rsaEncryption]="rsaEncryption",_e[id_sha1WithRSAEncryption]="sha1WithRSAEncryption",_e[id_sha224WithRSAEncryption]="sha224WithRSAEncryption",_e[id_sha256WithRSAEncryption]="sha256WithRSAEncryption",_e[id_sha384WithRSAEncryption]="sha384WithRSAEncryption",_e[id_sha512WithRSAEncryption]="sha512WithRSAEncryption",_e[id_ecPublicKey]="ecPublicKey",_e[id_ecdsaWithSHA1]="ecdsaWithSHA1",_e[id_ecdsaWithSHA224]="ecdsaWithSHA224",_e[id_ecdsaWithSHA256]="ecdsaWithSHA256",_e[id_ecdsaWithSHA384]="ecdsaWithSHA384",_e[id_ecdsaWithSHA512]="ecdsaWithSHA512",_e[id_kp_serverAuth]="TLS WWW server authentication",_e[id_kp_clientAuth]="TLS WWW client authentication",_e[id_kp_codeSigning]="Code Signing",_e[id_kp_emailProtection]="E-mail Protection",_e[id_kp_timeStamping]="Time Stamping",_e[id_kp_OCSPSigning]="OCSP Signing",_e[id_signedData]="Signed Data",_e);var TextConverter=function(){function e(){}e.serialize=function(e){return this.serializeObj(e).join("\n")};e.pad=function(e){if(e===void 0){e=0}return"".padStart(2*e," ")};e.serializeObj=function(e,t){if(t===void 0){t=0}var r=[];var i=this.pad(t++);var n="";var a=e[TextObject.VALUE];if(a){n=" ".concat(a)}r.push("".concat(i).concat(e[TextObject.NAME],":").concat(n));i=this.pad(t);for(var s in e){if(typeof s==="symbol"){continue}var o=e[s];var c=s?"".concat(s,": "):"";if(typeof o==="string"||typeof o==="number"||typeof o==="boolean"){r.push("".concat(i).concat(c).concat(o))}else if(o instanceof Date){r.push("".concat(i).concat(c).concat(o.toUTCString()))}else if(Array.isArray(o)){for(var u=0,f=o;u<f.length;u++){var h=f[u];h[TextObject.NAME]=s;r.push.apply(r,this.serializeObj(h,t))}}else if(o instanceof TextObject){o[TextObject.NAME]=s;r.push.apply(r,this.serializeObj(o,t))}else if(buildExports.BufferSourceConverter.isBufferSource(o)){if(s){r.push("".concat(i).concat(c));r.push.apply(r,this.serializeBufferSource(o,t+1))}else{r.push.apply(r,this.serializeBufferSource(o,t))}}else if("toTextObject"in o){var v=o.toTextObject();v[TextObject.NAME]=s;r.push.apply(r,this.serializeObj(v,t))}else{throw new TypeError("Cannot serialize data in text format. Unsupported type.")}}return r};e.serializeBufferSource=function(e,t){if(t===void 0){t=0}var r=this.pad(t);var i=buildExports.BufferSourceConverter.toUint8Array(e);var n=[];for(var a=0;a<i.length;){var s=[];for(var o=0;o<16&&a<i.length;o++){if(o===8){s.push("")}var c=i[a++].toString(16).padStart(2,"0");s.push(c)}n.push("".concat(r).concat(s.join(" ")))}return n};e.serializeAlgorithm=function(e){return this.algorithmSerializer.toTextObject(e)};return e}();TextConverter.oidSerializer=OidSerializer;TextConverter.algorithmSerializer=DefaultAlgorithmSerializer;var _AsnData_rawData;var AsnData$1=function(){function e(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}_AsnData_rawData.set(this,void 0);if(buildExports.BufferSourceConverter.isBufferSource(e[0])){this.asn=AsnConvert.parse(e[0],e[1]);__classPrivateFieldSet$1(this,_AsnData_rawData,buildExports.BufferSourceConverter.toArrayBuffer(e[0]),"f");this.onInit(this.asn)}else{this.asn=e[0];this.onInit(this.asn)}}Object.defineProperty(e.prototype,"rawData",{get:function(){if(!__classPrivateFieldGet$1(this,_AsnData_rawData,"f")){__classPrivateFieldSet$1(this,_AsnData_rawData,AsnConvert.serialize(this.asn),"f")}return __classPrivateFieldGet$1(this,_AsnData_rawData,"f")},enumerable:false,configurable:true});e.prototype.equal=function(t){if(t instanceof e){return buildExports.isEqual(t.rawData,this.rawData)}return false};e.prototype.toString=function(e){if(e===void 0){e="text"}switch(e){case"asn":return AsnConvert.toString(this.rawData);case"text":return TextConverter.serialize(this.toTextObject());case"hex":return buildExports.Convert.ToHex(this.rawData);case"base64":return buildExports.Convert.ToBase64(this.rawData);case"base64url":return buildExports.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}};e.prototype.getTextName=function(){var e=this.constructor;return e.NAME};e.prototype.toTextObject=function(){var e=this.toTextObjectEmpty();e[""]=this.rawData;return e};e.prototype.toTextObjectEmpty=function(e){return new TextObject(this.getTextName(),{},e)};return e}();_AsnData_rawData=new WeakMap;AsnData$1.NAME="ASN";var Extension$1=function(e){__extends(t,e);function t(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}var i;if(buildExports.BufferSourceConverter.isBufferSource(t[0])){i=buildExports.BufferSourceConverter.toArrayBuffer(t[0])}else{i=AsnConvert.serialize(new Extension$2({extnID:t[0],critical:t[1],extnValue:new OctetString(buildExports.BufferSourceConverter.toArrayBuffer(t[2]))}))}return e.call(this,i,Extension$2)||this}t.prototype.onInit=function(e){this.type=e.extnID;this.critical=e.critical;this.value=e.extnValue.buffer};t.prototype.toTextObject=function(){var e=this.toTextObjectWithoutValue();e[""]=this.value;return e};t.prototype.toTextObjectWithoutValue=function(){var e=this.toTextObjectEmpty(this.critical?"critical":undefined);if(e[TextObject.NAME]===t.NAME){e[TextObject.NAME]=OidSerializer.toString(this.type)}return e};return t}(AsnData$1);var _a;var CryptoProvider=function(){function e(){this.items=new Map;this[_a]="CryptoProvider";if(typeof self!=="undefined"&&typeof crypto!=="undefined"){this.set(e.DEFAULT,crypto)}else if(typeof global!=="undefined"&&global.crypto&&global.crypto.subtle){this.set(e.DEFAULT,global.crypto)}}e.isCryptoKeyPair=function(e){return e&&e.privateKey&&e.publicKey};e.isCryptoKey=function(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==undefined};e.prototype.clear=function(){this.items.clear()};e.prototype.delete=function(e){return this.items.delete(e)};e.prototype.forEach=function(e,t){return this.items.forEach(e,t)};e.prototype.has=function(e){return this.items.has(e)};Object.defineProperty(e.prototype,"size",{get:function(){return this.items.size},enumerable:false,configurable:true});e.prototype.entries=function(){return this.items.entries()};e.prototype.keys=function(){return this.items.keys()};e.prototype.values=function(){return this.items.values()};e.prototype[Symbol.iterator]=function(){return this.items[Symbol.iterator]()};e.prototype.get=function(t){if(t===void 0){t=e.DEFAULT}var r=this.items.get(t.toLowerCase());if(!r){throw new Error("Cannot get Crypto by name '".concat(t,"'"))}return r};e.prototype.set=function(t,r){if(typeof t==="string"){if(!r){throw new TypeError("Argument 'value' is required")}this.items.set(t.toLowerCase(),r)}else{this.items.set(e.DEFAULT,t)}return