UNPKG

@peculiar/fortify-webcomponents

Version:

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

63 lines (59 loc) 150 kB
var __extends=this&&this.__extends||function(){var r=function(e,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]};return r(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))r[i]=e[i]}return r};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(r,e,t,n){function i(r){return r instanceof t?r:new t((function(e){e(r)}))}return new(t||(t=Promise))((function(t,a){function u(r){try{s(n.next(r))}catch(r){a(r)}}function o(r){try{s(n["throw"](r))}catch(r){a(r)}}function s(r){r.done?t(r.value):i(r.value).then(u,o)}s((n=n.apply(r,e||[])).next())}))};var __generator=this&&this.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=o(0),u["throw"]=o(1),u["return"]=o(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function o(r){return function(e){return s([r,e])}}function s(o){if(n)throw new TypeError("Generator is already executing.");while(u&&(u=0,o[0]&&(t=0)),t)try{if(n=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;i=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=e.call(r,t)}catch(r){o=[6,r];i=0}finally{n=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(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++){if(a||!(n in e)){if(!a)a=Array.prototype.slice.call(e,0,n);a[n]=e[n]}}return r.concat(a||Array.prototype.slice.call(e))}; /*! * © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License */System.register(["./p-8E_LW63I.system.js","./p-CRHUQn_z.system.js","./p-xc8K752f.system.js","./p-ClEl0eaZ.system.js","./p-C9-FNG3w.system.js"],(function(r,e){"use strict";var t,n,i,a,u,o,s,c,f,v,h,l,d,p,w,m,y,g,b,_,z,A,k,E,S,C,M,O,P,j,x,H,T,R,W,I,N,K,D,U,V,B,F,L,Z,G,q,$,X,Q,Y,J,rr,er,tr,nr,ir,ar,ur,or,sr,cr,fr,vr,hr,lr,dr,pr,wr,mr,yr,gr,br,_r,zr,Ar,kr,Er,Sr,Cr,Mr,Or,Pr,jr,xr,Hr,Tr,Rr,Wr,Ir,Nr,Kr,Dr,Ur,Vr,Br,Fr,Lr,Zr,Gr;return{setters:[function(r){t=r.k;n=r.bo;i=r.bd;a=r.bf;u=r.b9;o=r.b5;s=r.a$;c=r.bg;f=r.b1;v=r.bc;h=r.bh;l=r.b6;d=r.H;p=r.F;w=r.bp;m=r.bq;y=r.br;g=r.bs;b=r.bt;_=r.a;z=r.i;A=r.E;k=r.bu;E=r.bv;S=r.bw;C=r.bx;M=r.by;O=r.bz;P=r.bA;j=r.b;x=r.aD;H=r.bB;T=r.bC;R=r.bD;W=r.bE;I=r.bF;N=r.bG;K=r.bH;D=r.bI;U=r.c;V=r.bJ;B=r.bK;F=r.bL;L=r.bM;Z=r.aF;G=r.az;q=r.av;$=r.ap;X=r.aG;Q=r.bN;Y=r.bO;J=r.ar;rr=r.bP;er=r.bQ;tr=r.bR;nr=r.aC;ir=r.aH;ar=r.bS;ur=r.bT;or=r.bU;sr=r.bV;cr=r.u;fr=r.bW;vr=r.a4;hr=r.bX;lr=r.O;dr=r.bY;pr=r.R;wr=r.bZ;mr=r.b_;yr=r.bn;gr=r.b$;br=r.c0;_r=r.q;zr=r.c1;Ar=r.c2;kr=r.c3;Er=r.c4;Sr=r.C;Cr=r.c5;Mr=r.c6;Or=r.c7;Pr=r.a0;jr=r.c8;xr=r.c9;Hr=r.ca;Tr=r.cb;Rr=r.cc;Wr=r.cd;Ir=r.ce;Nr=r.cf;Kr=r.cg;Dr=r.ch;Ur=r.r;Vr=r.a_;Br=r.ao},function(r){Fr=r.a},function(r){Lr=r.h},function(r){Zr=r.getString},function(r){Gr=r.T}],execute:function(){var qr;var $r=this; /** * @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(r,e){return new Uint8Array(Array.prototype.slice.call(this,r,e))}})}var Xr=function(){return ze($r,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:if(!!window["protobuf"])return[3,2];return[4,e.import("./p-BOdo9ul_.system.js").then((function(r){return r.p}))];case 1:r.sent();r.label=2;case 2:if(!!window["WebcryptoSocket"])return[3,4];return[4,e.import("./p-LNx19DPO.system.js")];case 3:r.sent();r.label=4;case 4:return[2]}}))}))};var Qr=/iPhone/i;var Yr=/iPod/i;var Jr=/iPad/i;var re=/\biOS-universal(?:.+)Mac\b/i;var ee=/\bAndroid(?:.+)Mobile\b/i;var te=/Android/i;var ne=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i;var ie=/Silk/i;var ae=/Windows Phone/i;var ue=/\bWindows(?:.+)ARM\b/i;var oe=/BlackBerry/i;var se=/BB10/i;var ce=/Opera Mini/i;var fe=/\b(CriOS|Chrome)(?:.+)Mobile/i;var ve=/Mobile(?:.+)Firefox\b/i;var he=function(r){return typeof r!=="undefined"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints==="number"&&r.maxTouchPoints>1&&typeof MSStream==="undefined"};function le(r){return function(e){return e.test(r)}}function de(r){var e={userAgent:"",platform:"",maxTouchPoints:0};if(!r&&typeof navigator!=="undefined"){e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}}else if(typeof r==="string"){e.userAgent=r}else if(r&&r.userAgent){e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0}}var t=e.userAgent;var n=t.split("[FBAN");if(typeof n[1]!=="undefined"){t=n[0]}n=t.split("Twitter");if(typeof n[1]!=="undefined"){t=n[0]}var i=le(t);var a={apple:{phone:i(Qr)&&!i(ae),ipod:i(Yr),tablet:!i(Qr)&&(i(Jr)||he(e))&&!i(ae),universal:i(re),device:(i(Qr)||i(Yr)||i(Jr)||i(re)||he(e))&&!i(ae)},amazon:{phone:i(ne),tablet:!i(ne)&&i(ie),device:i(ne)||i(ie)},android:{phone:!i(ae)&&i(ne)||!i(ae)&&i(ee),tablet:!i(ae)&&!i(ne)&&!i(ee)&&(i(ie)||i(te)),device:!i(ae)&&(i(ne)||i(ie)||i(ee)||i(te))||i(/\bokhttp\b/i)},windows:{phone:i(ae),tablet:i(ue),device:i(ae)||i(ue)},other:{blackberry:i(oe),blackberry10:i(se),opera:i(ce),firefox:i(ve),chrome:i(fe),device:i(oe)||i(se)||i(ce)||i(ve)||i(fe)},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 pe={}; /*! ***************************************************************************** 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 we;function me(){if(we)return pe;we=1;var r;(function(r){(function(e){var n=typeof globalThis==="object"?globalThis:typeof t==="object"?t:typeof self==="object"?self:typeof this==="object"?this:s();var i=a(r);if(typeof n.Reflect!=="undefined"){i=a(n.Reflect,i)}e(i,n);if(typeof n.Reflect==="undefined"){n.Reflect=r}function a(r,e){return function(t,n){Object.defineProperty(r,t,{configurable:true,writable:true,value:n});if(e)e(t,n)}}function u(){try{return Function("return this;")()}catch(r){}}function o(){try{return(0,eval)("(function() { return this; })()")}catch(r){}}function s(){return u()||o()}})((function(r,e){var t=Object.prototype.hasOwnProperty;var n=typeof Symbol==="function";var i=n&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var a=n&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var u=typeof Object.create==="function";var o={__proto__:[]}instanceof Array;var s=!u&&!o;var c={create:u?function(){return vr(Object.create(null))}:o?function(){return vr({__proto__:null})}:function(){return vr({})},has:s?function(r,e){return t.call(r,e)}:function(r,e){return e in r},get:s?function(r,e){return t.call(r,e)?r[e]:undefined}:function(r,e){return r[e]}};var f=Object.getPrototypeOf(Function);var v=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:sr();var h=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:cr();var l=typeof WeakMap==="function"?WeakMap:fr();var d=n?Symbol.for("@reflect-metadata:registry"):undefined;var p=ir();var w=ar(p);function m(r,e,t,n){if(!I(t)){if(!Z(r))throw new TypeError;if(!D(e))throw new TypeError;if(!D(n)&&!I(n)&&!N(n))throw new TypeError;if(N(n))n=undefined;t=L(t);return M(r,e,t,n)}else{if(!Z(r))throw new TypeError;if(!q(e))throw new TypeError;return C(r,e)}}r("decorate",m);function y(r,e){function t(t,n){if(!D(t))throw new TypeError;if(!I(n)&&!$(n))throw new TypeError;H(r,e,t,n)}return t}r("metadata",y);function g(r,e,t,n){if(!D(t))throw new TypeError;if(!I(n))n=L(n);return H(r,e,t,n)}r("defineMetadata",g);function b(r,e,t){if(!D(e))throw new TypeError;if(!I(t))t=L(t);return O(r,e,t)}r("hasMetadata",b);function _(r,e,t){if(!D(e))throw new TypeError;if(!I(t))t=L(t);return P(r,e,t)}r("hasOwnMetadata",_);function z(r,e,t){if(!D(e))throw new TypeError;if(!I(t))t=L(t);return j(r,e,t)}r("getMetadata",z);function A(r,e,t){if(!D(e))throw new TypeError;if(!I(t))t=L(t);return x(r,e,t)}r("getOwnMetadata",A);function k(r,e){if(!D(r))throw new TypeError;if(!I(e))e=L(e);return T(r,e)}r("getMetadataKeys",k);function E(r,e){if(!D(r))throw new TypeError;if(!I(e))e=L(e);return R(r,e)}r("getOwnMetadataKeys",E);function S(r,e,t){if(!D(e))throw new TypeError;if(!I(t))t=L(t);if(!D(e))throw new TypeError;if(!I(t))t=L(t);var n=or(e,t,false);if(I(n))return false;return n.OrdinaryDeleteMetadata(r,e,t)}r("deleteMetadata",S);function C(r,e){for(var t=r.length-1;t>=0;--t){var n=r[t];var i=n(e);if(!I(i)&&!N(i)){if(!q(i))throw new TypeError;e=i}}return e}function M(r,e,t,n){for(var i=r.length-1;i>=0;--i){var a=r[i];var u=a(e,t,n);if(!I(u)&&!N(u)){if(!D(u))throw new TypeError;n=u}}return n}function O(r,e,t){var n=P(r,e,t);if(n)return true;var i=tr(e);if(!N(i))return O(r,i,t);return false}function P(r,e,t){var n=or(e,t,false);if(I(n))return false;return B(n.OrdinaryHasOwnMetadata(r,e,t))}function j(r,e,t){var n=P(r,e,t);if(n)return x(r,e,t);var i=tr(e);if(!N(i))return j(r,i,t);return undefined}function x(r,e,t){var n=or(e,t,false);if(I(n))return;return n.OrdinaryGetOwnMetadata(r,e,t)}function H(r,e,t,n){var i=or(t,n,true);i.OrdinaryDefineOwnMetadata(r,e,t,n)}function T(r,e){var t=R(r,e);var n=tr(r);if(n===null)return t;var i=T(n,e);if(i.length<=0)return t;if(t.length<=0)return i;var a=new h;var u=[];for(var o=0,s=t;o<s.length;o++){var c=s[o];var f=a.has(c);if(!f){a.add(c);u.push(c)}}for(var v=0,l=i;v<l.length;v++){var c=l[v];var f=a.has(c);if(!f){a.add(c);u.push(c)}}return u}function R(r,e){var t=or(r,e,false);if(!t){return[]}return t.OrdinaryOwnMetadataKeys(r,e)}function W(r){if(r===null)return 1;switch(typeof r){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return r===null?1:6;default:return 6}}function I(r){return r===undefined}function N(r){return r===null}function K(r){return typeof r==="symbol"}function D(r){return typeof r==="object"?r!==null:typeof r==="function"}function U(r,e){switch(W(r)){case 0:return r;case 1:return r;case 2:return r;case 3:return r;case 4:return r;case 5:return r}var t="string";var n=Q(r,i);if(n!==undefined){var a=n.call(r,t);if(D(a))throw new TypeError;return a}return V(r)}function V(r,e){var t,n,i;{var a=r.toString;if(G(a)){var n=a.call(r);if(!D(n))return n}var t=r.valueOf;if(G(t)){var n=t.call(r);if(!D(n))return n}}throw new TypeError}function B(r){return!!r}function F(r){return""+r}function L(r){var e=U(r);if(K(e))return e;return F(e)}function Z(r){return Array.isArray?Array.isArray(r):r instanceof Object?r instanceof Array:Object.prototype.toString.call(r)==="[object Array]"}function G(r){return typeof r==="function"}function q(r){return typeof r==="function"}function $(r){switch(W(r)){case 3:return true;case 4:return true;default:return false}}function X(r,e){return r===e||r!==r&&e!==e}function Q(r,e){var t=r[e];if(t===undefined||t===null)return undefined;if(!G(t))throw new TypeError;return t}function Y(r){var e=Q(r,a);if(!G(e))throw new TypeError;var t=e.call(r);if(!D(t))throw new TypeError;return t}function J(r){return r.value}function rr(r){var e=r.next();return e.done?false:e}function er(r){var e=r["return"];if(e)e.call(r)}function tr(r){var e=Object.getPrototypeOf(r);if(typeof r!=="function"||r===f)return e;if(e!==f)return e;var t=r.prototype;var n=t&&Object.getPrototypeOf(t);if(n==null||n===Object.prototype)return e;var i=n.constructor;if(typeof i!=="function")return e;if(i===r)return e;return i}function nr(){var r;if(!I(d)&&typeof e.Reflect!=="undefined"&&!(d in e.Reflect)&&typeof e.Reflect.defineMetadata==="function"){r=ur(e.Reflect)}var t;var n;var i;var a=new l;var u={registerProvider:o,getProvider:c,setProvider:p};return u;function o(e){if(!Object.isExtensible(u)){throw new Error("Cannot add provider to a frozen registry.")}switch(true){case r===e:break;case I(t):t=e;break;case t===e:break;case I(n):n=e;break;case n===e:break;default:if(i===undefined)i=new h;i.add(e);break}}function s(e,a){if(!I(t)){if(t.isProviderFor(e,a))return t;if(!I(n)){if(n.isProviderFor(e,a))return t;if(!I(i)){var u=Y(i);while(true){var o=rr(u);if(!o){return undefined}var s=J(o);if(s.isProviderFor(e,a)){er(u);return s}}}}}if(!I(r)&&r.isProviderFor(e,a)){return r}return undefined}function c(r,e){var t=a.get(r);var n;if(!I(t)){n=t.get(e)}if(!I(n)){return n}n=s(r,e);if(!I(n)){if(I(t)){t=new v;a.set(r,t)}t.set(e,n)}return n}function f(r){if(I(r))throw new TypeError;return t===r||n===r||!I(i)&&i.has(r)}function p(r,e,t){if(!f(t)){throw new Error("Metadata provider not registered.")}var n=c(r,e);if(n!==t){if(!I(n)){return false}var i=a.get(r);if(I(i)){i=new v;a.set(r,i)}i.set(e,t)}return true}}function ir(){var r;if(!I(d)&&D(e.Reflect)&&Object.isExtensible(e.Reflect)){r=e.Reflect[d]}if(I(r)){r=nr()}if(!I(d)&&D(e.Reflect)&&Object.isExtensible(e.Reflect)){Object.defineProperty(e.Reflect,d,{enumerable:false,configurable:false,writable:false,value:r})}return r}function ar(r){var e=new l;var t={isProviderFor:function(r,t){var n=e.get(r);if(I(n))return false;return n.has(t)},OrdinaryDefineOwnMetadata:u,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:a,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:s};p.registerProvider(t);return t;function n(n,i,a){var u=e.get(n);var o=false;if(I(u)){if(!a)return undefined;u=new v;e.set(n,u);o=true}var s=u.get(i);if(I(s)){if(!a)return undefined;s=new v;u.set(i,s);if(!r.setProvider(n,i,t)){u.delete(i);if(o){e.delete(n)}throw new Error("Wrong provider for target.")}}return s}function i(r,e,t){var i=n(e,t,false);if(I(i))return false;return B(i.has(r))}function a(r,e,t){var i=n(e,t,false);if(I(i))return undefined;return i.get(r)}function u(r,e,t,i){var a=n(t,i,true);a.set(r,e)}function o(r,e){var t=[];var i=n(r,e,false);if(I(i))return t;var a=i.keys();var u=Y(a);var o=0;while(true){var s=rr(u);if(!s){t.length=o;return t}var c=J(s);try{t[o]=c}catch(r){try{er(u)}finally{throw r}}o++}}function s(r,t,i){var a=n(t,i,false);if(I(a))return false;if(!a.delete(r))return false;if(a.size===0){var u=e.get(t);if(!I(u)){u.delete(i);if(u.size===0){e.delete(u)}}}return true}}function ur(r){var e=r.defineMetadata,t=r.hasOwnMetadata,n=r.getOwnMetadata,i=r.getOwnMetadataKeys,a=r.deleteMetadata;var u=new l;var o={isProviderFor:function(r,e){var t=u.get(r);if(!I(t)&&t.has(e)){return true}if(i(r,e).length){if(I(t)){t=new h;u.set(r,t)}t.add(e);return true}return false},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:t,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:a};return o}function or(r,e,t){var n=p.getProvider(r,e);if(!I(n)){return n}if(t){if(p.setProvider(r,e,w)){return w}throw new Error("Illegal state.")}return undefined}function sr(){var r={};var e=[];var t=function(){function r(r,e,t){this._index=0;this._keys=r;this._values=e;this._selector=t}r.prototype["@@iterator"]=function(){return this};r.prototype[a]=function(){return this};r.prototype.next=function(){var r=this._index;if(r>=0&&r<this._keys.length){var t=this._selector(this._keys[r],this._values[r]);if(r+1>=this._keys.length){this._index=-1;this._keys=e;this._values=e}else{this._index++}return{value:t,done:false}}return{value:undefined,done:true}};r.prototype.throw=function(r){if(this._index>=0){this._index=-1;this._keys=e;this._values=e}throw r};r.prototype.return=function(r){if(this._index>=0){this._index=-1;this._keys=e;this._values=e}return{value:r,done:true}};return r}();var n=function(){function e(){this._keys=[];this._values=[];this._cacheKey=r;this._cacheIndex=-2}Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:true,configurable:true});e.prototype.has=function(r){return this._find(r,false)>=0};e.prototype.get=function(r){var e=this._find(r,false);return e>=0?this._values[e]:undefined};e.prototype.set=function(r,e){var t=this._find(r,true);this._values[t]=e;return this};e.prototype.delete=function(e){var t=this._find(e,false);if(t>=0){var n=this._keys.length;for(var i=t+1;i<n;i++){this._keys[i-1]=this._keys[i];this._values[i-1]=this._values[i]}this._keys.length--;this._values.length--;if(X(e,this._cacheKey)){this._cacheKey=r;this._cacheIndex=-2}return true}return false};e.prototype.clear=function(){this._keys.length=0;this._values.length=0;this._cacheKey=r;this._cacheIndex=-2};e.prototype.keys=function(){return new t(this._keys,this._values,i)};e.prototype.values=function(){return new t(this._keys,this._values,u)};e.prototype.entries=function(){return new t(this._keys,this._values,o)};e.prototype["@@iterator"]=function(){return this.entries()};e.prototype[a]=function(){return this.entries()};e.prototype._find=function(r,e){if(!X(this._cacheKey,r)){this._cacheIndex=-1;for(var t=0;t<this._keys.length;t++){if(X(this._keys[t],r)){this._cacheIndex=t;break}}}if(this._cacheIndex<0&&e){this._cacheIndex=this._keys.length;this._keys.push(r);this._values.push(undefined)}return this._cacheIndex};return e}();return n;function i(r,e){return r}function u(r,e){return e}function o(r,e){return[r,e]}}function cr(){var r=function(){function r(){this._map=new v}Object.defineProperty(r.prototype,"size",{get:function(){return this._map.size},enumerable:true,configurable:true});r.prototype.has=function(r){return this._map.has(r)};r.prototype.add=function(r){return this._map.set(r,r),this};r.prototype.delete=function(r){return this._map.delete(r)};r.prototype.clear=function(){this._map.clear()};r.prototype.keys=function(){return this._map.keys()};r.prototype.values=function(){return this._map.keys()};r.prototype.entries=function(){return this._map.entries()};r.prototype["@@iterator"]=function(){return this.keys()};r.prototype[a]=function(){return this.keys()};return r}();return r}function fr(){var r=16;var e=c.create();var n=i();return function(){function r(){this._key=i()}r.prototype.has=function(r){var e=a(r,false);return e!==undefined?c.has(e,this._key):false};r.prototype.get=function(r){var e=a(r,false);return e!==undefined?c.get(e,this._key):undefined};r.prototype.set=function(r,e){var t=a(r,true);t[this._key]=e;return this};r.prototype.delete=function(r){var e=a(r,false);return e!==undefined?delete e[this._key]:false};r.prototype.clear=function(){this._key=i()};return r}();function i(){var r;do{r="@@WeakMap@@"+s()}while(c.has(e,r));e[r]=true;return r}function a(r,e){if(!t.call(r,n)){if(!e)return undefined;Object.defineProperty(r,n,{value:c.create()})}return r[n]}function u(r,e){for(var t=0;t<e;++t)r[t]=Math.random()*255|0;return r}function o(r){if(typeof Uint8Array==="function"){var e=new Uint8Array(r);if(typeof crypto!=="undefined"){crypto.getRandomValues(e)}else if(typeof msCrypto!=="undefined"){msCrypto.getRandomValues(e)}else{u(e,r)}return e}return u(new Array(r),r)}function s(){var e=o(r);e[6]=e[6]&79|64;e[8]=e[8]&191|128;var t="";for(var n=0;n<r;++n){var i=e[n];if(n===4||n===6||n===8)t+="-";if(i<16)t+="0";t+=i.toString(16).toLowerCase()}return t}}function vr(r){r.__=undefined;delete r.__;return r}}))})(r||(r={}));return pe}me();var ye;(function(r){r[r["Transient"]=0]="Transient";r[r["Singleton"]=1]="Singleton";r[r["ResolutionScoped"]=2]="ResolutionScoped";r[r["ContainerScoped"]=3]="ContainerScoped"})(ye||(ye={}));var ge=ye;var be="injectionTokens";function _e(r){var e=Reflect.getMetadata("design:paramtypes",r)||[];var t=Reflect.getOwnMetadata(be,r)||{};Object.keys(t).forEach((function(r){e[+r]=t[r]}));return e} /*! ***************************************************************************** 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 ze(r,e,t,n){function i(r){return r instanceof t?r:new t((function(e){e(r)}))}return new(t||(t=Promise))((function(e,t){function a(r){try{o(n.next(r))}catch(r){t(r)}}function u(r){try{o(n["throw"](r))}catch(r){t(r)}}function o(r){r.done?e(r.value):i(r.value).then(a,u)}o((n=n.apply(r,[])).next())}))}function Ae(r){return!!r.useClass}function ke(r){return!!r.useFactory}var Ee=function(){function r(r){this.wrap=r;this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}r.prototype.createProxy=function(r){var e=this;var t={};var n=false;var i;var a=function(){if(!n){i=r(e.wrap());n=true}return i};return new Proxy(t,this.createHandler(a))};r.prototype.createHandler=function(r){var e={};var t=function(t){e[t]=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}e[0]=r();var i=Reflect[t];return i.apply(void 0,e)}};this.reflectMethods.forEach(t);return e};return r}();function Se(r){return typeof r==="string"||typeof r==="symbol"}function Ce(r){return typeof r==="object"&&"token"in r&&"multiple"in r}function Me(r){return typeof r==="object"&&"token"in r&&"transform"in r}function Oe(r){return typeof r==="function"||r instanceof Ee}function Pe(r){return!!r.useToken}function je(r){return r.useValue!=undefined}function xe(r){return Ae(r)||je(r)||Pe(r)||ke(r)}var He=function(){function r(){this._registryMap=new Map}r.prototype.entries=function(){return this._registryMap.entries()};r.prototype.getAll=function(r){this.ensure(r);return this._registryMap.get(r)};r.prototype.get=function(r){this.ensure(r);var e=this._registryMap.get(r);return e[e.length-1]||null};r.prototype.set=function(r,e){this.ensure(r);this._registryMap.get(r).push(e)};r.prototype.setAll=function(r,e){this._registryMap.set(r,e)};r.prototype.has=function(r){this.ensure(r);return this._registryMap.get(r).length>0};r.prototype.clear=function(){this._registryMap.clear()};r.prototype.ensure=function(r){if(!this._registryMap.has(r)){this._registryMap.set(r,[])}};return r}();var Te=function(r){__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(He);var Re=function(){function r(){this.scopedResolutions=new Map}return r}();function We(r,e){if(r===null){return"at position #".concat(e)}var t=r.split(",")[e].trim();return'"'.concat(t,'" at position #').concat(e)}function Ie(r,e,t){if(t===void 0){t=" "}return __spreadArray([r],e.message.split("\n").map((function(r){return t+r})),true).join("\n")}function Ne(r,e,t){var n=r.toString().match(/constructor\(([\w, ]+)\)/)||[],i=n[1],a=i===void 0?null:i;var u=We(a,e);return Ie("Cannot inject the dependency ".concat(u,' of "').concat(r.name,'" constructor. Reason:'),t)}function Ke(r){if(typeof r.dispose!=="function")return false;var e=r.dispose;if(e.length>0){return false}return true}var De=function(r){__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(He);var Ue=function(r){__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(He);var Ve=function(){function r(){this.preResolution=new De;this.postResolution=new Ue}return r}();var Be=new Map;var Fe=function(){function r(r){this.parent=r;this._registry=new Te;this.interceptors=new Ve;this.disposed=false;this.disposables=new Set}r.prototype.register=function(r,e,t){if(t===void 0){t={lifecycle:ge.Transient}}this.ensureNotDisposed();var n;if(!xe(e)){n={useClass:e}}else{n=e}if(Pe(n)){var i=[r];var a=n;while(a!=null){var u=a.useToken;if(i.includes(u)){throw new Error("Token registration cycle detected! ".concat(__spreadArray(__spreadArray([],i,true),[u],false).join(" -> ")))}i.push(u);var o=this._registry.get(u);if(o&&Pe(o.provider)){a=o.provider}else{a=null}}}if(t.lifecycle===ge.Singleton||t.lifecycle==ge.ContainerScoped||t.lifecycle==ge.ResolutionScoped){if(je(n)||ke(n)){throw new Error('Cannot use lifecycle "'.concat(ge[t.lifecycle],'" with ValueProviders or FactoryProviders'))}}this._registry.set(r,{provider:n,options:t});return this};r.prototype.registerType=function(r,e){this.ensureNotDisposed();if(Se(e)){return this.register(r,{useToken:e})}return this.register(r,{useClass:e})};r.prototype.registerInstance=function(r,e){this.ensureNotDisposed();return this.register(r,{useValue:e})};r.prototype.registerSingleton=function(r,e){this.ensureNotDisposed();if(Se(r)){if(Se(e)){return this.register(r,{useToken:e},{lifecycle:ge.Singleton})}else if(e){return this.register(r,{useClass:e},{lifecycle:ge.Singleton})}throw new Error('Cannot register a type name as a singleton without a "to" token')}var t=r;if(e&&!Se(e)){t=e}return this.register(r,{useClass:t},{lifecycle:ge.Singleton})};r.prototype.resolve=function(r,e,t){if(e===void 0){e=new Re}if(t===void 0){t=false}this.ensureNotDisposed();var n=this.getRegistration(r);if(!n&&Se(r)){if(t){return undefined}throw new Error('Attempted to resolve unregistered dependency token: "'.concat(r.toString(),'"'))}this.executePreResolutionInterceptor(r,"Single");if(n){var i=this.resolveRegistration(n,e);this.executePostResolutionInterceptor(r,i,"Single");return i}if(Oe(r)){var i=this.construct(r,e);this.executePostResolutionInterceptor(r,i,"Single");return i}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")};r.prototype.executePreResolutionInterceptor=function(r,e){if(this.interceptors.preResolution.has(r)){var t=[];for(var n=0,i=this.interceptors.preResolution.getAll(r);n<i.length;n++){var a=i[n];if(a.options.frequency!="Once"){t.push(a)}a.callback(r,e)}this.interceptors.preResolution.setAll(r,t)}};r.prototype.executePostResolutionInterceptor=function(r,e,t){if(this.interceptors.postResolution.has(r)){var n=[];for(var i=0,a=this.interceptors.postResolution.getAll(r);i<a.length;i++){var u=a[i];if(u.options.frequency!="Once"){n.push(u)}u.callback(r,e,t)}this.interceptors.postResolution.setAll(r,n)}};r.prototype.resolveRegistration=function(r,e){this.ensureNotDisposed();if(r.options.lifecycle===ge.ResolutionScoped&&e.scopedResolutions.has(r)){return e.scopedResolutions.get(r)}var t=r.options.lifecycle===ge.Singleton;var n=r.options.lifecycle===ge.ContainerScoped;var i=t||n;var a;if(je(r.provider)){a=r.provider.useValue}else if(Pe(r.provider)){a=i?r.instance||(r.instance=this.resolve(r.provider.useToken,e)):this.resolve(r.provider.useToken,e)}else if(Ae(r.provider)){a=i?r.instance||(r.instance=this.construct(r.provider.useClass,e)):this.construct(r.provider.useClass,e)}else if(ke(r.provider)){a=r.provider.useFactory(this)}else{a=this.construct(r.provider,e)}if(r.options.lifecycle===ge.ResolutionScoped){e.scopedResolutions.set(r,a)}return a};r.prototype.resolveAll=function(r,e,t){var n=this;if(e===void 0){e=new Re}if(t===void 0){t=false}this.ensureNotDisposed();var i=this.getAllRegistrations(r);if(!i&&Se(r)){if(t){return[]}throw new Error('Attempted to resolve unregistered dependency token: "'.concat(r.toString(),'"'))}this.executePreResolutionInterceptor(r,"All");if(i){var a=i.map((function(r){return n.resolveRegistration(r,e)}));this.executePostResolutionInterceptor(r,a,"All");return a}var u=[this.construct(r,e)];this.executePostResolutionInterceptor(r,u,"All");return u};r.prototype.isRegistered=function(r,e){if(e===void 0){e=false}this.ensureNotDisposed();return this._registry.has(r)||e&&(this.parent||false)&&this.parent.isRegistered(r,true)};r.prototype.reset=function(){this.ensureNotDisposed();this._registry.clear();this.interceptors.preResolution.clear();this.interceptors.postResolution.clear()};r.prototype.clearInstances=function(){this.ensureNotDisposed();for(var r=0,e=this._registry.entries();r<e.length;r++){var t=e[r],n=t[0],i=t[1];this._registry.setAll(n,i.filter((function(r){return!je(r.provider)})).map((function(r){r.instance=undefined;return r})))}};r.prototype.createChildContainer=function(){this.ensureNotDisposed();var e=new r(this);for(var t=0,n=this._registry.entries();t<n.length;t++){var i=n[t],a=i[0],u=i[1];if(u.some((function(r){var e=r.options;return e.lifecycle===ge.ContainerScoped}))){e._registry.setAll(a,u.map((function(r){if(r.options.lifecycle===ge.ContainerScoped){return{provider:r.provider,options:r.options}}return r})))}}return e};r.prototype.beforeResolution=function(r,e,t){if(t===void 0){t={frequency:"Always"}}this.interceptors.preResolution.set(r,{callback:e,options:t})};r.prototype.afterResolution=function(r,e,t){if(t===void 0){t={frequency:"Always"}}this.interceptors.postResolution.set(r,{callback:e,options:t})};r.prototype.dispose=function(){return ze(this,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:this.disposed=true;r=[];this.disposables.forEach((function(e){var t=e.dispose();if(t){r.push(t)}}));return[4,Promise.all(r)];case 1:e.sent();return[2]}}))}))};r.prototype.getRegistration=function(r){if(this.isRegistered(r)){return this._registry.get(r)}if(this.parent){return this.parent.getRegistration(r)}return null};r.prototype.getAllRegistrations=function(r){if(this.isRegistered(r)){return this._registry.getAll(r)}if(this.parent){return this.parent.getAllRegistrations(r)}return null};r.prototype.construct=function(r,e){var t=this;if(r instanceof Ee){return r.createProxy((function(r){return t.resolve(r,e)}))}var n=function(){var n=Be.get(r);if(!n||n.length===0){if(r.length===0){return new r}else{throw new Error('TypeInfo not known for "'.concat(r.name,'"'))}}var i=n.map(t.resolveParams(e,r));return new(r.bind.apply(r,__spreadArray([void 0],i,false)))}();if(Ke(n)){this.disposables.add(n)}return n};r.prototype.resolveParams=function(r,e){var t=this;return function(n,i){var a,u,o;try{if(Ce(n)){if(Me(n)){return n.multiple?(a=t.resolve(n.transform)).transform.apply(a,__spreadArray([t.resolveAll(n.token,new Re,n.isOptional)],n.transformArgs,false)):(u=t.resolve(n.transform)).transform.apply(u,__spreadArray([t.resolve(n.token,r,n.isOptional)],n.transformArgs,false))}else{return n.multiple?t.resolveAll(n.token,new Re,n.isOptional):t.resolve(n.token,r,n.isOptional)}}else if(Me(n)){return(o=t.resolve(n.transform,r)).transform.apply(o,__spreadArray([t.resolve(n.token,r)],n.transformArgs,false))}return t.resolve(n,r)}catch(r){throw new Error(Ne(e,i,r))}}};r.prototype.ensureNotDisposed=function(){if(this.disposed){throw new Error("This container has been disposed, you cannot interact with a disposed container")}};return r}();var Le=new Fe;function Ze(r){return function(r){Be.set(r,_e(r))}}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 Ge="crypto.algorithm";var qe=function(){function r(){}r.prototype.getAlgorithms=function(){return Le.resolveAll(Ge)};r.prototype.toAsnAlgorithm=function(r){for(var e=0,t=this.getAlgorithms();e<t.length;e++){var n=t[e];var i=n.toAsnAlgorithm(r);if(i){return i}}if(/^[0-9.]+$/.test(r.name)){var i=new w({algorithm:r.name});if("parameters"in r){var a=r;i.parameters=a.parameters}return i}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")};r.prototype.toWebAlgorithm=function(r){for(var e=0,t=this.getAlgorithms();e<t.length;e++){var n=t[e];var i=n.toWebAlgorithm(r);if(i){return i}}var a={name:r.algorithm,parameters:r.parameters};return a};return r}();var $e="crypto.algorithmProvider";Le.registerSingleton($e,qe);var Xe;var Qe="1.3.36.3.3.2.8.1.1";var Ye="".concat(Qe,".1");var Je="".concat(Qe,".2");var rt="".concat(Qe,".3");var et="".concat(Qe,".4");var tt="".concat(Qe,".5");var nt="".concat(Qe,".6");var it="".concat(Qe,".7");var at="".concat(Qe,".8");var ut="".concat(Qe,".9");var ot="".concat(Qe,".10");var st="".concat(Qe,".11");var ct="".concat(Qe,".12");var ft="".concat(Qe,".13");var vt="".concat(Qe,".14");var ht="brainpoolP160r1";var lt="brainpoolP160t1";var dt="brainpoolP192r1";var pt="brainpoolP192t1";var wt="brainpoolP224r1";var mt="brainpoolP224t1";var yt="brainpoolP256r1";var gt="brainpoolP256t1";var bt="brainpoolP320r1";var _t="brainpoolP320t1";var zt="brainpoolP384r1";var At="brainpoolP384t1";var kt="brainpoolP512r1";var Et="brainpoolP512t1";var St="ECDSA";var Ct=Xe=function(){function r(){}r.prototype.toAsnAlgorithm=function(r){switch(r.name.toLowerCase()){case St.toLowerCase():if("hash"in r){var e=typeof r.hash==="string"?r.hash:r.hash.name;switch(e.toLowerCase()){case"sha-1":return b;case"sha-256":return g;case"sha-384":return y;case"sha-512":return m}}else if("namedCurve"in r){var t="";switch(r.namedCurve){case"P-256":t=S;break;case"K-256":t=Xe.SECP256K1;break;case"P-384":t=E;break;case"P-521":t=k;break;case ht:t=Ye;break;case lt:t=Je;break;case dt:t=rt;break;case pt:t=et;break;case wt:t=tt;break;case mt:t=nt;break;case yt:t=it;break;case gt:t=at;break;case bt:t=ut;break;case _t:t=ot;break;case zt:t=st;break;case At:t=ct;break;case kt:t=ft;break;case Et:t=vt;break}if(t){return new w({algorithm:z,parameters:_.serialize(new A({namedCurve:t}))})}}}return null};r.prototype.toWebAlgorithm=function(r){switch(r.algorithm){case P:return{name:St,hash:{name:"SHA-1"}};case O:return{name:St,hash:{name:"SHA-256"}};case M:return{name:St,hash:{name:"SHA-384"}};case C:return{name:St,hash:{name:"SHA-512"}};case z:{if(!r.parameters){throw new TypeError("Cannot get required parameters from EC algorithm")}var e=_.parse(r.parameters,A);switch(e.namedCurve){case S:return{name:St,namedCurve:"P-256"};case Xe.SECP256K1:return{name:St,namedCurve:"K-256"};case E:return{name:St,namedCurve:"P-384"};case k:return{name:St,namedCurve:"P-521"};case Ye:return{name:St,namedCurve:ht};case Je:return{name:St,namedCurve:lt};case rt:return{name:St,namedCurve:dt};case et:return{name:St,namedCurve:pt};case tt:return{name:St,namedCurve:wt};case nt:return{name:St,namedCurve:mt};case it:return{name:St,namedCurve:yt};case at:return{name:St,namedCurve:gt};case ut:return{name:St,namedCurve:bt};case ot:return{name:St,namedCurve:_t};case st:return{name:St,namedCurve:zt};case ct:return{name:St,namedCurve:At};case ft:return{name:St,namedCurve:kt};case vt:return{name:St,namedCurve:Et}}}}return null};return r}();Ct.SECP256K1="1.3.132.0.10";Ct=Xe=n([Ze()],Ct);Le.registerSingleton(Ge,Ct);var Mt=Symbol("name");var Ot=Symbol("value");var Pt=function(){function r(r,e,t){if(e===void 0){e={}}if(t===void 0){t=""}this[Mt]=r;this[Ot]=t;for(var n in e){this[n]=e[n]}}return r}();Pt.NAME=Mt;Pt.VALUE=Ot;var jt=function(){function r(){}r.toTextObject=function(r){var e=new Pt("Algorithm Identifier",{},xt.toString(r.algorithm));if(r.parameters){switch(r.algorithm){case z:{var t=(new Ct).toWebAlgorithm(r);if(t&&"namedCurve"in t){e["Named Curve"]=t.namedCurve}else{e["Parameters"]=r.parameters}break}default:e["Parameters"]=r.parameters}}return e};return r}();var xt=function(){function r(){}r.toString=function(r){var e=this.items[r];if(e){return e}return r};return r}();xt.items=(qr={},qr[L]="sha1",qr[Dr]="sha224",qr[F]="sha256",qr[B]="sha384",qr[V]="sha512",qr[U]="rsaEncryption",qr[D]="sha1WithRSAEncryption",qr[Kr]="sha224WithRSAEncryption",qr[K]="sha256WithRSAEncryption",qr[N]="sha384WithRSAEncryption",qr[I]="sha512WithRSAEncryption",qr[z]="ecPublicKey",qr[P]="ecdsaWithSHA1",qr[Nr]="ecdsaWithSHA224",qr[O]="ecdsaWithSHA256",qr[M]="ecdsaWithSHA384",qr[C]="ecdsaWithSHA512",qr[Ir]="TLS WWW server authentication",qr[Wr]="TLS WWW client authentication",qr[Rr]="Code Signing",qr[Tr]="E-mail Protection",qr[Hr]="Time Stamping",qr[xr]="OCSP Signing",qr[Fr]="Signed Data",qr);var Ht=function(){function r(){}r.serialize=function(r){return this.serializeObj(r).join("\n")};r.pad=function(r){if(r===void 0){r=0}return"".padStart(2*r," ")};r.serializeObj=function(r,e){if(e===void 0){e=0}var t=[];var n=this.pad(e++);var i="";var a=r[Pt.VALUE];if(a){i=" ".concat(a)}t.push("".concat(n).concat(r[Pt.NAME],":").concat(i));n=this.pad(e);for(var u in r){if(typeof u==="symbol"){continue}var o=r[u];var s=u?"".concat(u,": "):"";if(typeof o==="string"||typeof o==="number"||typeof o==="boolean"){t.push("".concat(n).concat(s).concat(o))}else if(o instanceof Date){t.push("".concat(n).concat(s).concat(o.toUTCString()))}else if(Array.isArray(o)){for(var c=0,f=o;c<f.length;c++){var v=f[c];v[Pt.NAME]=u;t.push.apply(t,this.serializeObj(v,e))}}else if(o instanceof Pt){o[Pt.NAME]=u;t.push.apply(t,this.serializeObj(o,e))}else if(j.BufferSourceConverter.isBufferSource(o)){if(u){t.push("".concat(n).concat(s));t.push.apply(t,this.serializeBufferSource(o,e+1))}else{t.push.apply(t,this.serializeBufferSource(o,e))}}else if("toTextObject"in o){var h=o.toTextObject();h[Pt.NAME]=u;t.push.apply(t,this.serializeObj(h,e))}else{throw new TypeError("Cannot serialize data in text format. Unsupported type.")}}return t};r.serializeBufferSource=function(r,e){if(e===void 0){e=0}var t=this.pad(e);var n=j.BufferSourceConverter.toUint8Array(r);var i=[];for(var a=0;a<n.length;){var u=[];for(var o=0;o<16&&a<n.length;o++){if(o===8){u.push("")}var s=n[a++].toString(16).padStart(2,"0");u.push(s)}i.push("".concat(t).concat(u.join(" ")))}return i};r.serializeAlgorithm=function(r){return this.algorithmSerializer.toTextObject(r)};return r}();Ht.oidSerializer=xt;Ht.algorithmSerializer=jt;var Tt;var Rt=function(){function r(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}Tt.set(this,void 0);if(j.BufferSourceConverter.isBufferSource(r[0])){this.asn=_.parse(r[0],r[1]);Ar(this,Tt,j.BufferSourceConverter.toArrayBuffer(r[0]),"f");this.onInit(this.asn)}else{this.asn=r[0];this.onInit(this.asn)}}Object.defineProperty(r.prototype,"rawData",{get:function(){if(!zr(this,Tt,"f")){Ar(this,Tt,_.serialize(this.asn),"f")}return zr(this,Tt,"f")},enumerable:false,configurable:true});r.prototype.equal=function(e){if(e instanceof r){return j.isEqual(e.rawData,this.rawData)}return false};r.prototype.toString=function(r){if(r===void 0){r="text"}switch(r){case"asn":return _.toString(this.rawData);case"text":return Ht.serialize(this.toTextObject());case"hex":return j.Convert.ToHex(this.rawData);case"base64":return j.Convert.ToBase64(this.rawData);case"base64url":return j.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}};r.prototype.getTextName=function(){var r=this.constructor;return r.NAME};r.prototype.toTextObject=function(){var r=this.toTextObjectEmpty();r[""]=this.rawData;return r};r.prototype.toTextObjectEmpty=function(r){return new Pt(this.getTextName(),{},r)};return r}();Tt=new WeakMap;Rt.NAME="ASN";var Wt=function(r){__extends(e,r);function e(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var n;if(j.BufferSourceConverter.isBufferSource(e[0])){n=j.BufferSourceConverter.toArrayBuffer(e[0])}else{n=_.serialize(new vr({extnID:e[0],critical:e[1],extnValue:new lr(j.BufferSourceConverter.toArrayBuffer(e[2]))}))}return r.call(this,n,vr)||this}e.prototype.onInit=function(r){this.type=r.extnID;this.critical=r.critical;this.value=r.extnValue.buffer};e.prototype.toTextObject=function(){var r=this.toTextObjectWithoutValue();r[""]=this.value;return r};e.prototype.toTextObjectWithoutValue=function(){var r=this.toTextObjectEmpty(this.critical?"critical":undefined);if(r[Pt.NAME]===e.NAME){r[Pt.NAME]=xt.toString(this.type)}return r};return e}(Rt);var It;var Nt=function(){function r(){this.items=new Map;this[It]="CryptoProvider";if(typeof self!=="undefined"&&typeof crypto!=="undefined"){this.set(r.DEFAULT,crypto)}else if(typeof global!=="undefined"&&global.crypto&&global.crypto.subtle){this.set(r.DEFAULT,global.crypto)}}r.isCryptoKeyPair=function(r){return r&&r.privateKey&&r.publicKey};r.isCryptoKey=function(r){return r&&r.usages&&r.type&&r.algorithm&&r.extractable!==undefined};r.prototype.clear=function(){this.items.clear()};r.prototype.delete=function(r){return this.items.delete(r)};r.prototype.forEach=function(r,e){return this.items.forEach(r,e)};r.prototype.has=function(r){return this.items.has(r)};Object.defineProperty(r.prototype,"size",{get:function(){return this.items.size},enumerable:false,configurable:true});r.prototype.entries=function(){return this.items.entries()};r.prototype.keys=function(){return this.items.keys()};r.prototype.values=function(){return this.items.values()};r.prototype[Symbol.iterator]=function(){return this.items[Symbol.iterator]()};r.prototype.get=function(e){if(e===void 0){e=r.DEFAULT}var t=this.items.get(e.toLowerCase());if(!t){throw new Error("Cannot get Crypto by name '".concat(e,"'"))}return t};r.prototype.set=function(e,t){if(typeof e==="string"){if(!t){throw new TypeError("Argument 'value' is required")}this.items.set(e.toLowerCase(),t)}else{this.items.set(r.DEFAULT,e)}return this};return r}();It=Symbol.toStringTag;Nt.DEFAULT="default";var Kt=new Nt;var Dt=/^[0-2](?:\.[1-9][0-9]*)+$/;function Ut(r){return new RegExp(Dt).test(r)}var Vt=function(){function r(r){if(r===void 0){r={}}this.items={};for(var e in r){this.register(e,r[e])}}r.prototype.get=function(r){return this.items[r]||null};r.prototype.findId=function(r){if(!Ut(r)){return this.get(r)}return r};r.prototype.register=function(r,e){this.items[r]=e;this.items[e]=r};return r}();var Bt=new Vt;Bt.register("CN","2.5.4.3");Bt.register("L","2.5.4.7");Bt.register("ST","2.5.4.8");Bt.register("O","2.5.4.10");Bt.register("OU","2.5.4.11");Bt.register("C","2.5.4.6");Bt.register("DC","0.9.2342.19200300.100.1.25");Bt.register("E","1.2.840.113549.1.9.1");Bt.register("G","2.5.4.42");Bt.register("I","2.5.4.43");Bt.register("SN","2.5.4.4");Bt.register("T","2.5.4.12");function Ft(r,e){return"\\".concat(j.Convert.ToHex(j.Convert.FromUtf8String(e)).toUpperCase())}function Lt(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ft)}var Zt=function(){function r(r,e){if(e===void 0){e={}}this.extraNames=new Vt;this.asn=new yr;for(var t in e){if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this.extraNames.register(t,n)}}if(typeof r==="string"){this.asn=this.fromString(r)}else if(r instanceof yr){this.asn=r}else if(j.BufferSourceConverter.isBufferSource(r)){this.asn=_.parse(r,yr)}else{this.asn=this.fromJSON(r)}}r.isASCII=function(r){for(var e=0;e<r.length;e++){var t=r.charCodeAt(e);if(t>255){return false}}return true};r.isPrintableString=function(r){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(r)};r.prototype.getField=function(r){var e=this.extraNames.findId(r)||Bt.findId(r);var t=[];for(var n=0,i=this.asn;n<i.length;n++){var a=i[n];for(var u=0,o=a;u<o.length;u++){var s=o[u];if(s.type===e){t.push(s.value.toString())}}}return t};r.prototype.getName=function(r){return this.extraNames.get(r)||Bt.get(r)};r.prototype.toString=function(){var r=this;return this.asn.map((function(e){return e.map((function(e){var t=r.getName(e.type)||e.type;var n=e.value.anyValue?"#".concat(j.Convert.ToHex(e.value.anyValue)):Lt(e.value.toString());return"".concat(t,"=").concat(n)})).join("+")})).join(", ")};r.prototype.toJSON=function(){var r;var e=[];for(var t=0,n=this.asn;t<n.length;t++){var i=n[t];var a={};for(var u=0,o=i;u<o.length;u++){var s=o[u];var c=this.getName(s.type)||s.type;(r=a[c])!==null&&r!==void 0?r:a[c]=[];a[c].push(s.value.anyValue?"#".concat(j.Convert.ToHex(s.value.anyValue)):s.value.toString())}e.push(a)}return e};r.prototype.fromString=function(r){var e=new yr;var t=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;var n=null;var i=",";while(n=t.exec("".concat(r,","))){var a=n[1],u=n[2];var o=u[u.length-1];if(o===","||o==="+"){u=u.slice(0,u.length-1);n[3]=o}var s=n[3];a=this.getTypeOid(a);var c=this.createAttribute(a,u);if(i==="+"){e[e.length-1].push(c)}else{e.push(new kr([c]))}i=s}return e};r.prototype.fromJSON=function(r){var e=new yr;for(var t=0,n=r;t<n.length;t++){var i=n[t];var a=new kr;for(var u in i){var o=this.getTypeOid(u);var s=i[u];for(var c=0,f=s;c<f.length;c++){var v=f[c];var h=this.createAttribute(o,v);a.push(h)}}e.push(a)}return e};r.prototype.getTypeOid=function(r){if(!/[\d.]+/.test(r)){r=this.getName(r)||""}if(!r){throw new Error("Cannot get OID for name type '".concat(r,"'"))}return r};r.prototype.createAttribute=function(e,t){var n=new Er({type:e});if(typeof t==="object"){for(var i in t){switch(i){case"ia5String":n.value.ia5String=t[i];break;case"utf8String":n.value.utf8String=t[i];break;case"universalString":n.value.universalString=t[i];break;case"bmpString":n.value.bmpString=t[i];break;case"printableString":n.value.printableString=t[i];break}}}else if(t[0]==="#"){n.value.anyValue=j.Convert.FromHex(t.slice(1))}else{var a=this.processStringValue(t);if(e===this.getName("E")||e===this.getName("DC")){n.value.ia5String=a}else{if(r.isPrintableString(a)){n.value.printableString=a}else{n.value.utf8String=a}}}return n};r.prototype.processStringValue=function(r){var e=/"(.*?[^\\])?"/.exec(r);if(e){r=e[1]}return r.replace(/\\0a/gi,"\n").replace(/\\0d/gi,"\r").replace(/\\0g/gi,"\t").replace(/\\(.)/g,"$1")};r.prototype.toArrayBuffer=function(){return _.serialize(this.asn)};r.prototype.getThumbprint=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}return ze(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:n="SHA-1";if(r.length>=1&&!((e=r[0])===null||e===void 0?void 0:e.subtle)){n=r[0]||n;t=r[1]||Kt.get()}else{t=r[0]||Kt.get()}return[4,t.subtle.digest(n,this.toArrayBuffer())];case 1:return[2,i.sent()]}}))}))};return r}();r("N",Zt);var Gt="Cannot initialize GeneralName from ASN.1 data.";var qt="".concat(Gt," Unsupported string format in use.");var $t="".concat(Gt," Value doesn't match to GUID regular expression.");var Xt=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i;var Qt="1.3.6.1.4.1.311.25.1";var Yt="1.3.6.1.4.1.311.20.2.3";var Jt="dns";var rn="dn";var en="email";var tn="ip";var nn="url";var an="guid";var un="upn";var on="id";var sn=function(r){__extends(e,r);function e(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var n;if(e.length===2){switch(e[0]){case rn:{var i=new Zt(e[1]).toArrayBuffer();var a=_.parse(i,yr);n=new tr({directoryName:a});break}case Jt:n=new tr({dNSName:e[1]});break;case en:n=new tr({rfc822Name:e[1]});break;case an:{var u=new RegExp(Xt,"i").e